@calmlens/sdk 0.13.0 → 0.14.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 (30) hide show
  1. package/README.md +43 -39
  2. package/cjs/{CalmLensConnection-DzRDCMOP.js → CalmLensConnection-Bth5fJyp.js} +4 -3
  3. package/cjs/{CalmLensUtils-vX5H_vMn.js → CalmLensUtils-DNdmYeX6.js} +10 -10
  4. package/cjs/{CalmLensVersion-DjhsJ1gj.js → CalmLensVersion-Bs0DreBV.js} +67 -2
  5. package/cjs/{CalmLensWebhooks-hVquX5L1.js → CalmLensWebhooks-6thkvr_F.js} +2 -2
  6. package/cjs/{WebhookPayload-B7CgSmI5.d.ts → WebhookPayload-vy8HNMaK.d.ts} +4355 -449
  7. package/cjs/app.d.ts +3 -3
  8. package/cjs/app.js +3 -3
  9. package/cjs/{index-BywTQbRq.d.ts → index-Dz340UQ9.d.ts} +27 -1
  10. package/cjs/index.d.ts +3 -3
  11. package/cjs/index.js +1 -1
  12. package/cjs/server.d.ts +9 -8
  13. package/cjs/server.js +10 -9
  14. package/cjs/testing.d.ts +18 -44
  15. package/cjs/testing.js +96 -27
  16. package/esm/{CalmLensConnection-D8VsTdsA.js → CalmLensConnection-DrCOL9h9.js} +4 -3
  17. package/esm/{CalmLensUtils-B4i3Z2He.js → CalmLensUtils-BQo79TA1.js} +10 -10
  18. package/esm/{CalmLensVersion-DK4BMEST.js → CalmLensVersion-DPnL_Ebv.js} +67 -2
  19. package/esm/{CalmLensWebhooks-DyCoEvpf.js → CalmLensWebhooks-CWlD-f_P.js} +2 -2
  20. package/esm/{WebhookPayload-B7CgSmI5.d.ts → WebhookPayload-vy8HNMaK.d.ts} +4355 -449
  21. package/esm/app.d.ts +3 -3
  22. package/esm/app.js +3 -3
  23. package/esm/{index-BywTQbRq.d.ts → index-Dz340UQ9.d.ts} +27 -1
  24. package/esm/index.d.ts +3 -3
  25. package/esm/index.js +1 -1
  26. package/esm/server.d.ts +9 -8
  27. package/esm/server.js +10 -9
  28. package/esm/testing.d.ts +18 -44
  29. package/esm/testing.js +96 -27
  30. package/package.json +1 -1
package/cjs/app.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { $ as SearchAssetsOptions, A as DeleteAssetContentOptions, B as Lens, C as CdnAssetUrlOptions, Ct as EventSeverity, D as CreateAssetSignedUrlOptions, Dt as LensType, E as ConnectionOptions, Et as Page, F as IdempotencyOptions, Ft as ImageData, G as ModerateTextOptions, H as ListAssetChildrenOptions, I as ImageTransform, It as MetadataItem, J as MultipartUploadOptions, K as MoveAssetOptions, L as ImageTransformOptions, Lt as PreviewImage, M as EnsureLensOptions, Mt as AssetSafetyHoldReason, N as EnsureLensesOptions, Nt as DocumentData, O as CreateFolderOptions, Ot as AssetSearchMatchField, P as FolderIdOptions, Pt as ExtractedText, Q as RetryAssetOptions, R as IterateAssetChildrenOptions, Rt as ProcessingOptions, S as CalmLensServerClientOptions, St as EventFacts, T as CdnTransform, Tt as Order, U as ListAssetsOptions, V as LensTransform, W as ListEventsOptions, X as RequestOptions, Y as MultipartUploadPartOptions, Z as RetrieveAssetOptions, _ as AssetSearchResult, _t as EventAsset, a as ClassificationLabel, at as UpdateFolderOptions, b as AssetVisibility, bt as EventFact, c as ClassificationReport, ct as UploadedAsset, d as Asset, dt as WebhookHeadersInput, et as SignUploadTokenOptions, f as AssetChecksums, ft as WebhookPayloadInput, g as AssetSearchResponse, h as AssetPage, ht as Folder, i as ClassificationCategoryReport, it as UpdateAssetOptions, j as DeleteAssetOptions, jt as AssetSafetyHold, k as CreateMultipartUploadPartOptions, kt as AssetSearchQuery, l as Likelihood, lt as VerifyWebhookSignatureOptions, m as AssetContentOptions, n as ClassificationCategories, nt as SignedUrl, o as ClassificationNotEvaluatedReason, ot as UploadAssetPartOptions, p as AssetChildrenPage, pt as GetEventsResponse, 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 WaitForAssetDecisionOptions, v as AssetStatus, vt as TypedEvent, w as CdnServeOptions, wt as EventType, x as CalmLensAppClientOptions, xt as EventFactValues, y as AssetType, yt as EventCategory, z as IterateAssetsOptions } from "./WebhookPayload-B7CgSmI5.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-BywTQbRq.js";
1
+ import { $ as ModerateTextOptions, A as CalmLensServerClientOptions, At as EventSeverity, B as EnsureLensOptions, Bt as AssetSafetyHold, C as AssetProcessingStatus, D as AssetType, Dt as EventFact, E as AssetSearchResult, Et as EventCategory, F as CreateAssetSignedUrlOptions, Ft as Page, G as ImageTransformOptions, Gt as PreviewImage, H as FolderIdOptions, Ht as ExtractedText, I as CreateFolderOptions, It as LensType, J as Lens, K as IterateAssetChildrenOptions, Kt as ProcessingOptions, L as CreateMultipartUploadPartOptions, Lt as AssetSearchMatchField, M as CdnServeOptions, N as CdnTransform, Nt as Folder, O as AssetVisibility, Ot as EventFactValues, P as ConnectionOptions, Pt as Order, Q as ListEventsOptions, R as DeleteAssetContentOptions, Rt as AssetSearchQuery, S as AssetProcessing, T as AssetSearchResponse, Tt as TypedEvent, U as IdempotencyOptions, Ut as ImageData, V as EnsureLensesOptions, Vt as AssetSafetyHoldReason, W as ImageTransform, Wt as MetadataItem, X as ListAssetChildrenOptions, Y as LensTransform, Z as ListAssetsOptions, _ as AssetContentStatus, _t as VerifyWebhookSignatureOptions, a as ClassificationLabel, at as RetrieveAssetOptions, b as AssetModerationStatus, bt as WebhookPayloadInput, c as ClassificationReport, ct as SignUploadTokenOptions, d as Asset, dt as SubmitAssetOptions, et as MoveAssetOptions, f as AssetChecksums, ft as UpdateAssetOptions, g as AssetContentRemovalReason, gt as UploadedAsset, h as AssetContentOptions, ht as UploadPresetSubmitAssetOptions, i as ClassificationCategoryReport, it as RequestOptions, j as CdnAssetUrlOptions, jt as EventType, k as CalmLensAppClientOptions, kt as EventFacts, l as Likelihood, lt as SignedUploadToken, m as AssetContent, mt as UploadAssetPartOptions, n as ClassificationCategories, nt as MultipartUploadOptions, o as ClassificationNotEvaluatedReason, ot as RetryAssetOptions, p as AssetChildrenPage, pt as UpdateFolderOptions, q as IterateAssetsOptions, r as ClassificationCategory, rt as MultipartUploadPartOptions, s as ClassificationQualifierResults, st as SearchAssetsOptions, t as WebhookEventPayload, tt as MoveFolderOptions, u as ModerationQualifier, ut as SignedUrl, v as AssetModeration, vt as WaitForAssetDecisionOptions, w as AssetReviewerAction, wt as EventAsset, x as AssetPage, xt as GetEventsResponse, y as AssetModerationAction, yt as WebhookHeadersInput, z as DeleteAssetOptions } from "./WebhookPayload-vy8HNMaK.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-Dz340UQ9.js";
3
3
  //#region src/client/CalmLensAppClient.d.ts
