calmlens 0.27.5 → 0.28.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/README.md +2 -2
- package/bin/calmlens.js +48 -26
- package/cjs/{BrowserUpload-DJZY1LSU.d.ts → BrowserUpload-CRbCsX7a.d.ts} +2 -2
- package/cjs/{BrowserUpload-DhruIgFN.js → BrowserUpload-Dz4UwTTJ.js} +1 -1
- package/cjs/{CalmLensAppClient-BA_xaNHY.js → CalmLensAppClient-B0QZ1oJV.js} +3 -3
- package/{esm/CalmLensAppClient-DzoSqUgG.d.ts → cjs/CalmLensAppClient-B3u6BlP5.d.ts} +2 -2
- package/cjs/{CalmLensOptionKeys-BvLQghl-.js → CalmLensOptionKeys-Cat8CgOn.js} +2 -2
- package/cjs/{CalmLensServerClient-D3K5HS9v.d.ts → CalmLensServerClient-B8ntjNL3.d.ts} +6 -6
- package/cjs/{CalmLensServerClient-D55xDZm4.js → CalmLensServerClient-CQdvhCGg.js} +14 -14
- package/cjs/{CalmLensTypes-OWZsGvBX.d.ts → CalmLensTypes-CtO4Dieu.d.ts} +79 -8
- package/{esm/Core-CTO_Eh0l.d.ts → cjs/Core-BJaLU71Q.d.ts} +2 -2
- package/cjs/{Core-kKGmyk5V.js → Core-DCnnUsgF.js} +7 -4
- package/cjs/{CryptoUtils-B_x8lMIx-YBW1-bvL.js → CryptoUtils-BLCa-oZe-leCkr1ko.js} +1 -2
- package/cjs/{ModerationContextLimits-Cxaob3tc.js → ModerationContextLimits-_knOVCH0.js} +63 -8
- package/cjs/{ReactUpload-BDXV4aHT.d.ts → ReactUpload-BGUkcMpg.d.ts} +1 -1
- package/cjs/{ReactUpload-Cx3Hi7xt.js → ReactUpload-BtmIrdky.js} +1 -1
- package/{esm/TestTriggers-Dnukm-jm-DoEB7jJc.d.ts → cjs/TestTriggers-dognME9k-PWyIfHMI.d.ts} +1 -2
- package/cjs/{TestTriggers-Cvi7e2KA-DcT1pc_W.js → TestTriggers-uL2Ec8Vt-cPmmKvYd.js} +14 -15
- package/cjs/{UploadController-CC1afxmL.js → UploadController-CEL3N4Ae.js} +2 -2
- package/cjs/{WebhookPayload-CrMU6lg0.d.ts → WebhookPayload-DZadhbAJ.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-DQUZYLVY.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 +5 -5
- 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.d.ts +1 -1
- package/cjs/test-inputs.js +13 -13
- package/cjs/testing.d.ts +36 -7
- package/cjs/testing.js +112 -43
- package/cjs/{ui-DAbpyM2Z.d.ts → ui-BGywTQ2M.d.ts} +2 -2
- package/cjs/{ui-I75EvP9r.js → ui-DVQm0TFJ.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-DJZY1LSU.d.ts → BrowserUpload-CRbCsX7a.d.ts} +2 -2
- package/esm/{BrowserUpload-CejeWw5r.js → BrowserUpload-DSq5Ezo1.js} +1 -1
- package/esm/{CalmLensAppClient-BxkCVPCl.js → CalmLensAppClient-B1QpSXYm.js} +3 -3
- package/{cjs/CalmLensAppClient-DzoSqUgG.d.ts → esm/CalmLensAppClient-B3u6BlP5.d.ts} +2 -2
- package/esm/{CalmLensOptionKeys-DC9FUO43.js → CalmLensOptionKeys-BYqFZ0FP.js} +2 -2
- package/esm/{CalmLensServerClient-D3K5HS9v.d.ts → CalmLensServerClient-B8ntjNL3.d.ts} +6 -6
- package/esm/{CalmLensServerClient-D-TIIQp2.js → CalmLensServerClient-D2Vr_jTR.js} +10 -10
- package/esm/{CalmLensTypes-OWZsGvBX.d.ts → CalmLensTypes-CtO4Dieu.d.ts} +79 -8
- package/{cjs/Core-CTO_Eh0l.d.ts → esm/Core-BJaLU71Q.d.ts} +2 -2
- package/esm/{Core-B85V5dxv.js → Core-Dz7BAias.js} +7 -4
- package/esm/{CryptoUtils-B_x8lMIx-DhuWGzqn.js → CryptoUtils-BLCa-oZe-DKr3LmN6.js} +1 -2
- package/esm/{ModerationContextLimits-Tev2lxE0.js → ModerationContextLimits-DaFaXt45.js} +46 -9
- package/esm/{ReactUpload-BDXV4aHT.d.ts → ReactUpload-BGUkcMpg.d.ts} +1 -1
- package/esm/{ReactUpload-B7QXMSWJ.js → ReactUpload-kSzn3SOj.js} +1 -1
- package/{cjs/TestTriggers-Dnukm-jm-DoEB7jJc.d.ts → esm/TestTriggers-dognME9k-PWyIfHMI.d.ts} +1 -2
- package/esm/{TestTriggers-Cvi7e2KA-BA83CRJb.js → TestTriggers-uL2Ec8Vt-DYbTEJWm.js} +11 -12
- package/esm/{UploadController-D7XmzO-p.js → UploadController--Qz3DP2W.js} +2 -2
- package/esm/{WebhookPayload-CrMU6lg0.d.ts → WebhookPayload-DZadhbAJ.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-DQUZYLVY.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 +5 -5
- 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.d.ts +1 -1
- package/esm/test-inputs.js +1 -1
- package/esm/testing.d.ts +36 -7
- package/esm/testing.js +103 -34
- package/esm/{ui-cE1lyljs.js → ui-B951EpwC.js} +2 -2
- package/esm/{ui-DAbpyM2Z.d.ts → ui-BGywTQ2M.d.ts} +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/README.md
CHANGED
|
@@ -36,8 +36,8 @@ const client = new CalmLensServerClient({
|
|
|
36
36
|
// Text (comments, captions, bios): waits for the decision
|
|
37
37
|
const comment = await client.text.classify({ text: "Great photo!", externalId: "comment-42" });
|
|
38
38
|
|
|
39
|
-
const {
|
|
40
|
-
if (
|
|
39
|
+
const { decision } = comment.classification.moderation;
|
|
40
|
+
if (decision === "allowed" || decision === "limited") {
|
|
41
41
|
// publish it; keep "limited" out of recommendations, trending and notifications
|
|
42
42
|
} else {
|
|
43
43
|
// "age-restricted": show it only behind your own age check; "blocked" or "purged": don't publish it
|
package/bin/calmlens.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { readFile as readFile2 } from "node:fs/promises";
|
|
4
4
|
import { parseArgs } from "node:util";
|
|
5
5
|
// package.json
|
|
6
|
-
var version = "0.
|
|
6
|
+
var version = "0.28.0";
|
|
7
7
|
|
|
8
8
|
// src/contract/ModerationCategories-CHFRoeWV.js
|
|
9
9
|
var CLASSIFICATION_CATEGORIES = [
|
|
@@ -64,6 +64,7 @@ var API_ERROR_CODES = {
|
|
|
64
64
|
INVALID_IMAGE: "image/invalid",
|
|
65
65
|
IMAGE_TOO_LARGE: "image/too-large",
|
|
66
66
|
FREE_UPLOADS_EXHAUSTED: "usage/free-uploads-exhausted",
|
|
67
|
+
WEBSITE_BILLING_REQUIRED: "payment/billing-required",
|
|
67
68
|
UPLOADS_PAUSED: "usage/uploads-paused",
|
|
68
69
|
UNSUPPORTED_UPLOAD_TYPE: "upload/unsupported-type",
|
|
69
70
|
INVALID_UPLOAD_PAYLOAD: "upload-payload/invalid",
|
|
@@ -103,6 +104,7 @@ var API_ERROR_CODES = {
|
|
|
103
104
|
HASH_LIST_ENTRY_NOT_FOUND: "hash-list-entry/not-found",
|
|
104
105
|
HASH_LIST_LIMIT_REACHED: "hash-list/limit-reached",
|
|
105
106
|
HASH_LIST_ENTRY_LIMIT_REACHED: "hash-list-entry/limit-reached",
|
|
107
|
+
HASH_LIST_ENTRY_QUALITY_TOO_LOW: "hash-list-entry/quality-too-low",
|
|
106
108
|
HASH_LIST_ASSET_NOT_HASHED: "hash-list/asset-not-hashed",
|
|
107
109
|
POLICY_NOT_FOUND: "policy/not-found",
|
|
108
110
|
POLICY_REVISION_CONFLICT: "policy/revision-conflict",
|
|
@@ -882,7 +884,7 @@ class CalmLensTransport {
|
|
|
882
884
|
}
|
|
883
885
|
}
|
|
884
886
|
|
|
885
|
-
// src/contract/SharedConstants-
|
|
887
|
+
// src/contract/SharedConstants-D-QkbICw.js
|
|
886
888
|
var IMPERSONATION_COOKIE_NAME = "CL_impersonation";
|
|
887
889
|
var DAY_MS = 86400000;
|
|
888
890
|
var YEAR_MS = 365 * DAY_MS;
|
|
@@ -995,7 +997,7 @@ var FIRST_PARTY_COOKIES = {
|
|
|
995
997
|
},
|
|
996
998
|
ASSET_DASHBOARD_STATE: {
|
|
997
999
|
name: "CL_assetDashboardState",
|
|
998
|
-
description: "Remembers your asset dashboard view (view mode
|
|
1000
|
+
description: "Remembers your asset dashboard view (view mode and metadata grouping)",
|
|
999
1001
|
expirationDescription: "1 year",
|
|
1000
1002
|
expirationMs: YEAR_MS,
|
|
1001
1003
|
type: "functional",
|
|
@@ -1043,6 +1045,14 @@ var FIRST_PARTY_COOKIES = {
|
|
|
1043
1045
|
type: "functional",
|
|
1044
1046
|
providerName: "CalmLens"
|
|
1045
1047
|
},
|
|
1048
|
+
CHATGPT_AD_CLICK: {
|
|
1049
|
+
name: "CL_chatgptAdClick",
|
|
1050
|
+
description: "Links a ChatGPT ad click to signups, moderation checks and credit checkouts",
|
|
1051
|
+
expirationDescription: "30 days",
|
|
1052
|
+
expirationMs: 30 * DAY_MS,
|
|
1053
|
+
type: "marketing",
|
|
1054
|
+
providerName: "CalmLens"
|
|
1055
|
+
},
|
|
1046
1056
|
SEARCH_SDK_LANGUAGE: {
|
|
1047
1057
|
name: "CL_searchSdkLanguage",
|
|
1048
1058
|
description: "Remembers the SDK you chose to filter documentation search results by",
|
|
@@ -1687,25 +1697,37 @@ var appendAssetLocation = (assetUrl, location) => {
|
|
|
1687
1697
|
}
|
|
1688
1698
|
return `${path}${viewerClaimsQuery(viewerClaims)}`;
|
|
1689
1699
|
};
|
|
1700
|
+
var appendSignedLocation = (signedUrl, location) => {
|
|
1701
|
+
const resourcePath = location.resource === undefined ? "" : `/${ASSET_RESOURCE_PATHS[location.resource]}`;
|
|
1702
|
+
if (!signedUrl.endsWith(resourcePath)) {
|
|
1703
|
+
throw new CalmLensError(SDK_ERROR_CODES.INVALID_RESPONSE, {
|
|
1704
|
+
message: "The signed asset URL doesn't end in the resource it was signed for"
|
|
1705
|
+
});
|
|
1706
|
+
}
|
|
1707
|
+
return `${signedUrl}${appendAssetLocation("", location).slice(resourcePath.length)}`;
|
|
1708
|
+
};
|
|
1690
1709
|
var buildAssetUrl = (cdnBaseUrl, projectId, options) => {
|
|
1691
1710
|
const { assetId, externalId, resource, lens, transform, viewerClaims } = options;
|
|
1692
1711
|
const base = `${cdnBaseUrl.replace(/\/+$/, "")}/assets/${encodePathSegment(projectId, "Project ID")}/${getAssetSegment({ assetId, externalId })}`;
|
|
1693
1712
|
return appendAssetLocation(base, { resource, lens, transform, viewerClaims });
|
|
1694
1713
|
};
|
|
1695
1714
|
var validateSignAssetUrlOptions = (options) => {
|
|
1696
|
-
const { expiresIn
|
|
1715
|
+
const { expiresIn } = options;
|
|
1697
1716
|
if (expiresIn !== undefined && (!Number.isInteger(expiresIn) || expiresIn < 1 || expiresIn > MAX_SIGNED_URL_EXPIRES_IN)) {
|
|
1698
1717
|
throw invalidArgument(`expiresIn must be a whole number from 1 to ${MAX_SIGNED_URL_EXPIRES_IN}`);
|
|
1699
1718
|
}
|
|
1700
|
-
if (original !== undefined && typeof original !== "boolean") {
|
|
1701
|
-
throw invalidArgument("original must be a boolean");
|
|
1702
|
-
}
|
|
1703
1719
|
getAssetSegment(options);
|
|
1704
1720
|
appendAssetLocation("", options);
|
|
1705
1721
|
};
|
|
1722
|
+
var assetUrlOf = (url) => {
|
|
1723
|
+
const path = (url.split("?", 1)[0] ?? "").replace(/\/+$/, "");
|
|
1724
|
+
const parts = path.split("/");
|
|
1725
|
+
const assets = parts.lastIndexOf("assets");
|
|
1726
|
+
return assets >= 3 && parts.length > assets + 3 ? parts.slice(0, assets + 3).join("/") : path;
|
|
1727
|
+
};
|
|
1706
1728
|
var splitAssetUrl = (url) => {
|
|
1707
|
-
const
|
|
1708
|
-
const base =
|
|
1729
|
+
const query = url.split("?", 2)[1];
|
|
1730
|
+
const base = assetUrlOf(url);
|
|
1709
1731
|
const raw = query ? new URLSearchParams(query).get("viewerClaims") : null;
|
|
1710
1732
|
if (raw === null)
|
|
1711
1733
|
return { base };
|
|
@@ -2451,7 +2473,7 @@ var SERVER_OPTION_KEYS = {
|
|
|
2451
2473
|
"assets.search": ["mode", "pageSize", "query"],
|
|
2452
2474
|
"assets.update": ["assetId", "description", "externalId", "externalUrl", "metadata", "name", "tags", "visibility"],
|
|
2453
2475
|
"assets.uploadPart": ["assetId", "part", "wait"],
|
|
2454
|
-
"cdn.signAssetUrl": ["assetId", "expiresIn", "externalId", "lens", "
|
|
2476
|
+
"cdn.signAssetUrl": ["assetId", "expiresIn", "externalId", "lens", "projectId", "resource", "resource", "transform", "viewerClaims"],
|
|
2455
2477
|
ensureLens: ["active", "description", "identifier", "name", "transform", "type"],
|
|
2456
2478
|
ensureLenses: ["lenses"],
|
|
2457
2479
|
"events.list": ["assetId", "cursor", "pageSize", "types"],
|
|
@@ -2510,7 +2532,7 @@ var NULLABLE_OPTION_KEYS = {
|
|
|
2510
2532
|
"text.classify": ["authorId", "context", "description", "externalId", "folderId", "metadata", "processingOptions", "tags", "uploadPresetId", "visibility"]
|
|
2511
2533
|
};
|
|
2512
2534
|
|
|
2513
|
-
// src/contract/CryptoUtils-
|
|
2535
|
+
// src/contract/CryptoUtils-BLCa-oZe.js
|
|
2514
2536
|
var encoder = new TextEncoder;
|
|
2515
2537
|
var bytesToHex = (bytes) => Array.from(bytes instanceof Uint8Array ? bytes : new Uint8Array(bytes), (byte) => byte.toString(16).padStart(2, "0")).join("");
|
|
2516
2538
|
var sha256Hex = async (value) => bytesToHex(await crypto.subtle.digest("SHA-256", encoder.encode(value)));
|
|
@@ -2814,13 +2836,13 @@ class CalmLensServerClient {
|
|
|
2814
2836
|
signAssetUrl: async (signOptions, requestOptions) => {
|
|
2815
2837
|
const options = checked("cdn.signAssetUrl", signOptions);
|
|
2816
2838
|
validateSignAssetUrlOptions(options);
|
|
2817
|
-
const { projectId, assetId, externalId, expiresIn,
|
|
2839
|
+
const { projectId, assetId, externalId, expiresIn, ...location } = options;
|
|
2818
2840
|
const project = requireId(projectId ?? this.#settings.projectId, "Project ID");
|
|
2819
2841
|
const signed = await this.#send("cdn.signAssetUrl", requestOptions, "POST", `/projects/${project}/signed-asset-urls`, {
|
|
2820
2842
|
body: {
|
|
2821
2843
|
...assetId !== undefined ? { assetId } : { externalId },
|
|
2822
2844
|
expiresIn: expiresIn ?? DEFAULT_SIGNED_URL_EXPIRES_IN,
|
|
2823
|
-
|
|
2845
|
+
...location.resource !== undefined ? { resource: location.resource } : {}
|
|
2824
2846
|
}
|
|
2825
2847
|
});
|
|
2826
2848
|
if (!signed || typeof signed.url !== "string" || !signed.url || typeof signed.expiresAt !== "number") {
|
|
@@ -2828,7 +2850,7 @@ class CalmLensServerClient {
|
|
|
2828
2850
|
message: "The API returned no signed asset URL"
|
|
2829
2851
|
});
|
|
2830
2852
|
}
|
|
2831
|
-
return copyLastResponse({ url:
|
|
2853
|
+
return copyLastResponse({ url: appendSignedLocation(signed.url, location), expiresAt: signed.expiresAt }, signed);
|
|
2832
2854
|
},
|
|
2833
2855
|
getAssetInfo: (url, options = {}) => getAssetInfo(url, { ...options, fetch: this.#settings.cdnFetch }),
|
|
2834
2856
|
serve: async (options, requestOptions) => {
|
|
@@ -8869,7 +8891,7 @@ function refine(fn, _params = {}) {
|
|
|
8869
8891
|
function superRefine(fn, params) {
|
|
8870
8892
|
return _superRefine(fn, params);
|
|
8871
8893
|
}
|
|
8872
|
-
// src/contract/LazySchema-
|
|
8894
|
+
// src/contract/LazySchema-BKMpWIaF.js
|
|
8873
8895
|
var registryMap = globalRegistry._map;
|
|
8874
8896
|
var lazySchema = (build) => {
|
|
8875
8897
|
let schema;
|
|
@@ -8877,10 +8899,10 @@ var lazySchema = (build) => {
|
|
|
8877
8899
|
if (!schema) {
|
|
8878
8900
|
const built = build();
|
|
8879
8901
|
schema = built;
|
|
8902
|
+
const internals = built._zod;
|
|
8880
8903
|
const meta = registryMap.get(built);
|
|
8881
8904
|
if (meta !== undefined)
|
|
8882
8905
|
registryMap.set(proxy, meta);
|
|
8883
|
-
const internals = built._zod;
|
|
8884
8906
|
const process2 = internals.processJSONSchema;
|
|
8885
8907
|
if (process2)
|
|
8886
8908
|
internals.processJSONSchema = (context, json, params) => {
|
|
@@ -8930,7 +8952,7 @@ var lazySchema = (build) => {
|
|
|
8930
8952
|
return proxy;
|
|
8931
8953
|
};
|
|
8932
8954
|
|
|
8933
|
-
// src/contract/Jurisdiction-
|
|
8955
|
+
// src/contract/Jurisdiction-uODFGQGo.js
|
|
8934
8956
|
var JURISDICTIONS = {
|
|
8935
8957
|
global: {
|
|
8936
8958
|
name: "Global",
|
|
@@ -8979,7 +9001,7 @@ Object.keys(JURISDICTIONS).filter((code) => JURISDICTIONS[code].optional);
|
|
|
8979
9001
|
var COUNTRIES = new Set("AD AE AF AG AI AL AM AO AQ AR AS AT AU AW AX AZ BA BB BD BE BF BG BH BI BJ BL BM BN BO BQ BR BS BT BV BW BY BZ CA CC CD CF CG CH CI CK CL CM CN CO CR CU CV CW CX CY CZ DE DJ DK DM DO DZ EC EE EG EH ER ES ET FI FJ FK FM FO FR GA GB GD GE GF GG GH GI GL GM GN GP GQ GR GS GT GU GW GY HK HM HN HR HT HU ID IE IL IM IN IO IQ IR IS IT JE JM JO JP KE KG KH KI KM KN KP KR KW KY KZ LA LB LC LI LK LR LS LT LU LV LY MA MC MD ME MF MG MH MK ML MM MN MO MP MQ MR MS MT MU MV MW MX MY MZ NA NC NE NF NG NI NL NO NP NR NU NZ OM PA PE PF PG PH PK PL PM PN PR PS PT PW PY QA RE RO RS RU RW SA SB SC SD SE SG SH SI SJ SK SL SM SN SO SR SS ST SV SX SY SZ TC TD TF TG TH TJ TK TL TM TN TO TR TT TV TW TZ UA UG UM US UY UZ VA VC VE VG VI VN VU WF WS YE YT ZA ZM ZW".split(" "));
|
|
8980
9002
|
var EU_COUNTRIES2 = new Set("AT BE BG HR CY CZ DK EE FI FR DE GR HU IE IT LV LT LU MT NL PL PT RO SK SI ES SE".split(" "));
|
|
8981
9003
|
|
|
8982
|
-
// src/contract/TestRegionalActions-
|
|
9004
|
+
// src/contract/TestRegionalActions-Ce8EVv4q.js
|
|
8983
9005
|
var msg = (text) => text;
|
|
8984
9006
|
var MODERATION_QUALIFIER_INFO = {
|
|
8985
9007
|
"sexual-pornographic-media": {
|
|
@@ -10004,7 +10026,7 @@ var TEST_REGIONAL_ACTIONS_SCHEMA = /* @__PURE__ */ lazySchema(() => array(object
|
|
|
10004
10026
|
])
|
|
10005
10027
|
}).strict()).max(7).refine((entries) => new Set(entries.map((entry) => entry.region)).size === entries.length, "Choose each region once"));
|
|
10006
10028
|
|
|
10007
|
-
// src/contract/TestTriggers-
|
|
10029
|
+
// src/contract/TestTriggers-uL2Ec8Vt.js
|
|
10008
10030
|
var TEST_IMAGE_GRID_LEVELS = [
|
|
10009
10031
|
72,
|
|
10010
10032
|
128,
|
|
@@ -10073,19 +10095,19 @@ function testInputForSignal(signal, kind = "text") {
|
|
|
10073
10095
|
}
|
|
10074
10096
|
}
|
|
10075
10097
|
var TEST_DETECTION_BOX_MAX = 1e4;
|
|
10076
|
-
var basisPoints = number2().int().min(0).max(TEST_DETECTION_BOX_MAX);
|
|
10098
|
+
var basisPoints = /* @__PURE__ */ lazySchema(() => number2().int().min(0).max(TEST_DETECTION_BOX_MAX));
|
|
10077
10099
|
var detectionShape = {
|
|
10078
|
-
box: tuple([
|
|
10100
|
+
box: /* @__PURE__ */ lazySchema(() => tuple([
|
|
10079
10101
|
basisPoints,
|
|
10080
10102
|
basisPoints,
|
|
10081
10103
|
basisPoints,
|
|
10082
10104
|
basisPoints
|
|
10083
|
-
]),
|
|
10084
|
-
confidence: number2().int().min(0).max(100).optional()
|
|
10105
|
+
])),
|
|
10106
|
+
confidence: /* @__PURE__ */ lazySchema(() => number2().int().min(0).max(100).optional())
|
|
10085
10107
|
};
|
|
10086
10108
|
var fitsImage = ({ box: [left, top, width, height] }) => left + width <= 1e4 && top + height <= 1e4;
|
|
10087
10109
|
var BOX_MESSAGE = msg("A box must lie inside the image: left + width and top + height are at most 10000.");
|
|
10088
|
-
var ageYears = number2().int().min(0).max(120);
|
|
10110
|
+
var ageYears = /* @__PURE__ */ lazySchema(() => number2().int().min(0).max(120));
|
|
10089
10111
|
var TEST_DETECTED_PERSON_SCHEMA = /* @__PURE__ */ lazySchema(() => object(detectionShape).strict().refine(fitsImage, BOX_MESSAGE));
|
|
10090
10112
|
var TEST_DETECTED_FACE_SCHEMA = /* @__PURE__ */ lazySchema(() => object({
|
|
10091
10113
|
...detectionShape,
|
|
@@ -10105,7 +10127,6 @@ var TEST_INPUT_SCHEMA = /* @__PURE__ */ lazySchema(() => object({
|
|
|
10105
10127
|
category: _enum(CLASSIFICATION_CATEGORIES),
|
|
10106
10128
|
score: number2().min(0).max(1).optional(),
|
|
10107
10129
|
action: _enum([
|
|
10108
|
-
"allow",
|
|
10109
10130
|
"limit",
|
|
10110
10131
|
"age-restrict",
|
|
10111
10132
|
"block"
|
|
@@ -10597,7 +10618,7 @@ var applyConfiguration = async (client, config, state, plan, log = () => {}) =>
|
|
|
10597
10618
|
// src/cli/listen.ts
|
|
10598
10619
|
import { randomBytes } from "node:crypto";
|
|
10599
10620
|
|
|
10600
|
-
// src/contract/Ids-
|
|
10621
|
+
// src/contract/Ids-BBz_iuDy.js
|
|
10601
10622
|
var __defProp = Object.defineProperty;
|
|
10602
10623
|
var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod, mod.exports), cb = null), mod.exports);
|
|
10603
10624
|
var __exportAll = (all, no_symbols) => {
|
|
@@ -18914,6 +18935,7 @@ createMetaType({
|
|
|
18914
18935
|
createMetaType({ id: "updatedAt" });
|
|
18915
18936
|
createMetaType({ id: "monotonicTimestamp" });
|
|
18916
18937
|
createMetaType({ id: "backfill" });
|
|
18938
|
+
createMetaType({ id: "computed" });
|
|
18917
18939
|
var ID_PREFIXES = {
|
|
18918
18940
|
organisation: "org",
|
|
18919
18941
|
project: "proj",
|
|
@@ -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-BJaLU71Q.js";
|
|
2
|
+
import { r as UseCalmLensUploadResult$1 } from "./ReactUpload-BGUkcMpg.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
|
-
const require_UploadController = require("./UploadController-
|
|
1
|
+
const require_UploadController = require("./UploadController-CEL3N4Ae.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,5 +1,5 @@
|
|
|
1
|
-
const require_ModerationContextLimits = require("./ModerationContextLimits-
|
|
2
|
-
const require_CalmLensOptionKeys = require("./CalmLensOptionKeys-
|
|
1
|
+
const require_ModerationContextLimits = require("./ModerationContextLimits-_knOVCH0.js");
|
|
2
|
+
const require_CalmLensOptionKeys = require("./CalmLensOptionKeys-Cat8CgOn.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 require_CalmLensOptionKeys.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 = require_ModerationContextLimits.encodePathSegment(assetId, "Asset ID");
|
|
@@ -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-CtO4Dieu.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,4 +1,4 @@
|
|
|
1
|
-
const require_ModerationContextLimits = require("./ModerationContextLimits-
|
|
1
|
+
const require_ModerationContextLimits = require("./ModerationContextLimits-_knOVCH0.js");
|
|
2
2
|
// src/contract/AssetPayload.js
|
|
3
3
|
const bufferInputToBytes = (value) => {
|
|
4
4
|
if (value instanceof ArrayBuffer) return new Uint8Array(value);
|
|
@@ -746,9 +746,9 @@ const SERVER_OPTION_KEYS = {
|
|
|
746
746
|
"expiresIn",
|
|
747
747
|
"externalId",
|
|
748
748
|
"lens",
|
|
749
|
-
"original",
|
|
750
749
|
"projectId",
|
|
751
750
|
"resource",
|
|
751
|
+
"resource",
|
|
752
752
|
"transform",
|
|
753
753
|
"viewerClaims"
|
|
754
754
|
],
|
|
@@ -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-CtO4Dieu.js";
|
|
3
|
+
import { d as ListPromise, l as CalmLensResponse, r as CdnResponse } from "./WebhookPayload-DZadhbAJ.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;
|
|
@@ -83,10 +83,10 @@ declare class CalmLensServerClient {
|
|
|
83
83
|
getAssetUrl: (urlOptions: CdnAssetUrlOptions) => string;
|
|
84
84
|
/**
|
|
85
85
|
* Signs a private asset's URL on your server, so browsers and apps can load it without an API
|
|
86
|
-
* key until it expires.
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
* appends them and aren't part of the signature.
|
|
86
|
+
* key until it expires. With `resource`, it is signed for that resource and ends in it; only a
|
|
87
|
+
* URL signed for `original` serves the exact uploaded file, and any other serves every other
|
|
88
|
+
* resource beneath its grant. Lenses, transforms and viewer claims are appended as
|
|
89
|
+
* `getAssetUrl` appends them and aren't part of the signature.
|
|
90
90
|
*/
|
|
91
91
|
signAssetUrl: (signOptions: SignAssetUrlOptions, requestOptions?: RequestOptions) => Promise<CalmLensResponse<SignedAssetUrl>>;
|
|
92
92
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const require_ModerationContextLimits = require("./ModerationContextLimits-
|
|
2
|
-
const require_CalmLensOptionKeys = require("./CalmLensOptionKeys-
|
|
3
|
-
const
|
|
1
|
+
const require_ModerationContextLimits = require("./ModerationContextLimits-_knOVCH0.js");
|
|
2
|
+
const require_CalmLensOptionKeys = require("./CalmLensOptionKeys-Cat8CgOn.js");
|
|
3
|
+
const require_CryptoUtils_BLCa_oZe = require("./CryptoUtils-BLCa-oZe-leCkr1ko.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;
|
|
@@ -21,11 +21,11 @@ const fromBase64Url = (value) => {
|
|
|
21
21
|
*/
|
|
22
22
|
const uploadTokenKeyPrefix = (apiKey) => apiKey.substring(0, apiKey.startsWith("clsk_") ? 13 : 8);
|
|
23
23
|
/** The signing secret: the SHA-256 of the API key, which the backend stores instead of the key. */
|
|
24
|
-
const signingSecret = (apiKey) =>
|
|
24
|
+
const signingSecret = (apiKey) => require_CryptoUtils_BLCa_oZe.sha256Hex(apiKey);
|
|
25
25
|
/** Signs `claims` with `apiKey` and returns the token. */
|
|
26
26
|
const signUploadToken = async (claims, apiKey) => {
|
|
27
27
|
const body = toBase64Url(JSON.stringify(claims));
|
|
28
|
-
const signature = await
|
|
28
|
+
const signature = await require_CryptoUtils_BLCa_oZe.hmacSha256Hex(await signingSecret(apiKey), SIGNING_CONTEXT + body);
|
|
29
29
|
return `${UPLOAD_TOKEN_PREFIX}${body}.${signature}`;
|
|
30
30
|
};
|
|
31
31
|
/**
|
|
@@ -115,9 +115,9 @@ async function verifyWebhookSignature(options) {
|
|
|
115
115
|
if (Math.abs(Math.floor(nowMs / 1e3) - Number(timestampText)) > toleranceSeconds) return false;
|
|
116
116
|
const candidates = signature.split(",").map((part) => part.trim()).filter((part) => part.startsWith("v1=")).map((part) => part.slice(3).toLowerCase());
|
|
117
117
|
if (candidates.length === 0) return false;
|
|
118
|
-
const expected = await
|
|
118
|
+
const expected = await require_CryptoUtils_BLCa_oZe.hmacSha256Hex(secret, `${timestampText}.${body}`);
|
|
119
119
|
let matched = false;
|
|
120
|
-
for (const candidate of candidates) if (
|
|
120
|
+
for (const candidate of candidates) if (require_CryptoUtils_BLCa_oZe.timingSafeEqual(expected, candidate)) matched = true;
|
|
121
121
|
return matched;
|
|
122
122
|
}
|
|
123
123
|
/**
|
|
@@ -426,24 +426,24 @@ var CalmLensServerClient = class {
|
|
|
426
426
|
},
|
|
427
427
|
/**
|
|
428
428
|
* Signs a private asset's URL on your server, so browsers and apps can load it without an API
|
|
429
|
-
* key until it expires.
|
|
430
|
-
*
|
|
431
|
-
*
|
|
432
|
-
* appends them and aren't part of the signature.
|
|
429
|
+
* key until it expires. With `resource`, it is signed for that resource and ends in it; only a
|
|
430
|
+
* URL signed for `original` serves the exact uploaded file, and any other serves every other
|
|
431
|
+
* resource beneath its grant. Lenses, transforms and viewer claims are appended as
|
|
432
|
+
* `getAssetUrl` appends them and aren't part of the signature.
|
|
433
433
|
*/
|
|
434
434
|
signAssetUrl: async (signOptions, requestOptions) => {
|
|
435
435
|
const options = checked("cdn.signAssetUrl", signOptions);
|
|
436
436
|
require_ModerationContextLimits.validateSignAssetUrlOptions(options);
|
|
437
|
-
const { projectId, assetId, externalId, expiresIn,
|
|
437
|
+
const { projectId, assetId, externalId, expiresIn, ...location } = options;
|
|
438
438
|
const project = requireId(projectId ?? this.#settings.projectId, "Project ID");
|
|
439
439
|
const signed = await this.#send("cdn.signAssetUrl", requestOptions, "POST", `/projects/${project}/signed-asset-urls`, { body: {
|
|
440
440
|
...assetId !== void 0 ? { assetId } : { externalId },
|
|
441
441
|
expiresIn: expiresIn ?? 900,
|
|
442
|
-
|
|
442
|
+
...location.resource !== void 0 ? { resource: location.resource } : {}
|
|
443
443
|
} });
|
|
444
444
|
if (!signed || typeof signed.url !== "string" || !signed.url || typeof signed.expiresAt !== "number") throw new require_ModerationContextLimits.CalmLensError(require_ModerationContextLimits.SDK_ERROR_CODES.INVALID_RESPONSE, { message: "The API returned no signed asset URL" });
|
|
445
445
|
return require_ModerationContextLimits.copyLastResponse({
|
|
446
|
-
url: require_ModerationContextLimits.
|
|
446
|
+
url: require_ModerationContextLimits.appendSignedLocation(signed.url, location),
|
|
447
447
|
expiresAt: signed.expiresAt
|
|
448
448
|
}, signed);
|
|
449
449
|
},
|
|
@@ -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";
|
|
@@ -42844,7 +42912,7 @@ interface IdempotencyOptions {
|
|
|
42844
42912
|
}
|
|
42845
42913
|
/**
|
|
42846
42914
|
* What a resource URL beneath an asset URL serves: the `original` file exactly as uploaded (with a
|
|
42847
|
-
* signed URL, only
|
|
42915
|
+
* signed URL, only one signed for `original`); the `rendered` file for display (an image in the
|
|
42848
42916
|
* best format the client accepts, a PDF, or browser-safe video or audio); the `preview` still;
|
|
42849
42917
|
* the blurred `placeholder` PNG (private or blocked assets require a signed URL or download permission); the `hls` stream of audio or video (its
|
|
42850
42918
|
* master playlist); the `embed` page, which shows the asset in an iframe; or the `info` JSON that
|
|
@@ -42905,11 +42973,14 @@ type CdnServeOptions = CdnAssetUrlOptions & {
|
|
|
42905
42973
|
resource?: CdnResource;
|
|
42906
42974
|
init?: RequestInit;
|
|
42907
42975
|
};
|
|
42976
|
+
/**
|
|
42977
|
+
* `resource` is the resource the URL is signed for, and it ends in it. Only a URL signed for
|
|
42978
|
+
* `original` serves the exact uploaded file; any other, or one without a resource, serves every
|
|
42979
|
+
* other resource beneath its grant.
|
|
42980
|
+
*/
|
|
42908
42981
|
type SignAssetUrlOptions = CdnAssetUrlOptions & {
|
|
42909
42982
|
/** How long the URL works, in seconds, from 1 to 86400 (24 hours). Defaults to 900. */
|
|
42910
42983
|
expiresIn?: number;
|
|
42911
|
-
/** Whether the URL also serves `/original`, the exact uploaded file. Defaults to `false`. */
|
|
42912
|
-
original?: boolean;
|
|
42913
42984
|
};
|
|
42914
42985
|
/** Options for `getAssetInfo`. */
|
|
42915
42986
|
interface GetAssetInfoOptions {
|
|
@@ -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-CtO4Dieu.js";
|
|
2
|
+
import { t as CalmLensAppClient } from "./CalmLensAppClient-B3u6BlP5.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
|
-
const require_ModerationContextLimits = require("./ModerationContextLimits-
|
|
2
|
-
const require_UploadController = require("./UploadController-
|
|
1
|
+
const require_ModerationContextLimits = require("./ModerationContextLimits-_knOVCH0.js");
|
|
2
|
+
const require_UploadController = require("./UploadController-CEL3N4Ae.js");
|
|
3
3
|
const require_FileIcons = require("./FileIcons-Ob003MdS.js");
|
|
4
4
|
// src/ui/viewers/ViewerAsset.ts
|
|
5
5
|
/** Spreadsheet MIME types, as `content.format` reports them (compared lower-cased). */
|
|
@@ -207,8 +207,11 @@ const pageLink = (address) => {
|
|
|
207
207
|
return;
|
|
208
208
|
}
|
|
209
209
|
};
|
|
210
|
-
/**
|
|
211
|
-
|
|
210
|
+
/**
|
|
211
|
+
* The asset URL without any query; claims are added per resource. A resource URL beneath it, such
|
|
212
|
+
* as a URL signed for `original`, gives the asset URL its resources load beneath.
|
|
213
|
+
*/
|
|
214
|
+
const baseOf = (src) => require_ModerationContextLimits.assetUrlOf(src);
|
|
212
215
|
/** The viewer claims an asset URL carries in its query, if any. */
|
|
213
216
|
const claimsOf = (src) => {
|
|
214
217
|
const query = src.split("?", 2)[1];
|