calmlens 0.25.0 → 0.26.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -14
- package/bin/calmlens.js +2202 -521
- package/cjs/{BrowserUpload-AO2-2U5Z.js → BrowserUpload-DdkcoZLH.js} +1 -1
- package/{esm/BrowserUpload-D2lemMIU.d.ts → cjs/BrowserUpload-zYWKtFSs.d.ts} +2 -2
- package/cjs/{CalmLensAppClient-nv6qwja0.js → CalmLensAppClient-Gu9mU_66.js} +22 -15
- package/{esm/CalmLensAppClient-Dt0t9Bk6.d.ts → cjs/CalmLensAppClient-mTTjqpRc.d.ts} +5 -11
- package/cjs/{CalmLensOptionKeys-BvCac9NO.js → CalmLensOptionKeys-BCITGsr9.js} +138 -90
- package/cjs/CalmLensServerClient-D5-njsNk.d.ts +357 -0
- package/cjs/{CalmLensServerClient-B60kCBCR.js → CalmLensServerClient-DHmAPT1u.js} +283 -303
- package/cjs/{CalmLensTypes-BhR7LFDu.d.ts → CalmLensTypes-Df8eBgWB.d.ts} +127 -59
- package/cjs/{Core-DSMxC2GL.d.ts → Core-CREGGR0L.d.ts} +10 -3
- package/cjs/{Core-Cw4IxFUq.js → Core-DAf9lqe2.js} +30 -12
- package/{esm/ModerationContextLimits-Bqr0duav.js → cjs/ModerationContextLimits-D4iwqoN_.js} +858 -28
- package/cjs/{ReactUpload--oDFltw2.js → ReactUpload-BNIbpxIH.js} +38 -2
- package/cjs/ReactUpload-D4htIz8X.d.ts +27 -0
- package/cjs/{UploadController-ObdgTaBl.js → UploadController-B_lKxvpM.js} +16 -3
- package/cjs/{WebhookPayload-DLGGOGW6.d.ts → WebhookPayload-DMa6ihHr.d.ts} +152 -3
- package/cjs/app.d.ts +5 -5
- package/cjs/app.js +20 -2
- package/cjs/elements.d.ts +5 -5
- package/cjs/elements.js +102 -67
- package/cjs/{index-AAWuerkU.d.ts → index-CtpQldn_.d.ts} +2 -2
- package/cjs/index.d.ts +4 -4
- package/cjs/index.js +19 -1
- package/cjs/react-native.d.ts +3 -3
- package/cjs/react-native.js +6 -4
- package/cjs/react.d.ts +5 -4
- package/cjs/react.js +10 -14
- package/cjs/server.d.ts +5 -5
- package/cjs/server.js +20 -2
- package/cjs/testing.d.ts +11 -9
- package/cjs/testing.js +72 -41
- package/cjs/{ui-CcuGKTcL.d.ts → ui-BwFPFrno.d.ts} +2 -2
- package/cjs/{ui-CA16jyfZ.js → ui-CvlJmRYM.js} +6 -4
- package/cjs/ui.d.ts +3 -3
- package/cjs/ui.js +4 -3
- package/cjs/vue.d.ts +15 -8
- package/cjs/vue.js +29 -16
- package/esm/{BrowserUpload-Co4T6uGk.js → BrowserUpload-BAWYEBd7.js} +1 -1
- package/{cjs/BrowserUpload-D2lemMIU.d.ts → esm/BrowserUpload-zYWKtFSs.d.ts} +2 -2
- package/esm/{CalmLensAppClient-BRzy4dwn.js → CalmLensAppClient-DNkIZb6x.js} +22 -15
- package/{cjs/CalmLensAppClient-Dt0t9Bk6.d.ts → esm/CalmLensAppClient-mTTjqpRc.d.ts} +5 -11
- package/esm/{CalmLensOptionKeys-bE3rb5PN.js → CalmLensOptionKeys-CYHJo3nV.js} +133 -91
- package/esm/{CalmLensServerClient-_PRi90wI.js → CalmLensServerClient-B1AiR4nv.js} +283 -303
- package/esm/CalmLensServerClient-D5-njsNk.d.ts +357 -0
- package/esm/{CalmLensTypes-BhR7LFDu.d.ts → CalmLensTypes-Df8eBgWB.d.ts} +127 -59
- package/esm/{Core-DSMxC2GL.d.ts → Core-CREGGR0L.d.ts} +10 -3
- package/esm/{Core-CtbYmeXG.js → Core-xNBQxZWH.js} +30 -12
- package/{cjs/ModerationContextLimits-Cn9RvnZH.js → esm/ModerationContextLimits-DxuPP4uM.js} +475 -285
- package/esm/{ReactUpload-B5itHBSF.js → ReactUpload-BWifQdLv.js} +34 -4
- package/esm/ReactUpload-D4htIz8X.d.ts +27 -0
- package/esm/{UploadController-C7fL3Iz9.js → UploadController-jlJdddyI.js} +11 -4
- package/esm/{WebhookPayload-DLGGOGW6.d.ts → WebhookPayload-DMa6ihHr.d.ts} +152 -3
- package/esm/app.d.ts +5 -5
- package/esm/app.js +3 -3
- package/esm/elements.d.ts +5 -5
- package/esm/elements.js +102 -68
- package/esm/{index-AAWuerkU.d.ts → index-CtpQldn_.d.ts} +2 -2
- package/esm/index.d.ts +4 -4
- package/esm/index.js +1 -1
- package/esm/react-native.d.ts +3 -3
- package/esm/react-native.js +5 -5
- package/esm/react.d.ts +5 -4
- package/esm/react.js +9 -15
- package/esm/server.d.ts +5 -5
- package/esm/server.js +3 -3
- package/esm/styles.css +28 -10
- package/esm/svelte/CalmLensUploader.svelte +17 -17
- package/esm/svelte/context.js +21 -0
- package/esm/svelte/index.d.ts +12 -0
- package/esm/svelte/index.js +1 -0
- package/esm/testing.d.ts +11 -9
- package/esm/testing.js +72 -41
- package/esm/{ui-B98AucZA.js → ui-BXzzqh7M.js} +6 -4
- package/esm/{ui-CcuGKTcL.d.ts → ui-BwFPFrno.d.ts} +2 -2
- package/esm/ui.d.ts +3 -3
- package/esm/ui.js +4 -4
- package/esm/vue.d.ts +15 -8
- package/esm/vue.js +29 -18
- package/package.json +16 -6
- package/cjs/CalmLensServerClient-7XjQaeKu.d.ts +0 -353
- package/cjs/ReactUpload-CW4NzAsh.d.ts +0 -17
- package/esm/CalmLensServerClient-7XjQaeKu.d.ts +0 -353
- package/esm/ReactUpload-CW4NzAsh.d.ts +0 -17
|
@@ -1,6 +1,35 @@
|
|
|
1
|
-
const require_UploadController = require("./UploadController-
|
|
1
|
+
const require_UploadController = require("./UploadController-B_lKxvpM.js");
|
|
2
2
|
let react = require("react");
|
|
3
3
|
// src/ui/ReactUpload.ts
|
|
4
|
+
const CalmLensContext = (0, react.createContext)(void 0);
|
|
5
|
+
/**
|
|
6
|
+
* Gives every `CalmLensUploader` and `useCalmLensUpload` beneath it these upload options, such as
|
|
7
|
+
* `uploadPresetId` and `tokenUrl`, so they needn't be passed to each one. An option a component
|
|
8
|
+
* sets itself wins. A provider inside another adds to the outer one's options.
|
|
9
|
+
*/
|
|
10
|
+
function CalmLensProvider({ children, ...options }) {
|
|
11
|
+
const outer = (0, react.useContext)(CalmLensContext);
|
|
12
|
+
const { uploadPresetId, token, tokenUrl, baseUrl, createClient, upload, checkStatus } = options;
|
|
13
|
+
const value = (0, react.useMemo)(() => require_UploadController.withProvidedOptions(outer, {
|
|
14
|
+
uploadPresetId,
|
|
15
|
+
token,
|
|
16
|
+
tokenUrl,
|
|
17
|
+
baseUrl,
|
|
18
|
+
createClient,
|
|
19
|
+
upload,
|
|
20
|
+
checkStatus
|
|
21
|
+
}), [
|
|
22
|
+
outer,
|
|
23
|
+
uploadPresetId,
|
|
24
|
+
token,
|
|
25
|
+
tokenUrl,
|
|
26
|
+
baseUrl,
|
|
27
|
+
createClient,
|
|
28
|
+
upload,
|
|
29
|
+
checkStatus
|
|
30
|
+
]);
|
|
31
|
+
return (0, react.createElement)(CalmLensContext.Provider, { value }, children);
|
|
32
|
+
}
|
|
4
33
|
/** Re-renders with a controller's snapshot. */
|
|
5
34
|
const useUploadSnapshot = (controller) => {
|
|
6
35
|
const snapshot = (0, react.useSyncExternalStore)(controller.subscribe, controller.getSnapshot, controller.getSnapshot);
|
|
@@ -16,7 +45,8 @@ const useUploadSnapshot = (controller) => {
|
|
|
16
45
|
}), [snapshot, controller]);
|
|
17
46
|
};
|
|
18
47
|
/** A controller this component owns: it takes the latest options and cancels on unmount. */
|
|
19
|
-
const useOwnController = (
|
|
48
|
+
const useOwnController = (own, active = true) => {
|
|
49
|
+
const options = require_UploadController.withProvidedOptions((0, react.useContext)(CalmLensContext), own);
|
|
20
50
|
const [controller] = (0, react.useState)(() => require_UploadController.createUploadController(options));
|
|
21
51
|
if (active) controller.setOptions(options);
|
|
22
52
|
const pendingClear = (0, react.useRef)(void 0);
|
|
@@ -34,6 +64,12 @@ const useOwnController = (options, active = true) => {
|
|
|
34
64
|
* the component unmounts are cancelled.
|
|
35
65
|
*/
|
|
36
66
|
const useCalmLensUpload = (options) => useUploadSnapshot(useOwnController(options));
|
|
67
|
+
Object.defineProperty(exports, "CalmLensProvider", {
|
|
68
|
+
enumerable: true,
|
|
69
|
+
get: function() {
|
|
70
|
+
return CalmLensProvider;
|
|
71
|
+
}
|
|
72
|
+
});
|
|
37
73
|
Object.defineProperty(exports, "useCalmLensUpload", {
|
|
38
74
|
enumerable: true,
|
|
39
75
|
get: function() {
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { F as UploadFile, L as UploadSnapshot, N as UploadController, O as CalmLensProvidedOptions, P as UploadControllerOptions } from "./Core-CREGGR0L.js";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
type CalmLensProviderProps<F extends UploadFile = File> = CalmLensProvidedOptions<F> & {
|
|
4
|
+
children?: ReactNode;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Gives every `CalmLensUploader` and `useCalmLensUpload` beneath it these upload options, such as
|
|
8
|
+
* `uploadPresetId` and `tokenUrl`, so they needn't be passed to each one. An option a component
|
|
9
|
+
* sets itself wins. A provider inside another adds to the outer one's options.
|
|
10
|
+
*/
|
|
11
|
+
declare function CalmLensProvider<F extends UploadFile = File>({ children, ...options }: CalmLensProviderProps<F>): import("react").FunctionComponentElement<import("react").ProviderProps<CalmLensProvidedOptions<any> | undefined>>;
|
|
12
|
+
interface UseCalmLensUploadResult<F extends UploadFile = UploadFile> extends UploadSnapshot<F> {
|
|
13
|
+
controller: UploadController<F>;
|
|
14
|
+
addFiles: UploadController<F>["addFiles"];
|
|
15
|
+
retry: UploadController<F>["retry"];
|
|
16
|
+
cancel: UploadController<F>["cancel"];
|
|
17
|
+
remove: UploadController<F>["remove"];
|
|
18
|
+
clear: UploadController<F>["clear"];
|
|
19
|
+
start: UploadController<F>["start"];
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Uploads files through an upload preset and re-renders as each one uploads and is checked. Use
|
|
23
|
+
* it to build your own upload UI; `CalmLensUploader` is built on it. Uploads still running when
|
|
24
|
+
* the component unmounts are cancelled.
|
|
25
|
+
*/
|
|
26
|
+
declare const useCalmLensUpload: <F extends UploadFile = UploadFile>(options: UploadControllerOptions<F>) => UseCalmLensUploadResult<F>;
|
|
27
|
+
export { useCalmLensUpload as i, CalmLensProviderProps as n, UseCalmLensUploadResult as r, CalmLensProvider as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const require_ModerationContextLimits = require("./ModerationContextLimits-
|
|
2
|
-
const require_CalmLensAppClient = require("./CalmLensAppClient-
|
|
1
|
+
const require_ModerationContextLimits = require("./ModerationContextLimits-D4iwqoN_.js");
|
|
2
|
+
const require_CalmLensAppClient = require("./CalmLensAppClient-Gu9mU_66.js");
|
|
3
3
|
// src/contract/PlaceholderHashDecode.js
|
|
4
4
|
/**
|
|
5
5
|
* Decodes a ThumbHash to an RGBA image. RGB is not be premultiplied by A.
|
|
@@ -319,7 +319,7 @@ const checkedCustomUpload = (id, status) => ({
|
|
|
319
319
|
*/
|
|
320
320
|
const checkedPresetUpload = ({ id, classification }) => ({
|
|
321
321
|
id,
|
|
322
|
-
status: classification.moderation
|
|
322
|
+
status: classification.moderation ? classification.moderation.decision ?? "pending" : void 0,
|
|
323
323
|
settled: classification.status === "completed" || classification.status === "failed",
|
|
324
324
|
failed: classification.status === "failed"
|
|
325
325
|
});
|
|
@@ -618,6 +618,13 @@ var UploadController = class {
|
|
|
618
618
|
}
|
|
619
619
|
};
|
|
620
620
|
const createUploadController = (options) => new UploadController(options);
|
|
621
|
+
/** `options` over what a provider gives: an option an uploader sets (not `undefined`) wins. */
|
|
622
|
+
const withProvidedOptions = (provided, options) => {
|
|
623
|
+
if (!provided) return options;
|
|
624
|
+
const merged = { ...provided };
|
|
625
|
+
for (const [key, value] of Object.entries(options)) if (value !== void 0) merged[key] = value;
|
|
626
|
+
return merged;
|
|
627
|
+
};
|
|
621
628
|
Object.defineProperty(exports, "UploadController", {
|
|
622
629
|
enumerable: true,
|
|
623
630
|
get: function() {
|
|
@@ -648,3 +655,9 @@ Object.defineProperty(exports, "placeholderHashToDataURL", {
|
|
|
648
655
|
return placeholderHashToDataURL;
|
|
649
656
|
}
|
|
650
657
|
});
|
|
658
|
+
Object.defineProperty(exports, "withProvidedOptions", {
|
|
659
|
+
enumerable: true,
|
|
660
|
+
get: function() {
|
|
661
|
+
return withProvidedOptions;
|
|
662
|
+
}
|
|
663
|
+
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { cn as Actor, ln as EventAsset, un as TypedEvent } from "./CalmLensTypes-Df8eBgWB.js";
|
|
2
2
|
import * as zod from "zod";
|
|
3
3
|
/** Error codes the CalmLens API documents, by name. */
|
|
4
4
|
declare const API_ERROR_CODES: {
|
|
@@ -312,7 +312,14 @@ interface CalmLensErrorOptions {
|
|
|
312
312
|
headers?: Headers;
|
|
313
313
|
/** Seconds to wait before retrying, from the `Retry-After` response header. */
|
|
314
314
|
retryAfter?: number;
|
|
315
|
+
/** The response body as text, cut to its first 4 KiB, for API errors. */
|
|
316
|
+
body?: string;
|
|
315
317
|
}
|
|
318
|
+
/**
|
|
319
|
+
* What went wrong, from the most general: every kind is also its parent kind (`not-found` is an
|
|
320
|
+
* `api` error, `configuration` an `invalid-argument` error). Each has its own error class.
|
|
321
|
+
*/
|
|
322
|
+
type CalmLensErrorKind = "error" | "api" | "bad-request" | "authentication" | "permission-denied" | "not-found" | "conflict" | "payload-too-large" | "unprocessable-entity" | "rate-limit" | "server" | "connection" | "timeout" | "cancelled" | "invalid-argument" | "configuration" | "invalid-response" | "webhook-verification";
|
|
316
323
|
/**
|
|
317
324
|
* Every failure the SDK reports, whether the API returned an error or the request never
|
|
318
325
|
* completed. Branch on `code`; `status`, `requestId`, `headers` and `retryAfter` describe the
|
|
@@ -322,6 +329,12 @@ interface CalmLensErrorOptions {
|
|
|
322
329
|
* from any copy of the SDK, so they work when ESM and CommonJS builds are loaded side by side.
|
|
323
330
|
*/
|
|
324
331
|
declare class CalmLensError extends Error {
|
|
332
|
+
/** The kind this class is for; each kind's class sets its own. */
|
|
333
|
+
static readonly kind: CalmLensErrorKind;
|
|
334
|
+
/** What went wrong: one of `CalmLensErrorKind`, also its ancestors' (see `isKind`). */
|
|
335
|
+
readonly kind: CalmLensErrorKind;
|
|
336
|
+
/** The response body as text, cut to its first 4 KiB, for an API error; a proxy's HTML stays visible. */
|
|
337
|
+
readonly body?: string;
|
|
325
338
|
/** A stable identifier such as `asset/not-found` or `sdk/timeout`. */
|
|
326
339
|
readonly code: CalmLensErrorCode | (string & {});
|
|
327
340
|
/** The HTTP status, when the API responded. */
|
|
@@ -340,7 +353,15 @@ declare class CalmLensError extends Error {
|
|
|
340
353
|
}, options?: CalmLensErrorOptions);
|
|
341
354
|
/** True for any `CalmLensError`, including one created by another copy or build of the SDK. */
|
|
342
355
|
static isCalmLensError(value: unknown): value is CalmLensError;
|
|
343
|
-
|
|
356
|
+
/**
|
|
357
|
+
* `error instanceof CalmLensNotFoundError` (or any kind's class) is true for errors of that kind
|
|
358
|
+
* and its descendants, from any copy of the SDK.
|
|
359
|
+
*/
|
|
360
|
+
static [Symbol.hasInstance](this: {
|
|
361
|
+
kind: CalmLensErrorKind;
|
|
362
|
+
}, value: unknown): boolean;
|
|
363
|
+
/** Whether this error is of `kind` or a kind beneath it, such as `api` for a `not-found` error. */
|
|
364
|
+
isKind(kind: CalmLensErrorKind): boolean;
|
|
344
365
|
/**
|
|
345
366
|
* Whether the SDK raised this error itself, with no HTTP response: before sending (an invalid
|
|
346
367
|
* argument or option, or content it checks first, such as `upload/unsupported-type`), or because
|
|
@@ -358,6 +379,134 @@ declare class CalmLensError extends Error {
|
|
|
358
379
|
*/
|
|
359
380
|
isRetryable(): boolean;
|
|
360
381
|
}
|
|
382
|
+
/** The API, or a proxy in front of it, answered with a non-2xx status. */
|
|
383
|
+
declare class CalmLensApiError extends CalmLensError {
|
|
384
|
+
static readonly kind: CalmLensErrorKind;
|
|
385
|
+
}
|
|
386
|
+
/** HTTP 400: the request was invalid. */
|
|
387
|
+
declare class CalmLensBadRequestError extends CalmLensApiError {
|
|
388
|
+
static readonly kind: CalmLensErrorKind;
|
|
389
|
+
}
|
|
390
|
+
/** HTTP 401: the API key is missing or invalid. */
|
|
391
|
+
declare class CalmLensAuthenticationError extends CalmLensApiError {
|
|
392
|
+
static readonly kind: CalmLensErrorKind;
|
|
393
|
+
}
|
|
394
|
+
/** HTTP 403: the API key lacks a grant, or the viewer can't see the asset. */
|
|
395
|
+
declare class CalmLensPermissionDeniedError extends CalmLensApiError {
|
|
396
|
+
static readonly kind: CalmLensErrorKind;
|
|
397
|
+
}
|
|
398
|
+
/** HTTP 404: the resource doesn't exist or isn't visible to the API key. */
|
|
399
|
+
declare class CalmLensNotFoundError extends CalmLensApiError {
|
|
400
|
+
static readonly kind: CalmLensErrorKind;
|
|
401
|
+
}
|
|
402
|
+
/** HTTP 409: the request conflicts with the resource's state, such as a changed revision. */
|
|
403
|
+
declare class CalmLensConflictError extends CalmLensApiError {
|
|
404
|
+
static readonly kind: CalmLensErrorKind;
|
|
405
|
+
}
|
|
406
|
+
/** HTTP 413: the content is over a size limit. */
|
|
407
|
+
declare class CalmLensPayloadTooLargeError extends CalmLensApiError {
|
|
408
|
+
static readonly kind: CalmLensErrorKind;
|
|
409
|
+
}
|
|
410
|
+
/** HTTP 422: the content can't be processed. */
|
|
411
|
+
declare class CalmLensUnprocessableEntityError extends CalmLensApiError {
|
|
412
|
+
static readonly kind: CalmLensErrorKind;
|
|
413
|
+
}
|
|
414
|
+
/** HTTP 429: too many requests; `retryAfter` says how long to wait. */
|
|
415
|
+
declare class CalmLensRateLimitError extends CalmLensApiError {
|
|
416
|
+
static readonly kind: CalmLensErrorKind;
|
|
417
|
+
}
|
|
418
|
+
/** HTTP 500 or above: the API failed. */
|
|
419
|
+
declare class CalmLensServerError extends CalmLensApiError {
|
|
420
|
+
static readonly kind: CalmLensErrorKind;
|
|
421
|
+
}
|
|
422
|
+
/** No complete response: the connection failed or was cut (`sdk/transport-error`). */
|
|
423
|
+
declare class CalmLensConnectionError extends CalmLensError {
|
|
424
|
+
static readonly kind: CalmLensErrorKind;
|
|
425
|
+
}
|
|
426
|
+
/** A request took longer than its timeout, or a wait reached its deadline (`sdk/timeout`). */
|
|
427
|
+
declare class CalmLensTimeoutError extends CalmLensError {
|
|
428
|
+
static readonly kind: CalmLensErrorKind;
|
|
429
|
+
}
|
|
430
|
+
/** The caller cancelled the call through a signal (`sdk/cancelled`). */
|
|
431
|
+
declare class CalmLensCancelledError extends CalmLensError {
|
|
432
|
+
static readonly kind: CalmLensErrorKind;
|
|
433
|
+
}
|
|
434
|
+
/** The SDK refused the call before sending anything. */
|
|
435
|
+
declare class CalmLensInvalidArgumentError extends CalmLensError {
|
|
436
|
+
static readonly kind: CalmLensErrorKind;
|
|
437
|
+
}
|
|
438
|
+
/** The client's configuration is invalid (`sdk/invalid-config`, `sdk/no-fetch`). */
|
|
439
|
+
declare class CalmLensConfigurationError extends CalmLensInvalidArgumentError {
|
|
440
|
+
static readonly kind: CalmLensErrorKind;
|
|
441
|
+
}
|
|
442
|
+
/** A response wasn't what the operation returns (`sdk/invalid-response`, `sdk/response-too-large`). */
|
|
443
|
+
declare class CalmLensInvalidResponseError extends CalmLensError {
|
|
444
|
+
static readonly kind: CalmLensErrorKind;
|
|
445
|
+
}
|
|
446
|
+
/** A webhook delivery couldn't be verified or parsed. */
|
|
447
|
+
declare class CalmLensWebhookVerificationError extends CalmLensError {
|
|
448
|
+
static readonly kind: CalmLensErrorKind;
|
|
449
|
+
}
|
|
450
|
+
/** The HTTP response a successful call's result came from. */
|
|
451
|
+
interface CalmLensLastResponse {
|
|
452
|
+
/** The HTTP status, such as 200 or 201. */
|
|
453
|
+
readonly status: number;
|
|
454
|
+
/** The `x-request-id` header: quote it when you contact support about this request. */
|
|
455
|
+
readonly requestId?: string;
|
|
456
|
+
/** The response headers. */
|
|
457
|
+
readonly headers: Headers;
|
|
458
|
+
/** The `Idempotency-Key` the request was sent with, if any. */
|
|
459
|
+
readonly idempotencyKey?: string;
|
|
460
|
+
}
|
|
461
|
+
/**
|
|
462
|
+
* A call's result with the response it came from as `lastResponse`. `lastResponse` is not
|
|
463
|
+
* enumerable, so `JSON.stringify`, spreading and `Object.keys` leave it out.
|
|
464
|
+
*/
|
|
465
|
+
type CalmLensResponse<T> = T & {
|
|
466
|
+
readonly lastResponse: CalmLensLastResponse;
|
|
467
|
+
};
|
|
468
|
+
/** The most items `autoPagingToArray` collects; iterate with `for await` for more. */
|
|
469
|
+
declare const AUTO_PAGING_TO_ARRAY_MAX = 10000;
|
|
470
|
+
interface AutoPagingToArrayOptions {
|
|
471
|
+
/** How many items to collect at most, from 1 to 10,000. */
|
|
472
|
+
limit: number;
|
|
473
|
+
}
|
|
474
|
+
/** The fields every cursor-paginated list response has. */
|
|
475
|
+
interface CursorPageData<Item> {
|
|
476
|
+
items: Item[];
|
|
477
|
+
nextCursor: string | null;
|
|
478
|
+
hasMore: boolean;
|
|
479
|
+
}
|
|
480
|
+
/** Walking from a page: every item of it and of the pages after it. */
|
|
481
|
+
interface AutoPaging<Item> extends AsyncIterable<Item> {
|
|
482
|
+
/** Collects items from this page onward, fetching pages as needed, until `limit` are found. */
|
|
483
|
+
autoPagingToArray(options: AutoPagingToArrayOptions): Promise<Item[]>;
|
|
484
|
+
}
|
|
485
|
+
/**
|
|
486
|
+
* One page of a list, as the API returned it, with page navigation. `for await` over the page
|
|
487
|
+
* yields its items and every item after them, fetching pages as needed.
|
|
488
|
+
*/
|
|
489
|
+
type ListPage<Page extends CursorPageData<unknown>> = CalmLensResponse<Page> & AutoPaging<Page["items"][number]> & {
|
|
490
|
+
/** Whether a page follows this one. */
|
|
491
|
+
hasNextPage(): boolean;
|
|
492
|
+
/** Fetches the page after this one; fails with `sdk/invalid-argument` when there is none. */
|
|
493
|
+
getNextPage(): ListPromise<Page>;
|
|
494
|
+
};
|
|
495
|
+
/**
|
|
496
|
+
* What `list` methods return: await it for the first page, or `for await` over it for every item
|
|
497
|
+
* across pages. The cursor keeps the position stable when items are inserted or deleted.
|
|
498
|
+
*/
|
|
499
|
+
interface ListPromise<Page extends CursorPageData<unknown>> extends Promise<ListPage<Page>>, AutoPaging<Page["items"][number]> {}
|
|
500
|
+
/** Pixel dimensions of the representation served by the CDN. */
|
|
501
|
+
interface ServedAssetInfo {
|
|
502
|
+
readonly width: number;
|
|
503
|
+
readonly height: number;
|
|
504
|
+
}
|
|
505
|
+
interface CdnResponse extends Response {
|
|
506
|
+
/** Reads the served image dimensions from the headers without consuming the body. */
|
|
507
|
+
getAssetInfo(): ServedAssetInfo | undefined;
|
|
508
|
+
clone(): CdnResponse;
|
|
509
|
+
}
|
|
361
510
|
/** A webhook body; narrow on `type` to get typed `facts`. */
|
|
362
511
|
type WebhookEventPayload = TypedEvent;
|
|
363
512
|
/** Consumer boundary: future event types, facts and fields must not break installed clients. */
|
|
@@ -409,4 +558,4 @@ interface ReceivedWebhookEventPayload {
|
|
|
409
558
|
facts?: ReceivedFact;
|
|
410
559
|
[key: string]: unknown;
|
|
411
560
|
}
|
|
412
|
-
export {
|
|
561
|
+
export { CalmLensRateLimitError as A, CalmLensErrorKind as C, CalmLensNotFoundError as D, CalmLensInvalidResponseError as E, SdkErrorCode as F, ApiErrorCode as I, CalmLensTimeoutError as M, CalmLensUnprocessableEntityError as N, CalmLensPayloadTooLargeError as O, CalmLensWebhookVerificationError as P, CalmLensErrorDetails as S, CalmLensInvalidArgumentError as T, CalmLensConfigurationError as _, AUTO_PAGING_TO_ARRAY_MAX as a, CalmLensError as b, CalmLensLastResponse as c, ListPromise as d, CALMLENS_ERROR_CODES as f, CalmLensCancelledError as g, CalmLensBadRequestError as h, ServedAssetInfo as i, CalmLensServerError as j, CalmLensPermissionDeniedError as k, CalmLensResponse as l, CalmLensAuthenticationError as m, WebhookEventPayload as n, AutoPaging as o, CalmLensApiError as p, CdnResponse as r, AutoPagingToArrayOptions as s, ReceivedWebhookEventPayload as t, ListPage as u, CalmLensConflictError as v, CalmLensErrorOptions as w, CalmLensErrorCode as x, CalmLensConnectionError as y };
|
package/cjs/app.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as ClassificationNotEvaluatedReason, c as ModerationQualifier, d as HashListEntry, f as ModerationContext, g as selectModerationContextItems, h as ModerationContextItem, i as ClassificationCategoryReport, l as PolicyAction, m as MODERATION_CONTEXT_USED_ITEMS, n as ClassificationCategories, o as ClassificationQualifierResults, p as MODERATION_CONTEXT_USED_CHARACTERS, r as ClassificationCategory, s as Likelihood, u as HashList } from "./Classification-CxRedzgH-C9qlYW_J.js";
|
|
2
|
-
import { $ as
|
|
3
|
-
import { t as CalmLensAppClient } from "./CalmLensAppClient-
|
|
4
|
-
import { i as getAssetInfo, n as DEFAULT_CDN_BASE_URL, r as CDN_RESOURCES, t as SDK_VERSION } from "./index-
|
|
5
|
-
import { a as
|
|
6
|
-
export { type AddHashListEntryOptions, type AgeRange, type ApiErrorCode, type Asset, type AssetAvailability, type AssetBatchOperation, type AssetChecksums, type AssetChildrenPage, type AssetClassification, type AssetClassificationFailureReason, type AssetClassificationStatus, type AssetContent, type AssetContentOptions, type AssetContentRemovalReason, type AssetContentStatus, type AssetHls, type AssetHlsRendition, type AssetInfo, type AssetModeration, type AssetModerationDecision, type AssetModerationStatus, type AssetPage, type AssetPreview, type AssetRendered, type AssetRenderedKind, type AssetSafetyHold, type AssetSafetyHoldReason, type AssetSearchMatchField, type AssetSearchQuery, type AssetSearchResponse, type AssetSearchResult, type AssetTimelinePage, type AssetTimelineSegment, type AssetType, type AssetUpload, type AssetUploadStatus, type AssetVisibility, type AssignPolicyOptions, type BatchAssetsOptions, type BatchAssetsResponse, type BoundingBox, CALMLENS_ERROR_CODES, CDN_RESOURCES, CalmLensAppClient, type CalmLensAppClientOptions, CalmLensError, type CalmLensErrorCode, type CalmLensErrorDetails, type CalmLensErrorOptions, type CalmLensServerClientOptions, type CdnAssetLocation, type CdnAssetReference, type CdnAssetUrlOptions, type CdnResource, type CdnServeOptions, type CdnTransform, type ClassificationCategories, type ClassificationCategory, type ClassificationCategoryReport, type ClassificationNotEvaluatedReason, type ClassificationQualifierResults, type ClassifyTextOptions, type ConnectionOptions, type CreateFolderOptions, type CreateHashListOptions, type CreateLensOptions, type CreateMultipartUploadPartOptions, type CreatePolicyOptions, type CursorPage, DEFAULT_CDN_BASE_URL, type DecideAssetOptions, type DeleteAssetOptions, type DeleteMetadataFieldOptions, type DetectedFace, type DetectedPerson, type EnsureLensOptions, type EnsureLensesOptions, type EnsureMetadataFieldsOptions, type EnsureUploadPresetsOptions, type EnsureUploadPresetsResponse, type EventAsset, type EventCategory, type EventFact, type EventFactValues, type EventFacts, type EventSeverity, type EventType, type GetEventsResponse as EventsPage, type ExplainAssetOptions, type ExtractedText, type FileMetadata, type Folder, type FolderIdOptions, type FolderPage, type GetAssetInfoOptions, type HashList, type HashListEntry, type HashListEntryIdOptions, type HashListEntryPage, type HashListIdOptions, type HashListPage, type IdempotencyOptions, type ImageTransformOptions, type
|
|
2
|
+
import { $ as FolderIdOptions, $t as UploadedAsset, A as CdnAssetLocation, An as ProcessingFeatures, At as ResetPolicyOptions, B as CreateHashListOptions, Bn as AssetPreview, Bt as SubmitAssetOptions, C as AssetUploadStatus, Cn as AgeRange, Ct as MultipartUploadOptions, D as BatchAssetsResponse, Dn as ProcessingFeatureId, Dt as RemoveAssetContentOptions, E as BatchAssetsOptions, En as DetectedPerson, Et as PolicyPage, F as CdnTransform, Fn as AssetSearchQuery, Ft as SignAssetUrlOptions, G as DeleteAssetOptions, Gn as ExtractedText, Gt as UpdatePolicyOptions, H as CreateMultipartUploadPartOptions, Hn as AssetRenderedKind, Ht as UpdateFolderOptions, I as ClassifyTextOptions, It as SignUploadTokenOptions, J as EnsureLensesOptions, Jn as ProcessingOptions, Jt as UploadAssetPartOptions, K as DeleteMetadataFieldOptions, Kn as FileMetadata, Kt as UpdateProjectSettingsOptions, L as ClientRequestDefaults, Ln as AssetInfo, Lt as SignedAssetUrl, M as CdnAssetUrlOptions, Mn as CursorPage, Mt as RetryAssetOptions, N as CdnResource, Nn as LensType, Nt as SearchAssetsOptions, O as CalmLensAppClientOptions, On as ProcessingFeatureResults, Ot as RequestAttempt, P as CdnServeOptions, Pn as AssetSearchMatchField, Pt as SetPolicyAutomaticUpdatesOptions, Q as ExplainAssetOptions, Qt as UploadPresetSubmitAssetOptions, R as ConnectionOptions, Rn as AssetHls, Rt as SignedUploadToken, S as AssetUpload, Sn as UploadPreset, St as MoveFolderOptions, T as AssignPolicyOptions, Tn as DetectedFace, Tt as PolicyIdOptions, U as CreatePolicyOptions, Un as AssetSafetyHold, Ut as UpdateHashListOptions, V as CreateLensOptions, Vn as AssetRendered, Vt as UpdateAssetOptions, W as DecideAssetOptions, Wn as AssetSafetyHoldReason, Wt as UpdateLensOptions, X as EnsureUploadPresetsOptions, Xt as UploadPresetIdOptions, Y as EnsureMetadataFieldsOptions, Yt as UploadPresetDefinition, Z as EnsureUploadPresetsResponse, Zt as UploadPresetPage, _ as AssetPage, _t as ListHashListsOptions, a as AssetChecksums, an as AssetBatchOperation, at as HashListPage, b as AssetTimelinePage, bn as ProjectSettingsResource, bt as ListUploadPresetsOptions, c as AssetClassificationFailureReason, ct as Lens, d as AssetContentOptions, dn as EventCategory, dt as ListAssetChildrenOptions, en as VerifyWebhookSignatureOptions, et as FolderPage, f as AssetContentRemovalReason, fn as EventFact, ft as ListAssetTimelineOptions, g as AssetModerationStatus, gn as EventType, gt as ListHashListEntriesOptions, h as AssetModerationDecision, hn as EventSeverity, ht as ListFoldersOptions, i as AssetAvailability, in as WebhookPayloadInput, it as HashListIdOptions, j as CdnAssetReference, jn as Policy, jt as RetrieveAssetOptions, k as CalmLensServerClientOptions, kn as ProcessingFeatureStage, kt as RequestOptions, l as AssetClassificationStatus, ln as EventAsset, lt as LensIdOptions, m as AssetModeration, mn as EventFacts, mt as ListEventsOptions, n as AppInfo, nn as WaitForAssetDecisionOptions, nt as HashListEntryIdOptions, o as AssetChildrenPage, on as AssetTimelineSegment, ot as IdempotencyOptions, p as AssetContentStatus, pn as EventFactValues, pt as ListAssetsOptions, q as EnsureLensOptions, qn as MetadataItem, qt as UpgradePolicyOptions, r as Asset, rn as WebhookHeadersInput, rt as HashListEntryPage, s as AssetClassification, sn as GetEventsResponse, st as ImageTransformOptions, t as AddHashListEntryOptions, tn as ViewerClaims, tt as GetAssetInfoOptions, u as AssetContent, un as TypedEvent, ut as LensPage, v as AssetSearchResponse, vn as Folder, vt as ListLensesOptions, w as AssetVisibility, wn as BoundingBox, wt as MultipartUploadPartOptions, x as AssetType, xn as PublicProjectSettings, xt as MoveAssetOptions, y as AssetSearchResult, yn as MetadataFieldsResource, yt as ListPoliciesOptions, z as CreateFolderOptions, zn as AssetHlsRendition, zt as StreamingFeatureOptions } from "./CalmLensTypes-Df8eBgWB.js";
|
|
3
|
+
import { t as CalmLensAppClient } from "./CalmLensAppClient-mTTjqpRc.js";
|
|
4
|
+
import { i as getAssetInfo, n as DEFAULT_CDN_BASE_URL, r as CDN_RESOURCES, t as SDK_VERSION } from "./index-CtpQldn_.js";
|
|
5
|
+
import { A as CalmLensRateLimitError, C as CalmLensErrorKind, D as CalmLensNotFoundError, E as CalmLensInvalidResponseError, F as SdkErrorCode, I as ApiErrorCode, M as CalmLensTimeoutError, N as CalmLensUnprocessableEntityError, O as CalmLensPayloadTooLargeError, P as CalmLensWebhookVerificationError, S as CalmLensErrorDetails, T as CalmLensInvalidArgumentError, _ as CalmLensConfigurationError, a as AUTO_PAGING_TO_ARRAY_MAX, b as CalmLensError, c as CalmLensLastResponse, d as ListPromise, f as CALMLENS_ERROR_CODES, g as CalmLensCancelledError, h as CalmLensBadRequestError, i as ServedAssetInfo, j as CalmLensServerError, k as CalmLensPermissionDeniedError, l as CalmLensResponse, m as CalmLensAuthenticationError, o as AutoPaging, p as CalmLensApiError, r as CdnResponse, s as AutoPagingToArrayOptions, t as ReceivedWebhookEventPayload, u as ListPage, v as CalmLensConflictError, w as CalmLensErrorOptions, x as CalmLensErrorCode, y as CalmLensConnectionError } from "./WebhookPayload-DMa6ihHr.js";
|
|
6
|
+
export { AUTO_PAGING_TO_ARRAY_MAX, type AddHashListEntryOptions, type AgeRange, type ApiErrorCode, type AppInfo, type Asset, type AssetAvailability, type AssetBatchOperation, type AssetChecksums, type AssetChildrenPage, type AssetClassification, type AssetClassificationFailureReason, type AssetClassificationStatus, type AssetContent, type AssetContentOptions, type AssetContentRemovalReason, type AssetContentStatus, type AssetHls, type AssetHlsRendition, type AssetInfo, type AssetModeration, type AssetModerationDecision, type AssetModerationStatus, type AssetPage, type AssetPreview, type AssetRendered, type AssetRenderedKind, type AssetSafetyHold, type AssetSafetyHoldReason, type AssetSearchMatchField, type AssetSearchQuery, type AssetSearchResponse, type AssetSearchResult, type AssetTimelinePage, type AssetTimelineSegment, type AssetType, type AssetUpload, type AssetUploadStatus, type AssetVisibility, type AssignPolicyOptions, type AutoPaging, type AutoPagingToArrayOptions, type BatchAssetsOptions, type BatchAssetsResponse, type BoundingBox, CALMLENS_ERROR_CODES, CDN_RESOURCES, CalmLensApiError, CalmLensAppClient, type CalmLensAppClientOptions, CalmLensAuthenticationError, CalmLensBadRequestError, CalmLensCancelledError, CalmLensConfigurationError, CalmLensConflictError, CalmLensConnectionError, CalmLensError, type CalmLensErrorCode, type CalmLensErrorDetails, type CalmLensErrorKind, type CalmLensErrorOptions, CalmLensInvalidArgumentError, CalmLensInvalidResponseError, type CalmLensLastResponse, CalmLensNotFoundError, CalmLensPayloadTooLargeError, CalmLensPermissionDeniedError, CalmLensRateLimitError, type CalmLensResponse, type CalmLensServerClientOptions, CalmLensServerError, CalmLensTimeoutError, CalmLensUnprocessableEntityError, CalmLensWebhookVerificationError, type CdnAssetLocation, type CdnAssetReference, type CdnAssetUrlOptions, type CdnResource, type CdnResponse, type CdnServeOptions, type CdnTransform, type ClassificationCategories, type ClassificationCategory, type ClassificationCategoryReport, type ClassificationNotEvaluatedReason, type ClassificationQualifierResults, type ClassifyTextOptions, type ClientRequestDefaults, type ConnectionOptions, type CreateFolderOptions, type CreateHashListOptions, type CreateLensOptions, type CreateMultipartUploadPartOptions, type CreatePolicyOptions, type CursorPage, DEFAULT_CDN_BASE_URL, type DecideAssetOptions, type DeleteAssetOptions, type DeleteMetadataFieldOptions, type DetectedFace, type DetectedPerson, type EnsureLensOptions, type EnsureLensesOptions, type EnsureMetadataFieldsOptions, type EnsureUploadPresetsOptions, type EnsureUploadPresetsResponse, type EventAsset, type EventCategory, type EventFact, type EventFactValues, type EventFacts, type EventSeverity, type EventType, type GetEventsResponse as EventsPage, type ExplainAssetOptions, type ExtractedText, type FileMetadata, type Folder, type FolderIdOptions, type FolderPage, type GetAssetInfoOptions, type HashList, type HashListEntry, type HashListEntryIdOptions, type HashListEntryPage, type HashListIdOptions, type HashListPage, type IdempotencyOptions, type ImageTransformOptions, type Lens, type LensIdOptions, type LensPage, type LensType, type Likelihood, type ListAssetChildrenOptions, type ListAssetTimelineOptions, type ListAssetsOptions, type ListEventsOptions, type ListFoldersOptions, type ListHashListEntriesOptions, type ListHashListsOptions, type ListLensesOptions, type ListPage, type ListPoliciesOptions, type ListPromise, type ListUploadPresetsOptions, MODERATION_CONTEXT_USED_CHARACTERS, MODERATION_CONTEXT_USED_ITEMS, type MetadataFieldsResource, type MetadataItem, type ModerationContext, type ModerationContextItem, type ModerationQualifier, type MoveAssetOptions, type MoveFolderOptions, type MultipartUploadOptions, type MultipartUploadPartOptions, type Policy, type PolicyAction, type PolicyIdOptions, type PolicyPage, type ProcessingFeatureId, type ProcessingFeatureResults, type ProcessingFeatureStage, type ProcessingFeatures, type ProcessingOptions, type ProjectSettingsResource, type PublicProjectSettings, type RemoveAssetContentOptions, type RequestAttempt, type RequestOptions, type ResetPolicyOptions, type RetrieveAssetOptions, type RetryAssetOptions, SDK_VERSION, type SdkErrorCode, type SearchAssetsOptions, type ServedAssetInfo, type SetPolicyAutomaticUpdatesOptions, type SignAssetUrlOptions, type SignUploadTokenOptions, type SignedAssetUrl, type SignedUploadToken, type StreamingFeatureOptions, type SubmitAssetOptions, type TypedEvent, type UpdateAssetOptions, type UpdateFolderOptions, type UpdateHashListOptions, type UpdateLensOptions, type UpdatePolicyOptions, type UpdateProjectSettingsOptions, type UpgradePolicyOptions, type UploadAssetPartOptions, type UploadPreset, type UploadPresetDefinition, type UploadPresetIdOptions, type UploadPresetPage, type UploadPresetSubmitAssetOptions, type UploadedAsset, type VerifyWebhookSignatureOptions, type ViewerClaims, type WaitForAssetDecisionOptions, type ReceivedWebhookEventPayload as WebhookEventPayload, type WebhookHeadersInput, type WebhookPayloadInput, getAssetInfo, selectModerationContextItems };
|
package/cjs/app.js
CHANGED
|
@@ -1,11 +1,29 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_ModerationContextLimits = require("./ModerationContextLimits-
|
|
2
|
+
const require_ModerationContextLimits = require("./ModerationContextLimits-D4iwqoN_.js");
|
|
3
3
|
require("./index.js");
|
|
4
|
-
const require_CalmLensAppClient = require("./CalmLensAppClient-
|
|
4
|
+
const require_CalmLensAppClient = require("./CalmLensAppClient-Gu9mU_66.js");
|
|
5
|
+
exports.AUTO_PAGING_TO_ARRAY_MAX = require_ModerationContextLimits.AUTO_PAGING_TO_ARRAY_MAX;
|
|
5
6
|
exports.CALMLENS_ERROR_CODES = require_ModerationContextLimits.CALMLENS_ERROR_CODES;
|
|
6
7
|
exports.CDN_RESOURCES = require_ModerationContextLimits.CDN_RESOURCES;
|
|
8
|
+
exports.CalmLensApiError = require_ModerationContextLimits.CalmLensApiError;
|
|
7
9
|
exports.CalmLensAppClient = require_CalmLensAppClient.CalmLensAppClient;
|
|
10
|
+
exports.CalmLensAuthenticationError = require_ModerationContextLimits.CalmLensAuthenticationError;
|
|
11
|
+
exports.CalmLensBadRequestError = require_ModerationContextLimits.CalmLensBadRequestError;
|
|
12
|
+
exports.CalmLensCancelledError = require_ModerationContextLimits.CalmLensCancelledError;
|
|
13
|
+
exports.CalmLensConfigurationError = require_ModerationContextLimits.CalmLensConfigurationError;
|
|
14
|
+
exports.CalmLensConflictError = require_ModerationContextLimits.CalmLensConflictError;
|
|
15
|
+
exports.CalmLensConnectionError = require_ModerationContextLimits.CalmLensConnectionError;
|
|
8
16
|
exports.CalmLensError = require_ModerationContextLimits.CalmLensError;
|
|
17
|
+
exports.CalmLensInvalidArgumentError = require_ModerationContextLimits.CalmLensInvalidArgumentError;
|
|
18
|
+
exports.CalmLensInvalidResponseError = require_ModerationContextLimits.CalmLensInvalidResponseError;
|
|
19
|
+
exports.CalmLensNotFoundError = require_ModerationContextLimits.CalmLensNotFoundError;
|
|
20
|
+
exports.CalmLensPayloadTooLargeError = require_ModerationContextLimits.CalmLensPayloadTooLargeError;
|
|
21
|
+
exports.CalmLensPermissionDeniedError = require_ModerationContextLimits.CalmLensPermissionDeniedError;
|
|
22
|
+
exports.CalmLensRateLimitError = require_ModerationContextLimits.CalmLensRateLimitError;
|
|
23
|
+
exports.CalmLensServerError = require_ModerationContextLimits.CalmLensServerError;
|
|
24
|
+
exports.CalmLensTimeoutError = require_ModerationContextLimits.CalmLensTimeoutError;
|
|
25
|
+
exports.CalmLensUnprocessableEntityError = require_ModerationContextLimits.CalmLensUnprocessableEntityError;
|
|
26
|
+
exports.CalmLensWebhookVerificationError = require_ModerationContextLimits.CalmLensWebhookVerificationError;
|
|
9
27
|
exports.DEFAULT_CDN_BASE_URL = require_ModerationContextLimits.DEFAULT_CDN_BASE_URL;
|
|
10
28
|
exports.MODERATION_CONTEXT_USED_CHARACTERS = require_ModerationContextLimits.MODERATION_CONTEXT_USED_CHARACTERS;
|
|
11
29
|
exports.MODERATION_CONTEXT_USED_ITEMS = require_ModerationContextLimits.MODERATION_CONTEXT_USED_ITEMS;
|
package/cjs/elements.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { $ as
|
|
3
|
-
import { a as UploaderProps, i as UploadSnapshot, n as UploadControllerOptions, r as UploadItem, s as createUploadController, t as CalmLensUpload } from "./BrowserUpload-
|
|
4
|
-
import { C as ViewerState, S as AssetViewer, _ as spreadsheetColumnIndex, a as isMountedViewerKind, b as createWebsiteViewer, c as AssetViewerOptionsByKind, d as createTextViewer, f as SpreadsheetCell, g as parseSpreadsheetText, h as getSpreadsheetPage, i as getMountedViewerOptions, l as VIEWER_STYLES, m as SpreadsheetSheet, n as AssetViewerMount, o as ASSET_VIEWERS, p as SpreadsheetRow, r as MountedViewerKind, s as AssetViewerName, t as MediaStreamPlayer, u as createSpreadsheetViewer, v as loadPdfJs, x as createDocumentViewer, y as createImageViewer } from "./ui-
|
|
1
|
+
import { i as AssetAvailability } from "./CalmLensTypes-Df8eBgWB.js";
|
|
2
|
+
import { $ as getAssetAspectRatio, A as CustomUploadContext, B as isFileAccepted, C as formatMessage, D as resolveMessages, E as getUploadItemOutcome, F as UploadFile, G as AssetImageSource, H as AssetDisplay, J as AssetSessionState, K as AssetOptions, M as UploadClient, N as UploadController, O as CalmLensProvidedOptions, Q as MediaPlayback, R as UploadStage, S as formatBytes, T as getUploadItemMessage, U as AssetDocumentOptions, V as withProvidedOptions, W as AssetImageOptions, X as AssetVideoOptions, Y as AssetSpreadsheetOptions, Z as AssetView, _ as DEFAULT_MESSAGES, _t as DEFAULT_VIEWER_MESSAGES, a as ProgressFetchOptions, at as AssetViewerKind, b as describeUploadItem, bt as resolveViewerMessages, c as ICON_ATTRIBUTES, ct as PdfAssetOptions, d as AssetDisplayOptions, dt as ViewerAsset, et as getAssetView, f as AssetEventHandlers, ft as ViewerOptions, g as CalmLensMessages, gt as isSpreadsheetFormat, ht as getAssetViewerKind, i as CALMLENS_STYLES, it as pickAssetSource, j as CustomUploadResult, l as IconName, lt as SpreadsheetViewerOptions, m as UploaderDisplayOptions, mt as WebsiteViewerOptions, n as CalmLensTheme, nt as getPeakHeights, o as createProgressFetch, ot as DocumentViewerOptions, p as AssetProps, pt as ViewerTextOptions, q as AssetSession, r as resolveTheme, rt as getPlayedPercent, s as ICONS, st as ImageViewerOptions, t as CALMLENS_THEME, tt as getAssetViewKey, u as ASSET_FILE_ICON_SIZE, ut as TextViewerOptions, v as UploadItemView, vt as ViewerMessages, w as getDropzoneHint, x as describeUploader, y as UploaderView, yt as formatViewerMessage } from "./Core-CREGGR0L.js";
|
|
3
|
+
import { a as UploaderProps, i as UploadSnapshot, n as UploadControllerOptions, r as UploadItem, s as createUploadController, t as CalmLensUpload } from "./BrowserUpload-zYWKtFSs.js";
|
|
4
|
+
import { C as ViewerState, S as AssetViewer, _ as spreadsheetColumnIndex, a as isMountedViewerKind, b as createWebsiteViewer, c as AssetViewerOptionsByKind, d as createTextViewer, f as SpreadsheetCell, g as parseSpreadsheetText, h as getSpreadsheetPage, i as getMountedViewerOptions, l as VIEWER_STYLES, m as SpreadsheetSheet, n as AssetViewerMount, o as ASSET_VIEWERS, p as SpreadsheetRow, r as MountedViewerKind, s as AssetViewerName, t as MediaStreamPlayer, u as createSpreadsheetViewer, v as loadPdfJs, x as createDocumentViewer, y as createImageViewer } from "./ui-BwFPFrno.js";
|
|
5
5
|
declare const BaseElement$1: typeof HTMLElement;
|
|
6
6
|
/**
|
|
7
7
|
* An asset viewer element. Set the `src` attribute to the asset URL (public or signed) and the
|
|
@@ -186,4 +186,4 @@ declare global {
|
|
|
186
186
|
"calmlens-timeupdate": CustomEvent<number>;
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
|
-
export { ASSET_FILE_ICON_SIZE, ASSET_VIEWERS, type AssetDisplay, type AssetDisplayOptions, type AssetDocumentOptions, type AssetEventHandlers, type AssetImageOptions, type AssetImageSource, type AssetOptions, type AssetProps, AssetSession, type AssetSessionState, type AssetSpreadsheetOptions, type AssetVideoOptions, type AssetView, type AssetViewer, type AssetViewerKind, AssetViewerMount, AssetViewerName, AssetViewerOptionsByKind, CALMLENS_STYLES, CALMLENS_THEME, type CalmLensMessages, type CalmLensTheme, type CalmLensUpload, type CustomUploadContext, type CustomUploadResult, DEFAULT_MESSAGES, DEFAULT_VIEWER_MESSAGES, type DocumentViewerOptions, ICONS, ICON_ATTRIBUTES, type IconName, type ImageViewerOptions, type MediaPlayback, MediaStreamPlayer, type MountedViewerKind, type PdfAssetOptions, type ProgressFetchOptions, type SpreadsheetCell, type SpreadsheetRow, type SpreadsheetSheet, type SpreadsheetViewerOptions, type TextViewerOptions, type UploadClient, UploadController, type UploadControllerOptions, type UploadFile, type UploadItem, type UploadItemView, type UploadSnapshot, type UploadStage, type UploaderDisplayOptions, type UploaderProps, type UploaderView, VIEWER_STYLES, type ViewerAsset, type ViewerMessages, type ViewerOptions, type ViewerState, type ViewerTextOptions, type WebsiteViewerOptions, createDocumentViewer, createImageViewer, createProgressFetch, createSpreadsheetViewer, createTextViewer, createUploadController, createWebsiteViewer, describeUploadItem, describeUploader, formatBytes, formatMessage, formatViewerMessage, getAssetAspectRatio, getAssetView, getAssetViewKey, getAssetViewerKind, getDropzoneHint, getMountedViewerOptions, getPeakHeights, getPlayedPercent, getSpreadsheetPage, getUploadItemMessage, getUploadItemOutcome, isFileAccepted, isMountedViewerKind, isSpreadsheetFormat, loadPdfJs, parseSpreadsheetText, pickAssetSource, resolveMessages, resolveTheme, resolveViewerMessages, spreadsheetColumnIndex };
|
|
189
|
+
export { ASSET_FILE_ICON_SIZE, ASSET_VIEWERS, type AssetDisplay, type AssetDisplayOptions, type AssetDocumentOptions, type AssetEventHandlers, type AssetImageOptions, type AssetImageSource, type AssetOptions, type AssetProps, AssetSession, type AssetSessionState, type AssetSpreadsheetOptions, type AssetVideoOptions, type AssetView, type AssetViewer, type AssetViewerKind, AssetViewerMount, AssetViewerName, AssetViewerOptionsByKind, CALMLENS_STYLES, CALMLENS_THEME, type CalmLensMessages, type CalmLensProvidedOptions, type CalmLensTheme, type CalmLensUpload, type CustomUploadContext, type CustomUploadResult, DEFAULT_MESSAGES, DEFAULT_VIEWER_MESSAGES, type DocumentViewerOptions, ICONS, ICON_ATTRIBUTES, type IconName, type ImageViewerOptions, type MediaPlayback, MediaStreamPlayer, type MountedViewerKind, type PdfAssetOptions, type ProgressFetchOptions, type SpreadsheetCell, type SpreadsheetRow, type SpreadsheetSheet, type SpreadsheetViewerOptions, type TextViewerOptions, type UploadClient, UploadController, type UploadControllerOptions, type UploadFile, type UploadItem, type UploadItemView, type UploadSnapshot, type UploadStage, type UploaderDisplayOptions, type UploaderProps, type UploaderView, VIEWER_STYLES, type ViewerAsset, type ViewerMessages, type ViewerOptions, type ViewerState, type ViewerTextOptions, type WebsiteViewerOptions, createDocumentViewer, createImageViewer, createProgressFetch, createSpreadsheetViewer, createTextViewer, createUploadController, createWebsiteViewer, describeUploadItem, describeUploader, formatBytes, formatMessage, formatViewerMessage, getAssetAspectRatio, getAssetView, getAssetViewKey, getAssetViewerKind, getDropzoneHint, getMountedViewerOptions, getPeakHeights, getPlayedPercent, getSpreadsheetPage, getUploadItemMessage, getUploadItemOutcome, isFileAccepted, isMountedViewerKind, isSpreadsheetFormat, loadPdfJs, parseSpreadsheetText, pickAssetSource, resolveMessages, resolveTheme, resolveViewerMessages, spreadsheetColumnIndex, withProvidedOptions };
|