@muhgholy/next-drive 4.20.0 → 4.22.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.
@@ -36,6 +36,7 @@ var DriveSchema = new Schema(
36
36
  information: { type: informationSchema, required: true },
37
37
  status: { type: String, enum: ["READY", "PROCESSING", "UPLOADING", "FAILED"], default: "PROCESSING" },
38
38
  trashedAt: { type: Date, default: null },
39
+ meta: { type: Schema.Types.Mixed, default: {} },
39
40
  createdAt: { type: Date, default: Date.now }
40
41
  },
41
42
  { minimize: false }
@@ -59,6 +60,7 @@ DriveSchema.method("toClient", async function() {
59
60
  information: data.information,
60
61
  status: data.status,
61
62
  trashedAt: data.trashedAt,
63
+ meta: data.meta,
62
64
  createdAt: data.createdAt
63
65
  };
64
66
  });
@@ -1629,7 +1631,8 @@ var driveUpload = async (source, key, options) => {
1629
1631
  parentId: resolvedParentId,
1630
1632
  order: await getNextOrderValue(key),
1631
1633
  information: { type: "FILE", sizeInBytes: fileSize, mime: mimeType, path: "" },
1632
- status: "UPLOADING"
1634
+ status: "UPLOADING",
1635
+ meta: options.meta || {}
1633
1636
  });
1634
1637
  if (provider.name === "LOCAL" && drive.information.type === "FILE") {
1635
1638
  drive.information.path = path.join("file", String(drive._id), "data.bin");
@@ -2402,5 +2405,5 @@ var driveAPIHandler = async (req, res) => {
2402
2405
  };
2403
2406
 
2404
2407
  export { driveAPIHandler, driveConfiguration, driveDelete, driveFilePath, driveFileSchemaZod, driveGetUrl, driveInfo, driveList, driveReadFile, driveUpload, getDriveConfig, getDriveInformation };
2405
- //# sourceMappingURL=chunk-FWX344WM.js.map
2406
- //# sourceMappingURL=chunk-FWX344WM.js.map
2408
+ //# sourceMappingURL=chunk-CR3QW3QN.js.map
2409
+ //# sourceMappingURL=chunk-CR3QW3QN.js.map