calmlens 0.38.0 → 0.38.1

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.
Files changed (82) hide show
  1. package/bin/calmlens.js +79 -15
  2. package/cjs/{BrowserUpload-BO_ZukUM.js → BrowserUpload-DS0lxg5C.js} +1 -1
  3. package/{esm/BrowserUpload-BuTS7yTy.d.ts → cjs/BrowserUpload-_iMX_nq0.d.ts} +2 -2
  4. package/{esm/CalmLensAppClient-L5x_sMOI.d.ts → cjs/CalmLensAppClient-CQpnc4JZ.d.ts} +1 -1
  5. package/cjs/{CalmLensAppClient-DoNMg8Dh.js → CalmLensAppClient-Diu1QtBz.js} +2 -2
  6. package/cjs/{CalmLensCdn-B_Tbwq10.js → CalmLensCdn-DCj0AfoS.js} +1 -1
  7. package/cjs/{CalmLensConnection-Dhg1amnb.js → CalmLensConnection-BpBq0nQR.js} +13 -3
  8. package/cjs/{CalmLensServerClient-2H0ZpJlr.d.ts → CalmLensServerClient-CeTsE5Jx.d.ts} +2 -2
  9. package/cjs/{CalmLensServerClient-D0wCcQNn.js → CalmLensServerClient-vdHfH0Nf.js} +2 -2
  10. package/cjs/{CalmLensTypes-CCsoVr39.d.ts → CalmLensTypes-jond9q6a.d.ts} +24 -5
  11. package/cjs/{Core-iNgZ8Cij.js → Core-BHQSo7rY.js} +2 -2
  12. package/cjs/{Core-B110Ug8_.d.ts → Core-C6_Q5ZME.d.ts} +2 -2
  13. package/cjs/{ReactUpload-BS8bYIhv.js → ReactUpload-bbHMmEUQ.js} +1 -1
  14. package/{esm/ReactUpload-CbtQtN6v.d.ts → cjs/ReactUpload-fy6zhY8M.d.ts} +1 -1
  15. package/cjs/{UploadController-CVKtUCK0.js → UploadController-C1tiTTRR.js} +1 -1
  16. package/{esm/WebhookPayload-_fvY2eu8.d.ts → cjs/WebhookPayload-DdpKjQGw.d.ts} +1 -1
  17. package/cjs/app.d.ts +4 -4
  18. package/cjs/app.js +2 -2
  19. package/cjs/elements.d.ts +4 -4
  20. package/cjs/elements.js +4 -4
  21. package/cjs/{index-Dk3I5YXf.d.ts → index-CgAztQdX.d.ts} +2 -2
  22. package/cjs/index.d.ts +3 -3
  23. package/cjs/index.js +1 -1
  24. package/cjs/react-native.d.ts +2 -2
  25. package/cjs/react-native.js +4 -4
  26. package/cjs/react.d.ts +4 -4
  27. package/cjs/react.js +5 -5
  28. package/cjs/server.d.ts +4 -4
  29. package/cjs/server.js +2 -2
  30. package/cjs/{test-inputs-BVJZjtFd.js → test-inputs-DJnupsBH.js} +79 -10
  31. package/cjs/{test-inputs-JaZaV9Up.d.ts → test-inputs-fugEK0py.d.ts} +17 -142
  32. package/cjs/test-inputs.d.ts +2 -2
  33. package/cjs/test-inputs.js +3 -1
  34. package/cjs/testing.d.ts +5 -5
  35. package/cjs/testing.js +9 -8
  36. package/cjs/{ui-CuO37F4u.js → ui-2jJvTcCP.js} +2 -2
  37. package/cjs/{ui--E_s-cDd.d.ts → ui-Cp18fGXG.d.ts} +2 -2
  38. package/cjs/ui.d.ts +2 -2
  39. package/cjs/ui.js +3 -3
  40. package/cjs/vue.d.ts +5 -5
  41. package/cjs/vue.js +4 -4
  42. package/esm/{BrowserUpload-DxgiUXC2.js → BrowserUpload-C4YF17a3.js} +1 -1
  43. package/{cjs/BrowserUpload-BuTS7yTy.d.ts → esm/BrowserUpload-_iMX_nq0.d.ts} +2 -2
  44. package/esm/{CalmLensAppClient-C7ScAfRx.js → CalmLensAppClient-B2H7x_SJ.js} +2 -2
  45. package/{cjs/CalmLensAppClient-L5x_sMOI.d.ts → esm/CalmLensAppClient-CQpnc4JZ.d.ts} +1 -1
  46. package/esm/{CalmLensCdn-CW5Fn3ph.js → CalmLensCdn-Dh546rXe.js} +1 -1
  47. package/esm/{CalmLensConnection-Blv8JyLF.js → CalmLensConnection-BbFlVAdl.js} +13 -3
  48. package/esm/{CalmLensServerClient-2H0ZpJlr.d.ts → CalmLensServerClient-CeTsE5Jx.d.ts} +2 -2
  49. package/esm/{CalmLensServerClient-C7n6EzVd.js → CalmLensServerClient-CqH-tqcC.js} +2 -2
  50. package/esm/{CalmLensTypes-CCsoVr39.d.ts → CalmLensTypes-jond9q6a.d.ts} +24 -5
  51. package/esm/{Core-B110Ug8_.d.ts → Core-C6_Q5ZME.d.ts} +2 -2
  52. package/esm/{Core-BRrPxS4i.js → Core-VNBTpvrG.js} +2 -2
  53. package/esm/{ReactUpload-BGPktblV.js → ReactUpload-CRH6rSaX.js} +1 -1
  54. package/{cjs/ReactUpload-CbtQtN6v.d.ts → esm/ReactUpload-fy6zhY8M.d.ts} +1 -1
  55. package/esm/{UploadController-CQ4NouIU.js → UploadController-BYxiONcw.js} +1 -1
  56. package/{cjs/WebhookPayload-_fvY2eu8.d.ts → esm/WebhookPayload-DdpKjQGw.d.ts} +1 -1
  57. package/esm/app.d.ts +4 -4
  58. package/esm/app.js +2 -2
  59. package/esm/elements.d.ts +4 -4
  60. package/esm/elements.js +4 -4
  61. package/esm/{index-Dk3I5YXf.d.ts → index-CgAztQdX.d.ts} +2 -2
  62. package/esm/index.d.ts +3 -3
  63. package/esm/index.js +1 -1
  64. package/esm/react-native.d.ts +2 -2
  65. package/esm/react-native.js +4 -4
  66. package/esm/react.d.ts +4 -4
  67. package/esm/react.js +5 -5
  68. package/esm/server.d.ts +4 -4
  69. package/esm/server.js +2 -2
  70. package/esm/{test-inputs-DizPp8_w.js → test-inputs-BLlkOmNC.js} +68 -11
  71. package/esm/{test-inputs-JaZaV9Up.d.ts → test-inputs-fugEK0py.d.ts} +17 -142
  72. package/esm/test-inputs.d.ts +2 -2
  73. package/esm/test-inputs.js +1 -1
  74. package/esm/testing.d.ts +5 -5
  75. package/esm/testing.js +9 -8
  76. package/esm/{ui--E_s-cDd.d.ts → ui-Cp18fGXG.d.ts} +2 -2
  77. package/esm/{ui-B-QOHuVI.js → ui-siBYiNJZ.js} +2 -2
  78. package/esm/ui.d.ts +2 -2
  79. package/esm/ui.js +3 -3
  80. package/esm/vue.d.ts +5 -5
  81. package/esm/vue.js +4 -4
  82. 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.38.0";
6
+ var version = "0.38.1";
7
7
 
8
8
  // src/contract/ModerationCategories-CHFRoeWV.js
9
9
  var CLASSIFICATION_CATEGORIES = [
@@ -2139,10 +2139,14 @@ var assertUploadSize = (type, size, inParts) => {
2139
2139
  }
2140
2140
  };
2141
2141
  var isBlob = (value) => typeof Blob !== "undefined" && value instanceof Blob;
2142
+ var isUntypedText = (content) => !!content && typeof content === "object" && ("plainText" in content) && content.type === undefined;
2142
2143
  var withContentObject = (options) => {
2143
2144
  if (!options || typeof options !== "object" || !("content" in options))
2144
2145
  return options;
2145
2146
  const content = options.content;
2147
+ if (isUntypedText(content)) {
2148
+ return { ...options, content: { ...content, type: "text/plain" } };
2149
+ }
2146
2150
  if (!isBlob(content))
2147
2151
  return options;
2148
2152
  if (!content.type) {
@@ -6941,6 +6945,17 @@ function _array(Class, element, params) {
6941
6945
  ...normalizeParams(params)
6942
6946
  });
6943
6947
  }