4
4
  declare const inspectSymbol: unique symbol;
5
5
  /**
@@ -40,4 +40,4 @@ declare class CalmLensAppClient {
40
40
  };
41
41
  }
42
42
  //#endregion
43
- 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, CalmLensAppClient, 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 WaitForAssetDecisionOptions, type WebhookEventPayload, type WebhookHeadersInput, type WebhookPayloadInput };
43
+ export { type AgeRange, type ApiErrorCode, type Asset, type AssetChecksums, type AssetChildrenPage, type AssetContent, type AssetContentOptions, type AssetContentRemovalReason, type AssetContentStatus, type AssetModeration, type AssetModerationAction, type AssetModerationStatus, type AssetPage, type AssetProcessing, type AssetProcessingStatus, type AssetReviewerAction, type AssetSafetyHold, type AssetSafetyHoldReason, type AssetSearchMatchField, type AssetSearchQuery, type AssetSearchResponse, type AssetSearchResult, type AssetType, type AssetVisibility, type BoundingBox, CALMLENS_ERROR_CODES, CalmLensAppClient, 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 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 WaitForAssetDecisionOptions, type WebhookEventPayload, type WebhookHeadersInput, type WebhookPayloadInput };
package/cjs/app.js CHANGED
@@ -1,8 +1,8 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_CalmLensVersion = require("./CalmLensVersion-DjhsJ1gj.js");
2
+ const require_CalmLensVersion = require("./CalmLensVersion-Bs0DreBV.js");
3
3
  require("./index.js");
4
- const require_CalmLensUtils = require("./CalmLensUtils-vX5H_vMn.js");
5
- const require_CalmLensConnection = require("./CalmLensConnection-DzRDCMOP.js");
4
+ const require_CalmLensUtils = require("./CalmLensUtils-DNdmYeX6.js");
5
+ const require_CalmLensConnection = require("./CalmLensConnection-Bth5fJyp.js");
6
6
  //#region src/client/CalmLensAppClient.ts
7
7
  const inspectSymbol = Symbol.for("nodejs.util.inspect.custom");
8
8
  /**
@@ -1,4 +1,4 @@
1
- import "./WebhookPayload-B7CgSmI5.js";
1
+ import "./WebhookPayload-vy8HNMaK.js";
2
2
  import * as zod from "zod";
3
3
  //#region ../shared/src/ProcessingFeatures.d.ts
4
4
  /**
@@ -180,6 +180,8 @@ declare const API_ERROR_CODES: {
180
180
  readonly UPLOAD_PRESET_NOT_FOUND: "upload-preset/not-found";
181
181
  readonly UPLOAD_PRESET_DISABLED: "upload-preset/disabled";
182
182
  readonly UPLOAD_PRESET_TOKEN_REQUIRED: "upload-preset/token-required";
183
+ readonly REMOTE_URL_NOT_ALLOWED: "upload/remote-url-not-allowed";
184
+ readonly WEBSITE_RATE_LIMIT_EXCEEDED: "upload/website-rate-limit-exceeded";
183
185
  readonly UPLOAD_PRESET_CONTENT_TYPE_NOT_ALLOWED: "upload-preset/content-type-not-allowed";
184
186
  readonly UPLOAD_PRESET_TOO_LARGE: "upload-preset/too-large";
185
187
  readonly UPLOAD_PRESET_DAILY_LIMIT_REACHED: "upload-preset/daily-limit-reached";
@@ -188,6 +190,17 @@ declare const API_ERROR_CODES: {
188
190
  readonly UPLOAD_TOKEN_INVALID: "upload-token/invalid";
189
191
  readonly UPLOAD_TOKEN_EXPIRED: "upload-token/expired";
190
192
  readonly UPLOAD_TOKEN_USED: "upload-token/used";
193
+ readonly INVALID_REMOTE_URL: "asset/invalid-remote-url";
194
+ readonly REMOTE_URL_UNAVAILABLE: "asset/remote-url-unavailable";
195
+ readonly APPEAL_NOT_FOUND: "appeal/not-found";
196
+ readonly APPEAL_JUDGMENT_NOT_FOUND: "appeal/judgment-not-found";
197
+ readonly APPEAL_ASSET_NOT_FOUND: "appeal/asset-not-found";
198
+ readonly APPEAL_PERMISSION_DENIED: "appeal/permission-denied";
199
+ readonly APPEAL_ALREADY_REVIEWED: "appeal/already-reviewed";
200
+ readonly APPEAL_DECISION_CHANGED: "appeal/decision-changed";
201
+ readonly APPEAL_INVALID_ACTION: "appeal/invalid-action";
202
+ readonly APPEAL_SAFETY_HELD: "appeal/safety-held";
203
+ readonly APPEAL_CONTENT_UNAVAILABLE: "appeal/content-unavailable";
191
204
  };
192
205
  type ApiErrorCode = (typeof API_ERROR_CODES)[keyof typeof API_ERROR_CODES];
193
206
  //#endregion
@@ -259,6 +272,8 @@ declare const CALMLENS_ERROR_CODES: {
259
272
  readonly UPLOAD_PRESET_NOT_FOUND: "upload-preset/not-found";
260
273
  readonly UPLOAD_PRESET_DISABLED: "upload-preset/disabled";
261
274
  readonly UPLOAD_PRESET_TOKEN_REQUIRED: "upload-preset/token-required";
275
+ readonly REMOTE_URL_NOT_ALLOWED: "upload/remote-url-not-allowed";
276
+ readonly WEBSITE_RATE_LIMIT_EXCEEDED: "upload/website-rate-limit-exceeded";
262
277
  readonly UPLOAD_PRESET_CONTENT_TYPE_NOT_ALLOWED: "upload-preset/content-type-not-allowed";
263
278
  readonly UPLOAD_PRESET_TOO_LARGE: "upload-preset/too-large";
264
279
  readonly UPLOAD_PRESET_DAILY_LIMIT_REACHED: "upload-preset/daily-limit-reached";
@@ -267,6 +282,17 @@ declare const CALMLENS_ERROR_CODES: {
267
282
  readonly UPLOAD_TOKEN_INVALID: "upload-token/invalid";
268
283
  readonly UPLOAD_TOKEN_EXPIRED: "upload-token/expired";
269
284
  readonly UPLOAD_TOKEN_USED: "upload-token/used";
285
+ readonly INVALID_REMOTE_URL: "asset/invalid-remote-url";
286
+ readonly REMOTE_URL_UNAVAILABLE: "asset/remote-url-unavailable";
287
+ readonly APPEAL_NOT_FOUND: "appeal/not-found";
288
+ readonly APPEAL_JUDGMENT_NOT_FOUND: "appeal/judgment-not-found";
289
+ readonly APPEAL_ASSET_NOT_FOUND: "appeal/asset-not-found";
290
+ readonly APPEAL_PERMISSION_DENIED: "appeal/permission-denied";
291
+ readonly APPEAL_ALREADY_REVIEWED: "appeal/already-reviewed";
292
+ readonly APPEAL_DECISION_CHANGED: "appeal/decision-changed";
293
+ readonly APPEAL_INVALID_ACTION: "appeal/invalid-action";
294
+ readonly APPEAL_SAFETY_HELD: "appeal/safety-held";
295
+ readonly APPEAL_CONTENT_UNAVAILABLE: "appeal/content-unavailable";
270
296
  /** The request could not be completed: DNS, TLS, a refused or reset connection, a truncated body. */
