streamby-core 0.28.5 → 0.29.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.
- package/README.md +283 -283
- package/dist/adapters/database/connectionManager.js +63 -63
- package/dist/adapters/database/sql.js +1 -1
- package/dist/middleware/createRouter.js +21 -0
- package/dist/middleware/routes/ai.d.ts +3 -0
- package/dist/middleware/routes/ai.js +105 -0
- package/dist/middleware/routes/distribution.d.ts +3 -0
- package/dist/middleware/routes/distribution.js +192 -0
- package/dist/middleware/routes/media.d.ts +5 -0
- package/dist/middleware/routes/media.js +189 -0
- package/dist/middleware/routes/production.d.ts +3 -0
- package/dist/middleware/routes/production.js +362 -0
- package/dist/middleware/routes/renderFarm.d.ts +3 -0
- package/dist/middleware/routes/renderFarm.js +158 -0
- package/dist/middleware/routes/review.d.ts +3 -0
- package/dist/middleware/routes/review.js +240 -0
- package/dist/middleware/routes/rights.d.ts +3 -0
- package/dist/middleware/routes/rights.js +80 -0
- package/dist/models/Model.js +9 -9
- package/dist/services/aiProcessor.d.ts +25 -0
- package/dist/services/aiProcessor.js +123 -0
- package/dist/services/jobQueue.d.ts +5 -0
- package/dist/services/jobQueue.js +54 -0
- package/dist/services/mediaProcessor.d.ts +19 -0
- package/dist/services/mediaProcessor.js +201 -0
- package/dist/services/pipeline.js +153 -8
- package/dist/services/vfxProcessor.d.ts +24 -0
- package/dist/services/vfxProcessor.js +139 -0
- package/dist/types/index.d.ts +188 -0
- package/package.json +63 -63
- package/dist/utils/crypto.d.ts +0 -3
- package/dist/utils/crypto.js +0 -32
package/dist/types/index.d.ts
CHANGED
|
@@ -186,4 +186,192 @@ export interface Export {
|
|
|
186
186
|
useConnections?: boolean;
|
|
187
187
|
useCredentials?: boolean;
|
|
188
188
|
storageDbId?: string;
|
|
189
|
+
deliverableType?: 'api' | 'video-stream' | 'game-build' | 'asset-bundle' | 'app-binary';
|
|
190
|
+
deliverableVersion?: string;
|
|
191
|
+
deliverableTargets?: DeliveryTarget[];
|
|
192
|
+
publishedAt?: Date;
|
|
193
|
+
publishedBy?: string;
|
|
194
|
+
cdnUrl?: string;
|
|
195
|
+
}
|
|
196
|
+
export type DistributionTarget = 'cdnPush' | 'hlsStream' | 'steam' | 'appStoreConnect' | 'googlePlay' | 'itchIo' | 'customWebhook';
|
|
197
|
+
export type DeliveryStatus = 'pending' | 'publishing' | 'published' | 'failed';
|
|
198
|
+
export interface DeliveryTarget {
|
|
199
|
+
connectionId: string;
|
|
200
|
+
target: DistributionTarget;
|
|
201
|
+
channel?: string;
|
|
202
|
+
publishedAt?: Date;
|
|
203
|
+
publishedBy?: string;
|
|
204
|
+
receipt?: Record<string, string>;
|
|
205
|
+
status: DeliveryStatus;
|
|
206
|
+
}
|
|
207
|
+
export interface DistributionConnection {
|
|
208
|
+
id: string;
|
|
209
|
+
name: string;
|
|
210
|
+
target: DistributionTarget;
|
|
211
|
+
credentialId?: string;
|
|
212
|
+
projectId: string;
|
|
213
|
+
config: Record<string, string>;
|
|
214
|
+
createdAt: Date;
|
|
215
|
+
description?: string;
|
|
216
|
+
}
|
|
217
|
+
export interface QcCheck {
|
|
218
|
+
name: string;
|
|
219
|
+
passed: boolean;
|
|
220
|
+
value: string | number;
|
|
221
|
+
threshold: string | number;
|
|
222
|
+
message?: string;
|
|
223
|
+
}
|
|
224
|
+
export interface QcReportRecord {
|
|
225
|
+
assetId: string;
|
|
226
|
+
projectId: string;
|
|
227
|
+
checks: QcCheck[];
|
|
228
|
+
overallPassed: boolean;
|
|
229
|
+
generatedAt: Date;
|
|
230
|
+
}
|
|
231
|
+
export type JobType = 'ingest' | 'transcode' | 'caption' | 'thumbnail' | 'render' | 'format-convert' | 'lod' | 'distribute' | 'qc' | 'transcription' | 'upscale' | 'generate-asset';
|
|
232
|
+
export type AiProvider = 'openai' | 'deepgram' | 'assemblyai' | 'stabilityai' | 'meshy' | 'elevenlabs' | 'custom';
|
|
233
|
+
export interface PipelineSuggestion {
|
|
234
|
+
rationale: string;
|
|
235
|
+
nodesToAdd: {
|
|
236
|
+
type: string;
|
|
237
|
+
label: string;
|
|
238
|
+
position: {
|
|
239
|
+
x: number;
|
|
240
|
+
y: number;
|
|
241
|
+
};
|
|
242
|
+
}[];
|
|
243
|
+
edgesToAdd: {
|
|
244
|
+
source: string;
|
|
245
|
+
sourceHandle: string;
|
|
246
|
+
target: string;
|
|
247
|
+
targetHandle: string;
|
|
248
|
+
}[];
|
|
249
|
+
}
|
|
250
|
+
export type RenderFarmProvider = 'flamenco' | 'deadline' | 'rebusfarm' | 'sheepit' | 'custom';
|
|
251
|
+
export interface RenderFarmConnection {
|
|
252
|
+
id: string;
|
|
253
|
+
name: string;
|
|
254
|
+
provider: RenderFarmProvider;
|
|
255
|
+
apiUrl: string;
|
|
256
|
+
credentialId?: string;
|
|
257
|
+
projectId: string;
|
|
258
|
+
createdAt: Date;
|
|
259
|
+
description?: string;
|
|
260
|
+
}
|
|
261
|
+
export interface LodLevel {
|
|
262
|
+
level: number;
|
|
263
|
+
ratio: number;
|
|
264
|
+
storageFileId: string;
|
|
265
|
+
polyCount?: number;
|
|
266
|
+
fileSize?: number;
|
|
267
|
+
}
|
|
268
|
+
export interface LodManifestRecord {
|
|
269
|
+
assetId: string;
|
|
270
|
+
projectId: string;
|
|
271
|
+
levels: LodLevel[];
|
|
272
|
+
generatedAt: Date;
|
|
273
|
+
}
|
|
274
|
+
export interface AssetDependencyGraphRecord {
|
|
275
|
+
rootAssetId: string;
|
|
276
|
+
projectId: string;
|
|
277
|
+
nodes: {
|
|
278
|
+
assetId: string;
|
|
279
|
+
type: string;
|
|
280
|
+
resolved: boolean;
|
|
281
|
+
}[];
|
|
282
|
+
edges: {
|
|
283
|
+
from: string;
|
|
284
|
+
to: string;
|
|
285
|
+
relationship: string;
|
|
286
|
+
}[];
|
|
287
|
+
resolvedAt: Date;
|
|
288
|
+
}
|
|
289
|
+
export type ReviewStatus = 'open' | 'approved' | 'rejected' | 'expired';
|
|
290
|
+
export type ReviewDecision = 'approve' | 'reject';
|
|
291
|
+
export interface ReviewApproval {
|
|
292
|
+
userId: string;
|
|
293
|
+
username: string;
|
|
294
|
+
decision: ReviewDecision;
|
|
295
|
+
comment?: string;
|
|
296
|
+
at: Date;
|
|
297
|
+
}
|
|
298
|
+
export interface ReviewSessionRecord {
|
|
299
|
+
id: string;
|
|
300
|
+
projectId: string;
|
|
301
|
+
assetId: string;
|
|
302
|
+
assetVersionId: string;
|
|
303
|
+
status: ReviewStatus;
|
|
304
|
+
requiredApprovers: number;
|
|
305
|
+
approvals: ReviewApproval[];
|
|
306
|
+
deadline?: Date;
|
|
307
|
+
createdAt: Date;
|
|
308
|
+
updatedAt: Date;
|
|
309
|
+
}
|
|
310
|
+
export type AnnotationType = 'timecoded' | 'spatial' | 'region';
|
|
311
|
+
export interface AnnotationRecord {
|
|
312
|
+
id: string;
|
|
313
|
+
assetId: string;
|
|
314
|
+
assetVersionId: string;
|
|
315
|
+
projectId: string;
|
|
316
|
+
authorId: string;
|
|
317
|
+
authorUsername: string;
|
|
318
|
+
type: AnnotationType;
|
|
319
|
+
timecode?: string;
|
|
320
|
+
position3d?: {
|
|
321
|
+
x: number;
|
|
322
|
+
y: number;
|
|
323
|
+
z: number;
|
|
324
|
+
};
|
|
325
|
+
regionRect?: {
|
|
326
|
+
x: number;
|
|
327
|
+
y: number;
|
|
328
|
+
width: number;
|
|
329
|
+
height: number;
|
|
330
|
+
};
|
|
331
|
+
text: string;
|
|
332
|
+
resolved: boolean;
|
|
333
|
+
resolvedBy?: string;
|
|
334
|
+
createdAt: Date;
|
|
335
|
+
}
|
|
336
|
+
export type JobStatus = 'pending' | 'processing' | 'completed' | 'failed';
|
|
337
|
+
export interface JobRecord {
|
|
338
|
+
jobId: string;
|
|
339
|
+
jobType: JobType;
|
|
340
|
+
userId: string;
|
|
341
|
+
projectId: string;
|
|
342
|
+
assetId?: string;
|
|
343
|
+
status: JobStatus;
|
|
344
|
+
stage: string;
|
|
345
|
+
progress: number;
|
|
346
|
+
payload: Record<string, any>;
|
|
347
|
+
error?: string;
|
|
348
|
+
createdAt: Date;
|
|
349
|
+
updatedAt: Date;
|
|
350
|
+
}
|
|
351
|
+
export interface AssetMetadataRecord {
|
|
352
|
+
assetId: string;
|
|
353
|
+
projectId: string;
|
|
354
|
+
duration?: number;
|
|
355
|
+
width?: number;
|
|
356
|
+
height?: number;
|
|
357
|
+
frameRate?: number;
|
|
358
|
+
colorSpace?: string;
|
|
359
|
+
codec?: string;
|
|
360
|
+
bitrate?: number;
|
|
361
|
+
channels?: number;
|
|
362
|
+
sampleRate?: number;
|
|
363
|
+
customTags: Record<string, string>;
|
|
364
|
+
extractedAt: Date;
|
|
365
|
+
}
|
|
366
|
+
export interface AssetVersionRecord {
|
|
367
|
+
versionId: string;
|
|
368
|
+
assetId: string;
|
|
369
|
+
projectId: string;
|
|
370
|
+
version: number;
|
|
371
|
+
label?: string;
|
|
372
|
+
storageKey: string;
|
|
373
|
+
size: number;
|
|
374
|
+
createdBy: string;
|
|
375
|
+
changeNote?: string;
|
|
376
|
+
createdAt: Date;
|
|
189
377
|
}
|
package/package.json
CHANGED
|
@@ -1,63 +1,63 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "streamby-core",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "StreamBy middleware framework for media storage management",
|
|
5
|
-
"main": "dist/index.js",
|
|
6
|
-
"types": "dist/index.d.ts",
|
|
7
|
-
"files": [
|
|
8
|
-
"dist"
|
|
9
|
-
],
|
|
10
|
-
"scripts": {
|
|
11
|
-
"build": "tsc",
|
|
12
|
-
"test": "vitest",
|
|
13
|
-
"dev": "ts-node-dev --respawn --clear dev.ts",
|
|
14
|
-
"prepublishOnly": "npm run build"
|
|
15
|
-
},
|
|
16
|
-
"repository": {
|
|
17
|
-
"type": "git",
|
|
18
|
-
"url": "https://github.com/GwerhDev/StreamBy-Package.git"
|
|
19
|
-
},
|
|
20
|
-
"keywords": [
|
|
21
|
-
"streamby",
|
|
22
|
-
"middleware",
|
|
23
|
-
"upload",
|
|
24
|
-
"storage",
|
|
25
|
-
"s3",
|
|
26
|
-
"express",
|
|
27
|
-
"typescript"
|
|
28
|
-
],
|
|
29
|
-
"author": "TerminalCore Labs",
|
|
30
|
-
"license": "MIT",
|
|
31
|
-
"dependencies": {
|
|
32
|
-
"@aws-sdk/client-s3": "^3.528.0",
|
|
33
|
-
"@aws-sdk/s3-request-presigner": "^3.787.0",
|
|
34
|
-
"@prisma/client": "^6.12.0",
|
|
35
|
-
"bcrypt": "^5.1.1",
|
|
36
|
-
"dotenv": "^16.5.0",
|
|
37
|
-
"express": "^4.0.0",
|
|
38
|
-
"mongodb": "^6.17.0",
|
|
39
|
-
"mongoose": "^8.13.2",
|
|
40
|
-
"node-fetch": "^3.0.0",
|
|
41
|
-
"pg": "^8.16.3",
|
|
42
|
-
"prisma": "^6.12.0",
|
|
43
|
-
"ws": "^8.20.0"
|
|
44
|
-
},
|
|
45
|
-
"devDependencies": {
|
|
46
|
-
"@types/bcrypt": "^5.0.2",
|
|
47
|
-
"@types/cors": "^2.8.18",
|
|
48
|
-
"@types/express": "^4.17.17",
|
|
49
|
-
"@types/mongodb": "^4.0.7",
|
|
50
|
-
"@types/node": "^22.15.21",
|
|
51
|
-
"@types/pg": "^8.15.4",
|
|
52
|
-
"@types/supertest": "^6.0.3",
|
|
53
|
-
"@types/ws": "^8.18.1",
|
|
54
|
-
"cors": "^2.8.5",
|
|
55
|
-
"supertest": "^7.1.4",
|
|
56
|
-
"ts-node-dev": "^2.0.0",
|
|
57
|
-
"typescript": "^5.8.3",
|
|
58
|
-
"vitest": "^3.1.1"
|
|
59
|
-
},
|
|
60
|
-
"peerDependencies": {
|
|
61
|
-
"express": "^4.0.0"
|
|
62
|
-
}
|
|
63
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "streamby-core",
|
|
3
|
+
"version": "0.29.0",
|
|
4
|
+
"description": "StreamBy middleware framework for media storage management",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist"
|
|
9
|
+
],
|
|
10
|
+
"scripts": {
|
|
11
|
+
"build": "tsc",
|
|
12
|
+
"test": "vitest",
|
|
13
|
+
"dev": "ts-node-dev --respawn --clear dev.ts",
|
|
14
|
+
"prepublishOnly": "npm run build"
|
|
15
|
+
},
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "https://github.com/GwerhDev/StreamBy-Package.git"
|
|
19
|
+
},
|
|
20
|
+
"keywords": [
|
|
21
|
+
"streamby",
|
|
22
|
+
"middleware",
|
|
23
|
+
"upload",
|
|
24
|
+
"storage",
|
|
25
|
+
"s3",
|
|
26
|
+
"express",
|
|
27
|
+
"typescript"
|
|
28
|
+
],
|
|
29
|
+
"author": "TerminalCore Labs",
|
|
30
|
+
"license": "MIT",
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"@aws-sdk/client-s3": "^3.528.0",
|
|
33
|
+
"@aws-sdk/s3-request-presigner": "^3.787.0",
|
|
34
|
+
"@prisma/client": "^6.12.0",
|
|
35
|
+
"bcrypt": "^5.1.1",
|
|
36
|
+
"dotenv": "^16.5.0",
|
|
37
|
+
"express": "^4.0.0",
|
|
38
|
+
"mongodb": "^6.17.0",
|
|
39
|
+
"mongoose": "^8.13.2",
|
|
40
|
+
"node-fetch": "^3.0.0",
|
|
41
|
+
"pg": "^8.16.3",
|
|
42
|
+
"prisma": "^6.12.0",
|
|
43
|
+
"ws": "^8.20.0"
|
|
44
|
+
},
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"@types/bcrypt": "^5.0.2",
|
|
47
|
+
"@types/cors": "^2.8.18",
|
|
48
|
+
"@types/express": "^4.17.17",
|
|
49
|
+
"@types/mongodb": "^4.0.7",
|
|
50
|
+
"@types/node": "^22.15.21",
|
|
51
|
+
"@types/pg": "^8.15.4",
|
|
52
|
+
"@types/supertest": "^6.0.3",
|
|
53
|
+
"@types/ws": "^8.18.1",
|
|
54
|
+
"cors": "^2.8.5",
|
|
55
|
+
"supertest": "^7.1.4",
|
|
56
|
+
"ts-node-dev": "^2.0.0",
|
|
57
|
+
"typescript": "^5.8.3",
|
|
58
|
+
"vitest": "^3.1.1"
|
|
59
|
+
},
|
|
60
|
+
"peerDependencies": {
|
|
61
|
+
"express": "^4.0.0"
|
|
62
|
+
}
|
|
63
|
+
}
|
package/dist/utils/crypto.d.ts
DELETED
package/dist/utils/crypto.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.encrypt = encrypt;
|
|
7
|
-
exports.decrypt = decrypt;
|
|
8
|
-
exports.hash = hash;
|
|
9
|
-
const crypto_1 = __importDefault(require("crypto"));
|
|
10
|
-
const ALGORITHM = 'aes-256-cbc';
|
|
11
|
-
const IV_LENGTH = 16;
|
|
12
|
-
function encrypt(text, secretKey) {
|
|
13
|
-
const iv = crypto_1.default.randomBytes(IV_LENGTH);
|
|
14
|
-
const key = crypto_1.default.createHash('sha256').update(String(secretKey)).digest('base64').substr(0, 32);
|
|
15
|
-
const cipher = crypto_1.default.createCipheriv(ALGORITHM, Buffer.from(key), iv);
|
|
16
|
-
let encrypted = cipher.update(text);
|
|
17
|
-
encrypted = Buffer.concat([encrypted, cipher.final()]);
|
|
18
|
-
return iv.toString('hex') + ':' + encrypted.toString('hex');
|
|
19
|
-
}
|
|
20
|
-
function decrypt(text, secretKey) {
|
|
21
|
-
const textParts = text.split(':');
|
|
22
|
-
const iv = Buffer.from(textParts.shift(), 'hex');
|
|
23
|
-
const encryptedText = Buffer.from(textParts.join(':'), 'hex');
|
|
24
|
-
const key = crypto_1.default.createHash('sha256').update(String(secretKey)).digest('base64').substr(0, 32);
|
|
25
|
-
const decipher = crypto_1.default.createDecipheriv(ALGORITHM, Buffer.from(key), iv);
|
|
26
|
-
let decrypted = decipher.update(encryptedText);
|
|
27
|
-
decrypted = Buffer.concat([decrypted, decipher.final()]);
|
|
28
|
-
return decrypted.toString();
|
|
29
|
-
}
|
|
30
|
-
function hash(text) {
|
|
31
|
-
return crypto_1.default.createHash('sha256').update(text).digest('hex');
|
|
32
|
-
}
|