calmlens 0.37.1 → 0.38.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/bin/calmlens.js +9 -3
  2. package/cjs/{BrowserUpload-84KQWr1Q.js → BrowserUpload-BO_ZukUM.js} +1 -1
  3. package/{esm/BrowserUpload-CuG3tWSo.d.ts → cjs/BrowserUpload-BuTS7yTy.d.ts} +2 -2
  4. package/cjs/{CalmLensAppClient-D4tRb_P2.js → CalmLensAppClient-DoNMg8Dh.js} +3 -3
  5. package/{esm/CalmLensAppClient-QqtovWE-.d.ts → cjs/CalmLensAppClient-L5x_sMOI.d.ts} +1 -1
  6. package/cjs/{CalmLensCdn-CdYY_XtK.js → CalmLensCdn-B_Tbwq10.js} +2 -2
  7. package/cjs/{CalmLensConnection-GkR2cKn5.js → CalmLensConnection-Dhg1amnb.js} +2 -2
  8. package/cjs/{CalmLensError-ifj5rLmk.js → CalmLensError-C9g7GXfU.js} +7 -2
  9. package/{esm/CalmLensServerClient-csSQqHBt.d.ts → cjs/CalmLensServerClient-2H0ZpJlr.d.ts} +5 -5
  10. package/cjs/{CalmLensServerClient-cgPOG4Sv.js → CalmLensServerClient-D0wCcQNn.js} +15 -6
  11. package/cjs/{CalmLensTypes-_f7QVRtO.d.ts → CalmLensTypes-CCsoVr39.d.ts} +4 -4
  12. package/{esm/Core-4iFxKJnY.d.ts → cjs/Core-B110Ug8_.d.ts} +2 -2
  13. package/cjs/{Core-BlnBBJKb.js → Core-iNgZ8Cij.js} +3 -3
  14. package/cjs/{ReactUpload-D3AYIZBh.js → ReactUpload-BS8bYIhv.js} +1 -1
  15. package/cjs/{ReactUpload-4qd2xACg.d.ts → ReactUpload-CbtQtN6v.d.ts} +1 -1
  16. package/cjs/{UploadController-BYuHuZ7K.js → UploadController-CVKtUCK0.js} +2 -2
  17. package/{esm/WebhookPayload-BJtggTLd.d.ts → cjs/WebhookPayload-_fvY2eu8.d.ts} +5 -3
  18. package/cjs/app.d.ts +4 -4
  19. package/cjs/app.js +3 -3
  20. package/cjs/elements.d.ts +4 -4
  21. package/cjs/elements.js +4 -4
  22. package/cjs/{index-IEA75nev.d.ts → index-Dk3I5YXf.d.ts} +2 -2
  23. package/cjs/index.d.ts +3 -3
  24. package/cjs/index.js +2 -2
  25. package/cjs/react-native.d.ts +2 -2
  26. package/cjs/react-native.js +4 -4
  27. package/cjs/react.d.ts +4 -4
  28. package/cjs/react.js +5 -5
  29. package/cjs/server.d.ts +4 -4
  30. package/cjs/server.js +3 -3
  31. package/cjs/{CalmLensTestInputArguments-C6S09FVQ.js → test-inputs-BVJZjtFd.js} +156 -16
  32. package/{esm/TestTriggers-CjDhhz78.d.ts → cjs/test-inputs-JaZaV9Up.d.ts} +20 -1
  33. package/cjs/test-inputs.d.ts +2 -18
  34. package/cjs/test-inputs.js +15 -126
  35. package/cjs/testing.d.ts +11 -14
  36. package/cjs/testing.js +35 -66
  37. package/cjs/{ui-BMQW3Hse.d.ts → ui--E_s-cDd.d.ts} +2 -2
  38. package/cjs/{ui-Cy8MWXOw.js → ui-CuO37F4u.js} +2 -2
  39. package/cjs/ui.d.ts +2 -2
  40. package/cjs/ui.js +3 -3
  41. package/cjs/vue.d.ts +5 -5
  42. package/cjs/vue.js +4 -4
  43. package/{cjs/BrowserUpload-CuG3tWSo.d.ts → esm/BrowserUpload-BuTS7yTy.d.ts} +2 -2
  44. package/esm/{BrowserUpload-C429CcUi.js → BrowserUpload-DxgiUXC2.js} +1 -1
  45. package/esm/{CalmLensAppClient-Brvc-GXt.js → CalmLensAppClient-C7ScAfRx.js} +3 -3
  46. package/{cjs/CalmLensAppClient-QqtovWE-.d.ts → esm/CalmLensAppClient-L5x_sMOI.d.ts} +1 -1
  47. package/esm/{CalmLensCdn-cmxtF_dw.js → CalmLensCdn-CW5Fn3ph.js} +2 -2
  48. package/esm/{CalmLensConnection-DEfpIugc.js → CalmLensConnection-Blv8JyLF.js} +2 -2
  49. package/esm/{CalmLensError-C15tWu8W.js → CalmLensError-DjkibkdI.js} +7 -2
  50. package/{cjs/CalmLensServerClient-csSQqHBt.d.ts → esm/CalmLensServerClient-2H0ZpJlr.d.ts} +5 -5
  51. package/esm/{CalmLensServerClient-BpsCXVeO.js → CalmLensServerClient-C7n6EzVd.js} +15 -6
  52. package/esm/{CalmLensTypes-_f7QVRtO.d.ts → CalmLensTypes-CCsoVr39.d.ts} +4 -4
  53. package/{cjs/Core-4iFxKJnY.d.ts → esm/Core-B110Ug8_.d.ts} +2 -2
  54. package/esm/{Core-C_f1o9RQ.js → Core-BRrPxS4i.js} +3 -3
  55. package/esm/{ReactUpload-Ch5qY7PS.js → ReactUpload-BGPktblV.js} +1 -1
  56. package/esm/{ReactUpload-4qd2xACg.d.ts → ReactUpload-CbtQtN6v.d.ts} +1 -1
  57. package/esm/{UploadController-9fkYFVZM.js → UploadController-CQ4NouIU.js} +2 -2
  58. package/{cjs/WebhookPayload-BJtggTLd.d.ts → esm/WebhookPayload-_fvY2eu8.d.ts} +5 -3
  59. package/esm/app.d.ts +4 -4
  60. package/esm/app.js +3 -3
  61. package/esm/elements.d.ts +4 -4
  62. package/esm/elements.js +4 -4
  63. package/esm/{index-IEA75nev.d.ts → index-Dk3I5YXf.d.ts} +2 -2
  64. package/esm/index.d.ts +3 -3
  65. package/esm/index.js +2 -2
  66. package/esm/react-native.d.ts +2 -2
  67. package/esm/react-native.js +4 -4
  68. package/esm/react.d.ts +4 -4
  69. package/esm/react.js +5 -5
  70. package/esm/server.d.ts +4 -4
  71. package/esm/server.js +3 -3
  72. package/esm/{CalmLensTestInputArguments-DS_3mt1C.js → test-inputs-DizPp8_w.js} +145 -5
  73. package/{cjs/TestTriggers-CjDhhz78.d.ts → esm/test-inputs-JaZaV9Up.d.ts} +20 -1
  74. package/esm/test-inputs.d.ts +2 -18
  75. package/esm/test-inputs.js +1 -115
  76. package/esm/testing.d.ts +11 -14
  77. package/esm/testing.js +24 -55
  78. package/esm/{ui-BMQW3Hse.d.ts → ui--E_s-cDd.d.ts} +2 -2
  79. package/esm/{ui-HK74e42L.js → ui-B-QOHuVI.js} +2 -2
  80. package/esm/ui.d.ts +2 -2
  81. package/esm/ui.js +3 -3
  82. package/esm/vue.d.ts +5 -5
  83. package/esm/vue.js +4 -4
  84. package/package.json +1 -1
