calmlens 0.37.1 → 0.38.1
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 +87 -17
- package/cjs/{BrowserUpload-84KQWr1Q.js → BrowserUpload-DS0lxg5C.js} +1 -1
- package/{esm/BrowserUpload-CuG3tWSo.d.ts → cjs/BrowserUpload-_iMX_nq0.d.ts} +2 -2
- package/{esm/CalmLensAppClient-QqtovWE-.d.ts → cjs/CalmLensAppClient-CQpnc4JZ.d.ts} +1 -1
- package/cjs/{CalmLensAppClient-D4tRb_P2.js → CalmLensAppClient-Diu1QtBz.js} +3 -3
- package/cjs/{CalmLensCdn-CdYY_XtK.js → CalmLensCdn-DCj0AfoS.js} +2 -2
- package/cjs/{CalmLensConnection-GkR2cKn5.js → CalmLensConnection-BpBq0nQR.js} +14 -4
- package/cjs/{CalmLensError-ifj5rLmk.js → CalmLensError-C9g7GXfU.js} +7 -2
- package/{esm/CalmLensServerClient-csSQqHBt.d.ts → cjs/CalmLensServerClient-CeTsE5Jx.d.ts} +5 -5
- package/cjs/{CalmLensServerClient-cgPOG4Sv.js → CalmLensServerClient-vdHfH0Nf.js} +15 -6
- package/cjs/{CalmLensTypes-_f7QVRtO.d.ts → CalmLensTypes-jond9q6a.d.ts} +28 -9
- package/cjs/{Core-BlnBBJKb.js → Core-BHQSo7rY.js} +3 -3
- package/{esm/Core-4iFxKJnY.d.ts → cjs/Core-C6_Q5ZME.d.ts} +2 -2
- package/cjs/{ReactUpload-D3AYIZBh.js → ReactUpload-bbHMmEUQ.js} +1 -1
- package/cjs/{ReactUpload-4qd2xACg.d.ts → ReactUpload-fy6zhY8M.d.ts} +1 -1
- package/cjs/{UploadController-BYuHuZ7K.js → UploadController-C1tiTTRR.js} +2 -2
- package/{esm/WebhookPayload-BJtggTLd.d.ts → cjs/WebhookPayload-DdpKjQGw.d.ts} +5 -3
- package/cjs/app.d.ts +4 -4
- package/cjs/app.js +3 -3
- package/cjs/elements.d.ts +4 -4
- package/cjs/elements.js +4 -4
- package/cjs/{index-IEA75nev.d.ts → index-CgAztQdX.d.ts} +2 -2
- package/cjs/index.d.ts +3 -3
- package/cjs/index.js +2 -2
- package/cjs/react-native.d.ts +2 -2
- package/cjs/react-native.js +4 -4
- package/cjs/react.d.ts +4 -4
- package/cjs/react.js +5 -5
- package/cjs/server.d.ts +4 -4
- package/cjs/server.js +3 -3
- package/cjs/{CalmLensTestInputArguments-C6S09FVQ.js → test-inputs-DJnupsBH.js} +231 -22
- package/{esm/TestTriggers-CjDhhz78.d.ts → cjs/test-inputs-fugEK0py.d.ts} +36 -142
- package/cjs/test-inputs.d.ts +2 -18
- package/cjs/test-inputs.js +17 -126
- package/cjs/testing.d.ts +11 -14
- package/cjs/testing.js +38 -68
- package/cjs/{ui-Cy8MWXOw.js → ui-2jJvTcCP.js} +2 -2
- package/cjs/{ui-BMQW3Hse.d.ts → ui-Cp18fGXG.d.ts} +2 -2
- package/cjs/ui.d.ts +2 -2
- package/cjs/ui.js +3 -3
- package/cjs/vue.d.ts +5 -5
- package/cjs/vue.js +4 -4
- package/esm/{BrowserUpload-C429CcUi.js → BrowserUpload-C4YF17a3.js} +1 -1
- package/{cjs/BrowserUpload-CuG3tWSo.d.ts → esm/BrowserUpload-_iMX_nq0.d.ts} +2 -2
- package/esm/{CalmLensAppClient-Brvc-GXt.js → CalmLensAppClient-B2H7x_SJ.js} +3 -3
- package/{cjs/CalmLensAppClient-QqtovWE-.d.ts → esm/CalmLensAppClient-CQpnc4JZ.d.ts} +1 -1
- package/esm/{CalmLensCdn-cmxtF_dw.js → CalmLensCdn-Dh546rXe.js} +2 -2
- package/esm/{CalmLensConnection-DEfpIugc.js → CalmLensConnection-BbFlVAdl.js} +14 -4
- package/esm/{CalmLensError-C15tWu8W.js → CalmLensError-DjkibkdI.js} +7 -2
- package/{cjs/CalmLensServerClient-csSQqHBt.d.ts → esm/CalmLensServerClient-CeTsE5Jx.d.ts} +5 -5
- package/esm/{CalmLensServerClient-BpsCXVeO.js → CalmLensServerClient-CqH-tqcC.js} +15 -6
- package/esm/{CalmLensTypes-_f7QVRtO.d.ts → CalmLensTypes-jond9q6a.d.ts} +28 -9
- package/{cjs/Core-4iFxKJnY.d.ts → esm/Core-C6_Q5ZME.d.ts} +2 -2
- package/esm/{Core-C_f1o9RQ.js → Core-VNBTpvrG.js} +3 -3
- package/esm/{ReactUpload-Ch5qY7PS.js → ReactUpload-CRH6rSaX.js} +1 -1
- package/esm/{ReactUpload-4qd2xACg.d.ts → ReactUpload-fy6zhY8M.d.ts} +1 -1
- package/esm/{UploadController-9fkYFVZM.js → UploadController-BYxiONcw.js} +2 -2
- package/{cjs/WebhookPayload-BJtggTLd.d.ts → esm/WebhookPayload-DdpKjQGw.d.ts} +5 -3
- package/esm/app.d.ts +4 -4
- package/esm/app.js +3 -3
- package/esm/elements.d.ts +4 -4
- package/esm/elements.js +4 -4
- package/esm/{index-IEA75nev.d.ts → index-CgAztQdX.d.ts} +2 -2
- package/esm/index.d.ts +3 -3
- package/esm/index.js +2 -2
- package/esm/react-native.d.ts +2 -2
- package/esm/react-native.js +4 -4
- package/esm/react.d.ts +4 -4
- package/esm/react.js +5 -5
- package/esm/server.d.ts +4 -4
- package/esm/server.js +3 -3
- package/esm/{CalmLensTestInputArguments-DS_3mt1C.js → test-inputs-BLlkOmNC.js} +212 -15
- package/{cjs/TestTriggers-CjDhhz78.d.ts → esm/test-inputs-fugEK0py.d.ts} +36 -142
- package/esm/test-inputs.d.ts +2 -18
- package/esm/test-inputs.js +1 -115
- package/esm/testing.d.ts +11 -14
- package/esm/testing.js +27 -57
- package/esm/{ui-BMQW3Hse.d.ts → ui-Cp18fGXG.d.ts} +2 -2
- package/esm/{ui-HK74e42L.js → ui-siBYiNJZ.js} +2 -2
- package/esm/ui.d.ts +2 -2
- package/esm/ui.js +3 -3
- package/esm/vue.d.ts +5 -5
- package/esm/vue.js +4 -4
- package/package.json +1 -1
package/cjs/elements.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { i as AssetAvailability } from "./CalmLensTypes-
|
|
2
|
-
import { $ as MediaPlayback, A as CustomUploadContext, B as isFileAccepted, C as formatMessage, D as resolveMessages, E as getUploadItemOutcome, F as UploadFile, G as AssetImageSource, H as AssetDisplay, J as AssetSessionState, K as AssetOptions, M as UploadClient, N as UploadController, O as CalmLensProvidedOptions, Q as INSTANT_LOAD_MS, R as UploadStage, S as formatBytes, T as getUploadItemMessage, U as AssetDocumentOptions, V as withProvidedOptions, W as AssetImageOptions, X as AssetVideoOptions, Y as AssetSpreadsheetOptions, Z as AssetView, _ as DEFAULT_MESSAGES, _t as DEFAULT_VIEWER_MESSAGES, a as ProgressFetchOptions, at as isImageReady, b as describeUploadItem, bt as resolveViewerMessages, c as ICON_ATTRIBUTES, ct as DocumentViewerOptions, d as AssetDisplayOptions, dt as TextViewerOptions, et as getAssetAspectRatio, f as AssetEventHandlers, ft as ViewerAsset, g as CalmLensMessages, gt as isSpreadsheetFormat, ht as getAssetViewerKind, i as CALMLENS_STYLES, it as getPlayedPercent, j as CustomUploadResult, l as IconName, lt as PdfAssetOptions, m as UploaderDisplayOptions, mt as ViewerTextOptions, n as CalmLensTheme, nt as getAssetViewKey, o as createProgressFetch, ot as pickAssetSource, p as AssetProps, pt as ViewerOptions, q as AssetSession, r as resolveTheme, rt as getPeakHeights, s as ICONS, st as AssetViewerKind, t as CALMLENS_THEME, tt as getAssetView, u as ASSET_FILE_ICON_SIZE, ut as SpreadsheetViewerOptions, v as UploadItemView, vt as ViewerMessages, w as getDropzoneHint, x as describeUploader, y as UploaderView, yt as formatViewerMessage } from "./Core-
|
|
3
|
-
import { a as UploaderProps, i as UploadSnapshot, n as UploadControllerOptions, r as UploadItem, s as createUploadController, t as CalmLensUpload } from "./BrowserUpload-
|
|
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-
|
|
1
|
+
import { i as AssetAvailability } from "./CalmLensTypes-jond9q6a.js";
|
|
2
|
+
import { $ as MediaPlayback, A as CustomUploadContext, B as isFileAccepted, C as formatMessage, D as resolveMessages, E as getUploadItemOutcome, F as UploadFile, G as AssetImageSource, H as AssetDisplay, J as AssetSessionState, K as AssetOptions, M as UploadClient, N as UploadController, O as CalmLensProvidedOptions, Q as INSTANT_LOAD_MS, R as UploadStage, S as formatBytes, T as getUploadItemMessage, U as AssetDocumentOptions, V as withProvidedOptions, W as AssetImageOptions, X as AssetVideoOptions, Y as AssetSpreadsheetOptions, Z as AssetView, _ as DEFAULT_MESSAGES, _t as DEFAULT_VIEWER_MESSAGES, a as ProgressFetchOptions, at as isImageReady, b as describeUploadItem, bt as resolveViewerMessages, c as ICON_ATTRIBUTES, ct as DocumentViewerOptions, d as AssetDisplayOptions, dt as TextViewerOptions, et as getAssetAspectRatio, f as AssetEventHandlers, ft as ViewerAsset, g as CalmLensMessages, gt as isSpreadsheetFormat, ht as getAssetViewerKind, i as CALMLENS_STYLES, it as getPlayedPercent, j as CustomUploadResult, l as IconName, lt as PdfAssetOptions, m as UploaderDisplayOptions, mt as ViewerTextOptions, n as CalmLensTheme, nt as getAssetViewKey, o as createProgressFetch, ot as pickAssetSource, p as AssetProps, pt as ViewerOptions, q as AssetSession, r as resolveTheme, rt as getPeakHeights, s as ICONS, st as AssetViewerKind, t as CALMLENS_THEME, tt as getAssetView, u as ASSET_FILE_ICON_SIZE, ut as SpreadsheetViewerOptions, v as UploadItemView, vt as ViewerMessages, w as getDropzoneHint, x as describeUploader, y as UploaderView, yt as formatViewerMessage } from "./Core-C6_Q5ZME.js";
|
|
3
|
+
import { a as UploaderProps, i as UploadSnapshot, n as UploadControllerOptions, r as UploadItem, s as createUploadController, t as CalmLensUpload } from "./BrowserUpload-_iMX_nq0.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-Cp18fGXG.js";
|
|
5
5
|
declare const BaseElement$1: typeof HTMLElement;
|
|
6
6
|
/**
|
|
7
7
|
* An asset viewer element. Set the `src` attribute to the asset URL (public or signed) and the
|
package/cjs/elements.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_ui = require("./ui-
|
|
3
|
-
const require_Core = require("./Core-
|
|
4
|
-
const require_UploadController = require("./UploadController-
|
|
2
|
+
const require_ui = require("./ui-2jJvTcCP.js");
|
|
3
|
+
const require_Core = require("./Core-BHQSo7rY.js");
|
|
4
|
+
const require_UploadController = require("./UploadController-C1tiTTRR.js");
|
|
5
5
|
const require_FileIcons = require("./FileIcons-Ob003MdS.js");
|
|
6
|
-
const require_BrowserUpload = require("./BrowserUpload-
|
|
6
|
+
const require_BrowserUpload = require("./BrowserUpload-DS0lxg5C.js");
|
|
7
7
|
// src/viewers/Elements.ts
|
|
8
8
|
const BaseElement$1 = typeof HTMLElement === "undefined" ? class {} : HTMLElement;
|
|
9
9
|
const PROPERTIES = [
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "./Classification-C3pkrGYS-B7EygpJn.js";
|
|
2
|
-
import { Hn as AssetInfo, N as CdnResource, at as GetAssetInfoOptions } from "./CalmLensTypes-
|
|
3
|
-
import "./WebhookPayload-
|
|
2
|
+
import { Hn as AssetInfo, N as CdnResource, at as GetAssetInfoOptions } from "./CalmLensTypes-jond9q6a.js";
|
|
3
|
+
import "./WebhookPayload-DdpKjQGw.js";
|
|
4
4
|
/** Every CDN resource beneath an asset URL, as `getAssetUrl` and `signAssetUrl` accept them. */
|
|
5
5
|
declare const CDN_RESOURCES: CdnResource[];
|
|
6
6
|
/**
|
package/cjs/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as ClassificationQualifierResults, c as HashList, d as ModerationContext, i as ClassificationNotEvaluatedReason, l as HashListEntry, n as ClassificationCategory, o as Likelihood, r as ClassificationCategoryReport, s as ModerationQualifier, t as ClassificationCategories, u as PolicyAction } from "./Classification-C3pkrGYS-B7EygpJn.js";
|
|
2
|
-
import { $ as EventFactValues, $n as ProcessingOptions, $t as UpdateFolderOptions, A as CdnAssetLocation, An as LensType, At as PolicyIdOptions, B as CreateHashListOptions, Bn as AssetSearchQuery, Bt as RetrieveAssetByExternalIdOptions, C as AssetUploadStatus, Cn as DetectedFace, Ct as ListPoliciesOptions, D as BatchAssetsResponse, Dn as ProcessingFeatureStage, Dt as MultipartUploadOptions, E as BatchAssetsOptions, En as ProcessingFeatureResults, Et as MoveFolderOptions, F as CdnTransform, Fn as EventResourceKind, Ft as RemoveAssetContentOptions, G as DeleteAssetOptions, Gn as AssetPreview, Gt as SignAssetUrlOptions, H as CreateMultipartUploadPartOptions, Hn as AssetInfo, Ht as RetryAssetOptions, I as ClassifyTextOptions, In as EventSeverity, It as RequestAssetReviewOptions, J as EnsureLensesOptions, Jn as AssetSafetyHold, Jt as SignedUploadToken, K as DeleteMetadataFieldOptions, Kn as AssetRendered, Kt as SignUploadTokenOptions, L as ClientRequestDefaults, Lt as RequestAttempt, M as CdnAssetUrlOptions, Mn as EventResource, Mt as PolicySettings, N as CdnResource, Nt as ProjectSettingsResource, O as CalmLensAppClientOptions, On as ProcessingFeatures, Ot as MultipartUploadPartOptions, P as CdnServeOptions, Pn as EventCategory, Pt as PublicProjectSettings, Q as EventFact, Qn as MetadataItem, Qt as UpdateAssetOptions, R as ConnectionOptions, Rn as Folder, Rt as RequestOptions, S as AssetUpload, Sn as BoundingBox, St as ListLensesOptions, T as AssignPolicyOptions, Tn as ProcessingFeatureId, Tt as MoveAssetOptions, U as CreatePolicyOptions, Un as AssetHls, Ut as SearchAssetsOptions, V as CreateLensOptions, Vt as RetrieveAssetOptions, W as DecideAssetOptions, Wn as AssetHlsRendition, Wt as SetPolicyAutomaticUpdatesOptions, X as EnsureUploadPresetsOptions, Xn as ExtractedText, Xt as SubmitAssetOptions, Y as EnsureMetadataFieldsOptions, Yn as AssetSafetyHoldReason, Yt as StreamingFeatureOptions, Z as EnsureUploadPresetsResponse, Zn as FileMetadata, Zt as TypedEvent, _ as AssetPage, _n as AssetReviewRequest, _t as ListAssetsOptions, a as AssetChecksums, an as UploadAssetPartOptions, at as GetAssetInfoOptions, b as AssetTimelinePage, bn as UploadPreset, bt as ListHashListEntriesOptions, c as AssetClassificationFailureReason, cn as UploadPresetPage, ct as HashListIdOptions, d as AssetContentOptions, dn as VerifyWebhookSignatureOptions, dt as ImageTransformOptions, en as UpdateHashListOptions, et as EventFacts, f as AssetContentRemovalReason, fn as ViewerClaims, ft as Lens, g as AssetModerationStatus, gn as AssetBatchOperation, gt as ListAssetTimelineOptions, h as AssetModerationDecision, hn as WebhookPayloadInput, ht as ListAssetChildrenOptions, i as AssetAvailability, in as UpgradePolicyOptions, it as FolderPage, j as CdnAssetReference, jt as PolicyPage, k as CalmLensServerClientOptions, kn as CursorPage, kt as Policy, l as AssetClassificationStatus, ln as UploadPresetSubmitAssetOptions, lt as HashListPage, m as AssetModeration, mn as WebhookHeadersInput, mt as LensPage, n as AppInfo, nn as UpdatePolicyOptions, nt as EventsPage, o as AssetChildrenPage, on as UploadPresetDefinition, ot as HashListEntryIdOptions, p as AssetContentStatus, pn as WaitForAssetDecisionOptions, pt as LensIdOptions, q as EnsureLensOptions, qn as AssetRenderedKind, qt as SignedAssetUrl, r as Asset, rn as UpdateProjectSettingsOptions, rt as FolderIdOptions, s as AssetClassification, sn as UploadPresetIdOptions, st as HashListEntryPage, t as AddHashListEntryOptions, tn as UpdateLensOptions, tt as EventType, u as AssetContent, un as UploadedAsset, ut as IdempotencyOptions, v as AssetSearchResponse, vn as AssetTimelineSegment, vt as ListEventsOptions, w as AssetVisibility, wn as DetectedPerson, wt as ListUploadPresetsOptions, x as AssetType, xn as AgeRange, xt as ListHashListsOptions, y as AssetSearchResult, yn as MetadataFieldsResource, yt as ListFoldersOptions, z as CreateFolderOptions, zn as AssetSearchMatchField, zt as ResetPolicyOptions } from "./CalmLensTypes-
|
|
3
|
-
import { a as getAssetInfo, i as CDN_RESOURCES, n as SDK_VERSION, r as DEFAULT_CDN_BASE_URL, t as ModerationContextItem } from "./index-
|
|
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-
|
|
2
|
+
import { $ as EventFactValues, $n as ProcessingOptions, $t as UpdateFolderOptions, A as CdnAssetLocation, An as LensType, At as PolicyIdOptions, B as CreateHashListOptions, Bn as AssetSearchQuery, Bt as RetrieveAssetByExternalIdOptions, C as AssetUploadStatus, Cn as DetectedFace, Ct as ListPoliciesOptions, D as BatchAssetsResponse, Dn as ProcessingFeatureStage, Dt as MultipartUploadOptions, E as BatchAssetsOptions, En as ProcessingFeatureResults, Et as MoveFolderOptions, F as CdnTransform, Fn as EventResourceKind, Ft as RemoveAssetContentOptions, G as DeleteAssetOptions, Gn as AssetPreview, Gt as SignAssetUrlOptions, H as CreateMultipartUploadPartOptions, Hn as AssetInfo, Ht as RetryAssetOptions, I as ClassifyTextOptions, In as EventSeverity, It as RequestAssetReviewOptions, J as EnsureLensesOptions, Jn as AssetSafetyHold, Jt as SignedUploadToken, K as DeleteMetadataFieldOptions, Kn as AssetRendered, Kt as SignUploadTokenOptions, L as ClientRequestDefaults, Lt as RequestAttempt, M as CdnAssetUrlOptions, Mn as EventResource, Mt as PolicySettings, N as CdnResource, Nt as ProjectSettingsResource, O as CalmLensAppClientOptions, On as ProcessingFeatures, Ot as MultipartUploadPartOptions, P as CdnServeOptions, Pn as EventCategory, Pt as PublicProjectSettings, Q as EventFact, Qn as MetadataItem, Qt as UpdateAssetOptions, R as ConnectionOptions, Rn as Folder, Rt as RequestOptions, S as AssetUpload, Sn as BoundingBox, St as ListLensesOptions, T as AssignPolicyOptions, Tn as ProcessingFeatureId, Tt as MoveAssetOptions, U as CreatePolicyOptions, Un as AssetHls, Ut as SearchAssetsOptions, V as CreateLensOptions, Vt as RetrieveAssetOptions, W as DecideAssetOptions, Wn as AssetHlsRendition, Wt as SetPolicyAutomaticUpdatesOptions, X as EnsureUploadPresetsOptions, Xn as ExtractedText, Xt as SubmitAssetOptions, Y as EnsureMetadataFieldsOptions, Yn as AssetSafetyHoldReason, Yt as StreamingFeatureOptions, Z as EnsureUploadPresetsResponse, Zn as FileMetadata, Zt as TypedEvent, _ as AssetPage, _n as AssetReviewRequest, _t as ListAssetsOptions, a as AssetChecksums, an as UploadAssetPartOptions, at as GetAssetInfoOptions, b as AssetTimelinePage, bn as UploadPreset, bt as ListHashListEntriesOptions, c as AssetClassificationFailureReason, cn as UploadPresetPage, ct as HashListIdOptions, d as AssetContentOptions, dn as VerifyWebhookSignatureOptions, dt as ImageTransformOptions, en as UpdateHashListOptions, et as EventFacts, f as AssetContentRemovalReason, fn as ViewerClaims, ft as Lens, g as AssetModerationStatus, gn as AssetBatchOperation, gt as ListAssetTimelineOptions, h as AssetModerationDecision, hn as WebhookPayloadInput, ht as ListAssetChildrenOptions, i as AssetAvailability, in as UpgradePolicyOptions, it as FolderPage, j as CdnAssetReference, jt as PolicyPage, k as CalmLensServerClientOptions, kn as CursorPage, kt as Policy, l as AssetClassificationStatus, ln as UploadPresetSubmitAssetOptions, lt as HashListPage, m as AssetModeration, mn as WebhookHeadersInput, mt as LensPage, n as AppInfo, nn as UpdatePolicyOptions, nt as EventsPage, o as AssetChildrenPage, on as UploadPresetDefinition, ot as HashListEntryIdOptions, p as AssetContentStatus, pn as WaitForAssetDecisionOptions, pt as LensIdOptions, q as EnsureLensOptions, qn as AssetRenderedKind, qt as SignedAssetUrl, r as Asset, rn as UpdateProjectSettingsOptions, rt as FolderIdOptions, s as AssetClassification, sn as UploadPresetIdOptions, st as HashListEntryPage, t as AddHashListEntryOptions, tn as UpdateLensOptions, tt as EventType, u as AssetContent, un as UploadedAsset, ut as IdempotencyOptions, v as AssetSearchResponse, vn as AssetTimelineSegment, vt as ListEventsOptions, w as AssetVisibility, wn as DetectedPerson, wt as ListUploadPresetsOptions, x as AssetType, xn as AgeRange, xt as ListHashListsOptions, y as AssetSearchResult, yn as MetadataFieldsResource, yt as ListFoldersOptions, z as CreateFolderOptions, zn as AssetSearchMatchField, zt as ResetPolicyOptions } from "./CalmLensTypes-jond9q6a.js";
|
|
3
|
+
import { a as getAssetInfo, i as CDN_RESOURCES, n as SDK_VERSION, r as DEFAULT_CDN_BASE_URL, t as ModerationContextItem } from "./index-CgAztQdX.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-DdpKjQGw.js";
|
|
5
5
|
export { AUTO_PAGING_TO_ARRAY_MAX, type AddHashListEntryOptions, type AgeRange, type ApiErrorCode, type AppInfo, type Asset, type AssetAvailability, type AssetBatchOperation, type AssetChecksums, type AssetChildrenPage, type AssetClassification, type AssetClassificationFailureReason, type AssetClassificationStatus, type AssetContent, type AssetContentOptions, type AssetContentRemovalReason, type AssetContentStatus, type AssetHls, type AssetHlsRendition, type AssetInfo, type AssetModeration, type AssetModerationDecision, type AssetModerationStatus, type AssetPage, type AssetPreview, type AssetRendered, type AssetRenderedKind, type AssetReviewRequest, type AssetSafetyHold, type AssetSafetyHoldReason, type AssetSearchMatchField, type AssetSearchQuery, type AssetSearchResponse, type AssetSearchResult, type AssetTimelinePage, type AssetTimelineSegment, type AssetType, type AssetUpload, type AssetUploadStatus, type AssetVisibility, type AssignPolicyOptions, type AutoPaging, type AutoPagingToArrayOptions, type BatchAssetsOptions, type BatchAssetsResponse, type BoundingBox, CALMLENS_ERROR_CODES, CDN_RESOURCES, CalmLensApiError, type CalmLensAppClientOptions, CalmLensAuthenticationError, CalmLensBadRequestError, CalmLensCancelledError, CalmLensConfigurationError, CalmLensConflictError, CalmLensConnectionError, CalmLensError, type CalmLensErrorCode, type CalmLensErrorDetails, type CalmLensErrorKind, type CalmLensErrorOptions, CalmLensInvalidArgumentError, CalmLensInvalidResponseError, type CalmLensLastResponse, CalmLensNotFoundError, CalmLensPayloadTooLargeError, CalmLensPermissionDeniedError, CalmLensRateLimitError, type CalmLensResponse, type CalmLensServerClientOptions, CalmLensServerError, CalmLensTimeoutError, CalmLensUnprocessableEntityError, CalmLensWebhookVerificationError, type CdnAssetLocation, type CdnAssetReference, type CdnAssetUrlOptions, type CdnResource, type CdnResponse, type CdnServeOptions, type CdnTransform, type ClassificationCategories, type ClassificationCategory, type ClassificationCategoryReport, type ClassificationNotEvaluatedReason, type ClassificationQualifierResults, type ClassifyTextOptions, type ClientRequestDefaults, type ConnectionOptions, type CreateFolderOptions, type CreateHashListOptions, type CreateLensOptions, type CreateMultipartUploadPartOptions, type CreatePolicyOptions, type CursorPage, DEFAULT_CDN_BASE_URL, type DecideAssetOptions, type DeleteAssetOptions, type DeleteMetadataFieldOptions, type DetectedFace, type DetectedPerson, type EnsureLensOptions, type EnsureLensesOptions, type EnsureMetadataFieldsOptions, type EnsureUploadPresetsOptions, type EnsureUploadPresetsResponse, type EventCategory, type EventFact, type EventFactValues, type EventFacts, type EventResource, type EventResourceKind, type EventSeverity, type EventType, type EventsPage, type ExtractedText, type FileMetadata, type Folder, type FolderIdOptions, type FolderPage, type GetAssetInfoOptions, type HashList, type HashListEntry, type HashListEntryIdOptions, type HashListEntryPage, type HashListIdOptions, type HashListPage, type IdempotencyOptions, type ImageTransformOptions, type Lens, type LensIdOptions, type LensPage, type LensType, type Likelihood, type ListAssetChildrenOptions, type ListAssetTimelineOptions, type ListAssetsOptions, type ListEventsOptions, type ListFoldersOptions, type ListHashListEntriesOptions, type ListHashListsOptions, type ListLensesOptions, type ListPage, type ListPoliciesOptions, type ListPromise, type ListUploadPresetsOptions, type MetadataFieldsResource, type MetadataItem, type ModerationContext, type ModerationContextItem, type ModerationQualifier, type MoveAssetOptions, type MoveFolderOptions, type MultipartUploadOptions, type MultipartUploadPartOptions, type Policy, type PolicyAction, type PolicyIdOptions, type PolicyPage, type PolicySettings, type ProcessingFeatureId, type ProcessingFeatureResults, type ProcessingFeatureStage, type ProcessingFeatures, type ProcessingOptions, type ProjectSettingsResource, type PublicProjectSettings, type RemoveAssetContentOptions, type RequestAssetReviewOptions, type RequestAttempt, type RequestOptions, type ResetPolicyOptions, type RetrieveAssetByExternalIdOptions, type RetrieveAssetOptions, type RetryAssetOptions, SDK_VERSION, type SdkErrorCode, type SearchAssetsOptions, type ServedAssetInfo, type SetPolicyAutomaticUpdatesOptions, type SignAssetUrlOptions, type SignUploadTokenOptions, type SignedAssetUrl, type SignedUploadToken, type StreamingFeatureOptions, type SubmitAssetOptions, type TypedEvent, type UpdateAssetOptions, type UpdateFolderOptions, type UpdateHashListOptions, type UpdateLensOptions, type UpdatePolicyOptions, type UpdateProjectSettingsOptions, type UpgradePolicyOptions, type UploadAssetPartOptions, type UploadPreset, type UploadPresetDefinition, type UploadPresetIdOptions, type UploadPresetPage, type UploadPresetSubmitAssetOptions, type UploadedAsset, type VerifyWebhookSignatureOptions, type ViewerClaims, type WaitForAssetDecisionOptions, type ReceivedWebhookEventPayload as WebhookEventPayload, type WebhookHeadersInput, type WebhookPayloadInput, getAssetInfo };
|
package/cjs/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_CalmLensError = require("./CalmLensError-
|
|
3
|
-
const require_CalmLensCdn = require("./CalmLensCdn-
|
|
2
|
+
const require_CalmLensError = require("./CalmLensError-C9g7GXfU.js");
|
|
3
|
+
const require_CalmLensCdn = require("./CalmLensCdn-DCj0AfoS.js");
|
|
4
4
|
exports.AUTO_PAGING_TO_ARRAY_MAX = require_CalmLensCdn.AUTO_PAGING_TO_ARRAY_MAX;
|
|
5
5
|
exports.CALMLENS_ERROR_CODES = require_CalmLensError.CALMLENS_ERROR_CODES;
|
|
6
6
|
exports.CDN_RESOURCES = require_CalmLensCdn.CDN_RESOURCES;
|
package/cjs/react-native.d.ts
CHANGED
|
@@ -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-
|
|
2
|
-
import { i as useCalmLensUpload, n as CalmLensProviderProps, r as UseCalmLensUploadResult, t as CalmLensProvider } from "./ReactUpload-
|
|
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-C6_Q5ZME.js";
|
|
2
|
+
import { i as useCalmLensUpload, n as CalmLensProviderProps, r as UseCalmLensUploadResult, t as CalmLensProvider } from "./ReactUpload-fy6zhY8M.js";
|
|
3
3
|
import { ReactNode } from "react";
|
|
4
4
|
import { StyleProp, ViewStyle } from "react-native";
|
|
5
5
|
/** What the uploader asks your picker for. */
|
package/cjs/react-native.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_CalmLensCdn = require("./CalmLensCdn-
|
|
3
|
-
const require_Core = require("./Core-
|
|
4
|
-
const require_UploadController = require("./UploadController-
|
|
2
|
+
const require_CalmLensCdn = require("./CalmLensCdn-DCj0AfoS.js");
|
|
3
|
+
const require_Core = require("./Core-BHQSo7rY.js");
|
|
4
|
+
const require_UploadController = require("./UploadController-C1tiTTRR.js");
|
|
5
5
|
const require_FileIcons = require("./FileIcons-Ob003MdS.js");
|
|
6
|
-
const require_ReactUpload = require("./ReactUpload-
|
|
6
|
+
const require_ReactUpload = require("./ReactUpload-bbHMmEUQ.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");
|
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-
|
|
2
|
-
import { n as CalmLensProviderProps, t as CalmLensProvider } from "./ReactUpload-
|
|
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-
|
|
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-
|
|
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-C6_Q5ZME.js";
|
|
2
|
+
import { n as CalmLensProviderProps, t as CalmLensProvider } from "./ReactUpload-fy6zhY8M.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-_iMX_nq0.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-Cp18fGXG.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-
|
|
4
|
-
const require_Core = require("./Core-
|
|
5
|
-
const require_UploadController = require("./UploadController-
|
|
3
|
+
const require_ui = require("./ui-2jJvTcCP.js");
|
|
4
|
+
const require_Core = require("./Core-BHQSo7rY.js");
|
|
5
|
+
const require_UploadController = require("./UploadController-C1tiTTRR.js");
|
|
6
6
|
const require_FileIcons = require("./FileIcons-Ob003MdS.js");
|
|
7
|
-
const require_ReactUpload = require("./ReactUpload-
|
|
8
|
-
const require_BrowserUpload = require("./BrowserUpload-
|
|
7
|
+
const require_ReactUpload = require("./ReactUpload-bbHMmEUQ.js");
|
|
8
|
+
const require_BrowserUpload = require("./BrowserUpload-DS0lxg5C.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 ClassificationQualifierResults, c as HashList, d as ModerationContext, i as ClassificationNotEvaluatedReason, l as HashListEntry, n as ClassificationCategory, o as Likelihood, r as ClassificationCategoryReport, s as ModerationQualifier, t as ClassificationCategories, u as PolicyAction } from "./Classification-C3pkrGYS-B7EygpJn.js";
|
|
2
|
-
import { $ as EventFactValues, $n as ProcessingOptions, $t as UpdateFolderOptions, A as CdnAssetLocation, An as LensType, At as PolicyIdOptions, B as CreateHashListOptions, Bn as AssetSearchQuery, Bt as RetrieveAssetByExternalIdOptions, C as AssetUploadStatus, Cn as DetectedFace, Ct as ListPoliciesOptions, D as BatchAssetsResponse, Dn as ProcessingFeatureStage, Dt as MultipartUploadOptions, E as BatchAssetsOptions, En as ProcessingFeatureResults, Et as MoveFolderOptions, F as CdnTransform, Fn as EventResourceKind, Ft as RemoveAssetContentOptions, G as DeleteAssetOptions, Gn as AssetPreview, Gt as SignAssetUrlOptions, H as CreateMultipartUploadPartOptions, Hn as AssetInfo, Ht as RetryAssetOptions, I as ClassifyTextOptions, In as EventSeverity, It as RequestAssetReviewOptions, J as EnsureLensesOptions, Jn as AssetSafetyHold, Jt as SignedUploadToken, K as DeleteMetadataFieldOptions, Kn as AssetRendered, Kt as SignUploadTokenOptions, L as ClientRequestDefaults, Lt as RequestAttempt, M as CdnAssetUrlOptions, Mn as EventResource, Mt as PolicySettings, N as CdnResource, Nt as ProjectSettingsResource, O as CalmLensAppClientOptions, On as ProcessingFeatures, Ot as MultipartUploadPartOptions, P as CdnServeOptions, Pn as EventCategory, Pt as PublicProjectSettings, Q as EventFact, Qn as MetadataItem, Qt as UpdateAssetOptions, R as ConnectionOptions, Rn as Folder, Rt as RequestOptions, S as AssetUpload, Sn as BoundingBox, St as ListLensesOptions, T as AssignPolicyOptions, Tn as ProcessingFeatureId, Tt as MoveAssetOptions, U as CreatePolicyOptions, Un as AssetHls, Ut as SearchAssetsOptions, V as CreateLensOptions, Vt as RetrieveAssetOptions, W as DecideAssetOptions, Wn as AssetHlsRendition, Wt as SetPolicyAutomaticUpdatesOptions, X as EnsureUploadPresetsOptions, Xn as ExtractedText, Xt as SubmitAssetOptions, Y as EnsureMetadataFieldsOptions, Yn as AssetSafetyHoldReason, Yt as StreamingFeatureOptions, Z as EnsureUploadPresetsResponse, Zn as FileMetadata, Zt as TypedEvent, _ as AssetPage, _n as AssetReviewRequest, _t as ListAssetsOptions, a as AssetChecksums, an as UploadAssetPartOptions, at as GetAssetInfoOptions, b as AssetTimelinePage, bn as UploadPreset, bt as ListHashListEntriesOptions, c as AssetClassificationFailureReason, cn as UploadPresetPage, ct as HashListIdOptions, d as AssetContentOptions, dn as VerifyWebhookSignatureOptions, dt as ImageTransformOptions, en as UpdateHashListOptions, et as EventFacts, f as AssetContentRemovalReason, fn as ViewerClaims, ft as Lens, g as AssetModerationStatus, gn as AssetBatchOperation, gt as ListAssetTimelineOptions, h as AssetModerationDecision, hn as WebhookPayloadInput, ht as ListAssetChildrenOptions, i as AssetAvailability, in as UpgradePolicyOptions, it as FolderPage, j as CdnAssetReference, jt as PolicyPage, k as CalmLensServerClientOptions, kn as CursorPage, kt as Policy, l as AssetClassificationStatus, ln as UploadPresetSubmitAssetOptions, lt as HashListPage, m as AssetModeration, mn as WebhookHeadersInput, mt as LensPage, n as AppInfo, nn as UpdatePolicyOptions, nt as EventsPage, o as AssetChildrenPage, on as UploadPresetDefinition, ot as HashListEntryIdOptions, p as AssetContentStatus, pn as WaitForAssetDecisionOptions, pt as LensIdOptions, q as EnsureLensOptions, qn as AssetRenderedKind, qt as SignedAssetUrl, r as Asset, rn as UpdateProjectSettingsOptions, rt as FolderIdOptions, s as AssetClassification, sn as UploadPresetIdOptions, st as HashListEntryPage, t as AddHashListEntryOptions, tn as UpdateLensOptions, tt as EventType, u as AssetContent, un as UploadedAsset, ut as IdempotencyOptions, v as AssetSearchResponse, vn as AssetTimelineSegment, vt as ListEventsOptions, w as AssetVisibility, wn as DetectedPerson, wt as ListUploadPresetsOptions, x as AssetType, xn as AgeRange, xt as ListHashListsOptions, y as AssetSearchResult, yn as MetadataFieldsResource, yt as ListFoldersOptions, z as CreateFolderOptions, zn as AssetSearchMatchField, zt as ResetPolicyOptions } from "./CalmLensTypes-
|
|
3
|
-
import { a as getAssetInfo, i as CDN_RESOURCES, n as SDK_VERSION, r as DEFAULT_CDN_BASE_URL, t as ModerationContextItem } from "./index-
|
|
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-
|
|
5
|
-
import { t as CalmLensServerClient } from "./CalmLensServerClient-
|
|
2
|
+
import { $ as EventFactValues, $n as ProcessingOptions, $t as UpdateFolderOptions, A as CdnAssetLocation, An as LensType, At as PolicyIdOptions, B as CreateHashListOptions, Bn as AssetSearchQuery, Bt as RetrieveAssetByExternalIdOptions, C as AssetUploadStatus, Cn as DetectedFace, Ct as ListPoliciesOptions, D as BatchAssetsResponse, Dn as ProcessingFeatureStage, Dt as MultipartUploadOptions, E as BatchAssetsOptions, En as ProcessingFeatureResults, Et as MoveFolderOptions, F as CdnTransform, Fn as EventResourceKind, Ft as RemoveAssetContentOptions, G as DeleteAssetOptions, Gn as AssetPreview, Gt as SignAssetUrlOptions, H as CreateMultipartUploadPartOptions, Hn as AssetInfo, Ht as RetryAssetOptions, I as ClassifyTextOptions, In as EventSeverity, It as RequestAssetReviewOptions, J as EnsureLensesOptions, Jn as AssetSafetyHold, Jt as SignedUploadToken, K as DeleteMetadataFieldOptions, Kn as AssetRendered, Kt as SignUploadTokenOptions, L as ClientRequestDefaults, Lt as RequestAttempt, M as CdnAssetUrlOptions, Mn as EventResource, Mt as PolicySettings, N as CdnResource, Nt as ProjectSettingsResource, O as CalmLensAppClientOptions, On as ProcessingFeatures, Ot as MultipartUploadPartOptions, P as CdnServeOptions, Pn as EventCategory, Pt as PublicProjectSettings, Q as EventFact, Qn as MetadataItem, Qt as UpdateAssetOptions, R as ConnectionOptions, Rn as Folder, Rt as RequestOptions, S as AssetUpload, Sn as BoundingBox, St as ListLensesOptions, T as AssignPolicyOptions, Tn as ProcessingFeatureId, Tt as MoveAssetOptions, U as CreatePolicyOptions, Un as AssetHls, Ut as SearchAssetsOptions, V as CreateLensOptions, Vt as RetrieveAssetOptions, W as DecideAssetOptions, Wn as AssetHlsRendition, Wt as SetPolicyAutomaticUpdatesOptions, X as EnsureUploadPresetsOptions, Xn as ExtractedText, Xt as SubmitAssetOptions, Y as EnsureMetadataFieldsOptions, Yn as AssetSafetyHoldReason, Yt as StreamingFeatureOptions, Z as EnsureUploadPresetsResponse, Zn as FileMetadata, Zt as TypedEvent, _ as AssetPage, _n as AssetReviewRequest, _t as ListAssetsOptions, a as AssetChecksums, an as UploadAssetPartOptions, at as GetAssetInfoOptions, b as AssetTimelinePage, bn as UploadPreset, bt as ListHashListEntriesOptions, c as AssetClassificationFailureReason, cn as UploadPresetPage, ct as HashListIdOptions, d as AssetContentOptions, dn as VerifyWebhookSignatureOptions, dt as ImageTransformOptions, en as UpdateHashListOptions, et as EventFacts, f as AssetContentRemovalReason, fn as ViewerClaims, ft as Lens, g as AssetModerationStatus, gn as AssetBatchOperation, gt as ListAssetTimelineOptions, h as AssetModerationDecision, hn as WebhookPayloadInput, ht as ListAssetChildrenOptions, i as AssetAvailability, in as UpgradePolicyOptions, it as FolderPage, j as CdnAssetReference, jt as PolicyPage, k as CalmLensServerClientOptions, kn as CursorPage, kt as Policy, l as AssetClassificationStatus, ln as UploadPresetSubmitAssetOptions, lt as HashListPage, m as AssetModeration, mn as WebhookHeadersInput, mt as LensPage, n as AppInfo, nn as UpdatePolicyOptions, nt as EventsPage, o as AssetChildrenPage, on as UploadPresetDefinition, ot as HashListEntryIdOptions, p as AssetContentStatus, pn as WaitForAssetDecisionOptions, pt as LensIdOptions, q as EnsureLensOptions, qn as AssetRenderedKind, qt as SignedAssetUrl, r as Asset, rn as UpdateProjectSettingsOptions, rt as FolderIdOptions, s as AssetClassification, sn as UploadPresetIdOptions, st as HashListEntryPage, t as AddHashListEntryOptions, tn as UpdateLensOptions, tt as EventType, u as AssetContent, un as UploadedAsset, ut as IdempotencyOptions, v as AssetSearchResponse, vn as AssetTimelineSegment, vt as ListEventsOptions, w as AssetVisibility, wn as DetectedPerson, wt as ListUploadPresetsOptions, x as AssetType, xn as AgeRange, xt as ListHashListsOptions, y as AssetSearchResult, yn as MetadataFieldsResource, yt as ListFoldersOptions, z as CreateFolderOptions, zn as AssetSearchMatchField, zt as ResetPolicyOptions } from "./CalmLensTypes-jond9q6a.js";
|
|
3
|
+
import { a as getAssetInfo, i as CDN_RESOURCES, n as SDK_VERSION, r as DEFAULT_CDN_BASE_URL, t as ModerationContextItem } from "./index-CgAztQdX.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-DdpKjQGw.js";
|
|
5
|
+
import { t as CalmLensServerClient } from "./CalmLensServerClient-CeTsE5Jx.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,8 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_CalmLensError = require("./CalmLensError-
|
|
3
|
-
const require_CalmLensCdn = require("./CalmLensCdn-
|
|
2
|
+
const require_CalmLensError = require("./CalmLensError-C9g7GXfU.js");
|
|
3
|
+
const require_CalmLensCdn = require("./CalmLensCdn-DCj0AfoS.js");
|
|
4
4
|
require("./index.js");
|
|
5
|
-
const require_CalmLensServerClient = require("./CalmLensServerClient-
|
|
5
|
+
const require_CalmLensServerClient = require("./CalmLensServerClient-vdHfH0Nf.js");
|
|
6
6
|
exports.AUTO_PAGING_TO_ARRAY_MAX = require_CalmLensCdn.AUTO_PAGING_TO_ARRAY_MAX;
|
|
7
7
|
exports.CALMLENS_ERROR_CODES = require_CalmLensError.CALMLENS_ERROR_CODES;
|
|
8
8
|
exports.CDN_RESOURCES = require_CalmLensCdn.CDN_RESOURCES;
|
|
@@ -19,7 +19,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
19
19
|
value: mod,
|
|
20
20
|
enumerable: true
|
|
21
21
|
}) : target, mod));
|
|
22
|
-
const require_CalmLensError = require("./CalmLensError-
|
|
22
|
+
const require_CalmLensError = require("./CalmLensError-C9g7GXfU.js");
|
|
23
23
|
const require_CryptoUtils_BLCa_oZe = require("./CryptoUtils-BLCa-oZe-leCkr1ko.js");
|
|
24
24
|
let zod = require("zod");
|
|
25
25
|
let zod$1 = __toESM(zod, 1);
|
|
@@ -157,7 +157,7 @@ Object.keys(JURISDICTIONS).filter((code) => !JURISDICTIONS[code].optional);
|
|
|
157
157
|
Object.keys(JURISDICTIONS).filter((code) => JURISDICTIONS[code].optional);
|
|
158
158
|
new Set("AD AE AF AG AI AL AM AO AQ AR AS AT AU AW AX AZ BA BB BD BE BF BG BH BI BJ BL BM BN BO BQ BR BS BT BV BW BY BZ CA CC CD CF CG CH CI CK CL CM CN CO CR CU CV CW CX CY CZ DE DJ DK DM DO DZ EC EE EG EH ER ES ET FI FJ FK FM FO FR GA GB GD GE GF GG GH GI GL GM GN GP GQ GR GS GT GU GW GY HK HM HN HR HT HU ID IE IL IM IN IO IQ IR IS IT JE JM JO JP KE KG KH KI KM KN KP KR KW KY KZ LA LB LC LI LK LR LS LT LU LV LY MA MC MD ME MF MG MH MK ML MM MN MO MP MQ MR MS MT MU MV MW MX MY MZ NA NC NE NF NG NI NL NO NP NR NU NZ OM PA PE PF PG PH PK PL PM PN PR PS PT PW PY QA RE RO RS RU RW SA SB SC SD SE SG SH SI SJ SK SL SM SN SO SR SS ST SV SX SY SZ TC TD TF TG TH TJ TK TL TM TN TO TR TT TV TW TZ UA UG UM US UY UZ VA VC VE VG VI VN VU WF WS YE YT ZA ZM ZW".split(" "));
|
|
159
159
|
const EU_COUNTRIES = new Set("AT BE BG HR CY CZ DK EE FI FR DE GR HU IE IT LV LT LU MT NL PL PT RO SK SI ES SE".split(" "));
|
|
160
|
-
// src/contract/TestRegionalActions-
|
|
160
|
+
// src/contract/TestRegionalActions-BAzqFJfV.js
|
|
161
161
|
/**
|
|
162
162
|
* Marks English text in shared, backend and data modules that the portal shows, so the app's
|
|
163
163
|
* message catalog (packages/app/vite/messageCatalog.ts) extracts it and the portal can translate it
|
|
@@ -1172,13 +1172,15 @@ const MODERATION_QUALIFIER_INFO = {
|
|
|
1172
1172
|
}
|
|
1173
1173
|
};
|
|
1174
1174
|
const MODERATION_QUALIFIERS = Object.keys(MODERATION_QUALIFIER_INFO);
|
|
1175
|
-
MODERATION_QUALIFIERS.reduce((groups, qualifier) => {
|
|
1175
|
+
const MODERATION_QUALIFIERS_BY_CATEGORY = MODERATION_QUALIFIERS.reduce((groups, qualifier) => {
|
|
1176
1176
|
(groups[MODERATION_QUALIFIER_INFO[qualifier].category] ??= []).push(qualifier);
|
|
1177
1177
|
return groups;
|
|
1178
1178
|
}, {});
|
|
1179
|
-
|
|
1180
|
-
|
|
1179
|
+
/** A qualifier the input type sets (`fromInput`), which no model is asked about. */
|
|
1180
|
+
function isInputQualifier(qualifier) {
|
|
1181
|
+
return MODERATION_QUALIFIER_INFO[qualifier].fromInput === true;
|
|
1181
1182
|
}
|
|
1183
|
+
const getModerationQualifiers = (category) => MODERATION_QUALIFIERS_BY_CATEGORY[category] ?? [];
|
|
1182
1184
|
/** Authenticated test inputs can add regional delivery restrictions without inventing evidence. */
|
|
1183
1185
|
const TEST_REGIONAL_ACTIONS_SCHEMA = /* @__PURE__ */ lazySchema(() => zod$1.array(zod$1.object({
|
|
1184
1186
|
region: JURISDICTION_SCHEMA.exclude(["global"]),
|
|
@@ -1188,7 +1190,7 @@ const TEST_REGIONAL_ACTIONS_SCHEMA = /* @__PURE__ */ lazySchema(() => zod$1.arra
|
|
|
1188
1190
|
"block"
|
|
1189
1191
|
])
|
|
1190
1192
|
}).strict()).max(7).refine((entries) => new Set(entries.map((entry) => entry.region)).size === entries.length, "Choose each region once"));
|
|
1191
|
-
// src/contract/TestTriggers-
|
|
1193
|
+
// src/contract/TestTriggers-ByQZ27Zp.js
|
|
1192
1194
|
/**
|
|
1193
1195
|
* The visual encoding of test images (shared by images and video frames), independent of what the
|
|
1194
1196
|
* bytes mean. An odd N×N grid of square cells fills the image. Its outer ring alternates black and
|
|
@@ -1674,6 +1676,22 @@ const TEST_DETECTIONS_SCHEMA = /* @__PURE__ */ lazySchema(() => zod$1.object({
|
|
|
1674
1676
|
people: zod$1.union([zod$1.array(TEST_DETECTED_PERSON_SCHEMA).max(32), zod$1.literal("unavailable")]).optional(),
|
|
1675
1677
|
faces: zod$1.union([zod$1.array(TEST_DETECTED_FACE_SCHEMA).max(32), zod$1.literal("unavailable")]).optional()
|
|
1676
1678
|
}).strict());
|
|
1679
|
+
/**
|
|
1680
|
+
* Why a test input's qualifier is refused: each zod issue's `params` carry the `category`,
|
|
1681
|
+
* `qualifier` and `reason`, and `allowed` (the category's qualifiers) for an unknown one.
|
|
1682
|
+
*/
|
|
1683
|
+
const TEST_INPUT_QUALIFIER_ERRORS = {
|
|
1684
|
+
/** Not a qualifier of the instance's category. */
|
|
1685
|
+
unknown: "unknown-qualifier",
|
|
1686
|
+
/** A qualifier the input type sets, such as `sexual-text`. */
|
|
1687
|
+
automatic: "input-type-qualifier",
|
|
1688
|
+
/** Given more than once in one instance. */
|
|
1689
|
+
repeated: "repeated-qualifier"
|
|
1690
|
+
};
|
|
1691
|
+
const isKnownQualifier = (qualifier) => MODERATION_QUALIFIERS.includes(qualifier);
|
|
1692
|
+
const isCategoryQualifier = (category, qualifier) => getModerationQualifiers(category).includes(qualifier);
|
|
1693
|
+
/** The qualifiers a test input may give for `category`: its own, less those the input type sets. */
|
|
1694
|
+
const getTestInputQualifiers = (category) => getModerationQualifiers(category).filter((qualifier) => !isInputQualifier(qualifier));
|
|
1677
1695
|
/** Each row is one qualifying instance. Unselected qualifiers are explicitly absent. */
|
|
1678
1696
|
const TEST_INPUT_SCHEMA = /* @__PURE__ */ lazySchema(() => zod$1.object({
|
|
1679
1697
|
regionalActions: TEST_REGIONAL_ACTIONS_SCHEMA.optional(),
|
|
@@ -1686,11 +1704,46 @@ const TEST_INPUT_SCHEMA = /* @__PURE__ */ lazySchema(() => zod$1.object({
|
|
|
1686
1704
|
"age-restrict",
|
|
1687
1705
|
"block"
|
|
1688
1706
|
]).optional(),
|
|
1689
|
-
qualifiers: zod$1.array(zod$1.
|
|
1707
|
+
qualifiers: zod$1.array(zod$1.custom((value) => typeof value === "string", { message: "A qualifier is a string, such as harassment-abuse." })).max(64)
|
|
1690
1708
|
}).strict().superRefine((instance, context) => {
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1709
|
+
const seen = /* @__PURE__ */ new Set();
|
|
1710
|
+
instance.qualifiers.forEach((qualifier, index) => {
|
|
1711
|
+
const path = ["qualifiers", index];
|
|
1712
|
+
const details = {
|
|
1713
|
+
category: instance.category,
|
|
1714
|
+
qualifier
|
|
1715
|
+
};
|
|
1716
|
+
if (isKnownQualifier(qualifier) && isInputQualifier(qualifier)) context.addIssue({
|
|
1717
|
+
code: "custom",
|
|
1718
|
+
path,
|
|
1719
|
+
params: {
|
|
1720
|
+
...details,
|
|
1721
|
+
reason: TEST_INPUT_QUALIFIER_ERRORS.automatic
|
|
1722
|
+
},
|
|
1723
|
+
message: `"${qualifier}" is set by the input type: leave it out.`
|
|
1724
|
+
});
|
|
1725
|
+
else if (!isCategoryQualifier(instance.category, qualifier)) {
|
|
1726
|
+
const allowed = getTestInputQualifiers(instance.category);
|
|
1727
|
+
context.addIssue({
|
|
1728
|
+
code: "custom",
|
|
1729
|
+
path,
|
|
1730
|
+
params: {
|
|
1731
|
+
...details,
|
|
1732
|
+
reason: TEST_INPUT_QUALIFIER_ERRORS.unknown,
|
|
1733
|
+
allowed
|
|
1734
|
+
},
|
|
1735
|
+
message: `Unknown ${instance.category} qualifier "${qualifier}": choose from ${allowed.join(", ")}.`
|
|
1736
|
+
});
|
|
1737
|
+
} else if (seen.has(qualifier)) context.addIssue({
|
|
1738
|
+
code: "custom",
|
|
1739
|
+
path,
|
|
1740
|
+
params: {
|
|
1741
|
+
...details,
|
|
1742
|
+
reason: TEST_INPUT_QUALIFIER_ERRORS.repeated
|
|
1743
|
+
},
|
|
1744
|
+
message: `"${qualifier}" is repeated: give each qualifier once.`
|
|
1745
|
+
});
|
|
1746
|
+
seen.add(qualifier);
|
|
1694
1747
|
});
|
|
1695
1748
|
})).max(128),
|
|
1696
1749
|
detections: TEST_DETECTIONS_SCHEMA.optional()
|
|
@@ -1872,7 +1925,7 @@ const toBase64Url = (bytes) => btoa(String.fromCharCode(...bytes)).replaceAll("+
|
|
|
1872
1925
|
const fromBase64Url = (text) => Uint8Array.from(atob(text.replaceAll("-", "+").replaceAll("_", "/")), (char) => char.charCodeAt(0));
|
|
1873
1926
|
/** The signed bytes: the scenario's canonical JSON (ASCII). */
|
|
1874
1927
|
const envelope = (scenario) => new TextEncoder().encode(JSON.stringify(TEST_INPUT_SCHEMA.parse(scenario)));
|
|
1875
|
-
async function generateTestTextCode(scenario, key) {
|
|
1928
|
+
async function generateTestTextCode$1(scenario, key) {
|
|
1876
1929
|
if (!/^[a-f0-9]{32}$/.test(key)) throw new TypeError("Invalid test input key");
|
|
1877
1930
|
const payload = toBase64Url(envelope(typeof scenario === "string" ? testInputForSignal(scenario) : scenario));
|
|
1878
1931
|
if (payload.length > 8e3) throw new RangeError("Test scenario is too large");
|
|
@@ -1948,9 +2001,9 @@ const TEST_INPUT_CATEGORY_COLORS = {
|
|
|
1948
2001
|
* bytes, big-endian), the 16-byte tag, then the payload (the scenario JSON). The reader rebuilds
|
|
1949
2002
|
* the text code, so images and text share one verification.
|
|
1950
2003
|
*/
|
|
1951
|
-
async function paintTestImage(scenario, key) {
|
|
2004
|
+
async function paintTestImage$1(scenario, key) {
|
|
1952
2005
|
const input = TEST_INPUT_SCHEMA.parse(typeof scenario === "string" ? testInputForSignal(scenario, "image") : scenario);
|
|
1953
|
-
const [, signature, payload] = (await generateTestTextCode(input, key)).slice(0, -1).split(" ");
|
|
2006
|
+
const [, signature, payload] = (await generateTestTextCode$1(input, key)).slice(0, -1).split(" ");
|
|
1954
2007
|
const signed = fromBase64Url(payload);
|
|
1955
2008
|
const data = new Uint8Array(18 + signed.length);
|
|
1956
2009
|
data.set([signed.length >> 8, signed.length & 255]);
|
|
@@ -1994,12 +2047,156 @@ async function withValidTestInputArguments(key, generate) {
|
|
|
1994
2047
|
if (error instanceof zod.ZodError) {
|
|
1995
2048
|
const [issue] = error.issues;
|
|
1996
2049
|
const path = (issue?.path ?? []).map((segment) => typeof segment === "number" ? segment : String(segment));
|
|
1997
|
-
|
|
2050
|
+
const qualifier = issue?.code === "custom" && typeof issue.params?.reason === "string" ? issue.params : {};
|
|
2051
|
+
throw require_CalmLensError.invalidArgument(`Invalid test scenario at ${path.length ? path.join(".") : "scenario"}: ${issue?.message ?? error.message}`, {
|
|
2052
|
+
path,
|
|
2053
|
+
...qualifier
|
|
2054
|
+
});
|
|
1998
2055
|
}
|
|
1999
2056
|
if (error instanceof RangeError) throw require_CalmLensError.invalidArgument(error.message);
|
|
2000
2057
|
throw error;
|
|
2001
2058
|
}
|
|
2002
2059
|
}
|
|
2060
|
+
// src/client/TestImagePng.ts
|
|
2061
|
+
/**
|
|
2062
|
+
* Encodes a painted test image as a PNG: 8-bit RGBA rows without filtering in stored deflate
|
|
2063
|
+
* blocks, as every SDK writes it, so the bytes match across SDKs. Runs anywhere, with no
|
|
2064
|
+
* compression library.
|
|
2065
|
+
*/
|
|
2066
|
+
function encodeTestImagePng(width, height, rgba) {
|
|
2067
|
+
const stride = width * 4;
|
|
2068
|
+
const raw = new Uint8Array((stride + 1) * height);
|
|
2069
|
+
for (let row = 0; row < height; row++) raw.set(rgba.subarray(row * stride, (row + 1) * stride), row * (stride + 1) + 1);
|
|
2070
|
+
const blocks = Math.max(1, Math.ceil(raw.length / 65535));
|
|
2071
|
+
const stream = new Uint8Array(2 + raw.length + blocks * 5 + 4);
|
|
2072
|
+
stream.set([120, 1]);
|
|
2073
|
+
let position = 2;
|
|
2074
|
+
for (let offset = 0; offset < raw.length || position === 2; offset += 65535) {
|
|
2075
|
+
const block = raw.subarray(offset, offset + 65535);
|
|
2076
|
+
const length = block.length;
|
|
2077
|
+
stream.set([
|
|
2078
|
+
offset + length >= raw.length ? 1 : 0,
|
|
2079
|
+
length & 255,
|
|
2080
|
+
length >> 8,
|
|
2081
|
+
~length & 255,
|
|
2082
|
+
~length >> 8 & 255
|
|
2083
|
+
], position);
|
|
2084
|
+
stream.set(block, position + 5);
|
|
2085
|
+
position += 5 + length;
|
|
2086
|
+
}
|
|
2087
|
+
writeUint32(stream, position, adler32(raw));
|
|
2088
|
+
const header = /* @__PURE__ */ new Uint8Array(13);
|
|
2089
|
+
writeUint32(header, 0, width);
|
|
2090
|
+
writeUint32(header, 4, height);
|
|
2091
|
+
header.set([
|
|
2092
|
+
8,
|
|
2093
|
+
6,
|
|
2094
|
+
0,
|
|
2095
|
+
0,
|
|
2096
|
+
0
|
|
2097
|
+
], 8);
|
|
2098
|
+
return concat([
|
|
2099
|
+
Uint8Array.of(137, 80, 78, 71, 13, 10, 26, 10),
|
|
2100
|
+
chunk("IHDR", header),
|
|
2101
|
+
chunk("IDAT", stream),
|
|
2102
|
+
chunk("IEND", /* @__PURE__ */ new Uint8Array(0))
|
|
2103
|
+
]);
|
|
2104
|
+
}
|
|
2105
|
+
function chunk(kind, body) {
|
|
2106
|
+
const typed = new Uint8Array(4 + body.length);
|
|
2107
|
+
for (let i = 0; i < 4; i++) typed[i] = kind.charCodeAt(i);
|
|
2108
|
+
typed.set(body, 4);
|
|
2109
|
+
const out = new Uint8Array(12 + body.length);
|
|
2110
|
+
writeUint32(out, 0, body.length);
|
|
2111
|
+
out.set(typed, 4);
|
|
2112
|
+
writeUint32(out, 8 + body.length, crc32(typed));
|
|
2113
|
+
return out;
|
|
2114
|
+
}
|
|
2115
|
+
function writeUint32(target, offset, value) {
|
|
2116
|
+
target[offset] = value >>> 24;
|
|
2117
|
+
target[offset + 1] = value >>> 16 & 255;
|
|
2118
|
+
target[offset + 2] = value >>> 8 & 255;
|
|
2119
|
+
target[offset + 3] = value & 255;
|
|
2120
|
+
}
|
|
2121
|
+
function concat(parts) {
|
|
2122
|
+
const out = new Uint8Array(parts.reduce((total, part) => total + part.length, 0));
|
|
2123
|
+
let offset = 0;
|
|
2124
|
+
for (const part of parts) {
|
|
2125
|
+
out.set(part, offset);
|
|
2126
|
+
offset += part.length;
|
|
2127
|
+
}
|
|
2128
|
+
return out;
|
|
2129
|
+
}
|
|
2130
|
+
let crcTable;
|
|
2131
|
+
function crc32(bytes) {
|
|
2132
|
+
if (!crcTable) {
|
|
2133
|
+
crcTable = /* @__PURE__ */ new Uint32Array(256);
|
|
2134
|
+
for (let n = 0; n < 256; n++) {
|
|
2135
|
+
let c = n;
|
|
2136
|
+
for (let k = 0; k < 8; k++) c = c & 1 ? 3988292384 ^ c >>> 1 : c >>> 1;
|
|
2137
|
+
crcTable[n] = c >>> 0;
|
|
2138
|
+
}
|
|
2139
|
+
}
|
|
2140
|
+
let crc = 4294967295;
|
|
2141
|
+
for (const byte of bytes) crc = crcTable[(crc ^ byte) & 255] ^ crc >>> 8;
|
|
2142
|
+
return (crc ^ 4294967295) >>> 0;
|
|
2143
|
+
}
|
|
2144
|
+
function adler32(bytes) {
|
|
2145
|
+
let a = 1;
|
|
2146
|
+
let b = 0;
|
|
2147
|
+
for (const byte of bytes) {
|
|
2148
|
+
a = (a + byte) % 65521;
|
|
2149
|
+
b = (b + a) % 65521;
|
|
2150
|
+
}
|
|
2151
|
+
return (b << 16 | a) >>> 0;
|
|
2152
|
+
}
|
|
2153
|
+
// src/contract/MediaTestTriggers.js
|
|
2154
|
+
const MEDIA_TEST_SIGNALS = [...CLASSIFICATION_CATEGORIES, "violence.graphic"];
|
|
2155
|
+
const HEX_WORDS = [
|
|
2156
|
+
"zero",
|
|
2157
|
+
"one",
|
|
2158
|
+
"two",
|
|
2159
|
+
"three",
|
|
2160
|
+
"four",
|
|
2161
|
+
"five",
|
|
2162
|
+
"six",
|
|
2163
|
+
"seven",
|
|
2164
|
+
"eight",
|
|
2165
|
+
"nine",
|
|
2166
|
+
"alpha",
|
|
2167
|
+
"bravo",
|
|
2168
|
+
"charlie",
|
|
2169
|
+
"delta",
|
|
2170
|
+
"echo",
|
|
2171
|
+
"foxtrot"
|
|
2172
|
+
];
|
|
2173
|
+
/** Read this aloud, or render it as large, high-contrast text in a video frame. */
|
|
2174
|
+
async function generateMediaTestCode$1(signal, testInputKey) {
|
|
2175
|
+
if (!MEDIA_TEST_SIGNALS.includes(signal)) throw new RangeError("Unsupported media test signal");
|
|
2176
|
+
return `Calm Lens test ${[...await getTestInputTag("media", signal, testInputKey)].map((character) => HEX_WORDS[Number.parseInt(character, 16)]).join(" ")} ${signal.replace(/[.-]/g, " ")} end test`;
|
|
2177
|
+
}
|
|
2178
|
+
// src/test-inputs.ts
|
|
2179
|
+
/**
|
|
2180
|
+
* Portable test inputs: presets and custom instances share one authenticated format. CalmLens
|
|
2181
|
+
* recognises a code only as the whole text and a test image only as the whole
|
|
2182
|
+
* upload, signed with the project's own key.
|
|
2183
|
+
*/
|
|
2184
|
+
/** A spoken media test phrase for `signal`, signed with the project's test input key. */
|
|
2185
|
+
const generateMediaTestCode = (signal, key) => withValidTestInputArguments(key, () => generateMediaTestCode$1(signal, key));
|
|
2186
|
+
/** A text code for `scenario`, signed with the project's test input key. */
|
|
2187
|
+
const generateTestTextCode = (scenario, key) => withValidTestInputArguments(key, () => generateTestTextCode$1(scenario, key));
|
|
2188
|
+
/**
|
|
2189
|
+
* The test image for `scenario`, signed with the project's test input key. Upload its `png` bytes
|
|
2190
|
+
* (or encode `rgba` in another format: the image survives lossy formats and resizing) as the whole
|
|
2191
|
+
* image, optionally on a plain single-colour border.
|
|
2192
|
+
*/
|
|
2193
|
+
const paintTestImage = async (scenario, key) => {
|
|
2194
|
+
const image = await withValidTestInputArguments(key, () => paintTestImage$1(scenario, key));
|
|
2195
|
+
return {
|
|
2196
|
+
...image,
|
|
2197
|
+
png: encodeTestImagePng(image.width, image.height, image.rgba)
|
|
2198
|
+
};
|
|
2199
|
+
};
|
|
2003
2200
|
Object.defineProperty(exports, "CLASSIFICATION_CATEGORIES", {
|
|
2004
2201
|
enumerable: true,
|
|
2005
2202
|
get: function() {
|
|
@@ -2012,6 +2209,12 @@ Object.defineProperty(exports, "EU_COUNTRIES", {
|
|
|
2012
2209
|
return EU_COUNTRIES;
|
|
2013
2210
|
}
|
|
2014
2211
|
});
|
|
2212
|
+
Object.defineProperty(exports, "MEDIA_TEST_SIGNALS", {
|
|
2213
|
+
enumerable: true,
|
|
2214
|
+
get: function() {
|
|
2215
|
+
return MEDIA_TEST_SIGNALS;
|
|
2216
|
+
}
|
|
2217
|
+
});
|
|
2015
2218
|
Object.defineProperty(exports, "TEST_DETECTIONS_MAX", {
|
|
2016
2219
|
enumerable: true,
|
|
2017
2220
|
get: function() {
|
|
@@ -2048,6 +2251,12 @@ Object.defineProperty(exports, "TEST_INPUT_PRESETS", {
|
|
|
2048
2251
|
return TEST_INPUT_PRESETS;
|
|
2049
2252
|
}
|
|
2050
2253
|
});
|
|
2254
|
+
Object.defineProperty(exports, "TEST_INPUT_QUALIFIER_ERRORS", {
|
|
2255
|
+
enumerable: true,
|
|
2256
|
+
get: function() {
|
|
2257
|
+
return TEST_INPUT_QUALIFIER_ERRORS;
|
|
2258
|
+
}
|
|
2259
|
+
});
|
|
2051
2260
|
Object.defineProperty(exports, "__toESM", {
|
|
2052
2261
|
enumerable: true,
|
|
2053
2262
|
get: function() {
|
|
@@ -2066,6 +2275,12 @@ Object.defineProperty(exports, "detectTestTrigger", {
|
|
|
2066
2275
|
return detectTestTrigger;
|
|
2067
2276
|
}
|
|
2068
2277
|
});
|
|
2278
|
+
Object.defineProperty(exports, "generateMediaTestCode", {
|
|
2279
|
+
enumerable: true,
|
|
2280
|
+
get: function() {
|
|
2281
|
+
return generateMediaTestCode;
|
|
2282
|
+
}
|
|
2283
|
+
});
|
|
2069
2284
|
Object.defineProperty(exports, "generateTestTextCode", {
|
|
2070
2285
|
enumerable: true,
|
|
2071
2286
|
get: function() {
|
|
@@ -2078,10 +2293,10 @@ Object.defineProperty(exports, "getImageTestCategories", {
|
|
|
2078
2293
|
return getImageTestCategories;
|
|
2079
2294
|
}
|
|
2080
2295
|
});
|
|
2081
|
-
Object.defineProperty(exports, "
|
|
2296
|
+
Object.defineProperty(exports, "getTestInputQualifiers", {
|
|
2082
2297
|
enumerable: true,
|
|
2083
2298
|
get: function() {
|
|
2084
|
-
return
|
|
2299
|
+
return getTestInputQualifiers;
|
|
2085
2300
|
}
|
|
2086
2301
|
});
|
|
2087
2302
|
Object.defineProperty(exports, "lazySchema", {
|
|
@@ -2102,9 +2317,3 @@ Object.defineProperty(exports, "testInputForSignal", {
|
|
|
2102
2317
|
return testInputForSignal;
|
|
2103
2318
|
}
|
|
2104
2319
|
});
|
|
2105
|
-
Object.defineProperty(exports, "withValidTestInputArguments", {
|
|
2106
|
-
enumerable: true,
|
|
2107
|
-
get: function() {
|
|
2108
|
-
return withValidTestInputArguments;
|
|
2109
|
-
}
|
|
2110
|
-
});
|