6948
+ function _custom(Class, fn, _params) {
6949
+ const norm = normalizeParams(_params);
6950
+ norm.abort ?? (norm.abort = true);
6951
+ const schema = new Class({
6952
+ type: "custom",
6953
+ check: "custom",
6954
+ fn,
6955
+ ...norm
6956
+ });
6957
+ return schema;
6958
+ }
6944
6959
  function _refine(Class, fn, _params) {
6945
6960
  const schema = new Class({
6946
6961
  type: "custom",
@@ -8923,6 +8938,9 @@ var ZodCustom = /* @__PURE__ */ $constructor("ZodCustom", (inst, def) => {
8923
8938
  ZodType.init(inst, def);
8924
8939
  inst._zod.processJSONSchema = (ctx, json, params) => customProcessor(inst, ctx, json, params);
8925
8940
  });
8941
+ function custom(fn, _params) {
8942
+ return _custom(ZodCustom, fn ?? (() => true), _params);
8943
+ }
8926
8944
  function refine(fn, _params = {}) {
8927
8945
  return _refine(ZodCustom, fn, _params);
8928
8946
  }
@@ -9039,7 +9057,7 @@ Object.keys(JURISDICTIONS).filter((code) => JURISDICTIONS[code].optional);
9039
9057
  var COUNTRIES = new Set("AD AE AF AG AI AL AM AO AQ AR AS AT AU AW AX AZ BA BB BD BE BF BG BH BI BJ BL BM BN BO BQ BR BS BT BV BW BY BZ CA CC CD CF CG CH CI CK CL CM CN CO CR CU CV CW CX CY CZ DE DJ DK DM DO DZ EC EE EG EH ER ES ET FI FJ FK FM FO FR GA GB GD GE GF GG GH GI GL GM GN GP GQ GR GS GT GU GW GY HK HM HN HR HT HU ID IE IL IM IN IO IQ IR IS IT JE JM JO JP KE KG KH KI KM KN KP KR KW KY KZ LA LB LC LI LK LR LS LT LU LV LY MA MC MD ME MF MG MH MK ML MM MN MO MP MQ MR MS MT MU MV MW MX MY MZ NA NC NE NF NG NI NL NO NP NR NU NZ OM PA PE PF PG PH PK PL PM PN PR PS PT PW PY QA RE RO RS RU RW SA SB SC SD SE SG SH SI SJ SK SL SM SN SO SR SS ST SV SX SY SZ TC TD TF TG TH TJ TK TL TM TN TO TR TT TV TW TZ UA UG UM US UY UZ VA VC VE VG VI VN VU WF WS YE YT ZA ZM ZW".split(" "));
9040
9058
  var EU_COUNTRIES2 = new Set("AT BE BG HR CY CZ DK EE FI FR DE GR HU IE IT LV LT LU MT NL PL PT RO SK SI ES SE".split(" "));
9041
9059
 
9042
- // src/contract/TestRegionalActions-Ce8EVv4q.js
9060
+ // src/contract/TestRegionalActions-BAzqFJfV.js
9043
9061
  var msg = (text) => text;
9044
9062
  var MODERATION_QUALIFIER_INFO = {
9045
9063
  "sexual-pornographic-media": {
@@ -10048,13 +10066,14 @@ var MODERATION_QUALIFIER_INFO = {
10048
10066
  }
10049
10067
  };
10050
10068
  var MODERATION_QUALIFIERS = Object.keys(MODERATION_QUALIFIER_INFO);
10051
- MODERATION_QUALIFIERS.reduce((groups, qualifier) => {
10069
+ var MODERATION_QUALIFIERS_BY_CATEGORY = MODERATION_QUALIFIERS.reduce((groups, qualifier) => {
10052
10070
  (groups[MODERATION_QUALIFIER_INFO[qualifier].category] ??= []).push(qualifier);
10053
10071
  return groups;
10054
10072
  }, {});
10055
- function getModerationQualifierInfo(qualifier) {
10056
- return MODERATION_QUALIFIER_INFO[qualifier];
10073
+ function isInputQualifier(qualifier) {
10074
+ return MODERATION_QUALIFIER_INFO[qualifier].fromInput === true;
10057
10075
  }
10076
+ var getModerationQualifiers = (category) => MODERATION_QUALIFIERS_BY_CATEGORY[category] ?? [];
10058
10077
  var TEST_REGIONAL_ACTIONS_SCHEMA = /* @__PURE__ */ lazySchema(() => array(object({
10059
10078
  region: JURISDICTION_SCHEMA.exclude(["global"]),
10060
10079
  action: _enum([
@@ -10064,7 +10083,7 @@ var TEST_REGIONAL_ACTIONS_SCHEMA = /* @__PURE__ */ lazySchema(() => array(object
10064
10083
  ])
10065
10084
  }).strict()).max(7).refine((entries) => new Set(entries.map((entry) => entry.region)).size === entries.length, "Choose each region once"));
10066
10085
 
10067
- // src/contract/TestTriggers-uL2Ec8Vt.js
10086
+ // src/contract/TestTriggers-ByQZ27Zp.js
10068
10087
  var TEST_IMAGE_GRID_LEVELS = [
10069
10088
  72,
10070
10089
  128,
@@ -10158,6 +10177,14 @@ var TEST_DETECTIONS_SCHEMA = /* @__PURE__ */ lazySchema(() => object({
10158
10177
  people: union([array(TEST_DETECTED_PERSON_SCHEMA).max(32), literal("unavailable")]).optional(),
10159
10178
  faces: union([array(TEST_DETECTED_FACE_SCHEMA).max(32), literal("unavailable")]).optional()
10160
10179
  }).strict());
10180
+ var TEST_INPUT_QUALIFIER_ERRORS = {
10181
+ unknown: "unknown-qualifier",
10182
+ automatic: "input-type-qualifier",
10183
+ repeated: "repeated-qualifier"
10184
+ };
10185
+ var isKnownQualifier = (qualifier) => MODERATION_QUALIFIERS.includes(qualifier);
10186
+ var isCategoryQualifier = (category, qualifier) => getModerationQualifiers(category).includes(qualifier);
10187
+ var getTestInputQualifiers = (category) => getModerationQualifiers(category).filter((qualifier) => !isInputQualifier(qualifier));
10161
10188
  var TEST_INPUT_SCHEMA = /* @__PURE__ */ lazySchema(() => object({
10162
10189
  regionalActions: TEST_REGIONAL_ACTIONS_SCHEMA.optional(),
10163
10190
  unassessedCategories: array(_enum(CLASSIFICATION_CATEGORIES)).max(CLASSIFICATION_CATEGORIES.length).optional(),
@@ -10169,13 +10196,49 @@ var TEST_INPUT_SCHEMA = /* @__PURE__ */ lazySchema(() => object({
10169
10196
  "age-restrict",
10170
10197
  "block"
10171
10198
  ]).optional(),
10172
- qualifiers: array(_enum(MODERATION_QUALIFIERS)).max(64)
10199
+ qualifiers: array(custom((value) => typeof value === "string", { message: "A qualifier is a string, such as harassment-abuse." })).max(64)
10173
10200
  }).strict().superRefine((instance, context) => {
10174
- if (new Set(instance.qualifiers).size !== instance.qualifiers.length || instance.qualifiers.some((q) => getModerationQualifierInfo(q).category !== instance.category || ("fromInput" in getModerationQualifierInfo(q))))
10175
- context.addIssue({
10176
- code: "custom",
10177
- message: "Choose unique content qualifiers from this category; input-type facts are automatic."
10178
- });
10201
+ const seen = /* @__PURE__ */ new Set;
10202
+ instance.qualifiers.forEach((qualifier, index) => {
10203
+ const path = ["qualifiers", index];
10204
+ const details = {
10205
+ category: instance.category,
10206
+ qualifier
10207
+ };
10208
+ if (isKnownQualifier(qualifier) && isInputQualifier(qualifier))
10209
+ context.addIssue({
10210
+ code: "custom",
10211
+ path,
10212
+ params: {
10213
+ ...details,
10214
+ reason: TEST_INPUT_QUALIFIER_ERRORS.automatic
10215
+ },
10216
+ message: `"${qualifier}" is set by the input type: leave it out.`
10217
+ });
10218
+ else if (!isCategoryQualifier(instance.category, qualifier)) {
10219
+ const allowed = getTestInputQualifiers(instance.category);
10220
+ context.addIssue({
10221
+ code: "custom",
10222
+ path,
10223
+ params: {
10224
+ ...details,
10225
+ reason: TEST_INPUT_QUALIFIER_ERRORS.unknown,
10226
+ allowed
10227
+ },
10228
+ message: `Unknown ${instance.category} qualifier "${qualifier}": choose from ${allowed.join(", ")}.`
10229
+ });
10230
+ } else if (seen.has(qualifier))
10231
+ context.addIssue({
10232
+ code: "custom",
10233
+ path,
10234
+ params: {
10235
+ ...details,
10236
+ reason: TEST_INPUT_QUALIFIER_ERRORS.repeated
10237
+ },
10238
+ message: `"${qualifier}" is repeated: give each qualifier once.`
10239
+ });
10240
+ seen.add(qualifier);
10241
+ });
10179
10242
  })).max(128),
10180
10243
  detections: TEST_DETECTIONS_SCHEMA.optional()
10181
10244
  }).strict().superRefine((scenario, context) => {
@@ -10367,7 +10430,8 @@ async function withValidTestInputArguments(key, generate) {
10367
10430
  if (error instanceof ZodError) {
10368
10431
  const [issue] = error.issues;
10369
10432
  const path = (issue?.path ?? []).map((segment) => typeof segment === "number" ? segment : String(segment));
10370
- throw invalidArgument(`Invalid test scenario at ${path.length ? path.join(".") : "scenario"}: ${issue?.message ?? error.message}`, { path });
10433
+ const qualifier = issue?.code === "custom" && typeof issue.params?.reason === "string" ? issue.params : {};
10434
+ throw invalidArgument(`Invalid test scenario at ${path.length ? path.join(".") : "scenario"}: ${issue?.message ?? error.message}`, { path, ...qualifier });
10371
10435
  }
10372
10436
  if (error instanceof RangeError)
10373
10437
  throw invalidArgument(error.message);
@@ -17383,7 +17447,7 @@ var schemas_exports = /* @__PURE__ */ __exportAll({
17383
17447
  cuid: () => cuid3,
17384
17448
  cuid2: () => cuid22,
17385
17449
  currencyCode: () => currencyCode,
17386
- custom: () => custom,
17450
+ custom: () => custom2,
17387
17451
  date: () => date$1,
17388
17452
  describe: () => describe2,
17389
17453
  discriminatedUnion: () => discriminatedUnion,
@@ -18842,7 +18906,7 @@ function check(fn) {
18842
18906
  ch._zod.check = fn;
18843
18907
  return ch;
18844
18908
  }
18845
- function custom(fn, _params) {
18909
+ function custom2(fn, _params) {
18846
18910
  return /* @__PURE__ */ _custom2(ZodCustom2, fn ?? (() => true), _params);
18847
18911
  }
18848
18912
  function refine2(fn, _params = {}) {
@@ -1,4 +1,4 @@
1
- const require_UploadController = require("./UploadController-CVKtUCK0.js");
1
+ const require_UploadController = require("./UploadController-C1tiTTRR.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-B110Ug8_.js";
2
- import { r as UseCalmLensUploadResult$1 } from "./ReactUpload-CbtQtN6v.js";
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-C6_Q5ZME.js";
2
+ import { r as UseCalmLensUploadResult$1 } from "./ReactUpload-fy6zhY8M.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 { 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";
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-jond9q6a.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,6 +1,6 @@
1
1
  const require_CalmLensError = require("./CalmLensError-C9g7GXfU.js");
2
- const require_CalmLensCdn = require("./CalmLensCdn-B_Tbwq10.js");
3
- const require_CalmLensConnection = require("./CalmLensConnection-Dhg1amnb.js");
2
+ const require_CalmLensCdn = require("./CalmLensCdn-DCj0AfoS.js");
3
+ const require_CalmLensConnection = require("./CalmLensConnection-BpBq0nQR.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. */
@@ -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.38.0";
155
+ const SDK_VERSION = "0.38.1";
156
156
  const runtimeName = () => {
157
157
  const runtime = globalThis;
158
158
  if (isReactNativeRuntime()) return "react-native";
@@ -1,5 +1,5 @@
1
1
  const require_CalmLensError = require("./CalmLensError-C9g7GXfU.js");
2
- const require_CalmLensCdn = require("./CalmLensCdn-B_Tbwq10.js");
2
+ const require_CalmLensCdn = require("./CalmLensCdn-DCj0AfoS.js");
3
3
  // src/contract/AssetPayload.js
4
4
  const bufferInputToBytes = (value) => {
5
5
  if (value instanceof ArrayBuffer) return new Uint8Array(value);
@@ -606,13 +606,23 @@ const assertUploadSize = (type, size, inParts) => {
606
606
  };
607
607
  /** Checks upload options before anything is sent. */
608
608
  const isBlob = (value) => typeof Blob !== "undefined" && value instanceof Blob;
609
+ /** Plain text given without a type, which is `text/plain`, as the API defaults it. */
610
+ const isUntypedText = (content) => !!content && typeof content === "object" && "plainText" in content && content.type === void 0;
609
611
  /**
610
- * `content` given as a `Blob` or `File`, as the `{ data, type }` the rest of the client reads: the
611
- * content type is the Blob's own, and a File's name is the asset's when the options give none.
612
+ * `content` as the `{ data, type }` or `{ plainText, type }` the rest of the client reads: a `Blob`
613
+ * or `File` has its own type (and a File's name is the asset's when the options give none), and
614
+ * plain text without a type is `text/plain`.
612
615
  */
613
616
  const withContentObject = (options) => {
614
617
  if (!options || typeof options !== "object" || !("content" in options)) return options;
615
618
  const content = options.content;
619
+ if (isUntypedText(content)) return {
620
+ ...options,
621
+ content: {
622
+ ...content,
623
+ type: "text/plain"
624
+ }
625
+ };
616
626
  if (!isBlob(content)) return options;
617
627
  if (!content.type) throw invalidPayload("The Blob has no type: create it with one, such as new Blob([bytes], { type: \"image/png\" }), or pass { data, type }");
618
628
  const fileName = typeof File !== "undefined" && content instanceof File ? content.name : void 0;
@@ -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-CCsoVr39.js";
3
- import { d as ListPromise, l as CalmLensResponse, r as CdnResponse } from "./WebhookPayload-_fvY2eu8.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-jond9q6a.js";
3
+ import { d as ListPromise, l as CalmLensResponse, r as CdnResponse } from "./WebhookPayload-DdpKjQGw.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;
@@ -1,6 +1,6 @@
1
1
  const require_CalmLensError = require("./CalmLensError-C9g7GXfU.js");
2
- const require_CalmLensCdn = require("./CalmLensCdn-B_Tbwq10.js");
3
- const require_CalmLensConnection = require("./CalmLensConnection-Dhg1amnb.js");
2
+ const require_CalmLensCdn = require("./CalmLensCdn-DCj0AfoS.js");
3
+ const require_CalmLensConnection = require("./CalmLensConnection-BpBq0nQR.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) => {
@@ -43339,7 +43339,23 @@ type ListAssetChildrenOptions = Partial<GetAssetChildrenQuery> & {
43339
43339
  type ListAssetTimelineOptions = Partial<GetAssetTimelineQuery> & {
43340
43340
  assetId: string;
43341
43341
  };
43342
- type AssetContentOptions = AssetBinaryPayloadInput & {
43342
+ /**
43343
+ * Content and its MIME type or file extension. `type` defaults to `text/plain` for `plainText`;
43344
+ * give `text/html` to moderate the text as a web page. Other content needs its type.
43345
+ */
43346
+ type AssetContentOptions = ((Extract<AssetBinaryPayloadInput, {
43347
+ plainText: string;
43348
+ }> & {
43349
+ type?: string;
43350
+ }) | (Exclude<AssetBinaryPayloadInput, {
43351
+ plainText: string;
43352
+ }> & {
43353
+ type: string;
43354
+ })) & {
43355
+ sizeInBytes?: number;
43356
+ };
43357
+ /** Content as the client sends it, with its type resolved. */
43358
+ type PreparedAssetContentOptions = AssetBinaryPayloadInput & {
43343
43359
  type: string;
43344
43360
  sizeInBytes?: number;
43345
43361
  };
@@ -43358,7 +43374,7 @@ interface UploadAssetPartOptions extends IdempotencyOptions {
43358
43374
  */
43359
43375
  wait?: boolean;
43360
43376
  }
43361
- type CreateMultipartUploadPartOptions = AssetContentOptions & {
43377
+ type CreateMultipartUploadPartOptions = PreparedAssetContentOptions & {
43362
43378
  partNumber?: number;
43363
43379
  isFinal?: boolean;
43364
43380
  sizeInBytes?: number;
@@ -43397,9 +43413,12 @@ interface SubmitAssetCommonOptions extends IdempotencyOptions {
43397
43413
  * name the asset's name when you give none), or bytes, base64 or plain text with their `type`.
43398
43414
  */
43399
43415
  type AssetContentInput = AssetContentOptions | Blob;
43400
- /** Options as the client sends them, once a `Blob` or `File` is read as `{ data, type }`. */
43416
+ /**
43417
+ * Options as the client sends them, once a `Blob` or `File` is read as `{ data, type }` and plain
43418
+ * text without a type is `text/plain`.
43419
+ */
43401
43420
  type PreparedSubmitAssetOptions = (SubmitAssetCommonOptions & {
43402
- content: AssetContentOptions;
43421
+ content: PreparedAssetContentOptions;
43403
43422
  }) | (SubmitAssetCommonOptions & {
43404
43423
  url: string;
43405
43424
  }) | (SubmitAssetCommonOptions & {
@@ -43414,7 +43433,7 @@ type PreparedSubmitAssetOptions = (SubmitAssetCommonOptions & {
43414
43433
  });
43415
43434
  /** What `assets.create` and `assets.classify` take: content, a URL or a multipart part. */
43416
43435
  type SubmitAssetOptions = PreparedSubmitAssetOptions | (SubmitAssetCommonOptions & {
43417
- content: Blob;
43436
+ content: AssetContentInput;
43418
43437
  });
43419
43438
  interface MultipartUploadOptions extends SubmitAssetCommonOptions {
43420
43439
  part: CreateMultipartUploadPartOptions;
@@ -1,6 +1,6 @@
1
1
  const require_CalmLensError = require("./CalmLensError-C9g7GXfU.js");
2
- const require_CalmLensCdn = require("./CalmLensCdn-B_Tbwq10.js");
3
- const require_UploadController = require("./UploadController-CVKtUCK0.js");
2
+ const require_CalmLensCdn = require("./CalmLensCdn-DCj0AfoS.js");
3
+ const require_UploadController = require("./UploadController-C1tiTTRR.js");
4
4
  const require_FileIcons = require("./FileIcons-Ob003MdS.js");
5
5
  // src/ui/viewers/ViewerAsset.ts
6
6
  /** Spreadsheet MIME types, as `content.format` reports them (compared lower-cased). */
@@ -1,5 +1,5 @@
1
- import { F as CdnTransform, O as CalmLensAppClientOptions, fn as ViewerClaims, g as AssetModerationStatus, i as AssetAvailability } from "./CalmLensTypes-CCsoVr39.js";
2
- import { t as CalmLensAppClient } from "./CalmLensAppClient-L5x_sMOI.js";
1
+ import { F as CdnTransform, O as CalmLensAppClientOptions, fn as ViewerClaims, g as AssetModerationStatus, i as AssetAvailability } from "./CalmLensTypes-jond9q6a.js";
2
+ import { t as CalmLensAppClient } from "./CalmLensAppClient-CQpnc4JZ.js";
3
3
  import { o as UploadFileIconFamily } from "./FileIcons-4qSX7DW2.js";
4
4
  /**
5
5
  * The text the asset viewers show, keyed by name. `{name}` placeholders are filled in when shown.
@@ -1,4 +1,4 @@
1
- const require_UploadController = require("./UploadController-CVKtUCK0.js");
1
+ const require_UploadController = require("./UploadController-C1tiTTRR.js");
2
2
  let react = require("react");
3
3
  // src/ui/ReactUpload.ts
4
4
  const CalmLensContext = (0, react.createContext)(void 0);
@@ -1,4 +1,4 @@
1
- import { F as UploadFile, L as UploadSnapshot, N as UploadController, O as CalmLensProvidedOptions, P as UploadControllerOptions } from "./Core-B110Ug8_.js";
1
+ import { F as UploadFile, L as UploadSnapshot, N as UploadController, O as CalmLensProvidedOptions, P as UploadControllerOptions } from "./Core-C6_Q5ZME.js";
2
2
  import { ReactNode } from "react";
3
3
  type CalmLensProviderProps<F extends UploadFile = File> = CalmLensProvidedOptions<F> & {
4
4
  children?: ReactNode;
@@ -1,5 +1,5 @@
1
1
  const require_CalmLensError = require("./CalmLensError-C9g7GXfU.js");
2
- const require_CalmLensAppClient = require("./CalmLensAppClient-DoNMg8Dh.js");
2
+ const require_CalmLensAppClient = require("./CalmLensAppClient-Diu1QtBz.js");
3
3
  // src/contract/PlaceholderHashDecode.js
4
4
  /**
5
5
  * Decodes a ThumbHash to an RGBA image. RGB is not be premultiplied by A.
@@ -1,4 +1,4 @@
1
- import { Fn as EventResourceKind, Nn as TypedEvent, jn as Actor } from "./CalmLensTypes-CCsoVr39.js";
1
+ import { Fn as EventResourceKind, Nn as TypedEvent, jn as Actor } from "./CalmLensTypes-jond9q6a.js";
2
2
  import * as zod from "zod";
3
3
  /** Error codes the CalmLens API documents, by name. */
4
4
  declare const API_ERROR_CODES: {
package/cjs/app.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { a as ClassificationQualifierResults, c as HashList, d as ModerationContext, i as ClassificationNotEvaluatedReason, l as HashListEntry, n as ClassificationCategory, o as Likelihood, r as ClassificationCategoryReport, s as ModerationQualifier, t as ClassificationCategories, u as PolicyAction } from "./Classification-C3pkrGYS-B7EygpJn.js";
2
- import { $ as EventFactValues, $n as ProcessingOptions, $t as UpdateFolderOptions, A as CdnAssetLocation, An as LensType, At as PolicyIdOptions, B as CreateHashListOptions, Bn as AssetSearchQuery, Bt as RetrieveAssetByExternalIdOptions, C as AssetUploadStatus, Cn as DetectedFace, Ct as ListPoliciesOptions, D as BatchAssetsResponse, Dn as ProcessingFeatureStage, Dt as MultipartUploadOptions, E as BatchAssetsOptions, En as ProcessingFeatureResults, Et as MoveFolderOptions, F as CdnTransform, Fn as EventResourceKind, Ft as RemoveAssetContentOptions, G as DeleteAssetOptions, Gn as AssetPreview, Gt as SignAssetUrlOptions, H as CreateMultipartUploadPartOptions, Hn as AssetInfo, Ht as RetryAssetOptions, I as ClassifyTextOptions, In as EventSeverity, It as RequestAssetReviewOptions, J as EnsureLensesOptions, Jn as AssetSafetyHold, Jt as SignedUploadToken, K as DeleteMetadataFieldOptions, Kn as AssetRendered, Kt as SignUploadTokenOptions, L as ClientRequestDefaults, Lt as RequestAttempt, M as CdnAssetUrlOptions, Mn as EventResource, Mt as PolicySettings, N as CdnResource, Nt as ProjectSettingsResource, O as CalmLensAppClientOptions, On as ProcessingFeatures, Ot as MultipartUploadPartOptions, P as CdnServeOptions, Pn as EventCategory, Pt as PublicProjectSettings, Q as EventFact, Qn as MetadataItem, Qt as UpdateAssetOptions, R as ConnectionOptions, Rn as Folder, Rt as RequestOptions, S as AssetUpload, Sn as BoundingBox, St as ListLensesOptions, T as AssignPolicyOptions, Tn as ProcessingFeatureId, Tt as MoveAssetOptions, U as CreatePolicyOptions, Un as AssetHls, Ut as SearchAssetsOptions, V as CreateLensOptions, Vt as RetrieveAssetOptions, W as DecideAssetOptions, Wn as AssetHlsRendition, Wt as SetPolicyAutomaticUpdatesOptions, X as EnsureUploadPresetsOptions, Xn as ExtractedText, Xt as SubmitAssetOptions, Y as EnsureMetadataFieldsOptions, Yn as AssetSafetyHoldReason, Yt as StreamingFeatureOptions, Z as EnsureUploadPresetsResponse, Zn as FileMetadata, Zt as TypedEvent, _ as AssetPage, _n as AssetReviewRequest, _t as ListAssetsOptions, a as AssetChecksums, an as UploadAssetPartOptions, at as GetAssetInfoOptions, b as AssetTimelinePage, bn as UploadPreset, bt as ListHashListEntriesOptions, c as AssetClassificationFailureReason, cn as UploadPresetPage, ct as HashListIdOptions, d as AssetContentOptions, dn as VerifyWebhookSignatureOptions, dt as ImageTransformOptions, en as UpdateHashListOptions, et as EventFacts, f as AssetContentRemovalReason, fn as ViewerClaims, ft as Lens, g as AssetModerationStatus, gn as AssetBatchOperation, gt as ListAssetTimelineOptions, h as AssetModerationDecision, hn as WebhookPayloadInput, ht as ListAssetChildrenOptions, i as AssetAvailability, in as UpgradePolicyOptions, it as FolderPage, j as CdnAssetReference, jt as PolicyPage, k as CalmLensServerClientOptions, kn as CursorPage, kt as Policy, l as AssetClassificationStatus, ln as UploadPresetSubmitAssetOptions, lt as HashListPage, m as AssetModeration, mn as WebhookHeadersInput, mt as LensPage, n as AppInfo, nn as UpdatePolicyOptions, nt as EventsPage, o as AssetChildrenPage, on as UploadPresetDefinition, ot as HashListEntryIdOptions, p as AssetContentStatus, pn as WaitForAssetDecisionOptions, pt as LensIdOptions, q as EnsureLensOptions, qn as AssetRenderedKind, qt as SignedAssetUrl, r as Asset, rn as UpdateProjectSettingsOptions, rt as FolderIdOptions, s as AssetClassification, sn as UploadPresetIdOptions, st as HashListEntryPage, t as AddHashListEntryOptions, tn as UpdateLensOptions, tt as EventType, u as AssetContent, un as UploadedAsset, ut as IdempotencyOptions, v as AssetSearchResponse, vn as AssetTimelineSegment, vt as ListEventsOptions, w as AssetVisibility, wn as DetectedPerson, wt as ListUploadPresetsOptions, x as AssetType, xn as AgeRange, xt as ListHashListsOptions, y as AssetSearchResult, yn as MetadataFieldsResource, yt as ListFoldersOptions, z as CreateFolderOptions, zn as AssetSearchMatchField, zt as ResetPolicyOptions } from "./CalmLensTypes-CCsoVr39.js";
3
- import { t as CalmLensAppClient } from "./CalmLensAppClient-L5x_sMOI.js";
4
- import { a as getAssetInfo, i as CDN_RESOURCES, n as SDK_VERSION, r as DEFAULT_CDN_BASE_URL, t as ModerationContextItem } from "./index-Dk3I5YXf.js";
5
- import { A as CalmLensRateLimitError, C as CalmLensErrorKind, D as CalmLensNotFoundError, E as CalmLensInvalidResponseError, F as SdkErrorCode, I as ApiErrorCode, M as CalmLensTimeoutError, N as CalmLensUnprocessableEntityError, O as CalmLensPayloadTooLargeError, P as CalmLensWebhookVerificationError, S as CalmLensErrorDetails, T as CalmLensInvalidArgumentError, _ as CalmLensConfigurationError, a as AUTO_PAGING_TO_ARRAY_MAX, b as CalmLensError, c as CalmLensLastResponse, d as ListPromise, f as CALMLENS_ERROR_CODES, g as CalmLensCancelledError, h as CalmLensBadRequestError, i as ServedAssetInfo, j as CalmLensServerError, k as CalmLensPermissionDeniedError, l as CalmLensResponse, m as CalmLensAuthenticationError, o as AutoPaging, p as CalmLensApiError, r as CdnResponse, s as AutoPagingToArrayOptions, t as ReceivedWebhookEventPayload, u as ListPage, v as CalmLensConflictError, w as CalmLensErrorOptions, x as CalmLensErrorCode, y as CalmLensConnectionError } from "./WebhookPayload-_fvY2eu8.js";
2
+ import { $ as EventFactValues, $n as ProcessingOptions, $t as UpdateFolderOptions, A as CdnAssetLocation, An as LensType, At as PolicyIdOptions, B as CreateHashListOptions, Bn as AssetSearchQuery, Bt as RetrieveAssetByExternalIdOptions, C as AssetUploadStatus, Cn as DetectedFace, Ct as ListPoliciesOptions, D as BatchAssetsResponse, Dn as ProcessingFeatureStage, Dt as MultipartUploadOptions, E as BatchAssetsOptions, En as ProcessingFeatureResults, Et as MoveFolderOptions, F as CdnTransform, Fn as EventResourceKind, Ft as RemoveAssetContentOptions, G as DeleteAssetOptions, Gn as AssetPreview, Gt as SignAssetUrlOptions, H as CreateMultipartUploadPartOptions, Hn as AssetInfo, Ht as RetryAssetOptions, I as ClassifyTextOptions, In as EventSeverity, It as RequestAssetReviewOptions, J as EnsureLensesOptions, Jn as AssetSafetyHold, Jt as SignedUploadToken, K as DeleteMetadataFieldOptions, Kn as AssetRendered, Kt as SignUploadTokenOptions, L as ClientRequestDefaults, Lt as RequestAttempt, M as CdnAssetUrlOptions, Mn as EventResource, Mt as PolicySettings, N as CdnResource, Nt as ProjectSettingsResource, O as CalmLensAppClientOptions, On as ProcessingFeatures, Ot as MultipartUploadPartOptions, P as CdnServeOptions, Pn as EventCategory, Pt as PublicProjectSettings, Q as EventFact, Qn as MetadataItem, Qt as UpdateAssetOptions, R as ConnectionOptions, Rn as Folder, Rt as RequestOptions, S as AssetUpload, Sn as BoundingBox, St as ListLensesOptions, T as AssignPolicyOptions, Tn as ProcessingFeatureId, Tt as MoveAssetOptions, U as CreatePolicyOptions, Un as AssetHls, Ut as SearchAssetsOptions, V as CreateLensOptions, Vt as RetrieveAssetOptions, W as DecideAssetOptions, Wn as AssetHlsRendition, Wt as SetPolicyAutomaticUpdatesOptions, X as EnsureUploadPresetsOptions, Xn as ExtractedText, Xt as SubmitAssetOptions, Y as EnsureMetadataFieldsOptions, Yn as AssetSafetyHoldReason, Yt as StreamingFeatureOptions, Z as EnsureUploadPresetsResponse, Zn as FileMetadata, Zt as TypedEvent, _ as AssetPage, _n as AssetReviewRequest, _t as ListAssetsOptions, a as AssetChecksums, an as UploadAssetPartOptions, at as GetAssetInfoOptions, b as AssetTimelinePage, bn as UploadPreset, bt as ListHashListEntriesOptions, c as AssetClassificationFailureReason, cn as UploadPresetPage, ct as HashListIdOptions, d as AssetContentOptions, dn as VerifyWebhookSignatureOptions, dt as ImageTransformOptions, en as UpdateHashListOptions, et as EventFacts, f as AssetContentRemovalReason, fn as ViewerClaims, ft as Lens, g as AssetModerationStatus, gn as AssetBatchOperation, gt as ListAssetTimelineOptions, h as AssetModerationDecision, hn as WebhookPayloadInput, ht as ListAssetChildrenOptions, i as AssetAvailability, in as UpgradePolicyOptions, it as FolderPage, j as CdnAssetReference, jt as PolicyPage, k as CalmLensServerClientOptions, kn as CursorPage, kt as Policy, l as AssetClassificationStatus, ln as UploadPresetSubmitAssetOptions, lt as HashListPage, m as AssetModeration, mn as WebhookHeadersInput, mt as LensPage, n as AppInfo, nn as UpdatePolicyOptions, nt as EventsPage, o as AssetChildrenPage, on as UploadPresetDefinition, ot as HashListEntryIdOptions, p as AssetContentStatus, pn as WaitForAssetDecisionOptions, pt as LensIdOptions, q as EnsureLensOptions, qn as AssetRenderedKind, qt as SignedAssetUrl, r as Asset, rn as UpdateProjectSettingsOptions, rt as FolderIdOptions, s as AssetClassification, sn as UploadPresetIdOptions, st as HashListEntryPage, t as AddHashListEntryOptions, tn as UpdateLensOptions, tt as EventType, u as AssetContent, un as UploadedAsset, ut as IdempotencyOptions, v as AssetSearchResponse, vn as AssetTimelineSegment, vt as ListEventsOptions, w as AssetVisibility, wn as DetectedPerson, wt as ListUploadPresetsOptions, x as AssetType, xn as AgeRange, xt as ListHashListsOptions, y as AssetSearchResult, yn as MetadataFieldsResource, yt as ListFoldersOptions, z as CreateFolderOptions, zn as AssetSearchMatchField, zt as ResetPolicyOptions } from "./CalmLensTypes-jond9q6a.js";
3
+ import { t as CalmLensAppClient } from "./CalmLensAppClient-CQpnc4JZ.js";
4
+ import { a as getAssetInfo, i as CDN_RESOURCES, n as SDK_VERSION, r as DEFAULT_CDN_BASE_URL, t as ModerationContextItem } from "./index-CgAztQdX.js";
5
+ import { A as CalmLensRateLimitError, C as CalmLensErrorKind, D as CalmLensNotFoundError, E as CalmLensInvalidResponseError, F as SdkErrorCode, I as ApiErrorCode, M as CalmLensTimeoutError, N as CalmLensUnprocessableEntityError, O as CalmLensPayloadTooLargeError, P as CalmLensWebhookVerificationError, S as CalmLensErrorDetails, T as CalmLensInvalidArgumentError, _ as CalmLensConfigurationError, a as AUTO_PAGING_TO_ARRAY_MAX, b as CalmLensError, c as CalmLensLastResponse, d as ListPromise, f as CALMLENS_ERROR_CODES, g as CalmLensCancelledError, h as CalmLensBadRequestError, i as ServedAssetInfo, j as CalmLensServerError, k as CalmLensPermissionDeniedError, l as CalmLensResponse, m as CalmLensAuthenticationError, o as AutoPaging, p as CalmLensApiError, r as CdnResponse, s as AutoPagingToArrayOptions, t as ReceivedWebhookEventPayload, u as ListPage, v as CalmLensConflictError, w as CalmLensErrorOptions, x as CalmLensErrorCode, y as CalmLensConnectionError } from "./WebhookPayload-DdpKjQGw.js";
6
6
  export { AUTO_PAGING_TO_ARRAY_MAX, type AddHashListEntryOptions, type AgeRange, type ApiErrorCode, type AppInfo, type Asset, type AssetAvailability, type AssetBatchOperation, type AssetChecksums, type AssetChildrenPage, type AssetClassification, type AssetClassificationFailureReason, type AssetClassificationStatus, type AssetContent, type AssetContentOptions, type AssetContentRemovalReason, type AssetContentStatus, type AssetHls, type AssetHlsRendition, type AssetInfo, type AssetModeration, type AssetModerationDecision, type AssetModerationStatus, type AssetPage, type AssetPreview, type AssetRendered, type AssetRenderedKind, type AssetReviewRequest, type AssetSafetyHold, type AssetSafetyHoldReason, type AssetSearchMatchField, type AssetSearchQuery, type AssetSearchResponse, type AssetSearchResult, type AssetTimelinePage, type AssetTimelineSegment, type AssetType, type AssetUpload, type AssetUploadStatus, type AssetVisibility, type AssignPolicyOptions, type AutoPaging, type AutoPagingToArrayOptions, type BatchAssetsOptions, type BatchAssetsResponse, type BoundingBox, CALMLENS_ERROR_CODES, CDN_RESOURCES, CalmLensApiError, CalmLensAppClient, type CalmLensAppClientOptions, CalmLensAuthenticationError, CalmLensBadRequestError, CalmLensCancelledError, CalmLensConfigurationError, CalmLensConflictError, CalmLensConnectionError, CalmLensError, type CalmLensErrorCode, type CalmLensErrorDetails, type CalmLensErrorKind, type CalmLensErrorOptions, CalmLensInvalidArgumentError, CalmLensInvalidResponseError, type CalmLensLastResponse, CalmLensNotFoundError, CalmLensPayloadTooLargeError, CalmLensPermissionDeniedError, CalmLensRateLimitError, type CalmLensResponse, type CalmLensServerClientOptions, CalmLensServerError, CalmLensTimeoutError, CalmLensUnprocessableEntityError, CalmLensWebhookVerificationError, type CdnAssetLocation, type CdnAssetReference, type CdnAssetUrlOptions, type CdnResource, type CdnResponse, type CdnServeOptions, type CdnTransform, type ClassificationCategories, type ClassificationCategory, type ClassificationCategoryReport, type ClassificationNotEvaluatedReason, type ClassificationQualifierResults, type ClassifyTextOptions, type ClientRequestDefaults, type ConnectionOptions, type CreateFolderOptions, type CreateHashListOptions, type CreateLensOptions, type CreateMultipartUploadPartOptions, type CreatePolicyOptions, type CursorPage, DEFAULT_CDN_BASE_URL, type DecideAssetOptions, type DeleteAssetOptions, type DeleteMetadataFieldOptions, type DetectedFace, type DetectedPerson, type EnsureLensOptions, type EnsureLensesOptions, type EnsureMetadataFieldsOptions, type EnsureUploadPresetsOptions, type EnsureUploadPresetsResponse, type EventCategory, type EventFact, type EventFactValues, type EventFacts, type EventResource, type EventResourceKind, type EventSeverity, type EventType, type EventsPage, type ExtractedText, type FileMetadata, type Folder, type FolderIdOptions, type FolderPage, type GetAssetInfoOptions, type HashList, type HashListEntry, type HashListEntryIdOptions, type HashListEntryPage, type HashListIdOptions, type HashListPage, type IdempotencyOptions, type ImageTransformOptions, type Lens, type LensIdOptions, type LensPage, type LensType, type Likelihood, type ListAssetChildrenOptions, type ListAssetTimelineOptions, type ListAssetsOptions, type ListEventsOptions, type ListFoldersOptions, type ListHashListEntriesOptions, type ListHashListsOptions, type ListLensesOptions, type ListPage, type ListPoliciesOptions, type ListPromise, type ListUploadPresetsOptions, type MetadataFieldsResource, type MetadataItem, type ModerationContext, type ModerationContextItem, type ModerationQualifier, type MoveAssetOptions, type MoveFolderOptions, type MultipartUploadOptions, type MultipartUploadPartOptions, type Policy, type PolicyAction, type PolicyIdOptions, type PolicyPage, type PolicySettings, type ProcessingFeatureId, type ProcessingFeatureResults, type ProcessingFeatureStage, type ProcessingFeatures, type ProcessingOptions, type ProjectSettingsResource, type PublicProjectSettings, type RemoveAssetContentOptions, type RequestAssetReviewOptions, type RequestAttempt, type RequestOptions, type ResetPolicyOptions, type RetrieveAssetByExternalIdOptions, type RetrieveAssetOptions, type RetryAssetOptions, SDK_VERSION, type SdkErrorCode, type SearchAssetsOptions, type ServedAssetInfo, type SetPolicyAutomaticUpdatesOptions, type SignAssetUrlOptions, type SignUploadTokenOptions, type SignedAssetUrl, type SignedUploadToken, type StreamingFeatureOptions, type SubmitAssetOptions, type TypedEvent, type UpdateAssetOptions, type UpdateFolderOptions, type UpdateHashListOptions, type UpdateLensOptions, type UpdatePolicyOptions, type UpdateProjectSettingsOptions, type UpgradePolicyOptions, type UploadAssetPartOptions, type UploadPreset, type UploadPresetDefinition, type UploadPresetIdOptions, type UploadPresetPage, type UploadPresetSubmitAssetOptions, type UploadedAsset, type VerifyWebhookSignatureOptions, type ViewerClaims, type WaitForAssetDecisionOptions, type ReceivedWebhookEventPayload as WebhookEventPayload, type WebhookHeadersInput, type WebhookPayloadInput, getAssetInfo };
package/cjs/app.js CHANGED
@@ -1,8 +1,8 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_CalmLensError = require("./CalmLensError-C9g7GXfU.js");
3
- const require_CalmLensCdn = require("./CalmLensCdn-B_Tbwq10.js");
3
+ const require_CalmLensCdn = require("./CalmLensCdn-DCj0AfoS.js");
4
4
  require("./index.js");
5
- const require_CalmLensAppClient = require("./CalmLensAppClient-DoNMg8Dh.js");
5
+ const require_CalmLensAppClient = require("./CalmLensAppClient-Diu1QtBz.js");
6
6
  exports.AUTO_PAGING_TO_ARRAY_MAX = require_CalmLensCdn.AUTO_PAGING_TO_ARRAY_MAX;
7
7
  exports.CALMLENS_ERROR_CODES = require_CalmLensError.CALMLENS_ERROR_CODES;
8
8
  exports.CDN_RESOURCES = require_CalmLensCdn.CDN_RESOURCES;
package/cjs/elements.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { i as AssetAvailability } from "./CalmLensTypes-CCsoVr39.js";
2
- 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";
3
- import { a as UploaderProps, i as UploadSnapshot, n as UploadControllerOptions, r as UploadItem, s as createUploadController, t as CalmLensUpload } from "./BrowserUpload-BuTS7yTy.js";
4
- 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";
1
+ import { i as AssetAvailability } from "./CalmLensTypes-jond9q6a.js";
2
+ 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-C6_Q5ZME.js";
3
+ import { a as UploaderProps, i as UploadSnapshot, n as UploadControllerOptions, r as UploadItem, s as createUploadController, t as CalmLensUpload } from "./BrowserUpload-_iMX_nq0.js";
4
+ 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-Cp18fGXG.js";
5
5
  declare const BaseElement$1: typeof HTMLElement;
6
6
  /**
7
7
  * An asset viewer element. Set the `src` attribute to the asset URL (public or signed) and the
package/cjs/elements.js CHANGED
@@ -1,9 +1,9 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_ui = require("./ui-CuO37F4u.js");
3
- const require_Core = require("./Core-iNgZ8Cij.js");
4
- const require_UploadController = require("./UploadController-CVKtUCK0.js");
2
+ const require_ui = require("./ui-2jJvTcCP.js");
3
+ const require_Core = require("./Core-BHQSo7rY.js");
4
+ const require_UploadController = require("./UploadController-C1tiTTRR.js");
5
5
  const require_FileIcons = require("./FileIcons-Ob003MdS.js");
6
- const require_BrowserUpload = require("./BrowserUpload-BO_ZukUM.js");
6
+ const require_BrowserUpload = require("./BrowserUpload-DS0lxg5C.js");
7
7
  // src/viewers/Elements.ts
8
8
  const BaseElement$1 = typeof HTMLElement === "undefined" ? class {} : HTMLElement;
9
9
  const PROPERTIES = [
@@ -1,6 +1,6 @@
1
1
  import "./Classification-C3pkrGYS-B7EygpJn.js";
2
- import { Hn as AssetInfo, N as CdnResource, at as GetAssetInfoOptions } from "./CalmLensTypes-CCsoVr39.js";
3
- import "./WebhookPayload-_fvY2eu8.js";
2
+ import { Hn as AssetInfo, N as CdnResource, at as GetAssetInfoOptions } from "./CalmLensTypes-jond9q6a.js";
3
+ import "./WebhookPayload-DdpKjQGw.js";
4
4
  /** Every CDN resource beneath an asset URL, as `getAssetUrl` and `signAssetUrl` accept them. */
5
5
  declare const CDN_RESOURCES: CdnResource[];
6
6
  /**
package/cjs/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { a as ClassificationQualifierResults, c as HashList, d as ModerationContext, i as ClassificationNotEvaluatedReason, l as HashListEntry, n as ClassificationCategory, o as Likelihood, r as ClassificationCategoryReport, s as ModerationQualifier, t as ClassificationCategories, u as PolicyAction } from "./Classification-C3pkrGYS-B7EygpJn.js";
2
- import { $ as EventFactValues, $n as ProcessingOptions, $t as UpdateFolderOptions, A as CdnAssetLocation, An as LensType, At as PolicyIdOptions, B as CreateHashListOptions, Bn as AssetSearchQuery, Bt as RetrieveAssetByExternalIdOptions, C as AssetUploadStatus, Cn as DetectedFace, Ct as ListPoliciesOptions, D as BatchAssetsResponse, Dn as ProcessingFeatureStage, Dt as MultipartUploadOptions, E as BatchAssetsOptions, En as ProcessingFeatureResults, Et as MoveFolderOptions, F as CdnTransform, Fn as EventResourceKind, Ft as RemoveAssetContentOptions, G as DeleteAssetOptions, Gn as AssetPreview, Gt as SignAssetUrlOptions, H as CreateMultipartUploadPartOptions, Hn as AssetInfo, Ht as RetryAssetOptions, I as ClassifyTextOptions, In as EventSeverity, It as RequestAssetReviewOptions, J as EnsureLensesOptions, Jn as AssetSafetyHold, Jt as SignedUploadToken, K as DeleteMetadataFieldOptions, Kn as AssetRendered, Kt as SignUploadTokenOptions, L as ClientRequestDefaults, Lt as RequestAttempt, M as CdnAssetUrlOptions, Mn as EventResource, Mt as PolicySettings, N as CdnResource, Nt as ProjectSettingsResource, O as CalmLensAppClientOptions, On as ProcessingFeatures, Ot as MultipartUploadPartOptions, P as CdnServeOptions, Pn as EventCategory, Pt as PublicProjectSettings, Q as EventFact, Qn as MetadataItem, Qt as UpdateAssetOptions, R as ConnectionOptions, Rn as Folder, Rt as RequestOptions, S as AssetUpload, Sn as BoundingBox, St as ListLensesOptions, T as AssignPolicyOptions, Tn as ProcessingFeatureId, Tt as MoveAssetOptions, U as CreatePolicyOptions, Un as AssetHls, Ut as SearchAssetsOptions, V as CreateLensOptions, Vt as RetrieveAssetOptions, W as DecideAssetOptions, Wn as AssetHlsRendition, Wt as SetPolicyAutomaticUpdatesOptions, X as EnsureUploadPresetsOptions, Xn as ExtractedText, Xt as SubmitAssetOptions, Y as EnsureMetadataFieldsOptions, Yn as AssetSafetyHoldReason, Yt as StreamingFeatureOptions, Z as EnsureUploadPresetsResponse, Zn as FileMetadata, Zt as TypedEvent, _ as AssetPage, _n as AssetReviewRequest, _t as ListAssetsOptions, a as AssetChecksums, an as UploadAssetPartOptions, at as GetAssetInfoOptions, b as AssetTimelinePage, bn as UploadPreset, bt as ListHashListEntriesOptions, c as AssetClassificationFailureReason, cn as UploadPresetPage, ct as HashListIdOptions, d as AssetContentOptions, dn as VerifyWebhookSignatureOptions, dt as ImageTransformOptions, en as UpdateHashListOptions, et as EventFacts, f as AssetContentRemovalReason, fn as ViewerClaims, ft as Lens, g as AssetModerationStatus, gn as AssetBatchOperation, gt as ListAssetTimelineOptions, h as AssetModerationDecision, hn as WebhookPayloadInput, ht as ListAssetChildrenOptions, i as AssetAvailability, in as UpgradePolicyOptions, it as FolderPage, j as CdnAssetReference, jt as PolicyPage, k as CalmLensServerClientOptions, kn as CursorPage, kt as Policy, l as AssetClassificationStatus, ln as UploadPresetSubmitAssetOptions, lt as HashListPage, m as AssetModeration, mn as WebhookHeadersInput, mt as LensPage, n as AppInfo, nn as UpdatePolicyOptions, nt as EventsPage, o as AssetChildrenPage, on as UploadPresetDefinition, ot as HashListEntryIdOptions, p as AssetContentStatus, pn as WaitForAssetDecisionOptions, pt as LensIdOptions, q as EnsureLensOptions, qn as AssetRenderedKind, qt as SignedAssetUrl, r as Asset, rn as UpdateProjectSettingsOptions, rt as FolderIdOptions, s as AssetClassification, sn as UploadPresetIdOptions, st as HashListEntryPage, t as AddHashListEntryOptions, tn as UpdateLensOptions, tt as EventType, u as AssetContent, un as UploadedAsset, ut as IdempotencyOptions, v as AssetSearchResponse, vn as AssetTimelineSegment, vt as ListEventsOptions, w as AssetVisibility, wn as DetectedPerson, wt as ListUploadPresetsOptions, x as AssetType, xn as AgeRange, xt as ListHashListsOptions, y as AssetSearchResult, yn as MetadataFieldsResource, yt as ListFoldersOptions, z as CreateFolderOptions, zn as AssetSearchMatchField, zt as ResetPolicyOptions } from "./CalmLensTypes-CCsoVr39.js";
3
- import { a as getAssetInfo, i as CDN_RESOURCES, n as SDK_VERSION, r as DEFAULT_CDN_BASE_URL, t as ModerationContextItem } from "./index-Dk3I5YXf.js";
4
- import { A as CalmLensRateLimitError, C as CalmLensErrorKind, D as CalmLensNotFoundError, E as CalmLensInvalidResponseError, F as SdkErrorCode, I as ApiErrorCode, M as CalmLensTimeoutError, N as CalmLensUnprocessableEntityError, O as CalmLensPayloadTooLargeError, P as CalmLensWebhookVerificationError, S as CalmLensErrorDetails, T as CalmLensInvalidArgumentError, _ as CalmLensConfigurationError, a as AUTO_PAGING_TO_ARRAY_MAX, b as CalmLensError, c as CalmLensLastResponse, d as ListPromise, f as CALMLENS_ERROR_CODES, g as CalmLensCancelledError, h as CalmLensBadRequestError, i as ServedAssetInfo, j as CalmLensServerError, k as CalmLensPermissionDeniedError, l as CalmLensResponse, m as CalmLensAuthenticationError, o as AutoPaging, p as CalmLensApiError, r as CdnResponse, s as AutoPagingToArrayOptions, t as ReceivedWebhookEventPayload, u as ListPage, v as CalmLensConflictError, w as CalmLensErrorOptions, x as CalmLensErrorCode, y as CalmLensConnectionError } from "./WebhookPayload-_fvY2eu8.js";
2
+ import { $ as EventFactValues, $n as ProcessingOptions, $t as UpdateFolderOptions, A as CdnAssetLocation, An as LensType, At as PolicyIdOptions, B as CreateHashListOptions, Bn as AssetSearchQuery, Bt as RetrieveAssetByExternalIdOptions, C as AssetUploadStatus, Cn as DetectedFace, Ct as ListPoliciesOptions, D as BatchAssetsResponse, Dn as ProcessingFeatureStage, Dt as MultipartUploadOptions, E as BatchAssetsOptions, En as ProcessingFeatureResults, Et as MoveFolderOptions, F as CdnTransform, Fn as EventResourceKind, Ft as RemoveAssetContentOptions, G as DeleteAssetOptions, Gn as AssetPreview, Gt as SignAssetUrlOptions, H as CreateMultipartUploadPartOptions, Hn as AssetInfo, Ht as RetryAssetOptions, I as ClassifyTextOptions, In as EventSeverity, It as RequestAssetReviewOptions, J as EnsureLensesOptions, Jn as AssetSafetyHold, Jt as SignedUploadToken, K as DeleteMetadataFieldOptions, Kn as AssetRendered, Kt as SignUploadTokenOptions, L as ClientRequestDefaults, Lt as RequestAttempt, M as CdnAssetUrlOptions, Mn as EventResource, Mt as PolicySettings, N as CdnResource, Nt as ProjectSettingsResource, O as CalmLensAppClientOptions, On as ProcessingFeatures, Ot as MultipartUploadPartOptions, P as CdnServeOptions, Pn as EventCategory, Pt as PublicProjectSettings, Q as EventFact, Qn as MetadataItem, Qt as UpdateAssetOptions, R as ConnectionOptions, Rn as Folder, Rt as RequestOptions, S as AssetUpload, Sn as BoundingBox, St as ListLensesOptions, T as AssignPolicyOptions, Tn as ProcessingFeatureId, Tt as MoveAssetOptions, U as CreatePolicyOptions, Un as AssetHls, Ut as SearchAssetsOptions, V as CreateLensOptions, Vt as RetrieveAssetOptions, W as DecideAssetOptions, Wn as AssetHlsRendition, Wt as SetPolicyAutomaticUpdatesOptions, X as EnsureUploadPresetsOptions, Xn as ExtractedText, Xt as SubmitAssetOptions, Y as EnsureMetadataFieldsOptions, Yn as AssetSafetyHoldReason, Yt as StreamingFeatureOptions, Z as EnsureUploadPresetsResponse, Zn as FileMetadata, Zt as TypedEvent, _ as AssetPage, _n as AssetReviewRequest, _t as ListAssetsOptions, a as AssetChecksums, an as UploadAssetPartOptions, at as GetAssetInfoOptions, b as AssetTimelinePage, bn as UploadPreset, bt as ListHashListEntriesOptions, c as AssetClassificationFailureReason, cn as UploadPresetPage, ct as HashListIdOptions, d as AssetContentOptions, dn as VerifyWebhookSignatureOptions, dt as ImageTransformOptions, en as UpdateHashListOptions, et as EventFacts, f as AssetContentRemovalReason, fn as ViewerClaims, ft as Lens, g as AssetModerationStatus, gn as AssetBatchOperation, gt as ListAssetTimelineOptions, h as AssetModerationDecision, hn as WebhookPayloadInput, ht as ListAssetChildrenOptions, i as AssetAvailability, in as UpgradePolicyOptions, it as FolderPage, j as CdnAssetReference, jt as PolicyPage, k as CalmLensServerClientOptions, kn as CursorPage, kt as Policy, l as AssetClassificationStatus, ln as UploadPresetSubmitAssetOptions, lt as HashListPage, m as AssetModeration, mn as WebhookHeadersInput, mt as LensPage, n as AppInfo, nn as UpdatePolicyOptions, nt as EventsPage, o as AssetChildrenPage, on as UploadPresetDefinition, ot as HashListEntryIdOptions, p as AssetContentStatus, pn as WaitForAssetDecisionOptions, pt as LensIdOptions, q as EnsureLensOptions, qn as AssetRenderedKind, qt as SignedAssetUrl, r as Asset, rn as UpdateProjectSettingsOptions, rt as FolderIdOptions, s as AssetClassification, sn as UploadPresetIdOptions, st as HashListEntryPage, t as AddHashListEntryOptions, tn as UpdateLensOptions, tt as EventType, u as AssetContent, un as UploadedAsset, ut as IdempotencyOptions, v as AssetSearchResponse, vn as AssetTimelineSegment, vt as ListEventsOptions, w as AssetVisibility, wn as DetectedPerson, wt as ListUploadPresetsOptions, x as AssetType, xn as AgeRange, xt as ListHashListsOptions, y as AssetSearchResult, yn as MetadataFieldsResource, yt as ListFoldersOptions, z as CreateFolderOptions, zn as AssetSearchMatchField, zt as ResetPolicyOptions } from "./CalmLensTypes-jond9q6a.js";
3
+ import { a as getAssetInfo, i as CDN_RESOURCES, n as SDK_VERSION, r as DEFAULT_CDN_BASE_URL, t as ModerationContextItem } from "./index-CgAztQdX.js";
4
+ import { A as CalmLensRateLimitError, C as CalmLensErrorKind, D as CalmLensNotFoundError, E as CalmLensInvalidResponseError, F as SdkErrorCode, I as ApiErrorCode, M as CalmLensTimeoutError, N as CalmLensUnprocessableEntityError, O as CalmLensPayloadTooLargeError, P as CalmLensWebhookVerificationError, S as CalmLensErrorDetails, T as CalmLensInvalidArgumentError, _ as CalmLensConfigurationError, a as AUTO_PAGING_TO_ARRAY_MAX, b as CalmLensError, c as CalmLensLastResponse, d as ListPromise, f as CALMLENS_ERROR_CODES, g as CalmLensCancelledError, h as CalmLensBadRequestError, i as ServedAssetInfo, j as CalmLensServerError, k as CalmLensPermissionDeniedError, l as CalmLensResponse, m as CalmLensAuthenticationError, o as AutoPaging, p as CalmLensApiError, r as CdnResponse, s as AutoPagingToArrayOptions, t as ReceivedWebhookEventPayload, u as ListPage, v as CalmLensConflictError, w as CalmLensErrorOptions, x as CalmLensErrorCode, y as CalmLensConnectionError } from "./WebhookPayload-DdpKjQGw.js";
5
5
  export { AUTO_PAGING_TO_ARRAY_MAX, type AddHashListEntryOptions, type AgeRange, type ApiErrorCode, type AppInfo, type Asset, type AssetAvailability, type AssetBatchOperation, type AssetChecksums, type AssetChildrenPage, type AssetClassification, type AssetClassificationFailureReason, type AssetClassificationStatus, type AssetContent, type AssetContentOptions, type AssetContentRemovalReason, type AssetContentStatus, type AssetHls, type AssetHlsRendition, type AssetInfo, type AssetModeration, type AssetModerationDecision, type AssetModerationStatus, type AssetPage, type AssetPreview, type AssetRendered, type AssetRenderedKind, type AssetReviewRequest, type AssetSafetyHold, type AssetSafetyHoldReason, type AssetSearchMatchField, type AssetSearchQuery, type AssetSearchResponse, type AssetSearchResult, type AssetTimelinePage, type AssetTimelineSegment, type AssetType, type AssetUpload, type AssetUploadStatus, type AssetVisibility, type AssignPolicyOptions, type AutoPaging, type AutoPagingToArrayOptions, type BatchAssetsOptions, type BatchAssetsResponse, type BoundingBox, CALMLENS_ERROR_CODES, CDN_RESOURCES, CalmLensApiError, type CalmLensAppClientOptions, CalmLensAuthenticationError, CalmLensBadRequestError, CalmLensCancelledError, CalmLensConfigurationError, CalmLensConflictError, CalmLensConnectionError, CalmLensError, type CalmLensErrorCode, type CalmLensErrorDetails, type CalmLensErrorKind, type CalmLensErrorOptions, CalmLensInvalidArgumentError, CalmLensInvalidResponseError, type CalmLensLastResponse, CalmLensNotFoundError, CalmLensPayloadTooLargeError, CalmLensPermissionDeniedError, CalmLensRateLimitError, type CalmLensResponse, type CalmLensServerClientOptions, CalmLensServerError, CalmLensTimeoutError, CalmLensUnprocessableEntityError, CalmLensWebhookVerificationError, type CdnAssetLocation, type CdnAssetReference, type CdnAssetUrlOptions, type CdnResource, type CdnResponse, type CdnServeOptions, type CdnTransform, type ClassificationCategories, type ClassificationCategory, type ClassificationCategoryReport, type ClassificationNotEvaluatedReason, type ClassificationQualifierResults, type ClassifyTextOptions, type ClientRequestDefaults, type ConnectionOptions, type CreateFolderOptions, type CreateHashListOptions, type CreateLensOptions, type CreateMultipartUploadPartOptions, type CreatePolicyOptions, type CursorPage, DEFAULT_CDN_BASE_URL, type DecideAssetOptions, type DeleteAssetOptions, type DeleteMetadataFieldOptions, type DetectedFace, type DetectedPerson, type EnsureLensOptions, type EnsureLensesOptions, type EnsureMetadataFieldsOptions, type EnsureUploadPresetsOptions, type EnsureUploadPresetsResponse, type EventCategory, type EventFact, type EventFactValues, type EventFacts, type EventResource, type EventResourceKind, type EventSeverity, type EventType, type EventsPage, type ExtractedText, type FileMetadata, type Folder, type FolderIdOptions, type FolderPage, type GetAssetInfoOptions, type HashList, type HashListEntry, type HashListEntryIdOptions, type HashListEntryPage, type HashListIdOptions, type HashListPage, type IdempotencyOptions, type ImageTransformOptions, type Lens, type LensIdOptions, type LensPage, type LensType, type Likelihood, type ListAssetChildrenOptions, type ListAssetTimelineOptions, type ListAssetsOptions, type ListEventsOptions, type ListFoldersOptions, type ListHashListEntriesOptions, type ListHashListsOptions, type ListLensesOptions, type ListPage, type ListPoliciesOptions, type ListPromise, type ListUploadPresetsOptions, type MetadataFieldsResource, type MetadataItem, type ModerationContext, type ModerationContextItem, type ModerationQualifier, type MoveAssetOptions, type MoveFolderOptions, type MultipartUploadOptions, type MultipartUploadPartOptions, type Policy, type PolicyAction, type PolicyIdOptions, type PolicyPage, type PolicySettings, type ProcessingFeatureId, type ProcessingFeatureResults, type ProcessingFeatureStage, type ProcessingFeatures, type ProcessingOptions, type ProjectSettingsResource, type PublicProjectSettings, type RemoveAssetContentOptions, type RequestAssetReviewOptions, type RequestAttempt, type RequestOptions, type ResetPolicyOptions, type RetrieveAssetByExternalIdOptions, type RetrieveAssetOptions, type RetryAssetOptions, SDK_VERSION, type SdkErrorCode, type SearchAssetsOptions, type ServedAssetInfo, type SetPolicyAutomaticUpdatesOptions, type SignAssetUrlOptions, type SignUploadTokenOptions, type SignedAssetUrl, type SignedUploadToken, type StreamingFeatureOptions, type SubmitAssetOptions, type TypedEvent, type UpdateAssetOptions, type UpdateFolderOptions, type UpdateHashListOptions, type UpdateLensOptions, type UpdatePolicyOptions, type UpdateProjectSettingsOptions, type UpgradePolicyOptions, type UploadAssetPartOptions, type UploadPreset, type UploadPresetDefinition, type UploadPresetIdOptions, type UploadPresetPage, type UploadPresetSubmitAssetOptions, type UploadedAsset, type VerifyWebhookSignatureOptions, type ViewerClaims, type WaitForAssetDecisionOptions, type ReceivedWebhookEventPayload as WebhookEventPayload, type WebhookHeadersInput, type WebhookPayloadInput, getAssetInfo };
package/cjs/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_CalmLensError = require("./CalmLensError-C9g7GXfU.js");
3
- const require_CalmLensCdn = require("./CalmLensCdn-B_Tbwq10.js");
3
+ const require_CalmLensCdn = require("./CalmLensCdn-DCj0AfoS.js");
4
4
  exports.AUTO_PAGING_TO_ARRAY_MAX = require_CalmLensCdn.AUTO_PAGING_TO_ARRAY_MAX;
5
5
  exports.CALMLENS_ERROR_CODES = require_CalmLensError.CALMLENS_ERROR_CODES;
6
6
  exports.CDN_RESOURCES = require_CalmLensCdn.CDN_RESOURCES;
@@ -1,5 +1,5 @@
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, a as ProgressFetchOptions, at as isImageReady, b as describeUploadItem, c as ICON_ATTRIBUTES, d as AssetDisplayOptions, et as getAssetAspectRatio, f as AssetEventHandlers, g as CalmLensMessages, h as UploaderProps, i as CALMLENS_STYLES, it as getPlayedPercent, j as CustomUploadResult, k as CalmLensUpload, l as IconName, m as UploaderDisplayOptions, n as CalmLensTheme, nt as getAssetViewKey, o as createProgressFetch, ot as pickAssetSource, p as AssetProps, q as AssetSession, r as resolveTheme, rt as getPeakHeights, s as ICONS, t as CALMLENS_THEME, tt as getAssetView, u as ASSET_FILE_ICON_SIZE, v as UploadItemView, w as getDropzoneHint, x as describeUploader, y as UploaderView, z as createUploadController } from "./Core-B110Ug8_.js";
2
- import { i as useCalmLensUpload, n as CalmLensProviderProps, r as UseCalmLensUploadResult, t as CalmLensProvider } from "./ReactUpload-CbtQtN6v.js";
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, a as ProgressFetchOptions, at as isImageReady, b as describeUploadItem, c as ICON_ATTRIBUTES, d as AssetDisplayOptions, et as getAssetAspectRatio, f as AssetEventHandlers, g as CalmLensMessages, h as UploaderProps, i as CALMLENS_STYLES, it as getPlayedPercent, j as CustomUploadResult, k as CalmLensUpload, l as IconName, m as UploaderDisplayOptions, n as CalmLensTheme, nt as getAssetViewKey, o as createProgressFetch, ot as pickAssetSource, p as AssetProps, q as AssetSession, r as resolveTheme, rt as getPeakHeights, s as ICONS, t as CALMLENS_THEME, tt as getAssetView, u as ASSET_FILE_ICON_SIZE, v as UploadItemView, w as getDropzoneHint, x as describeUploader, y as UploaderView, z as createUploadController } from "./Core-C6_Q5ZME.js";
2
+ import { i as useCalmLensUpload, n as CalmLensProviderProps, r as UseCalmLensUploadResult, t as CalmLensProvider } from "./ReactUpload-fy6zhY8M.js";
3
3
  import { ReactNode } from "react";
4
4
  import { StyleProp, ViewStyle } from "react-native";
5
5
  /** What the uploader asks your picker for. */
@@ -1,9 +1,9 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_CalmLensCdn = require("./CalmLensCdn-B_Tbwq10.js");
3
- const require_Core = require("./Core-iNgZ8Cij.js");
4
- const require_UploadController = require("./UploadController-CVKtUCK0.js");
2
+ const require_CalmLensCdn = require("./CalmLensCdn-DCj0AfoS.js");
3
+ const require_Core = require("./Core-BHQSo7rY.js");
4
+ const require_UploadController = require("./UploadController-C1tiTTRR.js");
5
5
  const require_FileIcons = require("./FileIcons-Ob003MdS.js");
6
- const require_ReactUpload = require("./ReactUpload-BS8bYIhv.js");
6
+ const require_ReactUpload = require("./ReactUpload-bbHMmEUQ.js");
7
7
  let react = require("react");
8
8
  let react_jsx_runtime = require("react/jsx-runtime");
9
9
  let react_native = require("react-native");
package/cjs/react.d.ts CHANGED
@@ -1,7 +1,7 @@
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, 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";
2
- import { n as CalmLensProviderProps, t as CalmLensProvider } from "./ReactUpload-CbtQtN6v.js";
3
- import { a as UploaderProps, i as UploadSnapshot, n as UploadControllerOptions, o as UseCalmLensUploadResult, r as UploadItem, s as createUploadController, t as CalmLensUpload } from "./BrowserUpload-BuTS7yTy.js";
4
- 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";
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, 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-C6_Q5ZME.js";
2
+ import { n as CalmLensProviderProps, t as CalmLensProvider } from "./ReactUpload-fy6zhY8M.js";
3
+ import { a as UploaderProps, i as UploadSnapshot, n as UploadControllerOptions, o as UseCalmLensUploadResult, r as UploadItem, s as createUploadController, t as CalmLensUpload } from "./BrowserUpload-_iMX_nq0.js";
4
+ 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-Cp18fGXG.js";
5
5
  import { CSSProperties, HTMLAttributes, ReactNode } from "react";
6
6
  type ElementProps = Omit<HTMLAttributes<HTMLDivElement>, "children"> & {
7
7
  /** Leaves out the stylesheet the viewers render, so you can style the `calmlens-*` classes. */