edmaxlabs-core 2.5.1 → 2.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -414,20 +414,12 @@ function validateDocumentData(data, operation) {
414
414
  if (typeof data !== "object" || Array.isArray(data)) {
415
415
  throw new Error(`${operation}: data must be a plain object`);
416
416
  }
417
- const reservedFields = ["id", "_id", "_createdAt", "_updatedAt", "_deleted"];
417
+ const reservedFields = ["_id", "_createdAt", "_updatedAt", "_deleted", "_v", "_s"];
418
418
  for (const field of reservedFields) {
419
419
  if (field in data) {
420
420
  throw new Error(`${operation}: '${field}' is a reserved field and cannot be set manually`);
421
421
  }
422
422
  }
423
- try {
424
- const size = JSON.stringify(data).length;
425
- if (size > 1024 * 1024) {
426
- throw new Error(`${operation}: document too large (max 1MB)`);
427
- }
428
- } catch {
429
- throw new Error(`${operation}: data contains circular references`);
430
- }
431
423
  }
432
424
  var DocumentRef = class {
433
425
  constructor(app, collection, id) {
@@ -2336,7 +2328,7 @@ var StorageRef = class {
2336
2328
  const res = await new HttpsRequest({
2337
2329
  method: "POST" /* POST */,
2338
2330
  endpoint: this.app.getBaseUrl() + "/storage/file/upload",
2339
- headers: { authorization: this.app.getConfig().token, project: this.app.getConfig().project },
2331
+ headers: { authorization: this.app.getConfig().token, "x-project": this.app.getConfig().project },
2340
2332
  file: srcFile,
2341
2333
  isMultipart: true
2342
2334
  }).sendRequest();