calmlens 0.19.0 → 0.21.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 +13 -9
- package/bin/calmlens.js +1646 -706
- package/cjs/{BrowserUpload-CJ4Xc9bR.js → BrowserUpload-CeSwiMo5.js} +1 -1
- package/{esm/BrowserUpload-RkxV_Vv7.d.ts → cjs/BrowserUpload-D-NnAN7g.d.ts} +2 -2
- package/cjs/{CalmLensAppClient-LHMEQ-UZ.js → CalmLensAppClient-0UVCuNqW.js} +30 -10
- package/cjs/{CalmLensAppClient-B5gfOB6J.d.ts → CalmLensAppClient-gG16T2py.d.ts} +13 -3
- package/cjs/{CalmLensOptionKeys-BUj7v5AG.js → CalmLensOptionKeys-CYY6elxg.js} +242 -345
- package/cjs/{CalmLensServerClient-DCSbwIBs.d.ts → CalmLensServerClient-BHx3x_nZ.d.ts} +107 -49
- package/cjs/{CalmLensServerClient-BVOEUT_v.js → CalmLensServerClient-nfu6_YEW.js} +297 -92
- package/cjs/{CalmLensTypes-DpU-hXq2.d.ts → CalmLensTypes-CUB0YYVz.d.ts} +26601 -27354
- package/cjs/{Classification-D3SkprrQ-CMnQKW13.d.ts → Classification-Q5zGpR8l-CEWjnE39.d.ts} +731 -607
- package/cjs/Core-C82YmjjX.d.ts +823 -0
- package/cjs/Core-Dc3cteU7.js +998 -0
- package/cjs/FileIcons-4qSX7DW2.d.ts +67 -0
- package/cjs/{ModerationContextLimits-FDpQmw_T.js → ModerationContextLimits-BxOmeSqq.js} +970 -278
- package/cjs/{ReactUpload-BvpW4hJi.js → ReactUpload-BK2O3dnK.js} +1 -1
- package/cjs/{ReactUpload-huIMnOJ4.d.ts → ReactUpload-DiiXfKvj.d.ts} +1 -1
- package/cjs/{TestTriggers-CMwMrbjy-K0YBzu2a.js → TestTriggers-BTyXtX0Q-ATuFDhLX.js} +343 -35
- package/{esm/TestTriggers-D-fwfhEP-hlaP1oW2.d.ts → cjs/TestTriggers-D0pYHbkr-D5T0VdSn.d.ts} +146 -8
- package/cjs/{UploadController-D4qOZZc3.js → UploadController-DLyiLDTB.js} +34 -14
- package/cjs/{WebhookPayload-CQg8BBZQ.d.ts → WebhookPayload-BLT2y_Jy.d.ts} +93 -86
- package/cjs/app.d.ts +6 -7
- package/cjs/app.js +4 -3
- package/cjs/elements.d.ts +123 -22
- package/cjs/elements.js +553 -156
- package/cjs/file-icons.d.ts +2 -67
- package/cjs/index-CKRgjV16.d.ts +16 -0
- package/cjs/index.d.ts +5 -6
- package/cjs/index.js +3 -2
- package/cjs/react-native.d.ts +52 -11
- package/cjs/react-native.js +231 -99
- package/cjs/react.d.ts +42 -9
- package/cjs/react.js +381 -118
- package/cjs/server.d.ts +48 -7
- package/cjs/server.js +7 -3
- package/cjs/test-inputs.d.ts +2 -2
- package/cjs/test-inputs.js +13 -9
- package/cjs/testing.d.ts +29 -16
- package/cjs/testing.js +1511 -397
- package/cjs/ui-CTBUxnVp.d.ts +139 -0
- package/cjs/ui-CZ8exACq.js +1359 -0
- package/cjs/ui.d.ts +3 -2
- package/cjs/ui.js +45 -22
- package/cjs/vue.d.ts +802 -199
- package/cjs/vue.js +359 -127
- package/{cjs/BrowserUpload-RkxV_Vv7.d.ts → esm/BrowserUpload-D-NnAN7g.d.ts} +2 -2
- package/esm/{BrowserUpload-DpzS2bbj.js → BrowserUpload-i9OhCzMJ.js} +1 -1
- package/esm/{CalmLensAppClient-BjlvBweS.js → CalmLensAppClient-CK4_Py0c.js} +30 -10
- package/esm/{CalmLensAppClient-B5gfOB6J.d.ts → CalmLensAppClient-gG16T2py.d.ts} +13 -3
- package/esm/{CalmLensOptionKeys-BKez0Wiw.js → CalmLensOptionKeys-BGZlIsT2.js} +235 -338
- package/esm/{CalmLensServerClient-DCSbwIBs.d.ts → CalmLensServerClient-BHx3x_nZ.d.ts} +107 -49
- package/esm/{CalmLensServerClient-DemxbNMn.js → CalmLensServerClient-dAQUcDWb.js} +274 -93
- package/esm/{CalmLensTypes-DpU-hXq2.d.ts → CalmLensTypes-CUB0YYVz.d.ts} +26601 -27354
- package/esm/{Classification-D3SkprrQ-CMnQKW13.d.ts → Classification-Q5zGpR8l-CEWjnE39.d.ts} +731 -607
- package/esm/Core-BxeIud_S.js +843 -0
- package/esm/Core-C82YmjjX.d.ts +823 -0
- package/esm/FileIcons-4qSX7DW2.d.ts +67 -0
- package/esm/{ModerationContextLimits-lLfmyLni.js → ModerationContextLimits-B6_RalCQ.js} +911 -261
- package/esm/{ReactUpload-huIMnOJ4.d.ts → ReactUpload-DiiXfKvj.d.ts} +1 -1
- package/esm/{ReactUpload-6klucehl.js → ReactUpload-DxwVqfX1.js} +1 -1
- package/esm/{TestTriggers-CMwMrbjy-bdowBBKw.js → TestTriggers-BTyXtX0Q-GRB9jQwo.js} +320 -36
- package/{cjs/TestTriggers-D-fwfhEP-hlaP1oW2.d.ts → esm/TestTriggers-D0pYHbkr-D5T0VdSn.d.ts} +146 -8
- package/esm/{UploadController-UxP6gj7A.js → UploadController-D9Z-h00Q.js} +34 -14
- package/esm/{WebhookPayload-CQg8BBZQ.d.ts → WebhookPayload-BLT2y_Jy.d.ts} +93 -86
- package/esm/app.d.ts +6 -7
- package/esm/app.js +3 -3
- package/esm/elements.d.ts +123 -22
- package/esm/elements.js +497 -128
- package/esm/file-icons.d.ts +2 -67
- package/esm/index-CKRgjV16.d.ts +16 -0
- package/esm/index.d.ts +5 -6
- package/esm/index.js +1 -1
- package/esm/react-native.d.ts +52 -11
- package/esm/react-native.js +205 -75
- package/esm/react.d.ts +42 -9
- package/esm/react.js +327 -91
- package/esm/server.d.ts +48 -7
- package/esm/server.js +3 -3
- package/esm/styles.css +142 -22
- package/esm/svelte/AssetViewer.svelte +25 -0
- package/esm/svelte/CalmLensAsset.svelte +318 -0
- package/esm/svelte/CalmLensDocumentViewer.svelte +7 -0
- package/esm/svelte/CalmLensImageViewer.svelte +7 -0
- package/esm/svelte/CalmLensSpreadsheetViewer.svelte +7 -0
- package/esm/svelte/CalmLensTextViewer.svelte +7 -0
- package/esm/svelte/CalmLensWebsiteViewer.svelte +7 -0
- package/esm/svelte/index.d.ts +29 -6
- package/esm/svelte/index.js +7 -2
- package/esm/test-inputs.d.ts +2 -2
- package/esm/test-inputs.js +1 -1
- package/esm/testing.d.ts +29 -16
- package/esm/testing.js +1507 -393
- package/esm/ui-CTBUxnVp.d.ts +139 -0
- package/esm/ui-Cr7s6JHm.js +1258 -0
- package/esm/ui.d.ts +3 -2
- package/esm/ui.js +4 -3
- package/esm/vue.d.ts +802 -199
- package/esm/vue.js +308 -103
- package/package.json +3 -1
- package/cjs/ModerationContext-9lGm-Mna-CcmbRnOy.d.ts +0 -67
- package/cjs/index-BcDDQJF2.d.ts +0 -253
- package/cjs/ui-B23r8BvW.d.ts +0 -539
- package/cjs/ui-Dq-cm6Rx.js +0 -586
- package/esm/ModerationContext-9lGm-Mna-CcmbRnOy.d.ts +0 -67
- package/esm/index-BcDDQJF2.d.ts +0 -253
- package/esm/svelte/CalmLensMedia.svelte +0 -134
- package/esm/ui-B23r8BvW.d.ts +0 -539
- package/esm/ui-Bn29rfAi.js +0 -461
|
@@ -1,64 +1,64 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { an as EventAsset, in as Actor, on as TypedEvent } from "./CalmLensTypes-CUB0YYVz.js";
|
|
2
2
|
import * as zod from "zod";
|
|
3
3
|
/** Error codes the CalmLens API documents, by name. */
|
|
4
4
|
declare const API_ERROR_CODES: {
|
|
5
|
-
readonly INVALID_VIEWER_CLAIMS: "viewer/invalid
|
|
5
|
+
readonly INVALID_VIEWER_CLAIMS: "viewer-claims/invalid";
|
|
6
6
|
readonly AGE_CONFIRMATION_REQUIRED: "viewer/age-confirmation-required";
|
|
7
|
-
readonly INVALID_VIEWER_REGION: "viewer/invalid
|
|
7
|
+
readonly INVALID_VIEWER_REGION: "viewer-region/invalid";
|
|
8
8
|
readonly VIEWER_REGION_REQUIRED: "viewer/region-required";
|
|
9
9
|
readonly REGIONAL_EVIDENCE_REQUIRED: "asset/regional-evidence-required";
|
|
10
10
|
readonly SIGNED_URL_EXPIRED: "signed-url/expired";
|
|
11
11
|
readonly SIGNED_URL_INVALID: "signed-url/invalid";
|
|
12
|
+
readonly SIGNED_URL_ORIGINAL_NOT_GRANTED: "signed-url/original-not-granted";
|
|
13
|
+
readonly INVALID_REQUEST: "validation/invalid-request";
|
|
12
14
|
readonly INVALID_TYPE: "validation/invalid-type";
|
|
13
15
|
readonly TOO_SMALL: "validation/too-small";
|
|
14
16
|
readonly TOO_BIG: "validation/too-big";
|
|
15
17
|
readonly INVALID_FORMAT: "validation/invalid-format";
|
|
16
18
|
readonly INVALID_VALUE: "validation/invalid-value";
|
|
17
19
|
readonly UNKNOWN_FIELD: "validation/unknown-field";
|
|
18
|
-
readonly UNSUPPORTED_CONTENT_TYPE: "
|
|
19
|
-
readonly INVALID_FILTER: "
|
|
20
|
-
readonly
|
|
21
|
-
readonly ROUTE_NOT_FOUND: "
|
|
22
|
-
readonly INTERNAL_ERROR: "
|
|
20
|
+
readonly UNSUPPORTED_CONTENT_TYPE: "request/unsupported-content-type";
|
|
21
|
+
readonly INVALID_FILTER: "filter/invalid";
|
|
22
|
+
readonly UNSUPPORTED_ORDERING_FIELD: "ordering/unsupported-field";
|
|
23
|
+
readonly ROUTE_NOT_FOUND: "request/route-not-found";
|
|
24
|
+
readonly INTERNAL_ERROR: "server/internal-error";
|
|
23
25
|
readonly UNAUTHENTICATED: "auth/unauthenticated";
|
|
24
|
-
readonly TOKEN_EXPIRED: "
|
|
25
|
-
readonly INVALID_TOKEN: "
|
|
26
|
+
readonly TOKEN_EXPIRED: "session-token/expired";
|
|
27
|
+
readonly INVALID_TOKEN: "session-token/invalid";
|
|
26
28
|
readonly SEARCH_UNAVAILABLE: "search/unavailable";
|
|
27
|
-
readonly INVALID_TRANSFORM: "
|
|
28
|
-
readonly INVALID_TRANSFORM_OPTIONS: "
|
|
29
|
-
readonly
|
|
30
|
-
readonly
|
|
31
|
-
readonly
|
|
32
|
-
readonly
|
|
33
|
-
readonly
|
|
34
|
-
readonly
|
|
35
|
-
readonly API_KEY_PROJECT_MISMATCH: "auth/project-mismatch";
|
|
36
|
-
readonly API_KEY_NOT_ACCEPTED: "auth/api-key-not-accepted";
|
|
29
|
+
readonly INVALID_TRANSFORM: "transform/invalid";
|
|
30
|
+
readonly INVALID_TRANSFORM_OPTIONS: "transform-options/invalid";
|
|
31
|
+
readonly REMOTE_URL_TOO_MANY_REDIRECTS: "remote-url/too-many-redirects";
|
|
32
|
+
readonly INVALID_CURSOR: "cursor/invalid";
|
|
33
|
+
readonly MISSING_API_KEY: "api-key/missing";
|
|
34
|
+
readonly INVALID_API_KEY: "api-key/invalid";
|
|
35
|
+
readonly API_KEY_PROJECT_MISMATCH: "api-key/project-mismatch";
|
|
36
|
+
readonly API_KEY_NOT_ACCEPTED: "api-key/not-accepted";
|
|
37
37
|
readonly PERMISSION_DENIED: "auth/permission-denied";
|
|
38
|
-
readonly
|
|
39
|
-
readonly
|
|
40
|
-
readonly
|
|
41
|
-
readonly
|
|
42
|
-
readonly
|
|
43
|
-
readonly
|
|
44
|
-
readonly
|
|
45
|
-
readonly
|
|
46
|
-
readonly INVALID_UPLOAD_MIME_TYPE: "upload/invalid-mime-type";
|
|
47
|
-
readonly INVALID_UPLOAD_PAYLOAD: "upload/invalid-payload";
|
|
38
|
+
readonly UPLOAD_TOO_LARGE: "upload/too-large";
|
|
39
|
+
readonly DOCUMENT_TOO_MANY_ITEMS: "document/too-many-items";
|
|
40
|
+
readonly INVALID_IMAGE: "image/invalid";
|
|
41
|
+
readonly IMAGE_TOO_LARGE: "image/too-large";
|
|
42
|
+
readonly FREE_UPLOADS_EXHAUSTED: "usage/free-uploads-exhausted";
|
|
43
|
+
readonly UPLOADS_PAUSED: "usage/uploads-paused";
|
|
44
|
+
readonly UNSUPPORTED_UPLOAD_TYPE: "upload/unsupported-type";
|
|
45
|
+
readonly INVALID_UPLOAD_PAYLOAD: "upload-payload/invalid";
|
|
48
46
|
readonly USE_UPLOAD_PART: "upload/use-upload-part";
|
|
49
47
|
readonly UPLOAD_NOT_OPEN: "upload/not-open";
|
|
50
|
-
readonly INVALID_UPLOAD_PART_NUMBER: "upload/invalid-
|
|
48
|
+
readonly INVALID_UPLOAD_PART_NUMBER: "upload-part/invalid-number";
|
|
51
49
|
readonly UPLOAD_MISSING: "upload/missing";
|
|
52
50
|
readonly UPLOAD_SIZE_MISMATCH: "upload/size-mismatch";
|
|
53
51
|
readonly INVALID_IDEMPOTENCY_KEY: "idempotency/invalid-key";
|
|
54
52
|
readonly IDEMPOTENCY_KEY_REUSED: "idempotency/key-reused";
|
|
55
53
|
readonly IDEMPOTENT_REQUEST_IN_PROGRESS: "idempotency/request-in-progress";
|
|
54
|
+
readonly NO_RENDERED_VERSION: "asset/no-rendered-version";
|
|
56
55
|
readonly ASSET_NOT_FOUND: "asset/not-found";
|
|
57
56
|
readonly PROJECT_NOT_FOUND: "project/not-found";
|
|
57
|
+
readonly ASSET_CHILD_NOT_DELETABLE: "asset/child-not-deletable";
|
|
58
58
|
readonly ASSET_REVIEW_CHANGED: "asset/review-changed";
|
|
59
59
|
readonly ASSET_REVIEW_NOTE_REQUIRED: "asset/review-note-required";
|
|
60
60
|
readonly ASSET_UPDATE_FAILED: "asset/update-failed";
|
|
61
|
-
readonly
|
|
61
|
+
readonly ASSET_HELD: "asset/held";
|
|
62
62
|
readonly ASSET_PROCESSING: "asset/processing";
|
|
63
63
|
readonly ASSET_DECISION_NOT_ALLOWED: "asset/decision-not-allowed";
|
|
64
64
|
readonly ASSET_DECISION_UNCHANGED: "asset/decision-unchanged";
|
|
@@ -68,18 +68,19 @@ declare const API_ERROR_CODES: {
|
|
|
68
68
|
readonly ASSET_NOT_DECIDED: "asset/not-decided";
|
|
69
69
|
readonly ASSET_POLICY_CHANGED: "asset/policy-changed";
|
|
70
70
|
readonly ASSET_REVIEWED: "asset/reviewed";
|
|
71
|
-
readonly SUPPORT_TICKET_NOT_FOUND: "support/
|
|
71
|
+
readonly SUPPORT_TICKET_NOT_FOUND: "support-ticket/not-found";
|
|
72
72
|
readonly DUPLICATE_EXTERNAL_ID: "asset/duplicate-external-id";
|
|
73
73
|
readonly FOLDER_NOT_FOUND: "folder/not-found";
|
|
74
74
|
readonly DUPLICATE_FOLDER_NAME: "folder/duplicate-name";
|
|
75
75
|
readonly FOLDER_NOT_EMPTY: "folder/not-empty";
|
|
76
76
|
readonly FOLDER_PARENT_CYCLE: "folder/parent-cycle";
|
|
77
|
-
readonly
|
|
77
|
+
readonly LENS_NOT_FOUND: "lens/not-found";
|
|
78
|
+
readonly LENS_IDENTIFIER_TAKEN: "lens/identifier-taken";
|
|
78
79
|
readonly LENS_IDENTIFIER_RESERVED: "lens/identifier-reserved";
|
|
79
80
|
readonly HASH_LIST_NOT_FOUND: "hash-list/not-found";
|
|
80
|
-
readonly HASH_LIST_ENTRY_NOT_FOUND: "hash-list/
|
|
81
|
+
readonly HASH_LIST_ENTRY_NOT_FOUND: "hash-list-entry/not-found";
|
|
81
82
|
readonly HASH_LIST_LIMIT_REACHED: "hash-list/limit-reached";
|
|
82
|
-
readonly HASH_LIST_ENTRY_LIMIT_REACHED: "hash-list/
|
|
83
|
+
readonly HASH_LIST_ENTRY_LIMIT_REACHED: "hash-list-entry/limit-reached";
|
|
83
84
|
readonly HASH_LIST_ASSET_NOT_HASHED: "hash-list/asset-not-hashed";
|
|
84
85
|
readonly POLICY_NOT_FOUND: "policy/not-found";
|
|
85
86
|
readonly POLICY_REVISION_CONFLICT: "policy/revision-conflict";
|
|
@@ -93,18 +94,16 @@ declare const API_ERROR_CODES: {
|
|
|
93
94
|
readonly UPLOAD_PRESET_NOT_FOUND: "upload-preset/not-found";
|
|
94
95
|
readonly UPLOAD_PRESET_DISABLED: "upload-preset/disabled";
|
|
95
96
|
readonly UPLOAD_PRESET_TOKEN_REQUIRED: "upload-preset/token-required";
|
|
96
|
-
readonly REMOTE_URL_NOT_ALLOWED: "
|
|
97
|
-
readonly
|
|
98
|
-
readonly UPLOAD_PRESET_CONTENT_TYPE_NOT_ALLOWED: "upload-preset/content-type-not-allowed";
|
|
99
|
-
readonly UPLOAD_PRESET_TOO_LARGE: "upload-preset/too-large";
|
|
97
|
+
readonly REMOTE_URL_NOT_ALLOWED: "remote-url/not-allowed";
|
|
98
|
+
readonly WEBSITE_RATE_LIMIT_REACHED: "upload/website-rate-limit-reached";
|
|
100
99
|
readonly UPLOAD_PRESET_DAILY_LIMIT_REACHED: "upload-preset/daily-limit-reached";
|
|
101
100
|
readonly UPLOAD_PRESET_ORIGIN_NOT_ALLOWED: "upload-preset/origin-not-allowed";
|
|
102
101
|
readonly UPLOAD_PRESET_FIELD_NOT_ALLOWED: "upload-preset/field-not-allowed";
|
|
103
102
|
readonly UPLOAD_TOKEN_INVALID: "upload-token/invalid";
|
|
104
103
|
readonly UPLOAD_TOKEN_EXPIRED: "upload-token/expired";
|
|
105
104
|
readonly UPLOAD_TOKEN_USED: "upload-token/used";
|
|
106
|
-
readonly INVALID_REMOTE_URL: "
|
|
107
|
-
readonly REMOTE_URL_UNAVAILABLE: "
|
|
105
|
+
readonly INVALID_REMOTE_URL: "remote-url/invalid";
|
|
106
|
+
readonly REMOTE_URL_UNAVAILABLE: "remote-url/unavailable";
|
|
108
107
|
readonly APPEAL_NOT_FOUND: "appeal/not-found";
|
|
109
108
|
readonly APPEAL_JUDGMENT_NOT_FOUND: "appeal/judgment-not-found";
|
|
110
109
|
readonly APPEAL_ASSET_NOT_FOUND: "appeal/asset-not-found";
|
|
@@ -112,7 +111,6 @@ declare const API_ERROR_CODES: {
|
|
|
112
111
|
readonly APPEAL_ALREADY_REVIEWED: "appeal/already-reviewed";
|
|
113
112
|
readonly APPEAL_DECISION_CHANGED: "appeal/decision-changed";
|
|
114
113
|
readonly APPEAL_INVALID_ACTION: "appeal/invalid-action";
|
|
115
|
-
readonly APPEAL_SAFETY_HELD: "appeal/safety-held";
|
|
116
114
|
readonly APPEAL_CONTENT_UNAVAILABLE: "appeal/content-unavailable";
|
|
117
115
|
};
|
|
118
116
|
type ApiErrorCode = (typeof API_ERROR_CODES)[keyof typeof API_ERROR_CODES];
|
|
@@ -145,63 +143,63 @@ declare const SDK_ERROR_CODES: {
|
|
|
145
143
|
type SdkErrorCode = (typeof SDK_ERROR_CODES)[keyof typeof SDK_ERROR_CODES];
|
|
146
144
|
/** Every error code the SDK can throw: the documented API codes and the SDK's own `sdk/*` codes. */
|
|
147
145
|
declare const CALMLENS_ERROR_CODES: {
|
|
148
|
-
readonly INVALID_VIEWER_CLAIMS: "viewer/invalid
|
|
146
|
+
readonly INVALID_VIEWER_CLAIMS: "viewer-claims/invalid";
|
|
149
147
|
readonly AGE_CONFIRMATION_REQUIRED: "viewer/age-confirmation-required";
|
|
150
|
-
readonly INVALID_VIEWER_REGION: "viewer/invalid
|
|
148
|
+
readonly INVALID_VIEWER_REGION: "viewer-region/invalid";
|
|
151
149
|
readonly VIEWER_REGION_REQUIRED: "viewer/region-required";
|
|
152
150
|
readonly REGIONAL_EVIDENCE_REQUIRED: "asset/regional-evidence-required";
|
|
153
151
|
readonly SIGNED_URL_EXPIRED: "signed-url/expired";
|
|
154
152
|
readonly SIGNED_URL_INVALID: "signed-url/invalid";
|
|
153
|
+
readonly SIGNED_URL_ORIGINAL_NOT_GRANTED: "signed-url/original-not-granted";
|
|
154
|
+
readonly INVALID_REQUEST: "validation/invalid-request";
|
|
155
155
|
readonly INVALID_TYPE: "validation/invalid-type";
|
|
156
156
|
readonly TOO_SMALL: "validation/too-small";
|
|
157
157
|
readonly TOO_BIG: "validation/too-big";
|
|
158
158
|
readonly INVALID_FORMAT: "validation/invalid-format";
|
|
159
159
|
readonly INVALID_VALUE: "validation/invalid-value";
|
|
160
160
|
readonly UNKNOWN_FIELD: "validation/unknown-field";
|
|
161
|
-
readonly UNSUPPORTED_CONTENT_TYPE: "
|
|
162
|
-
readonly INVALID_FILTER: "
|
|
163
|
-
readonly
|
|
164
|
-
readonly ROUTE_NOT_FOUND: "
|
|
165
|
-
readonly INTERNAL_ERROR: "
|
|
161
|
+
readonly UNSUPPORTED_CONTENT_TYPE: "request/unsupported-content-type";
|
|
162
|
+
readonly INVALID_FILTER: "filter/invalid";
|
|
163
|
+
readonly UNSUPPORTED_ORDERING_FIELD: "ordering/unsupported-field";
|
|
164
|
+
readonly ROUTE_NOT_FOUND: "request/route-not-found";
|
|
165
|
+
readonly INTERNAL_ERROR: "server/internal-error";
|
|
166
166
|
readonly UNAUTHENTICATED: "auth/unauthenticated";
|
|
167
|
-
readonly TOKEN_EXPIRED: "
|
|
168
|
-
readonly INVALID_TOKEN: "
|
|
167
|
+
readonly TOKEN_EXPIRED: "session-token/expired";
|
|
168
|
+
readonly INVALID_TOKEN: "session-token/invalid";
|
|
169
169
|
readonly SEARCH_UNAVAILABLE: "search/unavailable";
|
|
170
|
-
readonly INVALID_TRANSFORM: "
|
|
171
|
-
readonly INVALID_TRANSFORM_OPTIONS: "
|
|
172
|
-
readonly
|
|
173
|
-
readonly
|
|
174
|
-
readonly
|
|
175
|
-
readonly
|
|
176
|
-
readonly
|
|
177
|
-
readonly
|
|
178
|
-
readonly API_KEY_PROJECT_MISMATCH: "auth/project-mismatch";
|
|
179
|
-
readonly API_KEY_NOT_ACCEPTED: "auth/api-key-not-accepted";
|
|
170
|
+
readonly INVALID_TRANSFORM: "transform/invalid";
|
|
171
|
+
readonly INVALID_TRANSFORM_OPTIONS: "transform-options/invalid";
|
|
172
|
+
readonly REMOTE_URL_TOO_MANY_REDIRECTS: "remote-url/too-many-redirects";
|
|
173
|
+
readonly INVALID_CURSOR: "cursor/invalid";
|
|
174
|
+
readonly MISSING_API_KEY: "api-key/missing";
|
|
175
|
+
readonly INVALID_API_KEY: "api-key/invalid";
|
|
176
|
+
readonly API_KEY_PROJECT_MISMATCH: "api-key/project-mismatch";
|
|
177
|
+
readonly API_KEY_NOT_ACCEPTED: "api-key/not-accepted";
|
|
180
178
|
readonly PERMISSION_DENIED: "auth/permission-denied";
|
|
181
|
-
readonly
|
|
182
|
-
readonly
|
|
183
|
-
readonly
|
|
184
|
-
readonly
|
|
185
|
-
readonly
|
|
186
|
-
readonly
|
|
187
|
-
readonly
|
|
188
|
-
readonly
|
|
189
|
-
readonly INVALID_UPLOAD_MIME_TYPE: "upload/invalid-mime-type";
|
|
190
|
-
readonly INVALID_UPLOAD_PAYLOAD: "upload/invalid-payload";
|
|
179
|
+
readonly UPLOAD_TOO_LARGE: "upload/too-large";
|
|
180
|
+
readonly DOCUMENT_TOO_MANY_ITEMS: "document/too-many-items";
|
|
181
|
+
readonly INVALID_IMAGE: "image/invalid";
|
|
182
|
+
readonly IMAGE_TOO_LARGE: "image/too-large";
|
|
183
|
+
readonly FREE_UPLOADS_EXHAUSTED: "usage/free-uploads-exhausted";
|
|
184
|
+
readonly UPLOADS_PAUSED: "usage/uploads-paused";
|
|
185
|
+
readonly UNSUPPORTED_UPLOAD_TYPE: "upload/unsupported-type";
|
|
186
|
+
readonly INVALID_UPLOAD_PAYLOAD: "upload-payload/invalid";
|
|
191
187
|
readonly USE_UPLOAD_PART: "upload/use-upload-part";
|
|
192
188
|
readonly UPLOAD_NOT_OPEN: "upload/not-open";
|
|
193
|
-
readonly INVALID_UPLOAD_PART_NUMBER: "upload/invalid-
|
|
189
|
+
readonly INVALID_UPLOAD_PART_NUMBER: "upload-part/invalid-number";
|
|
194
190
|
readonly UPLOAD_MISSING: "upload/missing";
|
|
195
191
|
readonly UPLOAD_SIZE_MISMATCH: "upload/size-mismatch";
|
|
196
192
|
readonly INVALID_IDEMPOTENCY_KEY: "idempotency/invalid-key";
|
|
197
193
|
readonly IDEMPOTENCY_KEY_REUSED: "idempotency/key-reused";
|
|
198
194
|
readonly IDEMPOTENT_REQUEST_IN_PROGRESS: "idempotency/request-in-progress";
|
|
195
|
+
readonly NO_RENDERED_VERSION: "asset/no-rendered-version";
|
|
199
196
|
readonly ASSET_NOT_FOUND: "asset/not-found";
|
|
200
197
|
readonly PROJECT_NOT_FOUND: "project/not-found";
|
|
198
|
+
readonly ASSET_CHILD_NOT_DELETABLE: "asset/child-not-deletable";
|
|
201
199
|
readonly ASSET_REVIEW_CHANGED: "asset/review-changed";
|
|
202
200
|
readonly ASSET_REVIEW_NOTE_REQUIRED: "asset/review-note-required";
|
|
203
201
|
readonly ASSET_UPDATE_FAILED: "asset/update-failed";
|
|
204
|
-
readonly
|
|
202
|
+
readonly ASSET_HELD: "asset/held";
|
|
205
203
|
readonly ASSET_PROCESSING: "asset/processing";
|
|
206
204
|
readonly ASSET_DECISION_NOT_ALLOWED: "asset/decision-not-allowed";
|
|
207
205
|
readonly ASSET_DECISION_UNCHANGED: "asset/decision-unchanged";
|
|
@@ -211,18 +209,19 @@ declare const CALMLENS_ERROR_CODES: {
|
|
|
211
209
|
readonly ASSET_NOT_DECIDED: "asset/not-decided";
|
|
212
210
|
readonly ASSET_POLICY_CHANGED: "asset/policy-changed";
|
|
213
211
|
readonly ASSET_REVIEWED: "asset/reviewed";
|
|
214
|
-
readonly SUPPORT_TICKET_NOT_FOUND: "support/
|
|
212
|
+
readonly SUPPORT_TICKET_NOT_FOUND: "support-ticket/not-found";
|
|
215
213
|
readonly DUPLICATE_EXTERNAL_ID: "asset/duplicate-external-id";
|
|
216
214
|
readonly FOLDER_NOT_FOUND: "folder/not-found";
|
|
217
215
|
readonly DUPLICATE_FOLDER_NAME: "folder/duplicate-name";
|
|
218
216
|
readonly FOLDER_NOT_EMPTY: "folder/not-empty";
|
|
219
217
|
readonly FOLDER_PARENT_CYCLE: "folder/parent-cycle";
|
|
220
|
-
readonly
|
|
218
|
+
readonly LENS_NOT_FOUND: "lens/not-found";
|
|
219
|
+
readonly LENS_IDENTIFIER_TAKEN: "lens/identifier-taken";
|
|
221
220
|
readonly LENS_IDENTIFIER_RESERVED: "lens/identifier-reserved";
|
|
222
221
|
readonly HASH_LIST_NOT_FOUND: "hash-list/not-found";
|
|
223
|
-
readonly HASH_LIST_ENTRY_NOT_FOUND: "hash-list/
|
|
222
|
+
readonly HASH_LIST_ENTRY_NOT_FOUND: "hash-list-entry/not-found";
|
|
224
223
|
readonly HASH_LIST_LIMIT_REACHED: "hash-list/limit-reached";
|
|
225
|
-
readonly HASH_LIST_ENTRY_LIMIT_REACHED: "hash-list/
|
|
224
|
+
readonly HASH_LIST_ENTRY_LIMIT_REACHED: "hash-list-entry/limit-reached";
|
|
226
225
|
readonly HASH_LIST_ASSET_NOT_HASHED: "hash-list/asset-not-hashed";
|
|
227
226
|
readonly POLICY_NOT_FOUND: "policy/not-found";
|
|
228
227
|
readonly POLICY_REVISION_CONFLICT: "policy/revision-conflict";
|
|
@@ -236,18 +235,16 @@ declare const CALMLENS_ERROR_CODES: {
|
|
|
236
235
|
readonly UPLOAD_PRESET_NOT_FOUND: "upload-preset/not-found";
|
|
237
236
|
readonly UPLOAD_PRESET_DISABLED: "upload-preset/disabled";
|
|
238
237
|
readonly UPLOAD_PRESET_TOKEN_REQUIRED: "upload-preset/token-required";
|
|
239
|
-
readonly REMOTE_URL_NOT_ALLOWED: "
|
|
240
|
-
readonly
|
|
241
|
-
readonly UPLOAD_PRESET_CONTENT_TYPE_NOT_ALLOWED: "upload-preset/content-type-not-allowed";
|
|
242
|
-
readonly UPLOAD_PRESET_TOO_LARGE: "upload-preset/too-large";
|
|
238
|
+
readonly REMOTE_URL_NOT_ALLOWED: "remote-url/not-allowed";
|
|
239
|
+
readonly WEBSITE_RATE_LIMIT_REACHED: "upload/website-rate-limit-reached";
|
|
243
240
|
readonly UPLOAD_PRESET_DAILY_LIMIT_REACHED: "upload-preset/daily-limit-reached";
|
|
244
241
|
readonly UPLOAD_PRESET_ORIGIN_NOT_ALLOWED: "upload-preset/origin-not-allowed";
|
|
245
242
|
readonly UPLOAD_PRESET_FIELD_NOT_ALLOWED: "upload-preset/field-not-allowed";
|
|
246
243
|
readonly UPLOAD_TOKEN_INVALID: "upload-token/invalid";
|
|
247
244
|
readonly UPLOAD_TOKEN_EXPIRED: "upload-token/expired";
|
|
248
245
|
readonly UPLOAD_TOKEN_USED: "upload-token/used";
|
|
249
|
-
readonly INVALID_REMOTE_URL: "
|
|
250
|
-
readonly REMOTE_URL_UNAVAILABLE: "
|
|
246
|
+
readonly INVALID_REMOTE_URL: "remote-url/invalid";
|
|
247
|
+
readonly REMOTE_URL_UNAVAILABLE: "remote-url/unavailable";
|
|
251
248
|
readonly APPEAL_NOT_FOUND: "appeal/not-found";
|
|
252
249
|
readonly APPEAL_JUDGMENT_NOT_FOUND: "appeal/judgment-not-found";
|
|
253
250
|
readonly APPEAL_ASSET_NOT_FOUND: "appeal/asset-not-found";
|
|
@@ -255,7 +252,6 @@ declare const CALMLENS_ERROR_CODES: {
|
|
|
255
252
|
readonly APPEAL_ALREADY_REVIEWED: "appeal/already-reviewed";
|
|
256
253
|
readonly APPEAL_DECISION_CHANGED: "appeal/decision-changed";
|
|
257
254
|
readonly APPEAL_INVALID_ACTION: "appeal/invalid-action";
|
|
258
|
-
readonly APPEAL_SAFETY_HELD: "appeal/safety-held";
|
|
259
255
|
readonly APPEAL_CONTENT_UNAVAILABLE: "appeal/content-unavailable";
|
|
260
256
|
/** The request could not be completed: DNS, TLS, a refused or reset connection, a truncated body. */
|
|
261
257
|
readonly TRANSPORT_ERROR: "sdk/transport-error";
|
|
@@ -329,7 +325,7 @@ declare class CalmLensError extends Error {
|
|
|
329
325
|
isNotFound(): boolean;
|
|
330
326
|
/**
|
|
331
327
|
* Whether repeating the same request may succeed: transport failures, timeouts (a request's
|
|
332
|
-
* `timeoutMs` or `waitForDecision`'s deadline), throttling (429), gateway errors (502, 503, 504)
|
|
328
|
+
* `timeoutMs` or `waitForDecision`'s deadline), throttling (429), internal and gateway errors (500, 502, 503, 504)
|
|
333
329
|
* and idempotent requests still in progress. Only repeat a create or upload with the same
|
|
334
330
|
* `idempotencyKey`.
|
|
335
331
|
*/
|
|
@@ -346,7 +342,12 @@ declare const RECEIVED_WEBHOOK_EVENT_PAYLOAD_SCHEMA: zod.ZodObject<{
|
|
|
346
342
|
severity: zod.ZodOptional<zod.ZodString>;
|
|
347
343
|
title: zod.ZodOptional<zod.ZodString>;
|
|
348
344
|
description: zod.ZodOptional<zod.ZodNullable<zod.ZodString>>;
|
|
345
|
+
actor: zod.ZodOptional<zod.ZodObject<{
|
|
346
|
+
type: zod.ZodString;
|
|
347
|
+
id: zod.ZodNullable<zod.ZodString>;
|
|
348
|
+
}, zod.core.$loose>>;
|
|
349
349
|
assetId: zod.ZodOptional<zod.ZodNullable<zod.ZodString>>;
|
|
350
|
+
assetSequence: zod.ZodOptional<zod.ZodNullable<zod.ZodNumber>>;
|
|
350
351
|
asset: zod.ZodOptional<zod.ZodNullable<zod.ZodObject<{
|
|
351
352
|
id: zod.ZodString;
|
|
352
353
|
}, zod.core.$loose>>>;
|
|
@@ -370,7 +371,13 @@ interface ReceivedWebhookEventPayload {
|
|
|
370
371
|
severity?: string;
|
|
371
372
|
title?: string;
|
|
372
373
|
description?: string | null;
|
|
374
|
+
/** Who caused the event; `type` may take values added later. */
|
|
375
|
+
actor?: {
|
|
376
|
+
type: Actor["type"] | (string & {});
|
|
377
|
+
id: string | null;
|
|
378
|
+
};
|
|
373
379
|
assetId?: string | null;
|
|
380
|
+
assetSequence?: number | null;
|
|
374
381
|
asset?: (EventAsset & Record<string, unknown>) | null;
|
|
375
382
|
facts?: ReceivedFact;
|
|
376
383
|
[key: string]: unknown;
|
package/esm/app.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { a as selectModerationContextItems,
|
|
2
|
-
import { $ as
|
|
3
|
-
import { t as CalmLensAppClient } from "./CalmLensAppClient-
|
|
4
|
-
import {
|
|
5
|
-
import { a as
|
|
6
|
-
|
|
7
|
-
export { type AddHashListEntryOptions, type AgeRange, type ApiErrorCode, type ApplyPolicyPresetOptions, type Asset, type AssetBatchOperation, type AssetChecksums, type AssetChildrenPage, type AssetClassification, type AssetClassificationFailureReason, type AssetClassificationStatus, type AssetContent, type AssetContentOptions, type AssetContentRemovalReason, type AssetContentStatus, type AssetImage, type AssetModeration, type AssetModerationDecision, type AssetModerationStatus, type AssetPage, type AssetSafetyHold, type AssetSafetyHoldReason, type AssetSearchMatchField, type AssetSearchQuery, type AssetSearchResponse, type AssetSearchResult, type AssetType, type AssetUpload, type AssetUploadStatus, type AssetVisibility, type AssignPolicyOptions, type BatchAssetsOptions, type BatchAssetsResponse, type BoundingBox, CALMLENS_ERROR_CODES, CalmLensAppClient, type CalmLensAppClientOptions, CalmLensError, type CalmLensErrorCode, type CalmLensErrorDetails, type CalmLensErrorOptions, type CalmLensServerClientOptions, type CdnAssetUrlOptions, type CdnResource, type CdnServeOptions, type CdnTransform, type ClassificationCategories, type ClassificationCategory, type ClassificationCategoryReport, type ClassificationLabel, type ClassificationNotEvaluatedReason, type ClassificationQualifierResults, type ClassifyTextOptions, type ConnectionOptions, type CreateAssetSignedUrlOptions, type CreateFolderOptions, type CreateHashListOptions, type CreateMultipartUploadPartOptions, type CreatePolicyOptions, type CursorPage, DEFAULT_CDN_BASE_URL, type DecideAssetOptions, type DeleteAssetContentOptions, type DeleteAssetOptions, type DetectedFace, type DetectedPerson, type EnsureLensOptions, type EnsureLensesOptions, type EventAsset, type EventCategory, type EventFact, type EventFactValues, type EventFacts, type EventSeverity, type EventType, type GetEventsResponse as EventsPage, type ExplainAssetOptions, type ExtractedText, type FileMetadata, type Folder, type FolderIdOptions, type GetAssetUrlOptions, type HashList, type HashListEntry, type HashListEntryIdOptions, type HashListEntryPage, type HashListIdOptions, type HashListPage, type IdempotencyOptions, type ImageTransformOptions, type IterateAssetChildrenOptions, type IterateAssetsOptions, type Lens, type LensType, type Likelihood, type ListAssetChildrenOptions, type ListAssetsOptions, type ListEventsOptions, type ListHashListEntriesOptions, type ListHashListsOptions, MODERATION_CONTEXT_USED_CHARACTERS, MODERATION_CONTEXT_USED_ITEMS, type MetadataItem, type ModerationContext, type ModerationContextItem, type ModerationQualifier, type MoveAssetOptions, type MoveFolderOptions, type MultipartUploadOptions, type MultipartUploadPartOptions, type Order, type Policy, type PolicyAction, type PolicyIdOptions, type PolicyList, type ProcessingFeatureId, type ProcessingFeatureResults, type ProcessingFeatureStage, type ProcessingFeatures, type ProcessingOptions, type RequestOptions, type RetrieveAssetOptions, type RetryAssetOptions, SDK_VERSION, type SdkErrorCode, type SearchAssetsOptions, type SetPolicyAutomaticUpdatesOptions, type SignUploadTokenOptions, type SignedUploadToken, type SignedUrl, type SubmitAssetOptions, type TypedEvent, type UpdateAssetOptions, type UpdateFolderOptions, type UpdateHashListOptions, type UpdatePolicyOptions, type UploadAssetPartOptions, type UploadPresetSubmitAssetOptions, type UploadedAsset, type VerifyWebhookSignatureOptions, type ViewerClaims, type WaitForAssetDecisionOptions, type ReceivedWebhookEventPayload as WebhookEventPayload, type WebhookHeadersInput, type WebhookPayloadInput, getAssetUrl, selectModerationContextItems };
|
|
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-Q5zGpR8l-CEWjnE39.js";
|
|
2
|
+
import { $ as HashListPage, $t as WebhookHeadersInput, A as CdnAssetReference, An as AssetHls, At as ResetPolicyOptions, B as CreateMultipartUploadPartOptions, Bn as ProcessingOptions, Bt as SubmitAssetOptions, C as AssetVisibility, Cn as Policy, Ct as MoveFolderOptions, D as CalmLensAppClientOptions, Dn as AssetSearchQuery, Dt as PolicyPage, E as BatchAssetsResponse, En as AssetSearchMatchField, Et as PolicyIdOptions, F as ClassifyTextOptions, Fn as AssetSafetyHold, Ft as SignAssetUrlOptions, G as EnsureLensesOptions, Gt as UpdatePolicyOptions, H as DecideAssetOptions, Ht as UpdateFolderOptions, I as ConnectionOptions, In as AssetSafetyHoldReason, It as SignUploadTokenOptions, J as FolderPage, Jt as UploadPresetSubmitAssetOptions, K as ExplainAssetOptions, Kt as UpgradePolicyOptions, L as CreateFolderOptions, Ln as ExtractedText, Lt as SignedAssetUrl, M as CdnResource, Mn as AssetPreview, Mt as RetryAssetOptions, N as CdnServeOptions, Nn as AssetRendered, Nt as SearchAssetsOptions, O as CalmLensServerClientOptions, Ot as RemoveAssetContentOptions, P as CdnTransform, Pn as AssetRenderedKind, Pt as SetPolicyAutomaticUpdatesOptions, Q as HashListIdOptions, Qt as WaitForAssetDecisionOptions, R as CreateHashListOptions, Rn as FileMetadata, Rt as SignedUploadToken, S as AssetUploadStatus, Sn as ProcessingFeatures, St as MoveAssetOptions, T as BatchAssetsOptions, Tn as LensType, Tt as MultipartUploadPartOptions, U as DeleteAssetOptions, Ut as UpdateHashListOptions, V as CreatePolicyOptions, Vt as UpdateAssetOptions, W as EnsureLensOptions, Wt as UpdateLensOptions, X as HashListEntryIdOptions, Xt as VerifyWebhookSignatureOptions, Y as GetAssetInfoOptions, Yt as UploadedAsset, Z as HashListEntryPage, Zt as ViewerClaims, _ as AssetSearchResponse, _n as DetectedFace, _t as ListFoldersOptions, a as AssetChildrenPage, an as EventAsset, at as IterateFoldersOptions, b as AssetType, bn as ProcessingFeatureResults, bt as ListLensesOptions, c as AssetClassificationStatus, cn as EventFact, ct as IterateLensesOptions, d as AssetContentRemovalReason, dn as EventSeverity, dt as LensIdOptions, en as WebhookPayloadInput, et as IdempotencyOptions, f as AssetContentStatus, fn as EventType, ft as LensPage, g as AssetPage, gn as BoundingBox, gt as ListEventsOptions, h as AssetModerationStatus, hn as AgeRange, ht as ListAssetsOptions, i as AssetChecksums, it as IterateAssetsOptions, j as CdnAssetUrlOptions, jn as AssetHlsRendition, jt as RetrieveAssetOptions, k as CdnAssetLocation, kn as AssetInfo, kt as RequestOptions, l as AssetContent, ln as EventFactValues, lt as IteratePoliciesOptions, m as AssetModerationDecision, mn as Folder, mt as ListAssetTimelineOptions, n as Asset, nn as AssetTimelineSegment, nt as IterateAssetChildrenOptions, o as AssetClassification, on as TypedEvent, ot as IterateHashListEntriesOptions, p as AssetModeration, pt as ListAssetChildrenOptions, q as FolderIdOptions, qt as UploadAssetPartOptions, r as AssetAvailability, rn as GetEventsResponse, rt as IterateAssetTimelineOptions, s as AssetClassificationFailureReason, sn as EventCategory, st as IterateHashListsOptions, t as AddHashListEntryOptions, tn as AssetBatchOperation, tt as ImageTransformOptions, u as AssetContentOptions, un as EventFacts, ut as Lens, v as AssetSearchResult, vn as DetectedPerson, vt as ListHashListEntriesOptions, w as AssignPolicyOptions, wn as CursorPage, wt as MultipartUploadOptions, x as AssetUpload, xn as ProcessingFeatureStage, xt as ListPoliciesOptions, y as AssetTimelinePage, yn as ProcessingFeatureId, yt as ListHashListsOptions, z as CreateLensOptions, zn as MetadataItem, zt as StreamingFeatureOptions } from "./CalmLensTypes-CUB0YYVz.js";
|
|
3
|
+
import { t as CalmLensAppClient } from "./CalmLensAppClient-gG16T2py.js";
|
|
4
|
+
import { i as getAssetInfo, n as DEFAULT_CDN_BASE_URL, r as CDN_RESOURCES, t as SDK_VERSION } from "./index-CKRgjV16.js";
|
|
5
|
+
import { a as CalmLensErrorCode, c as SdkErrorCode, i as CalmLensError, l as ApiErrorCode, o as CalmLensErrorDetails, r as CALMLENS_ERROR_CODES, s as CalmLensErrorOptions, t as ReceivedWebhookEventPayload } from "./WebhookPayload-BLT2y_Jy.js";
|
|
6
|
+
export { type AddHashListEntryOptions, type AgeRange, type ApiErrorCode, type Asset, type AssetAvailability, type AssetBatchOperation, type AssetChecksums, type AssetChildrenPage, type AssetClassification, type AssetClassificationFailureReason, type AssetClassificationStatus, type AssetContent, type AssetContentOptions, type AssetContentRemovalReason, type AssetContentStatus, type AssetHls, type AssetHlsRendition, type AssetInfo, type AssetModeration, type AssetModerationDecision, type AssetModerationStatus, type AssetPage, type AssetPreview, type AssetRendered, type AssetRenderedKind, type AssetSafetyHold, type AssetSafetyHoldReason, type AssetSearchMatchField, type AssetSearchQuery, type AssetSearchResponse, type AssetSearchResult, type AssetTimelinePage, type AssetTimelineSegment, type AssetType, type AssetUpload, type AssetUploadStatus, type AssetVisibility, type AssignPolicyOptions, type BatchAssetsOptions, type BatchAssetsResponse, type BoundingBox, CALMLENS_ERROR_CODES, CDN_RESOURCES, CalmLensAppClient, type CalmLensAppClientOptions, CalmLensError, type CalmLensErrorCode, type CalmLensErrorDetails, type CalmLensErrorOptions, type CalmLensServerClientOptions, type CdnAssetLocation, type CdnAssetReference, type CdnAssetUrlOptions, type CdnResource, type CdnServeOptions, type CdnTransform, type ClassificationCategories, type ClassificationCategory, type ClassificationCategoryReport, type ClassificationNotEvaluatedReason, type ClassificationQualifierResults, type ClassifyTextOptions, type ConnectionOptions, type CreateFolderOptions, type CreateHashListOptions, type CreateLensOptions, type CreateMultipartUploadPartOptions, type CreatePolicyOptions, type CursorPage, DEFAULT_CDN_BASE_URL, type DecideAssetOptions, type DeleteAssetOptions, type DetectedFace, type DetectedPerson, type EnsureLensOptions, type EnsureLensesOptions, type EventAsset, type EventCategory, type EventFact, type EventFactValues, type EventFacts, type EventSeverity, type EventType, type GetEventsResponse as EventsPage, type ExplainAssetOptions, type ExtractedText, type FileMetadata, type Folder, type FolderIdOptions, type FolderPage, type GetAssetInfoOptions, type HashList, type HashListEntry, type HashListEntryIdOptions, type HashListEntryPage, type HashListIdOptions, type HashListPage, type IdempotencyOptions, type ImageTransformOptions, type IterateAssetChildrenOptions, type IterateAssetTimelineOptions, type IterateAssetsOptions, type IterateFoldersOptions, type IterateHashListEntriesOptions, type IterateHashListsOptions, type IterateLensesOptions, type IteratePoliciesOptions, type Lens, type LensIdOptions, type LensPage, type LensType, type Likelihood, type ListAssetChildrenOptions, type ListAssetTimelineOptions, type ListAssetsOptions, type ListEventsOptions, type ListFoldersOptions, type ListHashListEntriesOptions, type ListHashListsOptions, type ListLensesOptions, type ListPoliciesOptions, MODERATION_CONTEXT_USED_CHARACTERS, MODERATION_CONTEXT_USED_ITEMS, type MetadataItem, type ModerationContext, type ModerationContextItem, type ModerationQualifier, type MoveAssetOptions, type MoveFolderOptions, type MultipartUploadOptions, type MultipartUploadPartOptions, type Policy, type PolicyAction, type PolicyIdOptions, type PolicyPage, type ProcessingFeatureId, type ProcessingFeatureResults, type ProcessingFeatureStage, type ProcessingFeatures, type ProcessingOptions, type RemoveAssetContentOptions, type RequestOptions, type ResetPolicyOptions, type RetrieveAssetOptions, type RetryAssetOptions, SDK_VERSION, type SdkErrorCode, type SearchAssetsOptions, type SetPolicyAutomaticUpdatesOptions, type SignAssetUrlOptions, type SignUploadTokenOptions, type SignedAssetUrl, type SignedUploadToken, type StreamingFeatureOptions, type SubmitAssetOptions, type TypedEvent, type UpdateAssetOptions, type UpdateFolderOptions, type UpdateHashListOptions, type UpdateLensOptions, type UpdatePolicyOptions, type UpgradePolicyOptions, type UploadAssetPartOptions, type UploadPresetSubmitAssetOptions, type UploadedAsset, type VerifyWebhookSignatureOptions, type ViewerClaims, type WaitForAssetDecisionOptions, type ReceivedWebhookEventPayload as WebhookEventPayload, type WebhookHeadersInput, type WebhookPayloadInput, getAssetInfo, selectModerationContextItems };
|
package/esm/app.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { L as CALMLENS_ERROR_CODES, P as SDK_VERSION, R as CalmLensError, i as CDN_RESOURCES, n as MODERATION_CONTEXT_USED_ITEMS, r as selectModerationContextItems, s as getAssetInfo, t as MODERATION_CONTEXT_USED_CHARACTERS, u as DEFAULT_CDN_BASE_URL } from "./ModerationContextLimits-B6_RalCQ.js";
|
|
2
2
|
import "./index.js";
|
|
3
|
-
import { t as CalmLensAppClient } from "./CalmLensAppClient-
|
|
4
|
-
export { CALMLENS_ERROR_CODES, CalmLensAppClient, CalmLensError, DEFAULT_CDN_BASE_URL, MODERATION_CONTEXT_USED_CHARACTERS, MODERATION_CONTEXT_USED_ITEMS, SDK_VERSION,
|
|
3
|
+
import { t as CalmLensAppClient } from "./CalmLensAppClient-CK4_Py0c.js";
|
|
4
|
+
export { CALMLENS_ERROR_CODES, CDN_RESOURCES, CalmLensAppClient, CalmLensError, DEFAULT_CDN_BASE_URL, MODERATION_CONTEXT_USED_CHARACTERS, MODERATION_CONTEXT_USED_ITEMS, SDK_VERSION, getAssetInfo, selectModerationContextItems };
|
package/esm/elements.d.ts
CHANGED
|
@@ -1,5 +1,72 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as
|
|
1
|
+
import { r as AssetAvailability } from "./CalmLensTypes-CUB0YYVz.js";
|
|
2
|
+
import { $ as getAssetViewKey, A as CustomUploadResult, B as AssetDisplay, C as formatMessage, D as resolveMessages, E as getUploadItemOutcome, G as AssetSession, H as AssetImageOptions, J as AssetVideoOptions, K as AssetSessionState, L as UploadStage, M as UploadController, P as UploadFile, Q as getAssetView, S as formatBytes, T as getUploadItemMessage, U as AssetImageSource, V as AssetDocumentOptions, W as AssetOptions, X as MediaPlayback, Y as AssetView, Z as getAssetAspectRatio, _ as DEFAULT_MESSAGES, _t as formatViewerMessage, a as ProgressFetchOptions, at as ImageViewerOptions, b as describeUploadItem, c as ICON_ATTRIBUTES, ct as TextViewerOptions, d as AssetDisplayOptions, dt as ViewerTextOptions, et as getPeakHeights, f as AssetEventHandlers, ft as WebsiteViewerOptions, g as CalmLensMessages, gt as ViewerMessages, ht as DEFAULT_VIEWER_MESSAGES, i as CALMLENS_STYLES, it as DocumentViewerOptions, j as UploadClient, k as CustomUploadContext, l as IconName, lt as ViewerAsset, m as UploaderDisplayOptions, mt as isSpreadsheetFormat, n as CalmLensTheme, nt as pickAssetSource, o as createProgressFetch, ot as PdfAssetOptions, p as AssetProps, pt as getAssetViewerKind, q as AssetSpreadsheetOptions, r as resolveTheme, rt as AssetViewerKind, s as ICONS, st as SpreadsheetViewerOptions, t as CALMLENS_THEME, tt as getPlayedPercent, u as ASSET_FILE_ICON_SIZE, ut as ViewerOptions, v as UploadItemView, vt as resolveViewerMessages, w as getDropzoneHint, x as describeUploader, y as UploaderView, z as isFileAccepted } from "./Core-C82YmjjX.js";
|
|
3
|
+
import { a as UploaderProps, i as UploadSnapshot, n as UploadControllerOptions, r as UploadItem, s as createUploadController, t as CalmLensUpload } from "./BrowserUpload-D-NnAN7g.js";
|
|
4
|
+
import { C as ViewerState, S as AssetViewer, _ as spreadsheetColumnIndex, a as isMountedViewerKind, b as createWebsiteViewer, c as AssetViewerOptionsByKind, d as createTextViewer, f as SpreadsheetCell, g as parseSpreadsheetText, h as getSpreadsheetPage, i as getMountedViewerOptions, l as VIEWER_STYLES, m as SpreadsheetSheet, n as AssetViewerMount, o as ASSET_VIEWERS, p as SpreadsheetRow, r as MountedViewerKind, s as AssetViewerName, t as MediaStreamPlayer, u as createSpreadsheetViewer, v as loadPdfJs, x as createDocumentViewer, y as createImageViewer } from "./ui-CTBUxnVp.js";
|
|
5
|
+
declare const BaseElement$1: typeof HTMLElement;
|
|
6
|
+
/**
|
|
7
|
+
* An asset viewer element. Set the `src` attribute to the asset URL (public or signed) and the
|
|
8
|
+
* `asset` property to its display info or the asset from the API, and `onExpired` to refresh a
|
|
9
|
+
* signed URL; other attributes: `label`, `viewer-claims` (JSON), `sizes` (images), `page-size`
|
|
10
|
+
* (spreadsheets) and `initial-page` (documents). The `text` and `getText` properties supply text
|
|
11
|
+
* and spreadsheet viewers' text, `messages` replaces their text and `pdf` sets where pdf.js loads
|
|
12
|
+
* its files from.
|
|
13
|
+
*/
|
|
14
|
+
declare abstract class ViewerElement<K extends AssetViewerName> extends BaseElement$1 {
|
|
15
|
+
#private;
|
|
16
|
+
static observedAttributes: string[];
|
|
17
|
+
protected abstract readonly kind: K;
|
|
18
|
+
/** The asset to show, from the API. */
|
|
19
|
+
get asset(): ViewerAsset | undefined;
|
|
20
|
+
set asset(value: ViewerAsset | undefined);
|
|
21
|
+
/** Returns a fresh asset URL from your server once a signed one expires. */
|
|
22
|
+
get onExpired(): (() => string | Promise<string>) | undefined;
|
|
23
|
+
set onExpired(value: (() => string | Promise<string>) | undefined);
|
|
24
|
+
/** Reads a text or spreadsheet viewer's text yourself. */
|
|
25
|
+
get getText(): (() => Promise<string>) | undefined;
|
|
26
|
+
set getText(value: (() => Promise<string>) | undefined);
|
|
27
|
+
/** Text your app already has, for a text or spreadsheet viewer. */
|
|
28
|
+
get text(): string | undefined;
|
|
29
|
+
set text(value: string | undefined);
|
|
30
|
+
get messages(): Partial<ViewerMessages> | undefined;
|
|
31
|
+
set messages(value: Partial<ViewerMessages> | undefined);
|
|
32
|
+
/** Where a document viewer's pdf.js loads its worker, fonts and decoders from. */
|
|
33
|
+
get pdf(): PdfAssetOptions | undefined;
|
|
34
|
+
set pdf(value: PdfAssetOptions | undefined);
|
|
35
|
+
connectedCallback(): void;
|
|
36
|
+
attributeChangedCallback(): void;
|
|
37
|
+
disconnectedCallback(): void;
|
|
38
|
+
}
|
|
39
|
+
/** `<calmlens-image-viewer>`: an image asset's rendered file, fitted to the element. */
|
|
40
|
+
export declare class CalmLensImageViewerElement extends ViewerElement<"image"> {
|
|
41
|
+
protected readonly kind = "image";
|
|
42
|
+
}
|
|
43
|
+
/** `<calmlens-website-viewer>`: a website's screenshot and a link to the page. */
|
|
44
|
+
export declare class CalmLensWebsiteViewerElement extends ViewerElement<"website"> {
|
|
45
|
+
protected readonly kind = "website";
|
|
46
|
+
}
|
|
47
|
+
/** `<calmlens-text-viewer>`: text, escaped, in a scrolling region. */
|
|
48
|
+
export declare class CalmLensTextViewerElement extends ViewerElement<"text"> {
|
|
49
|
+
protected readonly kind = "text";
|
|
50
|
+
}
|
|
51
|
+
/** `<calmlens-document-viewer>`: a PDF a page at a time, with pdf.js loaded lazily. */
|
|
52
|
+
export declare class CalmLensDocumentViewerElement extends ViewerElement<"document"> {
|
|
53
|
+
protected readonly kind = "document";
|
|
54
|
+
}
|
|
55
|
+
/** `<calmlens-spreadsheet-viewer>`: a spreadsheet's sheets as tabs and paged tables. */
|
|
56
|
+
export declare class CalmLensSpreadsheetViewerElement extends ViewerElement<"spreadsheet"> {
|
|
57
|
+
protected readonly kind = "spreadsheet";
|
|
58
|
+
}
|
|
59
|
+
/** Defines the asset viewer elements, if they aren't defined yet. */
|
|
60
|
+
export declare const defineCalmLensViewerElements: () => void;
|
|
61
|
+
declare global {
|
|
62
|
+
interface HTMLElementTagNameMap {
|
|
63
|
+
"calmlens-image-viewer": CalmLensImageViewerElement;
|
|
64
|
+
"calmlens-website-viewer": CalmLensWebsiteViewerElement;
|
|
65
|
+
"calmlens-text-viewer": CalmLensTextViewerElement;
|
|
66
|
+
"calmlens-document-viewer": CalmLensDocumentViewerElement;
|
|
67
|
+
"calmlens-spreadsheet-viewer": CalmLensSpreadsheetViewerElement;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
3
70
|
/** The `detail` of each event the elements dispatch. */
|
|
4
71
|
export interface CalmLensElementEvents {
|
|
5
72
|
"calmlens-uploaded": CalmLensUpload;
|
|
@@ -7,7 +74,13 @@ export interface CalmLensElementEvents {
|
|
|
7
74
|
"calmlens-failed": UploadItem;
|
|
8
75
|
"calmlens-removed": UploadItem;
|
|
9
76
|
"calmlens-change": UploadSnapshot;
|
|
10
|
-
"calmlens-
|
|
77
|
+
"calmlens-load": undefined;
|
|
78
|
+
"calmlens-error": undefined;
|
|
79
|
+
"calmlens-availability-change": AssetAvailability;
|
|
80
|
+
"calmlens-age-confirm-request": undefined;
|
|
81
|
+
"calmlens-play": undefined;
|
|
82
|
+
"calmlens-ended": undefined;
|
|
83
|
+
"calmlens-timeupdate": number;
|
|
11
84
|
}
|
|
12
85
|
declare const BaseElement: typeof HTMLElement;
|
|
13
86
|
/**
|
|
@@ -46,35 +119,57 @@ export declare class CalmLensUploaderElement extends BaseElement {
|
|
|
46
119
|
attributeChangedCallback(): void;
|
|
47
120
|
}
|
|
48
121
|
/**
|
|
49
|
-
* `<calmlens-
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
* `transform`, `widths` (comma-separated), `
|
|
54
|
-
* `
|
|
55
|
-
* `
|
|
56
|
-
* `
|
|
122
|
+
* `<calmlens-asset src="…" alt="…">` shows any asset from its asset URL (public, or signed by your
|
|
123
|
+
* server), natively in the page, the same way `CalmLensAsset` does in React, Vue and Svelte. It
|
|
124
|
+
* reads `{src}/info` once connected, unless the `info` property is set. Attributes: `src`,
|
|
125
|
+
* `display` (`full` or `preview`), `viewer-claims` (JSON), `alt`, `fit`, `aspect-ratio`, `eager`,
|
|
126
|
+
* `fetch-priority`, `lens`, `transform`, `widths` (comma-separated), `sizes`, `no-controls`,
|
|
127
|
+
* `autoplay`, `muted`, `loop`, `no-stream`, `initial-page` and `page-size`. Properties: `info`,
|
|
128
|
+
* `onExpired` (returns a fresh signed asset URL), `messages`, `pdf`, `getText` (a spreadsheet's
|
|
129
|
+
* sheets), and `renderUnavailable` / `renderAgeGate` (return your own notice's node). Events:
|
|
130
|
+
* `calmlens-load`, `calmlens-error`, `calmlens-availability-change` (detail: the availability),
|
|
131
|
+
* `calmlens-age-confirm-request`, `calmlens-play`, `calmlens-ended` and `calmlens-timeupdate`
|
|
132
|
+
* (detail: the position in seconds).
|
|
57
133
|
*/
|
|
58
|
-
export declare class
|
|
134
|
+
export declare class CalmLensAssetElement extends BaseElement {
|
|
59
135
|
#private;
|
|
60
136
|
static observedAttributes: string[];
|
|
61
137
|
get messages(): Partial<CalmLensMessages> | undefined;
|
|
62
138
|
set messages(value: Partial<CalmLensMessages> | undefined);
|
|
63
|
-
/**
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
get
|
|
68
|
-
set
|
|
139
|
+
/** The asset's display info, prefetched with `getAssetInfo`, so nothing waits for `/info`. */
|
|
140
|
+
get info(): ViewerAsset | undefined;
|
|
141
|
+
set info(value: ViewerAsset | undefined);
|
|
142
|
+
/** Returns a fresh asset URL from your server once a signed one expires. */
|
|
143
|
+
get onExpired(): (() => string | Promise<string>) | undefined;
|
|
144
|
+
set onExpired(value: (() => string | Promise<string>) | undefined);
|
|
145
|
+
/** Where a document's pdf.js loads its worker, fonts and decoders from. */
|
|
146
|
+
get pdf(): PdfAssetOptions | undefined;
|
|
147
|
+
set pdf(value: PdfAssetOptions | undefined);
|
|
148
|
+
/** Reads a spreadsheet's sheets yourself, such as from its text child asset. */
|
|
149
|
+
get getText(): (() => Promise<string>) | undefined;
|
|
150
|
+
set getText(value: (() => Promise<string>) | undefined);
|
|
151
|
+
/** Returns your own unavailable notice. */
|
|
152
|
+
get renderUnavailable(): (() => Node) | undefined;
|
|
153
|
+
set renderUnavailable(value: (() => Node) | undefined);
|
|
154
|
+
/** Returns your own age notice; call `confirm` from its reveal button. */
|
|
155
|
+
get renderAgeGate(): ((props: {
|
|
156
|
+
placeholderUrl?: string;
|
|
157
|
+
confirm: () => void;
|
|
158
|
+
}) => Node) | undefined;
|
|
159
|
+
set renderAgeGate(value: ((props: {
|
|
160
|
+
placeholderUrl?: string;
|
|
161
|
+
confirm: () => void;
|
|
162
|
+
}) => Node) | undefined);
|
|
69
163
|
connectedCallback(): void;
|
|
70
164
|
attributeChangedCallback(): void;
|
|
165
|
+
disconnectedCallback(): void;
|
|
71
166
|
}
|
|
72
|
-
/** Defines `<calmlens-uploader>` and `<calmlens-
|
|
167
|
+
/** Defines `<calmlens-uploader>` and `<calmlens-asset>`, if they aren't defined yet. */
|
|
73
168
|
export declare const defineCalmLensElements: () => void;
|
|
74
169
|
declare global {
|
|
75
170
|
interface HTMLElementTagNameMap {
|
|
76
171
|
"calmlens-uploader": CalmLensUploaderElement;
|
|
77
|
-
"calmlens-
|
|
172
|
+
"calmlens-asset": CalmLensAssetElement;
|
|
78
173
|
}
|
|
79
174
|
interface HTMLElementEventMap {
|
|
80
175
|
"calmlens-uploaded": CustomEvent<CalmLensUpload>;
|
|
@@ -82,7 +177,13 @@ declare global {
|
|
|
82
177
|
"calmlens-failed": CustomEvent<UploadItem>;
|
|
83
178
|
"calmlens-removed": CustomEvent<UploadItem>;
|
|
84
179
|
"calmlens-change": CustomEvent<UploadSnapshot>;
|
|
85
|
-
"calmlens-
|
|
180
|
+
"calmlens-load": CustomEvent<undefined>;
|
|
181
|
+
"calmlens-error": CustomEvent<undefined>;
|
|
182
|
+
"calmlens-availability-change": CustomEvent<AssetAvailability>;
|
|
183
|
+
"calmlens-age-confirm-request": CustomEvent<undefined>;
|
|
184
|
+
"calmlens-play": CustomEvent<undefined>;
|
|
185
|
+
"calmlens-ended": CustomEvent<undefined>;
|
|
186
|
+
"calmlens-timeupdate": CustomEvent<number>;
|
|
86
187
|
}
|
|
87
188
|
}
|
|
88
|
-
export { CALMLENS_STYLES, CALMLENS_THEME, type CalmLensMessages, type CalmLensTheme, type CalmLensUpload, type CustomUploadContext, type CustomUploadResult, DEFAULT_MESSAGES, ICONS, ICON_ATTRIBUTES, type IconName, type
|
|
189
|
+
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 CalmLensTheme, type CalmLensUpload, type CustomUploadContext, type CustomUploadResult, DEFAULT_MESSAGES, DEFAULT_VIEWER_MESSAGES, type DocumentViewerOptions, ICONS, ICON_ATTRIBUTES, type IconName, type ImageViewerOptions, 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, type WebsiteViewerOptions, createDocumentViewer, createImageViewer, createProgressFetch, createSpreadsheetViewer, createTextViewer, createUploadController, createWebsiteViewer, describeUploadItem, describeUploader, formatBytes, formatMessage, formatViewerMessage, getAssetAspectRatio, getAssetView, getAssetViewKey, getAssetViewerKind, getDropzoneHint, getMountedViewerOptions, getPeakHeights, getPlayedPercent, getSpreadsheetPage, getUploadItemMessage, getUploadItemOutcome, isFileAccepted, isMountedViewerKind, isSpreadsheetFormat, loadPdfJs, parseSpreadsheetText, pickAssetSource, resolveMessages, resolveTheme, resolveViewerMessages, spreadsheetColumnIndex };
|