calmlens 0.21.0 → 0.23.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 (85) hide show
  1. package/README.md +3 -2
  2. package/bin/calmlens.js +594 -88
  3. package/{esm/BrowserUpload-D-NnAN7g.d.ts → cjs/BrowserUpload-B2kmc3Y_.d.ts} +2 -2
  4. package/cjs/{BrowserUpload-CeSwiMo5.js → BrowserUpload-B5IJpb8m.js} +1 -1
  5. package/{esm/CalmLensAppClient-gG16T2py.d.ts → cjs/CalmLensAppClient-CMVh0y5w.d.ts} +1 -1
  6. package/cjs/{CalmLensAppClient-0UVCuNqW.js → CalmLensAppClient-DWClthAd.js} +3 -3
  7. package/cjs/{CalmLensOptionKeys-CYY6elxg.js → CalmLensOptionKeys-DsPvFCox.js} +139 -31
  8. package/cjs/{CalmLensServerClient-nfu6_YEW.js → CalmLensServerClient-B35N3hCo.js} +66 -9
  9. package/cjs/{CalmLensServerClient-BHx3x_nZ.d.ts → CalmLensServerClient-izj412cc.d.ts} +43 -7
  10. package/cjs/{CalmLensTypes-CUB0YYVz.d.ts → CalmLensTypes-SmOCgKI3.d.ts} +858 -70
  11. package/cjs/{Classification-Q5zGpR8l-CEWjnE39.d.ts → Classification-CxRedzgH-C9qlYW_J.d.ts} +35 -0
  12. package/cjs/{Core-Dc3cteU7.js → Core-5Mrihf2l.js} +10 -7
  13. package/{esm/Core-C82YmjjX.d.ts → cjs/Core-Dt_HUNvH.d.ts} +9 -5
  14. package/cjs/{ModerationContextLimits-BxOmeSqq.js → ModerationContextLimits-Bm8DxcJ_.js} +64 -12
  15. package/cjs/{ReactUpload-BK2O3dnK.js → ReactUpload-BJCjlqEb.js} +1 -1
  16. package/cjs/{ReactUpload-DiiXfKvj.d.ts → ReactUpload-Bd7Hea4w.d.ts} +1 -1
  17. package/{esm/TestTriggers-D0pYHbkr-D5T0VdSn.d.ts → cjs/TestTriggers-BJ4B-MXR-D1tGifPU.d.ts} +7 -5
  18. package/cjs/{TestTriggers-BTyXtX0Q-ATuFDhLX.js → TestTriggers-CiFcTHX3-BmfH4J3f.js} +35 -22
  19. package/cjs/{UploadController-DLyiLDTB.js → UploadController-DoD51qnV.js} +2 -2
  20. package/{esm/WebhookPayload-BLT2y_Jy.d.ts → cjs/WebhookPayload-C7KAk3iR.d.ts} +28 -1
  21. package/cjs/app.d.ts +6 -6
  22. package/cjs/app.js +2 -2
  23. package/cjs/elements.d.ts +4 -4
  24. package/cjs/elements.js +4 -4
  25. package/{esm/index-CKRgjV16.d.ts → cjs/index-BJf0y_Uk.d.ts} +3 -3
  26. package/cjs/index.d.ts +5 -5
  27. package/cjs/index.js +1 -1
  28. package/cjs/react-native.d.ts +2 -2
  29. package/cjs/react-native.js +4 -4
  30. package/cjs/react.d.ts +3 -3
  31. package/cjs/react.js +5 -5
  32. package/cjs/server.d.ts +6 -6
  33. package/cjs/server.js +2 -2
  34. package/cjs/test-inputs.d.ts +1 -1
  35. package/cjs/test-inputs.js +13 -13
  36. package/cjs/testing.d.ts +22 -9
  37. package/cjs/testing.js +399 -57
  38. package/cjs/{ui-CTBUxnVp.d.ts → ui-DNXPuzha.d.ts} +2 -2
  39. package/cjs/{ui-CZ8exACq.js → ui-DPLnhovP.js} +3 -3
  40. package/cjs/ui.d.ts +2 -2
  41. package/cjs/ui.js +3 -3
  42. package/cjs/vue.d.ts +5 -5
  43. package/cjs/vue.js +4 -4
  44. package/{cjs/BrowserUpload-D-NnAN7g.d.ts → esm/BrowserUpload-B2kmc3Y_.d.ts} +2 -2
  45. package/esm/{BrowserUpload-i9OhCzMJ.js → BrowserUpload-BheeMat4.js} +1 -1
  46. package/{cjs/CalmLensAppClient-gG16T2py.d.ts → esm/CalmLensAppClient-CMVh0y5w.d.ts} +1 -1
  47. package/esm/{CalmLensAppClient-CK4_Py0c.js → CalmLensAppClient-D51UlnU3.js} +3 -3
  48. package/esm/{CalmLensOptionKeys-BGZlIsT2.js → CalmLensOptionKeys-BmYuSh9G.js} +139 -31
  49. package/esm/{CalmLensServerClient-dAQUcDWb.js → CalmLensServerClient-CJCjmAXh.js} +66 -9
  50. package/esm/{CalmLensServerClient-BHx3x_nZ.d.ts → CalmLensServerClient-izj412cc.d.ts} +43 -7
  51. package/esm/{CalmLensTypes-CUB0YYVz.d.ts → CalmLensTypes-SmOCgKI3.d.ts} +858 -70
  52. package/esm/{Classification-Q5zGpR8l-CEWjnE39.d.ts → Classification-CxRedzgH-C9qlYW_J.d.ts} +35 -0
  53. package/esm/{Core-BxeIud_S.js → Core-5A2CZKsC.js} +10 -7
  54. package/{cjs/Core-C82YmjjX.d.ts → esm/Core-Dt_HUNvH.d.ts} +9 -5
  55. package/esm/{ModerationContextLimits-B6_RalCQ.js → ModerationContextLimits-DeqK3UAt.js} +64 -12
  56. package/esm/{ReactUpload-DiiXfKvj.d.ts → ReactUpload-Bd7Hea4w.d.ts} +1 -1
  57. package/esm/{ReactUpload-DxwVqfX1.js → ReactUpload-OkhH4jXm.js} +1 -1
  58. package/{cjs/TestTriggers-D0pYHbkr-D5T0VdSn.d.ts → esm/TestTriggers-BJ4B-MXR-D1tGifPU.d.ts} +7 -5
  59. package/esm/{TestTriggers-BTyXtX0Q-GRB9jQwo.js → TestTriggers-CiFcTHX3-BK2-sgOC.js} +35 -22
  60. package/esm/{UploadController-D9Z-h00Q.js → UploadController-BssSSy8Y.js} +2 -2
  61. package/{cjs/WebhookPayload-BLT2y_Jy.d.ts → esm/WebhookPayload-C7KAk3iR.d.ts} +28 -1
  62. package/esm/app.d.ts +6 -6
  63. package/esm/app.js +2 -2
  64. package/esm/elements.d.ts +4 -4
  65. package/esm/elements.js +4 -4
  66. package/{cjs/index-CKRgjV16.d.ts → esm/index-BJf0y_Uk.d.ts} +3 -3
  67. package/esm/index.d.ts +5 -5
  68. package/esm/index.js +1 -1
  69. package/esm/react-native.d.ts +2 -2
  70. package/esm/react-native.js +4 -4
  71. package/esm/react.d.ts +3 -3
  72. package/esm/react.js +5 -5
  73. package/esm/server.d.ts +6 -6
  74. package/esm/server.js +2 -2
  75. package/esm/test-inputs.d.ts +1 -1
  76. package/esm/test-inputs.js +1 -1
  77. package/esm/testing.d.ts +22 -9
  78. package/esm/testing.js +393 -51
  79. package/esm/{ui-Cr7s6JHm.js → ui-CZVG46z9.js} +3 -3
  80. package/esm/{ui-CTBUxnVp.d.ts → ui-DNXPuzha.d.ts} +2 -2
  81. package/esm/ui.d.ts +2 -2
  82. package/esm/ui.js +3 -3
  83. package/esm/vue.d.ts +5 -5
  84. package/esm/vue.js +4 -4
  85. package/package.json +2 -2