271
297
  readonly TRANSPORT_ERROR: "sdk/transport-error";
272
298
  /** The request did not finish within `timeoutMs`. */
package/cjs/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import { $ as SearchAssetsOptions, A as DeleteAssetContentOptions, B as Lens, C as CdnAssetUrlOptions, Ct as EventSeverity, D as CreateAssetSignedUrlOptions, Dt as LensType, E as ConnectionOptions, Et as Page, F as IdempotencyOptions, Ft as ImageData, G as ModerateTextOptions, H as ListAssetChildrenOptions, I as ImageTransform, It as MetadataItem, J as MultipartUploadOptions, K as MoveAssetOptions, L as ImageTransformOptions, Lt as PreviewImage, M as EnsureLensOptions, Mt as AssetSafetyHoldReason, N as EnsureLensesOptions, Nt as DocumentData, O as CreateFolderOptions, Ot as AssetSearchMatchField, P as FolderIdOptions, Pt as ExtractedText, Q as RetryAssetOptions, R as IterateAssetChildrenOptions, Rt as ProcessingOptions, S as CalmLensServerClientOptions, St as EventFacts, T as CdnTransform, Tt as Order, U as ListAssetsOptions, V as LensTransform, W as ListEventsOptions, X as RequestOptions, Y as MultipartUploadPartOptions, Z as RetrieveAssetOptions, _ as AssetSearchResult, _t as EventAsset, a as ClassificationLabel, at as UpdateFolderOptions, b as AssetVisibility, bt as EventFact, c as ClassificationReport, ct as UploadedAsset, d as Asset, dt as WebhookHeadersInput, et as SignUploadTokenOptions, f as AssetChecksums, ft as WebhookPayloadInput, g as AssetSearchResponse, h as AssetPage, ht as Folder, i as ClassificationCategoryReport, it as UpdateAssetOptions, j as DeleteAssetOptions, jt as AssetSafetyHold, k as CreateMultipartUploadPartOptions, kt as AssetSearchQuery, l as Likelihood, lt as VerifyWebhookSignatureOptions, m as AssetContentOptions, n as ClassificationCategories, nt as SignedUrl, o as ClassificationNotEvaluatedReason, ot as UploadAssetPartOptions, p as AssetChildrenPage, pt as GetEventsResponse, 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 WaitForAssetDecisionOptions, v as AssetStatus, vt as TypedEvent, w as CdnServeOptions, wt as EventType, x as CalmLensAppClientOptions, xt as EventFactValues, y as AssetType, yt as EventCategory, z as IterateAssetsOptions } from "./WebhookPayload-B7CgSmI5.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-BywTQbRq.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 WaitForAssetDecisionOptions, type WebhookEventPayload, type WebhookHeadersInput, type WebhookPayloadInput };
1
+ import { $ as ModerateTextOptions, A as CalmLensServerClientOptions, At as EventSeverity, B as EnsureLensOptions, Bt as AssetSafetyHold, C as AssetProcessingStatus, D as AssetType, Dt as EventFact, E as AssetSearchResult, Et as EventCategory, F as CreateAssetSignedUrlOptions, Ft as Page, G as ImageTransformOptions, Gt as PreviewImage, H as FolderIdOptions, Ht as ExtractedText, I as CreateFolderOptions, It as LensType, J as Lens, K as IterateAssetChildrenOptions, Kt as ProcessingOptions, L as CreateMultipartUploadPartOptions, Lt as AssetSearchMatchField, M as CdnServeOptions, N as CdnTransform, Nt as Folder, O as AssetVisibility, Ot as EventFactValues, P as ConnectionOptions, Pt as Order, Q as ListEventsOptions, R as DeleteAssetContentOptions, Rt as AssetSearchQuery, S as AssetProcessing, T as AssetSearchResponse, Tt as TypedEvent, U as IdempotencyOptions, Ut as ImageData, V as EnsureLensesOptions, Vt as AssetSafetyHoldReason, W as ImageTransform, Wt as MetadataItem, X as ListAssetChildrenOptions, Y as LensTransform, Z as ListAssetsOptions, _ as AssetContentStatus, _t as VerifyWebhookSignatureOptions, a as ClassificationLabel, at as RetrieveAssetOptions, b as AssetModerationStatus, bt as WebhookPayloadInput, c as ClassificationReport, ct as SignUploadTokenOptions, d as Asset, dt as SubmitAssetOptions, et as MoveAssetOptions, f as AssetChecksums, ft as UpdateAssetOptions, g as AssetContentRemovalReason, gt as UploadedAsset, h as AssetContentOptions, ht as UploadPresetSubmitAssetOptions, i as ClassificationCategoryReport, it as RequestOptions, j as CdnAssetUrlOptions, jt as EventType, k as CalmLensAppClientOptions, kt as EventFacts, l as Likelihood, lt as SignedUploadToken, m as AssetContent, mt as UploadAssetPartOptions, n as ClassificationCategories, nt as MultipartUploadOptions, o as ClassificationNotEvaluatedReason, ot as RetryAssetOptions, p as AssetChildrenPage, pt as UpdateFolderOptions, q as IterateAssetsOptions, r as ClassificationCategory, rt as MultipartUploadPartOptions, s as ClassificationQualifierResults, st as SearchAssetsOptions, t as WebhookEventPayload, tt as MoveFolderOptions, u as ModerationQualifier, ut as SignedUrl, v as AssetModeration, vt as WaitForAssetDecisionOptions, w as AssetReviewerAction, wt as EventAsset, x as AssetPage, xt as GetEventsResponse, y as AssetModerationAction, yt as WebhookHeadersInput, z as DeleteAssetOptions } from "./WebhookPayload-vy8HNMaK.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-Dz340UQ9.js";
3
+ export { type AgeRange, type ApiErrorCode, type Asset, type AssetChecksums, type AssetChildrenPage, type AssetContent, type AssetContentOptions, type AssetContentRemovalReason, type AssetContentStatus, type AssetModeration, type AssetModerationAction, type AssetModerationStatus, type AssetPage, type AssetProcessing, type AssetProcessingStatus, type AssetReviewerAction, type AssetSafetyHold, type AssetSafetyHoldReason, type AssetSearchMatchField, type AssetSearchQuery, type AssetSearchResponse, type AssetSearchResult, 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 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 WaitForAssetDecisionOptions, type WebhookEventPayload, type WebhookHeadersInput, type WebhookPayloadInput };
package/cjs/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_CalmLensVersion = require("./CalmLensVersion-DjhsJ1gj.js");
2
+ const require_CalmLensVersion = require("./CalmLensVersion-Bs0DreBV.js");
3
3
  exports.CALMLENS_ERROR_CODES = require_CalmLensVersion.CALMLENS_ERROR_CODES;
