calmlens 0.31.1 → 0.33.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 +54 -42
- package/cjs/{BrowserUpload-BwBE37LM.js → BrowserUpload-Al3ER3ki.js} +1 -1
- package/cjs/{BrowserUpload-BAH54V1q.d.ts → BrowserUpload-CURmX-DR.d.ts} +2 -2
- package/cjs/{CalmLensAppClient-CdlcDd5l.d.ts → CalmLensAppClient-DII9cdTD.d.ts} +3 -3
- package/cjs/{CalmLensAppClient-D6Y7MgH_.js → CalmLensAppClient-DWIy2yPF.js} +4 -4
- package/cjs/{CalmLensCdn-Q68faCEE.js → CalmLensCdn-6ZqvG8-v.js} +56 -22
- package/cjs/{CalmLensConnection-j2aBsuNx.js → CalmLensConnection-Qp9ucGHO.js} +7 -16
- package/cjs/{CalmLensServerClient-CtS66dCU.d.ts → CalmLensServerClient-CPwGfFR-.d.ts} +10 -10
- package/cjs/{CalmLensServerClient-CjK691kq.js → CalmLensServerClient-DRLyvnA1.js} +19 -19
- package/cjs/{CalmLensTypes-87kiUg0H.d.ts → CalmLensTypes-DF7wh23M.d.ts} +16527 -16498
- package/cjs/{Core-Ccy4-_sN.d.ts → Core-Dnm9bJPB.d.ts} +2 -2
- package/cjs/{Core-Dsj4tRNP.js → Core-rYZedJhi.js} +2 -2
- package/cjs/{ReactUpload-DBhppuxM.d.ts → ReactUpload-B7wrDPk8.d.ts} +1 -1
- package/cjs/{ReactUpload-B7SdNAel.js → ReactUpload-Bj6-CciJ.js} +1 -1
- package/{esm/TestTriggers-Daxebd0V.d.ts → cjs/TestTriggers-CjDhhz78.d.ts} +1 -11
- package/cjs/{UploadController-DsIENVY1.js → UploadController-DCr7oN6L.js} +1 -1
- package/cjs/{WebhookPayload-B4rA_Dvm.d.ts → WebhookPayload-CUMsersa.d.ts} +1 -1
- package/cjs/app.d.ts +5 -5
- package/cjs/app.js +2 -2
- package/cjs/elements.d.ts +4 -4
- package/cjs/elements.js +4 -4
- package/cjs/{index-CWUnLKoF.d.ts → index-B511mjeS.d.ts} +2 -2
- package/cjs/index.d.ts +4 -4
- 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 +5 -5
- package/cjs/server.js +2 -2
- package/cjs/test-inputs.d.ts +15 -3
- package/cjs/test-inputs.js +105 -2
- package/cjs/testing.d.ts +14 -6
- package/cjs/testing.js +122 -53
- package/cjs/{ui-sjnJhloQ.d.ts → ui-B83Pqjom.d.ts} +2 -2
- package/cjs/{ui-BC70R8KT.js → ui-BS9eFCI7.js} +8 -8
- 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-BAH54V1q.d.ts → BrowserUpload-CURmX-DR.d.ts} +2 -2
- package/esm/{BrowserUpload-DSLCpWgz.js → BrowserUpload-DOcZaSWT.js} +1 -1
- package/esm/{CalmLensAppClient-BKanqwYL.js → CalmLensAppClient-B7IkEK2D.js} +4 -4
- package/esm/{CalmLensAppClient-CdlcDd5l.d.ts → CalmLensAppClient-DII9cdTD.d.ts} +3 -3
- package/esm/{CalmLensCdn-CL1P1v2t.js → CalmLensCdn-DpJ7kIqG.js} +39 -23
- package/esm/{CalmLensConnection-CHNNULpg.js → CalmLensConnection-BYUqUitO.js} +7 -16
- package/esm/{CalmLensServerClient-CtS66dCU.d.ts → CalmLensServerClient-CPwGfFR-.d.ts} +10 -10
- package/esm/{CalmLensServerClient-CBjSqROz.js → CalmLensServerClient-DpkreSH6.js} +19 -19
- package/esm/{CalmLensTypes-87kiUg0H.d.ts → CalmLensTypes-DF7wh23M.d.ts} +16527 -16498
- package/esm/{Core-WxPuobo_.js → Core-DGF84gwM.js} +2 -2
- package/esm/{Core-Ccy4-_sN.d.ts → Core-Dnm9bJPB.d.ts} +2 -2
- package/esm/{ReactUpload-DBhppuxM.d.ts → ReactUpload-B7wrDPk8.d.ts} +1 -1
- package/esm/{ReactUpload-U49veoZl.js → ReactUpload-rDvF5arL.js} +1 -1
- package/{cjs/TestTriggers-Daxebd0V.d.ts → esm/TestTriggers-CjDhhz78.d.ts} +1 -11
- package/esm/{UploadController-X2gEFMGy.js → UploadController-cXocXbjd.js} +1 -1
- package/esm/{WebhookPayload-B4rA_Dvm.d.ts → WebhookPayload-CUMsersa.d.ts} +1 -1
- package/esm/app.d.ts +5 -5
- package/esm/app.js +2 -2
- package/esm/elements.d.ts +4 -4
- package/esm/elements.js +4 -4
- package/esm/{index-CWUnLKoF.d.ts → index-B511mjeS.d.ts} +2 -2
- package/esm/index.d.ts +4 -4
- 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 +5 -5
- package/esm/server.js +2 -2
- package/esm/test-inputs.d.ts +15 -3
- package/esm/test-inputs.js +105 -2
- package/esm/testing.d.ts +14 -6
- package/esm/testing.js +122 -53
- package/esm/{ui-sjnJhloQ.d.ts → ui-B83Pqjom.d.ts} +2 -2
- package/esm/{ui-DS85DGfi.js → ui-C0wgePYT.js} +8 -8
- 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/bin/calmlens.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { readFile as readFile2 } from "node:fs/promises";
|
|
4
4
|
import { parseArgs } from "node:util";
|
|
5
5
|
// package.json
|
|
6
|
-
var version = "0.
|
|
6
|
+
var version = "0.33.0";
|
|
7
7
|
|
|
8
8
|
// src/contract/ModerationCategories-CHFRoeWV.js
|
|
9
9
|
var CLASSIFICATION_CATEGORIES = [
|
|
@@ -894,7 +894,7 @@ class CalmLensTransport {
|
|
|
894
894
|
}
|
|
895
895
|
}
|
|
896
896
|
|
|
897
|
-
// src/contract/SharedConstants-
|
|
897
|
+
// src/contract/SharedConstants-CxzZSxDw.js
|
|
898
898
|
var IMPERSONATION_COOKIE_NAME = "CL_impersonation";
|
|
899
899
|
var DAY_MS = 86400000;
|
|
900
900
|
var YEAR_MS = 365 * DAY_MS;
|
|
@@ -1103,6 +1103,8 @@ var MAX_IMAGE_UPLOAD_BYTES = /* @__PURE__ */ (() => 20971520)();
|
|
|
1103
1103
|
var MAX_DIRECT_IMAGE_UPLOAD_BYTES = /* @__PURE__ */ (() => 10485760)();
|
|
1104
1104
|
var MAX_NON_IMAGE_UPLOAD_MB = 5000;
|
|
1105
1105
|
var MAX_NON_IMAGE_UPLOAD_BYTES = /* @__PURE__ */ (() => MAX_NON_IMAGE_UPLOAD_MB * 1024 * 1024)();
|
|
1106
|
+
var MAX_PDF_UPLOAD_BYTES = /* @__PURE__ */ (() => 2097152000)();
|
|
1107
|
+
var MAX_OTHER_DOCUMENT_UPLOAD_BYTES = /* @__PURE__ */ (() => 52428800)();
|
|
1106
1108
|
var normalizeUploadMimeType = (mimeType) => mimeType.toLowerCase().split(";")[0]?.trim() || mimeType.toLowerCase().trim();
|
|
1107
1109
|
var getRejectedUploadMimeTypeError = (mimeType) => `${normalizeUploadMimeType(mimeType)} is not a valid upload file type. Uploads must use a concrete file MIME type that CalmLens can store and process, such as image/png, image/jpeg, application/pdf, or text/plain.`;
|
|
1108
1110
|
var DOMAIN = "calmlens.com";
|
|
@@ -1306,6 +1308,22 @@ var UPLOAD_MIME_TYPES = [
|
|
|
1306
1308
|
"application/xml",
|
|
1307
1309
|
"application/yaml"
|
|
1308
1310
|
];
|
|
1311
|
+
var UPLOAD_MIME_DOCUMENTS = [
|
|
1312
|
+
"application/pdf",
|
|
1313
|
+
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
1314
|
+
"application/vnd.ms-word.document.macroenabled.12",
|
|
1315
|
+
"application/msword",
|
|
1316
|
+
"application/rtf",
|
|
1317
|
+
"application/vnd.oasis.opendocument.text",
|
|
1318
|
+
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
1319
|
+
"application/vnd.ms-excel.sheet.macroenabled.12",
|
|
1320
|
+
"application/vnd.ms-excel",
|
|
1321
|
+
"application/vnd.oasis.opendocument.spreadsheet",
|
|
1322
|
+
"application/vnd.openxmlformats-officedocument.presentationml.presentation",
|
|
1323
|
+
"application/vnd.ms-powerpoint.presentation.macroenabled.12",
|
|
1324
|
+
"application/vnd.ms-powerpoint",
|
|
1325
|
+
"application/vnd.oasis.opendocument.presentation"
|
|
1326
|
+
];
|
|
1309
1327
|
|
|
1310
1328
|
// src/client/CalmLensUtils.ts
|
|
1311
1329
|
var assertHttpUrl = (name, value) => {
|
|
@@ -1686,32 +1704,23 @@ var viewerClaimsQuery = (claims) => {
|
|
|
1686
1704
|
return sent ? `?${new URLSearchParams({ viewerClaims: JSON.stringify(sent) })}` : "";
|
|
1687
1705
|
};
|
|
1688
1706
|
var appendAssetLocation = (assetUrl, location) => {
|
|
1689
|
-
const { resource, lens, transform, viewerClaims } = location;
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
} else {
|
|
1696
|
-
if (typeof resource !== "string" || !Object.hasOwn(ASSET_RESOURCE_PATHS, resource)) {
|
|
1697
|
-
throw invalidArgument(`resource must be one of ${CDN_RESOURCES.join(", ")}`);
|
|
1698
|
-
}
|
|
1699
|
-
if (UNSELECTABLE.has(resource) && selected) {
|
|
1700
|
-
throw invalidArgument(`The ${resource} resource takes no lens or transform`);
|
|
1701
|
-
}
|
|
1702
|
-
path = `${assetUrl}/${ASSET_RESOURCE_PATHS[resource]}`;
|
|
1703
|
-
const selector = transformSelector(transform);
|
|
1704
|
-
const parts = [
|
|
1705
|
-
...lens !== undefined ? [`@${encodePathSegment(lens, "Lens")}`] : [],
|
|
1706
|
-
...selector ? [typeof transform === "string" ? encodeURI(selector) : selector] : []
|
|
1707
|
-
];
|
|
1708
|
-
if (parts.length)
|
|
1709
|
-
path = `${path}/${parts.join(",")}`;
|
|
1707
|
+
const { resource = "rendered", lens, transform, viewerClaims } = location;
|
|
1708
|
+
if (typeof resource !== "string" || !Object.hasOwn(ASSET_RESOURCE_PATHS, resource)) {
|
|
1709
|
+
throw invalidArgument(`resource must be one of ${CDN_RESOURCES.join(", ")}`);
|
|
1710
|
+
}
|
|
1711
|
+
if (UNSELECTABLE.has(resource) && (lens !== undefined || transform !== undefined)) {
|
|
1712
|
+
throw invalidArgument(`The ${resource} resource takes no lens or transform`);
|
|
1710
1713
|
}
|
|
1711
|
-
|
|
1714
|
+
const selector = transformSelector(transform);
|
|
1715
|
+
const parts = [
|
|
1716
|
+
...lens !== undefined ? [`@${encodePathSegment(lens, "Lens")}`] : [],
|
|
1717
|
+
...selector ? [typeof transform === "string" ? encodeURI(selector) : selector] : []
|
|
1718
|
+
];
|
|
1719
|
+
const path = `${assetUrl}/${ASSET_RESOURCE_PATHS[resource]}`;
|
|
1720
|
+
return `${parts.length ? `${path}/${parts.join(",")}` : path}${viewerClaimsQuery(viewerClaims)}`;
|
|
1712
1721
|
};
|
|
1713
1722
|
var appendSignedLocation = (signedUrl, location) => {
|
|
1714
|
-
const resourcePath = location.resource
|
|
1723
|
+
const resourcePath = `/${ASSET_RESOURCE_PATHS[location.resource ?? "rendered"]}`;
|
|
1715
1724
|
if (!signedUrl.endsWith(resourcePath)) {
|
|
1716
1725
|
throw new CalmLensError(SDK_ERROR_CODES.INVALID_RESPONSE, {
|
|
1717
1726
|
message: "The signed asset URL doesn't end in the resource it was signed for"
|
|
@@ -1886,8 +1895,8 @@ var MAX_LONG_MEDIA_UPLOAD_BYTES = 2147483648;
|
|
|
1886
1895
|
// src/client/CalmLensOptionKeys.ts
|
|
1887
1896
|
var SERVER_OPTION_KEYS = {
|
|
1888
1897
|
"assets.batch": ["assetIds", "operation"],
|
|
1889
|
-
"assets.classify": ["authorId", "content", "context", "
|
|
1890
|
-
"assets.create": ["authorId", "content", "context", "
|
|
1898
|
+
"assets.classify": ["authorId", "content", "context", "externalId", "externalUrl", "folderId", "isFinal", "metadata", "name", "part", "processingOptions", "sizeInBytes", "tags", "totalSizeInBytes", "uploadPresetId", "url", "visibility"],
|
|
1899
|
+
"assets.create": ["authorId", "content", "context", "externalId", "externalUrl", "folderId", "isFinal", "metadata", "name", "part", "processingOptions", "sizeInBytes", "tags", "totalSizeInBytes", "uploadPresetId", "url", "visibility"],
|
|
1891
1900
|
"assets.decide": ["assetId", "confirmPurge", "decision", "note"],
|
|
1892
1901
|
"assets.delete": ["assetId"],
|
|
1893
1902
|
"assets.list": ["cursor", "filter", "pageSize", "sort"],
|
|
@@ -1900,7 +1909,7 @@ var SERVER_OPTION_KEYS = {
|
|
|
1900
1909
|
"assets.retrieveByExternalId": ["externalId"],
|
|
1901
1910
|
"assets.retry": ["assetId"],
|
|
1902
1911
|
"assets.search": ["mode", "pageSize", "query"],
|
|
1903
|
-
"assets.update": ["assetId", "
|
|
1912
|
+
"assets.update": ["assetId", "externalId", "externalUrl", "metadata", "name", "tags", "visibility"],
|
|
1904
1913
|
"assets.uploadPart": ["assetId", "part", "wait"],
|
|
1905
1914
|
"cdn.signAssetUrl": ["assetId", "expiresIn", "externalId", "lens", "projectId", "resource", "resource", "transform", "viewerClaims"],
|
|
1906
1915
|
ensureLens: ["active", "description", "identifier", "name", "transform", "type"],
|
|
@@ -1940,17 +1949,17 @@ var SERVER_OPTION_KEYS = {
|
|
|
1940
1949
|
"policies.upgrade": ["policyId", "presetVersion", "revision"],
|
|
1941
1950
|
"projectSettings.get": [],
|
|
1942
1951
|
"projectSettings.update": ["revision", "searchIndexingBudgetUnits", "settings"],
|
|
1943
|
-
"text.classify": ["authorId", "context", "
|
|
1952
|
+
"text.classify": ["authorId", "context", "externalId", "externalUrl", "folderId", "metadata", "name", "processingOptions", "tags", "text", "uploadPresetId", "visibility"],
|
|
1944
1953
|
"uploadPresets.delete": ["uploadPresetId"],
|
|
1945
1954
|
"uploadPresets.ensure": ["uploadPresets"],
|
|
1946
1955
|
"uploadPresets.list": ["cursor", "pageSize", "sort"]
|
|
1947
1956
|
};
|
|
1948
1957
|
var NULLABLE_OPTION_KEYS = {
|
|
1949
|
-
"assets.classify": ["authorId", "context", "
|
|
1950
|
-
"assets.create": ["authorId", "context", "
|
|
1958
|
+
"assets.classify": ["authorId", "context", "externalId", "folderId", "metadata", "processingOptions", "tags", "uploadPresetId", "visibility"],
|
|
1959
|
+
"assets.create": ["authorId", "context", "externalId", "folderId", "metadata", "processingOptions", "tags", "uploadPresetId", "visibility"],
|
|
1951
1960
|
"assets.list": ["filter"],
|
|
1952
1961
|
"assets.move": ["folderId"],
|
|
1953
|
-
"assets.update": ["
|
|
1962
|
+
"assets.update": ["externalId", "externalUrl", "metadata", "tags", "visibility"],
|
|
1954
1963
|
"folders.create": ["parentId"],
|
|
1955
1964
|
"folders.move": ["parentId"],
|
|
1956
1965
|
"hashLists.addEntry": ["label", "quality"],
|
|
@@ -1958,7 +1967,7 @@ var NULLABLE_OPTION_KEYS = {
|
|
|
1958
1967
|
"hashLists.update": ["description"],
|
|
1959
1968
|
"lenses.create": ["description", "transform"],
|
|
1960
1969
|
"lenses.update": ["description", "transform"],
|
|
1961
|
-
"text.classify": ["authorId", "context", "
|
|
1970
|
+
"text.classify": ["authorId", "context", "externalId", "folderId", "metadata", "processingOptions", "tags", "uploadPresetId", "visibility"]
|
|
1962
1971
|
};
|
|
1963
1972
|
var REQUEST_OPTION_KEYS = ["deadlineMs", "extraBody", "extraQuery", "headers", "idempotencyKey", "maxRetries", "signal", "timeoutMs"];
|
|
1964
1973
|
|
|
@@ -2076,7 +2085,6 @@ Content-Type: ${payload.type.replace(/[\r\n]/g, "")}\r
|
|
|
2076
2085
|
var uploadFields = (options) => Object.fromEntries(UPLOAD_OPTION_KEYS.flatMap((key) => options[key] === undefined || options[key] === null ? [] : [[key, options[key]]]));
|
|
2077
2086
|
var UPLOAD_OPTION_KEYS = [
|
|
2078
2087
|
"name",
|
|
2079
|
-
"description",
|
|
2080
2088
|
"processingOptions",
|
|
2081
2089
|
"visibility",
|
|
2082
2090
|
"metadata",
|
|
@@ -2114,8 +2122,8 @@ var assertDeclaredPayloadSize = (payload, declared = payload.sizeInBytes) => {
|
|
|
2114
2122
|
var assertUploadSize = (type, size, inParts) => {
|
|
2115
2123
|
if (size === undefined)
|
|
2116
2124
|
return;
|
|
2117
|
-
const mime = type
|
|
2118
|
-
const [limit, message] = mime.startsWith("image/") ? [
|
|
2125
|
+
const mime = normalizeUploadMimeType(type);
|
|
2126
|
+
const [limit, message] = mime === "application/pdf" ? [MAX_PDF_UPLOAD_BYTES, "PDFs can be at most 2,000 MiB"] : UPLOAD_MIME_DOCUMENTS.includes(mime) ? [MAX_OTHER_DOCUMENT_UPLOAD_BYTES, "Documents other than PDFs can be at most 50 MiB"] : mime.startsWith("image/") ? [
|
|
2119
2127
|
MAX_DIRECT_IMAGE_UPLOAD_BYTES,
|
|
2120
2128
|
"Images uploaded in one request can be at most 10 MiB; upload larger images in parts"
|
|
2121
2129
|
] : mime.startsWith("audio/") || mime.startsWith("video/") ? [
|
|
@@ -2832,7 +2840,7 @@ class CalmLensServerClient {
|
|
|
2832
2840
|
body: {
|
|
2833
2841
|
...assetId !== undefined ? { assetId } : { externalId },
|
|
2834
2842
|
expiresIn: expiresIn ?? DEFAULT_SIGNED_URL_EXPIRES_IN,
|
|
2835
|
-
|
|
2843
|
+
resource: location.resource ?? "rendered"
|
|
2836
2844
|
}
|
|
2837
2845
|
});
|
|
2838
2846
|
if (!signed || typeof signed.url !== "string" || !signed.url || typeof signed.expiresAt !== "number") {
|
|
@@ -2844,11 +2852,11 @@ class CalmLensServerClient {
|
|
|
2844
2852
|
},
|
|
2845
2853
|
getAssetInfo: (url, options = {}) => getAssetInfo(url, { ...options, fetch: this.#settings.cdnFetch }),
|
|
2846
2854
|
serve: async (options, requestOptions) => {
|
|
2847
|
-
const { init,
|
|
2855
|
+
const { init, ...urlOptions } = checked("cdn.serve", options);
|
|
2848
2856
|
const connection = this.#connection.forCall("cdn.serve", requestOptions);
|
|
2849
2857
|
if (requestOptions?.extraBody)
|
|
2850
2858
|
throw invalidArgument("cdn.serve sends no body: extraBody can't apply");
|
|
2851
|
-
const url = this.cdn.getAssetUrl(
|
|
2859
|
+
const url = this.cdn.getAssetUrl(urlOptions);
|
|
2852
2860
|
const extraQuery = requestOptions?.extraQuery && stringifyQuery(requestOptions.extraQuery);
|
|
2853
2861
|
const method = init?.method?.toUpperCase() ?? "GET";
|
|
2854
2862
|
const { response } = await connection.transport.send({
|
|
@@ -2964,9 +2972,13 @@ class CalmLensServerClient {
|
|
|
2964
2972
|
}
|
|
2965
2973
|
get events() {
|
|
2966
2974
|
return {
|
|
2967
|
-
list: (options = {}, requestOptions) => this.#paginate("events.list", options, requestOptions, ({ types, ...query }) =>
|
|
2968
|
-
|
|
2969
|
-
|
|
2975
|
+
list: (options = {}, requestOptions) => this.#paginate("events.list", options, requestOptions, ({ types, ...query }) => {
|
|
2976
|
+
if (types != null && (!Array.isArray(types) || types.some((type) => typeof type !== "string")))
|
|
2977
|
+
throw invalidArgument("types must be an array of event types");
|
|
2978
|
+
return this.#send("events.list", requestOptions, "GET", `${this.#projectPath}/events`, {
|
|
2979
|
+
query: { ...query, types: types?.length ? types.join(",") : undefined }
|
|
2980
|
+
});
|
|
2981
|
+
}),
|
|
2970
2982
|
retrieveAsset: async (event, requestOptions) => event.resource?.kind === "asset" ? this.assets.retrieve({ assetId: event.resource.id }, requestOptions) : null
|
|
2971
2983
|
};
|
|
2972
2984
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_UploadController = require("./UploadController-
|
|
1
|
+
const require_UploadController = require("./UploadController-DCr7oN6L.js");
|
|
2
2
|
// src/ui/BrowserUpload.ts
|
|
3
3
|
/** Creates an upload queue for the browser components, such as one a form starts on submit. */
|
|
4
4
|
const createUploadController = (options) => require_UploadController.createUploadController(options);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
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-Dnm9bJPB.js";
|
|
2
|
+
import { r as UseCalmLensUploadResult$1 } from "./ReactUpload-B7wrDPk8.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 {
|
|
1
|
+
import { It as RequestOptions, M as CdnAssetUrlOptions, O as CalmLensAppClientOptions, cn as UploadedAsset, rn as UploadAssetPartOptions, sn as UploadPresetSubmitAssetOptions, zt as RetrieveAssetOptions } from "./CalmLensTypes-DF7wh23M.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,
|
|
@@ -25,8 +25,8 @@ declare class CalmLensAppClient {
|
|
|
25
25
|
/** Public asset URLs, built without a request. */
|
|
26
26
|
get cdn(): {
|
|
27
27
|
/**
|
|
28
|
-
* Builds a public asset's CDN URL: the
|
|
29
|
-
*
|
|
28
|
+
* Builds a public asset's CDN URL: the URL of `resource` (`rendered` unless one is given),
|
|
29
|
+
* with its lens or transform and the viewer claims. Private assets need a URL your
|
|
30
30
|
* server signs with `cdn.signAssetUrl`. The project is the client's `projectId` unless the
|
|
31
31
|
* call names one.
|
|
32
32
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const require_CalmLensError = require("./CalmLensError-ifj5rLmk.js");
|
|
2
|
-
const require_CalmLensCdn = require("./CalmLensCdn-
|
|
3
|
-
const require_CalmLensConnection = require("./CalmLensConnection-
|
|
2
|
+
const require_CalmLensCdn = require("./CalmLensCdn-6ZqvG8-v.js");
|
|
3
|
+
const require_CalmLensConnection = require("./CalmLensConnection-Qp9ucGHO.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. */
|
|
@@ -85,8 +85,8 @@ var CalmLensAppClient = class {
|
|
|
85
85
|
get cdn() {
|
|
86
86
|
return {
|
|
87
87
|
/**
|
|
88
|
-
* Builds a public asset's CDN URL: the
|
|
89
|
-
*
|
|
88
|
+
* Builds a public asset's CDN URL: the URL of `resource` (`rendered` unless one is given),
|
|
89
|
+
* with its lens or transform and the viewer claims. Private assets need a URL your
|
|
90
90
|
* server signs with `cdn.signAssetUrl`. The project is the client's `projectId` unless the
|
|
91
91
|
* call names one.
|
|
92
92
|
*/
|
|
@@ -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.33.0";
|
|
156
156
|
const runtimeName = () => {
|
|
157
157
|
const runtime = globalThis;
|
|
158
158
|
if (isReactNativeRuntime()) return "react-native";
|
|
@@ -536,7 +536,7 @@ var CalmLensTransport = class {
|
|
|
536
536
|
}
|
|
537
537
|
}
|
|
538
538
|
};
|
|
539
|
-
// src/contract/SharedConstants-
|
|
539
|
+
// src/contract/SharedConstants-CxzZSxDw.js
|
|
540
540
|
const IMPERSONATION_COOKIE_NAME = "CL_impersonation";
|
|
541
541
|
const DAY_MS = 864e5;
|
|
542
542
|
const YEAR_MS = 365 * DAY_MS;
|
|
@@ -745,6 +745,13 @@ const MAX_IMAGE_UPLOAD_BYTES = /* @__PURE__ */ (() => 20971520)();
|
|
|
745
745
|
const MAX_DIRECT_IMAGE_UPLOAD_BYTES = /* @__PURE__ */ (() => 10485760)();
|
|
746
746
|
const MAX_NON_IMAGE_UPLOAD_MB = 5e3;
|
|
747
747
|
const MAX_NON_IMAGE_UPLOAD_BYTES = /* @__PURE__ */ (() => MAX_NON_IMAGE_UPLOAD_MB * 1024 * 1024)();
|
|
748
|
+
/** PDFs: read in ranges of pages past `LONG_DOCUMENT_MIN_BYTES`, below the 4 GiB PDFium reads by range. */
|
|
749
|
+
const MAX_PDF_UPLOAD_BYTES = /* @__PURE__ */ (() => 2097152e3)();
|
|
750
|
+
/**
|
|
751
|
+
* Documents other than PDFs (Word, spreadsheets, presentations, OpenDocument and the formats
|
|
752
|
+
* LibreOffice converts): read whole, as the document processor reads at most this much.
|
|
753
|
+
*/
|
|
754
|
+
const MAX_OTHER_DOCUMENT_UPLOAD_BYTES = /* @__PURE__ */ (() => 52428800)();
|
|
748
755
|
const normalizeUploadMimeType = (mimeType) => mimeType.toLowerCase().split(";")[0]?.trim() || mimeType.toLowerCase().trim();
|
|
749
756
|
const getRejectedUploadMimeTypeError = (mimeType) => `${normalizeUploadMimeType(mimeType)} is not a valid upload file type. Uploads must use a concrete file MIME type that CalmLens can store and process, such as image/png, image/jpeg, application/pdf, or text/plain.`;
|
|
750
757
|
const DOMAIN = "calmlens.com";
|
|
@@ -924,6 +931,22 @@ const UPLOAD_MIME_TYPES = [
|
|
|
924
931
|
"application/xml",
|
|
925
932
|
"application/yaml"
|
|
926
933
|
];
|
|
934
|
+
const UPLOAD_MIME_DOCUMENTS = [
|
|
935
|
+
"application/pdf",
|
|
936
|
+
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
937
|
+
"application/vnd.ms-word.document.macroenabled.12",
|
|
938
|
+
"application/msword",
|
|
939
|
+
"application/rtf",
|
|
940
|
+
"application/vnd.oasis.opendocument.text",
|
|
941
|
+
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
942
|
+
"application/vnd.ms-excel.sheet.macroenabled.12",
|
|
943
|
+
"application/vnd.ms-excel",
|
|
944
|
+
"application/vnd.oasis.opendocument.spreadsheet",
|
|
945
|
+
"application/vnd.openxmlformats-officedocument.presentationml.presentation",
|
|
946
|
+
"application/vnd.ms-powerpoint.presentation.macroenabled.12",
|
|
947
|
+
"application/vnd.ms-powerpoint",
|
|
948
|
+
"application/vnd.oasis.opendocument.presentation"
|
|
949
|
+
];
|
|
927
950
|
// src/client/CalmLensUtils.ts
|
|
928
951
|
const assertHttpUrl = (name, value) => {
|
|
929
952
|
if (value === void 0) return;
|
|
@@ -1367,35 +1390,28 @@ const viewerClaimsQuery = (claims) => {
|
|
|
1367
1390
|
return sent ? `?${new URLSearchParams({ viewerClaims: JSON.stringify(sent) })}` : "";
|
|
1368
1391
|
};
|
|
1369
1392
|
/**
|
|
1370
|
-
* Appends a resource, its `@lens` and transform selector, and the
|
|
1371
|
-
*
|
|
1393
|
+
* Appends a resource (`rendered` unless one is given), its `@lens` and transform selector, and the
|
|
1394
|
+
* viewer claims to an asset URL (public or signed).
|
|
1372
1395
|
*/
|
|
1373
1396
|
const appendAssetLocation = (assetUrl, location) => {
|
|
1374
|
-
const { resource, lens, transform, viewerClaims } = location;
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
if (UNSELECTABLE.has(resource) && selected) throw require_CalmLensError.invalidArgument(`The ${resource} resource takes no lens or transform`);
|
|
1382
|
-
path = `${assetUrl}/${ASSET_RESOURCE_PATHS[resource]}`;
|
|
1383
|
-
const selector = transformSelector(transform);
|
|
1384
|
-
const parts = [...lens !== void 0 ? [`@${encodePathSegment(lens, "Lens")}`] : [], ...selector ? [typeof transform === "string" ? encodeURI(selector) : selector] : []];
|
|
1385
|
-
if (parts.length) path = `${path}/${parts.join(",")}`;
|
|
1386
|
-
}
|
|
1387
|
-
return `${path}${viewerClaimsQuery(viewerClaims)}`;
|
|
1397
|
+
const { resource = "rendered", lens, transform, viewerClaims } = location;
|
|
1398
|
+
if (typeof resource !== "string" || !Object.hasOwn(ASSET_RESOURCE_PATHS, resource)) throw require_CalmLensError.invalidArgument(`resource must be one of ${CDN_RESOURCES.join(", ")}`);
|
|
1399
|
+
if (UNSELECTABLE.has(resource) && (lens !== void 0 || transform !== void 0)) throw require_CalmLensError.invalidArgument(`The ${resource} resource takes no lens or transform`);
|
|
1400
|
+
const selector = transformSelector(transform);
|
|
1401
|
+
const parts = [...lens !== void 0 ? [`@${encodePathSegment(lens, "Lens")}`] : [], ...selector ? [typeof transform === "string" ? encodeURI(selector) : selector] : []];
|
|
1402
|
+
const path = `${assetUrl}/${ASSET_RESOURCE_PATHS[resource]}`;
|
|
1403
|
+
return `${parts.length ? `${path}/${parts.join(",")}` : path}${viewerClaimsQuery(viewerClaims)}`;
|
|
1388
1404
|
};
|
|
1389
1405
|
/**
|
|
1390
|
-
* The lens, transform and viewer claims added to a URL the API signed for `location.resource
|
|
1391
|
-
* which already ends in that resource.
|
|
1406
|
+
* The lens, transform and viewer claims added to a URL the API signed for `location.resource`
|
|
1407
|
+
* (`rendered` unless one is given), which already ends in that resource.
|
|
1392
1408
|
*/
|
|
1393
1409
|
const appendSignedLocation = (signedUrl, location) => {
|
|
1394
|
-
const resourcePath = location.resource
|
|
1410
|
+
const resourcePath = `/${ASSET_RESOURCE_PATHS[location.resource ?? "rendered"]}`;
|
|
1395
1411
|
if (!signedUrl.endsWith(resourcePath)) throw new require_CalmLensError.CalmLensError(require_CalmLensError.SDK_ERROR_CODES.INVALID_RESPONSE, { message: "The signed asset URL doesn't end in the resource it was signed for" });
|
|
1396
1412
|
return `${signedUrl}${appendAssetLocation("", location).slice(resourcePath.length)}`;
|
|
1397
1413
|
};
|
|
1398
|
-
/** An asset's public URL beneath a CDN base URL, with any
|
|
1414
|
+
/** An asset's public resource URL beneath a CDN base URL, with any selector and claims. */
|
|
1399
1415
|
const buildAssetUrl = (cdnBaseUrl, projectId, options) => {
|
|
1400
1416
|
const { assetId, externalId, resource, lens, transform, viewerClaims } = options;
|
|
1401
1417
|
const base = `${cdnBaseUrl.replace(/\/+$/, "")}/assets/${encodePathSegment(projectId, "Project ID")}/${getAssetSegment({
|
|
@@ -1537,12 +1553,30 @@ Object.defineProperty(exports, "MAX_NON_IMAGE_UPLOAD_BYTES", {
|
|
|
1537
1553
|
return MAX_NON_IMAGE_UPLOAD_BYTES;
|
|
1538
1554
|
}
|
|
1539
1555
|
});
|
|
1556
|
+
Object.defineProperty(exports, "MAX_OTHER_DOCUMENT_UPLOAD_BYTES", {
|
|
1557
|
+
enumerable: true,
|
|
1558
|
+
get: function() {
|
|
1559
|
+
return MAX_OTHER_DOCUMENT_UPLOAD_BYTES;
|
|
1560
|
+
}
|
|
1561
|
+
});
|
|
1562
|
+
Object.defineProperty(exports, "MAX_PDF_UPLOAD_BYTES", {
|
|
1563
|
+
enumerable: true,
|
|
1564
|
+
get: function() {
|
|
1565
|
+
return MAX_PDF_UPLOAD_BYTES;
|
|
1566
|
+
}
|
|
1567
|
+
});
|
|
1540
1568
|
Object.defineProperty(exports, "SDK_VERSION", {
|
|
1541
1569
|
enumerable: true,
|
|
1542
1570
|
get: function() {
|
|
1543
1571
|
return SDK_VERSION;
|
|
1544
1572
|
}
|
|
1545
1573
|
});
|
|
1574
|
+
Object.defineProperty(exports, "UPLOAD_MIME_DOCUMENTS", {
|
|
1575
|
+
enumerable: true,
|
|
1576
|
+
get: function() {
|
|
1577
|
+
return UPLOAD_MIME_DOCUMENTS;
|
|
1578
|
+
}
|
|
1579
|
+
});
|
|
1546
1580
|
Object.defineProperty(exports, "appendAssetLocation", {
|
|
1547
1581
|
enumerable: true,
|
|
1548
1582
|
get: function() {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_CalmLensError = require("./CalmLensError-ifj5rLmk.js");
|
|
2
|
-
const require_CalmLensCdn = require("./CalmLensCdn-
|
|
2
|
+
const require_CalmLensCdn = require("./CalmLensCdn-6ZqvG8-v.js");
|
|
3
3
|
// src/contract/AssetPayload.js
|
|
4
4
|
const bufferInputToBytes = (value) => {
|
|
5
5
|
if (value instanceof ArrayBuffer) return new Uint8Array(value);
|
|
@@ -98,7 +98,6 @@ const SERVER_OPTION_KEYS = {
|
|
|
98
98
|
"authorId",
|
|
99
99
|
"content",
|
|
100
100
|
"context",
|
|
101
|
-
"description",
|
|
102
101
|
"externalId",
|
|
103
102
|
"externalUrl",
|
|
104
103
|
"folderId",
|
|
@@ -118,7 +117,6 @@ const SERVER_OPTION_KEYS = {
|
|
|
118
117
|
"authorId",
|
|
119
118
|
"content",
|
|
120
119
|
"context",
|
|
121
|
-
"description",
|
|
122
120
|
"externalId",
|
|
123
121
|
"externalUrl",
|
|
124
122
|
"folderId",
|
|
@@ -171,7 +169,6 @@ const SERVER_OPTION_KEYS = {
|
|
|
171
169
|
],
|
|
172
170
|
"assets.update": [
|
|
173
171
|
"assetId",
|
|
174
|
-
"description",
|
|
175
172
|
"externalId",
|
|
176
173
|
"externalUrl",
|
|
177
174
|
"metadata",
|
|
@@ -327,7 +324,6 @@ const SERVER_OPTION_KEYS = {
|
|
|
327
324
|
"text.classify": [
|
|
328
325
|
"authorId",
|
|
329
326
|
"context",
|
|
330
|
-
"description",
|
|
331
327
|
"externalId",
|
|
332
328
|
"externalUrl",
|
|
333
329
|
"folderId",
|
|
@@ -351,7 +347,6 @@ const SERVER_OPTION_KEYS = {
|
|
|
351
347
|
const APP_OPTION_KEYS = {
|
|
352
348
|
"assets.classify": [
|
|
353
349
|
"content",
|
|
354
|
-
"description",
|
|
355
350
|
"externalUrl",
|
|
356
351
|
"name",
|
|
357
352
|
"part",
|
|
@@ -360,7 +355,6 @@ const APP_OPTION_KEYS = {
|
|
|
360
355
|
],
|
|
361
356
|
"assets.create": [
|
|
362
357
|
"content",
|
|
363
|
-
"description",
|
|
364
358
|
"externalUrl",
|
|
365
359
|
"name",
|
|
366
360
|
"part",
|
|
@@ -382,7 +376,6 @@ const NULLABLE_OPTION_KEYS = {
|
|
|
382
376
|
"assets.classify": [
|
|
383
377
|
"authorId",
|
|
384
378
|
"context",
|
|
385
|
-
"description",
|
|
386
379
|
"externalId",
|
|
387
380
|
"folderId",
|
|
388
381
|
"metadata",
|
|
@@ -394,7 +387,6 @@ const NULLABLE_OPTION_KEYS = {
|
|
|
394
387
|
"assets.create": [
|
|
395
388
|
"authorId",
|
|
396
389
|
"context",
|
|
397
|
-
"description",
|
|
398
390
|
"externalId",
|
|
399
391
|
"folderId",
|
|
400
392
|
"metadata",
|
|
@@ -406,7 +398,6 @@ const NULLABLE_OPTION_KEYS = {
|
|
|
406
398
|
"assets.list": ["filter"],
|
|
407
399
|
"assets.move": ["folderId"],
|
|
408
400
|
"assets.update": [
|
|
409
|
-
"description",
|
|
410
401
|
"externalId",
|
|
411
402
|
"externalUrl",
|
|
412
403
|
"metadata",
|
|
@@ -423,7 +414,6 @@ const NULLABLE_OPTION_KEYS = {
|
|
|
423
414
|
"text.classify": [
|
|
424
415
|
"authorId",
|
|
425
416
|
"context",
|
|
426
|
-
"description",
|
|
427
417
|
"externalId",
|
|
428
418
|
"folderId",
|
|
429
419
|
"metadata",
|
|
@@ -562,7 +552,6 @@ const uploadFields = (options) => Object.fromEntries(UPLOAD_OPTION_KEYS.flatMap(
|
|
|
562
552
|
/** The asset fields an upload carries in its body: the API refuses them in the query string. */
|
|
563
553
|
const UPLOAD_OPTION_KEYS = [
|
|
564
554
|
"name",
|
|
565
|
-
"description",
|
|
566
555
|
"processingOptions",
|
|
567
556
|
"visibility",
|
|
568
557
|
"metadata",
|
|
@@ -598,13 +587,15 @@ const assertDeclaredPayloadSize = (payload, declared = payload.sizeInBytes) => {
|
|
|
598
587
|
* Refuses content whose known size is over the API's limit for its type, so nothing is sent and
|
|
599
588
|
* an oversized file fails at once instead of after its upload. In one request, images can be up
|
|
600
589
|
* to 10 MiB (larger ones are uploaded in parts), audio and video up to 50 MiB and other files up
|
|
601
|
-
* to 5,000 MiB. Sent in parts (`inParts`), audio and video can be up to 2 GiB
|
|
602
|
-
*
|
|
590
|
+
* to 5,000 MiB. Sent in parts (`inParts`), audio and video can be up to 2 GiB. However it is sent,
|
|
591
|
+
* a PDF can be up to 2,000 MiB and another document (Word, spreadsheet, presentation, OpenDocument
|
|
592
|
+
* or RTF) up to 50 MiB. The API holds free uploads, made before billing is set up, to 50 MiB
|
|
593
|
+
* itself. Images in parts are checked apart.
|
|
603
594
|
*/
|
|
604
595
|
const assertUploadSize = (type, size, inParts) => {
|
|
605
596
|
if (size === void 0) return;
|
|
606
|
-
const mime =
|
|
607
|
-
const [limit, message] = mime.startsWith("image/") ? [require_CalmLensCdn.MAX_DIRECT_IMAGE_UPLOAD_BYTES, "Images uploaded in one request can be at most 10 MiB; upload larger images in parts"] : mime.startsWith("audio/") || mime.startsWith("video/") ? [inParts ? MAX_LONG_MEDIA_UPLOAD_BYTES : MAX_MEDIA_UPLOAD_BYTES, "Audio and video files can be at most 50 MiB in one request, or 2 GiB in parts"] : [require_CalmLensCdn.MAX_NON_IMAGE_UPLOAD_BYTES, "Files can be at most 5,000 MiB"];
|
|
597
|
+
const mime = require_CalmLensCdn.normalizeUploadMimeType(type);
|
|
598
|
+
const [limit, message] = mime === "application/pdf" ? [require_CalmLensCdn.MAX_PDF_UPLOAD_BYTES, "PDFs can be at most 2,000 MiB"] : require_CalmLensCdn.UPLOAD_MIME_DOCUMENTS.includes(mime) ? [require_CalmLensCdn.MAX_OTHER_DOCUMENT_UPLOAD_BYTES, "Documents other than PDFs can be at most 50 MiB"] : mime.startsWith("image/") ? [require_CalmLensCdn.MAX_DIRECT_IMAGE_UPLOAD_BYTES, "Images uploaded in one request can be at most 10 MiB; upload larger images in parts"] : mime.startsWith("audio/") || mime.startsWith("video/") ? [inParts ? MAX_LONG_MEDIA_UPLOAD_BYTES : MAX_MEDIA_UPLOAD_BYTES, "Audio and video files can be at most 50 MiB in one request, or 2 GiB in parts"] : [require_CalmLensCdn.MAX_NON_IMAGE_UPLOAD_BYTES, "Files can be at most 5,000 MiB"];
|
|
608
599
|
if (size > limit) throw new require_CalmLensError.CalmLensError(require_CalmLensError.API_ERROR_CODES.UPLOAD_TOO_LARGE, {
|
|
609
600
|
message,
|
|
610
601
|
details: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { c as HashList, l as HashListEntry } from "./Classification-C3pkrGYS-B7EygpJn.js";
|
|
2
|
-
import { $ as
|
|
3
|
-
import { d as ListPromise, l as CalmLensResponse, r as CdnResponse } from "./WebhookPayload-
|
|
2
|
+
import { $t as UpdateLensOptions, At as PolicyIdOptions, B as CreateHashListOptions, Bn as AssetSearchQuery, Bt as RetryAssetOptions, Ct as ListPoliciesOptions, D as BatchAssetsResponse, E as BatchAssetsOptions, Et as MoveFolderOptions, G as DeleteAssetOptions, Gt as SignedAssetUrl, Hn as AssetInfo, Ht as SetPolicyAutomaticUpdatesOptions, I as ClassifyTextOptions, It as RequestOptions, J as EnsureLensesOptions, Jt as SubmitAssetOptions, K as DeleteMetadataFieldOptions, Kt as SignedUploadToken, Lt as ResetPolicyOptions, M as CdnAssetUrlOptions, Nt as RemoveAssetContentOptions, P as CdnServeOptions, Pt as RequestAssetReviewOptions, Qt as UpdateHashListOptions, Rn as Folder, Rt as RetrieveAssetByExternalIdOptions, St as ListLensesOptions, T as AssignPolicyOptions, Tt as MoveAssetOptions, U as CreatePolicyOptions, Ut as SignAssetUrlOptions, V as CreateLensOptions, W as DecideAssetOptions, Wt as SignUploadTokenOptions, X as EnsureUploadPresetsOptions, Xt as UpdateAssetOptions, Y as EnsureMetadataFieldsOptions, Z as EnsureUploadPresetsResponse, Zt as UpdateFolderOptions, _ as AssetPage, _n as MetadataFieldsResource, _t as ListAssetsOptions, an as UploadPresetIdOptions, at as GetAssetInfoOptions, b as AssetTimelinePage, bt as ListHashListEntriesOptions, ct as HashListIdOptions, dn as WaitForAssetDecisionOptions, en as UpdatePolicyOptions, ft as Lens, gt as ListAssetTimelineOptions, hn as AssetReviewRequest, ht as ListAssetChildrenOptions, it as FolderPage, jt as PolicyPage, k as CalmLensServerClientOptions, kt as Policy, ln as VerifyWebhookSignatureOptions, lt as HashListPage, mt as LensPage, nn as UpgradePolicyOptions, nt as EventsPage, o as AssetChildrenPage, on as UploadPresetPage, ot as HashListEntryIdOptions, pt as LensIdOptions, q as EnsureLensOptions, r as Asset, rn as UploadAssetPartOptions, rt as FolderIdOptions, st as HashListEntryPage, t as AddHashListEntryOptions, tn as UpdateProjectSettingsOptions, v as AssetSearchResponse, vn as ProjectSettingsResource, vt as ListEventsOptions, wt as ListUploadPresetsOptions, xt as ListHashListsOptions, yt as ListFoldersOptions, z as CreateFolderOptions, zt as RetrieveAssetOptions } from "./CalmLensTypes-DF7wh23M.js";
|
|
3
|
+
import { d as ListPromise, l as CalmLensResponse, r as CdnResponse } from "./WebhookPayload-CUMsersa.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;
|
|
@@ -80,17 +80,17 @@ declare class CalmLensServerClient {
|
|
|
80
80
|
}, requestOptions?: RequestOptions): Promise<CalmLensResponse<T>>;
|
|
81
81
|
get cdn(): {
|
|
82
82
|
/**
|
|
83
|
-
* Builds an asset's CDN URL without a request: the
|
|
84
|
-
* beneath
|
|
85
|
-
*
|
|
86
|
-
*
|
|
83
|
+
* Builds an asset's CDN URL without a request: the URL of `resource` (`rendered` unless one
|
|
84
|
+
* is given) beneath the asset URL, with its lens or transform and the viewer claims, ready to
|
|
85
|
+
* fetch. Use it for public assets; private ones need `cdn.signAssetUrl`. Viewer claims are
|
|
86
|
+
* assertions from your app; CalmLens doesn't verify them.
|
|
87
87
|
*/
|
|
88
88
|
getAssetUrl: (urlOptions: CdnAssetUrlOptions) => string;
|
|
89
89
|
/**
|
|
90
90
|
* Signs a private asset's URL on your server, so browsers and apps can load it without an API
|
|
91
|
-
* key until it expires.
|
|
92
|
-
* URL signed for `original` serves the exact uploaded file, and any other serves
|
|
93
|
-
* resource beneath its grant. Lenses, transforms and viewer claims are appended as
|
|
91
|
+
* key until it expires. It is signed for `resource` (`rendered` unless one is given) and ends
|
|
92
|
+
* in it; only a URL signed for `original` serves the exact uploaded file, and any other serves
|
|
93
|
+
* every other resource beneath its grant. Lenses, transforms and viewer claims are appended as
|
|
94
94
|
* `getAssetUrl` appends them and aren't part of the signature.
|
|
95
95
|
*/
|
|
96
96
|
signAssetUrl: (signOptions: SignAssetUrlOptions, requestOptions?: RequestOptions) => Promise<CalmLensResponse<SignedAssetUrl>>;
|
|
@@ -239,7 +239,7 @@ declare class CalmLensServerClient {
|
|
|
239
239
|
* pass the same ones with each `cursor`. `for await` over it yields every event waiting
|
|
240
240
|
* after `cursor`; save the last page's `nextCursor` to resume later.
|
|
241
241
|
*/
|
|
242
|
-
list: (options?: ListEventsOptions, requestOptions?: RequestOptions) => ListPromise<
|
|
242
|
+
list: (options?: ListEventsOptions, requestOptions?: RequestOptions) => ListPromise<EventsPage>;
|
|
243
243
|
/**
|
|
244
244
|
* Retrieves the asset an event is about, as it is now, such as one from `events.list` or a
|
|
245
245
|
* parsed webhook delivery; events carry only the asset's ID, in `resource`. Resolves to
|