package/README.md CHANGED
@@ -17,7 +17,7 @@ The package has two clients, each with its own import:
17
17
  | `calmlens/server` | `CalmLensServerClient` | On your server: Node.js 22 or later, Bun, Deno, Cloudflare Workers | A project API key |
18
18
  | `calmlens/app` | `CalmLensAppClient` | In browsers and React Native apps | An upload preset, with an optional upload token from your server |
19
19
 
20
- API keys are secret, so `CalmLensServerClient` refuses to start in a web page or app. Upload from browsers and apps with `CalmLensAppClient`, and serve private content to them with signed URLs. The package ships ES modules and CommonJS with type declarations and loads no other packages at runtime.
20
+ API keys are secret, so `CalmLensServerClient` refuses to start in a web page or app. Upload from browsers and apps with `CalmLensAppClient`, and serve private content to them with signed URLs. The package ships ES modules and CommonJS with type declarations. The main, `/server` and `/app` entry points load no other packages at runtime. The package depends on `zod`, which its type declarations and testing helpers use, and on `pdfjs-dist` and `hls.js`, which the UI viewers load only when they show a document or a stream.
21
21
 
22
22
  Versions follow semantic versioning: see [Versioning and support](https://calmlens.com/docs/sdk#versioning-and-support).
23
23
 
@@ -75,6 +75,7 @@ The latest applied review in `classification.moderation.manualReviews` takes pre
75
75
  - Record [reviewer decisions](https://calmlens.com/docs/guides/human-review), [retry failed processing](https://calmlens.com/docs/guides/asset-lifecycle#recover-from-processing-failure), and [organise assets in folders](https://calmlens.com/docs/sdk/javascript/reference#folders).
76
76
  - [Verify and parse webhooks](https://calmlens.com/docs/sdk/javascript#webhooks), or poll the [events feed](https://calmlens.com/docs/sdk/javascript/reference#events-feed).
77
77
  - [Handle errors](https://calmlens.com/docs/sdk/javascript/reference#errors) by stable code, and set [timeouts and request budgets](https://calmlens.com/docs/sdk/javascript/reference#request-budgets).
78
+ - [Manage configuration in code](https://calmlens.com/docs/guides/configuration-as-code): `uploadPresets.ensure`, `projectSettings.get`/`update` and `metadataFields.ensure`, each guarded by a revision, or declare the project in `calmlens.config.json` and run `calmlens plan` and `calmlens apply` in CI.
78
79
  - Forward events to a local handler with the bundled [`calmlens` CLI](https://calmlens.com/docs/guides/local-development): `npx calmlens listen --forward-to http://localhost:3000/api/webhooks/calmlens`.
79
80
 
80
81
  Every public SDK operation accepts one options object, so call sites stay stable as optional fields are added. The [SDK reference](https://calmlens.com/docs/sdk/javascript/reference) lists every option and method.
@@ -83,7 +84,7 @@ Every public SDK operation accepts one options object, so call sites stay stable
83
84
 
84
85
  `calmlens/testing` runs the real clients against an in-memory CalmLens API and CDN, with moderation outcomes, recorded requests, injected failures and signed webhook deliveries. See [JavaScript testing](https://calmlens.com/docs/sdk/javascript/testing).
85
86
 
86
- `calmlens/test-inputs` makes signed test codes and images that a real project with test inputs turned on moderates as the scenario you choose. A code counts only as the whole text and an image only as the whole upload. See [Generate test inputs](https://calmlens.com/docs/sdk/javascript/testing#generate-test-inputs).
87
+ `calmlens/test-inputs` makes signed test codes and images that the project they are signed for moderates as the scenario you choose. A code counts only as the whole text and an image only as the whole upload. See [Generate test inputs](https://calmlens.com/docs/sdk/javascript/testing#generate-test-inputs).
87
88
 
88
89
  ## Links
89
90