calmlens 0.22.0 → 0.23.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 +44 -26
- package/cjs/{BrowserUpload-BWjZ9ntu.d.ts → BrowserUpload-B2kmc3Y_.d.ts} +2 -2
- package/cjs/{BrowserUpload-Bwlib4Zc.js → BrowserUpload-HQjhZrW-.js} +1 -1
- package/{esm/CalmLensAppClient-BaW3ddUR.d.ts → cjs/CalmLensAppClient-CMVh0y5w.d.ts} +1 -1
- package/cjs/{CalmLensAppClient-DUYMo9PZ.js → CalmLensAppClient-yNhGTyvi.js} +2 -2
- package/cjs/{CalmLensOptionKeys-YvgV995V.js → CalmLensOptionKeys-B4gAOSbY.js} +1 -1
- package/{esm/CalmLensServerClient-BKzn8zmp.d.ts → cjs/CalmLensServerClient-BFt1L_FZ.d.ts} +9 -9
- package/cjs/{CalmLensServerClient-3N-gdsxC.js → CalmLensServerClient-BGlhX1Ep.js} +27 -10
- package/cjs/{CalmLensTypes-BDKwThbO.d.ts → CalmLensTypes-SmOCgKI3.d.ts} +298 -69
- package/cjs/{Classification-Q5zGpR8l-CEWjnE39.d.ts → Classification-CxRedzgH-C9qlYW_J.d.ts} +35 -0
- package/{esm/Core-C33pkBmf.d.ts → cjs/Core-Dt_HUNvH.d.ts} +4 -3
- package/cjs/{Core-Cm5Z1oJ9.js → Core-zXLf8JKh.js} +3 -3
- package/cjs/{ModerationContextLimits-ud1xpZRK.js → ModerationContextLimits-C6Ts1Xhw.js} +4 -11
- package/cjs/{ReactUpload-DhF8mm51.d.ts → ReactUpload-Bd7Hea4w.d.ts} +1 -1
- package/cjs/{ReactUpload-DQ0BYISX.js → ReactUpload-SaTeZgdA.js} +1 -1
- package/{esm/TestTriggers-D0pYHbkr-D5T0VdSn.d.ts → cjs/TestTriggers-BJ4B-MXR-D1tGifPU.d.ts} +7 -5
- package/cjs/{TestTriggers-D29T_R0M-D6Bu-Mln.js → TestTriggers-CiFcTHX3-BmfH4J3f.js} +22 -9
- package/cjs/{UploadController-l8fZM2qT.js → UploadController-Bh2bqt8N.js} +2 -2
- package/{esm/WebhookPayload-Dt6DttS0.d.ts → cjs/WebhookPayload-C7KAk3iR.d.ts} +1 -1
- package/cjs/app.d.ts +6 -6
- package/cjs/app.js +2 -2
- package/cjs/elements.d.ts +4 -4
- package/cjs/elements.js +4 -4
- package/cjs/{index-Bde1wjiw.d.ts → index-BJf0y_Uk.d.ts} +3 -3
- package/cjs/index.d.ts +5 -5
- package/cjs/index.js +1 -1
- package/cjs/react-native.d.ts +2 -2
- package/cjs/react-native.js +4 -4
- package/cjs/react.d.ts +3 -3
- package/cjs/react.js +5 -5
- package/cjs/server.d.ts +6 -6
- package/cjs/server.js +2 -2
- package/cjs/test-inputs.d.ts +1 -1
- package/cjs/test-inputs.js +13 -13
- package/cjs/testing.d.ts +16 -7
- package/cjs/testing.js +98 -34
- package/cjs/{ui-BRA4HQ8r.js → ui-CbqSrVlT.js} +3 -3
- package/cjs/{ui-YQuvbidU.d.ts → ui-DNXPuzha.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-BWjZ9ntu.d.ts → BrowserUpload-B2kmc3Y_.d.ts} +2 -2
- package/esm/{BrowserUpload-GRZVB0G_.js → BrowserUpload-QwdUnq0H.js} +1 -1
- package/{cjs/CalmLensAppClient-BaW3ddUR.d.ts → esm/CalmLensAppClient-CMVh0y5w.d.ts} +1 -1
- package/esm/{CalmLensAppClient-B5QIJ6KS.js → CalmLensAppClient-Dih1prcq.js} +2 -2
- package/esm/{CalmLensOptionKeys-BG7Qrh8-.js → CalmLensOptionKeys-C6R-4Zvh.js} +1 -1
- package/{cjs/CalmLensServerClient-BKzn8zmp.d.ts → esm/CalmLensServerClient-BFt1L_FZ.d.ts} +9 -9
- package/esm/{CalmLensServerClient-bRUAebi-.js → CalmLensServerClient-CVF5_FfH.js} +27 -10
- package/esm/{CalmLensTypes-BDKwThbO.d.ts → CalmLensTypes-SmOCgKI3.d.ts} +298 -69
- package/esm/{Classification-Q5zGpR8l-CEWjnE39.d.ts → Classification-CxRedzgH-C9qlYW_J.d.ts} +35 -0
- package/{cjs/Core-C33pkBmf.d.ts → esm/Core-Dt_HUNvH.d.ts} +4 -3
- package/esm/{Core-BvQe4moS.js → Core-tfQsge01.js} +3 -3
- package/esm/{ModerationContextLimits-CrxSnVZ3.js → ModerationContextLimits-B8f4ukBB.js} +4 -11
- package/esm/{ReactUpload-DhF8mm51.d.ts → ReactUpload-Bd7Hea4w.d.ts} +1 -1
- package/esm/{ReactUpload-BMO8saxT.js → ReactUpload-DRW08-Kt.js} +1 -1
- package/{cjs/TestTriggers-D0pYHbkr-D5T0VdSn.d.ts → esm/TestTriggers-BJ4B-MXR-D1tGifPU.d.ts} +7 -5
- package/esm/{TestTriggers-D29T_R0M-Ztc74ucs.js → TestTriggers-CiFcTHX3-BK2-sgOC.js} +22 -9
- package/esm/{UploadController-DnJrWiE4.js → UploadController-DEwR1AxP.js} +2 -2
- package/{cjs/WebhookPayload-Dt6DttS0.d.ts → esm/WebhookPayload-C7KAk3iR.d.ts} +1 -1
- package/esm/app.d.ts +6 -6
- package/esm/app.js +2 -2
- package/esm/elements.d.ts +4 -4
- package/esm/elements.js +4 -4
- package/esm/{index-Bde1wjiw.d.ts → index-BJf0y_Uk.d.ts} +3 -3
- package/esm/index.d.ts +5 -5
- package/esm/index.js +1 -1
- package/esm/react-native.d.ts +2 -2
- package/esm/react-native.js +4 -4
- package/esm/react.d.ts +3 -3
- package/esm/react.js +5 -5
- package/esm/server.d.ts +6 -6
- package/esm/server.js +2 -2
- package/esm/test-inputs.d.ts +1 -1
- package/esm/test-inputs.js +1 -1
- package/esm/testing.d.ts +16 -7
- package/esm/testing.js +92 -28
- package/esm/{ui-YQuvbidU.d.ts → ui-DNXPuzha.d.ts} +2 -2
- package/esm/{ui-heryDd6g.js → ui-ndvNkmb_.js} +3 -3
- 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/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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-
|
|
2
|
-
import { $ as GetAssetInfoOptions, $n as
|
|
3
|
-
import { i as getAssetInfo, n as DEFAULT_CDN_BASE_URL, r as CDN_RESOURCES, t as SDK_VERSION } from "./index-
|
|
4
|
-
import { a as CalmLensErrorCode, c as SdkErrorCode, i as CalmLensError, l as ApiErrorCode, o as CalmLensErrorDetails, r as CALMLENS_ERROR_CODES, s as CalmLensErrorOptions, t as ReceivedWebhookEventPayload } from "./WebhookPayload-
|
|
5
|
-
export { type AddHashListEntryOptions, type AgeRange, type ApiErrorCode, 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
|
|
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-CxRedzgH-C9qlYW_J.js";
|
|
2
|
+
import { $ as GetAssetInfoOptions, $n as MetadataItem, $t as UpgradePolicyOptions, A as CdnAssetReference, An as BoundingBox, At as MultipartUploadOptions, B as CreateMultipartUploadPartOptions, Bn as AssetSearchMatchField, Bt as SetPolicyAutomaticUpdatesOptions, C as AssetVisibility, Ct as ListHashListEntriesOptions, D as CalmLensAppClientOptions, Dn as PublicProjectSettings, Dt as ListUploadPresetsOptions, E as BatchAssetsResponse, En as ProjectSettingsResource, Et as ListPoliciesOptions, F as ClassifyTextOptions, Fn as ProcessingFeatureStage, Ft as RequestOptions, G as EnsureLensOptions, Gn as AssetHlsRendition, Gt as StreamingFeatureOptions, H as DecideAssetOptions, Ht as SignUploadTokenOptions, I as ConnectionOptions, In as ProcessingFeatures, It as ResetPolicyOptions, J as EnsureUploadPresetsOptions, Jn as AssetRenderedKind, Jt as UpdateFolderOptions, K as EnsureLensesOptions, Kn as AssetPreview, Kt as SubmitAssetOptions, L as CreateFolderOptions, Ln as Policy, Lt as RetrieveAssetOptions, M as CdnResource, Mn as DetectedPerson, Mt as PolicyIdOptions, N as CdnServeOptions, Nn as ProcessingFeatureId, Nt as PolicyPage, O as CalmLensServerClientOptions, On as UploadPreset, Ot as MoveAssetOptions, P as CdnTransform, Pn as ProcessingFeatureResults, Pt as RemoveAssetContentOptions, Q as FolderPage, Qn as FileMetadata, Qt as UpdateProjectSettingsOptions, R as CreateHashListOptions, Rn as CursorPage, Rt as RetryAssetOptions, S as AssetUploadStatus, Sn as EventType, St as ListFoldersOptions, T as BatchAssetsOptions, Tn as MetadataFieldsResource, Tt as ListLensesOptions, U as DeleteAssetOptions, Un as AssetInfo, Ut as SignedAssetUrl, V as CreatePolicyOptions, Vn as AssetSearchQuery, Vt as SignAssetUrlOptions, W as DeleteMetadataFieldOptions, Wn as AssetHls, Wt as SignedUploadToken, X as ExplainAssetOptions, Xn as AssetSafetyHoldReason, Xt as UpdateLensOptions, Y as EnsureUploadPresetsResponse, Yn as AssetSafetyHold, Yt as UpdateHashListOptions, Z as FolderIdOptions, Zn as ExtractedText, Zt as UpdatePolicyOptions, _ as AssetSearchResponse, _n as EventCategory, _t as LensPage, a as AssetChildrenPage, an as UploadedAsset, at as ImageTransformOptions, b as AssetType, bn as EventFacts, bt as ListAssetsOptions, c as AssetClassificationStatus, cn as WaitForAssetDecisionOptions, ct as IterateAssetsOptions, d as AssetContentRemovalReason, dn as AssetBatchOperation, dt as IterateHashListsOptions, en as UploadAssetPartOptions, er as ProcessingOptions, et as HashListEntryIdOptions, f as AssetContentStatus, fn as AssetTimelineSegment, ft as IterateLensesOptions, g as AssetPage, gn as TypedEvent, gt as LensIdOptions, h as AssetModerationStatus, hn as EventAsset, ht as Lens, i as AssetChecksums, in as UploadPresetSubmitAssetOptions, it as IdempotencyOptions, j as CdnAssetUrlOptions, jn as DetectedFace, jt as MultipartUploadPartOptions, k as CdnAssetLocation, kn as AgeRange, kt as MoveFolderOptions, l as AssetContent, ln as WebhookHeadersInput, lt as IterateFoldersOptions, m as AssetModerationDecision, mt as IterateUploadPresetsOptions, n as Asset, nn as UploadPresetIdOptions, nt as HashListIdOptions, o as AssetClassification, on as VerifyWebhookSignatureOptions, ot as IterateAssetChildrenOptions, p as AssetModeration, pn as GetEventsResponse, pt as IteratePoliciesOptions, q as EnsureMetadataFieldsOptions, qn as AssetRendered, qt as UpdateAssetOptions, r as AssetAvailability, rn as UploadPresetPage, rt as HashListPage, s as AssetClassificationFailureReason, sn as ViewerClaims, st as IterateAssetTimelineOptions, t as AddHashListEntryOptions, tn as UploadPresetDefinition, tt as HashListEntryPage, u as AssetContentOptions, un as WebhookPayloadInput, ut as IterateHashListEntriesOptions, v as AssetSearchResult, vn as EventFact, vt as ListAssetChildrenOptions, w as AssignPolicyOptions, wn as Folder, wt as ListHashListsOptions, x as AssetUpload, xn as EventSeverity, xt as ListEventsOptions, y as AssetTimelinePage, yn as EventFactValues, yt as ListAssetTimelineOptions, z as CreateLensOptions, zn as LensType, zt as SearchAssetsOptions } from "./CalmLensTypes-SmOCgKI3.js";
|
|
3
|
+
import { i as getAssetInfo, n as DEFAULT_CDN_BASE_URL, r as CDN_RESOURCES, t as SDK_VERSION } from "./index-BJf0y_Uk.js";
|
|
4
|
+
import { a as CalmLensErrorCode, c as SdkErrorCode, i as CalmLensError, l as ApiErrorCode, o as CalmLensErrorDetails, r as CALMLENS_ERROR_CODES, s as CalmLensErrorOptions, t as ReceivedWebhookEventPayload } from "./WebhookPayload-C7KAk3iR.js";
|
|
5
|
+
export { type AddHashListEntryOptions, type AgeRange, type ApiErrorCode, type Asset, type AssetAvailability, type AssetBatchOperation, type AssetChecksums, type AssetChildrenPage, type AssetClassification, type AssetClassificationFailureReason, type AssetClassificationStatus, type AssetContent, type AssetContentOptions, type AssetContentRemovalReason, type AssetContentStatus, type AssetHls, type AssetHlsRendition, type AssetInfo, type AssetModeration, type AssetModerationDecision, type AssetModerationStatus, type AssetPage, type AssetPreview, type AssetRendered, type AssetRenderedKind, type AssetSafetyHold, type AssetSafetyHoldReason, type AssetSearchMatchField, type AssetSearchQuery, type AssetSearchResponse, type AssetSearchResult, type AssetTimelinePage, type AssetTimelineSegment, type AssetType, type AssetUpload, type AssetUploadStatus, type AssetVisibility, type AssignPolicyOptions, type BatchAssetsOptions, type BatchAssetsResponse, type BoundingBox, CALMLENS_ERROR_CODES, CDN_RESOURCES, type CalmLensAppClientOptions, CalmLensError, type CalmLensErrorCode, type CalmLensErrorDetails, type CalmLensErrorOptions, type CalmLensServerClientOptions, type CdnAssetLocation, type CdnAssetReference, type CdnAssetUrlOptions, type CdnResource, type CdnServeOptions, type CdnTransform, type ClassificationCategories, type ClassificationCategory, type ClassificationCategoryReport, type ClassificationNotEvaluatedReason, type ClassificationQualifierResults, type ClassifyTextOptions, type ConnectionOptions, type CreateFolderOptions, type CreateHashListOptions, type CreateLensOptions, type CreateMultipartUploadPartOptions, type CreatePolicyOptions, type CursorPage, DEFAULT_CDN_BASE_URL, type DecideAssetOptions, type DeleteAssetOptions, type DeleteMetadataFieldOptions, type DetectedFace, type DetectedPerson, type EnsureLensOptions, type EnsureLensesOptions, type EnsureMetadataFieldsOptions, type EnsureUploadPresetsOptions, type EnsureUploadPresetsResponse, type EventAsset, type EventCategory, type EventFact, type EventFactValues, type EventFacts, type EventSeverity, type EventType, type GetEventsResponse as EventsPage, type ExplainAssetOptions, 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 IterateAssetChildrenOptions, type IterateAssetTimelineOptions, type IterateAssetsOptions, type IterateFoldersOptions, type IterateHashListEntriesOptions, type IterateHashListsOptions, type IterateLensesOptions, type IteratePoliciesOptions, type IterateUploadPresetsOptions, 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 ListPoliciesOptions, type ListUploadPresetsOptions, MODERATION_CONTEXT_USED_CHARACTERS, MODERATION_CONTEXT_USED_ITEMS, type MetadataFieldsResource, type MetadataItem, type ModerationContext, type ModerationContextItem, type ModerationQualifier, type MoveAssetOptions, type MoveFolderOptions, type MultipartUploadOptions, type MultipartUploadPartOptions, type Policy, type PolicyAction, type PolicyIdOptions, type PolicyPage, type ProcessingFeatureId, type ProcessingFeatureResults, type ProcessingFeatureStage, type ProcessingFeatures, type ProcessingOptions, type ProjectSettingsResource, type PublicProjectSettings, type RemoveAssetContentOptions, type RequestOptions, type ResetPolicyOptions, type RetrieveAssetOptions, type RetryAssetOptions, SDK_VERSION, type SdkErrorCode, type SearchAssetsOptions, type SetPolicyAutomaticUpdatesOptions, type SignAssetUrlOptions, type SignUploadTokenOptions, type SignedAssetUrl, type SignedUploadToken, type StreamingFeatureOptions, type SubmitAssetOptions, type TypedEvent, type UpdateAssetOptions, type UpdateFolderOptions, type UpdateHashListOptions, type UpdateLensOptions, type UpdatePolicyOptions, type UpdateProjectSettingsOptions, type UpgradePolicyOptions, type UploadAssetPartOptions, type UploadPreset, type UploadPresetDefinition, type UploadPresetIdOptions, type UploadPresetPage, type UploadPresetSubmitAssetOptions, type UploadedAsset, type VerifyWebhookSignatureOptions, type ViewerClaims, type WaitForAssetDecisionOptions, type ReceivedWebhookEventPayload as WebhookEventPayload, type WebhookHeadersInput, type WebhookPayloadInput, getAssetInfo, selectModerationContextItems };
|
package/cjs/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_ModerationContextLimits = require("./ModerationContextLimits-
|
|
2
|
+
const require_ModerationContextLimits = require("./ModerationContextLimits-C6Ts1Xhw.js");
|
|
3
3
|
exports.CALMLENS_ERROR_CODES = require_ModerationContextLimits.CALMLENS_ERROR_CODES;
|
|
4
4
|
exports.CDN_RESOURCES = require_ModerationContextLimits.CDN_RESOURCES;
|
|
5
5
|
exports.CalmLensError = require_ModerationContextLimits.CalmLensError;
|
package/cjs/react-native.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { $ as getAssetViewKey, A as CustomUploadResult, B as AssetDisplay, C as formatMessage, D as resolveMessages, E as getUploadItemOutcome, F as UploadItem, G as AssetSession, H as AssetImageOptions, I as UploadSnapshot, J as AssetVideoOptions, K as AssetSessionState, L as UploadStage, M as UploadController, N as UploadControllerOptions, O as CalmLensUpload, P as UploadFile, Q as getAssetView, R as createUploadController, S as formatBytes, T as getUploadItemMessage, U as AssetImageSource, V as AssetDocumentOptions, W as AssetOptions, X as MediaPlayback, Y as AssetView, Z as getAssetAspectRatio, _ as DEFAULT_MESSAGES, a as ProgressFetchOptions, b as describeUploadItem, c as ICON_ATTRIBUTES, d as AssetDisplayOptions, et as getPeakHeights, f as AssetEventHandlers, g as CalmLensMessages, h as UploaderProps, i as CALMLENS_STYLES, j as UploadClient, k as CustomUploadContext, l as IconName, m as UploaderDisplayOptions, n as CalmLensTheme, nt as pickAssetSource, o as createProgressFetch, p as AssetProps, q as AssetSpreadsheetOptions, r as resolveTheme, s as ICONS, t as CALMLENS_THEME, tt as getPlayedPercent, u as ASSET_FILE_ICON_SIZE, v as UploadItemView, w as getDropzoneHint, x as describeUploader, y as UploaderView, z as isFileAccepted } from "./Core-
|
|
2
|
-
import { n as useCalmLensUpload, t as UseCalmLensUploadResult } from "./ReactUpload-
|
|
1
|
+
import { $ as getAssetViewKey, A as CustomUploadResult, B as AssetDisplay, C as formatMessage, D as resolveMessages, E as getUploadItemOutcome, F as UploadItem, G as AssetSession, H as AssetImageOptions, I as UploadSnapshot, J as AssetVideoOptions, K as AssetSessionState, L as UploadStage, M as UploadController, N as UploadControllerOptions, O as CalmLensUpload, P as UploadFile, Q as getAssetView, R as createUploadController, S as formatBytes, T as getUploadItemMessage, U as AssetImageSource, V as AssetDocumentOptions, W as AssetOptions, X as MediaPlayback, Y as AssetView, Z as getAssetAspectRatio, _ as DEFAULT_MESSAGES, a as ProgressFetchOptions, b as describeUploadItem, c as ICON_ATTRIBUTES, d as AssetDisplayOptions, et as getPeakHeights, f as AssetEventHandlers, g as CalmLensMessages, h as UploaderProps, i as CALMLENS_STYLES, j as UploadClient, k as CustomUploadContext, l as IconName, m as UploaderDisplayOptions, n as CalmLensTheme, nt as pickAssetSource, o as createProgressFetch, p as AssetProps, q as AssetSpreadsheetOptions, r as resolveTheme, s as ICONS, t as CALMLENS_THEME, tt as getPlayedPercent, u as ASSET_FILE_ICON_SIZE, v as UploadItemView, w as getDropzoneHint, x as describeUploader, y as UploaderView, z as isFileAccepted } from "./Core-Dt_HUNvH.js";
|
|
2
|
+
import { n as useCalmLensUpload, t as UseCalmLensUploadResult } from "./ReactUpload-Bd7Hea4w.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_ModerationContextLimits = require("./ModerationContextLimits-
|
|
3
|
-
const require_UploadController = require("./UploadController-
|
|
4
|
-
const require_Core = require("./Core-
|
|
2
|
+
const require_ModerationContextLimits = require("./ModerationContextLimits-C6Ts1Xhw.js");
|
|
3
|
+
const require_UploadController = require("./UploadController-Bh2bqt8N.js");
|
|
4
|
+
const require_Core = require("./Core-zXLf8JKh.js");
|
|
5
5
|
const require_FileIcons = require("./FileIcons-Ob003MdS.js");
|
|
6
|
-
const require_ReactUpload = require("./ReactUpload-
|
|
6
|
+
const require_ReactUpload = require("./ReactUpload-SaTeZgdA.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,6 +1,6 @@
|
|
|
1
|
-
import { $ as getAssetViewKey, A as CustomUploadResult, B as AssetDisplay, C as formatMessage, D as resolveMessages, E as getUploadItemOutcome, G as AssetSession, H as AssetImageOptions, J as AssetVideoOptions, K as AssetSessionState, L as UploadStage, M as UploadController, P as UploadFile, Q as getAssetView, S as formatBytes, T as getUploadItemMessage, U as AssetImageSource, V as AssetDocumentOptions, W as AssetOptions, X as MediaPlayback, Y as AssetView, Z as getAssetAspectRatio, _ as DEFAULT_MESSAGES, _t as formatViewerMessage, a as ProgressFetchOptions, at as ImageViewerOptions, b as describeUploadItem, c as ICON_ATTRIBUTES, ct as TextViewerOptions, d as AssetDisplayOptions, dt as ViewerTextOptions, et as getPeakHeights, f as AssetEventHandlers, ft as WebsiteViewerOptions, g as CalmLensMessages, gt as ViewerMessages, ht as DEFAULT_VIEWER_MESSAGES, i as CALMLENS_STYLES, it as DocumentViewerOptions, j as UploadClient, k as CustomUploadContext, l as IconName, lt as ViewerAsset, m as UploaderDisplayOptions, mt as isSpreadsheetFormat, n as CalmLensTheme, nt as pickAssetSource, o as createProgressFetch, ot as PdfAssetOptions, p as AssetProps, pt as getAssetViewerKind, q as AssetSpreadsheetOptions, r as resolveTheme, rt as AssetViewerKind, s as ICONS, st as SpreadsheetViewerOptions, t as CALMLENS_THEME, tt as getPlayedPercent, u as ASSET_FILE_ICON_SIZE, ut as ViewerOptions, v as UploadItemView, vt as resolveViewerMessages, w as getDropzoneHint, x as describeUploader, y as UploaderView, z as isFileAccepted } from "./Core-
|
|
2
|
-
import { a as UploaderProps, i as UploadSnapshot, n as UploadControllerOptions, o as UseCalmLensUploadResult, r as UploadItem, s as createUploadController, t as CalmLensUpload } from "./BrowserUpload-
|
|
3
|
-
import { C as ViewerState, S as AssetViewer, _ as spreadsheetColumnIndex, a as isMountedViewerKind, b as createWebsiteViewer, 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 createDocumentViewer, y as createImageViewer } from "./ui-
|
|
1
|
+
import { $ as getAssetViewKey, A as CustomUploadResult, B as AssetDisplay, C as formatMessage, D as resolveMessages, E as getUploadItemOutcome, G as AssetSession, H as AssetImageOptions, J as AssetVideoOptions, K as AssetSessionState, L as UploadStage, M as UploadController, P as UploadFile, Q as getAssetView, S as formatBytes, T as getUploadItemMessage, U as AssetImageSource, V as AssetDocumentOptions, W as AssetOptions, X as MediaPlayback, Y as AssetView, Z as getAssetAspectRatio, _ as DEFAULT_MESSAGES, _t as formatViewerMessage, a as ProgressFetchOptions, at as ImageViewerOptions, b as describeUploadItem, c as ICON_ATTRIBUTES, ct as TextViewerOptions, d as AssetDisplayOptions, dt as ViewerTextOptions, et as getPeakHeights, f as AssetEventHandlers, ft as WebsiteViewerOptions, g as CalmLensMessages, gt as ViewerMessages, ht as DEFAULT_VIEWER_MESSAGES, i as CALMLENS_STYLES, it as DocumentViewerOptions, j as UploadClient, k as CustomUploadContext, l as IconName, lt as ViewerAsset, m as UploaderDisplayOptions, mt as isSpreadsheetFormat, n as CalmLensTheme, nt as pickAssetSource, o as createProgressFetch, ot as PdfAssetOptions, p as AssetProps, pt as getAssetViewerKind, q as AssetSpreadsheetOptions, r as resolveTheme, rt as AssetViewerKind, s as ICONS, st as SpreadsheetViewerOptions, t as CALMLENS_THEME, tt as getPlayedPercent, u as ASSET_FILE_ICON_SIZE, ut as ViewerOptions, v as UploadItemView, vt as resolveViewerMessages, w as getDropzoneHint, x as describeUploader, y as UploaderView, z as isFileAccepted } from "./Core-Dt_HUNvH.js";
|
|
2
|
+
import { a as UploaderProps, i as UploadSnapshot, n as UploadControllerOptions, o as UseCalmLensUploadResult, r as UploadItem, s as createUploadController, t as CalmLensUpload } from "./BrowserUpload-B2kmc3Y_.js";
|
|
3
|
+
import { C as ViewerState, S as AssetViewer, _ as spreadsheetColumnIndex, a as isMountedViewerKind, b as createWebsiteViewer, 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 createDocumentViewer, y as createImageViewer } from "./ui-DNXPuzha.js";
|
|
4
4
|
import { CSSProperties, HTMLAttributes, ReactNode } from "react";
|
|
5
5
|
type ElementProps = Omit<HTMLAttributes<HTMLDivElement>, "children"> & {
|
|
6
6
|
/** 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_UploadController = require("./UploadController-
|
|
5
|
-
const require_Core = require("./Core-
|
|
3
|
+
const require_ui = require("./ui-CbqSrVlT.js");
|
|
4
|
+
const require_UploadController = require("./UploadController-Bh2bqt8N.js");
|
|
5
|
+
const require_Core = require("./Core-zXLf8JKh.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-SaTeZgdA.js");
|
|
8
|
+
const require_BrowserUpload = require("./BrowserUpload-HQjhZrW-.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
|
-
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-
|
|
2
|
-
import { $ as GetAssetInfoOptions, $n as
|
|
3
|
-
import { i as getAssetInfo, n as DEFAULT_CDN_BASE_URL, r as CDN_RESOURCES, t as SDK_VERSION } from "./index-
|
|
4
|
-
import { a as CalmLensErrorCode, c as SdkErrorCode, i as CalmLensError, l as ApiErrorCode, o as CalmLensErrorDetails, r as CALMLENS_ERROR_CODES, s as CalmLensErrorOptions, t as ReceivedWebhookEventPayload } from "./WebhookPayload-
|
|
5
|
-
import { t as CalmLensServerClient } from "./CalmLensServerClient-
|
|
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-CxRedzgH-C9qlYW_J.js";
|
|
2
|
+
import { $ as GetAssetInfoOptions, $n as MetadataItem, $t as UpgradePolicyOptions, A as CdnAssetReference, An as BoundingBox, At as MultipartUploadOptions, B as CreateMultipartUploadPartOptions, Bn as AssetSearchMatchField, Bt as SetPolicyAutomaticUpdatesOptions, C as AssetVisibility, Ct as ListHashListEntriesOptions, D as CalmLensAppClientOptions, Dn as PublicProjectSettings, Dt as ListUploadPresetsOptions, E as BatchAssetsResponse, En as ProjectSettingsResource, Et as ListPoliciesOptions, F as ClassifyTextOptions, Fn as ProcessingFeatureStage, Ft as RequestOptions, G as EnsureLensOptions, Gn as AssetHlsRendition, Gt as StreamingFeatureOptions, H as DecideAssetOptions, Ht as SignUploadTokenOptions, I as ConnectionOptions, In as ProcessingFeatures, It as ResetPolicyOptions, J as EnsureUploadPresetsOptions, Jn as AssetRenderedKind, Jt as UpdateFolderOptions, K as EnsureLensesOptions, Kn as AssetPreview, Kt as SubmitAssetOptions, L as CreateFolderOptions, Ln as Policy, Lt as RetrieveAssetOptions, M as CdnResource, Mn as DetectedPerson, Mt as PolicyIdOptions, N as CdnServeOptions, Nn as ProcessingFeatureId, Nt as PolicyPage, O as CalmLensServerClientOptions, On as UploadPreset, Ot as MoveAssetOptions, P as CdnTransform, Pn as ProcessingFeatureResults, Pt as RemoveAssetContentOptions, Q as FolderPage, Qn as FileMetadata, Qt as UpdateProjectSettingsOptions, R as CreateHashListOptions, Rn as CursorPage, Rt as RetryAssetOptions, S as AssetUploadStatus, Sn as EventType, St as ListFoldersOptions, T as BatchAssetsOptions, Tn as MetadataFieldsResource, Tt as ListLensesOptions, U as DeleteAssetOptions, Un as AssetInfo, Ut as SignedAssetUrl, V as CreatePolicyOptions, Vn as AssetSearchQuery, Vt as SignAssetUrlOptions, W as DeleteMetadataFieldOptions, Wn as AssetHls, Wt as SignedUploadToken, X as ExplainAssetOptions, Xn as AssetSafetyHoldReason, Xt as UpdateLensOptions, Y as EnsureUploadPresetsResponse, Yn as AssetSafetyHold, Yt as UpdateHashListOptions, Z as FolderIdOptions, Zn as ExtractedText, Zt as UpdatePolicyOptions, _ as AssetSearchResponse, _n as EventCategory, _t as LensPage, a as AssetChildrenPage, an as UploadedAsset, at as ImageTransformOptions, b as AssetType, bn as EventFacts, bt as ListAssetsOptions, c as AssetClassificationStatus, cn as WaitForAssetDecisionOptions, ct as IterateAssetsOptions, d as AssetContentRemovalReason, dn as AssetBatchOperation, dt as IterateHashListsOptions, en as UploadAssetPartOptions, er as ProcessingOptions, et as HashListEntryIdOptions, f as AssetContentStatus, fn as AssetTimelineSegment, ft as IterateLensesOptions, g as AssetPage, gn as TypedEvent, gt as LensIdOptions, h as AssetModerationStatus, hn as EventAsset, ht as Lens, i as AssetChecksums, in as UploadPresetSubmitAssetOptions, it as IdempotencyOptions, j as CdnAssetUrlOptions, jn as DetectedFace, jt as MultipartUploadPartOptions, k as CdnAssetLocation, kn as AgeRange, kt as MoveFolderOptions, l as AssetContent, ln as WebhookHeadersInput, lt as IterateFoldersOptions, m as AssetModerationDecision, mt as IterateUploadPresetsOptions, n as Asset, nn as UploadPresetIdOptions, nt as HashListIdOptions, o as AssetClassification, on as VerifyWebhookSignatureOptions, ot as IterateAssetChildrenOptions, p as AssetModeration, pn as GetEventsResponse, pt as IteratePoliciesOptions, q as EnsureMetadataFieldsOptions, qn as AssetRendered, qt as UpdateAssetOptions, r as AssetAvailability, rn as UploadPresetPage, rt as HashListPage, s as AssetClassificationFailureReason, sn as ViewerClaims, st as IterateAssetTimelineOptions, t as AddHashListEntryOptions, tn as UploadPresetDefinition, tt as HashListEntryPage, u as AssetContentOptions, un as WebhookPayloadInput, ut as IterateHashListEntriesOptions, v as AssetSearchResult, vn as EventFact, vt as ListAssetChildrenOptions, w as AssignPolicyOptions, wn as Folder, wt as ListHashListsOptions, x as AssetUpload, xn as EventSeverity, xt as ListEventsOptions, y as AssetTimelinePage, yn as EventFactValues, yt as ListAssetTimelineOptions, z as CreateLensOptions, zn as LensType, zt as SearchAssetsOptions } from "./CalmLensTypes-SmOCgKI3.js";
|
|
3
|
+
import { i as getAssetInfo, n as DEFAULT_CDN_BASE_URL, r as CDN_RESOURCES, t as SDK_VERSION } from "./index-BJf0y_Uk.js";
|
|
4
|
+
import { a as CalmLensErrorCode, c as SdkErrorCode, i as CalmLensError, l as ApiErrorCode, o as CalmLensErrorDetails, r as CALMLENS_ERROR_CODES, s as CalmLensErrorOptions, t as ReceivedWebhookEventPayload } from "./WebhookPayload-C7KAk3iR.js";
|
|
5
|
+
import { t as CalmLensServerClient } from "./CalmLensServerClient-BFt1L_FZ.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";
|
|
@@ -71,4 +71,4 @@ export declare const isTestWebhookEvent: (event: Pick<ReceivedWebhookEventPayloa
|
|
|
71
71
|
* new. Store the event's `assetSequence` per `assetId` once you have applied it.
|
|
72
72
|
*/
|
|
73
73
|
export declare const isNewerAssetEvent: (event: Pick<ReceivedWebhookEventPayload, "assetSequence">, lastSequence: number | null | undefined) => boolean;
|
|
74
|
-
export { type AddHashListEntryOptions, type AgeRange, type ApiErrorCode, 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
|
|
74
|
+
export { type AddHashListEntryOptions, type AgeRange, type ApiErrorCode, type Asset, type AssetAvailability, type AssetBatchOperation, type AssetChecksums, type AssetChildrenPage, type AssetClassification, type AssetClassificationFailureReason, type AssetClassificationStatus, type AssetContent, type AssetContentOptions, type AssetContentRemovalReason, type AssetContentStatus, type AssetHls, type AssetHlsRendition, type AssetInfo, type AssetModeration, type AssetModerationDecision, type AssetModerationStatus, type AssetPage, type AssetPreview, type AssetRendered, type AssetRenderedKind, type AssetSafetyHold, type AssetSafetyHoldReason, type AssetSearchMatchField, type AssetSearchQuery, type AssetSearchResponse, type AssetSearchResult, type AssetTimelinePage, type AssetTimelineSegment, type AssetType, type AssetUpload, type AssetUploadStatus, type AssetVisibility, type AssignPolicyOptions, type BatchAssetsOptions, type BatchAssetsResponse, type BoundingBox, CALMLENS_ERROR_CODES, CDN_RESOURCES, type CalmLensAppClientOptions, CalmLensError, type CalmLensErrorCode, type CalmLensErrorDetails, type CalmLensErrorOptions, CalmLensServerClient, type CalmLensServerClientOptions, type CdnAssetLocation, type CdnAssetReference, type CdnAssetUrlOptions, type CdnResource, type CdnServeOptions, type CdnTransform, type ClassificationCategories, type ClassificationCategory, type ClassificationCategoryReport, type ClassificationNotEvaluatedReason, type ClassificationQualifierResults, type ClassifyTextOptions, type ConnectionOptions, type CreateFolderOptions, type CreateHashListOptions, type CreateLensOptions, type CreateMultipartUploadPartOptions, type CreatePolicyOptions, type CursorPage, DEFAULT_CDN_BASE_URL, type DecideAssetOptions, type DeleteAssetOptions, type DeleteMetadataFieldOptions, type DetectedFace, type DetectedPerson, type EnsureLensOptions, type EnsureLensesOptions, type EnsureMetadataFieldsOptions, type EnsureUploadPresetsOptions, type EnsureUploadPresetsResponse, type EventAsset, type EventCategory, type EventFact, type EventFactValues, type EventFacts, type EventSeverity, type EventType, type GetEventsResponse as EventsPage, type ExplainAssetOptions, 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 IterateAssetChildrenOptions, type IterateAssetTimelineOptions, type IterateAssetsOptions, type IterateFoldersOptions, type IterateHashListEntriesOptions, type IterateHashListsOptions, type IterateLensesOptions, type IteratePoliciesOptions, type IterateUploadPresetsOptions, 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 ListPoliciesOptions, type ListUploadPresetsOptions, MODERATION_CONTEXT_USED_CHARACTERS, MODERATION_CONTEXT_USED_ITEMS, type MetadataFieldsResource, type MetadataItem, type ModerationContext, type ModerationContextItem, type ModerationQualifier, type MoveAssetOptions, type MoveFolderOptions, type MultipartUploadOptions, type MultipartUploadPartOptions, type Policy, type PolicyAction, type PolicyIdOptions, type PolicyPage, type ProcessingFeatureId, type ProcessingFeatureResults, type ProcessingFeatureStage, type ProcessingFeatures, type ProcessingOptions, type ProjectSettingsResource, type PublicProjectSettings, type RemoveAssetContentOptions, type RequestOptions, type ResetPolicyOptions, type RetrieveAssetOptions, type RetryAssetOptions, SDK_VERSION, type SdkErrorCode, type SearchAssetsOptions, type SetPolicyAutomaticUpdatesOptions, type SignAssetUrlOptions, type SignUploadTokenOptions, type SignedAssetUrl, type SignedUploadToken, type StreamingFeatureOptions, type SubmitAssetOptions, type TypedEvent, type UpdateAssetOptions, type UpdateFolderOptions, type UpdateHashListOptions, type UpdateLensOptions, type UpdatePolicyOptions, type UpdateProjectSettingsOptions, type UpgradePolicyOptions, type UploadAssetPartOptions, type UploadPreset, type UploadPresetDefinition, type UploadPresetIdOptions, type UploadPresetPage, type UploadPresetSubmitAssetOptions, type UploadedAsset, type VerifyWebhookSignatureOptions, type ViewerClaims, type WaitForAssetDecisionOptions, type ReceivedWebhookEventPayload as WebhookEventPayload, type WebhookHeadersInput, type WebhookPayloadInput, getAssetInfo, selectModerationContextItems };
|
package/cjs/server.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_ModerationContextLimits = require("./ModerationContextLimits-
|
|
2
|
+
const require_ModerationContextLimits = require("./ModerationContextLimits-C6Ts1Xhw.js");
|
|
3
3
|
require("./index.js");
|
|
4
|
-
const require_CalmLensServerClient = require("./CalmLensServerClient-
|
|
4
|
+
const require_CalmLensServerClient = require("./CalmLensServerClient-BGlhX1Ep.js");
|
|
5
5
|
exports.CALMLENS_ERROR_CODES = require_ModerationContextLimits.CALMLENS_ERROR_CODES;
|
|
6
6
|
exports.CDN_RESOURCES = require_ModerationContextLimits.CDN_RESOURCES;
|
|
7
7
|
exports.CalmLensError = require_ModerationContextLimits.CalmLensError;
|
package/cjs/test-inputs.d.ts
CHANGED
|
@@ -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-
|
|
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-BJ4B-MXR-D1tGifPU.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 };
|
package/cjs/test-inputs.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const
|
|
3
|
-
exports.TEST_DETECTIONS_MAX =
|
|
4
|
-
exports.TEST_DETECTION_BOX_MAX =
|
|
5
|
-
exports.TEST_FACE_AGE_MAX =
|
|
6
|
-
exports.TEST_FACE_AGE_PRESETS =
|
|
7
|
-
exports.TEST_INPUT_KEY_PATTERN =
|
|
8
|
-
exports.TEST_INPUT_PRESETS =
|
|
9
|
-
exports.detectTestImage =
|
|
10
|
-
exports.detectTestTrigger =
|
|
11
|
-
exports.generateTestTextCode =
|
|
12
|
-
exports.getImageTestCategories =
|
|
13
|
-
exports.paintTestImage =
|
|
14
|
-
exports.testInputForSignal =
|
|
2
|
+
const require_TestTriggers_CiFcTHX3 = require("./TestTriggers-CiFcTHX3-BmfH4J3f.js");
|
|
3
|
+
exports.TEST_DETECTIONS_MAX = require_TestTriggers_CiFcTHX3.TEST_DETECTIONS_MAX;
|
|
4
|
+
exports.TEST_DETECTION_BOX_MAX = require_TestTriggers_CiFcTHX3.TEST_DETECTION_BOX_MAX;
|
|
5
|
+
exports.TEST_FACE_AGE_MAX = require_TestTriggers_CiFcTHX3.TEST_FACE_AGE_MAX;
|
|
6
|
+
exports.TEST_FACE_AGE_PRESETS = require_TestTriggers_CiFcTHX3.TEST_FACE_AGE_PRESETS;
|
|
7
|
+
exports.TEST_INPUT_KEY_PATTERN = require_TestTriggers_CiFcTHX3.TEST_INPUT_KEY_PATTERN;
|
|
8
|
+
exports.TEST_INPUT_PRESETS = require_TestTriggers_CiFcTHX3.TEST_INPUT_PRESETS;
|
|
9
|
+
exports.detectTestImage = require_TestTriggers_CiFcTHX3.detectTestImage;
|
|
10
|
+
exports.detectTestTrigger = require_TestTriggers_CiFcTHX3.detectTestTrigger;
|
|
11
|
+
exports.generateTestTextCode = require_TestTriggers_CiFcTHX3.generateTestTextCode;
|
|
12
|
+
exports.getImageTestCategories = require_TestTriggers_CiFcTHX3.getImageTestCategories;
|
|
13
|
+
exports.paintTestImage = require_TestTriggers_CiFcTHX3.paintTestImage;
|
|
14
|
+
exports.testInputForSignal = require_TestTriggers_CiFcTHX3.testInputForSignal;
|
package/cjs/testing.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Cn as PermissionGrant, D as CalmLensAppClientOptions, Hn as AssetBinaryPayloadInput, Ht as SignUploadTokenOptions, O as CalmLensServerClientOptions, Wt as SignedUploadToken, gn as TypedEvent, n as Asset, p as AssetModeration, wn as Folder } from "./CalmLensTypes-
|
|
2
|
-
import { t as CalmLensAppClient } from "./CalmLensAppClient-
|
|
3
|
-
import { l as ApiErrorCode, n as WebhookEventPayload } from "./WebhookPayload-
|
|
4
|
-
import { t as CalmLensServerClient } from "./CalmLensServerClient-
|
|
5
|
-
import { t as ClassificationTestSignal } from "./TestTriggers-
|
|
1
|
+
import { Cn as PermissionGrant, D as CalmLensAppClientOptions, Hn as AssetBinaryPayloadInput, Ht as SignUploadTokenOptions, O as CalmLensServerClientOptions, Wt as SignedUploadToken, gn as TypedEvent, n as Asset, p as AssetModeration, wn as Folder } from "./CalmLensTypes-SmOCgKI3.js";
|
|
2
|
+
import { t as CalmLensAppClient } from "./CalmLensAppClient-CMVh0y5w.js";
|
|
3
|
+
import { l as ApiErrorCode, n as WebhookEventPayload } from "./WebhookPayload-C7KAk3iR.js";
|
|
4
|
+
import { t as CalmLensServerClient } from "./CalmLensServerClient-BFt1L_FZ.js";
|
|
5
|
+
import { t as ClassificationTestSignal } from "./TestTriggers-BJ4B-MXR-D1tGifPU.js";
|
|
6
6
|
import "zod";
|
|
7
7
|
/**
|
|
8
8
|
* Signs a single-use upload token with `apiKey`, locally. `CalmLensServerClient` and
|
|
@@ -64,6 +64,8 @@ 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
|
+
/** Why a decision waits for human review: `sampled`, or `uncertain` about some categories. */
|
|
68
|
+
type MockPendingReviewReason = "sampled" | "uncertain";
|
|
67
69
|
/**
|
|
68
70
|
* A moderation decision for `mockOptions.moderate` or `completeProcessing`, built with
|
|
69
71
|
* `mockDecision(status)`: flag the categories it found, with their scores and qualifiers, and
|
|
@@ -82,12 +84,19 @@ export declare class MockDecision {
|
|
|
82
84
|
flag(category: Category, score: number, qualifiers?: Record<string, number>): this;
|
|
83
85
|
/** Marks `category` as not assessed (`not-evaluated` for reason `not-supported`). */
|
|
84
86
|
notEvaluated(category: Category): this;
|
|
87
|
+
/**
|
|
88
|
+
* Leaves the decision waiting for human review, as `classification.moderation.pendingReview`
|
|
89
|
+
* reports: `sampled`, or `uncertain` with the `uncertainCategories` that made it so. The queue's
|
|
90
|
+
* decision (`decide` on the mock) clears it; `assets.decide` doesn't, as with the API.
|
|
91
|
+
*/
|
|
92
|
+
pendingReview(reason: MockPendingReviewReason, uncertainCategories?: Category[]): this;
|
|
85
93
|
/**
|
|
86
94
|
* The report a decided asset gets, as the API sends it: every category (unflagged ones
|
|
87
95
|
* evaluated with score 0), policy-adjusted results and the automated status and
|
|
88
|
-
* `flaggedCategories`. `
|
|
96
|
+
* `flaggedCategories`. `requestedAt` is when a pending review joined the queue. `undefined` for
|
|
97
|
+
* `pending` and `failed`.
|
|
89
98
|
*/
|
|
90
|
-
report(): Omit<AssetModeration, "status" | "manualReviews"> | undefined;
|
|
99
|
+
report(requestedAt?: number): Omit<AssetModeration, "status" | "manualReviews"> | undefined;
|
|
91
100
|
}
|
|
92
101
|
/** Starts a moderation decision with this status; see `MockDecision`. */
|
|
93
102
|
export declare const mockDecision: (status: MockAssetOutcome) => MockDecision;
|
package/cjs/testing.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const
|
|
3
|
-
const require_ModerationContextLimits = require("./ModerationContextLimits-
|
|
4
|
-
const require_CalmLensServerClient = require("./CalmLensServerClient-
|
|
5
|
-
const require_CalmLensOptionKeys = require("./CalmLensOptionKeys-
|
|
2
|
+
const require_TestTriggers_CiFcTHX3 = require("./TestTriggers-CiFcTHX3-BmfH4J3f.js");
|
|
3
|
+
const require_ModerationContextLimits = require("./ModerationContextLimits-C6Ts1Xhw.js");
|
|
4
|
+
const require_CalmLensServerClient = require("./CalmLensServerClient-BGlhX1Ep.js");
|
|
5
|
+
const require_CalmLensOptionKeys = require("./CalmLensOptionKeys-B4gAOSbY.js");
|
|
6
6
|
const require_CryptoUtils_B_x8lMIx = require("./CryptoUtils-B_x8lMIx-YBW1-bvL.js");
|
|
7
|
-
const require_CalmLensAppClient = require("./CalmLensAppClient-
|
|
8
|
-
const require_UploadController = require("./UploadController-
|
|
7
|
+
const require_CalmLensAppClient = require("./CalmLensAppClient-yNhGTyvi.js");
|
|
8
|
+
const require_UploadController = require("./UploadController-Bh2bqt8N.js");
|
|
9
9
|
let zod = require("zod");
|
|
10
|
-
zod =
|
|
10
|
+
zod = require_TestTriggers_CiFcTHX3.__toESM(zod, 1);
|
|
11
11
|
// src/contract/MediaTestTriggers.js
|
|
12
|
-
const MEDIA_TEST_SIGNALS = [...
|
|
12
|
+
const MEDIA_TEST_SIGNALS = [...require_TestTriggers_CiFcTHX3.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
|
|
34
|
+
return `Calm Lens test ${[...await require_TestTriggers_CiFcTHX3.getTestInputTag("media", signal, testInputKey)].map((character) => HEX_WORDS[Number.parseInt(character, 16)]).join(" ")} ${signal.replace(/[.-]/g, " ")} end test`;
|
|
35
35
|
}
|
|
36
36
|
// src/contract/Ids-BESMSxGb.js
|
|
37
37
|
var __defProp = Object.defineProperty;
|
|
@@ -8128,6 +8128,7 @@ const MOCK_QUALIFIERS = {
|
|
|
8128
8128
|
"sexual-educational",
|
|
8129
8129
|
"sexual-discussion",
|
|
8130
8130
|
"sexual-fictional",
|
|
8131
|
+
"sexual-artistic",
|
|
8131
8132
|
"sexual-support-prevention"
|
|
8132
8133
|
],
|
|
8133
8134
|
"violence": [
|
|
@@ -8288,6 +8289,7 @@ const isScore = (score) => typeof score === "number" && Number.isFinite(score) &
|
|
|
8288
8289
|
var MockDecision = class {
|
|
8289
8290
|
#flags = /* @__PURE__ */ new Map();
|
|
8290
8291
|
#notEvaluated = /* @__PURE__ */ new Set();
|
|
8292
|
+
#pendingReview;
|
|
8291
8293
|
constructor(status) {
|
|
8292
8294
|
if (!OUTCOMES.includes(status)) throw require_ModerationContextLimits.invalidArgument(`status must be one of ${OUTCOMES.join(", ")}`);
|
|
8293
8295
|
this.status = status;
|
|
@@ -8321,15 +8323,32 @@ var MockDecision = class {
|
|
|
8321
8323
|
this.#notEvaluated.add(category);
|
|
8322
8324
|
return this;
|
|
8323
8325
|
}
|
|
8326
|
+
/**
|
|
8327
|
+
* Leaves the decision waiting for human review, as `classification.moderation.pendingReview`
|
|
8328
|
+
* reports: `sampled`, or `uncertain` with the `uncertainCategories` that made it so. The queue's
|
|
8329
|
+
* decision (`decide` on the mock) clears it; `assets.decide` doesn't, as with the API.
|
|
8330
|
+
*/
|
|
8331
|
+
pendingReview(reason, uncertainCategories = []) {
|
|
8332
|
+
if (this.status === "pending" || this.status === "failed") throw require_ModerationContextLimits.invalidArgument(`a ${this.status} decision can't wait for review`);
|
|
8333
|
+
if (reason !== "sampled" && reason !== "uncertain") throw require_ModerationContextLimits.invalidArgument("reason must be sampled or uncertain");
|
|
8334
|
+
if (reason === "sampled" && uncertainCategories.length) throw require_ModerationContextLimits.invalidArgument("a sampled review has no uncertain categories");
|
|
8335
|
+
for (const category of uncertainCategories) this.#checkCategory(category);
|
|
8336
|
+
this.#pendingReview = {
|
|
8337
|
+
reason,
|
|
8338
|
+
uncertainCategories: [...uncertainCategories]
|
|
8339
|
+
};
|
|
8340
|
+
return this;
|
|
8341
|
+
}
|
|
8324
8342
|
#checkCategory(category) {
|
|
8325
8343
|
if (!MOCK_CATEGORIES.includes(category)) throw require_ModerationContextLimits.invalidArgument(`${category} is not a CalmLens category`);
|
|
8326
8344
|
}
|
|
8327
8345
|
/**
|
|
8328
8346
|
* The report a decided asset gets, as the API sends it: every category (unflagged ones
|
|
8329
8347
|
* evaluated with score 0), policy-adjusted results and the automated status and
|
|
8330
|
-
* `flaggedCategories`. `
|
|
8348
|
+
* `flaggedCategories`. `requestedAt` is when a pending review joined the queue. `undefined` for
|
|
8349
|
+
* `pending` and `failed`.
|
|
8331
8350
|
*/
|
|
8332
|
-
report() {
|
|
8351
|
+
report(requestedAt = 0) {
|
|
8333
8352
|
const status = this.status;
|
|
8334
8353
|
if (status === "pending" || status === "failed") return void 0;
|
|
8335
8354
|
const action = (score) => status !== "allowed" && score >= .5 ? STATUS_ACTION[status] : "allow";
|
|
@@ -8355,11 +8374,20 @@ var MockDecision = class {
|
|
|
8355
8374
|
return {
|
|
8356
8375
|
categories: Object.fromEntries(evaluated.map(([category, score]) => [category, {
|
|
8357
8376
|
score,
|
|
8358
|
-
action: action(score)
|
|
8377
|
+
action: action(score),
|
|
8378
|
+
source: { kind: score >= .5 ? "default" : "below-threshold" },
|
|
8379
|
+
settings: {
|
|
8380
|
+
action: status === "allowed" ? "allow" : STATUS_ACTION[status],
|
|
8381
|
+
allowances: [],
|
|
8382
|
+
restrictions: []
|
|
8383
|
+
}
|
|
8359
8384
|
}])),
|
|
8360
8385
|
explanationComplete: true,
|
|
8361
8386
|
policy: null,
|
|
8362
|
-
pendingReview:
|
|
8387
|
+
pendingReview: this.#pendingReview ? {
|
|
8388
|
+
requestedAt,
|
|
8389
|
+
...this.#pendingReview
|
|
8390
|
+
} : null,
|
|
8363
8391
|
source: "policy",
|
|
8364
8392
|
rule: null,
|
|
8365
8393
|
automatedStatus: status,
|
|
@@ -9242,8 +9270,7 @@ const mockPlaceholderPng = (thumbhash) => Uint8Array.from(atob(require_UploadCon
|
|
|
9242
9270
|
const NO_RENDERING = {
|
|
9243
9271
|
rendered: null,
|
|
9244
9272
|
preview: null,
|
|
9245
|
-
hls: null
|
|
9246
|
-
hlsStatus: null
|
|
9273
|
+
hls: null
|
|
9247
9274
|
};
|
|
9248
9275
|
/** The size of the waveform the API makes as an audio asset's preview. */
|
|
9249
9276
|
const WAVEFORM_SIZE = {
|
|
@@ -9301,8 +9328,7 @@ const mockRendering = (asset, processed) => {
|
|
|
9301
9328
|
...unsized
|
|
9302
9329
|
},
|
|
9303
9330
|
preview: preview(unsized),
|
|
9304
|
-
hls: null
|
|
9305
|
-
hlsStatus: null
|
|
9331
|
+
hls: null
|
|
9306
9332
|
};
|
|
9307
9333
|
case "website": return {
|
|
9308
9334
|
rendered: {
|
|
@@ -9311,8 +9337,7 @@ const mockRendering = (asset, processed) => {
|
|
|
9311
9337
|
...unsized
|
|
9312
9338
|
},
|
|
9313
9339
|
preview: preview(unsized),
|
|
9314
|
-
hls: null
|
|
9315
|
-
hlsStatus: null
|
|
9340
|
+
hls: null
|
|
9316
9341
|
};
|
|
9317
9342
|
case "multimedia-document":
|
|
9318
9343
|
if (SPREADSHEET_MIME_TYPES.includes(mimeType)) return NO_RENDERING;
|
|
@@ -9323,8 +9348,7 @@ const mockRendering = (asset, processed) => {
|
|
|
9323
9348
|
...unsized
|
|
9324
9349
|
},
|
|
9325
9350
|
preview: processed ? preview(unsized) : null,
|
|
9326
|
-
hls: null
|
|
9327
|
-
hlsStatus: null
|
|
9351
|
+
hls: null
|
|
9328
9352
|
};
|
|
9329
9353
|
case "video": return {
|
|
9330
9354
|
rendered: {
|
|
@@ -9333,8 +9357,7 @@ const mockRendering = (asset, processed) => {
|
|
|
9333
9357
|
...unsized
|
|
9334
9358
|
},
|
|
9335
9359
|
preview: null,
|
|
9336
|
-
hls: null
|
|
9337
|
-
hlsStatus: null
|
|
9360
|
+
hls: null
|
|
9338
9361
|
};
|
|
9339
9362
|
case "audio": return {
|
|
9340
9363
|
rendered: {
|
|
@@ -9344,8 +9367,7 @@ const mockRendering = (asset, processed) => {
|
|
|
9344
9367
|
...processed && { peaks: [] }
|
|
9345
9368
|
},
|
|
9346
9369
|
preview: processed ? preview(WAVEFORM_SIZE) : null,
|
|
9347
|
-
hls: null
|
|
9348
|
-
hlsStatus: null
|
|
9370
|
+
hls: null
|
|
9349
9371
|
};
|
|
9350
9372
|
default: return NO_RENDERING;
|
|
9351
9373
|
}
|
|
@@ -9497,7 +9519,7 @@ const MOCK_PRESET_NAMES = {
|
|
|
9497
9519
|
* personal information and profanity, `block` otherwise) and no rules. The mock holds no built-in
|
|
9498
9520
|
* preset settings, and uploads are never decided by a policy.
|
|
9499
9521
|
*/
|
|
9500
|
-
const mockPresetSettings = () => ({ categorySettings: Object.fromEntries(
|
|
9522
|
+
const mockPresetSettings = () => ({ categorySettings: Object.fromEntries(require_TestTriggers_CiFcTHX3.CLASSIFICATION_CATEGORIES.map((category) => [category, {
|
|
9501
9523
|
action: category === "personal-information" || category === "profanity" ? "allow" : "block",
|
|
9502
9524
|
allowances: [],
|
|
9503
9525
|
restrictions: []
|
|
@@ -9509,13 +9531,13 @@ const mockPresetSettings = () => ({ categorySettings: Object.fromEntries(require
|
|
|
9509
9531
|
const checkPolicySettings = (settings) => {
|
|
9510
9532
|
const categories = settings?.categorySettings;
|
|
9511
9533
|
if (!categories || typeof categories !== "object") throw invalidField("validation/invalid-type", "settings.categorySettings");
|
|
9512
|
-
for (const category of
|
|
9534
|
+
for (const category of require_TestTriggers_CiFcTHX3.CLASSIFICATION_CATEGORIES) {
|
|
9513
9535
|
const value = categories[category];
|
|
9514
9536
|
if (!value || typeof value !== "object") throw invalidField("validation/invalid-type", `settings.categorySettings.${category}`);
|
|
9515
9537
|
for (const key of ["allowances", "restrictions"]) if (!Array.isArray(value[key])) throw invalidField("validation/invalid-type", `settings.categorySettings.${category}.${key}`);
|
|
9516
9538
|
if (typeof value.action !== "string") throw invalidField("validation/invalid-value", `settings.categorySettings.${category}.action`);
|
|
9517
9539
|
}
|
|
9518
|
-
for (const key of Object.keys(categories)) if (!
|
|
9540
|
+
for (const key of Object.keys(categories)) if (!require_TestTriggers_CiFcTHX3.CLASSIFICATION_CATEGORIES.includes(key)) throw invalidField("validation/unknown-field", `settings.categorySettings.${key}`);
|
|
9519
9541
|
};
|
|
9520
9542
|
/** The client methods that send a request, the one it is recorded under first. */
|
|
9521
9543
|
const operationsOf = (request) => {
|
|
@@ -9759,6 +9781,7 @@ var MockCalmLensApi = class {
|
|
|
9759
9781
|
this.pendingReruns.delete(asset.id);
|
|
9760
9782
|
const decided = await this.applyOutcome(asset, decision, "requested");
|
|
9761
9783
|
const now = this.now();
|
|
9784
|
+
if (!review) decided.classification.moderation.pendingReview = null;
|
|
9762
9785
|
decided.classification.moderation.manualReviews = [...decided.classification.moderation.manualReviews ?? [], {
|
|
9763
9786
|
id: this.createId("rev"),
|
|
9764
9787
|
decision,
|
|
@@ -10638,7 +10661,40 @@ var MockCalmLensApi = class {
|
|
|
10638
10661
|
};
|
|
10639
10662
|
}
|
|
10640
10663
|
async createAsset(request) {
|
|
10641
|
-
return this.storeAsset(this.uploadFields(request), request.query.get("wait") === "false");
|
|
10664
|
+
return this.storeAsset(this.applyUploadPreset(this.uploadFields(request)), request.query.get("wait") === "false");
|
|
10665
|
+
}
|
|
10666
|
+
/**
|
|
10667
|
+
* An API-key upload through a preset, as the API applies it: the preset gives the folder and
|
|
10668
|
+
* visibility, which the upload can't change, and the processing options unless the upload sets
|
|
10669
|
+
* its own, and refuses types and sizes it doesn't accept.
|
|
10670
|
+
*/
|
|
10671
|
+
applyUploadPreset(fields) {
|
|
10672
|
+
if (!fields.uploadPresetId) return fields;
|
|
10673
|
+
const preset = [...this.configuredPresets.values()].find(({ id }) => id === fields.uploadPresetId);
|
|
10674
|
+
if (!preset) throw fail(require_ModerationContextLimits.API_ERROR_CODES.UPLOAD_PRESET_NOT_FOUND);
|
|
10675
|
+
if (!preset.enabled) throw fail(require_ModerationContextLimits.API_ERROR_CODES.UPLOAD_PRESET_DISABLED);
|
|
10676
|
+
if (preset.folderId && fields.folderId && fields.folderId !== preset.folderId) throw fail(require_ModerationContextLimits.API_ERROR_CODES.UPLOAD_PRESET_FIELD_NOT_ALLOWED, { details: { field: "folderId" } });
|
|
10677
|
+
if (fields.visibility && fields.visibility !== preset.visibility) throw fail(require_ModerationContextLimits.API_ERROR_CODES.UPLOAD_PRESET_FIELD_NOT_ALLOWED, { details: { field: "visibility" } });
|
|
10678
|
+
const contentType = fields.contentType;
|
|
10679
|
+
if (preset.allowedContentTypes?.length && contentType !== void 0 && !require_UploadController.isFileAccepted({
|
|
10680
|
+
name: fields.name,
|
|
10681
|
+
type: contentType
|
|
10682
|
+
}, preset.allowedContentTypes.join(","))) throw fail(require_ModerationContextLimits.API_ERROR_CODES.UNSUPPORTED_UPLOAD_TYPE, { details: {
|
|
10683
|
+
source: "preset",
|
|
10684
|
+
contentType,
|
|
10685
|
+
allowedContentTypes: preset.allowedContentTypes
|
|
10686
|
+
} });
|
|
10687
|
+
const size = fields.part?.totalSizeInBytes ?? fields.bytes?.byteLength;
|
|
10688
|
+
if (preset.maxSizeInBytes && size !== void 0 && size > preset.maxSizeInBytes) throw fail(require_ModerationContextLimits.API_ERROR_CODES.UPLOAD_TOO_LARGE, { details: {
|
|
10689
|
+
limitBytes: preset.maxSizeInBytes,
|
|
10690
|
+
source: "preset"
|
|
10691
|
+
} });
|
|
10692
|
+
return {
|
|
10693
|
+
...fields,
|
|
10694
|
+
folderId: preset.folderId ?? fields.folderId,
|
|
10695
|
+
visibility: preset.visibility,
|
|
10696
|
+
processingOptions: fields.processingOptions ?? preset.processingOptions
|
|
10697
|
+
};
|
|
10642
10698
|
}
|
|
10643
10699
|
async storeAsset(fields, queue) {
|
|
10644
10700
|
if (!fields.name) throw fail(require_ModerationContextLimits.API_ERROR_CODES.INVALID_UPLOAD_PAYLOAD, { message: "Asset name is required" });
|
|
@@ -10872,7 +10928,7 @@ var MockCalmLensApi = class {
|
|
|
10872
10928
|
* it, a decided image reports the person and face detection its upload turned on.
|
|
10873
10929
|
*/
|
|
10874
10930
|
async decided(asset, decision) {
|
|
10875
|
-
const next = await this.applyOutcome(asset, decision.status, "policy", decision.report());
|
|
10931
|
+
const next = await this.applyOutcome(asset, decision.status, "policy", decision.report(this.now()));
|
|
10876
10932
|
const features = this.processingOptions.get(asset.id)?.features;
|
|
10877
10933
|
if (next.classification.status !== "completed" || asset.type !== "image") return next;
|
|
10878
10934
|
return {
|
|
@@ -11141,7 +11197,11 @@ var MockCalmLensApi = class {
|
|
|
11141
11197
|
if (preset.allowedContentTypes && !require_UploadController.isFileAccepted({
|
|
11142
11198
|
name: fields.name,
|
|
11143
11199
|
type: fields.contentType ?? ""
|
|
11144
|
-
}, preset.allowedContentTypes.join(","))) throw fail(require_ModerationContextLimits.API_ERROR_CODES.UNSUPPORTED_UPLOAD_TYPE, { details: {
|
|
11200
|
+
}, preset.allowedContentTypes.join(","))) throw fail(require_ModerationContextLimits.API_ERROR_CODES.UNSUPPORTED_UPLOAD_TYPE, { details: {
|
|
11201
|
+
source: "preset",
|
|
11202
|
+
contentType: fields.contentType ?? "",
|
|
11203
|
+
allowedContentTypes: preset.allowedContentTypes
|
|
11204
|
+
} });
|
|
11145
11205
|
const size = fields.part?.totalSizeInBytes ?? fields.bytes?.byteLength;
|
|
11146
11206
|
if (preset.maxFileSizeInBytes !== void 0 && size !== void 0 && size > preset.maxFileSizeInBytes) throw fail(require_ModerationContextLimits.API_ERROR_CODES.UPLOAD_TOO_LARGE, { details: {
|
|
11147
11207
|
limitBytes: preset.maxFileSizeInBytes,
|
|
@@ -11449,10 +11509,11 @@ var MockCalmLensApi = class {
|
|
|
11449
11509
|
ensureLens(options) {
|
|
11450
11510
|
const existing = this.lenses.get(options.identifier);
|
|
11451
11511
|
if (!existing) return this.saveNewLens(options);
|
|
11452
|
-
if (existing.name === options.name && (existing.description ?? null) === (options.description ?? null) && existing.type === options.type && existing.active === options.active && require_CalmLensServerClient.stringifyJsonCanonical(existing.transform ?? null) === require_CalmLensServerClient.stringifyJsonCanonical(options.transform ?? null)) return existing;
|
|
11512
|
+
if (existing.name === options.name && (existing.description ?? null) === (options.description ?? null) && existing.type === options.type && existing.active === (options.active ?? true) && require_CalmLensServerClient.stringifyJsonCanonical(existing.transform ?? null) === require_CalmLensServerClient.stringifyJsonCanonical(options.transform ?? null)) return existing;
|
|
11453
11513
|
const lens = {
|
|
11454
11514
|
...existing,
|
|
11455
11515
|
...options,
|
|
11516
|
+
active: options.active ?? true,
|
|
11456
11517
|
updatedAt: this.now()
|
|
11457
11518
|
};
|
|
11458
11519
|
this.lenses.set(lens.identifier, lens);
|
|
@@ -11464,6 +11525,7 @@ var MockCalmLensApi = class {
|
|
|
11464
11525
|
id: this.createId("lens"),
|
|
11465
11526
|
projectId: this.projectId,
|
|
11466
11527
|
...options,
|
|
11528
|
+
active: options.active ?? true,
|
|
11467
11529
|
createdAt: now,
|
|
11468
11530
|
updatedAt: now
|
|
11469
11531
|
};
|
|
@@ -11570,12 +11632,14 @@ var MockCalmLensApi = class {
|
|
|
11570
11632
|
code: "asset/not-available",
|
|
11571
11633
|
message: "Asset is not available"
|
|
11572
11634
|
}, url);
|
|
11573
|
-
const
|
|
11635
|
+
const hasApiKey = request.headers.get("x-api-key") === this.apiKey;
|
|
11636
|
+
const grants = hasApiKey ? this.grants : [];
|
|
11574
11637
|
const folders = await this.databaseStorage.listFolders?.(this.projectId) ?? [];
|
|
11575
11638
|
const canDownload = () => permits(grants, "assets:download", asset.folderId ?? null, folders);
|
|
11576
11639
|
const status = asset.classification.moderation.status;
|
|
11577
11640
|
const isHead = request.method === "HEAD";
|
|
11578
11641
|
const { rendered, preview } = asset.content;
|
|
11642
|
+
if (asset.visibility !== "public" && !grant && !hasApiKey && resource !== "placeholder" && resource !== "info") return notFound();
|
|
11579
11643
|
if (resource === "info") return this.serveInfo(request, asset, Boolean(grant) || canDownload());
|
|
11580
11644
|
if (asset.content.safetyHold) return notAvailable();
|
|
11581
11645
|
if (resource === "placeholder") {
|
|
@@ -11609,7 +11673,7 @@ var MockCalmLensApi = class {
|
|
|
11609
11673
|
"X-Content-Type-Options": "nosniff"
|
|
11610
11674
|
});
|
|
11611
11675
|
if (resource === "rendered" && !rendered || resource === "preview" && !preview) return noRenderedVersion();
|
|
11612
|
-
if (isHls &&
|
|
11676
|
+
if (isHls && asset.content.hls?.status !== "ready") return noRenderedVersion();
|
|
11613
11677
|
const stillImage = resource === "preview" || resource === "rendered" && rendered?.kind === "image";
|
|
11614
11678
|
if (!stillImage && hasSelector) return invalidTransform();
|
|
11615
11679
|
if (selector.options) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const require_ModerationContextLimits = require("./ModerationContextLimits-
|
|
2
|
-
const require_UploadController = require("./UploadController-
|
|
3
|
-
require("./Core-
|
|
1
|
+
const require_ModerationContextLimits = require("./ModerationContextLimits-C6Ts1Xhw.js");
|
|
2
|
+
const require_UploadController = require("./UploadController-Bh2bqt8N.js");
|
|
3
|
+
require("./Core-zXLf8JKh.js");
|
|
4
4
|
// src/ui/viewers/PdfLoader.ts
|
|
5
5
|
let loading;
|
|
6
6
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "./CalmLensTypes-
|
|
2
|
-
import { G as AssetSession, W as AssetOptions, Y as AssetView, at as ImageViewerOptions, ct as TextViewerOptions, ft as WebsiteViewerOptions, it as DocumentViewerOptions, ot as PdfAssetOptions, st as SpreadsheetViewerOptions, ut as ViewerOptions } from "./Core-
|
|
1
|
+
import "./CalmLensTypes-SmOCgKI3.js";
|
|
2
|
+
import { G as AssetSession, W as AssetOptions, Y as AssetView, at as ImageViewerOptions, ct as TextViewerOptions, ft as WebsiteViewerOptions, it as DocumentViewerOptions, ot as PdfAssetOptions, st as SpreadsheetViewerOptions, ut as ViewerOptions } from "./Core-Dt_HUNvH.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> {
|