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
|
@@ -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
|
const require_CryptoUtils_BLCa_oZe = require("./CryptoUtils-BLCa-oZe-leCkr1ko.js");
|
|
5
5
|
// src/contract/JsonUtils.js
|
|
6
6
|
const stringifyJsonCanonical = (value) => JSON.stringify(value, (_key, nestedValue) => {
|
|
@@ -413,10 +413,10 @@ var CalmLensServerClient = class {
|
|
|
413
413
|
get cdn() {
|
|
414
414
|
return {
|
|
415
415
|
/**
|
|
416
|
-
* Builds an asset's CDN URL without a request: the
|
|
417
|
-
* beneath
|
|
418
|
-
*
|
|
419
|
-
*
|
|
416
|
+
* Builds an asset's CDN URL without a request: the URL of `resource` (`rendered` unless one
|
|
417
|
+
* is given) beneath the asset URL, with its lens or transform and the viewer claims, ready to
|
|
418
|
+
* fetch. Use it for public assets; private ones need `cdn.signAssetUrl`. Viewer claims are
|
|
419
|
+
* assertions from your app; CalmLens doesn't verify them.
|
|
420
420
|
*/
|
|
421
421
|
getAssetUrl: (urlOptions) => {
|
|
422
422
|
const { projectId, ...options } = checked("cdn.getAssetUrl", urlOptions);
|
|
@@ -424,9 +424,9 @@ var CalmLensServerClient = class {
|
|
|
424
424
|
},
|
|
425
425
|
/**
|
|
426
426
|
* Signs a private asset's URL on your server, so browsers and apps can load it without an API
|
|
427
|
-
* key until it expires.
|
|
428
|
-
* URL signed for `original` serves the exact uploaded file, and any other serves
|
|
429
|
-
* resource beneath its grant. Lenses, transforms and viewer claims are appended as
|
|
427
|
+
* key until it expires. It is signed for `resource` (`rendered` unless one is given) and ends
|
|
428
|
+
* in it; only a URL signed for `original` serves the exact uploaded file, and any other serves
|
|
429
|
+
* every other resource beneath its grant. Lenses, transforms and viewer claims are appended as
|
|
430
430
|
* `getAssetUrl` appends them and aren't part of the signature.
|
|
431
431
|
*/
|
|
432
432
|
signAssetUrl: async (signOptions, requestOptions) => {
|
|
@@ -437,7 +437,7 @@ var CalmLensServerClient = class {
|
|
|
437
437
|
const signed = await this.#send("cdn.signAssetUrl", requestOptions, "POST", `/projects/${project}/signed-asset-urls`, { body: {
|
|
438
438
|
...assetId !== void 0 ? { assetId } : { externalId },
|
|
439
439
|
expiresIn: expiresIn ?? 900,
|
|
440
|
-
|
|
440
|
+
resource: location.resource ?? "rendered"
|
|
441
441
|
} });
|
|
442
442
|
if (!signed || typeof signed.url !== "string" || !signed.url || typeof signed.expiresAt !== "number") throw new require_CalmLensError.CalmLensError(require_CalmLensError.SDK_ERROR_CODES.INVALID_RESPONSE, { message: "The API returned no signed asset URL" });
|
|
443
443
|
return require_CalmLensCdn.copyLastResponse({
|
|
@@ -461,13 +461,10 @@ var CalmLensServerClient = class {
|
|
|
461
461
|
* Non-2xx responses are returned, not thrown; `timeoutMs` covers only the wait for headers.
|
|
462
462
|
*/
|
|
463
463
|
serve: async (options, requestOptions) => {
|
|
464
|
-
const { init,
|
|
464
|
+
const { init, ...urlOptions } = checked("cdn.serve", options);
|
|
465
465
|
const connection = this.#connection.forCall("cdn.serve", requestOptions);
|
|
466
466
|
if (requestOptions?.extraBody) throw require_CalmLensError.invalidArgument("cdn.serve sends no body: extraBody can't apply");
|
|
467
|
-
const url = this.cdn.getAssetUrl(
|
|
468
|
-
...urlOptions,
|
|
469
|
-
resource
|
|
470
|
-
});
|
|
467
|
+
const url = this.cdn.getAssetUrl(urlOptions);
|
|
471
468
|
const extraQuery = requestOptions?.extraQuery && require_CalmLensCdn.stringifyQuery(requestOptions.extraQuery);
|
|
472
469
|
const method = init?.method?.toUpperCase() ?? "GET";
|
|
473
470
|
const { response } = await connection.transport.send({
|
|
@@ -682,10 +679,13 @@ sign: async (options) => {
|
|
|
682
679
|
* pass the same ones with each `cursor`. `for await` over it yields every event waiting
|
|
683
680
|
* after `cursor`; save the last page's `nextCursor` to resume later.
|
|
684
681
|
*/
|
|
685
|
-
list: (options = {}, requestOptions) => this.#paginate("events.list", options, requestOptions, ({ types, ...query }) =>
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
682
|
+
list: (options = {}, requestOptions) => this.#paginate("events.list", options, requestOptions, ({ types, ...query }) => {
|
|
683
|
+
if (types != null && (!Array.isArray(types) || types.some((type) => typeof type !== "string"))) throw require_CalmLensError.invalidArgument("types must be an array of event types");
|
|
684
|
+
return this.#send("events.list", requestOptions, "GET", `${this.#projectPath}/events`, { query: {
|
|
685
|
+
...query,
|
|
686
|
+
types: types?.length ? types.join(",") : void 0
|
|
687
|
+
} });
|
|
688
|
+
}),
|
|
689
689
|
/**
|
|
690
690
|
* Retrieves the asset an event is about, as it is now, such as one from `events.list` or a
|
|
691
691
|
* parsed webhook delivery; events carry only the asset's ID, in `resource`. Resolves to
|