calmlens 0.27.5 → 0.27.6
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 +2 -2
- package/bin/calmlens.js +26 -15
- package/cjs/{BrowserUpload-DJZY1LSU.d.ts → BrowserUpload-CdOfuIcV.d.ts} +2 -2
- package/cjs/{BrowserUpload-DhruIgFN.js → BrowserUpload-GQtZti-D.js} +1 -1
- package/{esm/CalmLensAppClient-DzoSqUgG.d.ts → cjs/CalmLensAppClient-Btp8f-34.d.ts} +2 -2
- package/cjs/{CalmLensAppClient-BA_xaNHY.js → CalmLensAppClient-Bwt3gP0C.js} +3 -3
- package/cjs/{CalmLensOptionKeys-BvLQghl-.js → CalmLensOptionKeys--gTpTkwt.js} +1 -1
- package/cjs/{CalmLensServerClient-D55xDZm4.js → CalmLensServerClient-BYMzGkQK.js} +7 -7
- package/cjs/{CalmLensServerClient-D3K5HS9v.d.ts → CalmLensServerClient-C3kaPLUZ.d.ts} +2 -2
- package/cjs/{CalmLensTypes-OWZsGvBX.d.ts → CalmLensTypes-DxxyZt2L.d.ts} +73 -5
- package/cjs/{Core-kKGmyk5V.js → Core-52DVaX7d.js} +2 -2
- package/{esm/Core-CTO_Eh0l.d.ts → cjs/Core-Dhijt6JU.d.ts} +2 -2
- package/cjs/{CryptoUtils-B_x8lMIx-YBW1-bvL.js → CryptoUtils-BLCa-oZe-leCkr1ko.js} +1 -2
- package/cjs/{ModerationContextLimits-Cxaob3tc.js → ModerationContextLimits-DJyIjzIn.js} +21 -3
- package/cjs/{ReactUpload-BDXV4aHT.d.ts → ReactUpload-BuqLPgNr.d.ts} +1 -1
- package/cjs/{ReactUpload-Cx3Hi7xt.js → ReactUpload-DHuhGYsr.js} +1 -1
- package/cjs/{TestTriggers-Cvi7e2KA-DcT1pc_W.js → TestTriggers-DP4m92jg-C0HD-A4r.js} +14 -14
- package/cjs/{UploadController-CC1afxmL.js → UploadController-ChzDPMmm.js} +2 -2
- package/cjs/{WebhookPayload-CrMU6lg0.d.ts → WebhookPayload-D_yWJA9M.d.ts} +5 -1
- package/cjs/app.d.ts +4 -4
- package/cjs/app.js +2 -2
- package/cjs/elements.d.ts +4 -4
- package/cjs/elements.js +4 -4
- package/cjs/{index-BDxmVi-G.d.ts → index-CUA-HDNu.d.ts} +2 -2
- package/cjs/index.d.ts +3 -3
- package/cjs/index.js +1 -1
- package/cjs/react-native.d.ts +2 -2
- package/cjs/react-native.js +4 -4
- package/cjs/react.d.ts +4 -4
- package/cjs/react.js +5 -5
- package/cjs/server.d.ts +4 -4
- package/cjs/server.js +2 -2
- package/cjs/test-inputs.js +13 -13
- package/cjs/testing.d.ts +4 -4
- package/cjs/testing.js +54 -32
- package/cjs/{ui-DAbpyM2Z.d.ts → ui-BSm_qphN.d.ts} +2 -2
- package/cjs/{ui-I75EvP9r.js → ui-C1_SDSiq.js} +2 -2
- package/cjs/ui.d.ts +2 -2
- package/cjs/ui.js +3 -3
- package/cjs/vue.d.ts +5 -5
- package/cjs/vue.js +4 -4
- package/esm/{BrowserUpload-CejeWw5r.js → BrowserUpload-BaKFKEBz.js} +1 -1
- package/esm/{BrowserUpload-DJZY1LSU.d.ts → BrowserUpload-CdOfuIcV.d.ts} +2 -2
- package/{cjs/CalmLensAppClient-DzoSqUgG.d.ts → esm/CalmLensAppClient-Btp8f-34.d.ts} +2 -2
- package/esm/{CalmLensAppClient-BxkCVPCl.js → CalmLensAppClient-DM6c3pGC.js} +3 -3
- package/esm/{CalmLensOptionKeys-DC9FUO43.js → CalmLensOptionKeys-CKZs8i3_.js} +1 -1
- package/esm/{CalmLensServerClient-D3K5HS9v.d.ts → CalmLensServerClient-C3kaPLUZ.d.ts} +2 -2
- package/esm/{CalmLensServerClient-D-TIIQp2.js → CalmLensServerClient-Da2UfUo4.js} +3 -3
- package/esm/{CalmLensTypes-OWZsGvBX.d.ts → CalmLensTypes-DxxyZt2L.d.ts} +73 -5
- package/{cjs/Core-CTO_Eh0l.d.ts → esm/Core-Dhijt6JU.d.ts} +2 -2
- package/esm/{Core-B85V5dxv.js → Core-kYMRW5C1.js} +2 -2
- package/esm/{CryptoUtils-B_x8lMIx-DhuWGzqn.js → CryptoUtils-BLCa-oZe-DKr3LmN6.js} +1 -2
- package/esm/{ModerationContextLimits-Tev2lxE0.js → ModerationContextLimits-ZIlK9n2X.js} +21 -3
- package/esm/{ReactUpload-BDXV4aHT.d.ts → ReactUpload-BuqLPgNr.d.ts} +1 -1
- package/esm/{ReactUpload-B7QXMSWJ.js → ReactUpload-CipY3cmO.js} +1 -1
- package/esm/{TestTriggers-Cvi7e2KA-BA83CRJb.js → TestTriggers-DP4m92jg-DhOI4S1V.js} +11 -11
- package/esm/{UploadController-D7XmzO-p.js → UploadController-D-14HWII.js} +2 -2
- package/esm/{WebhookPayload-CrMU6lg0.d.ts → WebhookPayload-D_yWJA9M.d.ts} +5 -1
- package/esm/app.d.ts +4 -4
- package/esm/app.js +2 -2
- package/esm/elements.d.ts +4 -4
- package/esm/elements.js +4 -4
- package/esm/{index-BDxmVi-G.d.ts → index-CUA-HDNu.d.ts} +2 -2
- package/esm/index.d.ts +3 -3
- package/esm/index.js +1 -1
- package/esm/react-native.d.ts +2 -2
- package/esm/react-native.js +4 -4
- package/esm/react.d.ts +4 -4
- package/esm/react.js +5 -5
- package/esm/server.d.ts +4 -4
- package/esm/server.js +2 -2
- package/esm/test-inputs.js +1 -1
- package/esm/testing.d.ts +4 -4
- package/esm/testing.js +45 -23
- package/esm/{ui-DAbpyM2Z.d.ts → ui-BSm_qphN.d.ts} +2 -2
- package/esm/{ui-cE1lyljs.js → ui-CgIG3knW.js} +2 -2
- package/esm/ui.d.ts +2 -2
- package/esm/ui.js +3 -3
- package/esm/vue.d.ts +5 -5
- package/esm/vue.js +4 -4
- package/package.json +1 -1
package/cjs/testing.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const
|
|
3
|
-
const require_ModerationContextLimits = require("./ModerationContextLimits-
|
|
4
|
-
const require_CalmLensServerClient = require("./CalmLensServerClient-
|
|
5
|
-
const require_CalmLensOptionKeys = require("./CalmLensOptionKeys
|
|
6
|
-
const
|
|
7
|
-
const require_CalmLensAppClient = require("./CalmLensAppClient-
|
|
8
|
-
const require_UploadController = require("./UploadController-
|
|
2
|
+
const require_TestTriggers_DP4m92jg = require("./TestTriggers-DP4m92jg-C0HD-A4r.js");
|
|
3
|
+
const require_ModerationContextLimits = require("./ModerationContextLimits-DJyIjzIn.js");
|
|
4
|
+
const require_CalmLensServerClient = require("./CalmLensServerClient-BYMzGkQK.js");
|
|
5
|
+
const require_CalmLensOptionKeys = require("./CalmLensOptionKeys--gTpTkwt.js");
|
|
6
|
+
const require_CryptoUtils_BLCa_oZe = require("./CryptoUtils-BLCa-oZe-leCkr1ko.js");
|
|
7
|
+
const require_CalmLensAppClient = require("./CalmLensAppClient-Bwt3gP0C.js");
|
|
8
|
+
const require_UploadController = require("./UploadController-ChzDPMmm.js");
|
|
9
9
|
let zod = require("zod");
|
|
10
|
-
zod =
|
|
10
|
+
zod = require_TestTriggers_DP4m92jg.__toESM(zod, 1);
|
|
11
11
|
// src/contract/MediaTestTriggers.js
|
|
12
|
-
const MEDIA_TEST_SIGNALS = [...
|
|
12
|
+
const MEDIA_TEST_SIGNALS = [...require_TestTriggers_DP4m92jg.CLASSIFICATION_CATEGORIES, "violence.graphic"];
|
|
13
13
|
const HEX_WORDS = [
|
|
14
14
|
"zero",
|
|
15
15
|
"one",
|
|
@@ -31,9 +31,21 @@ const HEX_WORDS = [
|
|
|
31
31
|
/** Read this aloud, or render it as large, high-contrast text in a video frame. */
|
|
32
32
|
async function generateMediaTestCode(signal, testInputKey) {
|
|
33
33
|
if (!MEDIA_TEST_SIGNALS.includes(signal)) throw new RangeError("Unsupported media test signal");
|
|
34
|
-
return `Calm Lens test ${[...await
|
|
34
|
+
return `Calm Lens test ${[...await require_TestTriggers_DP4m92jg.getTestInputTag("media", signal, testInputKey)].map((character) => HEX_WORDS[Number.parseInt(character, 16)]).join(" ")} ${signal.replace(/[.-]/g, " ")} end test`;
|
|
35
35
|
}
|
|
36
|
-
|
|
36
|
+
/**
|
|
37
|
+
* The character an asset ID starts with (after `asset_`) to say the region it lives in: the asset
|
|
38
|
+
* table computes each row's region from it (`AssetTable`), so an ID is only ever in one region and
|
|
39
|
+
* a lookup by ID goes straight there. A code is never reused for another region.
|
|
40
|
+
*/
|
|
41
|
+
const ASSET_ID_REGION_CODES = {
|
|
42
|
+
"aws-ap-southeast-1": "a",
|
|
43
|
+
"aws-eu-west-2": "e",
|
|
44
|
+
"aws-eu-central-1": "f",
|
|
45
|
+
"aws-us-east-2": "u"
|
|
46
|
+
};
|
|
47
|
+
new Map(Object.entries(ASSET_ID_REGION_CODES).map(([region, code]) => [code, region]));
|
|
48
|
+
// src/contract/Ids-BBz_iuDy.js
|
|
37
49
|
var __defProp = Object.defineProperty;
|
|
38
50
|
var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod, mod.exports), cb = null), mod.exports);
|
|
39
51
|
var __exportAll = (all, no_symbols) => {
|
|
@@ -7927,6 +7939,7 @@ createMetaType({
|
|
|
7927
7939
|
createMetaType({ id: "updatedAt" });
|
|
7928
7940
|
createMetaType({ id: "monotonicTimestamp" });
|
|
7929
7941
|
createMetaType({ id: "backfill" });
|
|
7942
|
+
createMetaType({ id: "computed" });
|
|
7930
7943
|
/**
|
|
7931
7944
|
* The prefix of every kind of object customers can see, so an ID says what it identifies:
|
|
7932
7945
|
* `proj_8fK2mQx7Lp4NvB3tRz9Y` is a project. Rows that never leave the backend (usage meters, upload
|
|
@@ -7989,15 +8002,23 @@ const randomBase62 = (length) => {
|
|
|
7989
8002
|
}
|
|
7990
8003
|
return result;
|
|
7991
8004
|
};
|
|
7992
|
-
/**
|
|
8005
|
+
/**
|
|
8006
|
+
* A new random ID, such as `newId("proj")` → `proj_8fK2mQx7Lp4NvB3tRz9Y`. Assets take theirs from
|
|
8007
|
+
* `newAssetId`, which names their region.
|
|
8008
|
+
*/
|
|
7993
8009
|
const newId = (prefix) => `${prefix}_${randomBase62(20)}`;
|
|
8010
|
+
/**
|
|
8011
|
+
* A new asset ID for an asset that lives in `region`: its first character after `asset_` is the
|
|
8012
|
+
* region's code (`ASSET_ID_REGION_CODES`), then 19 random characters (about 113 bits).
|
|
8013
|
+
*/
|
|
8014
|
+
const newAssetId = (region) => `asset_${ASSET_ID_REGION_CODES[region]}${randomBase62(19)}`;
|
|
7994
8015
|
/** Whether `value` is an ID with `prefix` (or with any registered prefix). */
|
|
7995
8016
|
const isId = (value, prefix) => typeof value === "string" && idPattern(prefix).test(value);
|
|
7996
8017
|
/** Example IDs for docs, OpenAPI and SDK fixtures: fixed, so generated output stays stable. */
|
|
7997
8018
|
const EXAMPLE_IDS = {
|
|
7998
8019
|
org: "org_3hQ7tLk2Vb9XpR4mWc8N",
|
|
7999
8020
|
proj: "proj_8fK2mQx7Lp4NvB3tRz9Y",
|
|
8000
|
-
asset: "
|
|
8021
|
+
asset: "asset_e5Gm2Rk8XqT3wLp9VbN4",
|
|
8001
8022
|
fldr: "fldr_7Nc4Wq2Lm8Xt5Rk9Bv3P",
|
|
8002
8023
|
lens: "lens_2Xr9Lp4Vm7Qk3Tb8Nw5C",
|
|
8003
8024
|
key: "key_9Pt3Wm6Rk2Lx8Qv4Nb7C",
|
|
@@ -8030,8 +8051,9 @@ const EXAMPLE_IDS = {
|
|
|
8030
8051
|
* across the packages that build records from plain strings).
|
|
8031
8052
|
*/
|
|
8032
8053
|
const idField = (prefix) => zod.string().regex(idPattern(prefix), { message: `Must be a valid ID: "${prefix}_" followed by 20 letters or digits` }).meta({ examples: [EXAMPLE_IDS[prefix]] });
|
|
8033
|
-
// src/contract/Permissions-
|
|
8034
|
-
|
|
8054
|
+
// src/contract/Permissions-Dwk78TtG.js
|
|
8055
|
+
/** Every permission action, in the order the docs and the portal list them. */
|
|
8056
|
+
const PERMISSION_ACTIONS = [
|
|
8035
8057
|
"assets:read",
|
|
8036
8058
|
"assets:download",
|
|
8037
8059
|
"assets:create",
|
|
@@ -8063,7 +8085,8 @@ const ACTION_SCHEMA = /* @__PURE__ */ require_TestTriggers_Cvi7e2KA.lazySchema((
|
|
|
8063
8085
|
"reviews:read",
|
|
8064
8086
|
"reviews:write",
|
|
8065
8087
|
"project:manage"
|
|
8066
|
-
]
|
|
8088
|
+
];
|
|
8089
|
+
const ACTION_SCHEMA = /* @__PURE__ */ require_TestTriggers_DP4m92jg.lazySchema(() => zod.enum(PERMISSION_ACTIONS));
|
|
8067
8090
|
const PROJECT_ACTIONS = [...[
|
|
8068
8091
|
"settings",
|
|
8069
8092
|
"members",
|
|
@@ -8079,14 +8102,14 @@ const PROJECT_ACTIONS = [...[
|
|
|
8079
8102
|
const isProjectAction = (action) => PROJECT_ACTIONS.includes(action);
|
|
8080
8103
|
/** The actions that include `action`: its feature's write action and project:manage. */
|
|
8081
8104
|
const actionsImplying = (action) => !isProjectAction(action) || action === "project:manage" ? [] : action.endsWith(":read") ? [action.replace(/:read$/, ":write"), "project:manage"] : ["project:manage"];
|
|
8082
|
-
const GRANT_SCHEMA = /* @__PURE__ */
|
|
8105
|
+
const GRANT_SCHEMA = /* @__PURE__ */ require_TestTriggers_DP4m92jg.lazySchema(() => zod.object({
|
|
8083
8106
|
actions: zod.array(ACTION_SCHEMA),
|
|
8084
8107
|
folderId: idField("fldr").nullable(),
|
|
8085
8108
|
includeSubfolders: zod.boolean()
|
|
8086
8109
|
}).strict().refine((g) => g.folderId === null || !g.actions.some(isProjectAction), "Project configuration permissions require project scope"));
|
|
8087
|
-
const GRANTS_SCHEMA = /* @__PURE__ */
|
|
8088
|
-
[...
|
|
8089
|
-
[...
|
|
8110
|
+
const GRANTS_SCHEMA = /* @__PURE__ */ require_TestTriggers_DP4m92jg.lazySchema(() => zod.array(GRANT_SCHEMA).max(100));
|
|
8111
|
+
[...PERMISSION_ACTIONS.filter((a) => !isProjectAction(a))];
|
|
8112
|
+
[...PERMISSION_ACTIONS.filter((a) => !isProjectAction(a))];
|
|
8090
8113
|
const permits = (grants, action, folderId, folders) => grants.some((grant) => {
|
|
8091
8114
|
if (![action, ...actionsImplying(action)].some((held) => grant.actions.includes(held))) return false;
|
|
8092
8115
|
if (grant.folderId === null) return true;
|
|
@@ -9534,7 +9557,7 @@ const MOCK_PRESET_NAMES = {
|
|
|
9534
9557
|
* personal information and profanity, `block` otherwise) and no rules. The mock holds no built-in
|
|
9535
9558
|
* preset settings, and uploads are never decided by a policy.
|
|
9536
9559
|
*/
|
|
9537
|
-
const mockPresetSettings = () => ({ categorySettings: Object.fromEntries(
|
|
9560
|
+
const mockPresetSettings = () => ({ categorySettings: Object.fromEntries(require_TestTriggers_DP4m92jg.CLASSIFICATION_CATEGORIES.map((category) => [category, {
|
|
9538
9561
|
action: category === "personal-information" || category === "profanity" ? "allow" : "block",
|
|
9539
9562
|
allowances: [],
|
|
9540
9563
|
restrictions: []
|
|
@@ -9546,13 +9569,13 @@ const mockPresetSettings = () => ({ categorySettings: Object.fromEntries(require
|
|
|
9546
9569
|
const checkPolicySettings = (settings) => {
|
|
9547
9570
|
const categories = settings?.categorySettings;
|
|
9548
9571
|
if (!categories || typeof categories !== "object") throw invalidField("validation/invalid-type", "settings.categorySettings");
|
|
9549
|
-
for (const category of
|
|
9572
|
+
for (const category of require_TestTriggers_DP4m92jg.CLASSIFICATION_CATEGORIES) {
|
|
9550
9573
|
const value = categories[category];
|
|
9551
9574
|
if (!value || typeof value !== "object") throw invalidField("validation/invalid-type", `settings.categorySettings.${category}`);
|
|
9552
9575
|
for (const key of ["allowances", "restrictions"]) if (!Array.isArray(value[key])) throw invalidField("validation/invalid-type", `settings.categorySettings.${category}.${key}`);
|
|
9553
9576
|
if (typeof value.action !== "string") throw invalidField("validation/invalid-value", `settings.categorySettings.${category}.action`);
|
|
9554
9577
|
}
|
|
9555
|
-
for (const key of Object.keys(categories)) if (!
|
|
9578
|
+
for (const key of Object.keys(categories)) if (!require_TestTriggers_DP4m92jg.CLASSIFICATION_CATEGORIES.includes(key)) throw invalidField("validation/unknown-field", `settings.categorySettings.${key}`);
|
|
9556
9579
|
};
|
|
9557
9580
|
/** The client methods that send a request, the one it is recorded under first. */
|
|
9558
9581
|
const operationsOf = (request) => {
|
|
@@ -11633,7 +11656,7 @@ var MockCalmLensApi = class {
|
|
|
11633
11656
|
}, url);
|
|
11634
11657
|
if (resource === "embed") return this.cdnResponse(isHead, new TextEncoder().encode(MOCK_EMBED_HTML), url, {
|
|
11635
11658
|
"Content-Type": "text/html; charset=utf-8",
|
|
11636
|
-
"Cache-Control":
|
|
11659
|
+
"Cache-Control": "private, no-store",
|
|
11637
11660
|
"Cache-Tag": `asset-${asset.id}`,
|
|
11638
11661
|
"X-Content-Type-Options": "nosniff"
|
|
11639
11662
|
});
|
|
@@ -11665,15 +11688,14 @@ var MockCalmLensApi = class {
|
|
|
11665
11688
|
bytes = mockPlaceholderPng(preview?.thumbhash ?? MOCK_THUMBHASH);
|
|
11666
11689
|
contentType = "image/png";
|
|
11667
11690
|
}
|
|
11668
|
-
const
|
|
11691
|
+
const imageResponse = stillImage || resource === "original" && asset.type === "image";
|
|
11692
|
+
const maxAge = grant ? Math.max(0, Math.min(86400, Math.floor((grant.expiresAt - this.now()) / 1e3))) : 86400;
|
|
11693
|
+
const cacheControl = query.has("viewerClaims") || request.headers.has("X-CalmLens-Viewer-Claims") ? "private, no-store" : isPrivate && !grant ? "private, no-cache" : `${isPrivate ? "private" : "public"}, max-age=${maxAge}, must-revalidate`;
|
|
11669
11694
|
return this.cdnResponse(isHead, bytes, url, {
|
|
11670
11695
|
"Content-Type": contentType,
|
|
11671
|
-
"Cache-Control":
|
|
11696
|
+
"Cache-Control": cacheControl,
|
|
11672
11697
|
"Cache-Tag": `asset-${asset.id}`,
|
|
11673
|
-
...
|
|
11674
|
-
ETag: `"${asset.id}"`,
|
|
11675
|
-
Expires: new Date(this.now() + 31536e6).toUTCString()
|
|
11676
|
-
} : {},
|
|
11698
|
+
...imageResponse ? { ETag: `"${asset.id}"` } : {},
|
|
11677
11699
|
"X-Content-Type-Options": "nosniff",
|
|
11678
11700
|
"Content-Security-Policy": "sandbox; default-src 'none'",
|
|
11679
11701
|
...isActiveContentType(contentType) ? { "Content-Disposition": "attachment" } : {}
|
|
@@ -11874,7 +11896,7 @@ var MockCalmLensServerClient = class extends require_CalmLensServerClient.CalmLe
|
|
|
11874
11896
|
grants: getMockApiKeyGrants(options.apiKey),
|
|
11875
11897
|
databaseStorage: mockOptions.databaseStorage ?? new InMemoryMockDatabaseStorage(),
|
|
11876
11898
|
imageStorage: mockOptions.imageStorage ?? new InMemoryMockImageStorage(),
|
|
11877
|
-
createId: mockOptions.createId ?? newId,
|
|
11899
|
+
createId: mockOptions.createId ?? ((prefix) => prefix === "asset" ? newAssetId("aws-eu-west-2") : newId(prefix)),
|
|
11878
11900
|
now: mockOptions.now ?? createMonotonicClock(),
|
|
11879
11901
|
moderate: mockOptions.moderate ?? defaultModerate
|
|
11880
11902
|
});
|
|
@@ -12042,7 +12064,7 @@ const toWebhookEventPayload = (event) => ({
|
|
|
12042
12064
|
createdAt: event.createdAt
|
|
12043
12065
|
});
|
|
12044
12066
|
/** `v1=<hex HMAC-SHA256 of "<timestamp>.<body>">`, the `x-calmlens-signature` header value. */
|
|
12045
|
-
const createWebhookSignatureHeader = async (secret, timestamp, body) => `v1=${await
|
|
12067
|
+
const createWebhookSignatureHeader = async (secret, timestamp, body) => `v1=${await require_CryptoUtils_BLCa_oZe.hmacSha256Hex(secret, `${timestamp}.${body}`)}`;
|
|
12046
12068
|
/** Headers for one signed delivery of `body`, as CalmLens sends them. */
|
|
12047
12069
|
const createWebhookHeaders = async (options) => {
|
|
12048
12070
|
const timestamp = options.timestampSeconds ?? Math.floor(Date.now() / 1e3);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "./CalmLensTypes-
|
|
2
|
-
import { K as AssetOptions, Z as AssetView, ct as DocumentViewerOptions, dt as TextViewerOptions, lt as PdfAssetOptions, pt as ViewerOptions, q as AssetSession, ut as SpreadsheetViewerOptions } from "./Core-
|
|
1
|
+
import "./CalmLensTypes-DxxyZt2L.js";
|
|
2
|
+
import { K as AssetOptions, Z as AssetView, ct as DocumentViewerOptions, dt as TextViewerOptions, lt as PdfAssetOptions, pt as ViewerOptions, q as AssetSession, ut as SpreadsheetViewerOptions } from "./Core-Dhijt6JU.js";
|
|
3
3
|
import "pdfjs-dist";
|
|
4
4
|
/** A viewer mounted into an element, which it owns the children of. */
|
|
5
5
|
interface AssetViewer<O extends ViewerOptions = ViewerOptions> {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const require_ModerationContextLimits = require("./ModerationContextLimits-
|
|
2
|
-
require("./Core-
|
|
1
|
+
const require_ModerationContextLimits = require("./ModerationContextLimits-DJyIjzIn.js");
|
|
2
|
+
require("./Core-52DVaX7d.js");
|
|
3
3
|
// src/ui/viewers/PdfLoader.ts
|
|
4
4
|
let loading;
|
|
5
5
|
/**
|
package/cjs/ui.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { $ as MediaPlayback, A as CustomUploadContext, B as isFileAccepted, C as formatMessage, D as resolveMessages, E as getUploadItemOutcome, F as UploadFile, G as AssetImageSource, H as AssetDisplay, I as UploadItem, J as AssetSessionState, K as AssetOptions, L as UploadSnapshot, M as UploadClient, N as UploadController, O as CalmLensProvidedOptions, P as UploadControllerOptions, Q as INSTANT_LOAD_MS, 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 isImageReady, b as describeUploadItem, bt as resolveViewerMessages, c as ICON_ATTRIBUTES, ct as DocumentViewerOptions, d as AssetDisplayOptions, dt as TextViewerOptions, et as getAssetAspectRatio, f as AssetEventHandlers, ft as ViewerAsset, g as CalmLensMessages, gt as isSpreadsheetFormat, h as UploaderProps, ht as getAssetViewerKind, i as CALMLENS_STYLES, it as getPlayedPercent, j as CustomUploadResult, k as CalmLensUpload, l as IconName, lt as PdfAssetOptions, m as UploaderDisplayOptions, mt as ViewerTextOptions, n as CalmLensTheme, nt as getAssetViewKey, o as createProgressFetch, ot as pickAssetSource, p as AssetProps, pt as ViewerOptions, q as AssetSession, r as resolveTheme, rt as getPeakHeights, s as ICONS, st as AssetViewerKind, t as CALMLENS_THEME, tt as getAssetView, u as ASSET_FILE_ICON_SIZE, ut as SpreadsheetViewerOptions, v as UploadItemView, vt as ViewerMessages, w as getDropzoneHint, x as describeUploader, y as UploaderView, yt as formatViewerMessage, z as createUploadController } from "./Core-
|
|
2
|
-
import { _ as spreadsheetColumnIndex, a as isMountedViewerKind, b as AssetViewer, 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 ViewerState, y as createDocumentViewer } from "./ui-
|
|
1
|
+
import { $ as MediaPlayback, A as CustomUploadContext, B as isFileAccepted, C as formatMessage, D as resolveMessages, E as getUploadItemOutcome, F as UploadFile, G as AssetImageSource, H as AssetDisplay, I as UploadItem, J as AssetSessionState, K as AssetOptions, L as UploadSnapshot, M as UploadClient, N as UploadController, O as CalmLensProvidedOptions, P as UploadControllerOptions, Q as INSTANT_LOAD_MS, 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 isImageReady, b as describeUploadItem, bt as resolveViewerMessages, c as ICON_ATTRIBUTES, ct as DocumentViewerOptions, d as AssetDisplayOptions, dt as TextViewerOptions, et as getAssetAspectRatio, f as AssetEventHandlers, ft as ViewerAsset, g as CalmLensMessages, gt as isSpreadsheetFormat, h as UploaderProps, ht as getAssetViewerKind, i as CALMLENS_STYLES, it as getPlayedPercent, j as CustomUploadResult, k as CalmLensUpload, l as IconName, lt as PdfAssetOptions, m as UploaderDisplayOptions, mt as ViewerTextOptions, n as CalmLensTheme, nt as getAssetViewKey, o as createProgressFetch, ot as pickAssetSource, p as AssetProps, pt as ViewerOptions, q as AssetSession, r as resolveTheme, rt as getPeakHeights, s as ICONS, st as AssetViewerKind, t as CALMLENS_THEME, tt as getAssetView, u as ASSET_FILE_ICON_SIZE, ut as SpreadsheetViewerOptions, v as UploadItemView, vt as ViewerMessages, w as getDropzoneHint, x as describeUploader, y as UploaderView, yt as formatViewerMessage, z as createUploadController } from "./Core-Dhijt6JU.js";
|
|
2
|
+
import { _ as spreadsheetColumnIndex, a as isMountedViewerKind, b as AssetViewer, 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 ViewerState, y as createDocumentViewer } from "./ui-BSm_qphN.js";
|
|
3
3
|
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, INSTANT_LOAD_MS, type IconName, 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, 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/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-C1_SDSiq.js");
|
|
3
|
+
const require_Core = require("./Core-52DVaX7d.js");
|
|
4
|
+
const require_UploadController = require("./UploadController-ChzDPMmm.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.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { O as CalmLensAppClientOptions, en as ViewerClaims, g as AssetModerationStatus, i as AssetAvailability } from "./CalmLensTypes-
|
|
2
|
-
import "./index-
|
|
3
|
-
import { $ as MediaPlayback, 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 INSTANT_LOAD_MS, 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 isImageReady, b as describeUploadItem, bt as resolveViewerMessages, c as ICON_ATTRIBUTES, ct as DocumentViewerOptions, d as AssetDisplayOptions, dt as TextViewerOptions, et as getAssetAspectRatio, f as AssetEventHandlers, ft as ViewerAsset, g as CalmLensMessages, gt as isSpreadsheetFormat, ht as getAssetViewerKind, i as CALMLENS_STYLES, it as getPlayedPercent, j as CustomUploadResult, l as IconName, lt as PdfAssetOptions, m as UploaderDisplayOptions, mt as ViewerTextOptions, n as CalmLensTheme, nt as getAssetViewKey, o as createProgressFetch, ot as pickAssetSource, p as AssetProps, pt as ViewerOptions, q as AssetSession, r as resolveTheme, rt as getPeakHeights, s as ICONS, st as AssetViewerKind, t as CALMLENS_THEME, tt as getAssetView, u as ASSET_FILE_ICON_SIZE, ut as SpreadsheetViewerOptions, v as UploadItemView, vt as ViewerMessages, w as getDropzoneHint, x as describeUploader, y as UploaderView, yt as formatViewerMessage } from "./Core-
|
|
4
|
-
import { a as UploaderProps, i as UploadSnapshot, n as UploadControllerOptions, r as UploadItem, s as createUploadController, t as CalmLensUpload } from "./BrowserUpload-
|
|
5
|
-
import { _ as spreadsheetColumnIndex, a as isMountedViewerKind, b as AssetViewer, 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 ViewerState, y as createDocumentViewer } from "./ui-
|
|
1
|
+
import { O as CalmLensAppClientOptions, en as ViewerClaims, g as AssetModerationStatus, i as AssetAvailability } from "./CalmLensTypes-DxxyZt2L.js";
|
|
2
|
+
import "./index-CUA-HDNu.js";
|
|
3
|
+
import { $ as MediaPlayback, 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 INSTANT_LOAD_MS, 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 isImageReady, b as describeUploadItem, bt as resolveViewerMessages, c as ICON_ATTRIBUTES, ct as DocumentViewerOptions, d as AssetDisplayOptions, dt as TextViewerOptions, et as getAssetAspectRatio, f as AssetEventHandlers, ft as ViewerAsset, g as CalmLensMessages, gt as isSpreadsheetFormat, ht as getAssetViewerKind, i as CALMLENS_STYLES, it as getPlayedPercent, j as CustomUploadResult, l as IconName, lt as PdfAssetOptions, m as UploaderDisplayOptions, mt as ViewerTextOptions, n as CalmLensTheme, nt as getAssetViewKey, o as createProgressFetch, ot as pickAssetSource, p as AssetProps, pt as ViewerOptions, q as AssetSession, r as resolveTheme, rt as getPeakHeights, s as ICONS, st as AssetViewerKind, t as CALMLENS_THEME, tt as getAssetView, u as ASSET_FILE_ICON_SIZE, ut as SpreadsheetViewerOptions, v as UploadItemView, vt as ViewerMessages, w as getDropzoneHint, x as describeUploader, y as UploaderView, yt as formatViewerMessage } from "./Core-Dhijt6JU.js";
|
|
4
|
+
import { a as UploaderProps, i as UploadSnapshot, n as UploadControllerOptions, r as UploadItem, s as createUploadController, t as CalmLensUpload } from "./BrowserUpload-CdOfuIcV.js";
|
|
5
|
+
import { _ as spreadsheetColumnIndex, a as isMountedViewerKind, b as AssetViewer, 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 ViewerState, y as createDocumentViewer } from "./ui-BSm_qphN.js";
|
|
6
6
|
import { App, MaybeRefOrGetter, PropType, ShallowRef } from "vue";
|
|
7
7
|
/** Shows a text asset's text, escaped, in a scrolling region. */
|
|
8
8
|
export declare const CalmLensTextViewer: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
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-C1_SDSiq.js");
|
|
3
|
+
const require_Core = require("./Core-52DVaX7d.js");
|
|
4
|
+
const require_UploadController = require("./UploadController-ChzDPMmm.js");
|
|
5
5
|
const require_FileIcons = require("./FileIcons-Ob003MdS.js");
|
|
6
|
-
const require_BrowserUpload = require("./BrowserUpload-
|
|
6
|
+
const require_BrowserUpload = require("./BrowserUpload-GQtZti-D.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-D-14HWII.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,5 +1,5 @@
|
|
|
1
|
-
import { F as UploadFile, I as UploadItem$1, L as UploadSnapshot$1, N as UploadController, P as UploadControllerOptions$1, h as UploaderProps$1, k as CalmLensUpload$1 } from "./Core-
|
|
2
|
-
import { r as UseCalmLensUploadResult$1 } from "./ReactUpload-
|
|
1
|
+
import { F as UploadFile, I as UploadItem$1, L as UploadSnapshot$1, N as UploadController, P as UploadControllerOptions$1, h as UploaderProps$1, k as CalmLensUpload$1 } from "./Core-Dhijt6JU.js";
|
|
2
|
+
import { r as UseCalmLensUploadResult$1 } from "./ReactUpload-BuqLPgNr.js";
|
|
3
3
|
type UploadItem<F extends UploadFile = File> = UploadItem$1<F>;
|
|
4
4
|
type CalmLensUpload<F extends UploadFile = File> = CalmLensUpload$1<F>;
|
|
5
5
|
type UploadSnapshot<F extends UploadFile = File> = UploadSnapshot$1<F>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { At as RetrieveAssetOptions, M as CdnAssetUrlOptions, O as CalmLensAppClientOptions, Ot as RequestOptions, Qt as UploadedAsset, Zt as UploadPresetSubmitAssetOptions, qt as UploadAssetPartOptions } from "./CalmLensTypes-
|
|
1
|
+
import { At as RetrieveAssetOptions, M as CdnAssetUrlOptions, O as CalmLensAppClientOptions, Ot as RequestOptions, Qt as UploadedAsset, Zt as UploadPresetSubmitAssetOptions, qt as UploadAssetPartOptions } from "./CalmLensTypes-DxxyZt2L.js";
|
|
2
2
|
declare const inspectSymbol: unique symbol;
|
|
3
3
|
declare class CalmLensAppClient {
|
|
4
4
|
#private;
|
|
@@ -37,7 +37,7 @@ declare class CalmLensAppClient {
|
|
|
37
37
|
* mode, chosen when it started, applies when the final part arrives.
|
|
38
38
|
*/
|
|
39
39
|
uploadPart: (partOptions: UploadAssetPartOptions, requestOptions?: RequestOptions) => Promise<UploadedAsset>;
|
|
40
|
-
/** Checks an upload this client made. `
|
|
40
|
+
/** Checks an upload this client made. `classification.moderation.decision` is present when the preset shows decisions. */
|
|
41
41
|
retrieve: (options: RetrieveAssetOptions, requestOptions?: RequestOptions) => Promise<UploadedAsset>;
|
|
42
42
|
};
|
|
43
43
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { S as validateAppClientOptions, ct as invalidConfig, d as checkOptionKeys, o as buildAssetUrl, p as encodePathSegment, st as invalidArgument, u as DEFAULT_CDN_BASE_URL } from "./ModerationContextLimits-
|
|
2
|
-
import { d as prepareSubmitAssetOptions, f as resolveConnectionOptions, i as CalmLensConnection, p as splitsIntoParts, s as expectUploadedAsset, t as APP_OPTION_KEYS } from "./CalmLensOptionKeys-
|
|
1
|
+
import { S as validateAppClientOptions, ct as invalidConfig, d as checkOptionKeys, o as buildAssetUrl, p as encodePathSegment, st as invalidArgument, u as DEFAULT_CDN_BASE_URL } from "./ModerationContextLimits-ZIlK9n2X.js";
|
|
2
|
+
import { d as prepareSubmitAssetOptions, f as resolveConnectionOptions, i as CalmLensConnection, p as splitsIntoParts, s as expectUploadedAsset, t as APP_OPTION_KEYS } from "./CalmLensOptionKeys-CKZs8i3_.js";
|
|
3
3
|
// src/client/CalmLensAppClient.ts
|
|
4
4
|
const inspectSymbol = Symbol.for("nodejs.util.inspect.custom");
|
|
5
5
|
/** `options`, once `checkOptionKeys` finds only keys `operation` takes. */
|
|
@@ -119,7 +119,7 @@ getAssetUrl: (urlOptions) => {
|
|
|
119
119
|
const data = await this.#connection.forCall("assets.uploadPart", requestOptions).uploadPart(`${this.uploadsPath}/${encodedAssetId}/part`, options, this.authHeaders(assetId));
|
|
120
120
|
return expectUploadedAsset(data);
|
|
121
121
|
},
|
|
122
|
-
/** Checks an upload this client made. `
|
|
122
|
+
/** Checks an upload this client made. `classification.moderation.decision` is present when the preset shows decisions. */
|
|
123
123
|
retrieve: async (options, requestOptions) => {
|
|
124
124
|
const { assetId } = checked("assets.retrieve", options);
|
|
125
125
|
const encodedAssetId = encodePathSegment(assetId, "Asset ID");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as resolveLogLevel, D as MAX_IMAGE_UPLOAD_BYTES, E as MAX_DIRECT_IMAGE_UPLOAD_BYTES, M as sleep, O as MAX_NON_IMAGE_UPLOAD_BYTES, Y as CalmLensError, _ as randomUuid, j as CalmLensTransport, k as getRejectedUploadMimeTypeError, lt as API_ERROR_CODES, m as isAcceptedUploadMimeType, ot as SDK_ERROR_CODES, r as selectModerationContextItems, st as invalidArgument, y as stringifyQuery } from "./ModerationContextLimits-
|
|
1
|
+
import { B as resolveLogLevel, D as MAX_IMAGE_UPLOAD_BYTES, E as MAX_DIRECT_IMAGE_UPLOAD_BYTES, M as sleep, O as MAX_NON_IMAGE_UPLOAD_BYTES, Y as CalmLensError, _ as randomUuid, j as CalmLensTransport, k as getRejectedUploadMimeTypeError, lt as API_ERROR_CODES, m as isAcceptedUploadMimeType, ot as SDK_ERROR_CODES, r as selectModerationContextItems, st as invalidArgument, y as stringifyQuery } from "./ModerationContextLimits-ZIlK9n2X.js";
|
|
2
2
|
// src/contract/AssetPayload.js
|
|
3
3
|
const bufferInputToBytes = (value) => {
|
|
4
4
|
if (value instanceof ArrayBuffer) return new Uint8Array(value);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { d as HashListEntry, u as HashList } from "./Classification-CMM2tZpJ-IdIh63n0.js";
|
|
2
|
-
import { $ as FolderPage, $t as VerifyWebhookSignatureOptions, An as Policy, At as RetrieveAssetOptions, B as CreateHashListOptions, Bt as UpdateAssetOptions, D as BatchAssetsResponse, E as BatchAssetsOptions, Et as RemoveAssetContentOptions, Ft as SignUploadTokenOptions, G as DeleteAssetOptions, Gt as UpdateProjectSettingsOptions, Ht as UpdateHashListOptions, I as ClassifyTextOptions, In as AssetInfo, It as SignedAssetUrl, J as EnsureLensesOptions, K as DeleteMetadataFieldOptions, Kt as UpgradePolicyOptions, Lt as SignedUploadToken, M as CdnAssetUrlOptions, Nt as SetPolicyAutomaticUpdatesOptions, Ot as RequestOptions, P as CdnServeOptions, Pn as AssetSearchQuery, Pt as SignAssetUrlOptions, Q as FolderIdOptions, T as AssignPolicyOptions, Tt as PolicyPage, U as CreatePolicyOptions, Ut as UpdateLensOptions, V as CreateLensOptions, Vt as UpdateFolderOptions, W as DecideAssetOptions, Wt as UpdatePolicyOptions, X as EnsureUploadPresetsOptions, Xt as UploadPresetPage, Y as EnsureMetadataFieldsOptions, Yt as UploadPresetIdOptions, Z as EnsureUploadPresetsResponse, _ as AssetPage, _n as Folder, _t as ListLensesOptions, b as AssetTimelinePage, bt as MoveAssetOptions, ct as LensIdOptions, dt as ListAssetTimelineOptions, et as GetAssetInfoOptions, ft as ListAssetsOptions, gt as ListHashListsOptions, ht as ListHashListEntriesOptions, it as HashListPage, jt as RetryAssetOptions, k as CalmLensServerClientOptions, kt as ResetPolicyOptions, lt as LensPage, mt as ListFoldersOptions, nt as HashListEntryPage, o as AssetChildrenPage, on as GetEventsResponse, pt as ListEventsOptions, q as EnsureLensOptions, qt as UploadAssetPartOptions, r as Asset, rt as HashListIdOptions, st as Lens, t as AddHashListEntryOptions, tn as WaitForAssetDecisionOptions, tt as HashListEntryIdOptions, ut as ListAssetChildrenOptions, v as AssetSearchResponse, vn as MetadataFieldsResource, vt as ListPoliciesOptions, wt as PolicyIdOptions, xt as MoveFolderOptions, yn as ProjectSettingsResource, yt as ListUploadPresetsOptions, z as CreateFolderOptions, zt as SubmitAssetOptions } from "./CalmLensTypes-
|
|
3
|
-
import { d as ListPromise, l as CalmLensResponse, r as CdnResponse } from "./WebhookPayload-
|
|
2
|
+
import { $ as FolderPage, $t as VerifyWebhookSignatureOptions, An as Policy, At as RetrieveAssetOptions, B as CreateHashListOptions, Bt as UpdateAssetOptions, D as BatchAssetsResponse, E as BatchAssetsOptions, Et as RemoveAssetContentOptions, Ft as SignUploadTokenOptions, G as DeleteAssetOptions, Gt as UpdateProjectSettingsOptions, Ht as UpdateHashListOptions, I as ClassifyTextOptions, In as AssetInfo, It as SignedAssetUrl, J as EnsureLensesOptions, K as DeleteMetadataFieldOptions, Kt as UpgradePolicyOptions, Lt as SignedUploadToken, M as CdnAssetUrlOptions, Nt as SetPolicyAutomaticUpdatesOptions, Ot as RequestOptions, P as CdnServeOptions, Pn as AssetSearchQuery, Pt as SignAssetUrlOptions, Q as FolderIdOptions, T as AssignPolicyOptions, Tt as PolicyPage, U as CreatePolicyOptions, Ut as UpdateLensOptions, V as CreateLensOptions, Vt as UpdateFolderOptions, W as DecideAssetOptions, Wt as UpdatePolicyOptions, X as EnsureUploadPresetsOptions, Xt as UploadPresetPage, Y as EnsureMetadataFieldsOptions, Yt as UploadPresetIdOptions, Z as EnsureUploadPresetsResponse, _ as AssetPage, _n as Folder, _t as ListLensesOptions, b as AssetTimelinePage, bt as MoveAssetOptions, ct as LensIdOptions, dt as ListAssetTimelineOptions, et as GetAssetInfoOptions, ft as ListAssetsOptions, gt as ListHashListsOptions, ht as ListHashListEntriesOptions, it as HashListPage, jt as RetryAssetOptions, k as CalmLensServerClientOptions, kt as ResetPolicyOptions, lt as LensPage, mt as ListFoldersOptions, nt as HashListEntryPage, o as AssetChildrenPage, on as GetEventsResponse, pt as ListEventsOptions, q as EnsureLensOptions, qt as UploadAssetPartOptions, r as Asset, rt as HashListIdOptions, st as Lens, t as AddHashListEntryOptions, tn as WaitForAssetDecisionOptions, tt as HashListEntryIdOptions, ut as ListAssetChildrenOptions, v as AssetSearchResponse, vn as MetadataFieldsResource, vt as ListPoliciesOptions, wt as PolicyIdOptions, xt as MoveFolderOptions, yn as ProjectSettingsResource, yt as ListUploadPresetsOptions, z as CreateFolderOptions, zt as SubmitAssetOptions } from "./CalmLensTypes-DxxyZt2L.js";
|
|
3
|
+
import { d as ListPromise, l as CalmLensResponse, r as CdnResponse } from "./WebhookPayload-D_yWJA9M.js";
|
|
4
4
|
interface TransportRequest {
|
|
5
5
|
/** The client method sending the request, such as `assets.retrieve`, for hooks and logs. */
|
|
6
6
|
operation?: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { C as validateBatchAssetsOptions, F as isReactNativeRuntime, L as copyLastResponse, P as isBrowserRuntime, R as listPages, Y as CalmLensError, a as appendAssetLocation, b as toTextAssetOptions, ct as invalidConfig, d as checkOptionKeys, g as pollForDecision, l as validateSignAssetUrlOptions, o as buildAssetUrl, ot as SDK_ERROR_CODES, p as encodePathSegment, s as getAssetInfo, st as invalidArgument, u as DEFAULT_CDN_BASE_URL, w as validateServerClientOptions, y as stringifyQuery, z as readEnv } from "./ModerationContextLimits-
|
|
2
|
-
import { c as getMockHooks, d as prepareSubmitAssetOptions, f as resolveConnectionOptions, i as CalmLensConnection, l as invalidPayload, m as validateCallOptions, n as NULLABLE_OPTION_KEYS, o as expectAsset, p as splitsIntoParts, r as SERVER_OPTION_KEYS, u as newIdempotencyKey } from "./CalmLensOptionKeys-
|
|
3
|
-
import { n as sha256Hex, r as timingSafeEqual, t as hmacSha256Hex } from "./CryptoUtils-
|
|
1
|
+
import { C as validateBatchAssetsOptions, F as isReactNativeRuntime, L as copyLastResponse, P as isBrowserRuntime, R as listPages, Y as CalmLensError, a as appendAssetLocation, b as toTextAssetOptions, ct as invalidConfig, d as checkOptionKeys, g as pollForDecision, l as validateSignAssetUrlOptions, o as buildAssetUrl, ot as SDK_ERROR_CODES, p as encodePathSegment, s as getAssetInfo, st as invalidArgument, u as DEFAULT_CDN_BASE_URL, w as validateServerClientOptions, y as stringifyQuery, z as readEnv } from "./ModerationContextLimits-ZIlK9n2X.js";
|
|
2
|
+
import { c as getMockHooks, d as prepareSubmitAssetOptions, f as resolveConnectionOptions, i as CalmLensConnection, l as invalidPayload, m as validateCallOptions, n as NULLABLE_OPTION_KEYS, o as expectAsset, p as splitsIntoParts, r as SERVER_OPTION_KEYS, u as newIdempotencyKey } from "./CalmLensOptionKeys-CKZs8i3_.js";
|
|
3
|
+
import { n as sha256Hex, r as timingSafeEqual, t as hmacSha256Hex } from "./CryptoUtils-BLCa-oZe-DKr3LmN6.js";
|
|
4
4
|
// src/contract/JsonUtils.js
|
|
5
5
|
const stringifyJsonCanonical = (value) => JSON.stringify(value, (_key, nestedValue) => {
|
|
6
6
|
if (!nestedValue || typeof nestedValue !== "object" || Array.isArray(nestedValue)) return nestedValue;
|
|
@@ -5017,11 +5017,11 @@ declare const ASSET_CLASSIFICATION_SCHEMA: zod.ZodObject<{
|
|
|
5017
5017
|
"processing-error": "processing-error";
|
|
5018
5018
|
"resolution-limit": "resolution-limit";
|
|
5019
5019
|
"too-many-items": "too-many-items";
|
|
5020
|
-
"website-unavailable": "website-unavailable";
|
|
5021
5020
|
"type-mismatch": "type-mismatch";
|
|
5022
5021
|
"undecodable-content": "undecodable-content";
|
|
5023
5022
|
"unsupported-format": "unsupported-format";
|
|
5024
5023
|
"uploads-paused": "uploads-paused";
|
|
5024
|
+
"website-unavailable": "website-unavailable";
|
|
5025
5025
|
}>>;
|
|
5026
5026
|
updatedAt: zod.ZodNullable<zod.ZodNumber>;
|
|
5027
5027
|
completedAt: zod.ZodNullable<zod.ZodNumber>;
|
|
@@ -10140,11 +10140,11 @@ declare const ASSET_SCHEMA: zod.ZodObject<{
|
|
|
10140
10140
|
"processing-error": "processing-error";
|
|
10141
10141
|
"resolution-limit": "resolution-limit";
|
|
10142
10142
|
"too-many-items": "too-many-items";
|
|
10143
|
-
"website-unavailable": "website-unavailable";
|
|
10144
10143
|
"type-mismatch": "type-mismatch";
|
|
10145
10144
|
"undecodable-content": "undecodable-content";
|
|
10146
10145
|
"unsupported-format": "unsupported-format";
|
|
10147
10146
|
"uploads-paused": "uploads-paused";
|
|
10147
|
+
"website-unavailable": "website-unavailable";
|
|
10148
10148
|
}>>;
|
|
10149
10149
|
updatedAt: zod.ZodNullable<zod.ZodNumber>;
|
|
10150
10150
|
completedAt: zod.ZodNullable<zod.ZodNumber>;
|
|
@@ -15396,11 +15396,11 @@ declare const ASSET_SEARCH_RESULT_SCHEMA: zod.ZodObject<{
|
|
|
15396
15396
|
"processing-error": "processing-error";
|
|
15397
15397
|
"resolution-limit": "resolution-limit";
|
|
15398
15398
|
"too-many-items": "too-many-items";
|
|
15399
|
-
"website-unavailable": "website-unavailable";
|
|
15400
15399
|
"type-mismatch": "type-mismatch";
|
|
15401
15400
|
"undecodable-content": "undecodable-content";
|
|
15402
15401
|
"unsupported-format": "unsupported-format";
|
|
15403
15402
|
"uploads-paused": "uploads-paused";
|
|
15403
|
+
"website-unavailable": "website-unavailable";
|
|
15404
15404
|
}>>;
|
|
15405
15405
|
updatedAt: zod.ZodNullable<zod.ZodNumber>;
|
|
15406
15406
|
completedAt: zod.ZodNullable<zod.ZodNumber>;
|
|
@@ -36368,11 +36368,11 @@ declare const EVENT_TYPE_INFO: {
|
|
|
36368
36368
|
"processing-error": "processing-error";
|
|
36369
36369
|
"resolution-limit": "resolution-limit";
|
|
36370
36370
|
"too-many-items": "too-many-items";
|
|
36371
|
-
"website-unavailable": "website-unavailable";
|
|
36372
36371
|
"type-mismatch": "type-mismatch";
|
|
36373
36372
|
"undecodable-content": "undecodable-content";
|
|
36374
36373
|
"unsupported-format": "unsupported-format";
|
|
36375
36374
|
"uploads-paused": "uploads-paused";
|
|
36375
|
+
"website-unavailable": "website-unavailable";
|
|
36376
36376
|
}>>;
|
|
36377
36377
|
};
|
|
36378
36378
|
/** Example data, used for synthetic test sends (`createSampleEvent`). */
|
|
@@ -36431,11 +36431,11 @@ declare const EVENT_TYPE_INFO: {
|
|
|
36431
36431
|
"processing-error": "processing-error";
|
|
36432
36432
|
"resolution-limit": "resolution-limit";
|
|
36433
36433
|
"too-many-items": "too-many-items";
|
|
36434
|
-
"website-unavailable": "website-unavailable";
|
|
36435
36434
|
"type-mismatch": "type-mismatch";
|
|
36436
36435
|
"undecodable-content": "undecodable-content";
|
|
36437
36436
|
"unsupported-format": "unsupported-format";
|
|
36438
36437
|
"uploads-paused": "uploads-paused";
|
|
36438
|
+
"website-unavailable": "website-unavailable";
|
|
36439
36439
|
}>;
|
|
36440
36440
|
}, zod.core.$strip>;
|
|
36441
36441
|
};
|
|
@@ -36511,6 +36511,72 @@ declare const EVENT_TYPE_INFO: {
|
|
|
36511
36511
|
totalSections: zod.ZodNumber;
|
|
36512
36512
|
}, zod.core.$strip>;
|
|
36513
36513
|
};
|
|
36514
|
+
readonly "asset.media-ready": {
|
|
36515
|
+
id: "asset.media-ready";
|
|
36516
|
+
name: string;
|
|
36517
|
+
description: string;
|
|
36518
|
+
category: EventCategory;
|
|
36519
|
+
severity: EventSeverity;
|
|
36520
|
+
/** Whether the in-app connector (notification bell) subscribes to the type by default. */
|
|
36521
|
+
notify: boolean;
|
|
36522
|
+
/**
|
|
36523
|
+
* The project-wide permission needed to see events of this type (portal feed, public events
|
|
36524
|
+
* feed) and to subscribe a connector to it.
|
|
36525
|
+
*/
|
|
36526
|
+
permission: PermissionAction;
|
|
36527
|
+
/** Types of unreleased features are left out of the published contract until enabled. */
|
|
36528
|
+
enabled?: boolean;
|
|
36529
|
+
fields: {
|
|
36530
|
+
assetName: EventFieldDefinition<zod.ZodOptional<zod.ZodNullable<zod.ZodString>>>;
|
|
36531
|
+
assetType: EventFieldDefinition<zod.ZodOptional<zod.ZodNullable<zod.ZodEnum<{
|
|
36532
|
+
audio: "audio";
|
|
36533
|
+
file: "file";
|
|
36534
|
+
image: "image";
|
|
36535
|
+
"multimedia-document": "multimedia-document";
|
|
36536
|
+
"plaintext-document": "plaintext-document";
|
|
36537
|
+
video: "video";
|
|
36538
|
+
website: "website";
|
|
36539
|
+
}>>>>;
|
|
36540
|
+
};
|
|
36541
|
+
/** Example data, used for synthetic test sends (`createSampleEvent`). */
|
|
36542
|
+
example: NoInfer<{
|
|
36543
|
+
assetName?: string | null | undefined;
|
|
36544
|
+
assetType?: "audio" | "file" | "image" | "multimedia-document" | "plaintext-document" | "video" | "website" | null | undefined;
|
|
36545
|
+
}>;
|
|
36546
|
+
factInfo: {
|
|
36547
|
+
label: string;
|
|
36548
|
+
description: string;
|
|
36549
|
+
display: EventFieldDisplay;
|
|
36550
|
+
/** Kept in the data but left out of rendered messages (usually an ID shown by another field). */
|
|
36551
|
+
hidden?: boolean;
|
|
36552
|
+
/**
|
|
36553
|
+
* Personal or account-level data that stays in the portal. Webhook, Slack and email deliveries,
|
|
36554
|
+
* and the public events feed, leave the fact out and word the title and description without it.
|
|
36555
|
+
*/
|
|
36556
|
+
inAppOnly?: boolean;
|
|
36557
|
+
/**
|
|
36558
|
+
* A person's name: `actor` names the event's `actor`, `member` the member in the `member-user-id`
|
|
36559
|
+
* fact. Deleting their account removes it from the events that name them.
|
|
36560
|
+
*/
|
|
36561
|
+
names?: "actor" | "member";
|
|
36562
|
+
/** Display names for `enum` and `list` values that don't read well humanized. */
|
|
36563
|
+
valueLabels?: Readonly<Record<string, string>>;
|
|
36564
|
+
schema: zod.ZodType<unknown, unknown, zod.core.$ZodTypeInternals<unknown, unknown>>;
|
|
36565
|
+
key: string;
|
|
36566
|
+
}[];
|
|
36567
|
+
values: zod.ZodObject<{
|
|
36568
|
+
assetName: zod.ZodOptional<zod.ZodNullable<zod.ZodString>>;
|
|
36569
|
+
assetType: zod.ZodOptional<zod.ZodNullable<zod.ZodEnum<{
|
|
36570
|
+
audio: "audio";
|
|
36571
|
+
file: "file";
|
|
36572
|
+
image: "image";
|
|
36573
|
+
"multimedia-document": "multimedia-document";
|
|
36574
|
+
"plaintext-document": "plaintext-document";
|
|
36575
|
+
video: "video";
|
|
36576
|
+
website: "website";
|
|
36577
|
+
}>>>;
|
|
36578
|
+
}, zod.core.$strip>;
|
|
36579
|
+
};
|
|
36514
36580
|
readonly "asset.deleted": {
|
|
36515
36581
|
id: "asset.deleted";
|
|
36516
36582
|
name: string;
|
|
@@ -38176,6 +38242,7 @@ declare const PUBLIC_EVENT_SCHEMA: zod.ZodObject<{
|
|
|
38176
38242
|
"asset.hash-matched": "asset.hash-matched";
|
|
38177
38243
|
"asset.limited": "asset.limited";
|
|
38178
38244
|
"asset.link-flagged": "asset.link-flagged";
|
|
38245
|
+
"asset.media-ready": "asset.media-ready";
|
|
38179
38246
|
"asset.progress-updated": "asset.progress-updated";
|
|
38180
38247
|
"asset.purged": "asset.purged";
|
|
38181
38248
|
"asset.region-restricted": "asset.region-restricted";
|
|
@@ -42376,6 +42443,7 @@ declare const GET_EVENTS_QUERY_SCHEMA: zod.ZodObject<{
|
|
|
42376
42443
|
"asset.hash-matched": "asset.hash-matched";
|
|
42377
42444
|
"asset.limited": "asset.limited";
|
|
42378
42445
|
"asset.link-flagged": "asset.link-flagged";
|
|
42446
|
+
"asset.media-ready": "asset.media-ready";
|
|
42379
42447
|
"asset.progress-updated": "asset.progress-updated";
|
|
42380
42448
|
"asset.purged": "asset.purged";
|
|
42381
42449
|
"asset.region-restricted": "asset.region-restricted";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { F as CdnTransform, O as CalmLensAppClientOptions, en as ViewerClaims, g as AssetModerationStatus, i as AssetAvailability } from "./CalmLensTypes-
|
|
2
|
-
import { t as CalmLensAppClient } from "./CalmLensAppClient-
|
|
1
|
+
import { F as CdnTransform, O as CalmLensAppClientOptions, en as ViewerClaims, g as AssetModerationStatus, i as AssetAvailability } from "./CalmLensTypes-DxxyZt2L.js";
|
|
2
|
+
import { t as CalmLensAppClient } from "./CalmLensAppClient-Btp8f-34.js";
|
|
3
3
|
import { o as UploadFileIconFamily } from "./FileIcons-4qSX7DW2.js";
|
|
4
4
|
/**
|
|
5
5
|
* The text the asset viewers show, keyed by name. `{name}` placeholders are filled in when shown.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Y as CalmLensError, a as appendAssetLocation, c as toUrlViewerClaims, s as getAssetInfo, v as serializeTransform, x as transformSelector } from "./ModerationContextLimits-
|
|
2
|
-
import { o as placeholderHashToDataURL } from "./UploadController-
|
|
1
|
+
import { Y as CalmLensError, a as appendAssetLocation, c as toUrlViewerClaims, s as getAssetInfo, v as serializeTransform, x as transformSelector } from "./ModerationContextLimits-ZIlK9n2X.js";
|
|
2
|
+
import { o as placeholderHashToDataURL } from "./UploadController-D-14HWII.js";
|
|
3
3
|
import { a as getFileIcon, c as renderFileIconSvg } from "./FileIcons-M6dzjFxd.js";
|
|
4
4
|
// src/ui/viewers/ViewerAsset.ts
|
|
5
5
|
/** Spreadsheet MIME types, as `content.format` reports them (compared lower-cased). */
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
// src/contract/CryptoUtils-
|
|
1
|
+
// src/contract/CryptoUtils-BLCa-oZe.js
|
|
2
2
|
const encoder = new TextEncoder();
|
|
3
3
|
/** Lowercase hex of `bytes`, two characters per byte. */
|
|
4
4
|
const bytesToHex = (bytes) => Array.from(bytes instanceof Uint8Array ? bytes : new Uint8Array(bytes), (byte) => byte.toString(16).padStart(2, "0")).join("");
|
|
5
|
-
/** SHA-256 of the UTF-8 encoding of `value`, as lowercase hex. */
|
|
6
5
|
const sha256Hex = async (value) => bytesToHex(await crypto.subtle.digest("SHA-256", encoder.encode(value)));
|
|
7
6
|
/** HMAC-SHA256 of `message` keyed with `secret` (both UTF-8 encoded), as lowercase hex. */
|
|
8
7
|
const hmacSha256Hex = async (secret, message) => {
|