streamby-core 0.24.11 → 0.24.12

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.
@@ -57,7 +57,8 @@ function exportRouter(config) {
57
57
  data = { name: exportMetadata.name, createdAt: exportMetadata.createdAt, updatedAt: exportMetadata.updatedAt, type: exportMetadata.type, collectionName: exportMetadata.collectionName };
58
58
  }
59
59
  else {
60
- data = await db.collection(exportMetadata.collectionName).find({ __metadata: { $exists: false } }).toArray();
60
+ const rawData = await db.collection(exportMetadata.collectionName).findOne({ _id: new mongodb_1.ObjectId(exportId) });
61
+ data = rawData ? { json: rawData.json, name: rawData.name, method: rawData.method, collectionName: rawData.collectionName, createdAt: rawData.createdAt, updatedAt: rawData.updatedAt, type: exportMetadata.type } : null;
61
62
  }
62
63
  }
63
64
  else if (project.dbType === 'sql') {
@@ -67,20 +68,11 @@ function exportRouter(config) {
67
68
  return res.status(404).json({ message: 'Export data not found' });
68
69
  }
69
70
  let responseData;
70
- if (Array.isArray(data)) {
71
- responseData = {
72
- content: data,
73
- allowedOrigin: exportMetadata.allowedOrigin,
74
- private: exportMetadata.private,
75
- };
76
- }
77
- else {
78
- responseData = {
79
- ...data,
80
- allowedOrigin: exportMetadata.allowedOrigin,
81
- private: exportMetadata.private,
82
- };
83
- }
71
+ responseData = {
72
+ ...data,
73
+ allowedOrigin: exportMetadata.allowedOrigin,
74
+ private: exportMetadata.private,
75
+ };
84
76
  res.json({
85
77
  data: responseData,
86
78
  message: 'Export data fetched successfully',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "streamby-core",
3
- "version": "0.24.11",
3
+ "version": "0.24.12",
4
4
  "description": "StreamBy middleware framework for media storage management",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",