@calmlens/sdk 0.9.1 → 0.10.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.
@@ -1,492 +0,0 @@
1
- import { ErrorCode } from "sendable-error";
2
- //#region \0@oxc-project+runtime@0.153.0/helpers/esm/typeof.js
3
- function _typeof(o) {
4
- "@babel/helpers - typeof";
5
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
6
- return typeof o;
7
- } : function(o) {
8
- return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
9
- }, _typeof(o);
10
- }
11
- //#endregion
12
- //#region \0@oxc-project+runtime@0.153.0/helpers/esm/toPrimitive.js
13
- function toPrimitive(t, r) {
14
- if ("object" != _typeof(t) || !t) return t;
15
- var e = t[Symbol.toPrimitive];
16
- if (void 0 !== e) {
17
- var i = e.call(t, r || "default");
18
- if ("object" != _typeof(i)) return i;
19
- throw new TypeError("@@toPrimitive must return a primitive value.");
20
- }
21
- return ("string" === r ? String : Number)(t);
22
- }
23
- //#endregion
24
- //#region \0@oxc-project+runtime@0.153.0/helpers/esm/toPropertyKey.js
25
- function toPropertyKey(t) {
26
- var i = toPrimitive(t, "string");
27
- return "symbol" == _typeof(i) ? i : i + "";
28
- }
29
- //#endregion
30
- //#region \0@oxc-project+runtime@0.153.0/helpers/esm/defineProperty.js
31
- function _defineProperty(e, r, t) {
32
- return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
33
- value: t,
34
- enumerable: !0,
35
- configurable: !0,
36
- writable: !0
37
- }) : e[r] = t, e;
38
- }
39
- //#endregion
40
- //#region \0@oxc-project+runtime@0.153.0/helpers/esm/objectSpread2.js
41
- function ownKeys(e, r) {
42
- var t = Object.keys(e);
43
- if (Object.getOwnPropertySymbols) {
44
- var o = Object.getOwnPropertySymbols(e);
45
- r && (o = o.filter(function(r) {
46
- return Object.getOwnPropertyDescriptor(e, r).enumerable;
47
- })), t.push.apply(t, o);
48
- }
49
- return t;
50
- }
51
- function _objectSpread2(e) {
52
- for (var r = 1; r < arguments.length; r++) {
53
- var t = null != arguments[r] ? arguments[r] : {};
54
- r % 2 ? ownKeys(Object(t), !0).forEach(function(r) {
55
- _defineProperty(e, r, t[r]);
56
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r) {
57
- Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
58
- });
59
- }
60
- return e;
61
- }
62
- //#endregion
63
- //#region \0@oxc-project+runtime@0.153.0/helpers/esm/asyncToGenerator.js
64
- function asyncGeneratorStep(n, t, e, r, o, a, c) {
65
- try {
66
- var i = n[a](c), u = i.value;
67
- } catch (n) {
68
- e(n);
69
- return;
70
- }
71
- i.done ? t(u) : Promise.resolve(u).then(r, o);
72
- }
73
- function _asyncToGenerator(n) {
74
- return function() {
75
- var t = this, e = arguments;
76
- return new Promise(function(r, o) {
77
- var a = n.apply(t, e);
78
- function _next(n) {
79
- asyncGeneratorStep(a, r, o, _next, _throw, "next", n);
80
- }
81
- function _throw(n) {
82
- asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);
83
- }
84
- _next(void 0);
85
- });
86
- };
87
- }
88
- //#endregion
89
- //#region ../shared/src/AssetPayload.ts
90
- const uint8ArrayInputToNumbers = (value) => {
91
- if (Array.isArray(value)) return value;
92
- return Array.from(value);
93
- };
94
- const bufferInputToBytes = (value) => {
95
- if (value instanceof ArrayBuffer) return new Uint8Array(value);
96
- return Uint8Array.from(value);
97
- };
98
- const BASE64_PART_BOUNDARY_ERROR = "Invalid base64 part. For multipart uploads, split the original bytes first, then base64-encode each part. Do not split one full base64 string into substrings.";
99
- const MULTIPART_PART_TOO_SMALL_ERROR = `Multipart upload parts must be at least 5MiB except the final part.`;
100
- const getRawBase64 = (value) => {
101
- const markerIndex = value.indexOf(";base64,");
102
- if (markerIndex === -1) return value;
103
- return value.slice(markerIndex + 8);
104
- };
105
- const validateBase64PayloadString = (payload, options) => {
106
- const raw = getRawBase64(payload.base64).replace(/\s/g, "");
107
- if ((options === null || options === void 0 ? void 0 : options.multipart) && raw.length % 4 !== 0) return {
108
- ok: false,
109
- error: BASE64_PART_BOUNDARY_ERROR
110
- };
111
- return { ok: true };
112
- };
113
- const isReadableStream = (value) => typeof value === "object" && value !== null && "getReader" in value && typeof value.getReader === "function";
114
- const assetToData = (payload) => {
115
- if ("plainText" in payload && payload.plainText !== void 0) return new TextEncoder().encode(payload.plainText);
116
- if ("data" in payload && payload.data) return payload.data;
117
- if ("buffer" in payload) {
118
- if (payload.buffer instanceof ArrayBuffer) return payload.buffer;
119
- return bufferInputToBytes(payload.buffer);
120
- }
121
- if (payload.uint8Array !== void 0) return Uint8Array.from(uint8ArrayInputToNumbers(payload.uint8Array));
122
- if (payload.base64 === void 0) throw new Error("Invalid asset payload");
123
- const raw = getRawBase64(payload.base64);
124
- if (typeof Buffer !== "undefined") return Uint8Array.from(Buffer.from(raw, "base64"));
125
- const binary = atob(raw);
126
- return Uint8Array.from(binary, (char) => char.charCodeAt(0));
127
- };
128
- const assetDataToUint8Array = function() {
129
- var _ref = _asyncToGenerator(function* (data) {
130
- if (data instanceof Response) return new Uint8Array(yield data.arrayBuffer());
131
- if (isReadableStream(data)) return new Uint8Array(yield new Response(data).arrayBuffer());
132
- if (data instanceof Blob) return new Uint8Array(yield data.arrayBuffer());
133
- if (data instanceof ArrayBuffer) return new Uint8Array(data);
134
- return data;
135
- });
136
- return function assetDataToUint8Array(_x) {
137
- return _ref.apply(this, arguments);
138
- };
139
- }();
140
- const getAssetPayloadByteLength = (payload) => {
141
- if ("plainText" in payload && payload.plainText !== void 0) return new TextEncoder().encode(payload.plainText).byteLength;
142
- if ("data" in payload && payload.data) {
143
- if (payload.data instanceof Blob) return payload.data.size;
144
- if (payload.data instanceof Response) {
145
- const contentLength = payload.data.headers.get("content-length");
146
- return contentLength ? Number(contentLength) : void 0;
147
- }
148
- return;
149
- }
150
- if ("buffer" in payload && payload.buffer) return payload.buffer.byteLength;
151
- if (payload.uint8Array !== void 0) {
152
- if (Array.isArray(payload.uint8Array)) return payload.uint8Array.length;
153
- return payload.uint8Array.byteLength;
154
- }
155
- if (payload.base64 === void 0) return;
156
- const raw = getRawBase64(payload.base64).replace(/\s/g, "");
157
- const padding = raw.endsWith("==") ? 2 : raw.endsWith("=") ? 1 : 0;
158
- return Math.max(0, Math.floor(raw.length * 3 / 4) - padding);
159
- };
160
- const validateAssetPayload = (payload, options) => {
161
- if ("base64" in payload && payload.base64 !== void 0) {
162
- const validation = validateBase64PayloadString(payload, options);
163
- if (!validation.ok) return {
164
- ok: false,
165
- error: validation.error
166
- };
167
- }
168
- const byteLength = getAssetPayloadByteLength(payload);
169
- if ((options === null || options === void 0 ? void 0 : options.multipart) && !options.isFinal && byteLength !== void 0 && byteLength < 5242880) return {
170
- ok: false,
171
- error: MULTIPART_PART_TOO_SMALL_ERROR
172
- };
173
- return { ok: true };
174
- };
175
- //#endregion
176
- //#region ../shared/src/JsonUtils.ts
177
- const stringifyJsonCanonical = (value) => JSON.stringify(value, (_key, nestedValue) => {
178
- if (!nestedValue || typeof nestedValue !== "object" || Array.isArray(nestedValue)) return nestedValue;
179
- return Object.fromEntries(Object.keys(nestedValue).sort().map((key) => [key, nestedValue[key]]));
180
- });
181
- //#endregion
182
- //#region ../shared/src/PublicErrorCodes.ts
183
- const PUBLIC_ERROR_CODES = {
184
- MISSING_TOKEN: new ErrorCode({
185
- id: "auth/missing-token",
186
- defaultMessage: "Authentication required. Send your project API key in the X-Api-Key header.",
187
- status: 401
188
- }),
189
- INVALID_API_KEY: new ErrorCode({
190
- id: "auth/invalid-api-key",
191
- defaultMessage: "The API key is invalid, revoked or expired. Create a key under Developer → API Keys.",
192
- status: 401
193
- }),
194
- API_KEY_PROJECT_MISMATCH: new ErrorCode({
195
- id: "auth/project-mismatch",
196
- defaultMessage: "This API key belongs to a different project. Use a key created for the project that owns this resource.",
197
- status: 403
198
- }),
199
- API_KEY_NOT_ACCEPTED: new ErrorCode({
200
- id: "auth/api-key-not-accepted",
201
- defaultMessage: "API keys are only accepted by the public API at /v1.",
202
- status: 403
203
- }),
204
- FILE_TOO_LARGE: new ErrorCode({
205
- id: "upload/file-too-large",
206
- defaultMessage: "File size exceeds limit. Maximum direct image size is 10MB, audio/video size is 50MiB, and other files is 5GB.",
207
- status: 400
208
- }),
209
- IMAGE_REQUIRES_MULTIPART_UPLOAD: new ErrorCode({
210
- id: "upload/image-requires-multipart-upload",
211
- defaultMessage: "Images of 10MB or more must use a multipart upload.",
212
- status: 400
213
- }),
214
- MULTIPART_IMAGE_TOO_SMALL: new ErrorCode({
215
- id: "upload/multipart-image-too-small",
216
- defaultMessage: "Multipart image uploads must total at least 10MB.",
217
- status: 400
218
- }),
219
- MULTIPART_IMAGE_TOO_LARGE: new ErrorCode({
220
- id: "upload/multipart-image-too-large",
221
- defaultMessage: "Multipart image uploads cannot exceed 20MB.",
222
- status: 400
223
- }),
224
- IMAGE_EXCEEDED_MAX_DIMENSIONS: new ErrorCode({
225
- id: "upload/image-exceeded-max-dimensions",
226
- defaultMessage: "Image exceeds maximum dimensions. Maximum dimensions are 12,000px.",
227
- status: 400
228
- }),
229
- UPLOAD_LIMIT_EXCEEDED: new ErrorCode({
230
- id: "upload/limit-exceeded",
231
- defaultMessage: "Upload limit exceeded. You have used all your free uploads. Please upgrade to Plus or Pro for unlimited uploads.",
232
- status: 403
233
- }),
234
- INVALID_UPLOAD_MIME_TYPE: new ErrorCode({
235
- id: "upload/invalid-mime-type",
236
- defaultMessage: "Upload file type is not supported. 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.",
237
- status: 400
238
- }),
239
- INVALID_EVENT_CURSOR: new ErrorCode({
240
- id: "events/invalid-cursor",
241
- defaultMessage: "The events cursor is invalid. Use the cursor from a previous response, or omit it to start from now.",
242
- status: 400
243
- }),
244
- INVALID_UPLOAD_PAYLOAD: new ErrorCode({
245
- id: "upload/invalid-payload",
246
- defaultMessage: "Upload payload is invalid.",
247
- status: 400
248
- }),
249
- USE_UPLOAD_PART: new ErrorCode({
250
- id: "upload/use-upload-part",
251
- defaultMessage: "Use uploadPart for multipart upload parts after the first part",
252
- status: 409
253
- }),
254
- UPLOAD_NOT_OPEN: new ErrorCode({
255
- id: "upload/not-open",
256
- defaultMessage: "Asset is not accepting additional parts",
257
- status: 409
258
- }),
259
- INVALID_UPLOAD_PART_NUMBER: new ErrorCode({
260
- id: "upload/invalid-part-number",
261
- defaultMessage: "Multipart upload part number is invalid.",
262
- status: 409
263
- }),
264
- UPLOAD_MISSING: new ErrorCode({
265
- id: "upload/missing",
266
- defaultMessage: "Multipart upload state is missing",
267
- status: 409
268
- }),
269
- UPLOAD_SIZE_MISMATCH: new ErrorCode({
270
- id: "upload/size-mismatch",
271
- defaultMessage: "The uploaded parts do not add up to the totalSizeInBytes declared when the multipart upload started.",
272
- status: 400
273
- }),
274
- INVALID_IDEMPOTENCY_KEY: new ErrorCode({
275
- id: "idempotency/invalid-key",
276
- defaultMessage: "The Idempotency-Key header must be 1 to 255 printable ASCII characters, such as a UUID.",
277
- status: 400
278
- }),
279
- IDEMPOTENCY_KEY_REUSED: new ErrorCode({
280
- id: "idempotency/key-reused",
281
- defaultMessage: "This Idempotency-Key was already used for a different request. Use a new key for each distinct request.",
282
- status: 409
283
- }),
284
- IDEMPOTENT_REQUEST_IN_PROGRESS: new ErrorCode({
285
- id: "idempotency/request-in-progress",
286
- defaultMessage: "A request with this Idempotency-Key is still being processed. Retry after the Retry-After delay to receive its result.",
287
- status: 409
288
- }),
289
- ASSET_NOT_FOUND: new ErrorCode({
290
- id: "asset/not-found",
291
- defaultMessage: "Asset not found",
292
- status: 404
293
- }),
294
- PROJECT_NOT_FOUND: new ErrorCode({
295
- id: "project/not-found",
296
- defaultMessage: "Project not found",
297
- status: 404
298
- }),
299
- ASSET_UPDATE_FAILED: new ErrorCode({
300
- id: "asset/update-failed",
301
- defaultMessage: "Failed to update asset",
302
- status: 500
303
- }),
304
- ASSET_SAFETY_HELD: new ErrorCode({
305
- id: "asset/safety-held",
306
- defaultMessage: "Asset access is restricted by a safety hold.",
307
- status: 423
308
- }),
309
- ASSET_NOT_RETRYABLE: new ErrorCode({
310
- id: "asset/not-retryable",
311
- defaultMessage: "Only assets that failed to process (status error) can be retried.",
312
- status: 409
313
- }),
314
- ASSET_CONTENT_UNAVAILABLE: new ErrorCode({
315
- id: "asset/content-unavailable",
316
- defaultMessage: "This asset's content is no longer stored, so it can't be processed again. Upload it again instead.",
317
- status: 409
318
- }),
319
- SUPPORT_TICKET_NOT_FOUND: new ErrorCode({
320
- id: "support/ticket-not-found",
321
- defaultMessage: "Support ticket not found.",
322
- status: 404
323
- }),
324
- DUPLICATE_EXTERNAL_ID: new ErrorCode({
325
- id: "asset/duplicate-external-id",
326
- defaultMessage: "An asset with this externalId already exists in the project.",
327
- status: 409
328
- }),
329
- FOLDER_NOT_FOUND: new ErrorCode({
330
- id: "folder/not-found",
331
- defaultMessage: "Folder not found",
332
- status: 404
333
- }),
334
- DUPLICATE_FOLDER_NAME: new ErrorCode({
335
- id: "folder/duplicate-name",
336
- defaultMessage: "A folder with this name already exists in this location.",
337
- status: 409
338
- }),
339
- FOLDER_NOT_EMPTY: new ErrorCode({
340
- id: "folder/not-empty",
341
- defaultMessage: "Folder must be empty before it can be deleted.",
342
- status: 409
343
- }),
344
- FOLDER_PARENT_CYCLE: new ErrorCode({
345
- id: "folder/parent-cycle",
346
- defaultMessage: "A folder cannot be moved inside itself or one of its descendants.",
347
- status: 409
348
- }),
349
- LENS_VERSION_CONFLICT: new ErrorCode({
350
- id: "lens/version-conflict",
351
- defaultMessage: "Lens updates require a version greater than the current version.",
352
- status: 409
353
- })
354
- };
355
- PUBLIC_ERROR_CODES.MISSING_TOKEN, PUBLIC_ERROR_CODES.INVALID_API_KEY, PUBLIC_ERROR_CODES.API_KEY_PROJECT_MISMATCH;
356
- const MAX_IMAGE_UPLOAD_BYTES = /* @__PURE__ */ (() => 20971520)();
357
- const MIN_MULTIPART_IMAGE_UPLOAD_BYTES = /* @__PURE__ */ (() => 10485760)();
358
- const REJECTED_UPLOAD_MIME_TYPE_SET = /* @__PURE__ */ new Set([
359
- "application/octet-stream",
360
- "multipart/form-data",
361
- "multipart/mixed",
362
- "multipart/alternative",
363
- "multipart/related",
364
- "multipart/signed",
365
- "multipart/encrypted"
366
- ]);
367
- const normalizeUploadMimeType = (mimeType) => {
368
- var _mimeType$toLowerCase;
369
- return ((_mimeType$toLowerCase = mimeType.toLowerCase().split(";")[0]) === null || _mimeType$toLowerCase === void 0 ? void 0 : _mimeType$toLowerCase.trim()) || mimeType.toLowerCase().trim();
370
- };
371
- const isRejectedUploadMimeType = (mimeType) => REJECTED_UPLOAD_MIME_TYPE_SET.has(normalizeUploadMimeType(mimeType));
372
- 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.`;
373
- const DOMAIN = "calmlens.com";
374
- //#endregion
375
- //#region src/client/CalmLensError.ts
376
- const SDK_ERRORS = { NO_CDN_FETCH: {
377
- id: "sdk/no-cdn-fetch",
378
- defaultMessage: "No fetch implementation is available for CDN requests"
379
- } };
380
- var CalmLensError = class extends Error {
381
- constructor(errorCode, options) {
382
- var _ref, _options$message;
383
- const code = "getId" in errorCode ? errorCode.getId() : errorCode.id;
384
- const defaultMessage = "getDefaultMessage" in errorCode ? errorCode.getDefaultMessage() : errorCode.defaultMessage;
385
- super(`[calmlens] ${(_ref = (_options$message = options === null || options === void 0 ? void 0 : options.message) !== null && _options$message !== void 0 ? _options$message : defaultMessage) !== null && _ref !== void 0 ? _ref : code}`, { cause: options === null || options === void 0 ? void 0 : options.cause });
386
- this.name = "CalmLensError";
387
- this.code = code;
388
- this.details = options === null || options === void 0 ? void 0 : options.details;
389
- this.status = options === null || options === void 0 ? void 0 : options.status;
390
- }
391
- };
392
- const calmLensError = (errorCode, options) => new CalmLensError(errorCode, options);
393
- //#endregion
394
- //#region \0@oxc-project+runtime@0.153.0/helpers/esm/objectWithoutPropertiesLoose.js
395
- function _objectWithoutPropertiesLoose(r, e) {
396
- if (null == r) return {};
397
- var t = {};
398
- for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
399
- if (e.includes(n)) continue;
400
- t[n] = r[n];
401
- }
402
- return t;
403
- }
404
- //#endregion
405
- //#region \0@oxc-project+runtime@0.153.0/helpers/esm/objectWithoutProperties.js
406
- function _objectWithoutProperties(e, t) {
407
- if (null == e) return {};
408
- var o, r, i = _objectWithoutPropertiesLoose(e, t);
409
- if (Object.getOwnPropertySymbols) {
410
- var s = Object.getOwnPropertySymbols(e);
411
- for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
412
- }
413
- return i;
414
- }
415
- //#endregion
416
- //#region src/client/CalmLensUtils.ts
417
- const _excluded = ["text", "name"];
418
- const invalidOptions = (message) => calmLensError({ id: "upload/invalid-payload" }, { message });
419
- const assertHttpUrl = (name, value) => {
420
- if (value === void 0) return;
421
- let url;
422
- try {
423
- url = new URL(value);
424
- } catch (_unused) {}
425
- if (!url || url.protocol !== "https:" && url.protocol !== "http:") throw invalidOptions(`${name} must be an absolute http(s) URL`);
426
- };
427
- /**
428
- * Checks client options before the client sets anything up. `CalmLensClient` and
429
- * `MockCalmLensClient` share it so both reject the same configuration.
430
- */
431
- const validateClientOptions = (options) => {
432
- if (!options || typeof options !== "object") throw invalidOptions("Client options are required");
433
- if (!options.apiKey) throw invalidOptions("API key is required");
434
- if (!options.projectId) throw invalidOptions("Project ID is required");
435
- encodePathSegment(options.projectId, "Project ID");
436
- if (options.timeoutMs !== void 0 && (!Number.isSafeInteger(options.timeoutMs) || options.timeoutMs <= 0)) throw invalidOptions("timeoutMs must be a positive integer");
437
- assertHttpUrl("baseUrl", options.baseUrl);
438
- assertHttpUrl("cdnBaseUrl", options.cdnBaseUrl);
439
- };
440
- const toTextAssetOptions = (_ref) => {
441
- let { text, name } = _ref, options = _objectWithoutProperties(_ref, _excluded);
442
- if (typeof text !== "string" || !text.trim()) throw calmLensError(PUBLIC_ERROR_CODES.INVALID_UPLOAD_PAYLOAD, { message: "Text to moderate must be a non-empty string" });
443
- return _objectSpread2(_objectSpread2({}, options), {}, {
444
- name: name !== null && name !== void 0 ? name : "text",
445
- content: {
446
- plainText: text,
447
- type: "text/plain"
448
- }
449
- });
450
- };
451
- /**
452
- * Encodes an identifier as one URL path segment. `.` and `..` are rejected because URL
453
- * resolution would treat them as relative segments and send the request to another route.
454
- */
455
- const encodePathSegment = (value, name) => {
456
- if (typeof value !== "string" || !value) throw invalidOptions(`${name} is required`);
457
- if (value === "." || value === "..") throw invalidOptions(`${name} cannot be "." or ".."`);
458
- return encodeURIComponent(value);
459
- };
460
- /** Appends a CDN lens (`/@name`) or direct transform selector to an asset URL. */
461
- const appendCdnSelector = (url, options) => {
462
- if (options.lens && options.transform) throw invalidOptions("Specify either a lens or a transform, not both");
463
- if (options.lens) return `${url}/@${encodePathSegment(options.lens, "Lens")}`;
464
- if (!options.transform) return url;
465
- const transform = options.transform.replace(/^\/+/, "");
466
- if (transform.includes("..") || transform.includes("?") || transform.includes("#")) throw invalidOptions("Transform cannot contain \"..\", \"?\" or \"#\"");
467
- return `${url}/${encodeURI(transform)}`;
468
- };
469
- const appendQueryValue = (parts, key, value) => {
470
- if (value === void 0 || value === null) return;
471
- if (Array.isArray(value)) {
472
- for (const [index, item] of value.entries()) appendQueryValue(parts, `${key}[${index}]`, item);
473
- return;
474
- }
475
- if (typeof value === "object") {
476
- for (const [field, item] of Object.entries(value)) appendQueryValue(parts, `${key}[${field}]`, item);
477
- return;
478
- }
479
- parts.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`);
480
- };
481
- /**
482
- * Serialises a query object the way the API parses it (qs bracket notation), for example
483
- * `ordering[0][field]=createdAt&ordering[0][direction]=DESC`. Every key and value is
484
- * percent-encoded and missing values are omitted.
485
- */
486
- const stringifyQuery = (query) => {
487
- const parts = [];
488
- for (const [key, value] of Object.entries(query)) appendQueryValue(parts, key, value);
489
- return parts.join("&");
490
- };
491
- //#endregion
492
- export { _objectSpread2 as C, _asyncToGenerator as S, assetDataToUint8Array as _, validateClientOptions as a, getRawBase64 as b, SDK_ERRORS as c, MAX_IMAGE_UPLOAD_BYTES as d, MIN_MULTIPART_IMAGE_UPLOAD_BYTES as f, stringifyJsonCanonical as g, PUBLIC_ERROR_CODES as h, toTextAssetOptions as i, calmLensError as l, isRejectedUploadMimeType as m, encodePathSegment as n, _objectWithoutProperties as o, getRejectedUploadMimeTypeError as p, stringifyQuery as r, CalmLensError as s, appendCdnSelector as t, DOMAIN as u, assetToData as v, validateAssetPayload as x, getAssetPayloadByteLength as y };