calmlens 0.35.0 → 0.36.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/calmlens.js +1 -1
- package/cjs/{BrowserUpload-C5rpoHJc.js → BrowserUpload-Bwfz85Id.js} +1 -1
- package/cjs/{CalmLensAppClient-Cxe_6E-A.js → CalmLensAppClient-CBIAVX_e.js} +2 -2
- package/cjs/{CalmLensCdn-DN3z-uDg.js → CalmLensCdn-Bfcr9qta.js} +1 -1
- package/cjs/{CalmLensConnection-B7gW8yEp.js → CalmLensConnection-By-EsCNB.js} +1 -1
- package/cjs/{CalmLensServerClient-DLdwysxW.js → CalmLensServerClient-BfkTpKwB.js} +2 -2
- package/cjs/{Core-COxzwIVe.js → Core-BcFDI-t4.js} +2 -2
- package/cjs/{ReactUpload-eD850yww.js → ReactUpload-DtqkbRO8.js} +1 -1
- package/cjs/{UploadController-C2NQZhRo.js → UploadController-DDLX2yS9.js} +1 -1
- package/cjs/app.js +2 -2
- package/cjs/elements.js +4 -4
- package/cjs/index.js +1 -1
- package/cjs/react-native.js +4 -4
- package/cjs/react.js +5 -5
- package/cjs/server.js +2 -2
- package/cjs/testing.d.ts +4 -0
- package/cjs/testing.js +20 -8
- package/cjs/{ui-D4cxDZIT.js → ui-TblNKrne.js} +2 -2
- package/cjs/ui.js +3 -3
- package/cjs/vue.js +4 -4
- package/esm/{BrowserUpload-AsxTQ4x8.js → BrowserUpload-CLnrvVO0.js} +1 -1
- package/esm/{CalmLensAppClient-B8O3Ai6H.js → CalmLensAppClient-C3RuoUjN.js} +2 -2
- package/esm/{CalmLensCdn-ZLaMr4XD.js → CalmLensCdn-DOdnpbSx.js} +1 -1
- package/esm/{CalmLensConnection-Duv-JB6o.js → CalmLensConnection-5EryxQTJ.js} +1 -1
- package/esm/{CalmLensServerClient-CdQSdL6-.js → CalmLensServerClient-DNMqxkhS.js} +2 -2
- package/esm/{Core-73r7ehG9.js → Core-CFceeESh.js} +2 -2
- package/esm/{ReactUpload-BrjxbrUo.js → ReactUpload-H5rXCKLT.js} +1 -1
- package/esm/{UploadController-DLPXc9Ug.js → UploadController-Djvf_J_v.js} +1 -1
- package/esm/app.js +2 -2
- package/esm/elements.js +4 -4
- package/esm/index.js +1 -1
- package/esm/react-native.js +4 -4
- package/esm/react.js +5 -5
- package/esm/server.js +2 -2
- package/esm/testing.d.ts +4 -0
- package/esm/testing.js +20 -8
- package/esm/{ui-Byxq-pmc.js → ui-C6wYNQgD.js} +2 -2
- package/esm/ui.js +3 -3
- package/esm/vue.js +4 -4
- package/package.json +1 -1
package/bin/calmlens.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_UploadController = require("./UploadController-
|
|
1
|
+
const require_UploadController = require("./UploadController-DDLX2yS9.js");
|
|
2
2
|
// src/ui/BrowserUpload.ts
|
|
3
3
|
/** Creates an upload queue for the browser components, such as one a form starts on submit. */
|
|
4
4
|
const createUploadController = (options) => require_UploadController.createUploadController(options);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const require_CalmLensError = require("./CalmLensError-ifj5rLmk.js");
|
|
2
|
-
const require_CalmLensCdn = require("./CalmLensCdn-
|
|
3
|
-
const require_CalmLensConnection = require("./CalmLensConnection-
|
|
2
|
+
const require_CalmLensCdn = require("./CalmLensCdn-Bfcr9qta.js");
|
|
3
|
+
const require_CalmLensConnection = require("./CalmLensConnection-By-EsCNB.js");
|
|
4
4
|
// src/client/CalmLensAppClient.ts
|
|
5
5
|
const inspectSymbol = Symbol.for("nodejs.util.inspect.custom");
|
|
6
6
|
/** `options`, once `checkOptionKeys` finds only keys `operation` takes. */
|
|
@@ -152,7 +152,7 @@ const listPages = (fetchPage, { cursor, feed = false } = {}) => {
|
|
|
152
152
|
};
|
|
153
153
|
// src/client/CalmLensVersion.ts
|
|
154
154
|
/** This SDK's version, from its package.json. */
|
|
155
|
-
const SDK_VERSION = "0.
|
|
155
|
+
const SDK_VERSION = "0.36.0";
|
|
156
156
|
const runtimeName = () => {
|
|
157
157
|
const runtime = globalThis;
|
|
158
158
|
if (isReactNativeRuntime()) return "react-native";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_CalmLensError = require("./CalmLensError-ifj5rLmk.js");
|
|
2
|
-
const require_CalmLensCdn = require("./CalmLensCdn-
|
|
2
|
+
const require_CalmLensCdn = require("./CalmLensCdn-Bfcr9qta.js");
|
|
3
3
|
// src/contract/AssetPayload.js
|
|
4
4
|
const bufferInputToBytes = (value) => {
|
|
5
5
|
if (value instanceof ArrayBuffer) return new Uint8Array(value);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const require_CalmLensError = require("./CalmLensError-ifj5rLmk.js");
|
|
2
|
-
const require_CalmLensCdn = require("./CalmLensCdn-
|
|
3
|
-
const require_CalmLensConnection = require("./CalmLensConnection-
|
|
2
|
+
const require_CalmLensCdn = require("./CalmLensCdn-Bfcr9qta.js");
|
|
3
|
+
const require_CalmLensConnection = require("./CalmLensConnection-By-EsCNB.js");
|
|
4
4
|
const require_CryptoUtils_BLCa_oZe = require("./CryptoUtils-BLCa-oZe-leCkr1ko.js");
|
|
5
5
|
// src/contract/JsonUtils.js
|
|
6
6
|
const stringifyJsonCanonical = (value) => JSON.stringify(value, (_key, nestedValue) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const require_CalmLensError = require("./CalmLensError-ifj5rLmk.js");
|
|
2
|
-
const require_CalmLensCdn = require("./CalmLensCdn-
|
|
3
|
-
const require_UploadController = require("./UploadController-
|
|
2
|
+
const require_CalmLensCdn = require("./CalmLensCdn-Bfcr9qta.js");
|
|
3
|
+
const require_UploadController = require("./UploadController-DDLX2yS9.js");
|
|
4
4
|
const require_FileIcons = require("./FileIcons-Ob003MdS.js");
|
|
5
5
|
// src/ui/viewers/ViewerAsset.ts
|
|
6
6
|
/** Spreadsheet MIME types, as `content.format` reports them (compared lower-cased). */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_UploadController = require("./UploadController-
|
|
1
|
+
const require_UploadController = require("./UploadController-DDLX2yS9.js");
|
|
2
2
|
let react = require("react");
|
|
3
3
|
// src/ui/ReactUpload.ts
|
|
4
4
|
const CalmLensContext = (0, react.createContext)(void 0);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_CalmLensError = require("./CalmLensError-ifj5rLmk.js");
|
|
2
|
-
const require_CalmLensAppClient = require("./CalmLensAppClient-
|
|
2
|
+
const require_CalmLensAppClient = require("./CalmLensAppClient-CBIAVX_e.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.
|
package/cjs/app.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_CalmLensError = require("./CalmLensError-ifj5rLmk.js");
|
|
3
|
-
const require_CalmLensCdn = require("./CalmLensCdn-
|
|
3
|
+
const require_CalmLensCdn = require("./CalmLensCdn-Bfcr9qta.js");
|
|
4
4
|
require("./index.js");
|
|
5
|
-
const require_CalmLensAppClient = require("./CalmLensAppClient-
|
|
5
|
+
const require_CalmLensAppClient = require("./CalmLensAppClient-CBIAVX_e.js");
|
|
6
6
|
exports.AUTO_PAGING_TO_ARRAY_MAX = require_CalmLensCdn.AUTO_PAGING_TO_ARRAY_MAX;
|
|
7
7
|
exports.CALMLENS_ERROR_CODES = require_CalmLensError.CALMLENS_ERROR_CODES;
|
|
8
8
|
exports.CDN_RESOURCES = require_CalmLensCdn.CDN_RESOURCES;
|
package/cjs/elements.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_ui = require("./ui-
|
|
3
|
-
const require_Core = require("./Core-
|
|
4
|
-
const require_UploadController = require("./UploadController-
|
|
2
|
+
const require_ui = require("./ui-TblNKrne.js");
|
|
3
|
+
const require_Core = require("./Core-BcFDI-t4.js");
|
|
4
|
+
const require_UploadController = require("./UploadController-DDLX2yS9.js");
|
|
5
5
|
const require_FileIcons = require("./FileIcons-Ob003MdS.js");
|
|
6
|
-
const require_BrowserUpload = require("./BrowserUpload-
|
|
6
|
+
const require_BrowserUpload = require("./BrowserUpload-Bwfz85Id.js");
|
|
7
7
|
// src/viewers/Elements.ts
|
|
8
8
|
const BaseElement$1 = typeof HTMLElement === "undefined" ? class {} : HTMLElement;
|
|
9
9
|
const PROPERTIES = [
|
package/cjs/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_CalmLensError = require("./CalmLensError-ifj5rLmk.js");
|
|
3
|
-
const require_CalmLensCdn = require("./CalmLensCdn-
|
|
3
|
+
const require_CalmLensCdn = require("./CalmLensCdn-Bfcr9qta.js");
|
|
4
4
|
exports.AUTO_PAGING_TO_ARRAY_MAX = require_CalmLensCdn.AUTO_PAGING_TO_ARRAY_MAX;
|
|
5
5
|
exports.CALMLENS_ERROR_CODES = require_CalmLensError.CALMLENS_ERROR_CODES;
|
|
6
6
|
exports.CDN_RESOURCES = require_CalmLensCdn.CDN_RESOURCES;
|
package/cjs/react-native.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_CalmLensCdn = require("./CalmLensCdn-
|
|
3
|
-
const require_Core = require("./Core-
|
|
4
|
-
const require_UploadController = require("./UploadController-
|
|
2
|
+
const require_CalmLensCdn = require("./CalmLensCdn-Bfcr9qta.js");
|
|
3
|
+
const require_Core = require("./Core-BcFDI-t4.js");
|
|
4
|
+
const require_UploadController = require("./UploadController-DDLX2yS9.js");
|
|
5
5
|
const require_FileIcons = require("./FileIcons-Ob003MdS.js");
|
|
6
|
-
const require_ReactUpload = require("./ReactUpload-
|
|
6
|
+
const require_ReactUpload = require("./ReactUpload-DtqkbRO8.js");
|
|
7
7
|
let react = require("react");
|
|
8
8
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
9
9
|
let react_native = require("react-native");
|
package/cjs/react.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const require_ui = require("./ui-
|
|
4
|
-
const require_Core = require("./Core-
|
|
5
|
-
const require_UploadController = require("./UploadController-
|
|
3
|
+
const require_ui = require("./ui-TblNKrne.js");
|
|
4
|
+
const require_Core = require("./Core-BcFDI-t4.js");
|
|
5
|
+
const require_UploadController = require("./UploadController-DDLX2yS9.js");
|
|
6
6
|
const require_FileIcons = require("./FileIcons-Ob003MdS.js");
|
|
7
|
-
const require_ReactUpload = require("./ReactUpload-
|
|
8
|
-
const require_BrowserUpload = require("./BrowserUpload-
|
|
7
|
+
const require_ReactUpload = require("./ReactUpload-DtqkbRO8.js");
|
|
8
|
+
const require_BrowserUpload = require("./BrowserUpload-Bwfz85Id.js");
|
|
9
9
|
let react = require("react");
|
|
10
10
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
11
11
|
const OPTION_NAMES = /* @__PURE__ */ new Set([
|
package/cjs/server.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_CalmLensError = require("./CalmLensError-ifj5rLmk.js");
|
|
3
|
-
const require_CalmLensCdn = require("./CalmLensCdn-
|
|
3
|
+
const require_CalmLensCdn = require("./CalmLensCdn-Bfcr9qta.js");
|
|
4
4
|
require("./index.js");
|
|
5
|
-
const require_CalmLensServerClient = require("./CalmLensServerClient-
|
|
5
|
+
const require_CalmLensServerClient = require("./CalmLensServerClient-BfkTpKwB.js");
|
|
6
6
|
exports.AUTO_PAGING_TO_ARRAY_MAX = require_CalmLensCdn.AUTO_PAGING_TO_ARRAY_MAX;
|
|
7
7
|
exports.CALMLENS_ERROR_CODES = require_CalmLensError.CALMLENS_ERROR_CODES;
|
|
8
8
|
exports.CDN_RESOURCES = require_CalmLensCdn.CDN_RESOURCES;
|
package/cjs/testing.d.ts
CHANGED
|
@@ -16,6 +16,10 @@ declare const signUploadTokenWithApiKey: (apiKey: string, options: SignUploadTok
|
|
|
16
16
|
}) => Promise<SignedUploadToken>;
|
|
17
17
|
export declare const MEDIA_TEST_SIGNALS: readonly ["sexual", "violence", "self-harm", "harassment", "hate", "criminal-activity", "personal-information", "profanity", "violence.graphic"];
|
|
18
18
|
export declare const MOCK_API_KEY_PREFIX = "sk_test_";
|
|
19
|
+
/**
|
|
20
|
+
* Creates a mock API key holding `grants`. Throws `sdk/invalid-argument`, naming the grant, for
|
|
21
|
+
* one the API doesn't accept, such as an unknown action.
|
|
22
|
+
*/
|
|
19
23
|
export declare const createMockApiKey: (grants?: PermissionGrant[]) => string;
|
|
20
24
|
/**
|
|
21
25
|
* The ID of every mock API key, as the `id` of the `actor` and `decidedBy` its requests record,
|
package/cjs/testing.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_CalmLensTestInputArguments = require("./CalmLensTestInputArguments-PYuRmE0j.js");
|
|
3
3
|
const require_CalmLensError = require("./CalmLensError-ifj5rLmk.js");
|
|
4
|
-
const require_CalmLensCdn = require("./CalmLensCdn-
|
|
5
|
-
const require_CalmLensServerClient = require("./CalmLensServerClient-
|
|
6
|
-
const require_CalmLensConnection = require("./CalmLensConnection-
|
|
4
|
+
const require_CalmLensCdn = require("./CalmLensCdn-Bfcr9qta.js");
|
|
5
|
+
const require_CalmLensServerClient = require("./CalmLensServerClient-BfkTpKwB.js");
|
|
6
|
+
const require_CalmLensConnection = require("./CalmLensConnection-By-EsCNB.js");
|
|
7
7
|
const require_CryptoUtils_BLCa_oZe = require("./CryptoUtils-BLCa-oZe-leCkr1ko.js");
|
|
8
|
-
const require_CalmLensAppClient = require("./CalmLensAppClient-
|
|
9
|
-
const require_UploadController = require("./UploadController-
|
|
8
|
+
const require_CalmLensAppClient = require("./CalmLensAppClient-CBIAVX_e.js");
|
|
9
|
+
const require_UploadController = require("./UploadController-DDLX2yS9.js");
|
|
10
10
|
let zod = require("zod");
|
|
11
11
|
let zod$1 = require_CalmLensTestInputArguments.__toESM(zod, 1);
|
|
12
12
|
zod = require_CalmLensTestInputArguments.__toESM(zod);
|
|
@@ -8132,7 +8132,19 @@ const fromBase64Url = (value) => {
|
|
|
8132
8132
|
const padded = value.padEnd(value.length + (4 - value.length % 4) % 4, "=");
|
|
8133
8133
|
return atob(padded.replaceAll("-", "+").replaceAll("_", "/"));
|
|
8134
8134
|
};
|
|
8135
|
-
|
|
8135
|
+
/**
|
|
8136
|
+
* Creates a mock API key holding `grants`. Throws `sdk/invalid-argument`, naming the grant, for
|
|
8137
|
+
* one the API doesn't accept, such as an unknown action.
|
|
8138
|
+
*/
|
|
8139
|
+
const createMockApiKey = (grants = []) => {
|
|
8140
|
+
const parsed = GRANTS_SCHEMA.safeParse(grants);
|
|
8141
|
+
if (!parsed.success) {
|
|
8142
|
+
const [issue] = parsed.error.issues;
|
|
8143
|
+
const path = (issue?.path ?? []).map((segment) => typeof segment === "number" ? segment : String(segment));
|
|
8144
|
+
throw require_CalmLensError.invalidArgument(`Invalid grant at ${["grants", ...path].join(".")}: ${issue?.message ?? parsed.error.message}`, { path });
|
|
8145
|
+
}
|
|
8146
|
+
return `${MOCK_API_KEY_PREFIX}${toBase64Url(JSON.stringify(parsed.data))}`;
|
|
8147
|
+
};
|
|
8136
8148
|
const getMockApiKeyGrants = (apiKey) => {
|
|
8137
8149
|
if (!apiKey.startsWith("sk_test_")) return [];
|
|
8138
8150
|
try {
|
|
@@ -12451,8 +12463,8 @@ var MockCalmLensServerClient = class extends require_CalmLensServerClient.CalmLe
|
|
|
12451
12463
|
api.useTimers = mockOptions.useTimers ?? false;
|
|
12452
12464
|
let endpoints;
|
|
12453
12465
|
super({
|
|
12454
|
-
maxRetries: 0,
|
|
12455
12466
|
...clientOptions,
|
|
12467
|
+
maxRetries: clientOptions.maxRetries ?? 0,
|
|
12456
12468
|
dangerouslyAllowBrowser: true,
|
|
12457
12469
|
...mockClientOptions(api, () => endpoints)
|
|
12458
12470
|
});
|
|
@@ -12613,8 +12625,8 @@ var MockCalmLensAppClient = class extends require_CalmLensAppClient.CalmLensAppC
|
|
|
12613
12625
|
uploads: /* @__PURE__ */ new Set()
|
|
12614
12626
|
});
|
|
12615
12627
|
super({
|
|
12616
|
-
maxRetries: 0,
|
|
12617
12628
|
...clientOptions,
|
|
12629
|
+
maxRetries: clientOptions.maxRetries ?? 0,
|
|
12618
12630
|
...requestOptions
|
|
12619
12631
|
});
|
|
12620
12632
|
endpoints = {
|
package/cjs/ui.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_ui = require("./ui-
|
|
3
|
-
const require_Core = require("./Core-
|
|
4
|
-
const require_UploadController = require("./UploadController-
|
|
2
|
+
const require_ui = require("./ui-TblNKrne.js");
|
|
3
|
+
const require_Core = require("./Core-BcFDI-t4.js");
|
|
4
|
+
const require_UploadController = require("./UploadController-DDLX2yS9.js");
|
|
5
5
|
exports.ASSET_FILE_ICON_SIZE = require_Core.ASSET_FILE_ICON_SIZE;
|
|
6
6
|
exports.ASSET_VIEWERS = require_ui.ASSET_VIEWERS;
|
|
7
7
|
exports.AssetSession = require_Core.AssetSession;
|
package/cjs/vue.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_ui = require("./ui-
|
|
3
|
-
const require_Core = require("./Core-
|
|
4
|
-
const require_UploadController = require("./UploadController-
|
|
2
|
+
const require_ui = require("./ui-TblNKrne.js");
|
|
3
|
+
const require_Core = require("./Core-BcFDI-t4.js");
|
|
4
|
+
const require_UploadController = require("./UploadController-DDLX2yS9.js");
|
|
5
5
|
const require_FileIcons = require("./FileIcons-Ob003MdS.js");
|
|
6
|
-
const require_BrowserUpload = require("./BrowserUpload-
|
|
6
|
+
const require_BrowserUpload = require("./BrowserUpload-Bwfz85Id.js");
|
|
7
7
|
let vue = require("vue");
|
|
8
8
|
// src/viewers/Vue.ts
|
|
9
9
|
const optional$1 = (type) => ({
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as createUploadController$1 } from "./UploadController-
|
|
1
|
+
import { n as createUploadController$1 } from "./UploadController-Djvf_J_v.js";
|
|
2
2
|
// src/ui/BrowserUpload.ts
|
|
3
3
|
/** Creates an upload queue for the browser components, such as one a form starts on submit. */
|
|
4
4
|
const createUploadController = (options) => createUploadController$1(options);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { C as invalidConfig, S as invalidArgument } from "./CalmLensError-C15tWu8W.js";
|
|
2
|
-
import { S as validateAppClientOptions, d as checkOptionKeys, o as buildAssetUrl, p as encodePathSegment, u as DEFAULT_CDN_BASE_URL } from "./CalmLensCdn-
|
|
3
|
-
import { c as prepareSubmitAssetOptions, f as APP_OPTION_KEYS, i as expectUploadedAsset, l as resolveConnectionOptions, t as CalmLensConnection, u as splitsIntoParts } from "./CalmLensConnection-
|
|
2
|
+
import { S as validateAppClientOptions, d as checkOptionKeys, o as buildAssetUrl, p as encodePathSegment, u as DEFAULT_CDN_BASE_URL } from "./CalmLensCdn-DOdnpbSx.js";
|
|
3
|
+
import { c as prepareSubmitAssetOptions, f as APP_OPTION_KEYS, i as expectUploadedAsset, l as resolveConnectionOptions, t as CalmLensConnection, u as splitsIntoParts } from "./CalmLensConnection-5EryxQTJ.js";
|
|
4
4
|
// src/client/CalmLensAppClient.ts
|
|
5
5
|
const inspectSymbol = Symbol.for("nodejs.util.inspect.custom");
|
|
6
6
|
/** `options`, once `checkOptionKeys` finds only keys `operation` takes. */
|
|
@@ -152,7 +152,7 @@ const listPages = (fetchPage, { cursor, feed = false } = {}) => {
|
|
|
152
152
|
};
|
|
153
153
|
// src/client/CalmLensVersion.ts
|
|
154
154
|
/** This SDK's version, from its package.json. */
|
|
155
|
-
const SDK_VERSION = "0.
|
|
155
|
+
const SDK_VERSION = "0.36.0";
|
|
156
156
|
const runtimeName = () => {
|
|
157
157
|
const runtime = globalThis;
|
|
158
158
|
if (isReactNativeRuntime()) return "react-native";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { S as invalidArgument, l as CalmLensError, w as API_ERROR_CODES, x as SDK_ERROR_CODES } from "./CalmLensError-C15tWu8W.js";
|
|
2
|
-
import { A as MAX_OTHER_DOCUMENT_UPLOAD_BYTES, D as MAX_DIRECT_IMAGE_UPLOAD_BYTES, F as sleep, M as getRejectedUploadMimeTypeError, N as normalizeUploadMimeType, O as MAX_IMAGE_UPLOAD_BYTES, P as CalmLensTransport, T as UPLOAD_MIME_DOCUMENTS, U as resolveLogLevel, _ as randomUuid, j as MAX_PDF_UPLOAD_BYTES, k as MAX_NON_IMAGE_UPLOAD_BYTES, m as isAcceptedUploadMimeType, y as stringifyQuery } from "./CalmLensCdn-
|
|
2
|
+
import { A as MAX_OTHER_DOCUMENT_UPLOAD_BYTES, D as MAX_DIRECT_IMAGE_UPLOAD_BYTES, F as sleep, M as getRejectedUploadMimeTypeError, N as normalizeUploadMimeType, O as MAX_IMAGE_UPLOAD_BYTES, P as CalmLensTransport, T as UPLOAD_MIME_DOCUMENTS, U as resolveLogLevel, _ as randomUuid, j as MAX_PDF_UPLOAD_BYTES, k as MAX_NON_IMAGE_UPLOAD_BYTES, m as isAcceptedUploadMimeType, y as stringifyQuery } from "./CalmLensCdn-DOdnpbSx.js";
|
|
3
3
|
// src/contract/AssetPayload.js
|
|
4
4
|
const bufferInputToBytes = (value) => {
|
|
5
5
|
if (value instanceof ArrayBuffer) return new Uint8Array(value);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { C as invalidConfig, S as invalidArgument, l as CalmLensError, x as SDK_ERROR_CODES } from "./CalmLensError-C15tWu8W.js";
|
|
2
|
-
import { B as copyLastResponse, C as validateBatchAssetsOptions, H as readEnv, L as isBrowserRuntime, R as isReactNativeRuntime, V as listPages, b as toTextAssetOptions, d as checkOptionKeys, g as pollForDecision, i as appendSignedLocation, l as validateSignAssetUrlOptions, o as buildAssetUrl, p as encodePathSegment, s as getAssetInfo, u as DEFAULT_CDN_BASE_URL, w as validateServerClientOptions, y as stringifyQuery } from "./CalmLensCdn-
|
|
3
|
-
import { a as getMockHooks, c as prepareSubmitAssetOptions, d as validateCallOptions, l as resolveConnectionOptions, m as SERVER_OPTION_KEYS, o as invalidPayload, p as NULLABLE_OPTION_KEYS, r as expectAsset, s as newIdempotencyKey, t as CalmLensConnection, u as splitsIntoParts } from "./CalmLensConnection-
|
|
2
|
+
import { B as copyLastResponse, C as validateBatchAssetsOptions, H as readEnv, L as isBrowserRuntime, R as isReactNativeRuntime, V as listPages, b as toTextAssetOptions, d as checkOptionKeys, g as pollForDecision, i as appendSignedLocation, l as validateSignAssetUrlOptions, o as buildAssetUrl, p as encodePathSegment, s as getAssetInfo, u as DEFAULT_CDN_BASE_URL, w as validateServerClientOptions, y as stringifyQuery } from "./CalmLensCdn-DOdnpbSx.js";
|
|
3
|
+
import { a as getMockHooks, c as prepareSubmitAssetOptions, d as validateCallOptions, l as resolveConnectionOptions, m as SERVER_OPTION_KEYS, o as invalidPayload, p as NULLABLE_OPTION_KEYS, r as expectAsset, s as newIdempotencyKey, t as CalmLensConnection, u as splitsIntoParts } from "./CalmLensConnection-5EryxQTJ.js";
|
|
4
4
|
import { n as sha256Hex, r as timingSafeEqual, t as hmacSha256Hex } from "./CryptoUtils-BLCa-oZe-DKr3LmN6.js";
|
|
5
5
|
// src/contract/JsonUtils.js
|
|
6
6
|
const stringifyJsonCanonical = (value) => JSON.stringify(value, (_key, nestedValue) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { l as CalmLensError } from "./CalmLensError-C15tWu8W.js";
|
|
2
|
-
import { a as assetUrlOf, c as toUrlViewerClaims, r as appendAssetLocation, s as getAssetInfo, v as serializeTransform, x as transformSelector } from "./CalmLensCdn-
|
|
3
|
-
import { o as placeholderHashToDataURL } from "./UploadController-
|
|
2
|
+
import { a as assetUrlOf, c as toUrlViewerClaims, r as appendAssetLocation, s as getAssetInfo, v as serializeTransform, x as transformSelector } from "./CalmLensCdn-DOdnpbSx.js";
|
|
3
|
+
import { o as placeholderHashToDataURL } from "./UploadController-Djvf_J_v.js";
|
|
4
4
|
import { a as getFileIcon, c as renderFileIconSvg } from "./FileIcons-M6dzjFxd.js";
|
|
5
5
|
// src/ui/viewers/ViewerAsset.ts
|
|
6
6
|
/** Spreadsheet MIME types, as `content.format` reports them (compared lower-cased). */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as withProvidedOptions, n as createUploadController } from "./UploadController-
|
|
1
|
+
import { i as withProvidedOptions, n as createUploadController } from "./UploadController-Djvf_J_v.js";
|
|
2
2
|
import { createContext, createElement, useContext, useEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
|
|
3
3
|
// src/ui/ReactUpload.ts
|
|
4
4
|
const CalmLensContext = createContext(void 0);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { l as CalmLensError, x as SDK_ERROR_CODES } from "./CalmLensError-C15tWu8W.js";
|
|
2
|
-
import { t as CalmLensAppClient } from "./CalmLensAppClient-
|
|
2
|
+
import { t as CalmLensAppClient } from "./CalmLensAppClient-C3RuoUjN.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.
|
package/esm/app.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { _ as CalmLensTimeoutError, a as CalmLensCancelledError, c as CalmLensConnectionError, d as CalmLensInvalidResponseError, f as CalmLensNotFoundError, g as CalmLensServerError, h as CalmLensRateLimitError, i as CalmLensBadRequestError, l as CalmLensError, m as CalmLensPermissionDeniedError, n as CalmLensApiError, o as CalmLensConfigurationError, p as CalmLensPayloadTooLargeError, r as CalmLensAuthenticationError, s as CalmLensConflictError, t as CALMLENS_ERROR_CODES, u as CalmLensInvalidArgumentError, v as CalmLensUnprocessableEntityError, y as CalmLensWebhookVerificationError } from "./CalmLensError-C15tWu8W.js";
|
|
2
|
-
import { I as SDK_VERSION, n as CDN_RESOURCES, s as getAssetInfo, u as DEFAULT_CDN_BASE_URL, z as AUTO_PAGING_TO_ARRAY_MAX } from "./CalmLensCdn-
|
|
2
|
+
import { I as SDK_VERSION, n as CDN_RESOURCES, s as getAssetInfo, u as DEFAULT_CDN_BASE_URL, z as AUTO_PAGING_TO_ARRAY_MAX } from "./CalmLensCdn-DOdnpbSx.js";
|
|
3
3
|
import "./index.js";
|
|
4
|
-
import { t as CalmLensAppClient } from "./CalmLensAppClient-
|
|
4
|
+
import { t as CalmLensAppClient } from "./CalmLensAppClient-C3RuoUjN.js";
|
|
5
5
|
export { AUTO_PAGING_TO_ARRAY_MAX, CALMLENS_ERROR_CODES, CDN_RESOURCES, CalmLensApiError, CalmLensAppClient, CalmLensAuthenticationError, CalmLensBadRequestError, CalmLensCancelledError, CalmLensConfigurationError, CalmLensConflictError, CalmLensConnectionError, CalmLensError, CalmLensInvalidArgumentError, CalmLensInvalidResponseError, CalmLensNotFoundError, CalmLensPayloadTooLargeError, CalmLensPermissionDeniedError, CalmLensRateLimitError, CalmLensServerError, CalmLensTimeoutError, CalmLensUnprocessableEntityError, CalmLensWebhookVerificationError, DEFAULT_CDN_BASE_URL, SDK_VERSION, getAssetInfo };
|
package/esm/elements.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { a as ASSET_VIEWERS, c as getSpreadsheetPage, d as createDocumentViewer, f as DEFAULT_VIEWER_MESSAGES, h as loadPdfJs, i as isMountedViewerKind, l as parseSpreadsheetText, m as resolveViewerMessages, n as AssetViewerMount, o as createSpreadsheetViewer, p as formatViewerMessage, r as getMountedViewerOptions, s as createTextViewer, t as MediaStreamPlayer, u as spreadsheetColumnIndex } from "./ui-
|
|
2
|
-
import { C as pickAssetSource, D as getAssetViewerKind, E as resolveTheme, O as isSpreadsheetFormat, S as isImageReady, T as CALMLENS_THEME, _ as getAssetAspectRatio, a as describeUploadItem, b as getPeakHeights, c as formatMessage, d as getUploadItemOutcome, f as resolveMessages, g as INSTANT_LOAD_MS, h as AssetSession, i as DEFAULT_MESSAGES, l as getDropzoneHint, m as ICON_ATTRIBUTES, o as describeUploader, p as ICONS, r as ASSET_FILE_ICON_SIZE, s as formatBytes, t as CALMLENS_STYLES, u as getUploadItemMessage, v as getAssetView, w as VIEWER_STYLES, x as getPlayedPercent, y as getAssetViewKey } from "./Core-
|
|
3
|
-
import { a as createProgressFetch, i as withProvidedOptions, n as createUploadController$1, r as isFileAccepted, t as UploadController } from "./UploadController-
|
|
1
|
+
import { a as ASSET_VIEWERS, c as getSpreadsheetPage, d as createDocumentViewer, f as DEFAULT_VIEWER_MESSAGES, h as loadPdfJs, i as isMountedViewerKind, l as parseSpreadsheetText, m as resolveViewerMessages, n as AssetViewerMount, o as createSpreadsheetViewer, p as formatViewerMessage, r as getMountedViewerOptions, s as createTextViewer, t as MediaStreamPlayer, u as spreadsheetColumnIndex } from "./ui-C6wYNQgD.js";
|
|
2
|
+
import { C as pickAssetSource, D as getAssetViewerKind, E as resolveTheme, O as isSpreadsheetFormat, S as isImageReady, T as CALMLENS_THEME, _ as getAssetAspectRatio, a as describeUploadItem, b as getPeakHeights, c as formatMessage, d as getUploadItemOutcome, f as resolveMessages, g as INSTANT_LOAD_MS, h as AssetSession, i as DEFAULT_MESSAGES, l as getDropzoneHint, m as ICON_ATTRIBUTES, o as describeUploader, p as ICONS, r as ASSET_FILE_ICON_SIZE, s as formatBytes, t as CALMLENS_STYLES, u as getUploadItemMessage, v as getAssetView, w as VIEWER_STYLES, x as getPlayedPercent, y as getAssetViewKey } from "./Core-CFceeESh.js";
|
|
3
|
+
import { a as createProgressFetch, i as withProvidedOptions, n as createUploadController$1, r as isFileAccepted, t as UploadController } from "./UploadController-Djvf_J_v.js";
|
|
4
4
|
import { c as renderFileIconSvg } from "./FileIcons-M6dzjFxd.js";
|
|
5
|
-
import { t as createUploadController } from "./BrowserUpload-
|
|
5
|
+
import { t as createUploadController } from "./BrowserUpload-CLnrvVO0.js";
|
|
6
6
|
// src/viewers/Elements.ts
|
|
7
7
|
const BaseElement$1 = typeof HTMLElement === "undefined" ? class {} : HTMLElement;
|
|
8
8
|
const PROPERTIES = [
|
package/esm/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { _ as CalmLensTimeoutError, a as CalmLensCancelledError, c as CalmLensConnectionError, d as CalmLensInvalidResponseError, f as CalmLensNotFoundError, g as CalmLensServerError, h as CalmLensRateLimitError, i as CalmLensBadRequestError, l as CalmLensError, m as CalmLensPermissionDeniedError, n as CalmLensApiError, o as CalmLensConfigurationError, p as CalmLensPayloadTooLargeError, r as CalmLensAuthenticationError, s as CalmLensConflictError, t as CALMLENS_ERROR_CODES, u as CalmLensInvalidArgumentError, v as CalmLensUnprocessableEntityError, y as CalmLensWebhookVerificationError } from "./CalmLensError-C15tWu8W.js";
|
|
2
|
-
import { I as SDK_VERSION, n as CDN_RESOURCES, s as getAssetInfo, u as DEFAULT_CDN_BASE_URL, z as AUTO_PAGING_TO_ARRAY_MAX } from "./CalmLensCdn-
|
|
2
|
+
import { I as SDK_VERSION, n as CDN_RESOURCES, s as getAssetInfo, u as DEFAULT_CDN_BASE_URL, z as AUTO_PAGING_TO_ARRAY_MAX } from "./CalmLensCdn-DOdnpbSx.js";
|
|
3
3
|
export { AUTO_PAGING_TO_ARRAY_MAX, CALMLENS_ERROR_CODES, CDN_RESOURCES, CalmLensApiError, CalmLensAuthenticationError, CalmLensBadRequestError, CalmLensCancelledError, CalmLensConfigurationError, CalmLensConflictError, CalmLensConnectionError, CalmLensError, CalmLensInvalidArgumentError, CalmLensInvalidResponseError, CalmLensNotFoundError, CalmLensPayloadTooLargeError, CalmLensPermissionDeniedError, CalmLensRateLimitError, CalmLensServerError, CalmLensTimeoutError, CalmLensUnprocessableEntityError, CalmLensWebhookVerificationError, DEFAULT_CDN_BASE_URL, SDK_VERSION, getAssetInfo };
|
package/esm/react-native.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { a as assetUrlOf, r as appendAssetLocation } from "./CalmLensCdn-
|
|
2
|
-
import { C as pickAssetSource, E as resolveTheme, S as isImageReady, T as CALMLENS_THEME, _ as getAssetAspectRatio, a as describeUploadItem, b as getPeakHeights, c as formatMessage, d as getUploadItemOutcome, f as resolveMessages, g as INSTANT_LOAD_MS, h as AssetSession, i as DEFAULT_MESSAGES, l as getDropzoneHint, m as ICON_ATTRIBUTES, o as describeUploader, p as ICONS, r as ASSET_FILE_ICON_SIZE, s as formatBytes, t as CALMLENS_STYLES, u as getUploadItemMessage, v as getAssetView, x as getPlayedPercent, y as getAssetViewKey } from "./Core-
|
|
3
|
-
import { a as createProgressFetch, i as withProvidedOptions, n as createUploadController, r as isFileAccepted, t as UploadController } from "./UploadController-
|
|
1
|
+
import { a as assetUrlOf, r as appendAssetLocation } from "./CalmLensCdn-DOdnpbSx.js";
|
|
2
|
+
import { C as pickAssetSource, E as resolveTheme, S as isImageReady, T as CALMLENS_THEME, _ as getAssetAspectRatio, a as describeUploadItem, b as getPeakHeights, c as formatMessage, d as getUploadItemOutcome, f as resolveMessages, g as INSTANT_LOAD_MS, h as AssetSession, i as DEFAULT_MESSAGES, l as getDropzoneHint, m as ICON_ATTRIBUTES, o as describeUploader, p as ICONS, r as ASSET_FILE_ICON_SIZE, s as formatBytes, t as CALMLENS_STYLES, u as getUploadItemMessage, v as getAssetView, x as getPlayedPercent, y as getAssetViewKey } from "./Core-CFceeESh.js";
|
|
3
|
+
import { a as createProgressFetch, i as withProvidedOptions, n as createUploadController, r as isFileAccepted, t as UploadController } from "./UploadController-Djvf_J_v.js";
|
|
4
4
|
import { a as getFileIcon, o as getFileIconLabel, t as FILE_ICON_COLORS } from "./FileIcons-M6dzjFxd.js";
|
|
5
|
-
import { i as useUploadSnapshot, n as useCalmLensUpload, r as useOwnController, t as CalmLensProvider } from "./ReactUpload-
|
|
5
|
+
import { i as useUploadSnapshot, n as useCalmLensUpload, r as useOwnController, t as CalmLensProvider } from "./ReactUpload-H5rXCKLT.js";
|
|
6
6
|
import { useEffect, useMemo, useRef, useState } from "react";
|
|
7
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
8
|
import { Image, Linking, PixelRatio, Pressable, StyleSheet, Text, View } from "react-native";
|
package/esm/react.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { a as ASSET_VIEWERS, c as getSpreadsheetPage, d as createDocumentViewer, f as DEFAULT_VIEWER_MESSAGES, h as loadPdfJs, i as isMountedViewerKind, l as parseSpreadsheetText, m as resolveViewerMessages, n as AssetViewerMount, o as createSpreadsheetViewer, p as formatViewerMessage, r as getMountedViewerOptions, s as createTextViewer, t as MediaStreamPlayer, u as spreadsheetColumnIndex } from "./ui-
|
|
3
|
-
import { C as pickAssetSource, D as getAssetViewerKind, E as resolveTheme, O as isSpreadsheetFormat, S as isImageReady, T as CALMLENS_THEME, _ as getAssetAspectRatio, a as describeUploadItem, b as getPeakHeights, c as formatMessage, d as getUploadItemOutcome, f as resolveMessages, g as INSTANT_LOAD_MS, h as AssetSession, i as DEFAULT_MESSAGES, l as getDropzoneHint, m as ICON_ATTRIBUTES, n as CALMLENS_STYLES_ID, o as describeUploader, p as ICONS, r as ASSET_FILE_ICON_SIZE, s as formatBytes, t as CALMLENS_STYLES, u as getUploadItemMessage, v as getAssetView, w as VIEWER_STYLES, x as getPlayedPercent, y as getAssetViewKey } from "./Core-
|
|
4
|
-
import { a as createProgressFetch, i as withProvidedOptions, r as isFileAccepted, t as UploadController } from "./UploadController-
|
|
2
|
+
import { a as ASSET_VIEWERS, c as getSpreadsheetPage, d as createDocumentViewer, f as DEFAULT_VIEWER_MESSAGES, h as loadPdfJs, i as isMountedViewerKind, l as parseSpreadsheetText, m as resolveViewerMessages, n as AssetViewerMount, o as createSpreadsheetViewer, p as formatViewerMessage, r as getMountedViewerOptions, s as createTextViewer, t as MediaStreamPlayer, u as spreadsheetColumnIndex } from "./ui-C6wYNQgD.js";
|
|
3
|
+
import { C as pickAssetSource, D as getAssetViewerKind, E as resolveTheme, O as isSpreadsheetFormat, S as isImageReady, T as CALMLENS_THEME, _ as getAssetAspectRatio, a as describeUploadItem, b as getPeakHeights, c as formatMessage, d as getUploadItemOutcome, f as resolveMessages, g as INSTANT_LOAD_MS, h as AssetSession, i as DEFAULT_MESSAGES, l as getDropzoneHint, m as ICON_ATTRIBUTES, n as CALMLENS_STYLES_ID, o as describeUploader, p as ICONS, r as ASSET_FILE_ICON_SIZE, s as formatBytes, t as CALMLENS_STYLES, u as getUploadItemMessage, v as getAssetView, w as VIEWER_STYLES, x as getPlayedPercent, y as getAssetViewKey } from "./Core-CFceeESh.js";
|
|
4
|
+
import { a as createProgressFetch, i as withProvidedOptions, r as isFileAccepted, t as UploadController } from "./UploadController-Djvf_J_v.js";
|
|
5
5
|
import { c as renderFileIconSvg } from "./FileIcons-M6dzjFxd.js";
|
|
6
|
-
import { i as useUploadSnapshot, n as useCalmLensUpload$1, r as useOwnController, t as CalmLensProvider } from "./ReactUpload-
|
|
7
|
-
import { t as createUploadController } from "./BrowserUpload-
|
|
6
|
+
import { i as useUploadSnapshot, n as useCalmLensUpload$1, r as useOwnController, t as CalmLensProvider } from "./ReactUpload-H5rXCKLT.js";
|
|
7
|
+
import { t as createUploadController } from "./BrowserUpload-CLnrvVO0.js";
|
|
8
8
|
import { useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
9
9
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
10
10
|
const OPTION_NAMES = /* @__PURE__ */ new Set([
|
package/esm/server.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { _ as CalmLensTimeoutError, a as CalmLensCancelledError, c as CalmLensConnectionError, d as CalmLensInvalidResponseError, f as CalmLensNotFoundError, g as CalmLensServerError, h as CalmLensRateLimitError, i as CalmLensBadRequestError, l as CalmLensError, m as CalmLensPermissionDeniedError, n as CalmLensApiError, o as CalmLensConfigurationError, p as CalmLensPayloadTooLargeError, r as CalmLensAuthenticationError, s as CalmLensConflictError, t as CALMLENS_ERROR_CODES, u as CalmLensInvalidArgumentError, v as CalmLensUnprocessableEntityError, y as CalmLensWebhookVerificationError } from "./CalmLensError-C15tWu8W.js";
|
|
2
|
-
import { I as SDK_VERSION, n as CDN_RESOURCES, s as getAssetInfo, u as DEFAULT_CDN_BASE_URL, z as AUTO_PAGING_TO_ARRAY_MAX } from "./CalmLensCdn-
|
|
2
|
+
import { I as SDK_VERSION, n as CDN_RESOURCES, s as getAssetInfo, u as DEFAULT_CDN_BASE_URL, z as AUTO_PAGING_TO_ARRAY_MAX } from "./CalmLensCdn-DOdnpbSx.js";
|
|
3
3
|
import "./index.js";
|
|
4
|
-
import { a as WEBHOOK_TIMESTAMP_HEADER, c as isNewerEvent, d as verifyWebhookSignature, i as WEBHOOK_SIGNATURE_TOLERANCE_SECONDS, l as isTestWebhookEvent, n as WEBHOOK_DELIVERY_HEADER, o as getEventFact, r as WEBHOOK_SIGNATURE_HEADER, s as getEventFacts, t as CalmLensServerClient, u as parseWebhookEvent } from "./CalmLensServerClient-
|
|
4
|
+
import { a as WEBHOOK_TIMESTAMP_HEADER, c as isNewerEvent, d as verifyWebhookSignature, i as WEBHOOK_SIGNATURE_TOLERANCE_SECONDS, l as isTestWebhookEvent, n as WEBHOOK_DELIVERY_HEADER, o as getEventFact, r as WEBHOOK_SIGNATURE_HEADER, s as getEventFacts, t as CalmLensServerClient, u as parseWebhookEvent } from "./CalmLensServerClient-DNMqxkhS.js";
|
|
5
5
|
export { AUTO_PAGING_TO_ARRAY_MAX, CALMLENS_ERROR_CODES, CDN_RESOURCES, CalmLensApiError, CalmLensAuthenticationError, CalmLensBadRequestError, CalmLensCancelledError, CalmLensConfigurationError, CalmLensConflictError, CalmLensConnectionError, CalmLensError, CalmLensInvalidArgumentError, CalmLensInvalidResponseError, CalmLensNotFoundError, CalmLensPayloadTooLargeError, CalmLensPermissionDeniedError, CalmLensRateLimitError, CalmLensServerClient, CalmLensServerError, CalmLensTimeoutError, CalmLensUnprocessableEntityError, CalmLensWebhookVerificationError, DEFAULT_CDN_BASE_URL, SDK_VERSION, WEBHOOK_DELIVERY_HEADER, WEBHOOK_SIGNATURE_HEADER, WEBHOOK_SIGNATURE_TOLERANCE_SECONDS, WEBHOOK_TIMESTAMP_HEADER, getAssetInfo, getEventFact, getEventFacts, isNewerEvent, isTestWebhookEvent, parseWebhookEvent, verifyWebhookSignature };
|
package/esm/testing.d.ts
CHANGED
|
@@ -16,6 +16,10 @@ declare const signUploadTokenWithApiKey: (apiKey: string, options: SignUploadTok
|
|
|
16
16
|
}) => Promise<SignedUploadToken>;
|
|
17
17
|
export declare const MEDIA_TEST_SIGNALS: readonly ["sexual", "violence", "self-harm", "harassment", "hate", "criminal-activity", "personal-information", "profanity", "violence.graphic"];
|
|
18
18
|
export declare const MOCK_API_KEY_PREFIX = "sk_test_";
|
|
19
|
+
/**
|
|
20
|
+
* Creates a mock API key holding `grants`. Throws `sdk/invalid-argument`, naming the grant, for
|
|
21
|
+
* one the API doesn't accept, such as an unknown action.
|
|
22
|
+
*/
|
|
19
23
|
export declare const createMockApiKey: (grants?: PermissionGrant[]) => string;
|
|
20
24
|
/**
|
|
21
25
|
* The ID of every mock API key, as the `id` of the `actor` and `decidedBy` its requests record,
|
package/esm/testing.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { C as invalidConfig, S as invalidArgument, T as API_ERROR_DEFINITIONS, l as CalmLensError, w as API_ERROR_CODES, x as SDK_ERROR_CODES } from "./CalmLensError-C15tWu8W.js";
|
|
2
|
-
import { F as sleep, M as getRejectedUploadMimeTypeError, N as normalizeUploadMimeType, O as MAX_IMAGE_UPLOAD_BYTES, S as validateAppClientOptions, _ as randomUuid, f as checkTransformOptions, h as parseTransformSelector, m as isAcceptedUploadMimeType, t as ASSET_RESOURCE_PATHS, w as validateServerClientOptions } from "./CalmLensCdn-
|
|
3
|
-
import { a as WEBHOOK_TIMESTAMP_HEADER, f as signUploadTokenWithApiKey, m as stringifyJsonCanonical, n as WEBHOOK_DELIVERY_HEADER, p as decodeUploadToken, r as WEBHOOK_SIGNATURE_HEADER, t as CalmLensServerClient } from "./CalmLensServerClient-
|
|
4
|
-
import { _ as validateAssetPayload, g as assetToData, h as assetDataToUint8Array, n as MOCK_HOOKS } from "./CalmLensConnection-
|
|
2
|
+
import { F as sleep, M as getRejectedUploadMimeTypeError, N as normalizeUploadMimeType, O as MAX_IMAGE_UPLOAD_BYTES, S as validateAppClientOptions, _ as randomUuid, f as checkTransformOptions, h as parseTransformSelector, m as isAcceptedUploadMimeType, t as ASSET_RESOURCE_PATHS, w as validateServerClientOptions } from "./CalmLensCdn-DOdnpbSx.js";
|
|
3
|
+
import { a as WEBHOOK_TIMESTAMP_HEADER, f as signUploadTokenWithApiKey, m as stringifyJsonCanonical, n as WEBHOOK_DELIVERY_HEADER, p as decodeUploadToken, r as WEBHOOK_SIGNATURE_HEADER, t as CalmLensServerClient } from "./CalmLensServerClient-DNMqxkhS.js";
|
|
4
|
+
import { _ as validateAssetPayload, g as assetToData, h as assetDataToUint8Array, n as MOCK_HOOKS } from "./CalmLensConnection-5EryxQTJ.js";
|
|
5
5
|
import { t as hmacSha256Hex } from "./CryptoUtils-BLCa-oZe-DKr3LmN6.js";
|
|
6
|
-
import { t as CalmLensAppClient } from "./CalmLensAppClient-
|
|
7
|
-
import { o as placeholderHashToDataURL, r as isFileAccepted } from "./UploadController-
|
|
6
|
+
import { t as CalmLensAppClient } from "./CalmLensAppClient-C3RuoUjN.js";
|
|
7
|
+
import { o as placeholderHashToDataURL, r as isFileAccepted } from "./UploadController-Djvf_J_v.js";
|
|
8
8
|
import { f as getTestInputTag, g as CLASSIFICATION_CATEGORIES, h as lazySchema, t as withValidTestInputArguments } from "./CalmLensTestInputArguments-CqPADTkl.js";
|
|
9
9
|
import * as zod from "zod";
|
|
10
10
|
// src/contract/MediaTestTriggers.js
|
|
@@ -8129,7 +8129,19 @@ const fromBase64Url = (value) => {
|
|
|
8129
8129
|
const padded = value.padEnd(value.length + (4 - value.length % 4) % 4, "=");
|
|
8130
8130
|
return atob(padded.replaceAll("-", "+").replaceAll("_", "/"));
|
|
8131
8131
|
};
|
|
8132
|
-
|
|
8132
|
+
/**
|
|
8133
|
+
* Creates a mock API key holding `grants`. Throws `sdk/invalid-argument`, naming the grant, for
|
|
8134
|
+
* one the API doesn't accept, such as an unknown action.
|
|
8135
|
+
*/
|
|
8136
|
+
const createMockApiKey = (grants = []) => {
|
|
8137
|
+
const parsed = GRANTS_SCHEMA.safeParse(grants);
|
|
8138
|
+
if (!parsed.success) {
|
|
8139
|
+
const [issue] = parsed.error.issues;
|
|
8140
|
+
const path = (issue?.path ?? []).map((segment) => typeof segment === "number" ? segment : String(segment));
|
|
8141
|
+
throw invalidArgument(`Invalid grant at ${["grants", ...path].join(".")}: ${issue?.message ?? parsed.error.message}`, { path });
|
|
8142
|
+
}
|
|
8143
|
+
return `${MOCK_API_KEY_PREFIX}${toBase64Url(JSON.stringify(parsed.data))}`;
|
|
8144
|
+
};
|
|
8133
8145
|
const getMockApiKeyGrants = (apiKey) => {
|
|
8134
8146
|
if (!apiKey.startsWith("sk_test_")) return [];
|
|
8135
8147
|
try {
|
|
@@ -12448,8 +12460,8 @@ var MockCalmLensServerClient = class extends CalmLensServerClient {
|
|
|
12448
12460
|
api.useTimers = mockOptions.useTimers ?? false;
|
|
12449
12461
|
let endpoints;
|
|
12450
12462
|
super({
|
|
12451
|
-
maxRetries: 0,
|
|
12452
12463
|
...clientOptions,
|
|
12464
|
+
maxRetries: clientOptions.maxRetries ?? 0,
|
|
12453
12465
|
dangerouslyAllowBrowser: true,
|
|
12454
12466
|
...mockClientOptions(api, () => endpoints)
|
|
12455
12467
|
});
|
|
@@ -12610,8 +12622,8 @@ var MockCalmLensAppClient = class extends CalmLensAppClient {
|
|
|
12610
12622
|
uploads: /* @__PURE__ */ new Set()
|
|
12611
12623
|
});
|
|
12612
12624
|
super({
|
|
12613
|
-
maxRetries: 0,
|
|
12614
12625
|
...clientOptions,
|
|
12626
|
+
maxRetries: clientOptions.maxRetries ?? 0,
|
|
12615
12627
|
...requestOptions
|
|
12616
12628
|
});
|
|
12617
12629
|
endpoints = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as assetUrlOf, r as appendAssetLocation } from "./CalmLensCdn-
|
|
2
|
-
import "./Core-
|
|
1
|
+
import { a as assetUrlOf, r as appendAssetLocation } from "./CalmLensCdn-DOdnpbSx.js";
|
|
2
|
+
import "./Core-CFceeESh.js";
|
|
3
3
|
// src/ui/viewers/PdfLoader.ts
|
|
4
4
|
let loading;
|
|
5
5
|
/**
|
package/esm/ui.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as ASSET_VIEWERS, c as getSpreadsheetPage, d as createDocumentViewer, f as DEFAULT_VIEWER_MESSAGES, h as loadPdfJs, i as isMountedViewerKind, l as parseSpreadsheetText, m as resolveViewerMessages, n as AssetViewerMount, o as createSpreadsheetViewer, p as formatViewerMessage, r as getMountedViewerOptions, s as createTextViewer, t as MediaStreamPlayer, u as spreadsheetColumnIndex } from "./ui-
|
|
2
|
-
import { C as pickAssetSource, D as getAssetViewerKind, E as resolveTheme, O as isSpreadsheetFormat, S as isImageReady, T as CALMLENS_THEME, _ as getAssetAspectRatio, a as describeUploadItem, b as getPeakHeights, c as formatMessage, d as getUploadItemOutcome, f as resolveMessages, g as INSTANT_LOAD_MS, h as AssetSession, i as DEFAULT_MESSAGES, l as getDropzoneHint, m as ICON_ATTRIBUTES, o as describeUploader, p as ICONS, r as ASSET_FILE_ICON_SIZE, s as formatBytes, t as CALMLENS_STYLES, u as getUploadItemMessage, v as getAssetView, w as VIEWER_STYLES, x as getPlayedPercent, y as getAssetViewKey } from "./Core-
|
|
3
|
-
import { a as createProgressFetch, i as withProvidedOptions, n as createUploadController, r as isFileAccepted, t as UploadController } from "./UploadController-
|
|
1
|
+
import { a as ASSET_VIEWERS, c as getSpreadsheetPage, d as createDocumentViewer, f as DEFAULT_VIEWER_MESSAGES, h as loadPdfJs, i as isMountedViewerKind, l as parseSpreadsheetText, m as resolveViewerMessages, n as AssetViewerMount, o as createSpreadsheetViewer, p as formatViewerMessage, r as getMountedViewerOptions, s as createTextViewer, t as MediaStreamPlayer, u as spreadsheetColumnIndex } from "./ui-C6wYNQgD.js";
|
|
2
|
+
import { C as pickAssetSource, D as getAssetViewerKind, E as resolveTheme, O as isSpreadsheetFormat, S as isImageReady, T as CALMLENS_THEME, _ as getAssetAspectRatio, a as describeUploadItem, b as getPeakHeights, c as formatMessage, d as getUploadItemOutcome, f as resolveMessages, g as INSTANT_LOAD_MS, h as AssetSession, i as DEFAULT_MESSAGES, l as getDropzoneHint, m as ICON_ATTRIBUTES, o as describeUploader, p as ICONS, r as ASSET_FILE_ICON_SIZE, s as formatBytes, t as CALMLENS_STYLES, u as getUploadItemMessage, v as getAssetView, w as VIEWER_STYLES, x as getPlayedPercent, y as getAssetViewKey } from "./Core-CFceeESh.js";
|
|
3
|
+
import { a as createProgressFetch, i as withProvidedOptions, n as createUploadController, r as isFileAccepted, t as UploadController } from "./UploadController-Djvf_J_v.js";
|
|
4
4
|
export { ASSET_FILE_ICON_SIZE, ASSET_VIEWERS, AssetSession, AssetViewerMount, CALMLENS_STYLES, CALMLENS_THEME, DEFAULT_MESSAGES, DEFAULT_VIEWER_MESSAGES, ICONS, ICON_ATTRIBUTES, INSTANT_LOAD_MS, MediaStreamPlayer, UploadController, VIEWER_STYLES, createDocumentViewer, createProgressFetch, createSpreadsheetViewer, createTextViewer, createUploadController, describeUploadItem, describeUploader, formatBytes, formatMessage, formatViewerMessage, getAssetAspectRatio, getAssetView, getAssetViewKey, getAssetViewerKind, getDropzoneHint, getMountedViewerOptions, getPeakHeights, getPlayedPercent, getSpreadsheetPage, getUploadItemMessage, getUploadItemOutcome, isFileAccepted, isImageReady, isMountedViewerKind, isSpreadsheetFormat, loadPdfJs, parseSpreadsheetText, pickAssetSource, resolveMessages, resolveTheme, resolveViewerMessages, spreadsheetColumnIndex, withProvidedOptions };
|
package/esm/vue.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { a as ASSET_VIEWERS, c as getSpreadsheetPage, d as createDocumentViewer, f as DEFAULT_VIEWER_MESSAGES, h as loadPdfJs, i as isMountedViewerKind, l as parseSpreadsheetText, m as resolveViewerMessages, n as AssetViewerMount, o as createSpreadsheetViewer, p as formatViewerMessage, r as getMountedViewerOptions, s as createTextViewer, t as MediaStreamPlayer, u as spreadsheetColumnIndex } from "./ui-
|
|
2
|
-
import { C as pickAssetSource, D as getAssetViewerKind, E as resolveTheme, O as isSpreadsheetFormat, S as isImageReady, T as CALMLENS_THEME, _ as getAssetAspectRatio, a as describeUploadItem, b as getPeakHeights, c as formatMessage, d as getUploadItemOutcome, f as resolveMessages, g as INSTANT_LOAD_MS, h as AssetSession, i as DEFAULT_MESSAGES, l as getDropzoneHint, m as ICON_ATTRIBUTES, o as describeUploader, p as ICONS, r as ASSET_FILE_ICON_SIZE, s as formatBytes, t as CALMLENS_STYLES, u as getUploadItemMessage, v as getAssetView, w as VIEWER_STYLES, x as getPlayedPercent, y as getAssetViewKey } from "./Core-
|
|
3
|
-
import { a as createProgressFetch, i as withProvidedOptions, n as createUploadController$1, r as isFileAccepted, t as UploadController } from "./UploadController-
|
|
1
|
+
import { a as ASSET_VIEWERS, c as getSpreadsheetPage, d as createDocumentViewer, f as DEFAULT_VIEWER_MESSAGES, h as loadPdfJs, i as isMountedViewerKind, l as parseSpreadsheetText, m as resolveViewerMessages, n as AssetViewerMount, o as createSpreadsheetViewer, p as formatViewerMessage, r as getMountedViewerOptions, s as createTextViewer, t as MediaStreamPlayer, u as spreadsheetColumnIndex } from "./ui-C6wYNQgD.js";
|
|
2
|
+
import { C as pickAssetSource, D as getAssetViewerKind, E as resolveTheme, O as isSpreadsheetFormat, S as isImageReady, T as CALMLENS_THEME, _ as getAssetAspectRatio, a as describeUploadItem, b as getPeakHeights, c as formatMessage, d as getUploadItemOutcome, f as resolveMessages, g as INSTANT_LOAD_MS, h as AssetSession, i as DEFAULT_MESSAGES, l as getDropzoneHint, m as ICON_ATTRIBUTES, o as describeUploader, p as ICONS, r as ASSET_FILE_ICON_SIZE, s as formatBytes, t as CALMLENS_STYLES, u as getUploadItemMessage, v as getAssetView, w as VIEWER_STYLES, x as getPlayedPercent, y as getAssetViewKey } from "./Core-CFceeESh.js";
|
|
3
|
+
import { a as createProgressFetch, i as withProvidedOptions, n as createUploadController$1, r as isFileAccepted, t as UploadController } from "./UploadController-Djvf_J_v.js";
|
|
4
4
|
import { c as renderFileIconSvg } from "./FileIcons-M6dzjFxd.js";
|
|
5
|
-
import { t as createUploadController } from "./BrowserUpload-
|
|
5
|
+
import { t as createUploadController } from "./BrowserUpload-CLnrvVO0.js";
|
|
6
6
|
import { computed, defineComponent, h, inject, onBeforeUnmount, onMounted, onScopeDispose, provide, ref, shallowRef, toValue, watch, watchEffect } from "vue";
|
|
7
7
|
// src/viewers/Vue.ts
|
|
8
8
|
const optional$1 = (type) => ({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "calmlens",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.36.0",
|
|
4
4
|
"description": "Official CalmLens SDK for JavaScript and TypeScript: content moderation, asset storage and CDN delivery.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://calmlens.com/docs/sdk/javascript",
|