streamby-core 0.37.0 → 0.38.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.
@@ -42,10 +42,11 @@ export interface StorageAdapter {
42
42
  deleteProjectDirectory: (projectId: string) => Promise<any>;
43
43
  getPresignedUrl?: (contentType: string, projectId: string) => Promise<any>;
44
44
  getPresignedProjectImageUrl?: (projectId: string) => Promise<any>;
45
- getPresignedUploadUrl?: (key: string, contentType: string) => Promise<string>;
45
+ getPresignedUploadUrl?: (key: string, contentType: string, expiresIn?: number) => Promise<string>;
46
46
  listFilesByCategory?: (projectId: string, category: string) => Promise<StorageFileInfo[]>;
47
47
  deleteFile?: (key: string) => Promise<void>;
48
- getPresignedGetUrl?: (key: string) => Promise<string>;
48
+ copyFile?: (from: string, to: string) => Promise<void>;
49
+ getPresignedGetUrl?: (key: string, expiresIn?: number, downloadName?: string) => Promise<string>;
49
50
  }
50
51
  export interface FieldDefinition {
51
52
  name: string;
@@ -140,6 +141,10 @@ export interface StreamByConfig {
140
141
  windowMs: number;
141
142
  };
142
143
  apiBaseUrl?: string;
144
+ signedUrlTtl?: {
145
+ upload?: number;
146
+ download?: number;
147
+ };
143
148
  };
144
149
  websocket?: {
145
150
  server: WebSocketServer;
@@ -0,0 +1,2 @@
1
+ /** The NoSQL database the project's files and production live in, or null when there's none. */
2
+ export declare function nosqlDb(): import("mongodb").Db | null;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.nosqlDb = nosqlDb;
4
+ const connectionManager_1 = require("../adapters/database/connectionManager");
5
+ /** The NoSQL database the project's files and production live in, or null when there's none. */
6
+ function nosqlDb() {
7
+ const ids = (0, connectionManager_1.getConnectedIds)().filter(id => (0, connectionManager_1.getConnection)(id).type === 'nosql');
8
+ if (!ids.length)
9
+ return null;
10
+ return (0, connectionManager_1.getConnection)(ids[0]).client.db();
11
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "streamby-core",
3
- "version": "0.37.0",
3
+ "version": "0.38.0",
4
4
  "description": "StreamBy middleware framework for media storage management",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",