@calmlens/sdk 0.10.1 → 0.12.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/esm/index.d.ts CHANGED
@@ -1,382 +1,3 @@
1
- import { $ as EventCategory, A as ModerateTextOptions, B as UpdateFolderOptions, C as IterateAssetChildrenOptions, D as ListAssetChildrenOptions, E as LensTransform, F as RequestOptions, G as AssetSearchQuery, H as VerifyWebhookSignatureOptions, I as RetrieveAssetOptions, J as PostAssetSignedUrlResponse, K as WebhookEventPayload, L as RetryAssetOptions, M as MoveFolderOptions, N as MultipartUploadOptions, O as ListAssetsOptions, P as MultipartUploadPartOptions, Q as TypedEvent, R as SubmitAssetOptions, S as ImageTransformOptions, T as Lens, U as WebhookHeadersInput, V as UploadAssetPartOptions, W as WebhookPayloadInput, X as Folder, _ as DeleteAssetOptions, a as AssetSearchResponse, b as FolderIdOptions, c as AssetType, ct as MetadataItem, d as CdnAssetUrlOptions, et as EventFact, f as CdnServeOptions, g as DeleteAssetContentOptions, h as CreateMultipartUploadPartOptions, i as AssetPage, it as EventType, j as MoveAssetOptions, k as ListEventsOptions, l as AssetVisibility, lt as ProcessingOptions, m as CreateFolderOptions, n as AssetChildrenPage, nt as EventFacts, o as AssetSearchResult, ot as ClassificationCategoryReport, p as CreateAssetSignedUrlOptions, q as GetEventsResponse, r as AssetContentOptions, rt as EventSeverity, s as AssetStatus, st as ClassificationReport, t as Asset, tt as EventFactValues, u as CalmLensClientOptions, v as EnsureLensOptions, w as IterateAssetsOptions, x as IdempotencyOptions, y as EnsureLensesOptions, z as UpdateAssetOptions } from "./CalmLensTypes-DjYFaTyh.js";
2
- //#region src/client/CalmLensClient.d.ts
3
- interface ClientState {
4
- readonly options: Omit<CalmLensClientOptions, "apiKey"> & {
5
- baseUrl: string;
6
- cdnBaseUrl: string;
7
- };
8
- readonly ensuredLenses: Map<string, Lens>;
9
- readonly pendingEnsureLenses: Map<string, Promise<void>>;
10
- }
11
- declare const inspectSymbol: unique symbol;
12
- /**
13
- * The CalmLens API client. Create one per project and reuse it; it holds no connections.
14
- * Every method takes one options object and throws `CalmLensError` on failure.
15
- */
16
- declare class CalmLensClient {
17
- #private;
18
- /**
19
- * Verifies that a webhook delivery came from CalmLens: checks the `v1=` HMAC-SHA256 in
20
- * `x-calmlens-signature` over `"<x-calmlens-timestamp>.<raw body>"` and rejects timestamps
21
- * more than `toleranceSeconds` (default 300) from now, which stops replayed deliveries.
22
- * Also exported as `verifyWebhookSignature`; `parseWebhookEvent` verifies and parses.
23
- *
24
- * @example
25
- * ```ts
26
- * const payload = await request.text();
27
- * const isValid = await CalmLensClient.verifyWebhookSignature({
28
- * payload,
29
- * headers: request.headers,
30
- * secret: process.env.CALMLENS_WEBHOOK_SECRET!,
31
- * });
32
- * ```
33
- */
34
- static verifyWebhookSignature(options: VerifyWebhookSignatureOptions): Promise<boolean>;
35
- constructor(options: CalmLensClientOptions, state?: ClientState);
36
- /**
37
- * A client with different cancellation, deadlines or retries for the calls made through it,
38
- * sharing this client's credentials and lens cache. This client is unchanged.
39
- */
40
- withRequestOptions(options: RequestOptions): CalmLensClient;
41
- /** Keeps the API key out of `console.log`, `util.inspect` and `JSON.stringify`. */
42
- [inspectSymbol](): string;
43
- toJSON(): {
44
- projectId: string;
45
- baseUrl: string;
46
- cdnBaseUrl: string;
47
- };
48
- private get timeoutMs();
49
- private apiUrl;
50
- private get projectPath();
51
- private request;
52
- private uploadRequest;
53
- private submitRawAssetUpload;
54
- private expectAsset;
55
- private submitAsset;
56
- get cdn(): {
57
- /**
58
- * Builds a CDN URL for asset content or a preview, without a request. Private assets
59
- * need a signed URL (`assets.createSignedUrl`) or an authenticated request.
60
- */
61
- getAssetUrl: ({ assetIdentifier, ...options }: CdnAssetUrlOptions) => string;
62
- /**
63
- * Fetches asset content or a preview from the CDN with the client's API key, and returns
64
- * the `Response` as soon as headers arrive, so the body streams. Non-2xx responses are
65
- * returned, not thrown; `timeoutMs` covers only the wait for headers.
66
- */
67
- serve: ({ assetIdentifier, init, ...urlOptions }: CdnServeOptions) => Promise<Response>;
68
- };
69
- get text(): {
70
- /**
71
- * Moderates text and waits for the decision. Sends `text` as `text/plain` content named
72
- * `text` unless you pass `name`.
73
- */
74
- moderate: (options: ModerateTextOptions) => Promise<Asset>;
75
- };
76
- get assets(): {
77
- /** Searches accessible assets by keyword or a natural-language description. */
78
- search: (options: Partial<AssetSearchQuery> & {
79
- query: string;
80
- }) => Promise<AssetSearchResponse>;
81
- /** Lists one page of the project's assets, with optional filter and ordering. */
82
- list: (options?: ListAssetsOptions) => Promise<AssetPage>;
83
- /**
84
- * Yields every asset matching `options`, fetching pages as needed. Assets created or
85
- * deleted while iterating can shift pages, so an asset may be skipped or repeated.
86
- */
87
- iterate: (options?: IterateAssetsOptions) => AsyncGenerator<Asset, void, undefined>;
88
- /** Retrieves an asset with its status and moderation report. */
89
- retrieve: ({ assetId }: RetrieveAssetOptions) => Promise<Asset>;
90
- /** Updates an asset's editable fields. */
91
- update: ({ assetId, ...body }: UpdateAssetOptions) => Promise<Asset>;
92
- /** Lists one page of the assets extracted from a website or multimedia document. */
93
- listChildren: ({ assetId, ...options }?: ListAssetChildrenOptions) => Promise<AssetChildrenPage>;
94
- /** Yields every child of an asset, fetching pages as needed. */
95
- iterateChildren: (options: IterateAssetChildrenOptions) => AsyncGenerator<Asset, void, undefined>;
96
- /**
97
- * Uploads an asset and queues it for moderation, returning immediately with status
98
- * `pending` (or `uploading` for the first multipart part). Retried safely with an
99
- * `Idempotency-Key`.
100
- */
101
- create: (options: SubmitAssetOptions) => Promise<Asset>;
102
- /**
103
- * Uploads an asset and waits for its moderation decision. Audio and video still finish
104
- * in the background. Retried safely with an `Idempotency-Key`.
105
- */
106
- moderate: (options: SubmitAssetOptions) => Promise<Asset>;
107
- /**
108
- * Uploads the next part of a multipart upload. The upload's queue mode, chosen when it
109
- * started, applies when the final part arrives; pass `queue` to override it.
110
- */
111
- uploadPart: ({ assetId, part, queue, idempotencyKey }: UploadAssetPartOptions) => Promise<Asset>;
112
- /**
113
- * Creates a short-lived signed CDN URL, so browsers can load private content without
114
- * an API key.
115
- */
116
- createSignedUrl: ({ assetId, ...options }: CreateAssetSignedUrlOptions) => Promise<PostAssetSignedUrlResponse>;
117
- /** Moves an asset into a folder, or to the project root with `folderId: null`. */
118
- move: ({ assetId, folderId }: MoveAssetOptions) => Promise<Asset>;
119
- /**
120
- * Processes an asset that failed (status `error`) again. It returns to `pending` and is
121
- * moderated like a new upload; its content must still be stored.
122
- */
123
- retry: ({ assetId }: RetryAssetOptions) => Promise<Asset>;
124
- /**
125
- * Removes an asset's stored content (source, preview and retained extracted text) while
126
- * keeping the asset record, metadata and moderation report. The returned asset has
127
- * `storageDeletedAt` set; the CDN no longer serves it.
128
- */
129
- deleteContent: ({ assetId }: DeleteAssetContentOptions) => Promise<Asset>;
130
- /** Deletes an asset record together with its stored content. */
131
- delete: ({ assetId }: DeleteAssetOptions) => Promise<void>;
132
- };
133
- get events(): {
134
- /**
135
- * Lists project events after a cursor, oldest first. Call without `after` to get a cursor
136
- * for "now", then poll with the returned `cursor`. Webhook deliveries carry the same events
137
- * reshaped as `{ id, type, createdAt, projectId, data }`.
138
- */
139
- list: (options?: ListEventsOptions) => Promise<GetEventsResponse>;
140
- /**
141
- * Yields pages of events after `after` until no more are waiting. Save each page's
142
- * `cursor` to resume later. Without `after`, yields one empty page whose cursor is "now".
143
- */
144
- pages: (options?: ListEventsOptions) => AsyncGenerator<GetEventsResponse, void, undefined>;
145
- };
146
- private iterateEventPages;
147
- private iteratePages;
148
- get folders(): {
149
- /** Lists every folder in the project. */
150
- list: () => Promise<Folder[]>;
151
- retrieve: ({ folderId }: FolderIdOptions) => Promise<Folder>;
152
- /** Creates a folder at the project root or inside `parentId`. */
153
- create: (options: CreateFolderOptions) => Promise<Folder>;
154
- update: ({ folderId, ...body }: UpdateFolderOptions) => Promise<Folder>;
155
- /** Deletes an empty folder; throws `folder/not-empty` otherwise. */
156
- delete: ({ folderId }: FolderIdOptions) => Promise<void>;
157
- /** Moves a folder under `parentId`, or to the project root with `parentId: null`. */
158
- move: ({ folderId, parentId }: MoveFolderOptions) => Promise<Folder>;
159
- };
160
- /**
161
- * Create a named lens at any positive version, or update it with a greater version.
162
- * Supplying the same definition and version is idempotent.
163
- */
164
- ensureLens(options: EnsureLensOptions): Promise<Lens>;
165
- /**
166
- * Create or update several named lenses in one API request.
167
- * Each lens follows the same versioning and idempotency rules as ensureLens().
168
- */
169
- ensureLenses({ lenses }: EnsureLensesOptions): Promise<Lens[]>;
170
- private submitEnsureLenses;
171
- }
172
- //#endregion
173
- //#region src/client/CalmLensErrorCodes.d.ts
174
- /** Error codes the CalmLens API documents, by name. */
175
- declare const API_ERROR_CODES: {
176
- readonly MISSING_TOKEN: "auth/missing-token";
177
- readonly INVALID_API_KEY: "auth/invalid-api-key";
178
- readonly API_KEY_PROJECT_MISMATCH: "auth/project-mismatch";
179
- readonly API_KEY_NOT_ACCEPTED: "auth/api-key-not-accepted";
180
- readonly FILE_TOO_LARGE: "upload/file-too-large";
181
- readonly IMAGE_REQUIRES_MULTIPART_UPLOAD: "upload/image-requires-multipart-upload";
182
- readonly MULTIPART_IMAGE_TOO_SMALL: "upload/multipart-image-too-small";
183
- readonly MULTIPART_IMAGE_TOO_LARGE: "upload/multipart-image-too-large";
184
- readonly IMAGE_EXCEEDED_MAX_DIMENSIONS: "upload/image-exceeded-max-dimensions";
185
- readonly UPLOAD_LIMIT_EXCEEDED: "upload/limit-exceeded";
186
- readonly INVALID_UPLOAD_MIME_TYPE: "upload/invalid-mime-type";
187
- readonly INVALID_EVENT_CURSOR: "events/invalid-cursor";
188
- readonly INVALID_UPLOAD_PAYLOAD: "upload/invalid-payload";
189
- readonly USE_UPLOAD_PART: "upload/use-upload-part";
190
- readonly UPLOAD_NOT_OPEN: "upload/not-open";
191
- readonly INVALID_UPLOAD_PART_NUMBER: "upload/invalid-part-number";
192
- readonly UPLOAD_MISSING: "upload/missing";
193
- readonly UPLOAD_SIZE_MISMATCH: "upload/size-mismatch";
194
- readonly INVALID_IDEMPOTENCY_KEY: "idempotency/invalid-key";
195
- readonly IDEMPOTENCY_KEY_REUSED: "idempotency/key-reused";
196
- readonly IDEMPOTENT_REQUEST_IN_PROGRESS: "idempotency/request-in-progress";
197
- readonly ASSET_NOT_FOUND: "asset/not-found";
198
- readonly PROJECT_NOT_FOUND: "project/not-found";
199
- readonly ASSET_UPDATE_FAILED: "asset/update-failed";
200
- readonly ASSET_SAFETY_HELD: "asset/safety-held";
201
- readonly ASSET_NOT_RETRYABLE: "asset/not-retryable";
202
- readonly ASSET_CONTENT_UNAVAILABLE: "asset/content-unavailable";
203
- readonly SUPPORT_TICKET_NOT_FOUND: "support/ticket-not-found";
204
- readonly DUPLICATE_EXTERNAL_ID: "asset/duplicate-external-id";
205
- readonly FOLDER_NOT_FOUND: "folder/not-found";
206
- readonly DUPLICATE_FOLDER_NAME: "folder/duplicate-name";
207
- readonly FOLDER_NOT_EMPTY: "folder/not-empty";
208
- readonly FOLDER_PARENT_CYCLE: "folder/parent-cycle";
209
- readonly LENS_VERSION_CONFLICT: "lens/version-conflict";
210
- };
211
- type ApiErrorCode = (typeof API_ERROR_CODES)[keyof typeof API_ERROR_CODES];
212
- //#endregion
213
- //#region src/client/CalmLensError.d.ts
214
- type CalmLensErrorDetails = Record<string, unknown>;
215
- /** Codes for failures the SDK detects itself, before or instead of an API error response. */
216
- declare const SDK_ERROR_CODES: {
217
- /** The request could not be completed: DNS, TLS, a refused or reset connection, a truncated body. */
218
- readonly TRANSPORT_ERROR: "sdk/transport-error";
219
- /** The request did not finish within `timeoutMs`. */
220
- readonly TIMEOUT: "sdk/timeout";
221
- /** The caller's `AbortSignal` cancelled the request. */
222
- readonly CANCELLED: "sdk/cancelled";
223
- /** A successful response whose body is not the JSON the operation returns. */
224
- readonly INVALID_RESPONSE: "sdk/invalid-response";
225
- /** An HTTP failure without a CalmLens error body, for example from a proxy. */
226
- readonly HTTP_ERROR: "sdk/http-error";
227
- /** A response body larger than `maxResponseBytes`. */
228
- readonly RESPONSE_TOO_LARGE: "sdk/response-too-large";
229
- /** A method argument is missing or invalid, for example an empty asset ID. */
230
- readonly INVALID_ARGUMENT: "sdk/invalid-argument";
231
- /** The client options are invalid, for example a missing API key. */
232
- readonly INVALID_CONFIG: "sdk/invalid-config";
233
- /** No `fetch` implementation is available in this runtime. */
234
- readonly NO_FETCH: "sdk/no-fetch";
235
- /** A webhook delivery whose signature or timestamp did not verify. */
236
- readonly INVALID_WEBHOOK_SIGNATURE: "sdk/invalid-webhook-signature";
237
- /** A verified webhook delivery whose body is not a webhook event. */
238
- readonly INVALID_WEBHOOK_PAYLOAD: "sdk/invalid-webhook-payload";
239
- };
240
- type SdkErrorCode = (typeof SDK_ERROR_CODES)[keyof typeof SDK_ERROR_CODES];
241
- /** Every error code the SDK can throw: the documented API codes and the SDK's own `sdk/*` codes. */
242
- export declare const CALMLENS_ERROR_CODES: {
243
- readonly MISSING_TOKEN: "auth/missing-token";
244
- readonly INVALID_API_KEY: "auth/invalid-api-key";
245
- readonly API_KEY_PROJECT_MISMATCH: "auth/project-mismatch";
246
- readonly API_KEY_NOT_ACCEPTED: "auth/api-key-not-accepted";
247
- readonly FILE_TOO_LARGE: "upload/file-too-large";
248
- readonly IMAGE_REQUIRES_MULTIPART_UPLOAD: "upload/image-requires-multipart-upload";
249
- readonly MULTIPART_IMAGE_TOO_SMALL: "upload/multipart-image-too-small";
250
- readonly MULTIPART_IMAGE_TOO_LARGE: "upload/multipart-image-too-large";
251
- readonly IMAGE_EXCEEDED_MAX_DIMENSIONS: "upload/image-exceeded-max-dimensions";
252
- readonly UPLOAD_LIMIT_EXCEEDED: "upload/limit-exceeded";
253
- readonly INVALID_UPLOAD_MIME_TYPE: "upload/invalid-mime-type";
254
- readonly INVALID_EVENT_CURSOR: "events/invalid-cursor";
255
- readonly INVALID_UPLOAD_PAYLOAD: "upload/invalid-payload";
256
- readonly USE_UPLOAD_PART: "upload/use-upload-part";
257
- readonly UPLOAD_NOT_OPEN: "upload/not-open";
258
- readonly INVALID_UPLOAD_PART_NUMBER: "upload/invalid-part-number";
259
- readonly UPLOAD_MISSING: "upload/missing";
260
- readonly UPLOAD_SIZE_MISMATCH: "upload/size-mismatch";
261
- readonly INVALID_IDEMPOTENCY_KEY: "idempotency/invalid-key";
262
- readonly IDEMPOTENCY_KEY_REUSED: "idempotency/key-reused";
263
- readonly IDEMPOTENT_REQUEST_IN_PROGRESS: "idempotency/request-in-progress";
264
- readonly ASSET_NOT_FOUND: "asset/not-found";
265
- readonly PROJECT_NOT_FOUND: "project/not-found";
266
- readonly ASSET_UPDATE_FAILED: "asset/update-failed";
267
- readonly ASSET_SAFETY_HELD: "asset/safety-held";
268
- readonly ASSET_NOT_RETRYABLE: "asset/not-retryable";
269
- readonly ASSET_CONTENT_UNAVAILABLE: "asset/content-unavailable";
270
- readonly SUPPORT_TICKET_NOT_FOUND: "support/ticket-not-found";
271
- readonly DUPLICATE_EXTERNAL_ID: "asset/duplicate-external-id";
272
- readonly FOLDER_NOT_FOUND: "folder/not-found";
273
- readonly DUPLICATE_FOLDER_NAME: "folder/duplicate-name";
274
- readonly FOLDER_NOT_EMPTY: "folder/not-empty";
275
- readonly FOLDER_PARENT_CYCLE: "folder/parent-cycle";
276
- readonly LENS_VERSION_CONFLICT: "lens/version-conflict";
277
- /** The request could not be completed: DNS, TLS, a refused or reset connection, a truncated body. */
278
- readonly TRANSPORT_ERROR: "sdk/transport-error";
279
- /** The request did not finish within `timeoutMs`. */
280
- readonly TIMEOUT: "sdk/timeout";
281
- /** The caller's `AbortSignal` cancelled the request. */
282
- readonly CANCELLED: "sdk/cancelled";
283
- /** A successful response whose body is not the JSON the operation returns. */
284
- readonly INVALID_RESPONSE: "sdk/invalid-response";
285
- /** An HTTP failure without a CalmLens error body, for example from a proxy. */
286
- readonly HTTP_ERROR: "sdk/http-error";
287
- /** A response body larger than `maxResponseBytes`. */
288
- readonly RESPONSE_TOO_LARGE: "sdk/response-too-large";
289
- /** A method argument is missing or invalid, for example an empty asset ID. */
290
- readonly INVALID_ARGUMENT: "sdk/invalid-argument";
291
- /** The client options are invalid, for example a missing API key. */
292
- readonly INVALID_CONFIG: "sdk/invalid-config";
293
- /** No `fetch` implementation is available in this runtime. */
294
- readonly NO_FETCH: "sdk/no-fetch";
295
- /** A webhook delivery whose signature or timestamp did not verify. */
296
- readonly INVALID_WEBHOOK_SIGNATURE: "sdk/invalid-webhook-signature";
297
- /** A verified webhook delivery whose body is not a webhook event. */
298
- readonly INVALID_WEBHOOK_PAYLOAD: "sdk/invalid-webhook-payload";
299
- };
300
- /**
301
- * A known error code. API validation codes (`validation/*`) and codes added to the API after
302
- * this SDK version are still delivered as plain strings, so compare against `string`.
303
- */
304
- type CalmLensErrorCode = ApiErrorCode | SdkErrorCode;
305
- interface CalmLensErrorOptions {
306
- message?: string;
307
- status?: number;
308
- details?: CalmLensErrorDetails;
309
- cause?: unknown;
310
- /** The `X-Request-Id` response header. */
311
- requestId?: string;
312
- /** The response headers, when there was a response. */
313
- headers?: Headers;
314
- /** Seconds to wait before retrying, from the `Retry-After` response header. */
315
- retryAfter?: number;
316
- }
317
- /**
318
- * Every failure the SDK reports, whether the API returned an error or the request never
319
- * completed. Branch on `code`; `status`, `requestId`, `headers` and `retryAfter` describe the
320
- * HTTP response when there was one, and `cause` holds the underlying error.
321
- *
322
- * `instanceof CalmLensError` and `CalmLensError.isCalmLensError(value)` both recognise errors
323
- * from any copy of the SDK, so they work when ESM and CommonJS builds are loaded side by side.
324
- */
325
- export declare class CalmLensError extends Error {
326
- /** A stable identifier such as `asset/not-found` or `sdk/timeout`. */
327
- readonly code: CalmLensErrorCode | (string & {});
328
- /** The HTTP status, when the API responded. */
329
- readonly status?: number;
330
- /** Structured diagnostics from the API, such as validation issues and `traceId`. */
331
- readonly details?: CalmLensErrorDetails;
332
- /** The `X-Request-Id` response header. Include it when you contact support. */
333
- readonly requestId?: string;
334
- /** The response headers, when the API responded. */
335
- readonly headers?: Headers;
336
- /** Seconds to wait before retrying, from the `Retry-After` response header. */
337
- readonly retryAfter?: number;
338
- constructor(code: CalmLensErrorCode | (string & {}) | {
339
- id: string;
340
- defaultMessage?: string;
341
- }, options?: CalmLensErrorOptions);
342
- /** True for any `CalmLensError`, including one created by another copy or build of the SDK. */
343
- static isCalmLensError(value: unknown): value is CalmLensError;
344
- static [Symbol.hasInstance](value: unknown): boolean;
345
- /** The resource does not exist or is not visible to this API key. */
346
- isNotFound(): boolean;
347
- /**
348
- * Whether repeating the same request may succeed: transport failures, throttling (429),
349
- * gateway errors (502, 503, 504) and idempotent requests still in progress. Only repeat a
350
- * create or upload with the same `idempotencyKey`.
351
- */
352
- isRetryable(): boolean;
353
- }
354
- //#endregion
355
- //#region src/client/CalmLensVersion.d.ts
356
- /** This SDK's version, from its package.json. */
357
- export declare const SDK_VERSION: string;
358
- //#endregion
359
- //#region src/client/CalmLensWebhooks.d.ts
360
- export declare const WEBHOOK_DELIVERY_HEADER = "x-calmlens-delivery";
361
- export declare const WEBHOOK_TIMESTAMP_HEADER = "x-calmlens-timestamp";
362
- export declare const WEBHOOK_SIGNATURE_HEADER = "x-calmlens-signature";
363
- /** Deliveries whose timestamp is further than this from the receiver's clock are rejected. */
364
- export declare const WEBHOOK_SIGNATURE_TOLERANCE_SECONDS = 300;
365
- /**
366
- * Verifies a webhook delivery: `x-calmlens-signature` must contain a `v1=` HMAC-SHA256 of
367
- * `"<x-calmlens-timestamp>.<raw body>"`, and the timestamp must be within `toleranceSeconds`
368
- * (default 300) of now. Returns `false` for anything missing, malformed or stale, and throws
369
- * `sdk/invalid-argument` when `payload` is not a raw body (for example, parsed JSON).
370
- */
371
- export declare function verifyWebhookSignature(options: VerifyWebhookSignatureOptions): Promise<boolean>;
372
- /**
373
- * Verifies a webhook delivery and parses its body. Throws `sdk/invalid-webhook-signature`
374
- * when the signature or timestamp does not verify, and `sdk/invalid-webhook-payload` when a
375
- * verified body is not a webhook event. Narrow the result on `type` for typed `data.facts`.
376
- *
377
- * Event types and fact keys added to CalmLens after this SDK version are returned as they are,
378
- * so keep a default branch when you switch on `type`.
379
- */
380
- export declare function parseWebhookEvent(options: VerifyWebhookSignatureOptions): Promise<WebhookEventPayload>;
381
- //#endregion
382
- export { type ApiErrorCode, type Asset, type AssetChildrenPage, type AssetContentOptions, type AssetPage, type AssetSearchQuery, type AssetSearchResponse, type AssetSearchResult, type AssetStatus, type AssetType, type AssetVisibility, CalmLensClient, type CalmLensClientOptions, type CalmLensErrorCode, type CalmLensErrorDetails, type CalmLensErrorOptions, type CdnAssetUrlOptions, type CdnServeOptions, type ClassificationCategoryReport, type ClassificationReport, type CreateAssetSignedUrlOptions, type CreateFolderOptions, type CreateMultipartUploadPartOptions, type DeleteAssetContentOptions, type DeleteAssetOptions, type EnsureLensOptions, type EnsureLensesOptions, type EventCategory, type EventFact, type EventFactValues, type EventFacts, type EventSeverity, type EventType, type GetEventsResponse as EventsPage, type Folder, type FolderIdOptions, type IdempotencyOptions, type ImageTransformOptions, type IterateAssetChildrenOptions, type IterateAssetsOptions, type Lens, type LensTransform, type ListAssetChildrenOptions, type ListAssetsOptions, type ListEventsOptions, type MetadataItem, type ModerateTextOptions, type MoveAssetOptions, type MoveFolderOptions, type MultipartUploadOptions, type MultipartUploadPartOptions, type ProcessingOptions, type RequestOptions, type RetrieveAssetOptions, type RetryAssetOptions, type SdkErrorCode, type SubmitAssetOptions, type TypedEvent, type UpdateAssetOptions, type UpdateFolderOptions, type UploadAssetPartOptions, type VerifyWebhookSignatureOptions, type WebhookEventPayload, type WebhookHeadersInput, type WebhookPayloadInput };
1
+ import { $ as SearchAssetsOptions, A as DeleteAssetContentOptions, At as AssetSafetyHold, B as Lens, C as CdnAssetUrlOptions, Ct as EventType, D as CreateAssetSignedUrlOptions, Dt as AssetSearchMatchField, E as ConnectionOptions, Et as LensType, F as IdempotencyOptions, Ft as MetadataItem, G as ModerateTextOptions, H as ListAssetChildrenOptions, I as ImageTransform, It as PreviewImage, J as MultipartUploadOptions, K as MoveAssetOptions, L as ImageTransformOptions, Lt as ProcessingOptions, M as EnsureLensOptions, Mt as DocumentData, N as EnsureLensesOptions, Nt as ExtractedText, O as CreateFolderOptions, Ot as AssetSearchQuery, P as FolderIdOptions, Pt as ImageData, Q as RetryAssetOptions, R as IterateAssetChildrenOptions, S as CalmLensServerClientOptions, St as EventSeverity, T as CdnTransform, Tt as Page, U as ListAssetsOptions, V as LensTransform, W as ListEventsOptions, X as RequestOptions, Y as MultipartUploadPartOptions, Z as RetrieveAssetOptions, _ as AssetSearchResult, _t as TypedEvent, a as ClassificationLabel, at as UpdateFolderOptions, b as AssetVisibility, bt as EventFactValues, c as ClassificationReport, ct as UploadedAsset, d as Asset, dt as WebhookPayloadInput, et as SignUploadTokenOptions, f as AssetChecksums, ft as GetEventsResponse, g as AssetSearchResponse, gt as EventAsset, h as AssetPage, i as ClassificationCategoryReport, it as UpdateAssetOptions, j as DeleteAssetOptions, jt as AssetSafetyHoldReason, k as CreateMultipartUploadPartOptions, l as Likelihood, lt as VerifyWebhookSignatureOptions, m as AssetContentOptions, mt as Folder, n as ClassificationCategories, nt as SignedUrl, o as ClassificationNotEvaluatedReason, ot as UploadAssetPartOptions, p as AssetChildrenPage, q as MoveFolderOptions, r as ClassificationCategory, rt as SubmitAssetOptions, s as ClassificationQualifierResults, st as UploadPresetSubmitAssetOptions, t as WebhookEventPayload, tt as SignedUploadToken, u as ModerationQualifier, ut as WebhookHeadersInput, v as AssetStatus, vt as EventCategory, w as CdnServeOptions, wt as Order, x as CalmLensAppClientOptions, xt as EventFacts, y as AssetType, yt as EventFact, z as IterateAssetsOptions } from "./WebhookPayload-Cgb32aSH.js";
2
+ import { _ as ProcessingFeatureStage, a as CalmLensErrorDetails, c as ApiErrorCode, d as AgeRange, f as BoundingBox, g as ProcessingFeatureResults, h as ProcessingFeatureId, i as CalmLensErrorCode, l as FlaggedContentAction, m as DetectedPerson, n as CALMLENS_ERROR_CODES, o as CalmLensErrorOptions, p as DetectedFace, r as CalmLensError, s as SdkErrorCode, t as SDK_VERSION, u as FlaggedContentPolicy, v as ProcessingFeatures } from "./index-BgmWj3KL.js";
3
+ export { type AgeRange, type ApiErrorCode, type Asset, type AssetChecksums, type AssetChildrenPage, type AssetContentOptions, type AssetPage, type AssetSafetyHold, type AssetSafetyHoldReason, type AssetSearchMatchField, type AssetSearchQuery, type AssetSearchResponse, type AssetSearchResult, type AssetStatus, type AssetType, type AssetVisibility, type BoundingBox, CALMLENS_ERROR_CODES, type CalmLensAppClientOptions, CalmLensError, type CalmLensErrorCode, type CalmLensErrorDetails, type CalmLensErrorOptions, type CalmLensServerClientOptions, type CdnAssetUrlOptions, type CdnServeOptions, type CdnTransform, type ClassificationCategories, type ClassificationCategory, type ClassificationCategoryReport, type ClassificationLabel, type ClassificationNotEvaluatedReason, type ClassificationQualifierResults, type ClassificationReport, type ConnectionOptions, type CreateAssetSignedUrlOptions, type CreateFolderOptions, type CreateMultipartUploadPartOptions, type DeleteAssetContentOptions, type DeleteAssetOptions, type DetectedFace, type DetectedPerson, type DocumentData, type EnsureLensOptions, type EnsureLensesOptions, type EventAsset, type EventCategory, type EventFact, type EventFactValues, type EventFacts, type EventSeverity, type EventType, type GetEventsResponse as EventsPage, type ExtractedText, type FlaggedContentAction, type FlaggedContentPolicy, type Folder, type FolderIdOptions, type IdempotencyOptions, type ImageData, type ImageTransform, type ImageTransformOptions, type IterateAssetChildrenOptions, type IterateAssetsOptions, type Lens, type LensTransform, type LensType, type Likelihood, type ListAssetChildrenOptions, type ListAssetsOptions, type ListEventsOptions, type MetadataItem, type ModerateTextOptions, type ModerationQualifier, type MoveAssetOptions, type MoveFolderOptions, type MultipartUploadOptions, type MultipartUploadPartOptions, type Order, type Page, type PreviewImage, type ProcessingFeatureId, type ProcessingFeatureResults, type ProcessingFeatureStage, type ProcessingFeatures, type ProcessingOptions, type RequestOptions, type RetrieveAssetOptions, type RetryAssetOptions, SDK_VERSION, type SdkErrorCode, type SearchAssetsOptions, type SignUploadTokenOptions, type SignedUploadToken, type SignedUrl, type SubmitAssetOptions, type TypedEvent, type UpdateAssetOptions, type UpdateFolderOptions, type UploadAssetPartOptions, type UploadPresetSubmitAssetOptions, type UploadedAsset, type VerifyWebhookSignatureOptions, type WebhookEventPayload, type WebhookHeadersInput, type WebhookPayloadInput };