@@ -1,115 +1 @@
1
- import { a as TEST_FACE_AGE_PRESETS, c as detectTestImage, d as getImageTestCategories, i as TEST_FACE_AGE_MAX, l as detectTestTrigger, m as testInputForSignal, n as TEST_DETECTIONS_MAX, o as TEST_INPUT_KEY_PATTERN, p as paintTestImage$1, r as TEST_DETECTION_BOX_MAX, s as TEST_INPUT_PRESETS, t as withValidTestInputArguments, u as generateTestTextCode$1 } from "./CalmLensTestInputArguments-DS_3mt1C.js";
2
- // src/client/TestImagePng.ts
3
- /**
4
- * Encodes a painted test image as a PNG: 8-bit RGBA rows without filtering in stored deflate
5
- * blocks, as every SDK writes it, so the bytes match across SDKs. Runs anywhere, with no
6
- * compression library.
7
- */
8
- function encodeTestImagePng(width, height, rgba) {
9
- const stride = width * 4;
10
- const raw = new Uint8Array((stride + 1) * height);
11
- for (let row = 0; row < height; row++) raw.set(rgba.subarray(row * stride, (row + 1) * stride), row * (stride + 1) + 1);
12
- const blocks = Math.max(1, Math.ceil(raw.length / 65535));
13
- const stream = new Uint8Array(2 + raw.length + blocks * 5 + 4);
14
- stream.set([120, 1]);
15
- let position = 2;
16
- for (let offset = 0; offset < raw.length || position === 2; offset += 65535) {
17
- const block = raw.subarray(offset, offset + 65535);
18
- const length = block.length;
19
- stream.set([
20
- offset + length >= raw.length ? 1 : 0,
21
- length & 255,
22
- length >> 8,
23
- ~length & 255,
24
- ~length >> 8 & 255
25
- ], position);
26
- stream.set(block, position + 5);
27
- position += 5 + length;
28
- }
29
- writeUint32(stream, position, adler32(raw));
30
- const header = /* @__PURE__ */ new Uint8Array(13);
31
- writeUint32(header, 0, width);
32
- writeUint32(header, 4, height);
33
- header.set([
34
- 8,
35
- 6,
36
- 0,
37
- 0,
38
- 0
39
- ], 8);
40
- return concat([
41
- Uint8Array.of(137, 80, 78, 71, 13, 10, 26, 10),
42
- chunk("IHDR", header),
43
- chunk("IDAT", stream),
44
- chunk("IEND", /* @__PURE__ */ new Uint8Array(0))
45
- ]);
46
- }
47
- function chunk(kind, body) {
48
- const typed = new Uint8Array(4 + body.length);
49
- for (let i = 0; i < 4; i++) typed[i] = kind.charCodeAt(i);
50
- typed.set(body, 4);
51
- const out = new Uint8Array(12 + body.length);
52
- writeUint32(out, 0, body.length);
53
- out.set(typed, 4);
54
- writeUint32(out, 8 + body.length, crc32(typed));
55
- return out;
56
- }
57
- function writeUint32(target, offset, value) {
58
- target[offset] = value >>> 24;
59
- target[offset + 1] = value >>> 16 & 255;
60
- target[offset + 2] = value >>> 8 & 255;
61
- target[offset + 3] = value & 255;
62
- }
63
- function concat(parts) {
64
- const out = new Uint8Array(parts.reduce((total, part) => total + part.length, 0));
65
- let offset = 0;
66
- for (const part of parts) {
67
- out.set(part, offset);
68
- offset += part.length;
69
- }
70
- return out;
71
- }
72
- let crcTable;
73
- function crc32(bytes) {
74
- if (!crcTable) {
75
- crcTable = /* @__PURE__ */ new Uint32Array(256);
76
- for (let n = 0; n < 256; n++) {
77
- let c = n;
78
- for (let k = 0; k < 8; k++) c = c & 1 ? 3988292384 ^ c >>> 1 : c >>> 1;
79
- crcTable[n] = c >>> 0;
80
- }
81
- }
82
- let crc = 4294967295;
83
- for (const byte of bytes) crc = crcTable[(crc ^ byte) & 255] ^ crc >>> 8;
84
- return (crc ^ 4294967295) >>> 0;
85
- }
86
- function adler32(bytes) {
87
- let a = 1;
88
- let b = 0;
89
- for (const byte of bytes) {
90
- a = (a + byte) % 65521;
91
- b = (b + a) % 65521;
92
- }
93
- return (b << 16 | a) >>> 0;
94
- }
95
- // src/test-inputs.ts
96
- /**
97
- * Portable test inputs: presets and custom instances share one authenticated format. CalmLens
98
- * recognises a code only as the whole text and a test image only as the whole
99
- * upload, signed with the project's own key.
100
- */
101
- /** A text code for `scenario`, signed with the project's test input key. */
102
- const generateTestTextCode = (scenario, key) => withValidTestInputArguments(key, () => generateTestTextCode$1(scenario, key));
103
- /**
104
- * The test image for `scenario`, signed with the project's test input key. Upload its `png` bytes
105
- * (or encode `rgba` in another format: the image survives lossy formats and resizing) as the whole
106
- * image, optionally on a plain single-colour border.
107
- */
108
- const paintTestImage = async (scenario, key) => {
109
- const image = await withValidTestInputArguments(key, () => paintTestImage$1(scenario, key));
110
- return {
111
- ...image,
112
- png: encodeTestImagePng(image.width, image.height, image.rgba)
113
- };
114
- };
115
- export { TEST_DETECTIONS_MAX, TEST_DETECTION_BOX_MAX, TEST_FACE_AGE_MAX, TEST_FACE_AGE_PRESETS, TEST_INPUT_KEY_PATTERN, TEST_INPUT_PRESETS, detectTestImage, detectTestTrigger, generateTestTextCode, getImageTestCategories, paintTestImage, testInputForSignal };
1
+ export { i as MEDIA_TEST_SIGNALS, a as TEST_DETECTIONS_MAX, o as TEST_DETECTION_BOX_MAX, s as TEST_FACE_AGE_MAX, c as TEST_FACE_AGE_PRESETS, l as TEST_INPUT_KEY_PATTERN, u as TEST_INPUT_PRESETS, d as detectTestImage, f as detectTestTrigger, t as generateMediaTestCode, n as generateTestTextCode, p as getImageTestCategories, r as paintTestImage, m as testInputForSignal } from "./test-inputs-DizPp8_w.js";
package/esm/testing.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- import { Jt as SignedUploadToken, Kt as SignUploadTokenOptions, Ln as PermissionGrant, Nn as TypedEvent, O as CalmLensAppClientOptions, Rn as Folder, Vn as AssetBinaryPayloadInput, k as CalmLensServerClientOptions, m as AssetModeration, on as UploadPresetDefinition, r as Asset } from "./CalmLensTypes-_f7QVRtO.js";
2
- import { t as CalmLensAppClient } from "./CalmLensAppClient-QqtovWE-.js";
3
- import { I as ApiErrorCode, n as WebhookEventPayload } from "./WebhookPayload-BJtggTLd.js";
4
- import { t as CalmLensServerClient } from "./CalmLensServerClient-csSQqHBt.js";
5
- import { t as ClassificationTestSignal } from "./TestTriggers-CjDhhz78.js";
1
+ import { Jt as SignedUploadToken, Kt as SignUploadTokenOptions, Ln as PermissionGrant, Nn as TypedEvent, O as CalmLensAppClientOptions, Rn as Folder, Vn as AssetBinaryPayloadInput, k as CalmLensServerClientOptions, m as AssetModeration, on as UploadPresetDefinition, r as Asset } from "./CalmLensTypes-CCsoVr39.js";
2
+ import { t as CalmLensAppClient } from "./CalmLensAppClient-L5x_sMOI.js";
3
+ import { I as ApiErrorCode, n as WebhookEventPayload } from "./WebhookPayload-_fvY2eu8.js";
4
+ import { t as CalmLensServerClient } from "./CalmLensServerClient-2H0ZpJlr.js";
5
+ import { a as MEDIA_TEST_SIGNALS, n as generateMediaTestCode } from "./test-inputs-JaZaV9Up.js";
6
6
  import "zod";
