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/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.27.
|
|
6
|
+
var version = "0.27.6";
|
|
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",
|
|
@@ -2510,7 +2520,7 @@ var NULLABLE_OPTION_KEYS = {
|
|
|
2510
2520
|
"text.classify": ["authorId", "context", "description", "externalId", "folderId", "metadata", "processingOptions", "tags", "uploadPresetId", "visibility"]
|
|
2511
2521
|
};
|
|
2512
2522
|
|
|
2513
|
-
// src/contract/CryptoUtils-
|
|
2523
|
+
// src/contract/CryptoUtils-BLCa-oZe.js
|
|
2514
2524
|
var encoder = new TextEncoder;
|
|
2515
2525
|
var bytesToHex = (bytes) => Array.from(bytes instanceof Uint8Array ? bytes : new Uint8Array(bytes), (byte) => byte.toString(16).padStart(2, "0")).join("");
|
|
2516
2526
|
var sha256Hex = async (value) => bytesToHex(await crypto.subtle.digest("SHA-256", encoder.encode(value)));
|
|
@@ -8869,7 +8879,7 @@ function refine(fn, _params = {}) {
|
|
|
8869
8879
|
function superRefine(fn, params) {
|
|
8870
8880
|
return _superRefine(fn, params);
|
|
8871
8881
|
}
|
|
8872
|
-
// src/contract/LazySchema-
|
|
8882
|
+
// src/contract/LazySchema-BKMpWIaF.js
|
|
8873
8883
|
var registryMap = globalRegistry._map;
|
|
8874
8884
|
var lazySchema = (build) => {
|
|
8875
8885
|
let schema;
|
|
@@ -8877,10 +8887,10 @@ var lazySchema = (build) => {
|
|
|
8877
8887
|
if (!schema) {
|
|
8878
8888
|
const built = build();
|
|
8879
8889
|
schema = built;
|
|
8890
|
+
const internals = built._zod;
|
|
8880
8891
|
const meta = registryMap.get(built);
|
|
8881
8892
|
if (meta !== undefined)
|
|
8882
8893
|
registryMap.set(proxy, meta);
|
|
8883
|
-
const internals = built._zod;
|
|
8884
8894
|
const process2 = internals.processJSONSchema;
|
|
8885
8895
|
if (process2)
|
|
8886
8896
|
internals.processJSONSchema = (context, json, params) => {
|
|
@@ -8930,7 +8940,7 @@ var lazySchema = (build) => {
|
|
|
8930
8940
|
return proxy;
|
|
8931
8941
|
};
|
|
8932
8942
|
|
|
8933
|
-
// src/contract/Jurisdiction-
|
|
8943
|
+
// src/contract/Jurisdiction-uODFGQGo.js
|
|
8934
8944
|
var JURISDICTIONS = {
|
|
8935
8945
|
global: {
|
|
8936
8946
|
name: "Global",
|
|
@@ -8979,7 +8989,7 @@ Object.keys(JURISDICTIONS).filter((code) => JURISDICTIONS[code].optional);
|
|
|
8979
8989
|
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
8990
|
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
8991
|
|
|
8982
|
-
// src/contract/TestRegionalActions-
|
|
8992
|
+
// src/contract/TestRegionalActions-Ce8EVv4q.js
|
|
8983
8993
|
var msg = (text) => text;
|
|
8984
8994
|
var MODERATION_QUALIFIER_INFO = {
|
|
8985
8995
|
"sexual-pornographic-media": {
|
|
@@ -10004,7 +10014,7 @@ var TEST_REGIONAL_ACTIONS_SCHEMA = /* @__PURE__ */ lazySchema(() => array(object
|
|
|
10004
10014
|
])
|
|
10005
10015
|
}).strict()).max(7).refine((entries) => new Set(entries.map((entry) => entry.region)).size === entries.length, "Choose each region once"));
|
|
10006
10016
|
|
|
10007
|
-
// src/contract/TestTriggers-
|
|
10017
|
+
// src/contract/TestTriggers-DP4m92jg.js
|
|
10008
10018
|
var TEST_IMAGE_GRID_LEVELS = [
|
|
10009
10019
|
72,
|
|
10010
10020
|
128,
|
|
@@ -10073,19 +10083,19 @@ function testInputForSignal(signal, kind = "text") {
|
|
|
10073
10083
|
}
|
|
10074
10084
|
}
|
|
10075
10085
|
var TEST_DETECTION_BOX_MAX = 1e4;
|
|
10076
|
-
var basisPoints = number2().int().min(0).max(TEST_DETECTION_BOX_MAX);
|
|
10086
|
+
var basisPoints = /* @__PURE__ */ lazySchema(() => number2().int().min(0).max(TEST_DETECTION_BOX_MAX));
|
|
10077
10087
|
var detectionShape = {
|
|
10078
|
-
box: tuple([
|
|
10088
|
+
box: /* @__PURE__ */ lazySchema(() => tuple([
|
|
10079
10089
|
basisPoints,
|
|
10080
10090
|
basisPoints,
|
|
10081
10091
|
basisPoints,
|
|
10082
10092
|
basisPoints
|
|
10083
|
-
]),
|
|
10084
|
-
confidence: number2().int().min(0).max(100).optional()
|
|
10093
|
+
])),
|
|
10094
|
+
confidence: /* @__PURE__ */ lazySchema(() => number2().int().min(0).max(100).optional())
|
|
10085
10095
|
};
|
|
10086
10096
|
var fitsImage = ({ box: [left, top, width, height] }) => left + width <= 1e4 && top + height <= 1e4;
|
|
10087
10097
|
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);
|
|
10098
|
+
var ageYears = /* @__PURE__ */ lazySchema(() => number2().int().min(0).max(120));
|
|
10089
10099
|
var TEST_DETECTED_PERSON_SCHEMA = /* @__PURE__ */ lazySchema(() => object(detectionShape).strict().refine(fitsImage, BOX_MESSAGE));
|
|
10090
10100
|
var TEST_DETECTED_FACE_SCHEMA = /* @__PURE__ */ lazySchema(() => object({
|
|
10091
10101
|
...detectionShape,
|
|
@@ -10597,7 +10607,7 @@ var applyConfiguration = async (client, config, state, plan, log = () => {}) =>
|
|
|
10597
10607
|
// src/cli/listen.ts
|
|
10598
10608
|
import { randomBytes } from "node:crypto";
|
|
10599
10609
|
|
|
10600
|
-
// src/contract/Ids-
|
|
10610
|
+
// src/contract/Ids-BBz_iuDy.js
|
|
10601
10611
|
var __defProp = Object.defineProperty;
|
|
10602
10612
|
var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod, mod.exports), cb = null), mod.exports);
|
|
10603
10613
|
var __exportAll = (all, no_symbols) => {
|
|
@@ -18914,6 +18924,7 @@ createMetaType({
|
|
|
18914
18924
|
createMetaType({ id: "updatedAt" });
|
|
18915
18925
|
createMetaType({ id: "monotonicTimestamp" });
|
|
18916
18926
|
createMetaType({ id: "backfill" });
|
|
18927
|
+
createMetaType({ id: "computed" });
|
|
18917
18928
|
var ID_PREFIXES = {
|
|
18918
18929
|
organisation: "org",
|
|
18919
18930
|
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-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
|
-
const require_UploadController = require("./UploadController-
|
|
1
|
+
const require_UploadController = require("./UploadController-ChzDPMmm.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,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
|
-
const require_ModerationContextLimits = require("./ModerationContextLimits-
|
|
2
|
-
const require_CalmLensOptionKeys = require("./CalmLensOptionKeys
|
|
1
|
+
const require_ModerationContextLimits = require("./ModerationContextLimits-DJyIjzIn.js");
|
|
2
|
+
const require_CalmLensOptionKeys = require("./CalmLensOptionKeys--gTpTkwt.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
|
-
const require_ModerationContextLimits = require("./ModerationContextLimits-
|
|
1
|
+
const require_ModerationContextLimits = require("./ModerationContextLimits-DJyIjzIn.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
|
-
const require_ModerationContextLimits = require("./ModerationContextLimits-
|
|
2
|
-
const require_CalmLensOptionKeys = require("./CalmLensOptionKeys
|
|
3
|
-
const
|
|
1
|
+
const require_ModerationContextLimits = require("./ModerationContextLimits-DJyIjzIn.js");
|
|
2
|
+
const require_CalmLensOptionKeys = require("./CalmLensOptionKeys--gTpTkwt.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
|
/**
|
|
@@ -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;
|
|
@@ -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
|
-
const require_ModerationContextLimits = require("./ModerationContextLimits-
|
|
2
|
-
const require_UploadController = require("./UploadController-
|
|
1
|
+
const require_ModerationContextLimits = require("./ModerationContextLimits-DJyIjzIn.js");
|
|
2
|
+
const require_UploadController = require("./UploadController-ChzDPMmm.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). */
|
|
@@ -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,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) => {
|
|
@@ -40,6 +40,7 @@ const API_ERROR_CODES = {
|
|
|
40
40
|
INVALID_IMAGE: "image/invalid",
|
|
41
41
|
IMAGE_TOO_LARGE: "image/too-large",
|
|
42
42
|
FREE_UPLOADS_EXHAUSTED: "usage/free-uploads-exhausted",
|
|
43
|
+
WEBSITE_BILLING_REQUIRED: "payment/billing-required",
|
|
43
44
|
UPLOADS_PAUSED: "usage/uploads-paused",
|
|
44
45
|
UNSUPPORTED_UPLOAD_TYPE: "upload/unsupported-type",
|
|
45
46
|
INVALID_UPLOAD_PAYLOAD: "upload-payload/invalid",
|
|
@@ -79,6 +80,7 @@ const API_ERROR_CODES = {
|
|
|
79
80
|
HASH_LIST_ENTRY_NOT_FOUND: "hash-list-entry/not-found",
|
|
80
81
|
HASH_LIST_LIMIT_REACHED: "hash-list/limit-reached",
|
|
81
82
|
HASH_LIST_ENTRY_LIMIT_REACHED: "hash-list-entry/limit-reached",
|
|
83
|
+
HASH_LIST_ENTRY_QUALITY_TOO_LOW: "hash-list-entry/quality-too-low",
|
|
82
84
|
HASH_LIST_ASSET_NOT_HASHED: "hash-list/asset-not-hashed",
|
|
83
85
|
POLICY_NOT_FOUND: "policy/not-found",
|
|
84
86
|
POLICY_REVISION_CONFLICT: "policy/revision-conflict",
|
|
@@ -277,6 +279,10 @@ const API_ERROR_DEFINITIONS = {
|
|
|
277
279
|
status: 403,
|
|
278
280
|
message: "This project's organisation has used its free uploads. Set up billing to continue uploading."
|
|
279
281
|
},
|
|
282
|
+
"payment/billing-required": {
|
|
283
|
+
status: 409,
|
|
284
|
+
message: "Set up billing to upload websites."
|
|
285
|
+
},
|
|
280
286
|
"usage/uploads-paused": {
|
|
281
287
|
status: 402,
|
|
282
288
|
message: "This upload would pass its organisation's usage limits, so it was refused. See details.reason; an owner can review them in Billing."
|
|
@@ -433,6 +439,10 @@ const API_ERROR_DEFINITIONS = {
|
|
|
433
439
|
status: 409,
|
|
434
440
|
message: "This project's hash lists hold the most entries they can. Remove entries to add more."
|
|
435
441
|
},
|
|
442
|
+
"hash-list-entry/quality-too-low": {
|
|
443
|
+
status: 422,
|
|
444
|
+
message: "This hash cannot be matched. Use a more detailed image or a hash of higher quality."
|
|
445
|
+
},
|
|
436
446
|
"hash-list/asset-not-hashed": {
|
|
437
447
|
status: 409,
|
|
438
448
|
message: "This asset has no perceptual hash. Only image assets that finished processing can be added."
|
|
@@ -1052,7 +1062,7 @@ const listPages = (fetchPage, { cursor, feed = false } = {}) => {
|
|
|
1052
1062
|
};
|
|
1053
1063
|
// src/client/CalmLensVersion.ts
|
|
1054
1064
|
/** This SDK's version, from its package.json. */
|
|
1055
|
-
const SDK_VERSION = "0.27.
|
|
1065
|
+
const SDK_VERSION = "0.27.6";
|
|
1056
1066
|
const runtimeName = () => {
|
|
1057
1067
|
const runtime = globalThis;
|
|
1058
1068
|
if (isReactNativeRuntime()) return "react-native";
|
|
@@ -1432,7 +1442,7 @@ var CalmLensTransport = class {
|
|
|
1432
1442
|
}
|
|
1433
1443
|
}
|
|
1434
1444
|
};
|
|
1435
|
-
// src/contract/SharedConstants-
|
|
1445
|
+
// src/contract/SharedConstants-D-QkbICw.js
|
|
1436
1446
|
const IMPERSONATION_COOKIE_NAME = "CL_impersonation";
|
|
1437
1447
|
const DAY_MS = 864e5;
|
|
1438
1448
|
const YEAR_MS = 365 * DAY_MS;
|
|
@@ -1545,7 +1555,7 @@ const FIRST_PARTY_COOKIES = {
|
|
|
1545
1555
|
},
|
|
1546
1556
|
ASSET_DASHBOARD_STATE: {
|
|
1547
1557
|
name: "CL_assetDashboardState",
|
|
1548
|
-
description: "Remembers your asset dashboard view (view mode
|
|
1558
|
+
description: "Remembers your asset dashboard view (view mode and metadata grouping)",
|
|
1549
1559
|
expirationDescription: "1 year",
|
|
1550
1560
|
expirationMs: YEAR_MS,
|
|
1551
1561
|
type: "functional",
|
|
@@ -1593,6 +1603,14 @@ const FIRST_PARTY_COOKIES = {
|
|
|
1593
1603
|
type: "functional",
|
|
1594
1604
|
providerName: "CalmLens"
|
|
1595
1605
|
},
|
|
1606
|
+
CHATGPT_AD_CLICK: {
|
|
1607
|
+
name: "CL_chatgptAdClick",
|
|
1608
|
+
description: "Links a ChatGPT ad click to signups, moderation checks and credit checkouts",
|
|
1609
|
+
expirationDescription: "30 days",
|
|
1610
|
+
expirationMs: 30 * DAY_MS,
|
|
1611
|
+
type: "marketing",
|
|
1612
|
+
providerName: "CalmLens"
|
|
1613
|
+
},
|
|
1596
1614
|
SEARCH_SDK_LANGUAGE: {
|
|
1597
1615
|
name: "CL_searchSdkLanguage",
|
|
1598
1616
|
description: "Remembers the SDK you chose to filter documentation search results by",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { F as UploadFile, L as UploadSnapshot, N as UploadController, O as CalmLensProvidedOptions, P as UploadControllerOptions } from "./Core-
|
|
1
|
+
import { F as UploadFile, L as UploadSnapshot, N as UploadController, O as CalmLensProvidedOptions, P as UploadControllerOptions } from "./Core-Dhijt6JU.js";
|
|
2
2
|
import { ReactNode } from "react";
|
|
3
3
|
type CalmLensProviderProps<F extends UploadFile = File> = CalmLensProvidedOptions<F> & {
|
|
4
4
|
children?: ReactNode;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_UploadController = require("./UploadController-
|
|
1
|
+
const require_UploadController = require("./UploadController-ChzDPMmm.js");
|
|
2
2
|
let react = require("react");
|
|
3
3
|
// src/ui/ReactUpload.ts
|
|
4
4
|
const CalmLensContext = (0, react.createContext)(void 0);
|