streamby-core 0.24.12 → 0.24.13

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.
@@ -44,7 +44,7 @@ function exportRouter(config) {
44
44
  let data;
45
45
  if (project.dbType === 'nosql') {
46
46
  const db = connection.client.db();
47
- if (exportMetadata.type === 'raw') {
47
+ if (exportMetadata.type === 'raw' || exportMetadata.type === 'json') {
48
48
  const rawData = await db.collection(exportMetadata.collectionName).findOne({ _id: new mongodb_1.ObjectId(exportId) });
49
49
  data = rawData ? { json: rawData.json, name: rawData.name, method: rawData.method, collectionName: rawData.collectionName, createdAt: rawData.createdAt, updatedAt: rawData.updatedAt, type: exportMetadata.type } : null;
50
50
  }
@@ -210,7 +210,7 @@ function exportRouter(config) {
210
210
  let data;
211
211
  if (project.dbType === 'nosql') {
212
212
  const db = connection.client.db();
213
- if (exportMetadata.type === 'raw') {
213
+ if (exportMetadata.type === 'raw' || exportMetadata.type === 'json') {
214
214
  const rawData = await db.collection(exportMetadata.collectionName).findOne({ _id: new mongodb_1.ObjectId(exportMetadata.id) });
215
215
  data = rawData ? rawData.json : null;
216
216
  }
@@ -4,8 +4,8 @@ interface CreateExportResult {
4
4
  collectionName: string;
5
5
  message: string;
6
6
  }
7
- export declare function createExport(config: StreamByConfig, projectId: string, exportName: string, collectionName: string, jsonData: any, dbType: DatabaseType, exportType: 'structured' | 'raw' | 'externalApi', isPrivate?: boolean, allowedOrigin?: string[], apiUrl?: string, credentialId?: string, prefix?: string): Promise<CreateExportResult>;
8
- export declare function updateExport(config: StreamByConfig, projectId: string, exportId: string, exportName: string, collectionName: string, jsonData: any, dbType: DatabaseType, exportType: 'structured' | 'raw' | 'externalApi', isPrivate?: boolean, allowedOrigin?: string[], apiUrl?: string, credentialId?: string, prefix?: string): Promise<CreateExportResult>;
7
+ export declare function createExport(config: StreamByConfig, projectId: string, exportName: string, collectionName: string, jsonData: any, dbType: DatabaseType, exportType: 'structured' | 'raw' | 'json' | 'externalApi', isPrivate?: boolean, allowedOrigin?: string[], apiUrl?: string, credentialId?: string, prefix?: string): Promise<CreateExportResult>;
8
+ export declare function updateExport(config: StreamByConfig, projectId: string, exportId: string, exportName: string, collectionName: string, jsonData: any, dbType: DatabaseType, exportType: 'structured' | 'raw' | 'json' | 'externalApi', isPrivate?: boolean, allowedOrigin?: string[], apiUrl?: string, credentialId?: string, prefix?: string): Promise<CreateExportResult>;
9
9
  export declare function deleteExport(config: StreamByConfig, projectId: string, exportId: string, dbType: DatabaseType, collectionName: string): Promise<{
10
10
  message: string;
11
11
  }>;
@@ -87,7 +87,7 @@ export interface Export {
87
87
  projectId: string;
88
88
  createdAt: Date;
89
89
  updatedAt: Date;
90
- type: 'structured' | 'raw' | 'externalApi';
90
+ type: 'structured' | 'raw' | 'json' | 'externalApi';
91
91
  fields?: FieldDefinition[];
92
92
  jsonData?: any;
93
93
  private?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "streamby-core",
3
- "version": "0.24.12",
3
+ "version": "0.24.13",
4
4
  "description": "StreamBy middleware framework for media storage management",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",