@muhgholy/next-drive 4.21.0 → 4.23.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.
@@ -49,6 +49,7 @@ var DriveSchema = new mongoose.Schema(
49
49
  information: { type: informationSchema, required: true },
50
50
  status: { type: String, enum: ["READY", "PROCESSING", "UPLOADING", "FAILED"], default: "PROCESSING" },
51
51
  trashedAt: { type: Date, default: null },
52
+ meta: { type: mongoose.Schema.Types.Mixed, default: {} },
52
53
  createdAt: { type: Date, default: Date.now }
53
54
  },
54
55
  { minimize: false }
@@ -72,6 +73,7 @@ DriveSchema.method("toClient", async function() {
72
73
  information: data.information,
73
74
  status: data.status,
74
75
  trashedAt: data.trashedAt,
76
+ meta: data.meta,
75
77
  createdAt: data.createdAt
76
78
  };
77
79
  });
@@ -1642,7 +1644,8 @@ var driveUpload = async (source, key, options) => {
1642
1644
  parentId: resolvedParentId,
1643
1645
  order: await getNextOrderValue(key),
1644
1646
  information: { type: "FILE", sizeInBytes: fileSize, mime: mimeType, path: "" },
1645
- status: "UPLOADING"
1647
+ status: "UPLOADING",
1648
+ meta: options.meta || {}
1646
1649
  });
1647
1650
  if (provider.name === "LOCAL" && drive.information.type === "FILE") {
1648
1651
  drive.information.path = path__default.default.join("file", String(drive._id), "data.bin");
@@ -2426,5 +2429,5 @@ exports.driveReadFile = driveReadFile;
2426
2429
  exports.driveUpload = driveUpload;
2427
2430
  exports.getDriveConfig = getDriveConfig;
2428
2431
  exports.getDriveInformation = getDriveInformation;
2429
- //# sourceMappingURL=chunk-TBBX3C6E.cjs.map
2430
- //# sourceMappingURL=chunk-TBBX3C6E.cjs.map
2432
+ //# sourceMappingURL=chunk-EUAHSB2J.cjs.map
2433
+ //# sourceMappingURL=chunk-EUAHSB2J.cjs.map