7
7
  /**
8
8
  * Signs a single-use upload token with `apiKey`, locally. `CalmLensServerClient` and
@@ -14,7 +14,6 @@ declare const signUploadTokenWithApiKey: (apiKey: string, options: SignUploadTok
14
14
  now?: number;
15
15
  nonce?: string;
16
16
  }) => Promise<SignedUploadToken>;
17
- export declare const MEDIA_TEST_SIGNALS: readonly ["sexual", "violence", "self-harm", "harassment", "hate", "criminal-activity", "personal-information", "profanity", "violence.graphic"];
18
17
  export declare const MOCK_API_KEY_PREFIX = "sk_test_";
19
18
  /**
20
19
  * Creates a mock API key holding `grants`. Throws `sdk/invalid-argument`, naming the grant, for
@@ -234,11 +233,11 @@ interface MockDatabaseStorage {
234
233
  getAsset(assetId: string): Promise<Asset | undefined>;
235
234
  listAssets(projectId: string): Promise<Asset[]>;
236
235
  deleteAsset(assetId: string): Promise<void>;
237
- createFolder?(folder: Folder): Promise<Folder>;
238
- updateFolder?(folder: Folder): Promise<Folder>;
239
- getFolder?(folderId: string): Promise<Folder | undefined>;
240
- listFolders?(projectId: string): Promise<Folder[]>;
241
- deleteFolder?(folderId: string): Promise<void>;
236
+ createFolder(folder: Folder): Promise<Folder>;
237
+ updateFolder(folder: Folder): Promise<Folder>;
238
+ getFolder(folderId: string): Promise<Folder | undefined>;
239
+ listFolders(projectId: string): Promise<Folder[]>;
240
+ deleteFolder(folderId: string): Promise<void>;
242
241
  }
243
242
  export declare class InMemoryMockDatabaseStorage implements MockDatabaseStorage {
244
243
  private readonly assets;
@@ -505,6 +504,4 @@ export declare const createWebhookHeaders: (options: {
505
504
  deliveryId: string;
506
505
  timestampSeconds?: number;
507
506
  }) => Promise<Record<string, string>>;
508
- /** A spoken media test phrase for `signal`, signed with the project's test input key. */
509
- export declare const generateMediaTestCode: (signal: ClassificationTestSignal, key: string) => Promise<string>;
510
- export { type MockAssetOutcome, type MockCalmLensAppClientOptions, type MockCalmLensCall, type MockCalmLensOperation, type MockCalmLensServerClientOptions, type MockDatabaseStorage, type MockDetectedFace, type MockDetectedLink, type MockDetectedPerson, type MockEventInput, type MockFailureOptions, type MockImageStorage, type MockModerate, type MockModerationInput, type MockModerationTrigger, type MockQrCode, type MockRegionalDecision, type MockRequestFailure, type MockReviewDecision, type MockServedUrl, type MockStoredContent, type MockTextRegion, type MockUploadPreset, signUploadTokenWithApiKey as signUploadToken };
507
+ export { MEDIA_TEST_SIGNALS, type MockAssetOutcome, type MockCalmLensAppClientOptions, type MockCalmLensCall, type MockCalmLensOperation, type MockCalmLensServerClientOptions, type MockDatabaseStorage, type MockDetectedFace, type MockDetectedLink, type MockDetectedPerson, type MockEventInput, type MockFailureOptions, type MockImageStorage, type MockModerate, type MockModerationInput, type MockModerationTrigger, type MockQrCode, type MockRegionalDecision, type MockRequestFailure, type MockReviewDecision, type MockServedUrl, type MockStoredContent, type MockTextRegion, type MockUploadPreset, generateMediaTestCode, signUploadTokenWithApiKey as signUploadToken };
package/esm/testing.js CHANGED
@@ -1,37 +1,12 @@
1
- import { C as invalidConfig, S as invalidArgument, T as API_ERROR_DEFINITIONS, l as CalmLensError, w as API_ERROR_CODES, x as SDK_ERROR_CODES } from "./CalmLensError-C15tWu8W.js";
2
- import { F as sleep, M as getRejectedUploadMimeTypeError, N as normalizeUploadMimeType, O as MAX_IMAGE_UPLOAD_BYTES, S as validateAppClientOptions, _ as randomUuid, f as checkTransformOptions, h as parseTransformSelector, m as isAcceptedUploadMimeType, t as ASSET_RESOURCE_PATHS, w as validateServerClientOptions } from "./CalmLensCdn-cmxtF_dw.js";
3
- import { a as WEBHOOK_TIMESTAMP_HEADER, f as signUploadTokenWithApiKey, m as stringifyJsonCanonical, n as WEBHOOK_DELIVERY_HEADER, p as decodeUploadToken, r as WEBHOOK_SIGNATURE_HEADER, t as CalmLensServerClient } from "./CalmLensServerClient-BpsCXVeO.js";
4
- import { _ as validateAssetPayload, g as assetToData, h as assetDataToUint8Array, n as MOCK_HOOKS } from "./CalmLensConnection-DEfpIugc.js";
1
+ import { C as invalidConfig, S as invalidArgument, T as API_ERROR_DEFINITIONS, l as CalmLensError, w as API_ERROR_CODES, x as SDK_ERROR_CODES } from "./CalmLensError-DjkibkdI.js";
2
+ import { F as sleep, M as getRejectedUploadMimeTypeError, N as normalizeUploadMimeType, O as MAX_IMAGE_UPLOAD_BYTES, S as validateAppClientOptions, _ as randomUuid, f as checkTransformOptions, h as parseTransformSelector, m as isAcceptedUploadMimeType, t as ASSET_RESOURCE_PATHS, w as validateServerClientOptions } from "./CalmLensCdn-CW5Fn3ph.js";
3
+ import { a as WEBHOOK_TIMESTAMP_HEADER, f as signUploadTokenWithApiKey, m as stringifyJsonCanonical, n as WEBHOOK_DELIVERY_HEADER, p as decodeUploadToken, r as WEBHOOK_SIGNATURE_HEADER, t as CalmLensServerClient } from "./CalmLensServerClient-C7n6EzVd.js";
4
+ import { _ as validateAssetPayload, g as assetToData, h as assetDataToUint8Array, n as MOCK_HOOKS } from "./CalmLensConnection-Blv8JyLF.js";
5
5
  import { t as hmacSha256Hex } from "./CryptoUtils-BLCa-oZe-DKr3LmN6.js";
