streamer-node 1.0.30 → 1.0.37
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/dist/package.json +6 -2
- package/dist/scripts/README.md +670 -0
- package/dist/scripts/install-streamer-node.sh +117 -0
- package/dist/scripts/reframe_ball.py +354 -0
- package/dist/src/application/interfaces/StartStreamUseCase.types.d.ts +3 -1
- package/dist/src/application/interfaces/StartStreamUseCase.types.d.ts.map +1 -1
- package/dist/src/application/interfaces/StartStreamUseCase.types.js.map +1 -1
- package/dist/src/application/services/HttpClient.d.ts +21 -0
- package/dist/src/application/services/HttpClient.d.ts.map +1 -1
- package/dist/src/application/services/HttpClient.js +37 -5
- package/dist/src/application/services/HttpClient.js.map +1 -1
- package/dist/src/application/services/StreamManagerService.d.ts.map +1 -1
- package/dist/src/application/services/StreamManagerService.js +2 -0
- package/dist/src/application/services/StreamManagerService.js.map +1 -1
- package/dist/src/application/use-cases/CaptureHighlightUseCase.d.ts +52 -0
- package/dist/src/application/use-cases/CaptureHighlightUseCase.d.ts.map +1 -0
- package/dist/src/application/use-cases/CaptureHighlightUseCase.js +169 -0
- package/dist/src/application/use-cases/CaptureHighlightUseCase.js.map +1 -0
- package/dist/src/application/use-cases/StartStreamUseCase.d.ts +9 -1
- package/dist/src/application/use-cases/StartStreamUseCase.d.ts.map +1 -1
- package/dist/src/application/use-cases/StartStreamUseCase.js +125 -2
- package/dist/src/application/use-cases/StartStreamUseCase.js.map +1 -1
- package/dist/src/application/use-cases/StopStreamUseCase.d.ts +5 -1
- package/dist/src/application/use-cases/StopStreamUseCase.d.ts.map +1 -1
- package/dist/src/application/use-cases/StopStreamUseCase.js +7 -1
- package/dist/src/application/use-cases/StopStreamUseCase.js.map +1 -1
- package/dist/src/domain/events/StreamEvent.d.ts +5 -0
- package/dist/src/domain/events/StreamEvent.d.ts.map +1 -1
- package/dist/src/domain/services/BallReframer.d.ts +35 -0
- package/dist/src/domain/services/BallReframer.d.ts.map +1 -0
- package/dist/src/domain/services/BallReframer.js +3 -0
- package/dist/src/domain/services/BallReframer.js.map +1 -0
- package/dist/src/domain/services/FFmpegService.d.ts +6 -2
- package/dist/src/domain/services/FFmpegService.d.ts.map +1 -1
- package/dist/src/domain/services/HighlightSignalSource.d.ts +113 -0
- package/dist/src/domain/services/HighlightSignalSource.d.ts.map +1 -0
- package/dist/src/domain/services/HighlightSignalSource.js +3 -0
- package/dist/src/domain/services/HighlightSignalSource.js.map +1 -0
- package/dist/src/domain/services/SSEService.d.ts +1 -0
- package/dist/src/domain/services/SSEService.d.ts.map +1 -1
- package/dist/src/infrastructure/config/Config.d.ts +32 -0
- package/dist/src/infrastructure/config/Config.d.ts.map +1 -1
- package/dist/src/infrastructure/config/Config.js +60 -0
- package/dist/src/infrastructure/config/Config.js.map +1 -1
- package/dist/src/infrastructure/listeners/SupabaseListener.d.ts +5 -0
- package/dist/src/infrastructure/listeners/SupabaseListener.d.ts.map +1 -1
- package/dist/src/infrastructure/listeners/SupabaseListener.js +43 -5
- package/dist/src/infrastructure/listeners/SupabaseListener.js.map +1 -1
- package/dist/src/infrastructure/logging/LogShippingService.d.ts +3 -1
- package/dist/src/infrastructure/logging/LogShippingService.d.ts.map +1 -1
- package/dist/src/infrastructure/logging/LogShippingService.js +13 -4
- package/dist/src/infrastructure/logging/LogShippingService.js.map +1 -1
- package/dist/src/infrastructure/logging/RemoteLogger.d.ts +1 -0
- package/dist/src/infrastructure/logging/RemoteLogger.d.ts.map +1 -1
- package/dist/src/infrastructure/logging/RemoteLogger.js +1 -1
- package/dist/src/infrastructure/logging/RemoteLogger.js.map +1 -1
- package/dist/src/infrastructure/services/AdDownloaderService.d.ts +85 -0
- package/dist/src/infrastructure/services/AdDownloaderService.d.ts.map +1 -0
- package/dist/src/infrastructure/services/AdDownloaderService.js +530 -0
- package/dist/src/infrastructure/services/AdDownloaderService.js.map +1 -0
- package/dist/src/infrastructure/services/AdRotator.d.ts +63 -0
- package/dist/src/infrastructure/services/AdRotator.d.ts.map +1 -0
- package/dist/src/infrastructure/services/AdRotator.js +223 -0
- package/dist/src/infrastructure/services/AdRotator.js.map +1 -0
- package/dist/src/infrastructure/services/HighlightBufferManager.d.ts +65 -0
- package/dist/src/infrastructure/services/HighlightBufferManager.d.ts.map +1 -0
- package/dist/src/infrastructure/services/HighlightBufferManager.js +203 -0
- package/dist/src/infrastructure/services/HighlightBufferManager.js.map +1 -0
- package/dist/src/infrastructure/services/HighlightBufferRegistry.d.ts +23 -0
- package/dist/src/infrastructure/services/HighlightBufferRegistry.d.ts.map +1 -0
- package/dist/src/infrastructure/services/HighlightBufferRegistry.js +44 -0
- package/dist/src/infrastructure/services/HighlightBufferRegistry.js.map +1 -0
- package/dist/src/infrastructure/services/HighlightExtractorService.d.ts +65 -0
- package/dist/src/infrastructure/services/HighlightExtractorService.d.ts.map +1 -0
- package/dist/src/infrastructure/services/HighlightExtractorService.js +264 -0
- package/dist/src/infrastructure/services/HighlightExtractorService.js.map +1 -0
- package/dist/src/infrastructure/services/HighlightRendererService.d.ts +38 -0
- package/dist/src/infrastructure/services/HighlightRendererService.d.ts.map +1 -0
- package/dist/src/infrastructure/services/HighlightRendererService.js +182 -0
- package/dist/src/infrastructure/services/HighlightRendererService.js.map +1 -0
- package/dist/src/infrastructure/services/NodeFFmpegService.d.ts +6 -4
- package/dist/src/infrastructure/services/NodeFFmpegService.d.ts.map +1 -1
- package/dist/src/infrastructure/services/NodeFFmpegService.js +154 -32
- package/dist/src/infrastructure/services/NodeFFmpegService.js.map +1 -1
- package/dist/src/infrastructure/services/NodeSSEService.d.ts +8 -0
- package/dist/src/infrastructure/services/NodeSSEService.d.ts.map +1 -1
- package/dist/src/infrastructure/services/NodeSSEService.js +71 -27
- package/dist/src/infrastructure/services/NodeSSEService.js.map +1 -1
- package/dist/src/infrastructure/services/NullBallReframer.d.ts +11 -0
- package/dist/src/infrastructure/services/NullBallReframer.d.ts.map +1 -0
- package/dist/src/infrastructure/services/NullBallReframer.js +16 -0
- package/dist/src/infrastructure/services/NullBallReframer.js.map +1 -0
- package/dist/src/infrastructure/services/PythonBallReframer.d.ts +35 -0
- package/dist/src/infrastructure/services/PythonBallReframer.d.ts.map +1 -0
- package/dist/src/infrastructure/services/PythonBallReframer.js +238 -0
- package/dist/src/infrastructure/services/PythonBallReframer.js.map +1 -0
- package/dist/src/infrastructure/services/SerialHighlightListener.d.ts +45 -0
- package/dist/src/infrastructure/services/SerialHighlightListener.d.ts.map +1 -0
- package/dist/src/infrastructure/services/SerialHighlightListener.js +440 -0
- package/dist/src/infrastructure/services/SerialHighlightListener.js.map +1 -0
- package/dist/src/infrastructure/services/YouTubeUploadService.d.ts +36 -0
- package/dist/src/infrastructure/services/YouTubeUploadService.d.ts.map +1 -0
- package/dist/src/infrastructure/services/YouTubeUploadService.js +402 -0
- package/dist/src/infrastructure/services/YouTubeUploadService.js.map +1 -0
- package/dist/src/infrastructure/utils/ResourceSampler.d.ts +47 -0
- package/dist/src/infrastructure/utils/ResourceSampler.d.ts.map +1 -0
- package/dist/src/infrastructure/utils/ResourceSampler.js +102 -0
- package/dist/src/infrastructure/utils/ResourceSampler.js.map +1 -0
- package/dist/src/infrastructure/utils/lowPriority.d.ts +29 -0
- package/dist/src/infrastructure/utils/lowPriority.d.ts.map +1 -0
- package/dist/src/infrastructure/utils/lowPriority.js +31 -0
- package/dist/src/infrastructure/utils/lowPriority.js.map +1 -0
- package/dist/src/infrastructure/utils/paths.d.ts +27 -0
- package/dist/src/infrastructure/utils/paths.d.ts.map +1 -0
- package/dist/src/infrastructure/utils/paths.js +69 -0
- package/dist/src/infrastructure/utils/paths.js.map +1 -0
- package/dist/src/infrastructure/utils/spawnToFile.d.ts +20 -0
- package/dist/src/infrastructure/utils/spawnToFile.d.ts.map +1 -0
- package/dist/src/infrastructure/utils/spawnToFile.js +98 -0
- package/dist/src/infrastructure/utils/spawnToFile.js.map +1 -0
- package/dist/src/main.js +228 -2
- package/dist/src/main.js.map +1 -1
- package/package.json +6 -2
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Filesystem path helpers shared across infrastructure services.
|
|
3
|
+
*
|
|
4
|
+
* ── IN SIMPLE WORDS ──
|
|
5
|
+
* Small, boring helpers for turning untrusted names into safe folder names and
|
|
6
|
+
* for making sure a folder exists. Several services need the exact same two
|
|
7
|
+
* operations, so they live here instead of being copy-pasted.
|
|
8
|
+
*
|
|
9
|
+
* ── WHY IT'S BUILT THIS WAY (change at your peril) ──
|
|
10
|
+
* `safeSegment` is the single guard that stops an externally-supplied id (e.g.
|
|
11
|
+
* a courtId from an SSE payload) from escaping its intended parent directory
|
|
12
|
+
* via `../` or breaking a path with hostile characters. Keep the allow-list
|
|
13
|
+
* conservative — widening it re-opens path-traversal.
|
|
14
|
+
*
|
|
15
|
+
* ── DO NOT ──
|
|
16
|
+
* - Do NOT loosen the `safeSegment` regex to allow `.` or `/` — that defeats
|
|
17
|
+
* the traversal guard.
|
|
18
|
+
*/
|
|
19
|
+
/**
|
|
20
|
+
* Reduce an arbitrary string to a single, safe filesystem path segment:
|
|
21
|
+
* anything outside [A-Za-z0-9_-] becomes "_". Prevents path traversal and
|
|
22
|
+
* invalid characters when an untrusted id is used as a directory name.
|
|
23
|
+
*/
|
|
24
|
+
export declare function safeSegment(value: string): string;
|
|
25
|
+
/** Create a directory (and parents) if missing. No-op when it already exists. */
|
|
26
|
+
export declare function ensureDirSync(dir: string): void;
|
|
27
|
+
//# sourceMappingURL=paths.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../../../src/infrastructure/utils/paths.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;GAiBG;AAEH;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED,iFAAiF;AACjF,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAE/C"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.safeSegment = safeSegment;
|
|
37
|
+
exports.ensureDirSync = ensureDirSync;
|
|
38
|
+
const fs = __importStar(require("fs"));
|
|
39
|
+
/**
|
|
40
|
+
* Filesystem path helpers shared across infrastructure services.
|
|
41
|
+
*
|
|
42
|
+
* ── IN SIMPLE WORDS ──
|
|
43
|
+
* Small, boring helpers for turning untrusted names into safe folder names and
|
|
44
|
+
* for making sure a folder exists. Several services need the exact same two
|
|
45
|
+
* operations, so they live here instead of being copy-pasted.
|
|
46
|
+
*
|
|
47
|
+
* ── WHY IT'S BUILT THIS WAY (change at your peril) ──
|
|
48
|
+
* `safeSegment` is the single guard that stops an externally-supplied id (e.g.
|
|
49
|
+
* a courtId from an SSE payload) from escaping its intended parent directory
|
|
50
|
+
* via `../` or breaking a path with hostile characters. Keep the allow-list
|
|
51
|
+
* conservative — widening it re-opens path-traversal.
|
|
52
|
+
*
|
|
53
|
+
* ── DO NOT ──
|
|
54
|
+
* - Do NOT loosen the `safeSegment` regex to allow `.` or `/` — that defeats
|
|
55
|
+
* the traversal guard.
|
|
56
|
+
*/
|
|
57
|
+
/**
|
|
58
|
+
* Reduce an arbitrary string to a single, safe filesystem path segment:
|
|
59
|
+
* anything outside [A-Za-z0-9_-] becomes "_". Prevents path traversal and
|
|
60
|
+
* invalid characters when an untrusted id is used as a directory name.
|
|
61
|
+
*/
|
|
62
|
+
function safeSegment(value) {
|
|
63
|
+
return value.replace(/[^a-zA-Z0-9_-]/g, "_");
|
|
64
|
+
}
|
|
65
|
+
/** Create a directory (and parents) if missing. No-op when it already exists. */
|
|
66
|
+
function ensureDirSync(dir) {
|
|
67
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=paths.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paths.js","sourceRoot":"","sources":["../../../../src/infrastructure/utils/paths.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,kCAEC;AAGD,sCAEC;AAjCD,uCAAyB;AAEzB;;;;;;;;;;;;;;;;;GAiBG;AAEH;;;;GAIG;AACH,SAAgB,WAAW,CAAC,KAAa;IACvC,OAAO,KAAK,CAAC,OAAO,CAAC,iBAAiB,EAAE,GAAG,CAAC,CAAC;AAC/C,CAAC;AAED,iFAAiF;AACjF,SAAgB,aAAa,CAAC,GAAW;IACvC,EAAE,CAAC,SAAS,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;AACzC,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Run a one-shot process whose output is a single file, safely.
|
|
3
|
+
*
|
|
4
|
+
* ── IN SIMPLE WORDS ──
|
|
5
|
+
* Runs a command (e.g. ffmpeg) that produces one output file, writing to a
|
|
6
|
+
* temp file first and renaming it into place only on success — so a crash,
|
|
7
|
+
* timeout, or non-zero exit never leaves a half-written/corrupt file at the
|
|
8
|
+
* real path.
|
|
9
|
+
*
|
|
10
|
+
* ── WHY IT'S BUILT THIS WAY (change at your peril) ──
|
|
11
|
+
* - The temp name PRESERVES dest's extension (`x.tmp.mp4`, not `x.mp4.tmp`)
|
|
12
|
+
* because ffmpeg picks the output muxer from the extension.
|
|
13
|
+
* - The caller passes all args EXCEPT the final output path; this appends the
|
|
14
|
+
* temp path as the last arg.
|
|
15
|
+
*
|
|
16
|
+
* ── DO NOT ──
|
|
17
|
+
* - Do NOT pass the output path in `args` — it's appended here.
|
|
18
|
+
*/
|
|
19
|
+
export declare function spawnToFile(command: string, args: string[], dest: string, timeoutMs: number): Promise<void>;
|
|
20
|
+
//# sourceMappingURL=spawnToFile.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spawnToFile.d.ts","sourceRoot":"","sources":["../../../../src/infrastructure/utils/spawnToFile.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,WAAW,CACzB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EAAE,EACd,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,IAAI,CAAC,CAyCf"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.spawnToFile = spawnToFile;
|
|
37
|
+
const fs = __importStar(require("fs"));
|
|
38
|
+
const path = __importStar(require("path"));
|
|
39
|
+
const child_process_1 = require("child_process");
|
|
40
|
+
/**
|
|
41
|
+
* Run a one-shot process whose output is a single file, safely.
|
|
42
|
+
*
|
|
43
|
+
* ── IN SIMPLE WORDS ──
|
|
44
|
+
* Runs a command (e.g. ffmpeg) that produces one output file, writing to a
|
|
45
|
+
* temp file first and renaming it into place only on success — so a crash,
|
|
46
|
+
* timeout, or non-zero exit never leaves a half-written/corrupt file at the
|
|
47
|
+
* real path.
|
|
48
|
+
*
|
|
49
|
+
* ── WHY IT'S BUILT THIS WAY (change at your peril) ──
|
|
50
|
+
* - The temp name PRESERVES dest's extension (`x.tmp.mp4`, not `x.mp4.tmp`)
|
|
51
|
+
* because ffmpeg picks the output muxer from the extension.
|
|
52
|
+
* - The caller passes all args EXCEPT the final output path; this appends the
|
|
53
|
+
* temp path as the last arg.
|
|
54
|
+
*
|
|
55
|
+
* ── DO NOT ──
|
|
56
|
+
* - Do NOT pass the output path in `args` — it's appended here.
|
|
57
|
+
*/
|
|
58
|
+
function spawnToFile(command, args, dest, timeoutMs) {
|
|
59
|
+
const ext = path.extname(dest);
|
|
60
|
+
const tmp = ext ? `${dest.slice(0, -ext.length)}.tmp${ext}` : `${dest}.tmp`;
|
|
61
|
+
return new Promise((resolve, reject) => {
|
|
62
|
+
const proc = (0, child_process_1.spawn)(command, [...args, tmp], {
|
|
63
|
+
stdio: ["ignore", "ignore", "pipe"],
|
|
64
|
+
});
|
|
65
|
+
let stderr = "";
|
|
66
|
+
proc.stderr?.on("data", (d) => {
|
|
67
|
+
stderr += d.toString();
|
|
68
|
+
});
|
|
69
|
+
const timeout = setTimeout(() => {
|
|
70
|
+
proc.kill("SIGKILL");
|
|
71
|
+
fs.unlink(tmp, () => { });
|
|
72
|
+
reject(new Error(`${command} timed out`));
|
|
73
|
+
}, timeoutMs);
|
|
74
|
+
proc.on("exit", (code) => {
|
|
75
|
+
clearTimeout(timeout);
|
|
76
|
+
if (code === 0 && fs.existsSync(tmp)) {
|
|
77
|
+
try {
|
|
78
|
+
fs.renameSync(tmp, dest);
|
|
79
|
+
resolve();
|
|
80
|
+
}
|
|
81
|
+
catch (err) {
|
|
82
|
+
fs.unlink(tmp, () => { });
|
|
83
|
+
reject(err);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
fs.unlink(tmp, () => { });
|
|
88
|
+
reject(new Error(`${command} failed (code ${code}): ${stderr.slice(-200)}`));
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
proc.on("error", (err) => {
|
|
92
|
+
clearTimeout(timeout);
|
|
93
|
+
fs.unlink(tmp, () => { });
|
|
94
|
+
reject(err);
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
//# sourceMappingURL=spawnToFile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spawnToFile.js","sourceRoot":"","sources":["../../../../src/infrastructure/utils/spawnToFile.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsBA,kCA8CC;AApED,uCAAyB;AACzB,2CAA6B;AAC7B,iDAAsC;AAEtC;;;;;;;;;;;;;;;;;GAiBG;AACH,SAAgB,WAAW,CACzB,OAAe,EACf,IAAc,EACd,IAAY,EACZ,SAAiB;IAEjB,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/B,MAAM,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,IAAI,MAAM,CAAC;IAC5E,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,MAAM,IAAI,GAAG,IAAA,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OAAO,iBAAiB,IAAI,MAAM,MAAM,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;YAC/E,CAAC;QACH,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE;YACvB,YAAY,CAAC,OAAO,CAAC,CAAC;YACtB,EAAE,CAAC,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;YACzB,MAAM,CAAC,GAAG,CAAC,CAAC;QACd,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/dist/src/main.js
CHANGED
|
@@ -34,11 +34,15 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
34
34
|
};
|
|
35
35
|
})();
|
|
36
36
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
const fs = __importStar(require("fs"));
|
|
38
|
+
const path = __importStar(require("path"));
|
|
37
39
|
const packageJson = __importStar(require("../package.json"));
|
|
38
40
|
const Config_1 = require("./infrastructure/config/Config");
|
|
39
41
|
const FileSystemStreamRepository_1 = require("./infrastructure/repositories/FileSystemStreamRepository");
|
|
40
42
|
const NodeFFmpegService_1 = require("./infrastructure/services/NodeFFmpegService");
|
|
41
43
|
const NodeSSEService_1 = require("./infrastructure/services/NodeSSEService");
|
|
44
|
+
const AdDownloaderService_1 = require("./infrastructure/services/AdDownloaderService");
|
|
45
|
+
const AdRotator_1 = require("./infrastructure/services/AdRotator");
|
|
42
46
|
const StartStreamUseCase_1 = require("./application/use-cases/StartStreamUseCase");
|
|
43
47
|
const StopStreamUseCase_1 = require("./application/use-cases/StopStreamUseCase");
|
|
44
48
|
const StreamManagerService_1 = require("./application/services/StreamManagerService");
|
|
@@ -46,13 +50,102 @@ const HttpClient_1 = require("./application/services/HttpClient");
|
|
|
46
50
|
const RemoteLogger_1 = require("./infrastructure/logging/RemoteLogger");
|
|
47
51
|
const SupabaseService_1 = require("./infrastructure/services/SupabaseService");
|
|
48
52
|
const SupabaseListener_1 = require("./infrastructure/listeners/SupabaseListener");
|
|
53
|
+
const SerialHighlightListener_1 = require("./infrastructure/services/SerialHighlightListener");
|
|
54
|
+
const HighlightBufferRegistry_1 = require("./infrastructure/services/HighlightBufferRegistry");
|
|
55
|
+
const HighlightExtractorService_1 = require("./infrastructure/services/HighlightExtractorService");
|
|
56
|
+
const HighlightRendererService_1 = require("./infrastructure/services/HighlightRendererService");
|
|
57
|
+
const NullBallReframer_1 = require("./infrastructure/services/NullBallReframer");
|
|
58
|
+
const PythonBallReframer_1 = require("./infrastructure/services/PythonBallReframer");
|
|
59
|
+
const YouTubeUploadService_1 = require("./infrastructure/services/YouTubeUploadService");
|
|
60
|
+
const CaptureHighlightUseCase_1 = require("./application/use-cases/CaptureHighlightUseCase");
|
|
49
61
|
class Application {
|
|
50
62
|
constructor() {
|
|
63
|
+
this.adRotationRegistry = new AdRotator_1.AdRotationRegistry();
|
|
64
|
+
this.highlightBufferRegistry = new HighlightBufferRegistry_1.HighlightBufferRegistry();
|
|
51
65
|
this.logger = new RemoteLogger_1.RemoteLogger({
|
|
52
66
|
...Config_1.Config.getInstance().get().remoteLogging,
|
|
53
67
|
baseUrl: Config_1.Config.getInstance().get().server.baseUrl,
|
|
68
|
+
streamingApiKey: Config_1.Config.getInstance().get().server.streamingApiKey,
|
|
54
69
|
}, "debug");
|
|
55
70
|
this.httpClient = new HttpClient_1.HttpClient();
|
|
71
|
+
/** Last state forwarded per court, to suppress redundant identical writes. */
|
|
72
|
+
this.lastScoreByCourt = new Map();
|
|
73
|
+
/** Courts the backend has rejected, so we stop retrying them every packet. */
|
|
74
|
+
this.rejectedScoreCourts = new Set();
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Forward score packets from the court hardware to the backend, which writes
|
|
78
|
+
* them to Supabase — the single source of truth the scorecard overlay already
|
|
79
|
+
* reads. The streamer is a bridge here, not a second source.
|
|
80
|
+
*
|
|
81
|
+
* ── WHY THE DEDUPE AND THE REJECT-SET ──
|
|
82
|
+
* At a multi-court venue this ESP32 also relays the NEIGHBOURING court's
|
|
83
|
+
* traffic (shared mesh credentials; the firmware does no filtering). We can't
|
|
84
|
+
* filter locally — we don't know which courts belong to this ground — so the
|
|
85
|
+
* backend validates it. But an un-suppressed reject would then POST and 400
|
|
86
|
+
* on every packet from that court, forever. First rejection is logged, then
|
|
87
|
+
* that court is dropped silently.
|
|
88
|
+
*
|
|
89
|
+
* ── DO NOT ──
|
|
90
|
+
* - Do NOT throw from here. A scoring failure must never disturb the live
|
|
91
|
+
* stream; every path swallows and logs.
|
|
92
|
+
*/
|
|
93
|
+
wireScoreForwarding(groundId) {
|
|
94
|
+
if (!this.highlightSignalSource)
|
|
95
|
+
return;
|
|
96
|
+
this.logger.info("ESP32 score forwarding enabled", { groundId });
|
|
97
|
+
this.highlightSignalSource.onScore(async (score) => {
|
|
98
|
+
try {
|
|
99
|
+
if (this.rejectedScoreCourts.has(score.courtId))
|
|
100
|
+
return;
|
|
101
|
+
// Absolute state — identical repeats carry no information.
|
|
102
|
+
const fingerprint = JSON.stringify([
|
|
103
|
+
score.mode,
|
|
104
|
+
score.scoreA,
|
|
105
|
+
score.scoreB,
|
|
106
|
+
score.gamesA,
|
|
107
|
+
score.gamesB,
|
|
108
|
+
]);
|
|
109
|
+
if (this.lastScoreByCourt.get(score.courtId) === fingerprint)
|
|
110
|
+
return;
|
|
111
|
+
// Firmware mode -> the backend's enum. Unknown/absent is omitted so the
|
|
112
|
+
// existing row keeps its mode rather than being forced to a guess.
|
|
113
|
+
const mode = score.mode === "AMER"
|
|
114
|
+
? "americano"
|
|
115
|
+
: score.mode === "TENNIS"
|
|
116
|
+
? "standard"
|
|
117
|
+
: undefined;
|
|
118
|
+
const res = await this.httpClient.postScoreboard(groundId, score.courtId, {
|
|
119
|
+
mode,
|
|
120
|
+
// A -> red (left/top), B -> blue (right/bottom), matching the overlay.
|
|
121
|
+
redScore: score.scoreA,
|
|
122
|
+
blueScore: score.scoreB,
|
|
123
|
+
redGames: score.gamesA,
|
|
124
|
+
blueGames: score.gamesB,
|
|
125
|
+
});
|
|
126
|
+
if (res.ok) {
|
|
127
|
+
this.lastScoreByCourt.set(score.courtId, fingerprint);
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
// 400/404 = this court isn't ours (mesh bleed from another ground).
|
|
131
|
+
// Expected at shared venues; log once, then ignore that court.
|
|
132
|
+
if (res.status === 400 || res.status === 404) {
|
|
133
|
+
this.rejectedScoreCourts.add(score.courtId);
|
|
134
|
+
this.logger.info("Ignoring score for a court the backend does not recognise for this ground", { courtId: score.courtId, status: res.status });
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
this.logger.warn("Score forward failed", {
|
|
138
|
+
courtId: score.courtId,
|
|
139
|
+
status: res.status,
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
catch (error) {
|
|
143
|
+
this.logger.warn("Score forward errored", {
|
|
144
|
+
courtId: score.courtId,
|
|
145
|
+
error: error instanceof Error ? error.message : String(error),
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
});
|
|
56
149
|
}
|
|
57
150
|
async start() {
|
|
58
151
|
try {
|
|
@@ -65,9 +158,135 @@ class Application {
|
|
|
65
158
|
const streamRepository = new FileSystemStreamRepository_1.FileSystemStreamRepository(config.get().stream.persistentStateDir, this.logger);
|
|
66
159
|
const ffmpegService = new NodeFFmpegService_1.NodeFFmpegService(this.logger, config);
|
|
67
160
|
const sseService = new NodeSSEService_1.NodeSSEService(this.logger);
|
|
161
|
+
const adDownloader = new AdDownloaderService_1.AdDownloaderService(this.logger);
|
|
162
|
+
// Highlight hardware detector. Started once at boot (tied to the physical
|
|
163
|
+
// USB device, not any one stream). Its isDevicePresent() drives automatic
|
|
164
|
+
// per-box enablement of the highlight buffer inside StartStreamUseCase —
|
|
165
|
+
// a box with no ESP32 attached simply never records highlights.
|
|
166
|
+
// Highlight capture subsystem — wired up ONLY when enabled, so a box with
|
|
167
|
+
// highlights off has ZERO new runtime behavior (no serial port opened, no
|
|
168
|
+
// capture pipeline, no logs). When on, enablement is still gated further
|
|
169
|
+
// by ESP32 presence inside StartStreamUseCase.
|
|
170
|
+
const highlightConfig = config.get().highlight;
|
|
171
|
+
const esp32Config = config.get().esp32;
|
|
172
|
+
// ONE device, ONE reader. The ESP32 carries both the highlight button and
|
|
173
|
+
// the score packets, and a serial port can only be held by one consumer —
|
|
174
|
+
// so the listener is opened when EITHER feature is on, and each subscribes
|
|
175
|
+
// to the events it cares about. With both off, nothing is opened at all
|
|
176
|
+
// and the box has zero new runtime behaviour.
|
|
177
|
+
if (highlightConfig.enabled || esp32Config.scoreForwardingEnabled) {
|
|
178
|
+
this.highlightSignalSource = new SerialHighlightListener_1.SerialHighlightListener(highlightConfig.serialPortPath, highlightConfig.serialBaudRate, this.logger, highlightConfig.forcePresent, highlightConfig.triggerFile);
|
|
179
|
+
this.highlightSignalSource.start();
|
|
180
|
+
if (esp32Config.scoreForwardingEnabled) {
|
|
181
|
+
this.wireScoreForwarding(config.get().groundInfo.groundId);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
if (highlightConfig.enabled && this.highlightSignalSource) {
|
|
185
|
+
// Capture pipeline: signal → cut window → (reframe) → overlay logos.
|
|
186
|
+
const highlightExtractor = new HighlightExtractorService_1.HighlightExtractorService(highlightConfig.outputDir, this.logger);
|
|
187
|
+
// Ball-tracking reframer: real Python/OpenCV impl only when enabled,
|
|
188
|
+
// else a no-op (full-frame). Off by default until tuned on real footage.
|
|
189
|
+
const ballReframer = highlightConfig.ballTracking.enabled
|
|
190
|
+
? new PythonBallReframer_1.PythonBallReframer(highlightConfig.reelAspect, this.logger)
|
|
191
|
+
: new NullBallReframer_1.NullBallReframer();
|
|
192
|
+
const highlightRenderer = new HighlightRendererService_1.HighlightRendererService(path.resolve("./public/ds.png"), path.resolve(config.get().images.clientPath), this.logger);
|
|
193
|
+
const captureHighlightUseCase = new CaptureHighlightUseCase_1.CaptureHighlightUseCase(this.highlightBufferRegistry, highlightExtractor, ballReframer, highlightRenderer, this.logger);
|
|
194
|
+
// Optional YouTube upload of the finished reel. Only built when enabled
|
|
195
|
+
// AND a streaming key is configured; otherwise reels stay on disk only.
|
|
196
|
+
const serverCfg = config.get().server;
|
|
197
|
+
const highlightUploader = highlightConfig.uploadEnabled && serverCfg.streamingApiKey
|
|
198
|
+
? new YouTubeUploadService_1.YouTubeUploadService(serverCfg.baseUrl, config.get().groundInfo.groundId, serverCfg.streamingApiKey, this.logger)
|
|
199
|
+
: null;
|
|
200
|
+
// Route a highlight to the court the press actually came from.
|
|
201
|
+
//
|
|
202
|
+
// COURT FILTERING IS LOAD-BEARING, not a nicety: every unit ships with
|
|
203
|
+
// the same mesh credentials, so at a venue with two courts in WiFi
|
|
204
|
+
// range this box's ESP32 relays the neighbouring court's button presses
|
|
205
|
+
// verbatim. Taking `running[0]` unconditionally would cut a clip from
|
|
206
|
+
// the wrong court's stream with nothing in the logs to explain it.
|
|
207
|
+
// A signal with no courtId is a debug trigger (force/trigger-file) and
|
|
208
|
+
// falls back to the single running stream.
|
|
209
|
+
this.highlightSignalSource.onHighlight(async ({ receivedAtMs, courtId }) => {
|
|
210
|
+
try {
|
|
211
|
+
const running = await streamRepository.findRunning();
|
|
212
|
+
if (running.length === 0) {
|
|
213
|
+
this.logger.warn("Highlight signal ignored: no running stream", {
|
|
214
|
+
courtId,
|
|
215
|
+
});
|
|
216
|
+
return;
|
|
217
|
+
}
|
|
218
|
+
const court = courtId
|
|
219
|
+
? running.find((s) => s.courtId === courtId)
|
|
220
|
+
: running[0];
|
|
221
|
+
if (!court) {
|
|
222
|
+
// Almost always a neighbouring court's press bleeding over the
|
|
223
|
+
// shared mesh — expected at multi-court venues, not an error.
|
|
224
|
+
this.logger.info("Highlight signal ignored: press is for another court", { pressCourtId: courtId, running: running.map((s) => s.courtId) });
|
|
225
|
+
return;
|
|
226
|
+
}
|
|
227
|
+
const result = await captureHighlightUseCase.execute({
|
|
228
|
+
courtId: court.courtId,
|
|
229
|
+
receivedAtMs,
|
|
230
|
+
});
|
|
231
|
+
// Upload is a best-effort, additive step: it runs only on a
|
|
232
|
+
// successful capture and its failure never affects the on-disk reel
|
|
233
|
+
// (the uploader is fully fail-soft). streamKey is required by the
|
|
234
|
+
// backend to resolve the video's privacy.
|
|
235
|
+
if (result && highlightUploader) {
|
|
236
|
+
const videoId = await highlightUploader.upload({
|
|
237
|
+
filePath: result.finalPath,
|
|
238
|
+
courtId: court.courtId,
|
|
239
|
+
streamKey: court.streamKey,
|
|
240
|
+
title: `DropShot highlight — ${court.courtId}`,
|
|
241
|
+
preferShort: true,
|
|
242
|
+
});
|
|
243
|
+
// Reclaim the disk once YouTube has CONFIRMED the video. Gated on
|
|
244
|
+
// a real videoId, never on "we tried": a failed upload keeps the
|
|
245
|
+
// file so the reel still exists somewhere. Unlink failure is
|
|
246
|
+
// logged and ignored — it must not fail the capture.
|
|
247
|
+
if (videoId && highlightConfig.deleteAfterUpload) {
|
|
248
|
+
fs.unlink(result.finalPath, (err) => {
|
|
249
|
+
if (err) {
|
|
250
|
+
this.logger.warn("Could not delete reel after upload", {
|
|
251
|
+
courtId: court.courtId,
|
|
252
|
+
filePath: result.finalPath,
|
|
253
|
+
error: err.message,
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
else {
|
|
257
|
+
this.logger.info("Local reel deleted after upload", {
|
|
258
|
+
courtId: court.courtId,
|
|
259
|
+
filePath: result.finalPath,
|
|
260
|
+
videoId,
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
else if (result) {
|
|
267
|
+
// Say WHY there was no upload. Without this the capture simply
|
|
268
|
+
// ends and a disabled uploader is indistinguishable from a broken
|
|
269
|
+
// one — you cannot tell from the logs that anything was meant to
|
|
270
|
+
// happen at all.
|
|
271
|
+
this.logger.info("Reel upload skipped (not configured)", {
|
|
272
|
+
courtId: court.courtId,
|
|
273
|
+
finalPath: result.finalPath,
|
|
274
|
+
reason: !highlightConfig.uploadEnabled
|
|
275
|
+
? "HIGHLIGHT_UPLOAD_ENABLED is not true"
|
|
276
|
+
: "STREAMING_API_KEY is not set",
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
catch (error) {
|
|
281
|
+
this.logger.error("Highlight capture handler failed", {
|
|
282
|
+
error: error instanceof Error ? error.message : String(error),
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
});
|
|
286
|
+
}
|
|
68
287
|
// Initialize use cases
|
|
69
|
-
const startStreamUseCase = new StartStreamUseCase_1.StartStreamUseCase(streamRepository, ffmpegService, this.logger, this.httpClient);
|
|
70
|
-
const stopStreamUseCase = new StopStreamUseCase_1.StopStreamUseCase(streamRepository, ffmpegService, this.logger);
|
|
288
|
+
const startStreamUseCase = new StartStreamUseCase_1.StartStreamUseCase(streamRepository, ffmpegService, this.logger, this.httpClient, adDownloader, this.adRotationRegistry, this.highlightBufferRegistry, this.highlightSignalSource);
|
|
289
|
+
const stopStreamUseCase = new StopStreamUseCase_1.StopStreamUseCase(streamRepository, ffmpegService, this.logger, this.adRotationRegistry, this.highlightBufferRegistry);
|
|
71
290
|
// Initialize Supabase Listener (if enabled)
|
|
72
291
|
const supabaseConfig = config.get().supabase;
|
|
73
292
|
let supabaseListener;
|
|
@@ -99,12 +318,19 @@ class Application {
|
|
|
99
318
|
const shutdown = async (signal) => {
|
|
100
319
|
this.logger.info(`Received ${signal}, shutting down gracefully`);
|
|
101
320
|
try {
|
|
321
|
+
// Stop all ad rotation timers before tearing down streams.
|
|
322
|
+
this.adRotationRegistry.stopAll();
|
|
323
|
+
// Stop all highlight buffer retention sweeps.
|
|
324
|
+
this.highlightBufferRegistry.stopAll();
|
|
102
325
|
if (this.streamManager) {
|
|
103
326
|
await this.streamManager.stop();
|
|
104
327
|
}
|
|
105
328
|
if (this.supabaseListener) { // Keep this just in case, though StreamManager handles unsub
|
|
106
329
|
await this.supabaseListener.stop();
|
|
107
330
|
}
|
|
331
|
+
if (this.highlightSignalSource) {
|
|
332
|
+
this.highlightSignalSource.stop();
|
|
333
|
+
}
|
|
108
334
|
this.logger.info("Application shutdown completed");
|
|
109
335
|
process.exit(0);
|
|
110
336
|
}
|
package/dist/src/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.js","sourceRoot":"","sources":["../../src/main.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,6DAA+C;AAC/C,2DAAwD;AACxD,yGAAsG;AACtG,mFAAgF;AAChF,6EAA0E;AAC1E,mFAAgF;AAChF,iFAA8E;AAC9E,sFAAmF;AACnF,kEAA+D;AAC/D,wEAAqE;AACrE,+EAA4E;AAC5E,kFAA+E;AAE/E,MAAM,WAAW;IAAjB;QAGmB,WAAM,GAAG,IAAI,2BAAY,CACxC;YACE,GAAG,eAAM,CAAC,WAAW,EAAE,CAAC,GAAG,EAAE,CAAC,aAAa;YAC3C,OAAO,EAAE,eAAM,CAAC,WAAW,EAAE,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO;SACnD,EACD,OAAO,CACR,CAAC;QACe,eAAU,GAAG,IAAI,uBAAU,EAAE,CAAC;IA0HjD,CAAC;IAxHQ,KAAK,CAAC,KAAK;QAChB,IAAI,CAAC;YAGH,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,oCAAoC,CAAC,CAAC;YACvD,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,oBAAoB,WAAW,CAAC,OAAO,EAAE,CAAC,CAAC;YAE5D,2BAA2B;YAC3B,MAAM,MAAM,GAAG,eAAM,CAAC,WAAW,EAAE,CAAC;YACpC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,sBAAsB,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;YAEn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AE,EAAE,MAAM,EAAE,CAAC,CAAC;YACrD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAED,wBAAwB;AACxB,MAAM,GAAG,GAAG,IAAI,WAAW,EAAE,CAAC;AAC9B,GAAG,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IAC1B,OAAO,CAAC,KAAK,CAAC,8BAA8B,EAAE,KAAK,CAAC,CAAC;IACrD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "streamer-node",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.37",
|
|
4
4
|
"description": "A lightweight TypeScript streaming system with Clean Architecture",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"LICENSE"
|
|
14
14
|
],
|
|
15
15
|
"scripts": {
|
|
16
|
-
"build": "npx tsc && mkdir -p public && cp -r public dist/",
|
|
16
|
+
"build": "npx tsc && mkdir -p public && cp -r public dist/ && cp -r scripts dist/",
|
|
17
17
|
"start": "node dist/src/main.js",
|
|
18
18
|
"dev": "npm run build && npm start",
|
|
19
19
|
"monitor": "bash -c 'npm run dev 2>&1 | tee >(grep -E \"ERROR|WARN|INFO\" > node.logs) >(grep \"DEBUG\" | grep -v \"frame=\" > ffmpeg.logs)'",
|
|
@@ -49,6 +49,10 @@
|
|
|
49
49
|
"dotenv": "^16.3.1",
|
|
50
50
|
"pngjs": "^7.0.0"
|
|
51
51
|
},
|
|
52
|
+
"optionalDependencies": {
|
|
53
|
+
"@serialport/parser-readline": "^12.0.0",
|
|
54
|
+
"serialport": "^12.0.0"
|
|
55
|
+
},
|
|
52
56
|
"devDependencies": {
|
|
53
57
|
"@types/node": "^20.0.0",
|
|
54
58
|
"@types/pngjs": "^6.0.5",
|