@norskvideo/norsk-studio-built-ins 1.27.0-2025-07-09-1c530503 → 1.27.0-2025-07-10-5b6e3f99

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.
@@ -0,0 +1,227 @@
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.FileInput = void 0;
7
+ const runtime_types_1 = require("@norskvideo/norsk-studio/lib/extension/runtime-types");
8
+ const logging_1 = require("@norskvideo/norsk-studio/lib/server/logging");
9
+ const util_1 = require("@norskvideo/norsk-studio/lib/shared/util");
10
+ const path_1 = __importDefault(require("path"));
11
+ const schemas_1 = require("../shared/schemas");
12
+ const api_1 = require("@norskvideo/norsk-studio/lib/server/api");
13
+ const info_1 = require("./info");
14
+ class FileInput {
15
+ id;
16
+ relatedMediaNodes = new runtime_types_1.RelatedMediaNodes();
17
+ norsk;
18
+ cfg;
19
+ currentNode;
20
+ initialised;
21
+ updates;
22
+ static async create(norsk, cfg, updates) {
23
+ const node = new FileInput(norsk, cfg, updates);
24
+ await node.initialised;
25
+ return node;
26
+ }
27
+ constructor(norsk, cfg, updates) {
28
+ this.cfg = cfg;
29
+ this.id = cfg.id;
30
+ this.norsk = norsk;
31
+ this.updates = updates;
32
+ this.initialised = this.initialise();
33
+ }
34
+ async initialise() {
35
+ await this.relatedMediaNodes.setup(this.norsk, this, this.cfg.streamMappings ?? (0, info_1.defaultStreamMapping)(this.cfg));
36
+ if (this.cfg.initialFilename) {
37
+ try {
38
+ await this.play(this.cfg.initialFilename, this.cfg.initialLoop ?? false);
39
+ }
40
+ catch (error) {
41
+ (0, logging_1.errorlog)('Failed to auto-start file playback:', error);
42
+ this.updates.raiseEvent({
43
+ type: 'playback-error',
44
+ error: `Failed to auto-start: ${error instanceof Error ? error.message : String(error)}`,
45
+ filePath: this.cfg.initialFilename
46
+ });
47
+ }
48
+ }
49
+ }
50
+ async play(filePath, loop = false) {
51
+ const currentState = this.updates.latest();
52
+ if (currentState.status === 'playing') {
53
+ throw new Error('Already playing a file');
54
+ }
55
+ const ext = path_1.default.extname(filePath).toLowerCase();
56
+ this.updates.raiseEvent({
57
+ type: 'playback-started',
58
+ filePath,
59
+ isLooping: loop
60
+ });
61
+ try {
62
+ if (ext === '.mp4') {
63
+ this.currentNode = await this.norsk.input.fileMp4({
64
+ id: `${this.cfg.id}-file`,
65
+ sourceName: this.cfg.sourceName,
66
+ fileName: filePath,
67
+ loop,
68
+ onClose: () => {
69
+ (0, logging_1.debuglog)('File playback completed');
70
+ this.currentNode = undefined;
71
+ if (!loop) {
72
+ this.cleanup().then(() => {
73
+ this.updates.raiseEvent({
74
+ type: 'playback-completed',
75
+ filePath: this.updates.latest().currentFile || ''
76
+ });
77
+ }).catch(error => {
78
+ (0, logging_1.errorlog)('Error during cleanup:', error);
79
+ });
80
+ }
81
+ }
82
+ });
83
+ }
84
+ else if (ext === '.ts') {
85
+ this.currentNode = await this.norsk.input.fileTs({
86
+ id: `${this.cfg.id}-file`,
87
+ sourceName: this.cfg.sourceName,
88
+ fileName: filePath,
89
+ loop,
90
+ onClose: () => {
91
+ (0, logging_1.debuglog)('TS file playback completed');
92
+ this.currentNode = undefined;
93
+ if (!loop) {
94
+ this.cleanup().then(() => {
95
+ this.updates.raiseEvent({
96
+ type: 'playback-completed',
97
+ filePath: this.updates.latest().currentFile || ''
98
+ });
99
+ }).catch(error => {
100
+ (0, logging_1.errorlog)('Error during cleanup:', error);
101
+ });
102
+ }
103
+ }
104
+ });
105
+ }
106
+ else {
107
+ throw new Error(`Unsupported file type: ${ext}`);
108
+ }
109
+ this.relatedMediaNodes.addOutput(this.currentNode);
110
+ (0, logging_1.infolog)(`Started playing file: ${filePath}`);
111
+ }
112
+ catch (error) {
113
+ (0, logging_1.errorlog)(`Failed to create file input for ${filePath}:`, error);
114
+ this.updates.raiseEvent({
115
+ type: 'playback-error',
116
+ error: `Failed to create file input: ${error instanceof Error ? error.message : String(error)}`,
117
+ filePath
118
+ });
119
+ throw error;
120
+ }
121
+ }
122
+ async stop() {
123
+ const currentState = this.updates.latest();
124
+ if (currentState.status !== 'playing') {
125
+ return;
126
+ }
127
+ (0, logging_1.debuglog)('Stopping file playback');
128
+ await this.cleanup();
129
+ this.updates.raiseEvent({
130
+ type: 'playback-stopped'
131
+ });
132
+ }
133
+ async cleanup() {
134
+ if (this.currentNode) {
135
+ try {
136
+ await this.currentNode.close();
137
+ this.currentNode = undefined;
138
+ }
139
+ catch (error) {
140
+ (0, logging_1.errorlog)('Error closing file input node:', error);
141
+ }
142
+ this.currentNode = undefined;
143
+ }
144
+ (0, logging_1.debuglog)('File input cleanup completed');
145
+ }
146
+ async close() {
147
+ await this.cleanup();
148
+ }
149
+ }
150
+ exports.FileInput = FileInput;
151
+ class FileInputDefinition {
152
+ async create(norsk, cfg, cb, runtime) {
153
+ const node = await FileInput.create(norsk, cfg, runtime.updates);
154
+ cb(node);
155
+ }
156
+ async handleCommand(node, command) {
157
+ const commandType = command.type;
158
+ switch (commandType) {
159
+ case 'play':
160
+ await node.play(command.filePath, command.loop);
161
+ break;
162
+ case 'stop':
163
+ await node.stop();
164
+ break;
165
+ default:
166
+ (0, util_1.assertUnreachable)(commandType);
167
+ }
168
+ }
169
+ async schemas() {
170
+ return (0, schemas_1.schemaFromTypes)(path_1.default.join(__dirname, 'types.yaml'), {
171
+ config: 'Config',
172
+ state: 'State'
173
+ });
174
+ }
175
+ async instanceRoutes() {
176
+ return (0, api_1.defineApi)(path_1.default.join(__dirname, 'types.yaml'), {
177
+ '/play': {
178
+ post: ({ runtime }) => async (req, res) => {
179
+ try {
180
+ const { filePath, loop = false } = req.body;
181
+ if (!filePath) {
182
+ return res.status(400).json({ error: 'filePath is required' });
183
+ }
184
+ runtime.updates.sendCommand({
185
+ type: 'play',
186
+ filePath,
187
+ loop
188
+ });
189
+ res.json({ status: 'playing', filePath });
190
+ }
191
+ catch (error) {
192
+ (0, logging_1.errorlog)('Error in play handler:', error);
193
+ res.status(500).json({ error: 'Failed to start playback' });
194
+ }
195
+ }
196
+ },
197
+ '/stop': {
198
+ post: ({ runtime }) => async (req, res) => {
199
+ try {
200
+ runtime.updates.sendCommand({
201
+ type: 'stop'
202
+ });
203
+ res.json({ status: 'stopped' });
204
+ }
205
+ catch (error) {
206
+ (0, logging_1.errorlog)('Error in stop handler:', error);
207
+ res.status(500).json({ error: 'Failed to stop playback' });
208
+ }
209
+ }
210
+ },
211
+ '/status': {
212
+ get: ({ runtime }) => async (req, res) => {
213
+ try {
214
+ const state = runtime.updates.latest();
215
+ res.json(state);
216
+ }
217
+ catch (error) {
218
+ (0, logging_1.errorlog)('Error in status handler:', error);
219
+ res.status(500).json({ error: 'Failed to get status' });
220
+ }
221
+ }
222
+ }
223
+ });
224
+ }
225
+ }
226
+ exports.default = FileInputDefinition;
227
+ //# sourceMappingURL=runtime.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime.js","sourceRoot":"","sources":["../../src/input.file/runtime.ts"],"names":[],"mappings":";;;;;;AACA,wFAAmM;AACnM,yEAA0F;AAC1F,mEAA6E;AAC7E,gDAAwB;AAExB,+CAAoD;AACpD,iEAAoE;AACpE,iCAA8C;AAU9C,MAAa,SAAS;IACpB,EAAE,CAAS;IACX,iBAAiB,GAAsB,IAAI,iCAAiB,EAAE,CAAC;IAE/D,KAAK,CAAQ;IACb,GAAG,CAAoB;IAEvB,WAAW,CAAsC;IAEjD,WAAW,CAAgB;IAE3B,OAAO,CAAmE;IAE1E,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,KAAY,EAAE,GAAsB,EAAE,OAAyE;QACjI,MAAM,IAAI,GAAG,IAAI,SAAS,CAAC,KAAK,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;QAChD,MAAM,IAAI,CAAC,WAAW,CAAC;QACvB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,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A,kBAAQ,EAAC,0BAA0B,EAAE,KAAK,CAAC,CAAC;wBAC5C,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,sBAAsB,EAAE,CAAC,CAAC;oBAC1D,CAAC;gBACH,CAAC;aACF;SACF,CAAC,CAAC;IACP,CAAC;CACF;AAjFD,sCAiFC"}
@@ -0,0 +1,243 @@
1
+ export interface paths {
2
+ "/play": {
3
+ parameters: {
4
+ query?: never;
5
+ header?: never;
6
+ path?: never;
7
+ cookie?: never;
8
+ };
9
+ get?: never;
10
+ put?: never;
11
+ post: {
12
+ parameters: {
13
+ query?: never;
14
+ header?: never;
15
+ path?: never;
16
+ cookie?: never;
17
+ };
18
+ requestBody?: {
19
+ content: {
20
+ "application/json": {
21
+ filePath: string;
22
+ loop?: boolean;
23
+ };
24
+ };
25
+ };
26
+ responses: {
27
+ 200: {
28
+ headers: {
29
+ [name: string]: unknown;
30
+ };
31
+ content: {
32
+ "application/json": {
33
+ status?: "playing";
34
+ filePath?: string;
35
+ };
36
+ };
37
+ };
38
+ 400: {
39
+ headers: {
40
+ [name: string]: unknown;
41
+ };
42
+ content: {
43
+ "application/json": {
44
+ error?: string;
45
+ };
46
+ };
47
+ };
48
+ 500: {
49
+ headers: {
50
+ [name: string]: unknown;
51
+ };
52
+ content: {
53
+ "application/json": {
54
+ error?: string;
55
+ };
56
+ };
57
+ };
58
+ };
59
+ };
60
+ delete?: never;
61
+ options?: never;
62
+ head?: never;
63
+ patch?: never;
64
+ trace?: never;
65
+ };
66
+ "/stop": {
67
+ parameters: {
68
+ query?: never;
69
+ header?: never;
70
+ path?: never;
71
+ cookie?: never;
72
+ };
73
+ get?: never;
74
+ put?: never;
75
+ post: {
76
+ parameters: {
77
+ query?: never;
78
+ header?: never;
79
+ path?: never;
80
+ cookie?: never;
81
+ };
82
+ requestBody?: never;
83
+ responses: {
84
+ 200: {
85
+ headers: {
86
+ [name: string]: unknown;
87
+ };
88
+ content: {
89
+ "application/json": {
90
+ status?: "stopped";
91
+ };
92
+ };
93
+ };
94
+ 500: {
95
+ headers: {
96
+ [name: string]: unknown;
97
+ };
98
+ content: {
99
+ "application/json": {
100
+ error?: string;
101
+ };
102
+ };
103
+ };
104
+ };
105
+ };
106
+ delete?: never;
107
+ options?: never;
108
+ head?: never;
109
+ patch?: never;
110
+ trace?: never;
111
+ };
112
+ "/status": {
113
+ parameters: {
114
+ query?: never;
115
+ header?: never;
116
+ path?: never;
117
+ cookie?: never;
118
+ };
119
+ get: {
120
+ parameters: {
121
+ query?: never;
122
+ header?: never;
123
+ path?: never;
124
+ cookie?: never;
125
+ };
126
+ requestBody?: never;
127
+ responses: {
128
+ 200: {
129
+ headers: {
130
+ [name: string]: unknown;
131
+ };
132
+ content: {
133
+ "application/json": {
134
+ status: "idle" | "playing" | "error";
135
+ currentFile: string | null;
136
+ isLooping: boolean;
137
+ error: string | null;
138
+ };
139
+ };
140
+ };
141
+ };
142
+ };
143
+ put?: never;
144
+ post?: never;
145
+ delete?: never;
146
+ options?: never;
147
+ head?: never;
148
+ patch?: never;
149
+ trace?: never;
150
+ };
151
+ }
152
+ export type webhooks = Record<string, never>;
153
+ export interface components {
154
+ schemas: {
155
+ Config: {
156
+ id: string;
157
+ displayName: string;
158
+ notes?: string;
159
+ sourceName: string;
160
+ initialFilename?: string;
161
+ initialLoop?: boolean;
162
+ streamMappings?: {
163
+ streams: {
164
+ outputKey: {
165
+ streamId: number;
166
+ programNumber: number;
167
+ sourceName: string;
168
+ renditionName: string;
169
+ };
170
+ displayName?: string;
171
+ media: "video" | "audio" | "subtitle" | "ancillary" | "playlist";
172
+ filters?: ({
173
+ type: "sourceName" | "language" | "codec" | "renditionName";
174
+ value: string;
175
+ } | {
176
+ type: "streamId" | "programNumber";
177
+ value: number;
178
+ })[];
179
+ missingBehaviour?: "fill" | "skip";
180
+ }[];
181
+ };
182
+ };
183
+ State: {
184
+ status: "idle" | "playing" | "error";
185
+ currentFile: string | null;
186
+ isLooping: boolean;
187
+ error: string | null;
188
+ };
189
+ Commands: {
190
+ type: "play";
191
+ filePath: string;
192
+ loop?: boolean;
193
+ } | {
194
+ type: "stop";
195
+ };
196
+ PlayCommand: {
197
+ type: "play";
198
+ filePath: string;
199
+ loop?: boolean;
200
+ };
201
+ StopCommand: {
202
+ type: "stop";
203
+ };
204
+ Events: {
205
+ type: "playback-started";
206
+ filePath: string;
207
+ isLooping: boolean;
208
+ } | {
209
+ type: "playback-completed";
210
+ filePath: string;
211
+ } | {
212
+ type: "playback-stopped";
213
+ } | {
214
+ type: "playback-error";
215
+ error: string;
216
+ filePath?: string | null;
217
+ };
218
+ PlaybackStartedEvent: {
219
+ type: "playback-started";
220
+ filePath: string;
221
+ isLooping: boolean;
222
+ };
223
+ PlaybackCompletedEvent: {
224
+ type: "playback-completed";
225
+ filePath: string;
226
+ };
227
+ PlaybackStoppedEvent: {
228
+ type: "playback-stopped";
229
+ };
230
+ PlaybackErrorEvent: {
231
+ type: "playback-error";
232
+ error: string;
233
+ filePath?: string | null;
234
+ };
235
+ };
236
+ responses: never;
237
+ parameters: never;
238
+ requestBodies: never;
239
+ headers: never;
240
+ pathItems: never;
241
+ }
242
+ export type $defs = Record<string, never>;
243
+ export type operations = Record<string, never>;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/input.file/types.ts"],"names":[],"mappings":""}