6
- import { t as CalmLensAppClient } from "./CalmLensAppClient-Brvc-GXt.js";
7
- import { o as placeholderHashToDataURL, r as isFileAccepted } from "./UploadController-9fkYFVZM.js";
8
- import { _ as CLASSIFICATION_CATEGORIES, f as getTestInputTag, g as lazySchema, h as EU_COUNTRIES, t as withValidTestInputArguments } from "./CalmLensTestInputArguments-DS_3mt1C.js";
6
+ import { t as CalmLensAppClient } from "./CalmLensAppClient-C7ScAfRx.js";
7
+ import { o as placeholderHashToDataURL, r as isFileAccepted } from "./UploadController-CQ4NouIU.js";
8
+ import { _ as CLASSIFICATION_CATEGORIES, g as lazySchema, h as EU_COUNTRIES, i as MEDIA_TEST_SIGNALS, t as generateMediaTestCode } from "./test-inputs-DizPp8_w.js";
9
9
  import * as zod from "zod";
10
- // src/contract/MediaTestTriggers.js
11
- const MEDIA_TEST_SIGNALS = [...CLASSIFICATION_CATEGORIES, "violence.graphic"];
12
- const HEX_WORDS = [
13
- "zero",
14
- "one",
15
- "two",
16
- "three",
17
- "four",
18
- "five",
19
- "six",
20
- "seven",
21
- "eight",
22
- "nine",
23
- "alpha",
24
- "bravo",
25
- "charlie",
26
- "delta",
27
- "echo",
28
- "foxtrot"
29
- ];
30
- /** Read this aloud, or render it as large, high-contrast text in a video frame. */
31
- async function generateMediaTestCode$1(signal, testInputKey) {
32
- if (!MEDIA_TEST_SIGNALS.includes(signal)) throw new RangeError("Unsupported media test signal");
33
- return `Calm Lens test ${[...await getTestInputTag("media", signal, testInputKey)].map((character) => HEX_WORDS[Number.parseInt(character, 16)]).join(" ")} ${signal.replace(/[.-]/g, " ")} end test`;
34
- }
35
10
  /**
36
11
  * The character an asset ID starts with (after `asset_`) to say the region it lives in: the asset
37
12
  * table computes each row's region from it (`AssetTable`), so an ID is only ever in one region and
@@ -9857,17 +9832,14 @@ const operationsOf = (request) => {
9857
9832
  return [];
9858
9833
  };
9859
9834
  /**
9860
- * The methods whose requests the API runs under an `Idempotency-Key` (`idempotent` in its request
9861
- * definitions): a retry with the same key replays the first response. Others ignore the header.
9835
+ * Like the API, every write (POST, PUT, PATCH and DELETE) runs under its `Idempotency-Key`: a retry
9836
+ * with the same key replays the first response. Reads ignore the header.
9862
9837
  */
