calmlens 0.37.0 → 0.38.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/calmlens.js +31 -9
- package/cjs/{BrowserUpload-BOXt-BFy.js → BrowserUpload-BO_ZukUM.js} +1 -1
- package/{esm/BrowserUpload-CuG3tWSo.d.ts → cjs/BrowserUpload-BuTS7yTy.d.ts} +2 -2
- package/cjs/{CalmLensAppClient-Bt9GNyqS.js → CalmLensAppClient-DoNMg8Dh.js} +3 -3
- package/{esm/CalmLensAppClient-QqtovWE-.d.ts → cjs/CalmLensAppClient-L5x_sMOI.d.ts} +1 -1
- package/cjs/{CalmLensCdn-D4I4Km4j.js → CalmLensCdn-B_Tbwq10.js} +2 -2
- package/cjs/{CalmLensConnection-knkk2-BW.js → CalmLensConnection-Dhg1amnb.js} +25 -12
- package/cjs/{CalmLensError-ifj5rLmk.js → CalmLensError-C9g7GXfU.js} +7 -2
- package/{esm/CalmLensServerClient-csSQqHBt.d.ts → cjs/CalmLensServerClient-2H0ZpJlr.d.ts} +5 -5
- package/cjs/{CalmLensServerClient--L5qRzFd.js → CalmLensServerClient-D0wCcQNn.js} +16 -6
- package/cjs/{CalmLensTypes-_f7QVRtO.d.ts → CalmLensTypes-CCsoVr39.d.ts} +4 -4
- package/cjs/{Core-4iFxKJnY.d.ts → Core-B110Ug8_.d.ts} +2 -2
- package/cjs/{Core-CNsji7uR.js → Core-iNgZ8Cij.js} +3 -3
- package/cjs/{ReactUpload-DfioGW58.js → ReactUpload-BS8bYIhv.js} +1 -1
- package/cjs/{ReactUpload-4qd2xACg.d.ts → ReactUpload-CbtQtN6v.d.ts} +1 -1
- package/cjs/{UploadController-B-a2r2kN.js → UploadController-CVKtUCK0.js} +2 -2
- package/{esm/WebhookPayload-BJtggTLd.d.ts → cjs/WebhookPayload-_fvY2eu8.d.ts} +5 -3
- package/cjs/app.d.ts +4 -4
- package/cjs/app.js +3 -3
- package/cjs/elements.d.ts +4 -4
- package/cjs/elements.js +4 -4
- package/cjs/{index-IEA75nev.d.ts → index-Dk3I5YXf.d.ts} +2 -2
- package/cjs/index.d.ts +3 -3
- package/cjs/index.js +2 -2
- 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 +3 -3
- package/cjs/{CalmLensTestInputArguments-C6S09FVQ.js → test-inputs-BVJZjtFd.js} +156 -16
- package/cjs/{TestTriggers-CjDhhz78.d.ts → test-inputs-JaZaV9Up.d.ts} +20 -1
- package/cjs/test-inputs.d.ts +2 -18
- package/cjs/test-inputs.js +15 -126
- package/cjs/testing.d.ts +13 -15
- package/cjs/testing.js +55 -68
- package/cjs/{ui-BMQW3Hse.d.ts → ui--E_s-cDd.d.ts} +2 -2
- package/cjs/{ui-DOkuD90x.js → ui-CuO37F4u.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/{cjs/BrowserUpload-CuG3tWSo.d.ts → esm/BrowserUpload-BuTS7yTy.d.ts} +2 -2
- package/esm/{BrowserUpload-Ch67b69G.js → BrowserUpload-DxgiUXC2.js} +1 -1
- package/esm/{CalmLensAppClient-DEFSQC15.js → CalmLensAppClient-C7ScAfRx.js} +3 -3
- package/{cjs/CalmLensAppClient-QqtovWE-.d.ts → esm/CalmLensAppClient-L5x_sMOI.d.ts} +1 -1
- package/esm/{CalmLensCdn-xvzJyv9X.js → CalmLensCdn-CW5Fn3ph.js} +2 -2
- package/esm/{CalmLensConnection-D6BVOMri.js → CalmLensConnection-Blv8JyLF.js} +25 -12
- package/esm/{CalmLensError-C15tWu8W.js → CalmLensError-DjkibkdI.js} +7 -2
- package/{cjs/CalmLensServerClient-csSQqHBt.d.ts → esm/CalmLensServerClient-2H0ZpJlr.d.ts} +5 -5
- package/esm/{CalmLensServerClient-BGz_olSn.js → CalmLensServerClient-C7n6EzVd.js} +16 -6
- package/esm/{CalmLensTypes-_f7QVRtO.d.ts → CalmLensTypes-CCsoVr39.d.ts} +4 -4
- package/esm/{Core-4iFxKJnY.d.ts → Core-B110Ug8_.d.ts} +2 -2
- package/esm/{Core-Cj91IL4-.js → Core-BRrPxS4i.js} +3 -3
- package/esm/{ReactUpload-Bg4-5rV2.js → ReactUpload-BGPktblV.js} +1 -1
- package/esm/{ReactUpload-4qd2xACg.d.ts → ReactUpload-CbtQtN6v.d.ts} +1 -1
- package/esm/{UploadController-CpLvD8W-.js → UploadController-CQ4NouIU.js} +2 -2
- package/{cjs/WebhookPayload-BJtggTLd.d.ts → esm/WebhookPayload-_fvY2eu8.d.ts} +5 -3
- package/esm/app.d.ts +4 -4
- package/esm/app.js +3 -3
- package/esm/elements.d.ts +4 -4
- package/esm/elements.js +4 -4
- package/esm/{index-IEA75nev.d.ts → index-Dk3I5YXf.d.ts} +2 -2
- package/esm/index.d.ts +3 -3
- package/esm/index.js +2 -2
- 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 +3 -3
- package/esm/{CalmLensTestInputArguments-DS_3mt1C.js → test-inputs-DizPp8_w.js} +145 -5
- package/esm/{TestTriggers-CjDhhz78.d.ts → test-inputs-JaZaV9Up.d.ts} +20 -1
- package/esm/test-inputs.d.ts +2 -18
- package/esm/test-inputs.js +1 -115
- package/esm/testing.d.ts +13 -15
- package/esm/testing.js +44 -57
- package/esm/{ui-BMQW3Hse.d.ts → ui--E_s-cDd.d.ts} +2 -2
- package/esm/{ui-CGrWIVKa.js → ui-B-QOHuVI.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,40 +1,15 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const
|
|
3
|
-
const require_CalmLensError = require("./CalmLensError-
|
|
4
|
-
const require_CalmLensCdn = require("./CalmLensCdn-
|
|
5
|
-
const require_CalmLensServerClient = require("./CalmLensServerClient
|
|
6
|
-
const require_CalmLensConnection = require("./CalmLensConnection-
|
|
2
|
+
const require_test_inputs = require("./test-inputs-BVJZjtFd.js");
|
|
3
|
+
const require_CalmLensError = require("./CalmLensError-C9g7GXfU.js");
|
|
4
|
+
const require_CalmLensCdn = require("./CalmLensCdn-B_Tbwq10.js");
|
|
5
|
+
const require_CalmLensServerClient = require("./CalmLensServerClient-D0wCcQNn.js");
|
|
6
|
+
const require_CalmLensConnection = require("./CalmLensConnection-Dhg1amnb.js");
|
|
7
7
|
const require_CryptoUtils_BLCa_oZe = require("./CryptoUtils-BLCa-oZe-leCkr1ko.js");
|
|
8
|
-
const require_CalmLensAppClient = require("./CalmLensAppClient-
|
|
9
|
-
const require_UploadController = require("./UploadController-
|
|
8
|
+
const require_CalmLensAppClient = require("./CalmLensAppClient-DoNMg8Dh.js");
|
|
9
|
+
const require_UploadController = require("./UploadController-CVKtUCK0.js");
|
|
10
10
|
let zod = require("zod");
|
|
11
|
-
let zod$1 =
|
|
12
|
-
zod =
|
|
13
|
-
// src/contract/MediaTestTriggers.js
|
|
14
|
-
const MEDIA_TEST_SIGNALS = [...require_CalmLensTestInputArguments.CLASSIFICATION_CATEGORIES, "violence.graphic"];
|
|
15
|
-
const HEX_WORDS = [
|
|
16
|
-
"zero",
|
|
17
|
-
"one",
|
|
18
|
-
"two",
|
|
19
|
-
"three",
|
|
20
|
-
"four",
|
|
21
|
-
"five",
|
|
22
|
-
"six",
|
|
23
|
-
"seven",
|
|
24
|
-
"eight",
|
|
25
|
-
"nine",
|
|
26
|
-
"alpha",
|
|
27
|
-
"bravo",
|
|
28
|
-
"charlie",
|
|
29
|
-
"delta",
|
|
30
|
-
"echo",
|
|
31
|
-
"foxtrot"
|
|
32
|
-
];
|
|
33
|
-
/** Read this aloud, or render it as large, high-contrast text in a video frame. */
|
|
34
|
-
async function generateMediaTestCode$1(signal, testInputKey) {
|
|
35
|
-
if (!MEDIA_TEST_SIGNALS.includes(signal)) throw new RangeError("Unsupported media test signal");
|
|
36
|
-
return `Calm Lens test ${[...await require_CalmLensTestInputArguments.getTestInputTag("media", signal, testInputKey)].map((character) => HEX_WORDS[Number.parseInt(character, 16)]).join(" ")} ${signal.replace(/[.-]/g, " ")} end test`;
|
|
37
|
-
}
|
|
11
|
+
let zod$1 = require_test_inputs.__toESM(zod, 1);
|
|
12
|
+
zod = require_test_inputs.__toESM(zod);
|
|
38
13
|
/**
|
|
39
14
|
* The character an asset ID starts with (after `asset_`) to say the region it lives in: the asset
|
|
40
15
|
* table computes each row's region from it (`AssetTable`), so an ID is only ever in one region and
|
|
@@ -8088,7 +8063,7 @@ const PERMISSION_ACTIONS = [
|
|
|
8088
8063
|
"reviews:write",
|
|
8089
8064
|
"project:manage"
|
|
8090
8065
|
];
|
|
8091
|
-
const ACTION_SCHEMA = /* @__PURE__ */
|
|
8066
|
+
const ACTION_SCHEMA = /* @__PURE__ */ require_test_inputs.lazySchema(() => zod$1.enum(PERMISSION_ACTIONS));
|
|
8092
8067
|
const PROJECT_ACTIONS = [...[
|
|
8093
8068
|
"settings",
|
|
8094
8069
|
"members",
|
|
@@ -8104,12 +8079,12 @@ const PROJECT_ACTIONS = [...[
|
|
|
8104
8079
|
const isProjectAction = (action) => PROJECT_ACTIONS.includes(action);
|
|
8105
8080
|
/** The actions that include `action`: its feature's write action and project:manage. */
|
|
8106
8081
|
const actionsImplying = (action) => !isProjectAction(action) || action === "project:manage" ? [] : action.endsWith(":read") ? [action.replace(/:read$/, ":write"), "project:manage"] : ["project:manage"];
|
|
8107
|
-
const GRANT_SCHEMA = /* @__PURE__ */
|
|
8082
|
+
const GRANT_SCHEMA = /* @__PURE__ */ require_test_inputs.lazySchema(() => zod$1.object({
|
|
8108
8083
|
actions: zod$1.array(ACTION_SCHEMA),
|
|
8109
8084
|
folderId: idField("fldr").nullable(),
|
|
8110
8085
|
includeSubfolders: zod$1.boolean()
|
|
8111
8086
|
}).strict().refine((g) => g.folderId === null || !g.actions.some(isProjectAction), "Project configuration permissions require project scope"));
|
|
8112
|
-
const GRANTS_SCHEMA = /* @__PURE__ */
|
|
8087
|
+
const GRANTS_SCHEMA = /* @__PURE__ */ require_test_inputs.lazySchema(() => zod$1.array(GRANT_SCHEMA).max(100));
|
|
8113
8088
|
[...PERMISSION_ACTIONS.filter((a) => !isProjectAction(a))];
|
|
8114
8089
|
[...PERMISSION_ACTIONS.filter((a) => !isProjectAction(a))];
|
|
8115
8090
|
const permits = (grants, action, folderId, folders) => grants.some((grant) => {
|
|
@@ -9769,7 +9744,7 @@ const MOCK_PRESET_NAMES = {
|
|
|
9769
9744
|
* personal information and profanity, `block` otherwise) and no rules. The mock holds no built-in
|
|
9770
9745
|
* preset settings, and uploads are never decided by a policy.
|
|
9771
9746
|
*/
|
|
9772
|
-
const mockPresetSettings = () => ({ categorySettings: Object.fromEntries(
|
|
9747
|
+
const mockPresetSettings = () => ({ categorySettings: Object.fromEntries(require_test_inputs.CLASSIFICATION_CATEGORIES.map((category) => [category, {
|
|
9773
9748
|
action: category === "personal-information" || category === "profanity" ? "allow" : "block",
|
|
9774
9749
|
allowances: [],
|
|
9775
9750
|
restrictions: []
|
|
@@ -9781,13 +9756,13 @@ const mockPresetSettings = () => ({ categorySettings: Object.fromEntries(require
|
|
|
9781
9756
|
const checkPolicySettings = (settings) => {
|
|
9782
9757
|
const categories = settings?.categorySettings;
|
|
9783
9758
|
if (!categories || typeof categories !== "object") throw invalidField("validation/invalid-type", "settings.categorySettings");
|
|
9784
|
-
for (const category of
|
|
9759
|
+
for (const category of require_test_inputs.CLASSIFICATION_CATEGORIES) {
|
|
9785
9760
|
const value = categories[category];
|
|
9786
9761
|
if (!value || typeof value !== "object") throw invalidField("validation/invalid-type", `settings.categorySettings.${category}`);
|
|
9787
9762
|
for (const key of ["allowances", "restrictions"]) if (!Array.isArray(value[key])) throw invalidField("validation/invalid-type", `settings.categorySettings.${category}.${key}`);
|
|
9788
9763
|
if (typeof value.action !== "string") throw invalidField("validation/invalid-value", `settings.categorySettings.${category}.action`);
|
|
9789
9764
|
}
|
|
9790
|
-
for (const key of Object.keys(categories)) if (!
|
|
9765
|
+
for (const key of Object.keys(categories)) if (!require_test_inputs.CLASSIFICATION_CATEGORIES.includes(key)) throw invalidField("validation/unknown-field", `settings.categorySettings.${key}`);
|
|
9791
9766
|
};
|
|
9792
9767
|
/** The client methods that send a request, the one it is recorded under first. */
|
|
9793
9768
|
const operationsOf = (request) => {
|
|
@@ -9860,17 +9835,14 @@ const operationsOf = (request) => {
|
|
|
9860
9835
|
return [];
|
|
9861
9836
|
};
|
|
9862
9837
|
/**
|
|
9863
|
-
*
|
|
9864
|
-
*
|
|
9838
|
+
* Like the API, every write (POST, PUT, PATCH and DELETE) runs under its `Idempotency-Key`: a retry
|
|
9839
|
+
* with the same key replays the first response. Reads ignore the header.
|
|
9865
9840
|
*/
|
|
9866
|
-
const
|
|
9867
|
-
"
|
|
9868
|
-
"
|
|
9869
|
-
"
|
|
9870
|
-
"
|
|
9871
|
-
"assets.decide",
|
|
9872
|
-
"assets.requestReview",
|
|
9873
|
-
"hashLists.addEntry"
|
|
9841
|
+
const IDEMPOTENT_METHODS = [
|
|
9842
|
+
"POST",
|
|
9843
|
+
"PUT",
|
|
9844
|
+
"PATCH",
|
|
9845
|
+
"DELETE"
|
|
9874
9846
|
];
|
|
9875
9847
|
/** A plain-text upload: the SDKs send text as a JSON body with `content.plainText`. */
|
|
9876
9848
|
const isTextUpload = (request) => {
|
|
@@ -9881,6 +9853,11 @@ const isTextUpload = (request) => {
|
|
|
9881
9853
|
return false;
|
|
9882
9854
|
}
|
|
9883
9855
|
};
|
|
9856
|
+
/**
|
|
9857
|
+
* Like the API (`classifiesInBackground`): audio, video, documents, websites and plain text over
|
|
9858
|
+
* 4 MiB are always moderated in the background, even when the caller waits.
|
|
9859
|
+
*/
|
|
9860
|
+
const classifiesInBackground = (asset) => asset.type === "audio" || asset.type === "video" || asset.type === "multimedia-document" || asset.type === "website" || asset.type === "plaintext-document" && (asset.content.sizeInBytes ?? 0) > 4194304;
|
|
9884
9861
|
/** Like the API: a new folder is 201 Created, a queued batch 202 Accepted, everything else 200. */
|
|
9885
9862
|
const SUCCESS_STATUS = {
|
|
9886
9863
|
"folders.create": 201,
|
|
@@ -10287,7 +10264,7 @@ var MockCalmLensApi = class {
|
|
|
10287
10264
|
async answer(request, operation, session) {
|
|
10288
10265
|
const { url, headers } = request;
|
|
10289
10266
|
if (!(request.segments[0] === "upload-presets") && headers.get("x-api-key") !== this.apiKey) return this.failureResponse(fail(require_CalmLensError.API_ERROR_CODES.INVALID_API_KEY), url);
|
|
10290
|
-
const key =
|
|
10267
|
+
const key = IDEMPOTENT_METHODS.includes(request.method) ? headers.get("idempotency-key")?.replace(/^[\t\n\r ]+|[\t\n\r ]+$/g, "") : void 0;
|
|
10291
10268
|
const upload = headers.get("x-calmlens-upload");
|
|
10292
10269
|
const contentType = headers.get("content-type");
|
|
10293
10270
|
const isForm = !!upload && /^multipart\/form-data\b/i.test(contentType ?? "");
|
|
@@ -10301,20 +10278,32 @@ var MockCalmLensApi = class {
|
|
|
10301
10278
|
[...request.query].sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0),
|
|
10302
10279
|
isForm ? "multipart/form-data" : contentType,
|
|
10303
10280
|
upload,
|
|
10304
|
-
upload ? request.bytes.byteLength : new TextDecoder().decode(request.bytes),
|
|
10281
|
+
isForm ? null : upload ? request.bytes.byteLength : new TextDecoder().decode(request.bytes),
|
|
10305
10282
|
formOptions ?? null
|
|
10306
10283
|
]);
|
|
10284
|
+
const replayOnly = headers.get("idempotency-replay-only") === "true";
|
|
10285
|
+
if (replayOnly && (key === void 0 || upload !== "part" || !isForm || request.segments.at(-1) === "part" || request.query.get("partNumber") !== "1")) return this.failureResponse(fail(require_CalmLensError.API_ERROR_CODES.INVALID_REQUEST), url);
|
|
10307
10286
|
if (key !== void 0) {
|
|
10308
10287
|
if (!isValidIdempotencyKey(key)) return this.failureResponse(fail(require_CalmLensError.API_ERROR_CODES.INVALID_IDEMPOTENCY_KEY), url);
|
|
10309
10288
|
const saved = this.idempotentResults.get(key);
|
|
10310
10289
|
if (saved) {
|
|
10311
10290
|
if (saved.fingerprint !== fingerprint) return this.failureResponse(fail(require_CalmLensError.API_ERROR_CODES.IDEMPOTENCY_KEY_REUSED), url);
|
|
10291
|
+
if (replayOnly) {
|
|
10292
|
+
const { id } = JSON.parse(saved.body);
|
|
10293
|
+
const asset = await this.databaseStorage.getAsset(id);
|
|
10294
|
+
if (!asset) return this.response(204, null, url, {});
|
|
10295
|
+
return this.response(200, JSON.stringify(asset, this.publishAssets), url, {
|
|
10296
|
+
"Content-Type": "application/json",
|
|
10297
|
+
"Idempotent-Replayed": "true"
|
|
10298
|
+
});
|
|
10299
|
+
}
|
|
10312
10300
|
return this.response(saved.status, saved.body, url, {
|
|
10313
10301
|
"Content-Type": "application/json",
|
|
10314
10302
|
"Idempotent-Replayed": "true"
|
|
10315
10303
|
});
|
|
10316
10304
|
}
|
|
10317
10305
|
}
|
|
10306
|
+
if (replayOnly) return this.response(204, null, url, {});
|
|
10318
10307
|
let answer;
|
|
10319
10308
|
try {
|
|
10320
10309
|
answer = await this.route(request, session);
|
|
@@ -11452,11 +11441,12 @@ var MockCalmLensApi = class {
|
|
|
11452
11441
|
bytes: data,
|
|
11453
11442
|
text: data && asset.type === "plaintext-document" ? new TextDecoder().decode(data) : null
|
|
11454
11443
|
};
|
|
11444
|
+
const background = trigger === "upload" && classifiesInBackground(asset);
|
|
11455
11445
|
return toDecision(await this.options.moderate({
|
|
11456
11446
|
asset: this.toPublished(asset),
|
|
11457
11447
|
content,
|
|
11458
11448
|
trigger,
|
|
11459
|
-
queued
|
|
11449
|
+
queued: queued || background
|
|
11460
11450
|
}));
|
|
11461
11451
|
}
|
|
11462
11452
|
/**
|
|
@@ -11837,7 +11827,7 @@ var MockCalmLensApi = class {
|
|
|
11837
11827
|
* `search`, by name unless `ordering` says otherwise, with the folders above them.
|
|
11838
11828
|
*/
|
|
11839
11829
|
async listFolders(query) {
|
|
11840
|
-
const all = await this.databaseStorage.listFolders
|
|
11830
|
+
const all = await this.databaseStorage.listFolders(this.projectId);
|
|
11841
11831
|
const parentId = query.get("parentId");
|
|
11842
11832
|
const search = query.get("search")?.trim() || null;
|
|
11843
11833
|
const sort = this.sort(query, ["name", "createdAt"], 1);
|
|
@@ -11887,7 +11877,7 @@ var MockCalmLensApi = class {
|
|
|
11887
11877
|
createdAt: now,
|
|
11888
11878
|
updatedAt: now
|
|
11889
11879
|
};
|
|
11890
|
-
return this.databaseStorage.createFolder
|
|
11880
|
+
return this.databaseStorage.createFolder(folder);
|
|
11891
11881
|
}
|
|
11892
11882
|
async updateFolder(folderId, body) {
|
|
11893
11883
|
const folder = await this.findOwnFolder(folderId);
|
|
@@ -11898,17 +11888,17 @@ var MockCalmLensApi = class {
|
|
|
11898
11888
|
...name !== void 0 ? { name } : {},
|
|
11899
11889
|
updatedAt: this.now()
|
|
11900
11890
|
};
|
|
11901
|
-
return this.databaseStorage.updateFolder
|
|
11891
|
+
return this.databaseStorage.updateFolder(updated);
|
|
11902
11892
|
}
|
|
11903
11893
|
async deleteFolder(folderId) {
|
|
11904
11894
|
await this.findOwnFolder(folderId);
|
|
11905
11895
|
const hasAssets = (await this.databaseStorage.listAssets(this.projectId)).some((asset) => asset.folderId === folderId);
|
|
11906
|
-
const hasChildren = (await this.databaseStorage.listFolders
|
|
11896
|
+
const hasChildren = (await this.databaseStorage.listFolders(this.projectId)).some((folder) => folder.parentId === folderId);
|
|
11907
11897
|
if (hasAssets || hasChildren) throw fail(require_CalmLensError.API_ERROR_CODES.FOLDER_NOT_EMPTY, { details: {
|
|
11908
11898
|
hasAssets,
|
|
11909
11899
|
hasChildren
|
|
11910
11900
|
} });
|
|
11911
|
-
await this.databaseStorage.deleteFolder
|
|
11901
|
+
await this.databaseStorage.deleteFolder(folderId);
|
|
11912
11902
|
}
|
|
11913
11903
|
async moveFolder(folderId, body) {
|
|
11914
11904
|
const folder = await this.findOwnFolder(folderId);
|
|
@@ -11928,10 +11918,10 @@ var MockCalmLensApi = class {
|
|
|
11928
11918
|
parentId: targetParentId,
|
|
11929
11919
|
updatedAt: this.now()
|
|
11930
11920
|
};
|
|
11931
|
-
return this.databaseStorage.updateFolder
|
|
11921
|
+
return this.databaseStorage.updateFolder(updated);
|
|
11932
11922
|
}
|
|
11933
11923
|
async resolveFolder(folderId) {
|
|
11934
|
-
const folder = await this.databaseStorage.getFolder
|
|
11924
|
+
const folder = await this.databaseStorage.getFolder(folderId);
|
|
11935
11925
|
return folder && folder.projectId === this.projectId ? folder : void 0;
|
|
11936
11926
|
}
|
|
11937
11927
|
async findOwnFolder(folderId) {
|
|
@@ -11940,7 +11930,7 @@ var MockCalmLensApi = class {
|
|
|
11940
11930
|
return folder;
|
|
11941
11931
|
}
|
|
11942
11932
|
async assertUniqueFolderName(name, parentId, excludeFolderId) {
|
|
11943
|
-
if ((await this.databaseStorage.listFolders
|
|
11933
|
+
if ((await this.databaseStorage.listFolders(this.projectId)).find((folder) => folder.id !== excludeFolderId && (folder.parentId ?? null) === parentId && folder.name === name)) throw fail(require_CalmLensError.API_ERROR_CODES.DUPLICATE_FOLDER_NAME, { message: `A folder named "${name}" already exists in this location.` });
|
|
11944
11934
|
}
|
|
11945
11935
|
/** A page of the project's upload presets, oldest first unless `sort` says otherwise. */
|
|
11946
11936
|
listUploadPresets(query) {
|
|
@@ -12209,7 +12199,7 @@ var MockCalmLensApi = class {
|
|
|
12209
12199
|
}, url);
|
|
12210
12200
|
const hasApiKey = request.headers.get("x-api-key") === this.apiKey;
|
|
12211
12201
|
const grants = hasApiKey ? this.grants : [];
|
|
12212
|
-
const folders = await this.databaseStorage.listFolders
|
|
12202
|
+
const folders = await this.databaseStorage.listFolders(this.projectId);
|
|
12213
12203
|
const canDownload = () => permits(grants, "assets:download", asset.folderId ?? null, folders);
|
|
12214
12204
|
const status = asset.classification.moderation.decision;
|
|
12215
12205
|
const isHead = request.method === "HEAD";
|
|
@@ -12320,7 +12310,7 @@ var MockCalmLensApi = class {
|
|
|
12320
12310
|
availability: "unavailable",
|
|
12321
12311
|
code: "viewer/region-required"
|
|
12322
12312
|
};
|
|
12323
|
-
const applied = stricter.filter((entry) => entry.region === region || entry.region === "EU" &&
|
|
12313
|
+
const applied = stricter.filter((entry) => entry.region === region || entry.region === "EU" && require_test_inputs.EU_COUNTRIES.has(region)).sort((a, b) => REGIONAL_STATUS_RANK[b.status] - REGIONAL_STATUS_RANK[a.status])[0];
|
|
12324
12314
|
if (applied?.status === "blocked" || applied?.status === "purged") return {
|
|
12325
12315
|
availability: "unavailable",
|
|
12326
12316
|
code: "asset/not-available"
|
|
@@ -12757,12 +12747,9 @@ const createWebhookHeaders = async (options) => {
|
|
|
12757
12747
|
[require_CalmLensServerClient.WEBHOOK_SIGNATURE_HEADER]: await createWebhookSignatureHeader(options.secret, timestamp, options.body)
|
|
12758
12748
|
};
|
|
12759
12749
|
};
|
|
12760
|
-
// src/testing.ts
|
|
12761
|
-
/** A spoken media test phrase for `signal`, signed with the project's test input key. */
|
|
12762
|
-
const generateMediaTestCode = (signal, key) => require_CalmLensTestInputArguments.withValidTestInputArguments(key, () => generateMediaTestCode$1(signal, key));
|
|
12763
12750
|
exports.InMemoryMockDatabaseStorage = InMemoryMockDatabaseStorage;
|
|
12764
12751
|
exports.InMemoryMockImageStorage = InMemoryMockImageStorage;
|
|
12765
|
-
exports.MEDIA_TEST_SIGNALS = MEDIA_TEST_SIGNALS;
|
|
12752
|
+
exports.MEDIA_TEST_SIGNALS = require_test_inputs.MEDIA_TEST_SIGNALS;
|
|
12766
12753
|
exports.MOCK_API_KEY_ID = MOCK_API_KEY_ID;
|
|
12767
12754
|
exports.MOCK_API_KEY_PREFIX = MOCK_API_KEY_PREFIX;
|
|
12768
12755
|
exports.MockCalmLensAppClient = MockCalmLensAppClient;
|
|
@@ -12771,7 +12758,7 @@ exports.MockDecision = MockDecision;
|
|
|
12771
12758
|
exports.createMockApiKey = createMockApiKey;
|
|
12772
12759
|
exports.createWebhookHeaders = createWebhookHeaders;
|
|
12773
12760
|
exports.createWebhookSignatureHeader = createWebhookSignatureHeader;
|
|
12774
|
-
exports.generateMediaTestCode = generateMediaTestCode;
|
|
12761
|
+
exports.generateMediaTestCode = require_test_inputs.generateMediaTestCode;
|
|
12775
12762
|
exports.mockDecision = mockDecision;
|
|
12776
12763
|
exports.signUploadToken = require_CalmLensServerClient.signUploadTokenWithApiKey;
|
|
12777
12764
|
exports.toWebhookEventPayload = toWebhookEventPayload;
|
|
@@ -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-CCsoVr39.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-B110Ug8_.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> {
|
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-B110Ug8_.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--E_s-cDd.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-CuO37F4u.js");
|
|
3
|
+
const require_Core = require("./Core-iNgZ8Cij.js");
|
|
4
|
+
const require_UploadController = require("./UploadController-CVKtUCK0.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, fn 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, fn as ViewerClaims, g as AssetModerationStatus, i as AssetAvailability } from "./CalmLensTypes-CCsoVr39.js";
|
|
2
|
+
import "./index-Dk3I5YXf.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-B110Ug8_.js";
|
|
4
|
+
import { a as UploaderProps, i as UploadSnapshot, n as UploadControllerOptions, r as UploadItem, s as createUploadController, t as CalmLensUpload } from "./BrowserUpload-BuTS7yTy.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--E_s-cDd.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-CuO37F4u.js");
|
|
3
|
+
const require_Core = require("./Core-iNgZ8Cij.js");
|
|
4
|
+
const require_UploadController = require("./UploadController-CVKtUCK0.js");
|
|
5
5
|
const require_FileIcons = require("./FileIcons-Ob003MdS.js");
|
|
6
|
-
const require_BrowserUpload = require("./BrowserUpload-
|
|
6
|
+
const require_BrowserUpload = require("./BrowserUpload-BO_ZukUM.js");
|
|
7
7
|
let vue = require("vue");
|
|
8
8
|
// src/viewers/Vue.ts
|
|
9
9
|
const optional$1 = (type) => ({
|
|
@@ -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-B110Ug8_.js";
|
|
2
|
+
import { r as UseCalmLensUploadResult$1 } from "./ReactUpload-CbtQtN6v.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 { n as createUploadController$1 } from "./UploadController-
|
|
1
|
+
import { n as createUploadController$1 } from "./UploadController-CQ4NouIU.js";
|
|
2
2
|
// src/ui/BrowserUpload.ts
|
|
3
3
|
/** Creates an upload queue for the browser components, such as one a form starts on submit. */
|
|
4
4
|
const createUploadController = (options) => createUploadController$1(options);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { C as invalidConfig, S as invalidArgument } from "./CalmLensError-
|
|
2
|
-
import { S as validateAppClientOptions, d as checkOptionKeys, o as buildAssetUrl, p as encodePathSegment, u as DEFAULT_CDN_BASE_URL } from "./CalmLensCdn-
|
|
3
|
-
import { c as prepareSubmitAssetOptions, f as APP_OPTION_KEYS, i as expectUploadedAsset, l as resolveConnectionOptions, t as CalmLensConnection, u as splitsIntoParts } from "./CalmLensConnection-
|
|
1
|
+
import { C as invalidConfig, S as invalidArgument } from "./CalmLensError-DjkibkdI.js";
|
|
2
|
+
import { S as validateAppClientOptions, d as checkOptionKeys, o as buildAssetUrl, p as encodePathSegment, u as DEFAULT_CDN_BASE_URL } from "./CalmLensCdn-CW5Fn3ph.js";
|
|
3
|
+
import { c as prepareSubmitAssetOptions, f as APP_OPTION_KEYS, i as expectUploadedAsset, l as resolveConnectionOptions, t as CalmLensConnection, u as splitsIntoParts } from "./CalmLensConnection-Blv8JyLF.js";
|
|
4
4
|
// src/client/CalmLensAppClient.ts
|
|
5
5
|
const inspectSymbol = Symbol.for("nodejs.util.inspect.custom");
|
|
6
6
|
/** `options`, once `checkOptionKeys` finds only keys `operation` takes. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { M as CdnAssetUrlOptions, O as CalmLensAppClientOptions, Rt as RequestOptions, Vt as RetrieveAssetOptions, an as UploadAssetPartOptions, ln as UploadPresetSubmitAssetOptions, un as UploadedAsset } from "./CalmLensTypes-
|
|
1
|
+
import { M as CdnAssetUrlOptions, O as CalmLensAppClientOptions, Rt as RequestOptions, Vt as RetrieveAssetOptions, an as UploadAssetPartOptions, ln as UploadPresetSubmitAssetOptions, un as UploadedAsset } from "./CalmLensTypes-CCsoVr39.js";
|
|
2
2
|
declare const inspectSymbol: unique symbol;
|
|
3
3
|
/**
|
|
4
4
|
* The CalmLens client for browsers and React Native apps. It uploads through an upload preset,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as invalidConfig, S as invalidArgument, b as MAX_ERROR_BODY_LENGTH, l as CalmLensError, x as SDK_ERROR_CODES } from "./CalmLensError-
|
|
1
|
+
import { C as invalidConfig, S as invalidArgument, b as MAX_ERROR_BODY_LENGTH, l as CalmLensError, x as SDK_ERROR_CODES } from "./CalmLensError-DjkibkdI.js";
|
|
2
2
|
// src/client/CalmLensLogging.ts
|
|
3
3
|
const LOG_LEVELS = [
|
|
4
4
|
"off",
|
|
@@ -152,7 +152,7 @@ const listPages = (fetchPage, { cursor, feed = false } = {}) => {
|
|
|
152
152
|
};
|
|
153
153
|
// src/client/CalmLensVersion.ts
|
|
154
154
|
/** This SDK's version, from its package.json. */
|
|
155
|
-
const SDK_VERSION = "0.
|
|
155
|
+
const SDK_VERSION = "0.38.0";
|
|
156
156
|
const runtimeName = () => {
|
|
157
157
|
const runtime = globalThis;
|
|
158
158
|
if (isReactNativeRuntime()) return "react-native";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { S as invalidArgument, l as CalmLensError, w as API_ERROR_CODES, x as SDK_ERROR_CODES } from "./CalmLensError-
|
|
2
|
-
import { A as MAX_OTHER_DOCUMENT_UPLOAD_BYTES, D as MAX_DIRECT_IMAGE_UPLOAD_BYTES, F as sleep, M as getRejectedUploadMimeTypeError, N as normalizeUploadMimeType, O as MAX_IMAGE_UPLOAD_BYTES, P as CalmLensTransport, T as UPLOAD_MIME_DOCUMENTS, U as resolveLogLevel, _ as randomUuid, j as MAX_PDF_UPLOAD_BYTES, k as MAX_NON_IMAGE_UPLOAD_BYTES, m as isAcceptedUploadMimeType, y as stringifyQuery } from "./CalmLensCdn-
|
|
1
|
+
import { S as invalidArgument, l as CalmLensError, w as API_ERROR_CODES, x as SDK_ERROR_CODES } from "./CalmLensError-DjkibkdI.js";
|
|
2
|
+
import { A as MAX_OTHER_DOCUMENT_UPLOAD_BYTES, D as MAX_DIRECT_IMAGE_UPLOAD_BYTES, F as sleep, M as getRejectedUploadMimeTypeError, N as normalizeUploadMimeType, O as MAX_IMAGE_UPLOAD_BYTES, P as CalmLensTransport, T as UPLOAD_MIME_DOCUMENTS, U as resolveLogLevel, _ as randomUuid, j as MAX_PDF_UPLOAD_BYTES, k as MAX_NON_IMAGE_UPLOAD_BYTES, m as isAcceptedUploadMimeType, y as stringifyQuery } from "./CalmLensCdn-CW5Fn3ph.js";
|
|
3
3
|
// src/contract/AssetPayload.js
|
|
4
4
|
const bufferInputToBytes = (value) => {
|
|
5
5
|
if (value instanceof ArrayBuffer) return new Uint8Array(value);
|
|
@@ -915,33 +915,46 @@ var CalmLensConnection = class CalmLensConnection {
|
|
|
915
915
|
/**
|
|
916
916
|
* Uploads content larger than `partSizeBytes` in parts: the first to `uploadsPath` with the
|
|
917
917
|
* upload's fields, the rest to `partPath(assetId)`. Each part carries its own Idempotency-Key
|
|
918
|
-
* (`<key>:part-<n>`), so it is retried safely
|
|
919
|
-
*
|
|
920
|
-
*
|
|
918
|
+
* (`<key>:part-<n>`), so it is retried safely. With `resumes`, a repeated call with the same
|
|
919
|
+
* explicit key resumes the upload: it first asks which parts the API has, with the first part's
|
|
920
|
+
* options and an empty file (`Idempotency-Replay-Only`), and sends only the missing parts. A
|
|
921
|
+
* part the API already has is skipped, and a final part that finds the upload already completed
|
|
922
|
+
* reads it back with `retrieve`.
|
|
921
923
|
*/
|
|
922
|
-
async submitInParts(uploadsPath, options, wait, { authHeaders = {}, partPath, onStarted, retrieve }) {
|
|
924
|
+
async submitInParts(uploadsPath, options, wait, { authHeaders = {}, partPath, onStarted, resumes = false, retrieve }) {
|
|
923
925
|
const { content, idempotencyKey, ...fields } = options;
|
|
924
926
|
const source = getSplittableContent(content);
|
|
925
927
|
const partSize = this.partSizeBytes;
|
|
926
928
|
const count = Math.ceil(source.size / partSize);
|
|
927
|
-
const
|
|
929
|
+
const explicitKey = idempotencyKey ?? this.call.idempotencyKey;
|
|
930
|
+
const key = explicitKey ?? newIdempotencyKey();
|
|
928
931
|
const part = (partNumber) => source.slice((partNumber - 1) * partSize, Math.min(partNumber * partSize, source.size));
|
|
929
|
-
const
|
|
932
|
+
const sendFirst = (payload, headers) => this.submitUpload(uploadsPath, {
|
|
930
933
|
...fields,
|
|
931
934
|
part: {
|
|
932
|
-
...
|
|
935
|
+
...payload,
|
|
933
936
|
type: content.type,
|
|
937
|
+
sizeInBytes: Math.min(partSize, source.size),
|
|
934
938
|
partNumber: 1,
|
|
935
939
|
isFinal: false
|
|
936
940
|
},
|
|
937
941
|
totalSizeInBytes: source.size,
|
|
938
942
|
idempotencyKey: key
|
|
939
|
-
}, wait,
|
|
940
|
-
const
|
|
943
|
+
}, wait, headers);
|
|
944
|
+
const existing = resumes && explicitKey ? await sendFirst({ uint8Array: /* @__PURE__ */ new Uint8Array(0) }, {
|
|
945
|
+
...authHeaders,
|
|
946
|
+
"Idempotency-Replay-Only": "true"
|
|
947
|
+
}) : void 0;
|
|
948
|
+
const first = existing ?? await sendFirst(part(1), authHeaders);
|
|
949
|
+
const uploaded = expectUploadedAsset(first);
|
|
950
|
+
const assetId = uploaded.id;
|
|
941
951
|
onStarted?.(assetId);
|
|
952
|
+
if (existing && uploaded.upload.status === "completed") return first;
|
|
942
953
|
const laterParts = this.withCall({ extraBody: void 0 });
|
|
943
954
|
let result = first;
|
|
944
|
-
|
|
955
|
+
const received = uploaded.upload.partsReceived;
|
|
956
|
+
const nextPart = typeof received === "number" && received >= 2 && received < count ? received + 1 : 2;
|
|
957
|
+
for (let partNumber = nextPart; partNumber <= count;) {
|
|
945
958
|
const isFinal = partNumber === count;
|
|
946
959
|
try {
|
|
947
960
|
result = await laterParts.uploadPart(partPath(assetId), {
|
|
@@ -55,6 +55,7 @@ const API_ERROR_CODES = {
|
|
|
55
55
|
IDEMPOTENT_REQUEST_IN_PROGRESS: "idempotency/request-in-progress",
|
|
56
56
|
NO_RENDERED_VERSION: "asset/no-rendered-version",
|
|
57
57
|
ASSET_NOT_FOUND: "asset/not-found",
|
|
58
|
+
ASSET_NOT_AVAILABLE: "asset/not-available",
|
|
58
59
|
PROJECT_NOT_FOUND: "project/not-found",
|
|
59
60
|
ASSET_CHILD_NOT_DELETABLE: "asset/child-not-deletable",
|
|
60
61
|
ASSET_REVIEW_CHANGED: "asset/review-changed",
|
|
@@ -341,6 +342,10 @@ const API_ERROR_DEFINITIONS = {
|
|
|
341
342
|
status: 404,
|
|
342
343
|
message: "Asset not found"
|
|
343
344
|
},
|
|
345
|
+
"asset/not-available": {
|
|
346
|
+
status: 403,
|
|
347
|
+
message: "This asset isn't available to this viewer: it may still be uploading or awaiting moderation, or its delivery is blocked or restricted."
|
|
348
|
+
},
|
|
344
349
|
"project/not-found": {
|
|
345
350
|
status: 404,
|
|
346
351
|
message: "Project not found"
|
|
@@ -784,8 +789,8 @@ var CalmLensError = class CalmLensError extends Error {
|
|
|
784
789
|
/**
|
|
785
790
|
* Whether repeating the same request may succeed: transport failures, timeouts (a request's
|
|
786
791
|
* `timeoutMs` or `waitForDecision`'s deadline), throttling (429), internal and gateway errors (500, 502, 503, 504)
|
|
787
|
-
* and idempotent requests still in progress. Only repeat a create
|
|
788
|
-
* `idempotencyKey`.
|
|
792
|
+
* and idempotent requests still in progress. Only repeat a write (a create, upload, change or
|
|
793
|
+
* delete) with the same `idempotencyKey`.
|
|
789
794
|
*/
|
|
790
795
|
isRetryable() {
|
|
791
796
|
return RETRYABLE_CODES.has(this.code) || this.status !== void 0 && RETRYABLE_STATUSES.has(this.status);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { c as HashList, l as HashListEntry } from "./Classification-C3pkrGYS-B7EygpJn.js";
|
|
2
|
-
import { $t as UpdateFolderOptions, At as PolicyIdOptions, B as CreateHashListOptions, Bn as AssetSearchQuery, Bt as RetrieveAssetByExternalIdOptions, Ct as ListPoliciesOptions, D as BatchAssetsResponse, E as BatchAssetsOptions, Et as MoveFolderOptions, Ft as RemoveAssetContentOptions, G as DeleteAssetOptions, Gt as SignAssetUrlOptions, Hn as AssetInfo, Ht as RetryAssetOptions, I as ClassifyTextOptions, It as RequestAssetReviewOptions, J as EnsureLensesOptions, Jt as SignedUploadToken, K as DeleteMetadataFieldOptions, Kt as SignUploadTokenOptions, M as CdnAssetUrlOptions, Nt as ProjectSettingsResource, P as CdnServeOptions, Qt as UpdateAssetOptions, Rn as Folder, Rt as RequestOptions, St as ListLensesOptions, T as AssignPolicyOptions, Tt as MoveAssetOptions, U as CreatePolicyOptions, V as CreateLensOptions, Vt as RetrieveAssetOptions, W as DecideAssetOptions, Wt as SetPolicyAutomaticUpdatesOptions, X as EnsureUploadPresetsOptions, Xt as SubmitAssetOptions, Y as EnsureMetadataFieldsOptions, Z as EnsureUploadPresetsResponse, _ as AssetPage, _n as AssetReviewRequest, _t as ListAssetsOptions, an as UploadAssetPartOptions, at as GetAssetInfoOptions, b as AssetTimelinePage, bt as ListHashListEntriesOptions, cn as UploadPresetPage, ct as HashListIdOptions, dn as VerifyWebhookSignatureOptions, en as UpdateHashListOptions, ft as Lens, gt as ListAssetTimelineOptions, ht as ListAssetChildrenOptions, in as UpgradePolicyOptions, it as FolderPage, jt as PolicyPage, k as CalmLensServerClientOptions, kt as Policy, lt as HashListPage, mt as LensPage, nn as UpdatePolicyOptions, nt as EventsPage, o as AssetChildrenPage, ot as HashListEntryIdOptions, pn as WaitForAssetDecisionOptions, pt as LensIdOptions, q as EnsureLensOptions, qt as SignedAssetUrl, r as Asset, rn as UpdateProjectSettingsOptions, rt as FolderIdOptions, sn as UploadPresetIdOptions, st as HashListEntryPage, t as AddHashListEntryOptions, tn as UpdateLensOptions, v as AssetSearchResponse, vt as ListEventsOptions, wt as ListUploadPresetsOptions, xt as ListHashListsOptions, yn as MetadataFieldsResource, yt as ListFoldersOptions, z as CreateFolderOptions, zt as ResetPolicyOptions } from "./CalmLensTypes-
|
|
3
|
-
import { d as ListPromise, l as CalmLensResponse, r as CdnResponse } from "./WebhookPayload-
|
|
2
|
+
import { $t as UpdateFolderOptions, At as PolicyIdOptions, B as CreateHashListOptions, Bn as AssetSearchQuery, Bt as RetrieveAssetByExternalIdOptions, Ct as ListPoliciesOptions, D as BatchAssetsResponse, E as BatchAssetsOptions, Et as MoveFolderOptions, Ft as RemoveAssetContentOptions, G as DeleteAssetOptions, Gt as SignAssetUrlOptions, Hn as AssetInfo, Ht as RetryAssetOptions, I as ClassifyTextOptions, It as RequestAssetReviewOptions, J as EnsureLensesOptions, Jt as SignedUploadToken, K as DeleteMetadataFieldOptions, Kt as SignUploadTokenOptions, M as CdnAssetUrlOptions, Nt as ProjectSettingsResource, P as CdnServeOptions, Qt as UpdateAssetOptions, Rn as Folder, Rt as RequestOptions, St as ListLensesOptions, T as AssignPolicyOptions, Tt as MoveAssetOptions, U as CreatePolicyOptions, V as CreateLensOptions, Vt as RetrieveAssetOptions, W as DecideAssetOptions, Wt as SetPolicyAutomaticUpdatesOptions, X as EnsureUploadPresetsOptions, Xt as SubmitAssetOptions, Y as EnsureMetadataFieldsOptions, Z as EnsureUploadPresetsResponse, _ as AssetPage, _n as AssetReviewRequest, _t as ListAssetsOptions, an as UploadAssetPartOptions, at as GetAssetInfoOptions, b as AssetTimelinePage, bt as ListHashListEntriesOptions, cn as UploadPresetPage, ct as HashListIdOptions, dn as VerifyWebhookSignatureOptions, en as UpdateHashListOptions, ft as Lens, gt as ListAssetTimelineOptions, ht as ListAssetChildrenOptions, in as UpgradePolicyOptions, it as FolderPage, jt as PolicyPage, k as CalmLensServerClientOptions, kt as Policy, lt as HashListPage, mt as LensPage, nn as UpdatePolicyOptions, nt as EventsPage, o as AssetChildrenPage, ot as HashListEntryIdOptions, pn as WaitForAssetDecisionOptions, pt as LensIdOptions, q as EnsureLensOptions, qt as SignedAssetUrl, r as Asset, rn as UpdateProjectSettingsOptions, rt as FolderIdOptions, sn as UploadPresetIdOptions, st as HashListEntryPage, t as AddHashListEntryOptions, tn as UpdateLensOptions, v as AssetSearchResponse, vt as ListEventsOptions, wt as ListUploadPresetsOptions, xt as ListHashListsOptions, yn as MetadataFieldsResource, yt as ListFoldersOptions, z as CreateFolderOptions, zt as ResetPolicyOptions } from "./CalmLensTypes-CCsoVr39.js";
|
|
3
|
+
import { d as ListPromise, l as CalmLensResponse, r as CdnResponse } from "./WebhookPayload-_fvY2eu8.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;
|
|
@@ -8,7 +8,7 @@ interface TransportRequest {
|
|
|
8
8
|
url: string;
|
|
9
9
|
headers?: Record<string, string>;
|
|
10
10
|
body?: BodyInit | null;
|
|
11
|
-
/** Sent as `Idempotency-Key`; it also makes a
|
|
11
|
+
/** Sent as `Idempotency-Key`; it also makes a write safe to retry. */
|
|
12
12
|
idempotencyKey?: string;
|
|
13
13
|
/** Deadline per attempt in milliseconds, or undefined for none. */
|
|
14
14
|
timeoutMs?: number;
|
|
@@ -214,8 +214,8 @@ declare class CalmLensServerClient {
|
|
|
214
214
|
* another (`asset/child-not-deletable`), or nothing is queued. Resolves with
|
|
215
215
|
* `{ batchId, status: "queued", assetCount }` once queued; the work runs in the background
|
|
216
216
|
* and records `asset.deleted` or `asset.content-removed` for each asset, with a `batch-id`
|
|
217
|
-
* fact naming `batchId`. Assets under a safety hold are skipped.
|
|
218
|
-
* `
|
|
217
|
+
* fact naming `batchId`. Assets under a safety hold are skipped. Retried only with an
|
|
218
|
+
* `idempotencyKey` request option.
|
|
219
219
|
*/
|
|
220
220
|
batch: (options: BatchAssetsOptions, requestOptions?: RequestOptions) => Promise<CalmLensResponse<BatchAssetsResponse>>;
|
|
221
221
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { C as invalidConfig, S as invalidArgument, l as CalmLensError, x as SDK_ERROR_CODES } from "./CalmLensError-
|
|
2
|
-
import { B as copyLastResponse, C as validateBatchAssetsOptions, H as readEnv, L as isBrowserRuntime, R as isReactNativeRuntime, V as listPages, b as toTextAssetOptions, d as checkOptionKeys, g as pollForDecision, i as appendSignedLocation, l as validateSignAssetUrlOptions, o as buildAssetUrl, p as encodePathSegment, s as getAssetInfo, u as DEFAULT_CDN_BASE_URL, w as validateServerClientOptions, y as stringifyQuery } from "./CalmLensCdn-
|
|
3
|
-
import { a as getMockHooks, c as prepareSubmitAssetOptions, d as validateCallOptions, l as resolveConnectionOptions, m as SERVER_OPTION_KEYS, o as invalidPayload, p as NULLABLE_OPTION_KEYS, r as expectAsset, s as newIdempotencyKey, t as CalmLensConnection, u as splitsIntoParts } from "./CalmLensConnection-
|
|
1
|
+
import { C as invalidConfig, S as invalidArgument, l as CalmLensError, x as SDK_ERROR_CODES } from "./CalmLensError-DjkibkdI.js";
|
|
2
|
+
import { B as copyLastResponse, C as validateBatchAssetsOptions, H as readEnv, L as isBrowserRuntime, R as isReactNativeRuntime, V as listPages, b as toTextAssetOptions, d as checkOptionKeys, g as pollForDecision, i as appendSignedLocation, l as validateSignAssetUrlOptions, o as buildAssetUrl, p as encodePathSegment, s as getAssetInfo, u as DEFAULT_CDN_BASE_URL, w as validateServerClientOptions, y as stringifyQuery } from "./CalmLensCdn-CW5Fn3ph.js";
|
|
3
|
+
import { a as getMockHooks, c as prepareSubmitAssetOptions, d as validateCallOptions, l as resolveConnectionOptions, m as SERVER_OPTION_KEYS, o as invalidPayload, p as NULLABLE_OPTION_KEYS, r as expectAsset, s as newIdempotencyKey, t as CalmLensConnection, u as splitsIntoParts } from "./CalmLensConnection-Blv8JyLF.js";
|
|
4
4
|
import { n as sha256Hex, r as timingSafeEqual, t as hmacSha256Hex } from "./CryptoUtils-BLCa-oZe-DKr3LmN6.js";
|
|
5
5
|
// src/contract/JsonUtils.js
|
|
6
6
|
const stringifyJsonCanonical = (value) => JSON.stringify(value, (_key, nestedValue) => {
|
|
@@ -399,6 +399,7 @@ var CalmLensServerClient = class {
|
|
|
399
399
|
const uploadsPath = `${this.#projectPath}/assets`;
|
|
400
400
|
if ("content" in body && splitsIntoParts(body.content, connection.partSizeBytes)) return expectAsset(await connection.submitInParts(uploadsPath, body, wait, {
|
|
401
401
|
partPath: (assetId) => `/assets/${encodeURIComponent(assetId)}/part`,
|
|
402
|
+
resumes: true,
|
|
402
403
|
retrieve: (assetId, read) => read.json("GET", `/assets/${requireId(assetId, "Asset ID")}`)
|
|
403
404
|
}));
|
|
404
405
|
if ("content" in body || "part" in body) return expectAsset(await connection.submitUpload(uploadsPath, body, wait));
|
|
@@ -653,8 +654,8 @@ sign: async (options) => {
|
|
|
653
654
|
* another (`asset/child-not-deletable`), or nothing is queued. Resolves with
|
|
654
655
|
* `{ batchId, status: "queued", assetCount }` once queued; the work runs in the background
|
|
655
656
|
* and records `asset.deleted` or `asset.content-removed` for each asset, with a `batch-id`
|
|
656
|
-
* fact naming `batchId`. Assets under a safety hold are skipped.
|
|
657
|
-
* `
|
|
657
|
+
* fact naming `batchId`. Assets under a safety hold are skipped. Retried only with an
|
|
658
|
+
* `idempotencyKey` request option.
|
|
658
659
|
*/
|
|
659
660
|
batch: async (options, requestOptions) => {
|
|
660
661
|
const { assetIds, operation } = checked("assets.batch", options);
|
|
@@ -935,7 +936,16 @@ sign: async (options) => {
|
|
|
935
936
|
});
|
|
936
937
|
}
|
|
937
938
|
async #submitEnsureLenses(options, requestOptions) {
|
|
938
|
-
|
|
939
|
+
const key = requestOptions?.idempotencyKey;
|
|
940
|
+
const chunked = options.length > 100;
|
|
941
|
+
if (chunked && (key?.length ?? 0) > 240) throw invalidArgument(`idempotencyKey can be at most 240 characters for lenses sent in several requests`);
|
|
942
|
+
for (let start = 0; start < options.length; start += 100) {
|
|
943
|
+
const chunk = start / 100 + 1;
|
|
944
|
+
await this.#submitEnsureLensesChunk(options.slice(start, start + 100), key && chunked ? {
|
|
945
|
+
...requestOptions,
|
|
946
|
+
idempotencyKey: `${key}:chunk-${chunk}`
|
|
947
|
+
} : requestOptions);
|
|
948
|
+
}
|
|
939
949
|
}
|
|
940
950
|
async #submitEnsureLensesChunk(options, requestOptions) {
|
|
941
951
|
const result = await this.#send("ensureLenses", requestOptions, "PUT", `${this.#projectPath}/lenses`, { body: { lenses: options } });
|