4
4
  exports.CalmLensError = require_CalmLensVersion.CalmLensError;
5
5
  exports.SDK_VERSION = require_CalmLensVersion.SDK_VERSION;
package/cjs/server.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { $ as SearchAssetsOptions, A as DeleteAssetContentOptions, B as Lens, C as CdnAssetUrlOptions, Ct as EventSeverity, D as CreateAssetSignedUrlOptions, Dt as LensType, E as ConnectionOptions, Et as Page, F as IdempotencyOptions, Ft as ImageData, G as ModerateTextOptions, H as ListAssetChildrenOptions, I as ImageTransform, It as MetadataItem, J as MultipartUploadOptions, K as MoveAssetOptions, L as ImageTransformOptions, Lt as PreviewImage, M as EnsureLensOptions, Mt as AssetSafetyHoldReason, N as EnsureLensesOptions, Nt as DocumentData, O as CreateFolderOptions, Ot as AssetSearchMatchField, P as FolderIdOptions, Pt as ExtractedText, Q as RetryAssetOptions, R as IterateAssetChildrenOptions, Rt as ProcessingOptions, S as CalmLensServerClientOptions, St as EventFacts, T as CdnTransform, Tt as Order, U as ListAssetsOptions, V as LensTransform, W as ListEventsOptions, X as RequestOptions, Y as MultipartUploadPartOptions, Z as RetrieveAssetOptions, _ as AssetSearchResult, _t as EventAsset, a as ClassificationLabel, at as UpdateFolderOptions, b as AssetVisibility, bt as EventFact, c as ClassificationReport, ct as UploadedAsset, d as Asset, dt as WebhookHeadersInput, et as SignUploadTokenOptions, f as AssetChecksums, ft as WebhookPayloadInput, g as AssetSearchResponse, h as AssetPage, ht as Folder, i as ClassificationCategoryReport, it as UpdateAssetOptions, j as DeleteAssetOptions, jt as AssetSafetyHold, k as CreateMultipartUploadPartOptions, kt as AssetSearchQuery, l as Likelihood, lt as VerifyWebhookSignatureOptions, m as AssetContentOptions, mt as PostAssetSignedUrlResponse, n as ClassificationCategories, nt as SignedUrl, o as ClassificationNotEvaluatedReason, ot as UploadAssetPartOptions, p as AssetChildrenPage, pt as GetEventsResponse, 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 WaitForAssetDecisionOptions, v as AssetStatus, vt as TypedEvent, w as CdnServeOptions, wt as EventType, x as CalmLensAppClientOptions, xt as EventFactValues, y as AssetType, yt as EventCategory, z as IterateAssetsOptions } from "./WebhookPayload-B7CgSmI5.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-BywTQbRq.js";
1
+ import { $ as ModerateTextOptions, A as CalmLensServerClientOptions, At as EventSeverity, B as EnsureLensOptions, Bt as AssetSafetyHold, C as AssetProcessingStatus, D as AssetType, Dt as EventFact, E as AssetSearchResult, Et as EventCategory, F as CreateAssetSignedUrlOptions, Ft as Page, G as ImageTransformOptions, Gt as PreviewImage, H as FolderIdOptions, Ht as ExtractedText, I as CreateFolderOptions, It as LensType, J as Lens, K as IterateAssetChildrenOptions, Kt as ProcessingOptions, L as CreateMultipartUploadPartOptions, Lt as AssetSearchMatchField, M as CdnServeOptions, N as CdnTransform, Nt as Folder, O as AssetVisibility, Ot as EventFactValues, P as ConnectionOptions, Pt as Order, Q as ListEventsOptions, R as DeleteAssetContentOptions, Rt as AssetSearchQuery, S as AssetProcessing, St as PostAssetSignedUrlResponse, T as AssetSearchResponse, Tt as TypedEvent, U as IdempotencyOptions, Ut as ImageData, V as EnsureLensesOptions, Vt as AssetSafetyHoldReason, W as ImageTransform, Wt as MetadataItem, X as ListAssetChildrenOptions, Y as LensTransform, Z as ListAssetsOptions, _ as AssetContentStatus, _t as VerifyWebhookSignatureOptions, a as ClassificationLabel, at as RetrieveAssetOptions, b as AssetModerationStatus, bt as WebhookPayloadInput, c as ClassificationReport, ct as SignUploadTokenOptions, d as Asset, dt as SubmitAssetOptions, et as MoveAssetOptions, f as AssetChecksums, ft as UpdateAssetOptions, g as AssetContentRemovalReason, gt as UploadedAsset, h as AssetContentOptions, ht as UploadPresetSubmitAssetOptions, i as ClassificationCategoryReport, it as RequestOptions, j as CdnAssetUrlOptions, jt as EventType, k as CalmLensAppClientOptions, kt as EventFacts, l as Likelihood, lt as SignedUploadToken, m as AssetContent, mt as UploadAssetPartOptions, n as ClassificationCategories, nt as MultipartUploadOptions, o as ClassificationNotEvaluatedReason, ot as RetryAssetOptions, p as AssetChildrenPage, pt as UpdateFolderOptions, q as IterateAssetsOptions, r as ClassificationCategory, rt as MultipartUploadPartOptions, s as ClassificationQualifierResults, st as SearchAssetsOptions, t as WebhookEventPayload, tt as MoveFolderOptions, u as ModerationQualifier, ut as SignedUrl, v as AssetModeration, vt as WaitForAssetDecisionOptions, w as AssetReviewerAction, wt as EventAsset, x as AssetPage, xt as GetEventsResponse, y as AssetModerationAction, yt as WebhookHeadersInput, z as DeleteAssetOptions } from "./WebhookPayload-vy8HNMaK.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-Dz340UQ9.js";
3
3
  //#region src/client/CalmLensServerClient.d.ts