9863
- const IDEMPOTENT_OPERATIONS = [
9864
- "assets.create",
9865
- "assets.classify",
9866
- "text.classify",
9867
- "assets.uploadPart",
9868
- "assets.decide",
9869
- "assets.requestReview",
9870
- "hashLists.addEntry"
9838
+ const IDEMPOTENT_METHODS = [
9839
+ "POST",
9840
+ "PUT",
9841
+ "PATCH",
9842
+ "DELETE"
9871
9843
  ];
9872
9844
  /** A plain-text upload: the SDKs send text as a JSON body with `content.plainText`. */
9873
9845
  const isTextUpload = (request) => {
@@ -10289,7 +10261,7 @@ var MockCalmLensApi = class {
10289
10261
  async answer(request, operation, session) {
10290
10262
  const { url, headers } = request;
10291
10263
  if (!(request.segments[0] === "upload-presets") && headers.get("x-api-key") !== this.apiKey) return this.failureResponse(fail(API_ERROR_CODES.INVALID_API_KEY), url);
10292
- const key = operation && IDEMPOTENT_OPERATIONS.includes(operation) ? headers.get("idempotency-key")?.replace(/^[\t\n\r ]+|[\t\n\r ]+$/g, "") : void 0;
10264
+ const key = IDEMPOTENT_METHODS.includes(request.method) ? headers.get("idempotency-key")?.replace(/^[\t\n\r ]+|[\t\n\r ]+$/g, "") : void 0;
10293
10265
  const upload = headers.get("x-calmlens-upload");
10294
10266
  const contentType = headers.get("content-type");
10295
10267
  const isForm = !!upload && /^multipart\/form-data\b/i.test(contentType ?? "");
@@ -11852,7 +11824,7 @@ var MockCalmLensApi = class {
11852
11824
  * `search`, by name unless `ordering` says otherwise, with the folders above them.
11853
11825
  */
11854
11826
  async listFolders(query) {
11855
- const all = await this.databaseStorage.listFolders?.(this.projectId) ?? [];
11827
+ const all = await this.databaseStorage.listFolders(this.projectId);
11856
11828
  const parentId = query.get("parentId");
11857
11829
  const search = query.get("search")?.trim() || null;
11858
11830
  const sort = this.sort(query, ["name", "createdAt"], 1);
@@ -11902,7 +11874,7 @@ var MockCalmLensApi = class {
11902
11874
  createdAt: now,
11903
11875
  updatedAt: now
11904
11876
  };
11905
- return this.databaseStorage.createFolder ? await this.databaseStorage.createFolder(folder) : folder;
11877
+ return this.databaseStorage.createFolder(folder);
11906
11878
  }
11907
11879
  async updateFolder(folderId, body) {
11908
11880
  const folder = await this.findOwnFolder(folderId);
@@ -11913,17 +11885,17 @@ var MockCalmLensApi = class {
11913
11885
  ...name !== void 0 ? { name } : {},
11914
11886
  updatedAt: this.now()
11915
11887
  };
11916
- return this.databaseStorage.updateFolder ? await this.databaseStorage.updateFolder(updated) : updated;
11888
+ return this.databaseStorage.updateFolder(updated);
11917
11889
  }
11918
11890
  async deleteFolder(folderId) {
11919
11891
  await this.findOwnFolder(folderId);
11920
11892
  const hasAssets = (await this.databaseStorage.listAssets(this.projectId)).some((asset) => asset.folderId === folderId);
11921
- const hasChildren = (await this.databaseStorage.listFolders?.(this.projectId) ?? []).some((folder) => folder.parentId === folderId);
11893
+ const hasChildren = (await this.databaseStorage.listFolders(this.projectId)).some((folder) => folder.parentId === folderId);
11922
11894
  if (hasAssets || hasChildren) throw fail(API_ERROR_CODES.FOLDER_NOT_EMPTY, { details: {
11923
11895
  hasAssets,
11924
11896
  hasChildren
11925
11897
  } });
11926
- await this.databaseStorage.deleteFolder?.(folderId);
11898
+ await this.databaseStorage.deleteFolder(folderId);
11927
11899
  }
11928
11900
  async moveFolder(folderId, body) {
11929
11901
  const folder = await this.findOwnFolder(folderId);
@@ -11943,10 +11915,10 @@ var MockCalmLensApi = class {
11943
11915
  parentId: targetParentId,
11944
11916
  updatedAt: this.now()
11945
11917
  };
11946
- return this.databaseStorage.updateFolder ? await this.databaseStorage.updateFolder(updated) : updated;
11918
+ return this.databaseStorage.updateFolder(updated);
11947
11919
  }
11948
11920
  async resolveFolder(folderId) {
11949
- const folder = await this.databaseStorage.getFolder?.(folderId);
11921
+ const folder = await this.databaseStorage.getFolder(folderId);
11950
11922
  return folder && folder.projectId === this.projectId ? folder : void 0;
11951
11923
  }
11952
11924
  async findOwnFolder(folderId) {
@@ -11955,7 +11927,7 @@ var MockCalmLensApi = class {
11955
11927
  return folder;
11956
11928
  }
11957
11929
  async assertUniqueFolderName(name, parentId, excludeFolderId) {
11958
- if ((await this.databaseStorage.listFolders?.(this.projectId) ?? []).find((folder) => folder.id !== excludeFolderId && (folder.parentId ?? null) === parentId && folder.name === name)) throw fail(API_ERROR_CODES.DUPLICATE_FOLDER_NAME, { message: `A folder named "${name}" already exists in this location.` });
11930
+ if ((await this.databaseStorage.listFolders(this.projectId)).find((folder) => folder.id !== excludeFolderId && (folder.parentId ?? null) === parentId && folder.name === name)) throw fail(API_ERROR_CODES.DUPLICATE_FOLDER_NAME, { message: `A folder named "${name}" already exists in this location.` });
11959
11931
  }
11960
11932
  /** A page of the project's upload presets, oldest first unless `sort` says otherwise. */
11961
11933
  listUploadPresets(query) {
@@ -12224,7 +12196,7 @@ var MockCalmLensApi = class {
12224
12196
  }, url);
12225
12197
  const hasApiKey = request.headers.get("x-api-key") === this.apiKey;
12226
12198
  const grants = hasApiKey ? this.grants : [];
12227
- const folders = await this.databaseStorage.listFolders?.(this.projectId) ?? [];
12199
+ const folders = await this.databaseStorage.listFolders(this.projectId);
12228
12200
  const canDownload = () => permits(grants, "assets:download", asset.folderId ?? null, folders);
12229
12201
  const status = asset.classification.moderation.decision;
12230
12202
  const isHead = request.method === "HEAD";
@@ -12772,7 +12744,4 @@ const createWebhookHeaders = async (options) => {
12772
12744
  [WEBHOOK_SIGNATURE_HEADER]: await createWebhookSignatureHeader(options.secret, timestamp, options.body)
12773
12745
  };
12774
12746
  };
12775
- // src/testing.ts
12776
- /** A spoken media test phrase for `signal`, signed with the project's test input key. */
12777
- const generateMediaTestCode = (signal, key) => withValidTestInputArguments(key, () => generateMediaTestCode$1(signal, key));
12778
12747
  export { InMemoryMockDatabaseStorage, InMemoryMockImageStorage, MEDIA_TEST_SIGNALS, MOCK_API_KEY_ID, MOCK_API_KEY_PREFIX, MockCalmLensAppClient, MockCalmLensServerClient, MockDecision, createMockApiKey, createWebhookHeaders, createWebhookSignatureHeader, generateMediaTestCode, mockDecision, signUploadTokenWithApiKey as signUploadToken, toWebhookEventPayload };
@@ -1,5 +1,5 @@
1
- import "./CalmLensTypes-_f7QVRtO.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-4iFxKJnY.js";
1
+ import "./CalmLensTypes-CCsoVr39.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-B110Ug8_.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
- import { a as assetUrlOf, r as appendAssetLocation } from "./CalmLensCdn-cmxtF_dw.js";
2
- import "./Core-C_f1o9RQ.js";
1
+ import { a as assetUrlOf, r as appendAssetLocation } from "./CalmLensCdn-CW5Fn3ph.js";
2
+ import "./Core-BRrPxS4i.js";
3
3
  // src/ui/viewers/PdfLoader.ts
4
4
  let loading;
5
5
  /**
package/esm/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-4iFxKJnY.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-BMQW3Hse.js";
1
+ import { $ as MediaPlayback, A as CustomUploadContext, B as isFileAccepted, C as formatMessage, D as resolveMessages, E as getUploadItemOutcome, F as UploadFile, G as AssetImageSource, H as AssetDisplay, I as UploadItem, J as AssetSessionState, K as AssetOptions, L as UploadSnapshot, M as UploadClient, N as UploadController, O as CalmLensProvidedOptions, P as UploadControllerOptions, Q as INSTANT_LOAD_MS, R as UploadStage, S as formatBytes, T as getUploadItemMessage, U as AssetDocumentOptions, V as withProvidedOptions, W as AssetImageOptions, X as AssetVideoOptions, Y as AssetSpreadsheetOptions, Z as AssetView, _ as DEFAULT_MESSAGES, _t as DEFAULT_VIEWER_MESSAGES, a as ProgressFetchOptions, at as isImageReady, b as describeUploadItem, bt as resolveViewerMessages, c as ICON_ATTRIBUTES, ct as DocumentViewerOptions, d as AssetDisplayOptions, dt as TextViewerOptions, et as getAssetAspectRatio, f as AssetEventHandlers, ft as ViewerAsset, g as CalmLensMessages, gt as isSpreadsheetFormat, h as UploaderProps, ht as getAssetViewerKind, i as CALMLENS_STYLES, it as getPlayedPercent, j as CustomUploadResult, k as CalmLensUpload, l as IconName, lt as PdfAssetOptions, m as UploaderDisplayOptions, mt as ViewerTextOptions, n as CalmLensTheme, nt as getAssetViewKey, o as createProgressFetch, ot as pickAssetSource, p as AssetProps, pt as ViewerOptions, q as AssetSession, r as resolveTheme, rt as getPeakHeights, s as ICONS, st as AssetViewerKind, t as CALMLENS_THEME, tt as getAssetView, u as ASSET_FILE_ICON_SIZE, ut as SpreadsheetViewerOptions, v as UploadItemView, vt as ViewerMessages, w as getDropzoneHint, x as describeUploader, y as UploaderView, yt as formatViewerMessage, z as createUploadController } from "./Core-B110Ug8_.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--E_s-cDd.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/esm/ui.js CHANGED
@@ -1,4 +1,4 @@
1
- import { a as ASSET_VIEWERS, c as getSpreadsheetPage, d as createDocumentViewer, f as DEFAULT_VIEWER_MESSAGES, h as loadPdfJs, i as isMountedViewerKind, l as parseSpreadsheetText, m as resolveViewerMessages, n as AssetViewerMount, o as createSpreadsheetViewer, p as formatViewerMessage, r as getMountedViewerOptions, s as createTextViewer, t as MediaStreamPlayer, u as spreadsheetColumnIndex } from "./ui-HK74e42L.js";
2
- import { C as pickAssetSource, D as getAssetViewerKind, E as resolveTheme, O as isSpreadsheetFormat, S as isImageReady, T as CALMLENS_THEME, _ as getAssetAspectRatio, a as describeUploadItem, b as getPeakHeights, c as formatMessage, d as getUploadItemOutcome, f as resolveMessages, g as INSTANT_LOAD_MS, h as AssetSession, i as DEFAULT_MESSAGES, l as getDropzoneHint, m as ICON_ATTRIBUTES, o as describeUploader, p as ICONS, r as ASSET_FILE_ICON_SIZE, s as formatBytes, t as CALMLENS_STYLES, u as getUploadItemMessage, v as getAssetView, w as VIEWER_STYLES, x as getPlayedPercent, y as getAssetViewKey } from "./Core-C_f1o9RQ.js";
3
- import { a as createProgressFetch, i as withProvidedOptions, n as createUploadController, r as isFileAccepted, t as UploadController } from "./UploadController-9fkYFVZM.js";
1
+ import { a as ASSET_VIEWERS, c as getSpreadsheetPage, d as createDocumentViewer, f as DEFAULT_VIEWER_MESSAGES, h as loadPdfJs, i as isMountedViewerKind, l as parseSpreadsheetText, m as resolveViewerMessages, n as AssetViewerMount, o as createSpreadsheetViewer, p as formatViewerMessage, r as getMountedViewerOptions, s as createTextViewer, t as MediaStreamPlayer, u as spreadsheetColumnIndex } from "./ui-B-QOHuVI.js";
2
+ import { C as pickAssetSource, D as getAssetViewerKind, E as resolveTheme, O as isSpreadsheetFormat, S as isImageReady, T as CALMLENS_THEME, _ as getAssetAspectRatio, a as describeUploadItem, b as getPeakHeights, c as formatMessage, d as getUploadItemOutcome, f as resolveMessages, g as INSTANT_LOAD_MS, h as AssetSession, i as DEFAULT_MESSAGES, l as getDropzoneHint, m as ICON_ATTRIBUTES, o as describeUploader, p as ICONS, r as ASSET_FILE_ICON_SIZE, s as formatBytes, t as CALMLENS_STYLES, u as getUploadItemMessage, v as getAssetView, w as VIEWER_STYLES, x as getPlayedPercent, y as getAssetViewKey } from "./Core-BRrPxS4i.js";
3
+ import { a as createProgressFetch, i as withProvidedOptions, n as createUploadController, r as isFileAccepted, t as UploadController } from "./UploadController-CQ4NouIU.js";
4
4
  export { ASSET_FILE_ICON_SIZE, ASSET_VIEWERS, AssetSession, AssetViewerMount, CALMLENS_STYLES, CALMLENS_THEME, DEFAULT_MESSAGES, DEFAULT_VIEWER_MESSAGES, ICONS, ICON_ATTRIBUTES, INSTANT_LOAD_MS, MediaStreamPlayer, UploadController, VIEWER_STYLES, createDocumentViewer, createProgressFetch, createSpreadsheetViewer, createTextViewer, createUploadController, describeUploadItem, describeUploader, formatBytes, formatMessage, formatViewerMessage, getAssetAspectRatio, getAssetView, getAssetViewKey, getAssetViewerKind, getDropzoneHint, getMountedViewerOptions, getPeakHeights, getPlayedPercent, getSpreadsheetPage, getUploadItemMessage, getUploadItemOutcome, isFileAccepted, isImageReady, isMountedViewerKind, isSpreadsheetFormat, loadPdfJs, parseSpreadsheetText, pickAssetSource, resolveMessages, resolveTheme, resolveViewerMessages, spreadsheetColumnIndex, withProvidedOptions };
package/esm/vue.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- import { O as CalmLensAppClientOptions, fn as ViewerClaims, g as AssetModerationStatus, i as AssetAvailability } from "./CalmLensTypes-_f7QVRtO.js";
2
- import "./index-IEA75nev.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-4iFxKJnY.js";
4
- import { a as UploaderProps, i as UploadSnapshot, n as UploadControllerOptions, r as UploadItem, s as createUploadController, t as CalmLensUpload } from "./BrowserUpload-CuG3tWSo.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-BMQW3Hse.js";
1
+ import { O as CalmLensAppClientOptions, fn as ViewerClaims, g as AssetModerationStatus, i as AssetAvailability } from "./CalmLensTypes-CCsoVr39.js";
2
+ import "./index-Dk3I5YXf.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-B110Ug8_.js";
4
+ import { a as UploaderProps, i as UploadSnapshot, n as UploadControllerOptions, r as UploadItem, s as createUploadController, t as CalmLensUpload } from "./BrowserUpload-BuTS7yTy.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--E_s-cDd.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/esm/vue.js CHANGED
@@ -1,8 +1,8 @@
1
- import { a as ASSET_VIEWERS, c as getSpreadsheetPage, d as createDocumentViewer, f as DEFAULT_VIEWER_MESSAGES, h as loadPdfJs, i as isMountedViewerKind, l as parseSpreadsheetText, m as resolveViewerMessages, n as AssetViewerMount, o as createSpreadsheetViewer, p as formatViewerMessage, r as getMountedViewerOptions, s as createTextViewer, t as MediaStreamPlayer, u as spreadsheetColumnIndex } from "./ui-HK74e42L.js";
2
- import { C as pickAssetSource, D as getAssetViewerKind, E as resolveTheme, O as isSpreadsheetFormat, S as isImageReady, T as CALMLENS_THEME, _ as getAssetAspectRatio, a as describeUploadItem, b as getPeakHeights, c as formatMessage, d as getUploadItemOutcome, f as resolveMessages, g as INSTANT_LOAD_MS, h as AssetSession, i as DEFAULT_MESSAGES, l as getDropzoneHint, m as ICON_ATTRIBUTES, o as describeUploader, p as ICONS, r as ASSET_FILE_ICON_SIZE, s as formatBytes, t as CALMLENS_STYLES, u as getUploadItemMessage, v as getAssetView, w as VIEWER_STYLES, x as getPlayedPercent, y as getAssetViewKey } from "./Core-C_f1o9RQ.js";
3
- import { a as createProgressFetch, i as withProvidedOptions, n as createUploadController$1, r as isFileAccepted, t as UploadController } from "./UploadController-9fkYFVZM.js";
1
+ import { a as ASSET_VIEWERS, c as getSpreadsheetPage, d as createDocumentViewer, f as DEFAULT_VIEWER_MESSAGES, h as loadPdfJs, i as isMountedViewerKind, l as parseSpreadsheetText, m as resolveViewerMessages, n as AssetViewerMount, o as createSpreadsheetViewer, p as formatViewerMessage, r as getMountedViewerOptions, s as createTextViewer, t as MediaStreamPlayer, u as spreadsheetColumnIndex } from "./ui-B-QOHuVI.js";
2
+ import { C as pickAssetSource, D as getAssetViewerKind, E as resolveTheme, O as isSpreadsheetFormat, S as isImageReady, T as CALMLENS_THEME, _ as getAssetAspectRatio, a as describeUploadItem, b as getPeakHeights, c as formatMessage, d as getUploadItemOutcome, f as resolveMessages, g as INSTANT_LOAD_MS, h as AssetSession, i as DEFAULT_MESSAGES, l as getDropzoneHint, m as ICON_ATTRIBUTES, o as describeUploader, p as ICONS, r as ASSET_FILE_ICON_SIZE, s as formatBytes, t as CALMLENS_STYLES, u as getUploadItemMessage, v as getAssetView, w as VIEWER_STYLES, x as getPlayedPercent, y as getAssetViewKey } from "./Core-BRrPxS4i.js";
3
+ import { a as createProgressFetch, i as withProvidedOptions, n as createUploadController$1, r as isFileAccepted, t as UploadController } from "./UploadController-CQ4NouIU.js";
4
4
  import { c as renderFileIconSvg } from "./FileIcons-M6dzjFxd.js";
5
- import { t as createUploadController } from "./BrowserUpload-C429CcUi.js";
5
+ import { t as createUploadController } from "./BrowserUpload-DxgiUXC2.js";
6
6
  import { computed, defineComponent, h, inject, onBeforeUnmount, onMounted, onScopeDispose, provide, ref, shallowRef, toValue, watch, watchEffect } from "vue";
7
7
  // src/viewers/Vue.ts
8
8
  const optional$1 = (type) => ({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "calmlens",
3
- "version": "0.37.1",
3
+ "version": "0.38.0",
4
4
  "description": "Official CalmLens SDK for JavaScript and TypeScript: content moderation, asset storage and CDN delivery.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://calmlens.com/docs/sdk/javascript",