calmlens 0.27.5 → 0.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/bin/calmlens.js +48 -26
- package/cjs/{BrowserUpload-DJZY1LSU.d.ts → BrowserUpload-CRbCsX7a.d.ts} +2 -2
- package/cjs/{BrowserUpload-DhruIgFN.js → BrowserUpload-Dz4UwTTJ.js} +1 -1
- package/cjs/{CalmLensAppClient-BA_xaNHY.js → CalmLensAppClient-B0QZ1oJV.js} +3 -3
- package/{esm/CalmLensAppClient-DzoSqUgG.d.ts → cjs/CalmLensAppClient-B3u6BlP5.d.ts} +2 -2
- package/cjs/{CalmLensOptionKeys-BvLQghl-.js → CalmLensOptionKeys-Cat8CgOn.js} +2 -2
- package/cjs/{CalmLensServerClient-D3K5HS9v.d.ts → CalmLensServerClient-B8ntjNL3.d.ts} +6 -6
- package/cjs/{CalmLensServerClient-D55xDZm4.js → CalmLensServerClient-CQdvhCGg.js} +14 -14
- package/cjs/{CalmLensTypes-OWZsGvBX.d.ts → CalmLensTypes-CtO4Dieu.d.ts} +79 -8
- package/{esm/Core-CTO_Eh0l.d.ts → cjs/Core-BJaLU71Q.d.ts} +2 -2
- package/cjs/{Core-kKGmyk5V.js → Core-DCnnUsgF.js} +7 -4
- package/cjs/{CryptoUtils-B_x8lMIx-YBW1-bvL.js → CryptoUtils-BLCa-oZe-leCkr1ko.js} +1 -2
- package/cjs/{ModerationContextLimits-Cxaob3tc.js → ModerationContextLimits-_knOVCH0.js} +63 -8
- package/cjs/{ReactUpload-BDXV4aHT.d.ts → ReactUpload-BGUkcMpg.d.ts} +1 -1
- package/cjs/{ReactUpload-Cx3Hi7xt.js → ReactUpload-BtmIrdky.js} +1 -1
- package/{esm/TestTriggers-Dnukm-jm-DoEB7jJc.d.ts → cjs/TestTriggers-dognME9k-PWyIfHMI.d.ts} +1 -2
- package/cjs/{TestTriggers-Cvi7e2KA-DcT1pc_W.js → TestTriggers-uL2Ec8Vt-cPmmKvYd.js} +14 -15
- package/cjs/{UploadController-CC1afxmL.js → UploadController-CEL3N4Ae.js} +2 -2
- package/cjs/{WebhookPayload-CrMU6lg0.d.ts → WebhookPayload-DZadhbAJ.d.ts} +5 -1
- package/cjs/app.d.ts +4 -4
- package/cjs/app.js +2 -2
- package/cjs/elements.d.ts +4 -4
- package/cjs/elements.js +4 -4
- package/cjs/{index-BDxmVi-G.d.ts → index-DQUZYLVY.d.ts} +2 -2
- package/cjs/index.d.ts +3 -3
- package/cjs/index.js +1 -1
- package/cjs/react-native.d.ts +2 -2
- package/cjs/react-native.js +5 -5
- package/cjs/react.d.ts +4 -4
- package/cjs/react.js +5 -5
- package/cjs/server.d.ts +4 -4
- 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 +36 -7
- package/cjs/testing.js +112 -43
- package/cjs/{ui-DAbpyM2Z.d.ts → ui-BGywTQ2M.d.ts} +2 -2
- package/cjs/{ui-I75EvP9r.js → ui-DVQm0TFJ.js} +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-DJZY1LSU.d.ts → BrowserUpload-CRbCsX7a.d.ts} +2 -2
- package/esm/{BrowserUpload-CejeWw5r.js → BrowserUpload-DSq5Ezo1.js} +1 -1
- package/esm/{CalmLensAppClient-BxkCVPCl.js → CalmLensAppClient-B1QpSXYm.js} +3 -3
- package/{cjs/CalmLensAppClient-DzoSqUgG.d.ts → esm/CalmLensAppClient-B3u6BlP5.d.ts} +2 -2
- package/esm/{CalmLensOptionKeys-DC9FUO43.js → CalmLensOptionKeys-BYqFZ0FP.js} +2 -2
- package/esm/{CalmLensServerClient-D3K5HS9v.d.ts → CalmLensServerClient-B8ntjNL3.d.ts} +6 -6
- package/esm/{CalmLensServerClient-D-TIIQp2.js → CalmLensServerClient-D2Vr_jTR.js} +10 -10
- package/esm/{CalmLensTypes-OWZsGvBX.d.ts → CalmLensTypes-CtO4Dieu.d.ts} +79 -8
- package/{cjs/Core-CTO_Eh0l.d.ts → esm/Core-BJaLU71Q.d.ts} +2 -2
- package/esm/{Core-B85V5dxv.js → Core-Dz7BAias.js} +7 -4
- package/esm/{CryptoUtils-B_x8lMIx-DhuWGzqn.js → CryptoUtils-BLCa-oZe-DKr3LmN6.js} +1 -2
- package/esm/{ModerationContextLimits-Tev2lxE0.js → ModerationContextLimits-DaFaXt45.js} +46 -9
- package/esm/{ReactUpload-BDXV4aHT.d.ts → ReactUpload-BGUkcMpg.d.ts} +1 -1
- package/esm/{ReactUpload-B7QXMSWJ.js → ReactUpload-kSzn3SOj.js} +1 -1
- package/{cjs/TestTriggers-Dnukm-jm-DoEB7jJc.d.ts → esm/TestTriggers-dognME9k-PWyIfHMI.d.ts} +1 -2
- package/esm/{TestTriggers-Cvi7e2KA-BA83CRJb.js → TestTriggers-uL2Ec8Vt-DYbTEJWm.js} +11 -12
- package/esm/{UploadController-D7XmzO-p.js → UploadController--Qz3DP2W.js} +2 -2
- package/esm/{WebhookPayload-CrMU6lg0.d.ts → WebhookPayload-DZadhbAJ.d.ts} +5 -1
- package/esm/app.d.ts +4 -4
- package/esm/app.js +2 -2
- package/esm/elements.d.ts +4 -4
- package/esm/elements.js +4 -4
- package/esm/{index-BDxmVi-G.d.ts → index-DQUZYLVY.d.ts} +2 -2
- package/esm/index.d.ts +3 -3
- package/esm/index.js +1 -1
- package/esm/react-native.d.ts +2 -2
- package/esm/react-native.js +5 -5
- package/esm/react.d.ts +4 -4
- package/esm/react.js +5 -5
- package/esm/server.d.ts +4 -4
- 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 +36 -7
- package/esm/testing.js +103 -34
- package/esm/{ui-cE1lyljs.js → ui-B951EpwC.js} +2 -2
- package/esm/{ui-DAbpyM2Z.d.ts → ui-BGywTQ2M.d.ts} +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/server.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { a as ClassificationNotEvaluatedReason, c as ModerationQualifier, d as HashListEntry, f as ModerationContext, g as selectModerationContextItems, h as ModerationContextItem, i as ClassificationCategoryReport, l as PolicyAction, m as MODERATION_CONTEXT_USED_ITEMS, n as ClassificationCategories, o as ClassificationQualifierResults, p as MODERATION_CONTEXT_USED_CHARACTERS, r as ClassificationCategory, s as Likelihood, u as HashList } from "./Classification-CMM2tZpJ-IdIh63n0.js";
|
|
2
|
-
import { $ as FolderPage, $t as VerifyWebhookSignatureOptions, A as CdnAssetLocation, An as Policy, At as RetrieveAssetOptions, B as CreateHashListOptions, Bn as AssetRendered, Bt as UpdateAssetOptions, C as AssetUploadStatus, Cn as BoundingBox, Ct as MultipartUploadPartOptions, D as BatchAssetsResponse, Dn as ProcessingFeatureResults, Dt as RequestAttempt, E as BatchAssetsOptions, En as ProcessingFeatureId, Et as RemoveAssetContentOptions, F as CdnTransform, Ft as SignUploadTokenOptions, G as DeleteAssetOptions, Gn as FileMetadata, Gt as UpdateProjectSettingsOptions, H as CreateMultipartUploadPartOptions, Hn as AssetSafetyHold, Ht as UpdateHashListOptions, I as ClassifyTextOptions, In as AssetInfo, It as SignedAssetUrl, J as EnsureLensesOptions, Jt as UploadPresetDefinition, K as DeleteMetadataFieldOptions, Kn as MetadataItem, Kt as UpgradePolicyOptions, L as ClientRequestDefaults, Ln as AssetHls, Lt as SignedUploadToken, M as CdnAssetUrlOptions, Mn as LensType, Mt as SearchAssetsOptions, N as CdnResource, Nn as AssetSearchMatchField, Nt as SetPolicyAutomaticUpdatesOptions, O as CalmLensAppClientOptions, On as ProcessingFeatureStage, Ot as RequestOptions, P as CdnServeOptions, Pn as AssetSearchQuery, Pt as SignAssetUrlOptions, Q as FolderIdOptions, Qt as UploadedAsset, R as ConnectionOptions, Rn as AssetHlsRendition, Rt as StreamingFeatureOptions, S as AssetUpload, Sn as AgeRange, St as MultipartUploadOptions, T as AssignPolicyOptions, Tn as DetectedPerson, Tt as PolicyPage, U as CreatePolicyOptions, Un as AssetSafetyHoldReason, Ut as UpdateLensOptions, V as CreateLensOptions, Vn as AssetRenderedKind, Vt as UpdateFolderOptions, W as DecideAssetOptions, Wn as ExtractedText, Wt as UpdatePolicyOptions, X as EnsureUploadPresetsOptions, Xt as UploadPresetPage, Y as EnsureMetadataFieldsOptions, Yt as UploadPresetIdOptions, Z as EnsureUploadPresetsResponse, Zt as UploadPresetSubmitAssetOptions, _ as AssetPage, _n as Folder, _t as ListLensesOptions, a as AssetChecksums, an as AssetTimelineSegment, at as IdempotencyOptions, b as AssetTimelinePage, bn as PublicProjectSettings, bt as MoveAssetOptions, c as AssetClassificationFailureReason, cn as EventAsset, ct as LensIdOptions, d as AssetContentOptions, dn as EventFact, dt as ListAssetTimelineOptions, en as ViewerClaims, et as GetAssetInfoOptions, f as AssetContentRemovalReason, fn as EventFactValues, ft as ListAssetsOptions, g as AssetModerationStatus, gt as ListHashListsOptions, h as AssetModerationDecision, hn as EventType, ht as ListHashListEntriesOptions, i as AssetAvailability, in as AssetBatchOperation, it as HashListPage, j as CdnAssetReference, jn as CursorPage, jt as RetryAssetOptions, k as CalmLensServerClientOptions, kn as ProcessingFeatures, kt as ResetPolicyOptions, l as AssetClassificationStatus, ln as TypedEvent, lt as LensPage, m as AssetModeration, mn as EventSeverity, mt as ListFoldersOptions, n as AppInfo, nn as WebhookHeadersInput, nt as HashListEntryPage, o as AssetChildrenPage, on as GetEventsResponse, ot as ImageTransformOptions, p as AssetContentStatus, pn as EventFacts, pt as ListEventsOptions, q as EnsureLensOptions, qn as ProcessingOptions, qt as UploadAssetPartOptions, r as Asset, rn as WebhookPayloadInput, rt as HashListIdOptions, s as AssetClassification, st as Lens, t as AddHashListEntryOptions, tn as WaitForAssetDecisionOptions, tt as HashListEntryIdOptions, u as AssetContent, un as EventCategory, ut as ListAssetChildrenOptions, v as AssetSearchResponse, vn as MetadataFieldsResource, vt as ListPoliciesOptions, w as AssetVisibility, wn as DetectedFace, wt as PolicyIdOptions, x as AssetType, xn as UploadPreset, xt as MoveFolderOptions, y as AssetSearchResult, yn as ProjectSettingsResource, yt as ListUploadPresetsOptions, z as CreateFolderOptions, zn as AssetPreview, zt as SubmitAssetOptions } from "./CalmLensTypes-
|
|
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 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 FolderPage, $t as VerifyWebhookSignatureOptions, A as CdnAssetLocation, An as Policy, At as RetrieveAssetOptions, B as CreateHashListOptions, Bn as AssetRendered, Bt as UpdateAssetOptions, C as AssetUploadStatus, Cn as BoundingBox, Ct as MultipartUploadPartOptions, D as BatchAssetsResponse, Dn as ProcessingFeatureResults, Dt as RequestAttempt, E as BatchAssetsOptions, En as ProcessingFeatureId, Et as RemoveAssetContentOptions, F as CdnTransform, Ft as SignUploadTokenOptions, G as DeleteAssetOptions, Gn as FileMetadata, Gt as UpdateProjectSettingsOptions, H as CreateMultipartUploadPartOptions, Hn as AssetSafetyHold, Ht as UpdateHashListOptions, I as ClassifyTextOptions, In as AssetInfo, It as SignedAssetUrl, J as EnsureLensesOptions, Jt as UploadPresetDefinition, K as DeleteMetadataFieldOptions, Kn as MetadataItem, Kt as UpgradePolicyOptions, L as ClientRequestDefaults, Ln as AssetHls, Lt as SignedUploadToken, M as CdnAssetUrlOptions, Mn as LensType, Mt as SearchAssetsOptions, N as CdnResource, Nn as AssetSearchMatchField, Nt as SetPolicyAutomaticUpdatesOptions, O as CalmLensAppClientOptions, On as ProcessingFeatureStage, Ot as RequestOptions, P as CdnServeOptions, Pn as AssetSearchQuery, Pt as SignAssetUrlOptions, Q as FolderIdOptions, Qt as UploadedAsset, R as ConnectionOptions, Rn as AssetHlsRendition, Rt as StreamingFeatureOptions, S as AssetUpload, Sn as AgeRange, St as MultipartUploadOptions, T as AssignPolicyOptions, Tn as DetectedPerson, Tt as PolicyPage, U as CreatePolicyOptions, Un as AssetSafetyHoldReason, Ut as UpdateLensOptions, V as CreateLensOptions, Vn as AssetRenderedKind, Vt as UpdateFolderOptions, W as DecideAssetOptions, Wn as ExtractedText, Wt as UpdatePolicyOptions, X as EnsureUploadPresetsOptions, Xt as UploadPresetPage, Y as EnsureMetadataFieldsOptions, Yt as UploadPresetIdOptions, Z as EnsureUploadPresetsResponse, Zt as UploadPresetSubmitAssetOptions, _ as AssetPage, _n as Folder, _t as ListLensesOptions, a as AssetChecksums, an as AssetTimelineSegment, at as IdempotencyOptions, b as AssetTimelinePage, bn as PublicProjectSettings, bt as MoveAssetOptions, c as AssetClassificationFailureReason, cn as EventAsset, ct as LensIdOptions, d as AssetContentOptions, dn as EventFact, dt as ListAssetTimelineOptions, en as ViewerClaims, et as GetAssetInfoOptions, f as AssetContentRemovalReason, fn as EventFactValues, ft as ListAssetsOptions, g as AssetModerationStatus, gt as ListHashListsOptions, h as AssetModerationDecision, hn as EventType, ht as ListHashListEntriesOptions, i as AssetAvailability, in as AssetBatchOperation, it as HashListPage, j as CdnAssetReference, jn as CursorPage, jt as RetryAssetOptions, k as CalmLensServerClientOptions, kn as ProcessingFeatures, kt as ResetPolicyOptions, l as AssetClassificationStatus, ln as TypedEvent, lt as LensPage, m as AssetModeration, mn as EventSeverity, mt as ListFoldersOptions, n as AppInfo, nn as WebhookHeadersInput, nt as HashListEntryPage, o as AssetChildrenPage, on as GetEventsResponse, ot as ImageTransformOptions, p as AssetContentStatus, pn as EventFacts, pt as ListEventsOptions, q as EnsureLensOptions, qn as ProcessingOptions, qt as UploadAssetPartOptions, r as Asset, rn as WebhookPayloadInput, rt as HashListIdOptions, s as AssetClassification, st as Lens, t as AddHashListEntryOptions, tn as WaitForAssetDecisionOptions, tt as HashListEntryIdOptions, u as AssetContent, un as EventCategory, ut as ListAssetChildrenOptions, v as AssetSearchResponse, vn as MetadataFieldsResource, vt as ListPoliciesOptions, w as AssetVisibility, wn as DetectedFace, wt as PolicyIdOptions, x as AssetType, xn as UploadPreset, xt as MoveFolderOptions, y as AssetSearchResult, yn as ProjectSettingsResource, yt as ListUploadPresetsOptions, z as CreateFolderOptions, zn as AssetPreview, zt as SubmitAssetOptions } from "./CalmLensTypes-CtO4Dieu.js";
|
|
3
|
+
import { i as getAssetInfo, n as DEFAULT_CDN_BASE_URL, r as CDN_RESOURCES, t as SDK_VERSION } from "./index-DQUZYLVY.js";
|
|
4
|
+
import { A as CalmLensRateLimitError, C as CalmLensErrorKind, D as CalmLensNotFoundError, E as CalmLensInvalidResponseError, F as SdkErrorCode, I as ApiErrorCode, M as CalmLensTimeoutError, N as CalmLensUnprocessableEntityError, O as CalmLensPayloadTooLargeError, P as CalmLensWebhookVerificationError, S as CalmLensErrorDetails, T as CalmLensInvalidArgumentError, _ as CalmLensConfigurationError, a as AUTO_PAGING_TO_ARRAY_MAX, b as CalmLensError, c as CalmLensLastResponse, d as ListPromise, f as CALMLENS_ERROR_CODES, g as CalmLensCancelledError, h as CalmLensBadRequestError, i as ServedAssetInfo, j as CalmLensServerError, k as CalmLensPermissionDeniedError, l as CalmLensResponse, m as CalmLensAuthenticationError, o as AutoPaging, p as CalmLensApiError, r as CdnResponse, s as AutoPagingToArrayOptions, t as ReceivedWebhookEventPayload, u as ListPage, v as CalmLensConflictError, w as CalmLensErrorOptions, x as CalmLensErrorCode, y as CalmLensConnectionError } from "./WebhookPayload-DZadhbAJ.js";
|
|
5
|
+
import { t as CalmLensServerClient } from "./CalmLensServerClient-B8ntjNL3.js";
|
|
6
6
|
export declare const WEBHOOK_DELIVERY_HEADER = "x-calmlens-delivery";
|
|
7
7
|
export declare const WEBHOOK_TIMESTAMP_HEADER = "x-calmlens-timestamp";
|
|
8
8
|
export declare const WEBHOOK_SIGNATURE_HEADER = "x-calmlens-signature";
|
package/cjs/server.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_ModerationContextLimits = require("./ModerationContextLimits-
|
|
2
|
+
const require_ModerationContextLimits = require("./ModerationContextLimits-_knOVCH0.js");
|
|
3
3
|
require("./index.js");
|
|
4
|
-
const require_CalmLensServerClient = require("./CalmLensServerClient-
|
|
4
|
+
const require_CalmLensServerClient = require("./CalmLensServerClient-CQdvhCGg.js");
|
|
5
5
|
exports.AUTO_PAGING_TO_ARRAY_MAX = require_ModerationContextLimits.AUTO_PAGING_TO_ARRAY_MAX;
|
|
6
6
|
exports.CALMLENS_ERROR_CODES = require_ModerationContextLimits.CALMLENS_ERROR_CODES;
|
|
7
7
|
exports.CDN_RESOURCES = require_ModerationContextLimits.CDN_RESOURCES;
|
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-dognME9k-PWyIfHMI.js";
|
|
2
2
|
export { type ClassificationTestSignal, TEST_DETECTIONS_MAX, TEST_DETECTION_BOX_MAX, TEST_FACE_AGE_MAX, TEST_FACE_AGE_PRESETS, TEST_INPUT_KEY_PATTERN, TEST_INPUT_PRESETS, type TestDetections, type TestInput, detectTestImage, detectTestTrigger, generateTestTextCode, getImageTestCategories, paintTestImage, testInputForSignal };
|
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_uL2Ec8Vt = require("./TestTriggers-uL2Ec8Vt-cPmmKvYd.js");
|
|
3
|
+
exports.TEST_DETECTIONS_MAX = require_TestTriggers_uL2Ec8Vt.TEST_DETECTIONS_MAX;
|
|
4
|
+
exports.TEST_DETECTION_BOX_MAX = require_TestTriggers_uL2Ec8Vt.TEST_DETECTION_BOX_MAX;
|
|
5
|
+
exports.TEST_FACE_AGE_MAX = require_TestTriggers_uL2Ec8Vt.TEST_FACE_AGE_MAX;
|
|
6
|
+
exports.TEST_FACE_AGE_PRESETS = require_TestTriggers_uL2Ec8Vt.TEST_FACE_AGE_PRESETS;
|
|
7
|
+
exports.TEST_INPUT_KEY_PATTERN = require_TestTriggers_uL2Ec8Vt.TEST_INPUT_KEY_PATTERN;
|
|
8
|
+
exports.TEST_INPUT_PRESETS = require_TestTriggers_uL2Ec8Vt.TEST_INPUT_PRESETS;
|
|
9
|
+
exports.detectTestImage = require_TestTriggers_uL2Ec8Vt.detectTestImage;
|
|
10
|
+
exports.detectTestTrigger = require_TestTriggers_uL2Ec8Vt.detectTestTrigger;
|
|
11
|
+
exports.generateTestTextCode = require_TestTriggers_uL2Ec8Vt.generateTestTextCode;
|
|
12
|
+
exports.getImageTestCategories = require_TestTriggers_uL2Ec8Vt.getImageTestCategories;
|
|
13
|
+
exports.paintTestImage = require_TestTriggers_uL2Ec8Vt.paintTestImage;
|
|
14
|
+
exports.testInputForSignal = require_TestTriggers_uL2Ec8Vt.testInputForSignal;
|
package/cjs/testing.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Fn as AssetBinaryPayloadInput, Ft as SignUploadTokenOptions, Lt as SignedUploadToken, O as CalmLensAppClientOptions, _n as Folder, gn as PermissionGrant, k as CalmLensServerClientOptions, ln as TypedEvent, m as AssetModeration, r as Asset } from "./CalmLensTypes-
|
|
2
|
-
import { t as CalmLensAppClient } from "./CalmLensAppClient-
|
|
3
|
-
import { I as ApiErrorCode, n as WebhookEventPayload } from "./WebhookPayload-
|
|
4
|
-
import { t as CalmLensServerClient } from "./CalmLensServerClient-
|
|
5
|
-
import { t as ClassificationTestSignal } from "./TestTriggers-
|
|
1
|
+
import { Fn as AssetBinaryPayloadInput, Ft as SignUploadTokenOptions, Lt as SignedUploadToken, O as CalmLensAppClientOptions, _n as Folder, gn as PermissionGrant, k as CalmLensServerClientOptions, ln as TypedEvent, m as AssetModeration, r as Asset } from "./CalmLensTypes-CtO4Dieu.js";
|
|
2
|
+
import { t as CalmLensAppClient } from "./CalmLensAppClient-B3u6BlP5.js";
|
|
3
|
+
import { I as ApiErrorCode, n as WebhookEventPayload } from "./WebhookPayload-DZadhbAJ.js";
|
|
4
|
+
import { t as CalmLensServerClient } from "./CalmLensServerClient-B8ntjNL3.js";
|
|
5
|
+
import { t as ClassificationTestSignal } from "./TestTriggers-dognME9k-PWyIfHMI.js";
|
|
6
6
|
import "zod";
|
|
7
7
|
/**
|
|
8
8
|
* Signs a single-use upload token with `apiKey`, locally. `CalmLensServerClient` and
|
|
@@ -64,6 +64,15 @@ declare const MOCK_CATEGORIES: readonly ["sexual", "violence", "self-harm", "har
|
|
|
64
64
|
*/
|
|
65
65
|
type MockAssetOutcome = "pending" | "failed" | "allowed" | "limited" | "age-restricted" | "blocked" | "purged";
|
|
66
66
|
type Category = (typeof MOCK_CATEGORIES)[number];
|
|
67
|
+
type EvaluatedFeature<K extends "ocr" | "linkDetection"> = Extract<NonNullable<Asset["classification"][K]>, {
|
|
68
|
+
status: "evaluated";
|
|
69
|
+
}>;
|
|
70
|
+
/** A region of text OCR found, as `classification.ocr.textRegions` reports one. */
|
|
71
|
+
type MockTextRegion = EvaluatedFeature<"ocr">["textRegions"][number];
|
|
72
|
+
/** A QR code link detection decoded, as `classification.linkDetection.qrCodes` reports one. */
|
|
73
|
+
type MockQrCode = EvaluatedFeature<"linkDetection">["qrCodes"][number];
|
|
74
|
+
/** A link found in an image's text or QR codes, as `classification.linkDetection.links` reports one. */
|
|
75
|
+
type MockDetectedLink = EvaluatedFeature<"linkDetection">["links"][number];
|
|
67
76
|
/** Why a decision waits for human review: `sampled`, or `uncertain` about some categories. */
|
|
68
77
|
type MockPendingReviewReason = "sampled" | "uncertain";
|
|
69
78
|
/**
|
|
@@ -90,6 +99,26 @@ export declare class MockDecision {
|
|
|
90
99
|
* decision (`decide` on the mock) clears it; `assets.decide` doesn't, as with the API.
|
|
91
100
|
*/
|
|
92
101
|
pendingReview(reason: MockPendingReviewReason, uncertainCategories?: Category[]): this;
|
|
102
|
+
/**
|
|
103
|
+
* The text OCR finds in an image, for an upload that turns OCR on: `classification.ocr` reports
|
|
104
|
+
* `textRegions`, and `content.extractedText` holds `text` when the upload keeps its content.
|
|
105
|
+
*/
|
|
106
|
+
withOcr(text: string | null, textRegions?: MockTextRegion[]): this;
|
|
107
|
+
/**
|
|
108
|
+
* The QR codes and links link detection finds in an image, reported as
|
|
109
|
+
* `classification.linkDetection` unless the upload turns link detection off.
|
|
110
|
+
*/
|
|
111
|
+
withLinkDetection(qrCodes?: MockQrCode[], links?: MockDetectedLink[]): this;
|
|
112
|
+
/** @internal What `withOcr` set, if anything. */
|
|
113
|
+
get ocrFindings(): {
|
|
114
|
+
text: string | null;
|
|
115
|
+
textRegions: MockTextRegion[];
|
|
116
|
+
} | undefined;
|
|
117
|
+
/** @internal What `withLinkDetection` set, if anything. */
|
|
118
|
+
get linkFindings(): {
|
|
119
|
+
qrCodes: MockQrCode[];
|
|
120
|
+
links: MockDetectedLink[];
|
|
121
|
+
} | undefined;
|
|
93
122
|
/**
|
|
94
123
|
* The report a decided asset gets, as the API sends it: every category (unflagged ones
|
|
95
124
|
* evaluated with score 0), policy-adjusted results and the automated status and
|
|
@@ -271,7 +300,7 @@ interface MockCalmLensServerClientOptions extends Omit<CalmLensServerClientOptio
|
|
|
271
300
|
/**
|
|
272
301
|
* Returns a new ID for an object of the kind `prefix` names (`asset`, `fldr`, `hl`, `hle`,
|
|
273
302
|
* `lens`, `evt` or `rev`). The default is like the API's: the prefix, `_` and 20 random
|
|
274
|
-
* base62 characters, such as `
|
|
303
|
+
* base62 characters, such as `asset_e5Gm2Rk8XqT3wLp9VbN4`.
|
|
275
304
|
*/
|
|
276
305
|
createId?: (prefix: IdPrefix) => string;
|
|
277
306
|
/**
|
|
@@ -401,4 +430,4 @@ export declare const createWebhookHeaders: (options: {
|
|
|
401
430
|
deliveryId: string;
|
|
402
431
|
timestampSeconds?: number;
|
|
403
432
|
}) => Promise<Record<string, string>>;
|
|
404
|
-
export { type MockAssetOutcome, type MockCalmLensAppClientOptions, type MockCalmLensCall, type MockCalmLensOperation, type MockCalmLensServerClientOptions, type MockDatabaseStorage, type MockEventInput, type MockFailureOptions, type MockImageStorage, type MockModerate, type MockModerationInput, type MockModerationTrigger, type MockRequestFailure, type MockReviewDecision, type MockStoredContent, type MockUploadPreset, signUploadTokenWithApiKey as signUploadToken };
|
|
433
|
+
export { type MockAssetOutcome, type MockCalmLensAppClientOptions, type MockCalmLensCall, type MockCalmLensOperation, type MockCalmLensServerClientOptions, type MockDatabaseStorage, type MockDetectedLink, type MockEventInput, type MockFailureOptions, type MockImageStorage, type MockModerate, type MockModerationInput, type MockModerationTrigger, type MockQrCode, type MockRequestFailure, type MockReviewDecision, type MockStoredContent, type MockTextRegion, type MockUploadPreset, signUploadTokenWithApiKey as signUploadToken };
|
package/cjs/testing.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const
|
|
3
|
-
const require_ModerationContextLimits = require("./ModerationContextLimits-
|
|
4
|
-
const require_CalmLensServerClient = require("./CalmLensServerClient-
|
|
5
|
-
const require_CalmLensOptionKeys = require("./CalmLensOptionKeys-
|
|
6
|
-
const
|
|
7
|
-
const require_CalmLensAppClient = require("./CalmLensAppClient-
|
|
8
|
-
const require_UploadController = require("./UploadController-
|
|
2
|
+
const require_TestTriggers_uL2Ec8Vt = require("./TestTriggers-uL2Ec8Vt-cPmmKvYd.js");
|
|
3
|
+
const require_ModerationContextLimits = require("./ModerationContextLimits-_knOVCH0.js");
|
|
4
|
+
const require_CalmLensServerClient = require("./CalmLensServerClient-CQdvhCGg.js");
|
|
5
|
+
const require_CalmLensOptionKeys = require("./CalmLensOptionKeys-Cat8CgOn.js");
|
|
6
|
+
const require_CryptoUtils_BLCa_oZe = require("./CryptoUtils-BLCa-oZe-leCkr1ko.js");
|
|
7
|
+
const require_CalmLensAppClient = require("./CalmLensAppClient-B0QZ1oJV.js");
|
|
8
|
+
const require_UploadController = require("./UploadController-CEL3N4Ae.js");
|
|
9
9
|
let zod = require("zod");
|
|
10
|
-
zod =
|
|
10
|
+
zod = require_TestTriggers_uL2Ec8Vt.__toESM(zod, 1);
|
|
11
11
|
// src/contract/MediaTestTriggers.js
|
|
12
|
-
const MEDIA_TEST_SIGNALS = [...
|
|
12
|
+
const MEDIA_TEST_SIGNALS = [...require_TestTriggers_uL2Ec8Vt.CLASSIFICATION_CATEGORIES, "violence.graphic"];
|
|
13
13
|
const HEX_WORDS = [
|
|
14
14
|
"zero",
|
|
15
15
|
"one",
|
|
@@ -31,9 +31,21 @@ 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_uL2Ec8Vt.getTestInputTag("media", signal, testInputKey)].map((character) => HEX_WORDS[Number.parseInt(character, 16)]).join(" ")} ${signal.replace(/[.-]/g, " ")} end test`;
|
|
35
35
|
}
|
|
36
|
-
|
|
36
|
+
/**
|
|
37
|
+
* The character an asset ID starts with (after `asset_`) to say the region it lives in: the asset
|
|
38
|
+
* table computes each row's region from it (`AssetTable`), so an ID is only ever in one region and
|
|
39
|
+
* a lookup by ID goes straight there. A code is never reused for another region.
|
|
40
|
+
*/
|
|
41
|
+
const ASSET_ID_REGION_CODES = {
|
|
42
|
+
"aws-ap-southeast-1": "a",
|
|
43
|
+
"aws-eu-west-2": "e",
|
|
44
|
+
"aws-eu-central-1": "f",
|
|
45
|
+
"aws-us-east-2": "u"
|
|
46
|
+
};
|
|
47
|
+
new Map(Object.entries(ASSET_ID_REGION_CODES).map(([region, code]) => [code, region]));
|
|
48
|
+
// src/contract/Ids-BBz_iuDy.js
|
|
37
49
|
var __defProp = Object.defineProperty;
|
|
38
50
|
var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod, mod.exports), cb = null), mod.exports);
|
|
39
51
|
var __exportAll = (all, no_symbols) => {
|
|
@@ -7927,6 +7939,7 @@ createMetaType({
|
|
|
7927
7939
|
createMetaType({ id: "updatedAt" });
|
|
7928
7940
|
createMetaType({ id: "monotonicTimestamp" });
|
|
7929
7941
|
createMetaType({ id: "backfill" });
|
|
7942
|
+
createMetaType({ id: "computed" });
|
|
7930
7943
|
/**
|
|
7931
7944
|
* The prefix of every kind of object customers can see, so an ID says what it identifies:
|
|
7932
7945
|
* `proj_8fK2mQx7Lp4NvB3tRz9Y` is a project. Rows that never leave the backend (usage meters, upload
|
|
@@ -7989,15 +8002,23 @@ const randomBase62 = (length) => {
|
|
|
7989
8002
|
}
|
|
7990
8003
|
return result;
|
|
7991
8004
|
};
|
|
7992
|
-
/**
|
|
8005
|
+
/**
|
|
8006
|
+
* A new random ID, such as `newId("proj")` → `proj_8fK2mQx7Lp4NvB3tRz9Y`. Assets take theirs from
|
|
8007
|
+
* `newAssetId`, which names their region.
|
|
8008
|
+
*/
|
|
7993
8009
|
const newId = (prefix) => `${prefix}_${randomBase62(20)}`;
|
|
8010
|
+
/**
|
|
8011
|
+
* A new asset ID for an asset that lives in `region`: its first character after `asset_` is the
|
|
8012
|
+
* region's code (`ASSET_ID_REGION_CODES`), then 19 random characters (about 113 bits).
|
|
8013
|
+
*/
|
|
8014
|
+
const newAssetId = (region) => `asset_${ASSET_ID_REGION_CODES[region]}${randomBase62(19)}`;
|
|
7994
8015
|
/** Whether `value` is an ID with `prefix` (or with any registered prefix). */
|
|
7995
8016
|
const isId = (value, prefix) => typeof value === "string" && idPattern(prefix).test(value);
|
|
7996
8017
|
/** Example IDs for docs, OpenAPI and SDK fixtures: fixed, so generated output stays stable. */
|
|
7997
8018
|
const EXAMPLE_IDS = {
|
|
7998
8019
|
org: "org_3hQ7tLk2Vb9XpR4mWc8N",
|
|
7999
8020
|
proj: "proj_8fK2mQx7Lp4NvB3tRz9Y",
|
|
8000
|
-
asset: "
|
|
8021
|
+
asset: "asset_e5Gm2Rk8XqT3wLp9VbN4",
|
|
8001
8022
|
fldr: "fldr_7Nc4Wq2Lm8Xt5Rk9Bv3P",
|
|
8002
8023
|
lens: "lens_2Xr9Lp4Vm7Qk3Tb8Nw5C",
|
|
8003
8024
|
key: "key_9Pt3Wm6Rk2Lx8Qv4Nb7C",
|
|
@@ -8030,8 +8051,9 @@ const EXAMPLE_IDS = {
|
|
|
8030
8051
|
* across the packages that build records from plain strings).
|
|
8031
8052
|
*/
|
|
8032
8053
|
const idField = (prefix) => zod.string().regex(idPattern(prefix), { message: `Must be a valid ID: "${prefix}_" followed by 20 letters or digits` }).meta({ examples: [EXAMPLE_IDS[prefix]] });
|
|
8033
|
-
// src/contract/Permissions-
|
|
8034
|
-
|
|
8054
|
+
// src/contract/Permissions-Dwk78TtG.js
|
|
8055
|
+
/** Every permission action, in the order the docs and the portal list them. */
|
|
8056
|
+
const PERMISSION_ACTIONS = [
|
|
8035
8057
|
"assets:read",
|
|
8036
8058
|
"assets:download",
|
|
8037
8059
|
"assets:create",
|
|
@@ -8063,7 +8085,8 @@ const ACTION_SCHEMA = /* @__PURE__ */ require_TestTriggers_Cvi7e2KA.lazySchema((
|
|
|
8063
8085
|
"reviews:read",
|
|
8064
8086
|
"reviews:write",
|
|
8065
8087
|
"project:manage"
|
|
8066
|
-
]
|
|
8088
|
+
];
|
|
8089
|
+
const ACTION_SCHEMA = /* @__PURE__ */ require_TestTriggers_uL2Ec8Vt.lazySchema(() => zod.enum(PERMISSION_ACTIONS));
|
|
8067
8090
|
const PROJECT_ACTIONS = [...[
|
|
8068
8091
|
"settings",
|
|
8069
8092
|
"members",
|
|
@@ -8079,14 +8102,14 @@ const PROJECT_ACTIONS = [...[
|
|
|
8079
8102
|
const isProjectAction = (action) => PROJECT_ACTIONS.includes(action);
|
|
8080
8103
|
/** The actions that include `action`: its feature's write action and project:manage. */
|
|
8081
8104
|
const actionsImplying = (action) => !isProjectAction(action) || action === "project:manage" ? [] : action.endsWith(":read") ? [action.replace(/:read$/, ":write"), "project:manage"] : ["project:manage"];
|
|
8082
|
-
const GRANT_SCHEMA = /* @__PURE__ */
|
|
8105
|
+
const GRANT_SCHEMA = /* @__PURE__ */ require_TestTriggers_uL2Ec8Vt.lazySchema(() => zod.object({
|
|
8083
8106
|
actions: zod.array(ACTION_SCHEMA),
|
|
8084
8107
|
folderId: idField("fldr").nullable(),
|
|
8085
8108
|
includeSubfolders: zod.boolean()
|
|
8086
8109
|
}).strict().refine((g) => g.folderId === null || !g.actions.some(isProjectAction), "Project configuration permissions require project scope"));
|
|
8087
|
-
const GRANTS_SCHEMA = /* @__PURE__ */
|
|
8088
|
-
[...
|
|
8089
|
-
[...
|
|
8110
|
+
const GRANTS_SCHEMA = /* @__PURE__ */ require_TestTriggers_uL2Ec8Vt.lazySchema(() => zod.array(GRANT_SCHEMA).max(100));
|
|
8111
|
+
[...PERMISSION_ACTIONS.filter((a) => !isProjectAction(a))];
|
|
8112
|
+
[...PERMISSION_ACTIONS.filter((a) => !isProjectAction(a))];
|
|
8090
8113
|
const permits = (grants, action, folderId, folders) => grants.some((grant) => {
|
|
8091
8114
|
if (![action, ...actionsImplying(action)].some((held) => grant.actions.includes(held))) return false;
|
|
8092
8115
|
if (grant.folderId === null) return true;
|
|
@@ -8316,6 +8339,8 @@ var MockDecision = class {
|
|
|
8316
8339
|
#flags = /* @__PURE__ */ new Map();
|
|
8317
8340
|
#notEvaluated = /* @__PURE__ */ new Set();
|
|
8318
8341
|
#pendingReview;
|
|
8342
|
+
#ocr;
|
|
8343
|
+
#linkDetection;
|
|
8319
8344
|
constructor(status) {
|
|
8320
8345
|
if (!OUTCOMES.includes(status)) throw require_ModerationContextLimits.invalidArgument(`status must be one of ${OUTCOMES.join(", ")}`);
|
|
8321
8346
|
this.status = status;
|
|
@@ -8365,6 +8390,36 @@ var MockDecision = class {
|
|
|
8365
8390
|
};
|
|
8366
8391
|
return this;
|
|
8367
8392
|
}
|
|
8393
|
+
/**
|
|
8394
|
+
* The text OCR finds in an image, for an upload that turns OCR on: `classification.ocr` reports
|
|
8395
|
+
* `textRegions`, and `content.extractedText` holds `text` when the upload keeps its content.
|
|
8396
|
+
*/
|
|
8397
|
+
withOcr(text, textRegions = []) {
|
|
8398
|
+
this.#ocr = {
|
|
8399
|
+
text,
|
|
8400
|
+
textRegions: structuredClone(textRegions)
|
|
8401
|
+
};
|
|
8402
|
+
return this;
|
|
8403
|
+
}
|
|
8404
|
+
/**
|
|
8405
|
+
* The QR codes and links link detection finds in an image, reported as
|
|
8406
|
+
* `classification.linkDetection` unless the upload turns link detection off.
|
|
8407
|
+
*/
|
|
8408
|
+
withLinkDetection(qrCodes = [], links = []) {
|
|
8409
|
+
this.#linkDetection = {
|
|
8410
|
+
qrCodes: structuredClone(qrCodes),
|
|
8411
|
+
links: structuredClone(links)
|
|
8412
|
+
};
|
|
8413
|
+
return this;
|
|
8414
|
+
}
|
|
8415
|
+
/** @internal What `withOcr` set, if anything. */
|
|
8416
|
+
get ocrFindings() {
|
|
8417
|
+
return this.#ocr && structuredClone(this.#ocr);
|
|
8418
|
+
}
|
|
8419
|
+
/** @internal What `withLinkDetection` set, if anything. */
|
|
8420
|
+
get linkFindings() {
|
|
8421
|
+
return this.#linkDetection && structuredClone(this.#linkDetection);
|
|
8422
|
+
}
|
|
8368
8423
|
#checkCategory(category) {
|
|
8369
8424
|
if (!MOCK_CATEGORIES.includes(category)) throw require_ModerationContextLimits.invalidArgument(`${category} is not a CalmLens category`);
|
|
8370
8425
|
}
|
|
@@ -9534,7 +9589,7 @@ const MOCK_PRESET_NAMES = {
|
|
|
9534
9589
|
* personal information and profanity, `block` otherwise) and no rules. The mock holds no built-in
|
|
9535
9590
|
* preset settings, and uploads are never decided by a policy.
|
|
9536
9591
|
*/
|
|
9537
|
-
const mockPresetSettings = () => ({ categorySettings: Object.fromEntries(
|
|
9592
|
+
const mockPresetSettings = () => ({ categorySettings: Object.fromEntries(require_TestTriggers_uL2Ec8Vt.CLASSIFICATION_CATEGORIES.map((category) => [category, {
|
|
9538
9593
|
action: category === "personal-information" || category === "profanity" ? "allow" : "block",
|
|
9539
9594
|
allowances: [],
|
|
9540
9595
|
restrictions: []
|
|
@@ -9546,13 +9601,13 @@ const mockPresetSettings = () => ({ categorySettings: Object.fromEntries(require
|
|
|
9546
9601
|
const checkPolicySettings = (settings) => {
|
|
9547
9602
|
const categories = settings?.categorySettings;
|
|
9548
9603
|
if (!categories || typeof categories !== "object") throw invalidField("validation/invalid-type", "settings.categorySettings");
|
|
9549
|
-
for (const category of
|
|
9604
|
+
for (const category of require_TestTriggers_uL2Ec8Vt.CLASSIFICATION_CATEGORIES) {
|
|
9550
9605
|
const value = categories[category];
|
|
9551
9606
|
if (!value || typeof value !== "object") throw invalidField("validation/invalid-type", `settings.categorySettings.${category}`);
|
|
9552
9607
|
for (const key of ["allowances", "restrictions"]) if (!Array.isArray(value[key])) throw invalidField("validation/invalid-type", `settings.categorySettings.${category}.${key}`);
|
|
9553
9608
|
if (typeof value.action !== "string") throw invalidField("validation/invalid-value", `settings.categorySettings.${category}.action`);
|
|
9554
9609
|
}
|
|
9555
|
-
for (const key of Object.keys(categories)) if (!
|
|
9610
|
+
for (const key of Object.keys(categories)) if (!require_TestTriggers_uL2Ec8Vt.CLASSIFICATION_CATEGORIES.includes(key)) throw invalidField("validation/unknown-field", `settings.categorySettings.${key}`);
|
|
9556
9611
|
};
|
|
9557
9612
|
/** The client methods that send a request, the one it is recorded under first. */
|
|
9558
9613
|
const operationsOf = (request) => {
|
|
@@ -10448,17 +10503,21 @@ var MockCalmLensApi = class {
|
|
|
10448
10503
|
}
|
|
10449
10504
|
/**
|
|
10450
10505
|
* Signs an asset URL like the API (`POST /projects/:projectId/signed-asset-urls`): a grant to one
|
|
10451
|
-
* asset, by ID or external ID, until it expires,
|
|
10506
|
+
* asset, by ID or external ID, until it expires, ending in the resource it was signed for and
|
|
10507
|
+
* serving the original only when signed for it. The mock's
|
|
10452
10508
|
* grant is readable (its asset, original access and expiry), unlike the CDN's, and only the
|
|
10453
10509
|
* mock's CDN accepts it.
|
|
10454
10510
|
*/
|
|
10455
10511
|
async signAssetUrl(body) {
|
|
10456
|
-
|
|
10512
|
+
const fields = [
|
|
10457
10513
|
"assetId",
|
|
10458
10514
|
"externalId",
|
|
10459
10515
|
"expiresIn",
|
|
10460
|
-
"
|
|
10461
|
-
]
|
|
10516
|
+
"resource"
|
|
10517
|
+
];
|
|
10518
|
+
const unknown = Object.keys(body).find((key) => !fields.includes(key));
|
|
10519
|
+
if (unknown !== void 0) throw invalidField("validation/unknown-field", unknown);
|
|
10520
|
+
for (const key of fields) if (body[key] === null) throw invalidField("validation/invalid-type", key);
|
|
10462
10521
|
const { assetId, externalId } = body;
|
|
10463
10522
|
if (assetId === void 0 === (externalId === void 0)) throw new ApiFailure(400, require_ModerationContextLimits.API_ERROR_CODES.INVALID_REQUEST, "Send either assetId or externalId", { issues: [{
|
|
10464
10523
|
path: "",
|
|
@@ -10469,8 +10528,8 @@ var MockCalmLensApi = class {
|
|
|
10469
10528
|
if (typeof expiresIn !== "number" || !Number.isInteger(expiresIn)) throw invalidField("validation/invalid-type", "expiresIn");
|
|
10470
10529
|
if (expiresIn < 1) throw invalidField("validation/too-small", "expiresIn");
|
|
10471
10530
|
if (expiresIn > 86400) throw invalidField("validation/too-big", "expiresIn");
|
|
10472
|
-
const
|
|
10473
|
-
if (typeof
|
|
10531
|
+
const { resource } = body;
|
|
10532
|
+
if (resource !== void 0 && (typeof resource !== "string" || !Object.hasOwn(require_ModerationContextLimits.ASSET_RESOURCE_PATHS, resource))) throw invalidField("validation/invalid-value", "resource");
|
|
10474
10533
|
let asset;
|
|
10475
10534
|
if (externalId !== void 0) {
|
|
10476
10535
|
asset = (await this.databaseStorage.listAssets(this.projectId)).find((candidate) => candidate.externalId === externalId);
|
|
@@ -10480,11 +10539,12 @@ var MockCalmLensApi = class {
|
|
|
10480
10539
|
const expiresAt = this.now() + expiresIn * 1e3;
|
|
10481
10540
|
const grant = encodeMockGrant({
|
|
10482
10541
|
assetId: asset.id,
|
|
10483
|
-
original,
|
|
10542
|
+
original: resource === "original",
|
|
10484
10543
|
expiresAt
|
|
10485
10544
|
});
|
|
10545
|
+
const path = resource === void 0 ? "" : `/${require_ModerationContextLimits.ASSET_RESOURCE_PATHS[resource]}`;
|
|
10486
10546
|
return {
|
|
10487
|
-
url: `${this.cdnBaseUrl}/assets/${encodeURIComponent(this.projectId)}/${grant}`,
|
|
10547
|
+
url: `${this.cdnBaseUrl}/assets/${encodeURIComponent(this.projectId)}/${grant}${path}`,
|
|
10488
10548
|
expiresAt
|
|
10489
10549
|
};
|
|
10490
10550
|
}
|
|
@@ -10906,18 +10966,28 @@ var MockCalmLensApi = class {
|
|
|
10906
10966
|
const next = await this.applyOutcome(asset, decision.status, "policy", decision.report(this.now()));
|
|
10907
10967
|
const features = this.processingOptions.get(asset.id)?.features;
|
|
10908
10968
|
if (next.classification.status !== "completed" || asset.type !== "image") return next;
|
|
10969
|
+
const ocr = features?.ocr?.enabled === true ? decision.ocrFindings : void 0;
|
|
10909
10970
|
return {
|
|
10910
10971
|
...next,
|
|
10972
|
+
...ocr?.text != null && next.content.status === "stored" && { content: {
|
|
10973
|
+
...next.content,
|
|
10974
|
+
extractedText: {
|
|
10975
|
+
type: "string",
|
|
10976
|
+
content: ocr.text
|
|
10977
|
+
}
|
|
10978
|
+
} },
|
|
10911
10979
|
classification: {
|
|
10912
10980
|
...next.classification,
|
|
10913
10981
|
...features?.ocr?.enabled === true && { ocr: {
|
|
10914
10982
|
status: "evaluated",
|
|
10915
|
-
textRegions: []
|
|
10983
|
+
textRegions: ocr?.textRegions ?? []
|
|
10916
10984
|
} },
|
|
10917
10985
|
...features?.linkDetection?.enabled !== false && { linkDetection: {
|
|
10918
10986
|
status: "evaluated",
|
|
10919
|
-
|
|
10920
|
-
|
|
10987
|
+
...decision.linkFindings ?? {
|
|
10988
|
+
qrCodes: [],
|
|
10989
|
+
links: []
|
|
10990
|
+
}
|
|
10921
10991
|
} },
|
|
10922
10992
|
...features?.personDetection?.enabled === true && { personDetection: {
|
|
10923
10993
|
status: "evaluated",
|
|
@@ -11633,7 +11703,7 @@ var MockCalmLensApi = class {
|
|
|
11633
11703
|
}, url);
|
|
11634
11704
|
if (resource === "embed") return this.cdnResponse(isHead, new TextEncoder().encode(MOCK_EMBED_HTML), url, {
|
|
11635
11705
|
"Content-Type": "text/html; charset=utf-8",
|
|
11636
|
-
"Cache-Control":
|
|
11706
|
+
"Cache-Control": "private, no-store",
|
|
11637
11707
|
"Cache-Tag": `asset-${asset.id}`,
|
|
11638
11708
|
"X-Content-Type-Options": "nosniff"
|
|
11639
11709
|
});
|
|
@@ -11665,15 +11735,14 @@ var MockCalmLensApi = class {
|
|
|
11665
11735
|
bytes = mockPlaceholderPng(preview?.thumbhash ?? MOCK_THUMBHASH);
|
|
11666
11736
|
contentType = "image/png";
|
|
11667
11737
|
}
|
|
11668
|
-
const
|
|
11738
|
+
const imageResponse = stillImage || resource === "original" && asset.type === "image";
|
|
11739
|
+
const maxAge = grant ? Math.max(0, Math.min(86400, Math.floor((grant.expiresAt - this.now()) / 1e3))) : 86400;
|
|
11740
|
+
const cacheControl = query.has("viewerClaims") || request.headers.has("X-CalmLens-Viewer-Claims") ? "private, no-store" : isPrivate && !grant ? "private, no-cache" : `${isPrivate ? "private" : "public"}, max-age=${maxAge}, must-revalidate`;
|
|
11669
11741
|
return this.cdnResponse(isHead, bytes, url, {
|
|
11670
11742
|
"Content-Type": contentType,
|
|
11671
|
-
"Cache-Control":
|
|
11743
|
+
"Cache-Control": cacheControl,
|
|
11672
11744
|
"Cache-Tag": `asset-${asset.id}`,
|
|
11673
|
-
...
|
|
11674
|
-
ETag: `"${asset.id}"`,
|
|
11675
|
-
Expires: new Date(this.now() + 31536e6).toUTCString()
|
|
11676
|
-
} : {},
|
|
11745
|
+
...imageResponse ? { ETag: `"${asset.id}"` } : {},
|
|
11677
11746
|
"X-Content-Type-Options": "nosniff",
|
|
11678
11747
|
"Content-Security-Policy": "sandbox; default-src 'none'",
|
|
11679
11748
|
...isActiveContentType(contentType) ? { "Content-Disposition": "attachment" } : {}
|
|
@@ -11874,7 +11943,7 @@ var MockCalmLensServerClient = class extends require_CalmLensServerClient.CalmLe
|
|
|
11874
11943
|
grants: getMockApiKeyGrants(options.apiKey),
|
|
11875
11944
|
databaseStorage: mockOptions.databaseStorage ?? new InMemoryMockDatabaseStorage(),
|
|
11876
11945
|
imageStorage: mockOptions.imageStorage ?? new InMemoryMockImageStorage(),
|
|
11877
|
-
createId: mockOptions.createId ?? newId,
|
|
11946
|
+
createId: mockOptions.createId ?? ((prefix) => prefix === "asset" ? newAssetId("aws-eu-west-2") : newId(prefix)),
|
|
11878
11947
|
now: mockOptions.now ?? createMonotonicClock(),
|
|
11879
11948
|
moderate: mockOptions.moderate ?? defaultModerate
|
|
11880
11949
|
});
|
|
@@ -12042,7 +12111,7 @@ const toWebhookEventPayload = (event) => ({
|
|
|
12042
12111
|
createdAt: event.createdAt
|
|
12043
12112
|
});
|
|
12044
12113
|
/** `v1=<hex HMAC-SHA256 of "<timestamp>.<body>">`, the `x-calmlens-signature` header value. */
|
|
12045
|
-
const createWebhookSignatureHeader = async (secret, timestamp, body) => `v1=${await
|
|
12114
|
+
const createWebhookSignatureHeader = async (secret, timestamp, body) => `v1=${await require_CryptoUtils_BLCa_oZe.hmacSha256Hex(secret, `${timestamp}.${body}`)}`;
|
|
12046
12115
|
/** Headers for one signed delivery of `body`, as CalmLens sends them. */
|
|
12047
12116
|
const createWebhookHeaders = async (options) => {
|
|
12048
12117
|
const timestamp = options.timestampSeconds ?? Math.floor(Date.now() / 1e3);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "./CalmLensTypes-
|
|
2
|
-
import { K as AssetOptions, Z as AssetView, ct as DocumentViewerOptions, dt as TextViewerOptions, lt as PdfAssetOptions, pt as ViewerOptions, q as AssetSession, ut as SpreadsheetViewerOptions } from "./Core-
|
|
1
|
+
import "./CalmLensTypes-CtO4Dieu.js";
|
|
2
|
+
import { K as AssetOptions, Z as AssetView, ct as DocumentViewerOptions, dt as TextViewerOptions, lt as PdfAssetOptions, pt as ViewerOptions, q as AssetSession, ut as SpreadsheetViewerOptions } from "./Core-BJaLU71Q.js";
|
|
3
3
|
import "pdfjs-dist";
|
|
4
4
|
/** A viewer mounted into an element, which it owns the children of. */
|
|
5
5
|
interface AssetViewer<O extends ViewerOptions = ViewerOptions> {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const require_ModerationContextLimits = require("./ModerationContextLimits-
|
|
2
|
-
require("./Core-
|
|
1
|
+
const require_ModerationContextLimits = require("./ModerationContextLimits-_knOVCH0.js");
|
|
2
|
+
require("./Core-DCnnUsgF.js");
|
|
3
3
|
// src/ui/viewers/PdfLoader.ts
|
|
4
4
|
let loading;
|
|
5
5
|
/**
|
package/cjs/ui.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { $ as MediaPlayback, A as CustomUploadContext, B as isFileAccepted, C as formatMessage, D as resolveMessages, E as getUploadItemOutcome, F as UploadFile, G as AssetImageSource, H as AssetDisplay, I as UploadItem, J as AssetSessionState, K as AssetOptions, L as UploadSnapshot, M as UploadClient, N as UploadController, O as CalmLensProvidedOptions, P as UploadControllerOptions, Q as INSTANT_LOAD_MS, R as UploadStage, S as formatBytes, T as getUploadItemMessage, U as AssetDocumentOptions, V as withProvidedOptions, W as AssetImageOptions, X as AssetVideoOptions, Y as AssetSpreadsheetOptions, Z as AssetView, _ as DEFAULT_MESSAGES, _t as DEFAULT_VIEWER_MESSAGES, a as ProgressFetchOptions, at as isImageReady, b as describeUploadItem, bt as resolveViewerMessages, c as ICON_ATTRIBUTES, ct as DocumentViewerOptions, d as AssetDisplayOptions, dt as TextViewerOptions, et as getAssetAspectRatio, f as AssetEventHandlers, ft as ViewerAsset, g as CalmLensMessages, gt as isSpreadsheetFormat, h as UploaderProps, ht as getAssetViewerKind, i as CALMLENS_STYLES, it as getPlayedPercent, j as CustomUploadResult, k as CalmLensUpload, l as IconName, lt as PdfAssetOptions, m as UploaderDisplayOptions, mt as ViewerTextOptions, n as CalmLensTheme, nt as getAssetViewKey, o as createProgressFetch, ot as pickAssetSource, p as AssetProps, pt as ViewerOptions, q as AssetSession, r as resolveTheme, rt as getPeakHeights, s as ICONS, st as AssetViewerKind, t as CALMLENS_THEME, tt as getAssetView, u as ASSET_FILE_ICON_SIZE, ut as SpreadsheetViewerOptions, v as UploadItemView, vt as ViewerMessages, w as getDropzoneHint, x as describeUploader, y as UploaderView, yt as formatViewerMessage, z as createUploadController } from "./Core-
|
|
2
|
-
import { _ as spreadsheetColumnIndex, a as isMountedViewerKind, b as AssetViewer, c as AssetViewerOptionsByKind, d as createTextViewer, f as SpreadsheetCell, g as parseSpreadsheetText, h as getSpreadsheetPage, i as getMountedViewerOptions, l as VIEWER_STYLES, m as SpreadsheetSheet, n as AssetViewerMount, o as ASSET_VIEWERS, p as SpreadsheetRow, r as MountedViewerKind, s as AssetViewerName, t as MediaStreamPlayer, u as createSpreadsheetViewer, v as loadPdfJs, x as ViewerState, y as createDocumentViewer } from "./ui-
|
|
1
|
+
import { $ as MediaPlayback, A as CustomUploadContext, B as isFileAccepted, C as formatMessage, D as resolveMessages, E as getUploadItemOutcome, F as UploadFile, G as AssetImageSource, H as AssetDisplay, I as UploadItem, J as AssetSessionState, K as AssetOptions, L as UploadSnapshot, M as UploadClient, N as UploadController, O as CalmLensProvidedOptions, P as UploadControllerOptions, Q as INSTANT_LOAD_MS, R as UploadStage, S as formatBytes, T as getUploadItemMessage, U as AssetDocumentOptions, V as withProvidedOptions, W as AssetImageOptions, X as AssetVideoOptions, Y as AssetSpreadsheetOptions, Z as AssetView, _ as DEFAULT_MESSAGES, _t as DEFAULT_VIEWER_MESSAGES, a as ProgressFetchOptions, at as isImageReady, b as describeUploadItem, bt as resolveViewerMessages, c as ICON_ATTRIBUTES, ct as DocumentViewerOptions, d as AssetDisplayOptions, dt as TextViewerOptions, et as getAssetAspectRatio, f as AssetEventHandlers, ft as ViewerAsset, g as CalmLensMessages, gt as isSpreadsheetFormat, h as UploaderProps, ht as getAssetViewerKind, i as CALMLENS_STYLES, it as getPlayedPercent, j as CustomUploadResult, k as CalmLensUpload, l as IconName, lt as PdfAssetOptions, m as UploaderDisplayOptions, mt as ViewerTextOptions, n as CalmLensTheme, nt as getAssetViewKey, o as createProgressFetch, ot as pickAssetSource, p as AssetProps, pt as ViewerOptions, q as AssetSession, r as resolveTheme, rt as getPeakHeights, s as ICONS, st as AssetViewerKind, t as CALMLENS_THEME, tt as getAssetView, u as ASSET_FILE_ICON_SIZE, ut as SpreadsheetViewerOptions, v as UploadItemView, vt as ViewerMessages, w as getDropzoneHint, x as describeUploader, y as UploaderView, yt as formatViewerMessage, z as createUploadController } from "./Core-BJaLU71Q.js";
|
|
2
|
+
import { _ as spreadsheetColumnIndex, a as isMountedViewerKind, b as AssetViewer, c as AssetViewerOptionsByKind, d as createTextViewer, f as SpreadsheetCell, g as parseSpreadsheetText, h as getSpreadsheetPage, i as getMountedViewerOptions, l as VIEWER_STYLES, m as SpreadsheetSheet, n as AssetViewerMount, o as ASSET_VIEWERS, p as SpreadsheetRow, r as MountedViewerKind, s as AssetViewerName, t as MediaStreamPlayer, u as createSpreadsheetViewer, v as loadPdfJs, x as ViewerState, y as createDocumentViewer } from "./ui-BGywTQ2M.js";
|
|
3
3
|
export { ASSET_FILE_ICON_SIZE, ASSET_VIEWERS, type AssetDisplay, type AssetDisplayOptions, type AssetDocumentOptions, type AssetEventHandlers, type AssetImageOptions, type AssetImageSource, type AssetOptions, type AssetProps, AssetSession, type AssetSessionState, type AssetSpreadsheetOptions, type AssetVideoOptions, type AssetView, type AssetViewer, type AssetViewerKind, AssetViewerMount, AssetViewerName, AssetViewerOptionsByKind, CALMLENS_STYLES, CALMLENS_THEME, type CalmLensMessages, type CalmLensProvidedOptions, type CalmLensTheme, type CalmLensUpload, type CustomUploadContext, type CustomUploadResult, DEFAULT_MESSAGES, DEFAULT_VIEWER_MESSAGES, type DocumentViewerOptions, ICONS, ICON_ATTRIBUTES, INSTANT_LOAD_MS, type IconName, type MediaPlayback, MediaStreamPlayer, type MountedViewerKind, type PdfAssetOptions, type ProgressFetchOptions, type SpreadsheetCell, type SpreadsheetRow, type SpreadsheetSheet, type SpreadsheetViewerOptions, type TextViewerOptions, type UploadClient, UploadController, type UploadControllerOptions, type UploadFile, type UploadItem, type UploadItemView, type UploadSnapshot, type UploadStage, type UploaderDisplayOptions, type UploaderProps, type UploaderView, VIEWER_STYLES, type ViewerAsset, type ViewerMessages, type ViewerOptions, type ViewerState, type ViewerTextOptions, createDocumentViewer, createProgressFetch, createSpreadsheetViewer, createTextViewer, createUploadController, describeUploadItem, describeUploader, formatBytes, formatMessage, formatViewerMessage, getAssetAspectRatio, getAssetView, getAssetViewKey, getAssetViewerKind, getDropzoneHint, getMountedViewerOptions, getPeakHeights, getPlayedPercent, getSpreadsheetPage, getUploadItemMessage, getUploadItemOutcome, isFileAccepted, isImageReady, isMountedViewerKind, isSpreadsheetFormat, loadPdfJs, parseSpreadsheetText, pickAssetSource, resolveMessages, resolveTheme, resolveViewerMessages, spreadsheetColumnIndex, withProvidedOptions };
|
package/cjs/ui.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_ui = require("./ui-
|
|
3
|
-
const require_Core = require("./Core-
|
|
4
|
-
const require_UploadController = require("./UploadController-
|
|
2
|
+
const require_ui = require("./ui-DVQm0TFJ.js");
|
|
3
|
+
const require_Core = require("./Core-DCnnUsgF.js");
|
|
4
|
+
const require_UploadController = require("./UploadController-CEL3N4Ae.js");
|
|
5
5
|
exports.ASSET_FILE_ICON_SIZE = require_Core.ASSET_FILE_ICON_SIZE;
|
|
6
6
|
exports.ASSET_VIEWERS = require_ui.ASSET_VIEWERS;
|
|
7
7
|
exports.AssetSession = require_Core.AssetSession;
|
package/cjs/vue.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { O as CalmLensAppClientOptions, en as ViewerClaims, g as AssetModerationStatus, i as AssetAvailability } from "./CalmLensTypes-
|
|
2
|
-
import "./index-
|
|
3
|
-
import { $ as MediaPlayback, A as CustomUploadContext, B as isFileAccepted, C as formatMessage, D as resolveMessages, E as getUploadItemOutcome, F as UploadFile, G as AssetImageSource, H as AssetDisplay, J as AssetSessionState, K as AssetOptions, M as UploadClient, N as UploadController, O as CalmLensProvidedOptions, Q as INSTANT_LOAD_MS, R as UploadStage, S as formatBytes, T as getUploadItemMessage, U as AssetDocumentOptions, V as withProvidedOptions, W as AssetImageOptions, X as AssetVideoOptions, Y as AssetSpreadsheetOptions, Z as AssetView, _ as DEFAULT_MESSAGES, _t as DEFAULT_VIEWER_MESSAGES, a as ProgressFetchOptions, at as isImageReady, b as describeUploadItem, bt as resolveViewerMessages, c as ICON_ATTRIBUTES, ct as DocumentViewerOptions, d as AssetDisplayOptions, dt as TextViewerOptions, et as getAssetAspectRatio, f as AssetEventHandlers, ft as ViewerAsset, g as CalmLensMessages, gt as isSpreadsheetFormat, ht as getAssetViewerKind, i as CALMLENS_STYLES, it as getPlayedPercent, j as CustomUploadResult, l as IconName, lt as PdfAssetOptions, m as UploaderDisplayOptions, mt as ViewerTextOptions, n as CalmLensTheme, nt as getAssetViewKey, o as createProgressFetch, ot as pickAssetSource, p as AssetProps, pt as ViewerOptions, q as AssetSession, r as resolveTheme, rt as getPeakHeights, s as ICONS, st as AssetViewerKind, t as CALMLENS_THEME, tt as getAssetView, u as ASSET_FILE_ICON_SIZE, ut as SpreadsheetViewerOptions, v as UploadItemView, vt as ViewerMessages, w as getDropzoneHint, x as describeUploader, y as UploaderView, yt as formatViewerMessage } from "./Core-
|
|
4
|
-
import { a as UploaderProps, i as UploadSnapshot, n as UploadControllerOptions, r as UploadItem, s as createUploadController, t as CalmLensUpload } from "./BrowserUpload-
|
|
5
|
-
import { _ as spreadsheetColumnIndex, a as isMountedViewerKind, b as AssetViewer, c as AssetViewerOptionsByKind, d as createTextViewer, f as SpreadsheetCell, g as parseSpreadsheetText, h as getSpreadsheetPage, i as getMountedViewerOptions, l as VIEWER_STYLES, m as SpreadsheetSheet, n as AssetViewerMount, o as ASSET_VIEWERS, p as SpreadsheetRow, r as MountedViewerKind, s as AssetViewerName, t as MediaStreamPlayer, u as createSpreadsheetViewer, v as loadPdfJs, x as ViewerState, y as createDocumentViewer } from "./ui-
|
|
1
|
+
import { O as CalmLensAppClientOptions, en as ViewerClaims, g as AssetModerationStatus, i as AssetAvailability } from "./CalmLensTypes-CtO4Dieu.js";
|
|
2
|
+
import "./index-DQUZYLVY.js";
|
|
3
|
+
import { $ as MediaPlayback, A as CustomUploadContext, B as isFileAccepted, C as formatMessage, D as resolveMessages, E as getUploadItemOutcome, F as UploadFile, G as AssetImageSource, H as AssetDisplay, J as AssetSessionState, K as AssetOptions, M as UploadClient, N as UploadController, O as CalmLensProvidedOptions, Q as INSTANT_LOAD_MS, R as UploadStage, S as formatBytes, T as getUploadItemMessage, U as AssetDocumentOptions, V as withProvidedOptions, W as AssetImageOptions, X as AssetVideoOptions, Y as AssetSpreadsheetOptions, Z as AssetView, _ as DEFAULT_MESSAGES, _t as DEFAULT_VIEWER_MESSAGES, a as ProgressFetchOptions, at as isImageReady, b as describeUploadItem, bt as resolveViewerMessages, c as ICON_ATTRIBUTES, ct as DocumentViewerOptions, d as AssetDisplayOptions, dt as TextViewerOptions, et as getAssetAspectRatio, f as AssetEventHandlers, ft as ViewerAsset, g as CalmLensMessages, gt as isSpreadsheetFormat, ht as getAssetViewerKind, i as CALMLENS_STYLES, it as getPlayedPercent, j as CustomUploadResult, l as IconName, lt as PdfAssetOptions, m as UploaderDisplayOptions, mt as ViewerTextOptions, n as CalmLensTheme, nt as getAssetViewKey, o as createProgressFetch, ot as pickAssetSource, p as AssetProps, pt as ViewerOptions, q as AssetSession, r as resolveTheme, rt as getPeakHeights, s as ICONS, st as AssetViewerKind, t as CALMLENS_THEME, tt as getAssetView, u as ASSET_FILE_ICON_SIZE, ut as SpreadsheetViewerOptions, v as UploadItemView, vt as ViewerMessages, w as getDropzoneHint, x as describeUploader, y as UploaderView, yt as formatViewerMessage } from "./Core-BJaLU71Q.js";
|
|
4
|
+
import { a as UploaderProps, i as UploadSnapshot, n as UploadControllerOptions, r as UploadItem, s as createUploadController, t as CalmLensUpload } from "./BrowserUpload-CRbCsX7a.js";
|
|
5
|
+
import { _ as spreadsheetColumnIndex, a as isMountedViewerKind, b as AssetViewer, c as AssetViewerOptionsByKind, d as createTextViewer, f as SpreadsheetCell, g as parseSpreadsheetText, h as getSpreadsheetPage, i as getMountedViewerOptions, l as VIEWER_STYLES, m as SpreadsheetSheet, n as AssetViewerMount, o as ASSET_VIEWERS, p as SpreadsheetRow, r as MountedViewerKind, s as AssetViewerName, t as MediaStreamPlayer, u as createSpreadsheetViewer, v as loadPdfJs, x as ViewerState, y as createDocumentViewer } from "./ui-BGywTQ2M.js";
|
|
6
6
|
import { App, MaybeRefOrGetter, PropType, ShallowRef } from "vue";
|
|
7
7
|
/** Shows a text asset's text, escaped, in a scrolling region. */
|
|
8
8
|
export declare const CalmLensTextViewer: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
package/cjs/vue.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_ui = require("./ui-
|
|
3
|
-
const require_Core = require("./Core-
|
|
4
|
-
const require_UploadController = require("./UploadController-
|
|
2
|
+
const require_ui = require("./ui-DVQm0TFJ.js");
|
|
3
|
+
const require_Core = require("./Core-DCnnUsgF.js");
|
|
4
|
+
const require_UploadController = require("./UploadController-CEL3N4Ae.js");
|
|
5
5
|
const require_FileIcons = require("./FileIcons-Ob003MdS.js");
|
|
6
|
-
const require_BrowserUpload = require("./BrowserUpload-
|
|
6
|
+
const require_BrowserUpload = require("./BrowserUpload-Dz4UwTTJ.js");
|
|
7
7
|
let vue = require("vue");
|
|
8
8
|
// src/viewers/Vue.ts
|
|
9
9
|
const optional$1 = (type) => ({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { F as UploadFile, I as UploadItem$1, L as UploadSnapshot$1, N as UploadController, P as UploadControllerOptions$1, h as UploaderProps$1, k as CalmLensUpload$1 } from "./Core-
|
|
2
|
-
import { r as UseCalmLensUploadResult$1 } from "./ReactUpload-
|
|
1
|
+
import { F as UploadFile, I as UploadItem$1, L as UploadSnapshot$1, N as UploadController, P as UploadControllerOptions$1, h as UploaderProps$1, k as CalmLensUpload$1 } from "./Core-BJaLU71Q.js";
|
|
2
|
+
import { r as UseCalmLensUploadResult$1 } from "./ReactUpload-BGUkcMpg.js";
|
|
3
3
|
type UploadItem<F extends UploadFile = File> = UploadItem$1<F>;
|
|
4
4
|
type CalmLensUpload<F extends UploadFile = File> = CalmLensUpload$1<F>;
|
|
5
5
|
type UploadSnapshot<F extends UploadFile = File> = UploadSnapshot$1<F>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as createUploadController$1 } from "./UploadController
|
|
1
|
+
import { n as createUploadController$1 } from "./UploadController--Qz3DP2W.js";
|
|
2
2
|
// src/ui/BrowserUpload.ts
|
|
3
3
|
/** Creates an upload queue for the browser components, such as one a form starts on submit. */
|
|
4
4
|
const createUploadController = (options) => createUploadController$1(options);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { d as prepareSubmitAssetOptions, f as resolveConnectionOptions, i as CalmLensConnection, p as splitsIntoParts, s as expectUploadedAsset, t as APP_OPTION_KEYS } from "./CalmLensOptionKeys-
|
|
1
|
+
import { T as validateAppClientOptions, dt as invalidConfig, g as encodePathSegment, l as buildAssetUrl, m as checkOptionKeys, p as DEFAULT_CDN_BASE_URL, ut as invalidArgument } from "./ModerationContextLimits-DaFaXt45.js";
|
|
2
|
+
import { d as prepareSubmitAssetOptions, f as resolveConnectionOptions, i as CalmLensConnection, p as splitsIntoParts, s as expectUploadedAsset, t as APP_OPTION_KEYS } from "./CalmLensOptionKeys-BYqFZ0FP.js";
|
|
3
3
|
// src/client/CalmLensAppClient.ts
|
|
4
4
|
const inspectSymbol = Symbol.for("nodejs.util.inspect.custom");
|
|
5
5
|
/** `options`, once `checkOptionKeys` finds only keys `operation` takes. */
|
|
@@ -119,7 +119,7 @@ getAssetUrl: (urlOptions) => {
|
|
|
119
119
|
const data = await this.#connection.forCall("assets.uploadPart", requestOptions).uploadPart(`${this.uploadsPath}/${encodedAssetId}/part`, options, this.authHeaders(assetId));
|
|
120
120
|
return expectUploadedAsset(data);
|
|
121
121
|
},
|
|
122
|
-
/** Checks an upload this client made. `
|
|
122
|
+
/** Checks an upload this client made. `classification.moderation.decision` is present when the preset shows decisions. */
|
|
123
123
|
retrieve: async (options, requestOptions) => {
|
|
124
124
|
const { assetId } = checked("assets.retrieve", options);
|
|
125
125
|
const encodedAssetId = encodePathSegment(assetId, "Asset ID");
|