4
4
  interface LensCache {
5
5
  readonly ensuredLenses: Map<string, Lens>;
@@ -88,8 +88,8 @@ declare class CalmLensServerClient {
88
88
  /** Yields every child of an asset, fetching pages as needed. */
89
89
  iterateChildren: (options: IterateAssetChildrenOptions) => AsyncGenerator<Asset, void, undefined>;
90
90
  /**
91
- * Uploads an asset and queues it for moderation, returning immediately with status
92
- * `pending` (or `uploading` for the first multipart part). Retried safely with an
91
+ * Uploads an asset and queues it for moderation, returning immediately with processing
92
+ * status `processing` (or `uploading` for the first multipart part). Retried safely with an
93
93
  * `Idempotency-Key`.
94
94
  */
95
95
  create: (options: SubmitAssetOptions) => Promise<Asset>;
@@ -111,13 +111,14 @@ declare class CalmLensServerClient {
111
111
  /** Moves an asset into a folder, or to the project root with `folderId: null`. */
112
112
  move: ({ assetId, folderId }: MoveAssetOptions) => Promise<Asset>;
113
113
  /**
114
- * Processes an asset that failed (status `error`) again. It returns to `pending` and is
114
+ * Processes an asset that failed (processing status `failed`) again. It returns to
115
+ * `processing` and is
115
116
  * moderated like a new upload; its content must still be stored.
116
117
  */
117
118
  retry: ({ assetId }: RetryAssetOptions) => Promise<Asset>;
118
119
  /**
119
- * Waits for an asset's moderation decision (`approved`, `rejected` or `error`) and returns
120
- * the decided asset, checking every few seconds. Rejects with `sdk/timeout` if there is no
120
+ * Waits until an asset's `moderation.status` is `approved` or `rejected`, or its
121
+ * `processing.status` is `failed`, and returns that asset, checking every few seconds. Rejects with `sdk/timeout` if there is no
121
122
  * decision within `timeoutMs` (default 60000). Webhooks report decisions without polling.
122
123
  */
123
124
  waitForDecision: ({ assetId, ...options }: WaitForAssetDecisionOptions) => Promise<Asset>;
@@ -207,4 +208,4 @@ export declare function verifyWebhookSignature(options: VerifyWebhookSignatureOp
207
208
  */
208
209
  export declare function parseWebhookEvent(options: VerifyWebhookSignatureOptions): Promise<WebhookEventPayload>;
209
210
  //#endregion
210
- 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, CalmLensServerClient, 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 WaitForAssetDecisionOptions, type WebhookEventPayload, type WebhookHeadersInput, type WebhookPayloadInput };
211
+ export { type AgeRange, type ApiErrorCode, type Asset, type AssetChecksums, type AssetChildrenPage, type AssetContent, type AssetContentOptions, type AssetContentRemovalReason, type AssetContentStatus, type AssetModeration, type AssetModerationAction, type AssetModerationStatus, type AssetPage, type AssetProcessing, type AssetProcessingStatus, type AssetReviewerAction, type AssetSafetyHold, type AssetSafetyHoldReason, type AssetSearchMatchField, type AssetSearchQuery, type AssetSearchResponse, type AssetSearchResult, type AssetType, type AssetVisibility, type BoundingBox, CALMLENS_ERROR_CODES, type CalmLensAppClientOptions, CalmLensError, type CalmLensErrorCode, type CalmLensErrorDetails, type CalmLensErrorOptions, CalmLensServerClient, 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 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 WaitForAssetDecisionOptions, type WebhookEventPayload, type WebhookHeadersInput, type WebhookPayloadInput };
package/cjs/server.js CHANGED
@@ -1,9 +1,9 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_CalmLensVersion = require("./CalmLensVersion-DjhsJ1gj.js");
2
+ const require_CalmLensVersion = require("./CalmLensVersion-Bs0DreBV.js");
3
3
  require("./index.js");
4
- const require_CalmLensWebhooks = require("./CalmLensWebhooks-hVquX5L1.js");
5
- const require_CalmLensUtils = require("./CalmLensUtils-vX5H_vMn.js");
6
- const require_CalmLensConnection = require("./CalmLensConnection-DzRDCMOP.js");
4
+ const require_CalmLensWebhooks = require("./CalmLensWebhooks-6thkvr_F.js");
5
+ const require_CalmLensUtils = require("./CalmLensUtils-DNdmYeX6.js");
6
+ const require_CalmLensConnection = require("./CalmLensConnection-Bth5fJyp.js");
7
7
  const getEnsureLensCacheKey = (options) => require_CalmLensWebhooks.stringifyJsonCanonical({
8
8
  identifier: options.identifier,
9
9
  name: options.name,
@@ -198,8 +198,8 @@ sign: async (options) => {
198
198
  }));
199
199
  },
200
200
  /**
201
- * Uploads an asset and queues it for moderation, returning immediately with status
202
- * `pending` (or `uploading` for the first multipart part). Retried safely with an
201
+ * Uploads an asset and queues it for moderation, returning immediately with processing
202
+ * status `processing` (or `uploading` for the first multipart part). Retried safely with an
203
203
  * `Idempotency-Key`.
204
204
  */
205
205
  create: async (options) => this.submitAsset(options, true),
@@ -236,13 +236,14 @@ sign: async (options) => {
236
236
  /** Moves an asset into a folder, or to the project root with `folderId: null`. */
237
237
  move: async ({ assetId, folderId }) => this.request("POST", `/assets/${requireId(assetId, "Asset ID")}/move`, { body: { folderId } }),
238
238
  /**
239
- * Processes an asset that failed (status `error`) again. It returns to `pending` and is
239
+ * Processes an asset that failed (processing status `failed`) again. It returns to
240
+ * `processing` and is
240
241
  * moderated like a new upload; its content must still be stored.
241
242
  */
242
243
  retry: async ({ assetId }) => this.request("POST", `/assets/${requireId(assetId, "Asset ID")}/retry`),
243
244
  /**
244
- * Waits for an asset's moderation decision (`approved`, `rejected` or `error`) and returns
245
- * the decided asset, checking every few seconds. Rejects with `sdk/timeout` if there is no
245
+ * Waits until an asset's `moderation.status` is `approved` or `rejected`, or its
246
+ * `processing.status` is `failed`, and returns that asset, checking every few seconds. Rejects with `sdk/timeout` if there is no
246
247
  * decision within `timeoutMs` (default 60000). Webhooks report decisions without polling.
247
248
  */
248
249
  waitForDecision: async ({ assetId, ...options }) => {
package/cjs/testing.d.ts CHANGED
@@ -1,5 +1,4 @@
1
- import { $ as SearchAssetsOptions, A as DeleteAssetContentOptions, At as AssetBinaryPayloadInput, B as Lens, C as CdnAssetUrlOptions, D as CreateAssetSignedUrlOptions, G as ModerateTextOptions, H as ListAssetChildrenOptions, K as MoveAssetOptions, M as EnsureLensOptions, N as EnsureLensesOptions, O as CreateFolderOptions, P as FolderIdOptions, Q as RetryAssetOptions, R as IterateAssetChildrenOptions, S as CalmLensServerClientOptions, U as ListAssetsOptions, W as ListEventsOptions, Z as RetrieveAssetOptions, at as UpdateFolderOptions, d as Asset, et as SignUploadTokenOptions, g as AssetSearchResponse, gt as Event, h as AssetPage, ht as Folder, it as UpdateAssetOptions, j as DeleteAssetOptions, mt as PostAssetSignedUrlResponse, ot as UploadAssetPartOptions, p as AssetChildrenPage, pt as GetEventsResponse, q as MoveFolderOptions, r as ClassificationCategory, rt as SubmitAssetOptions, t as WebhookEventPayload, tt as SignedUploadToken, ut as WaitForAssetDecisionOptions, v as AssetStatus, vt as TypedEvent, w as CdnServeOptions, z as IterateAssetsOptions } from "./WebhookPayload-B7CgSmI5.js";
2
- import * as zod from "zod";
1
+ import { $ as ModerateTextOptions, A as CalmLensServerClientOptions, B as EnsureLensOptions, Ct as Event, F as CreateAssetSignedUrlOptions, H as FolderIdOptions, I as CreateFolderOptions, J as Lens, K as IterateAssetChildrenOptions, M as CdnServeOptions, Mt as PermissionGrant, Nt as Folder, Q as ListEventsOptions, R as DeleteAssetContentOptions, St as PostAssetSignedUrlResponse, T as AssetSearchResponse, Tt as TypedEvent, V as EnsureLensesOptions, X as ListAssetChildrenOptions, Z as ListAssetsOptions, at as RetrieveAssetOptions, ct as SignUploadTokenOptions, d as Asset, dt as SubmitAssetOptions, et as MoveAssetOptions, ft as UpdateAssetOptions, j as CdnAssetUrlOptions, lt as SignedUploadToken, mt as UploadAssetPartOptions, ot as RetryAssetOptions, p as AssetChildrenPage, pt as UpdateFolderOptions, q as IterateAssetsOptions, r as ClassificationCategory, st as SearchAssetsOptions, t as WebhookEventPayload, tt as MoveFolderOptions, vt as WaitForAssetDecisionOptions, x as AssetPage, xt as GetEventsResponse, z as DeleteAssetOptions, zt as AssetBinaryPayloadInput } from "./WebhookPayload-vy8HNMaK.js";
3
2
  //#region ../shared/src/TestTriggers.d.ts
4
3
  type ClassificationTestSignal = ClassificationCategory | "sexual.involving-minors" | "violence.graphic";
5
4
  //#endregion
@@ -8,42 +7,6 @@ export declare const MEDIA_TEST_SIGNALS: readonly ["sexual", "violence", "self-h
8
7
  /** Read this aloud, or render it as large, high-contrast text in a video frame. */
9
8
  export declare function generateMediaTestCode(signal: ClassificationTestSignal, projectId: string): string;
10
9
  //#endregion
11
- //#region ../shared/src/Permissions.d.ts
12
- declare const GRANT_SCHEMA: zod.ZodObject<{
13
- actions: zod.ZodArray<zod.ZodEnum<{
14
- "api-keys:read": "api-keys:read";
15
- "api-keys:write": "api-keys:write";
16
- "assets:create": "assets:create";
17
- "assets:delete": "assets:delete";
18
- "assets:download": "assets:download";
19
- "assets:read": "assets:read";
20
- "assets:share": "assets:share";
21
- "assets:update": "assets:update";
22
- "connectors:read": "connectors:read";
23
- "connectors:write": "connectors:write";
24
- "folders:create": "folders:create";
25
- "folders:delete": "folders:delete";
26
- "folders:read": "folders:read";
27
- "folders:update": "folders:update";
28
- "lenses:read": "lenses:read";
29
- "lenses:write": "lenses:write";
30
- "members:read": "members:read";
31
- "members:write": "members:write";
32
- "metadata:read": "metadata:read";
33
- "metadata:write": "metadata:write";
34
- "project:manage": "project:manage";
35
- "reviews:read": "reviews:read";
36
- "reviews:write": "reviews:write";
37
- "settings:read": "settings:read";
38
- "settings:write": "settings:write";
39
- "upload-presets:read": "upload-presets:read";
40
- "upload-presets:write": "upload-presets:write";
41
- }>>;
42
- folderId: zod.ZodNullable<zod.ZodString>;
43
- includeSubfolders: zod.ZodBoolean;
44
- }, zod.core.$strict>;
45
- type PermissionGrant = zod.infer<typeof GRANT_SCHEMA>;
46
- //#endregion
47
10
  //#region src/testing/MockApiKey.d.ts
48
11
  export declare const MOCK_API_KEY_PREFIX = "sk_test_";
49
12
  export declare const createMockApiKey: (grants?: PermissionGrant[]) => string;
@@ -113,13 +76,18 @@ interface MockCalmLensServerClientOptions extends CalmLensServerClientOptions {
113
76
  imageStorage?: MockImageStorage;
114
77
  createId?: () => string;
115
78
  now?: () => number;
116
- /** Status `assets.create` returns. Defaults to `pending`. */
117
- queuedStatus?: AssetStatus;
118
- /** Status `assets.moderate` and `text.moderate` return. Defaults to `approved`. */
119
- analyzedStatus?: AssetStatus;
79
+ /** Outcome of `assets.create` (and queued multipart uploads). Defaults to `pending`. */
80
+ queuedOutcome?: MockAssetOutcome;
81
+ /** Outcome of `assets.moderate` and `text.moderate`. Defaults to `approved`. */
82
+ analyzedOutcome?: MockAssetOutcome;
120
83
  signedUrlBaseUrl?: string;
121
84
  };
122
85
  }
86
+ /**
87
+ * Where a mock upload ends up: `pending` (still processing), `approved` or `rejected` (processing
88
+ * done with that decision), or `failed` (processing failed, retryable).
89
+ */
90
+ type MockAssetOutcome = "pending" | "approved" | "rejected" | "failed";
123
91
  /** The options each `MockCalmLensServerClient` method was given, by operation name. */
124
92
  interface MockCalmLensOperationOptions {
125
93
  "assets.list": ListAssetsOptions;
@@ -179,8 +147,8 @@ export declare class MockCalmLensServerClient {
179
147
  readonly imageStorage: MockImageStorage;
180
148
  private readonly createId;
181
149
  private readonly now;
182
- private readonly queuedStatus;
183
- private readonly analyzedStatus;
150
+ private readonly queuedOutcome;
151
+ private readonly analyzedOutcome;
184
152
  private readonly apiKeyGrants;
185
153
  private readonly signedUrlBaseUrl;
186
154
  private readonly cdnBaseUrl;
@@ -287,9 +255,15 @@ export declare class MockCalmLensServerClient {
287
255
  private withIdempotency;
288
256
  private moderateAsset;
289
257
  private createAsset;
258
+ /**
259
+ * Moves an asset to `outcome` like the pipeline would: a decision finishes processing, and
260
+ * finished processing removes content kept only temporarily (`keepContentAfterProcessing` off).
261
+ */
262
+ private applyOutcome;
290
263
  private resolveFolder;
291
264
  private findOwnFolder;
292
265
  private assertUniqueFolderName;
266
+ private getContentFormat;
293
267
  private getSizeInBytes;
294
268
  }
295
269
  //#endregion
package/cjs/testing.js CHANGED
@@ -21,9 +21,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
21
21
  enumerable: true
22
22
  }) : target, mod));
23
23
  //#endregion
24
- const require_CalmLensVersion = require("./CalmLensVersion-DjhsJ1gj.js");
25
- const require_CalmLensWebhooks = require("./CalmLensWebhooks-hVquX5L1.js");
26
- const require_CalmLensUtils = require("./CalmLensUtils-vX5H_vMn.js");
24
+ const require_CalmLensVersion = require("./CalmLensVersion-Bs0DreBV.js");
25
+ const require_CalmLensWebhooks = require("./CalmLensWebhooks-6thkvr_F.js");
26
+ const require_CalmLensUtils = require("./CalmLensUtils-DNdmYeX6.js");
27
27
  let zod = require("zod");
28
28
  zod = __toESM(zod);
29
29
  require("zod/v4");
@@ -335,7 +335,6 @@ const CLASSIFICATION_LABEL_SCHEMA = zod.object({
335
335
  zod.object({
336
336
  processedAt: zod.number(),
337
337
  categories: CATEGORIES_SCHEMA,
338
- flagged: zod.boolean(),
339
338
  score: zod.number(),
340
339
  notes: saneStringField().nullish(),
341
340
  media: zod.object({
@@ -732,8 +731,8 @@ var MockCalmLensServerClient = class {
732
731
  this.imageStorage = options.mockOptions?.imageStorage ?? new InMemoryMockImageStorage();
733
732
  this.createId = options.mockOptions?.createId ?? crypto.randomUUID.bind(crypto);
734
733
  this.now = options.mockOptions?.now ?? Date.now;
735
- this.queuedStatus = options.mockOptions?.queuedStatus ?? "pending";
736
- this.analyzedStatus = options.mockOptions?.analyzedStatus ?? "approved";
734
+ this.queuedOutcome = options.mockOptions?.queuedOutcome ?? "pending";
735
+ this.analyzedOutcome = options.mockOptions?.analyzedOutcome ?? "approved";
737
736
  this.apiKeyGrants = getMockApiKeyGrants(options.apiKey);
738
737
  this.signedUrlBaseUrl = options.mockOptions?.signedUrlBaseUrl ?? "mock://calmlens";
739
738
  this.cdnBaseUrl = (options.cdnBaseUrl ?? "mock://calmlens/v1").replace(/\/+$/, "");
@@ -1045,18 +1044,22 @@ var MockCalmLensServerClient = class {
1045
1044
  isFinal: part.isFinal
1046
1045
  });
1047
1046
  if (!validation.ok) throw this.invalidPayload(validation.error);
1048
- if (asset.status !== "uploading") throw this.apiError(require_CalmLensVersion.API_ERROR_CODES.UPLOAD_NOT_OPEN);
1049
- const expectedPartNumber = (asset.uploadPartsReceived ?? 1) + 1;
1047
+ if (asset.processing.status !== "uploading") throw this.apiError(require_CalmLensVersion.API_ERROR_CODES.UPLOAD_NOT_OPEN);
1048
+ const expectedPartNumber = (asset.processing.uploadPartsReceived ?? 1) + 1;
1050
1049
  if (part.partNumber !== expectedPartNumber) throw this.apiError(require_CalmLensVersion.API_ERROR_CODES.INVALID_UPLOAD_PART_NUMBER, { details: { expectedPartNumber } });
1051
1050
  await this.imageStorage.putPart(assetId, part);
1052
1051
  const queue = options.queue ?? this.uploadQueues.get(assetId) ?? false;
1053
1052
  if (part.isFinal) this.uploadQueues.delete(assetId);
1054
- return this.databaseStorage.updateAsset({
1053
+ const now = this.now();
1054
+ const received = {
1055
1055
  ...asset,
1056
- status: part.isFinal ? queue ? this.queuedStatus : this.analyzedStatus : "uploading",
1057
- uploadPartsReceived: part.partNumber,
1058
- updatedAt: this.now()
1059
- });
1056
+ processing: {
1057
+ ...asset.processing,
1058
+ uploadPartsReceived: part.partNumber
1059
+ },
1060
+ updatedAt: now
1061
+ };
1062
+ return this.databaseStorage.updateAsset(part.isFinal ? await this.applyOutcome(received, queue ? this.queuedOutcome : this.analyzedOutcome) : received);
1060
1063
  });
1061
1064
  },
1062
1065
  createSignedUrl: async (signedUrlOptions) => {
@@ -1089,13 +1092,9 @@ var MockCalmLensServerClient = class {
1089
1092
  retry: async (options) => {
1090
1093
  this.begin("assets.retry", options);
1091
1094
  const asset = await this.findOwnAsset(options?.assetId);
1092
- if (asset.status !== "error") throw this.apiError(require_CalmLensVersion.API_ERROR_CODES.ASSET_NOT_RETRYABLE);
1093
- if (asset.storageDeletedAt) throw this.apiError(require_CalmLensVersion.API_ERROR_CODES.ASSET_CONTENT_UNAVAILABLE);
1094
- return this.databaseStorage.updateAsset({
1095
- ...asset,
1096
- status: "pending",
1097
- updatedAt: this.now()
1098
- });
1095
+ if (asset.processing.status !== "failed") throw this.apiError(require_CalmLensVersion.API_ERROR_CODES.ASSET_NOT_RETRYABLE);
1096
+ if (asset.content.status === "removed") throw this.apiError(require_CalmLensVersion.API_ERROR_CODES.ASSET_CONTENT_UNAVAILABLE);
1097
+ return this.databaseStorage.updateAsset(await this.applyOutcome(asset, "pending"));
1099
1098
  },
1100
1099
  /** Waits like the real client, checking the mock's storage for a decision. */
1101
1100
  waitForDecision: async (options) => {
@@ -1107,11 +1106,17 @@ var MockCalmLensServerClient = class {
1107
1106
  this.begin("assets.deleteContent", options);
1108
1107
  const asset = await this.findOwnAsset(options?.assetId);
1109
1108
  await this.imageStorage.deleteContent(asset.id);
1109
+ const now = this.now();
1110
1110
  return this.databaseStorage.updateAsset({
1111
1111
  ...asset,
1112
- extractedText: null,
1113
- storageDeletedAt: asset.storageDeletedAt ?? this.now(),
1114
- updatedAt: this.now()
1112
+ content: asset.content.status === "removed" ? asset.content : {
1113
+ ...asset.content,
1114
+ status: "removed",
1115
+ removalReason: "requested",
1116
+ updatedAt: now,
1117
+ extractedText: null
1118
+ },
1119
+ updatedAt: now
1115
1120
  });
1116
1121
  },
1117
1122
  delete: async (options) => {
@@ -1295,6 +1300,7 @@ var MockCalmLensServerClient = class {
1295
1300
  const id = this.createId();
1296
1301
  const now = this.now();
1297
1302
  const isOpenUpload = "part" in options && !options.part.isFinal;
1303
+ const keepContent = options.processingOptions?.keepContentAfterProcessing === true;
1298
1304
  const asset = {
1299
1305
  id,
1300
1306
  projectId: this.projectId,
@@ -1307,11 +1313,37 @@ var MockCalmLensServerClient = class {
1307
1313
  externalUrl: "url" in options ? options.url : "content" in options ? options.externalUrl : void 0,
1308
1314
  type: inferAssetType(options),
1309
1315
  metadata: options.metadata,
1310
- status: isOpenUpload ? "uploading" : queue ? this.queuedStatus : this.analyzedStatus,
1311
1316
  processingOptions: options.processingOptions,
1312
1317
  visibility: options.visibility ?? "private",
1313
- sizeInBytes: this.getSizeInBytes(options),
1314
- uploadPartsReceived: "part" in options ? options.part.partNumber ?? 1 : void 0
1318
+ processing: {
1319
+ status: isOpenUpload ? "uploading" : "processing",
1320
+ updatedAt: now,
1321
+ uploadPartsReceived: "part" in options ? options.part.partNumber ?? 1 : null
1322
+ },
1323
+ moderation: {
1324
+ status: "pending",
1325
+ action: null,
1326
+ note: null,
1327
+ reviewerAction: null,
1328
+ reviewerNote: null,
1329
+ reviewerUserId: null,
1330
+ reviewedAt: null,
1331
+ decidedAt: null,
1332
+ report: null
1333
+ },
1334
+ content: {
1335
+ status: keepContent ? "stored" : "temporary",
1336
+ removalReason: null,
1337
+ updatedAt: now,
1338
+ safetyHold: null,
1339
+ format: this.getContentFormat(options),
1340
+ extension: null,
1341
+ sizeInBytes: this.getSizeInBytes(options) ?? null,
1342
+ checksums: null,
1343
+ image: null,
1344
+ previewImage: null,
1345
+ extractedText: null
1346
+ }
1315
1347
  };
1316
1348
  if ("content" in options) {
1317
1349
  if (!("plainText" in options.content)) await this.imageStorage.putContent(id, options.content);
@@ -1319,7 +1351,39 @@ var MockCalmLensServerClient = class {
1319
1351
  await this.imageStorage.putPart(id, options.part);
1320
1352
  if (isOpenUpload) this.uploadQueues.set(id, queue);
1321
1353
  }
1322
- return this.databaseStorage.createAsset(asset);
1354
+ return this.databaseStorage.createAsset(isOpenUpload ? asset : await this.applyOutcome(asset, queue ? this.queuedOutcome : this.analyzedOutcome));
1355
+ }
1356
+ /**
1357
+ * Moves an asset to `outcome` like the pipeline would: a decision finishes processing, and
1358
+ * finished processing removes content kept only temporarily (`keepContentAfterProcessing` off).
1359
+ */
1360
+ async applyOutcome(asset, outcome) {
1361
+ const now = this.now();
1362
+ const decided = outcome === "approved" || outcome === "rejected";
1363
+ const processingStatus = decided ? "done" : outcome === "failed" ? "failed" : "processing";
1364
+ const removeContent = processingStatus === "done" && asset.content.status === "temporary";
1365
+ if (removeContent) await this.imageStorage.deleteContent(asset.id);
1366
+ return {
1367
+ ...asset,
1368
+ updatedAt: now,
1369
+ processing: {
1370
+ ...asset.processing,
1371
+ status: processingStatus,
1372
+ updatedAt: now
1373
+ },
1374
+ moderation: {
1375
+ ...asset.moderation,
1376
+ status: decided ? outcome : "pending",
1377
+ decidedAt: decided ? now : null
1378
+ },
1379
+ content: removeContent ? {
1380
+ ...asset.content,
1381
+ status: "removed",
1382
+ removalReason: "retention",
1383
+ updatedAt: now,
1384
+ extractedText: null
1385
+ } : asset.content
1386
+ };
1323
1387
  }
1324
1388
  async resolveFolder(folderId) {
1325
1389
  if (!this.databaseStorage.getFolder) return void 0;
@@ -1336,6 +1400,11 @@ var MockCalmLensServerClient = class {
1336
1400
  async assertUniqueFolderName(name, parentId, excludeFolderId) {
1337
1401
  if ((this.databaseStorage.listFolders ? await this.databaseStorage.listFolders(this.projectId) : []).find((f) => f.id !== excludeFolderId && f.parentId === (parentId ?? null) && f.name === name)) throw this.apiError(require_CalmLensVersion.API_ERROR_CODES.DUPLICATE_FOLDER_NAME, { message: `A folder named "${name}" already exists in this location.` });
1338
1402
  }
1403
+ getContentFormat(options) {
1404
+ if ("content" in options) return options.content.type;
1405
+ if ("part" in options) return options.part.type;
1406
+ return null;
1407
+ }
1339
1408
  getSizeInBytes(options) {
1340
1409
  if ("content" in options) {
1341
1410
  if ("plainText" in options.content) return new TextEncoder().encode(options.content.plainText).byteLength;
@@ -1,5 +1,5 @@
1
- import { c as invalidArgument, o as CalmLensError, s as SDK_ERROR_CODES, u as API_ERROR_CODES } from "./CalmLensVersion-DK4BMEST.js";
2
- import { a as stringifyQuery, b as getRejectedUploadMimeTypeError, d as CalmLensTransport, g as validateAssetPayload, h as getAssetPayloadByteLength, i as randomUuid, m as assetToData, v as MAX_IMAGE_UPLOAD_BYTES, x as isRejectedUploadMimeType, y as MIN_MULTIPART_IMAGE_UPLOAD_BYTES } from "./CalmLensUtils-B4i3Z2He.js";
1
+ import { c as invalidArgument, o as CalmLensError, s as SDK_ERROR_CODES, u as API_ERROR_CODES } from "./CalmLensVersion-DPnL_Ebv.js";
2
+ import { a as stringifyQuery, b as getRejectedUploadMimeTypeError, d as CalmLensTransport, g as validateAssetPayload, h as getAssetPayloadByteLength, i as randomUuid, m as assetToData, v as MAX_IMAGE_UPLOAD_BYTES, x as isRejectedUploadMimeType, y as MIN_MULTIPART_IMAGE_UPLOAD_BYTES } from "./CalmLensUtils-BQo79TA1.js";
3
3
  //#region src/client/CalmLensConnection.ts
4
4
  const DEFAULT_TIMEOUT_MS = 12e4;
5
5
  const DEFAULT_MAX_RETRIES = 2;
@@ -62,7 +62,8 @@ const prepareSubmitAssetOptions = (options) => {
62
62
  const newIdempotencyKey = () => randomUuid();
63
63
  /** Text content is small, so it keeps the API deadline; binary files may be arbitrarily large. */
64
64
  const isTextPayload = (payload) => "plainText" in payload;
65
- const isAsset = (data) => !!data && typeof data === "object" && typeof data.id === "string" && !!data.id && typeof data.status === "string";
65
+ const hasStringStatus = (value) => !!value && typeof value === "object" && typeof value.status === "string";
66
+ const isAsset = (data) => !!data && typeof data === "object" && typeof data.id === "string" && !!data.id && hasStringStatus(data.processing) && hasStringStatus(data.moderation);
66
67
  const isUploadedAsset = (data) => !!data && typeof data === "object" && typeof data.id === "string" && !!data.id;
67
68
  const expectUploadedAsset = (data) => {
68
69
  if (!isUploadedAsset(data)) throw new CalmLensError(SDK_ERROR_CODES.INVALID_RESPONSE, {