@norskvideo/norsk-studio-built-ins 1.27.0-2025-04-05-fad1c39a → 1.27.0-2025-04-07-8f68de69

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.
Files changed (82) hide show
  1. package/client/info.js +6824 -1190
  2. package/lib/info.js +29 -21
  3. package/lib/info.js.map +1 -1
  4. package/lib/output.autoCmaf/info.js +4 -132
  5. package/lib/output.autoCmaf/info.js.map +1 -1
  6. package/lib/output.autoCmaf/runtime.js +4 -54
  7. package/lib/output.autoCmaf/runtime.js.map +1 -1
  8. package/lib/output.autoCmaf/types.d.ts +31 -31
  9. package/lib/output.autoCmaf/types.yaml +4 -85
  10. package/lib/output.cmafMultiVariant/info.d.ts +15 -0
  11. package/lib/output.cmafMultiVariant/info.js +91 -0
  12. package/lib/output.cmafMultiVariant/info.js.map +1 -0
  13. package/lib/output.cmafMultiVariant/runtime.d.ts +37 -0
  14. package/lib/output.cmafMultiVariant/runtime.js +158 -0
  15. package/lib/output.cmafMultiVariant/runtime.js.map +1 -0
  16. package/lib/output.cmafMultiVariant/types.d.ts +130 -0
  17. package/lib/output.cmafMultiVariant/types.js +3 -0
  18. package/lib/output.cmafMultiVariant/types.js.map +1 -0
  19. package/lib/output.cmafMultiVariant/types.yaml +74 -0
  20. package/lib/output.cmafPlaylist/info.d.ts +22 -0
  21. package/lib/output.cmafPlaylist/info.js +114 -0
  22. package/lib/output.cmafPlaylist/info.js.map +1 -0
  23. package/lib/output.cmafPlaylist/runtime.d.ts +41 -0
  24. package/lib/output.cmafPlaylist/runtime.js +239 -0
  25. package/lib/output.cmafPlaylist/runtime.js.map +1 -0
  26. package/lib/output.cmafPlaylist/types.d.ts +155 -0
  27. package/lib/output.cmafPlaylist/types.js +3 -0
  28. package/lib/output.cmafPlaylist/types.js.map +1 -0
  29. package/lib/output.cmafPlaylist/types.yaml +90 -0
  30. package/lib/output.tsMediaPlaylist/info.d.ts +22 -0
  31. package/lib/output.tsMediaPlaylist/info.js +113 -0
  32. package/lib/output.tsMediaPlaylist/info.js.map +1 -0
  33. package/lib/output.tsMediaPlaylist/runtime.d.ts +41 -0
  34. package/lib/output.tsMediaPlaylist/runtime.js +225 -0
  35. package/lib/output.tsMediaPlaylist/runtime.js.map +1 -0
  36. package/lib/output.tsMediaPlaylist/types.d.ts +155 -0
  37. package/lib/output.tsMediaPlaylist/types.js +3 -0
  38. package/lib/output.tsMediaPlaylist/types.js.map +1 -0
  39. package/lib/output.tsMediaPlaylist/types.yaml +90 -0
  40. package/lib/output.tsMultiVariant/info.d.ts +15 -0
  41. package/lib/output.tsMultiVariant/info.js +91 -0
  42. package/lib/output.tsMultiVariant/info.js.map +1 -0
  43. package/lib/output.tsMultiVariant/runtime.d.ts +37 -0
  44. package/lib/output.tsMultiVariant/runtime.js +157 -0
  45. package/lib/output.tsMultiVariant/runtime.js.map +1 -0
  46. package/lib/output.tsMultiVariant/types.d.ts +130 -0
  47. package/lib/output.tsMultiVariant/types.js +3 -0
  48. package/lib/output.tsMultiVariant/types.js.map +1 -0
  49. package/lib/output.tsMultiVariant/types.yaml +74 -0
  50. package/lib/processor.fixedLadder/info.d.ts +3 -3
  51. package/lib/processor.fixedLadder/info.js +1159 -73
  52. package/lib/processor.fixedLadder/info.js.map +1 -1
  53. package/lib/processor.fixedLadder/nvidia-rate-control-view.d.ts +4 -0
  54. package/lib/processor.fixedLadder/nvidia-rate-control-view.js +20 -0
  55. package/lib/processor.fixedLadder/nvidia-rate-control-view.js.map +1 -0
  56. package/lib/processor.fixedLadder/nvidia-view.d.ts +5 -0
  57. package/lib/processor.fixedLadder/nvidia-view.js +20 -0
  58. package/lib/processor.fixedLadder/nvidia-view.js.map +1 -0
  59. package/lib/processor.fixedLadder/quadra-view.d.ts +6 -0
  60. package/lib/processor.fixedLadder/quadra-view.js +22 -0
  61. package/lib/processor.fixedLadder/quadra-view.js.map +1 -0
  62. package/lib/processor.fixedLadder/runtime.js.map +1 -1
  63. package/lib/processor.fixedLadder/software-view.d.ts +5 -0
  64. package/lib/processor.fixedLadder/software-view.js +20 -0
  65. package/lib/processor.fixedLadder/software-view.js.map +1 -0
  66. package/lib/processor.fixedLadder/types.d.ts +108 -20
  67. package/lib/processor.fixedLadder/types.yaml +241 -34
  68. package/lib/processor.fixedLadder/x26x-bitrate-view.d.ts +4 -0
  69. package/lib/processor.fixedLadder/x26x-bitrate-view.js +20 -0
  70. package/lib/processor.fixedLadder/x26x-bitrate-view.js.map +1 -0
  71. package/lib/shared/cmaf.d.ts +17 -0
  72. package/lib/shared/cmaf.js +198 -0
  73. package/lib/shared/cmaf.js.map +1 -0
  74. package/lib/{output.autoCmaf/form-views.d.ts → shared/playlist-form-views.d.ts} +1 -1
  75. package/lib/{output.autoCmaf/form-views.js → shared/playlist-form-views.js} +1 -1
  76. package/lib/shared/playlist-form-views.js.map +1 -0
  77. package/lib/shared/types.d.ts +158 -0
  78. package/lib/shared/types.js +3 -0
  79. package/lib/shared/types.js.map +1 -0
  80. package/lib/shared/types.yaml +182 -0
  81. package/package.json +3 -3
  82. package/lib/output.autoCmaf/form-views.js.map +0 -1
@@ -0,0 +1,113 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = default_1;
4
+ const util_1 = require("@norskvideo/norsk-studio/lib/shared/util");
5
+ const FaHeadphones_1 = require("@react-icons/all-files/fa/FaHeadphones");
6
+ const cmaf_1 = require("../shared/cmaf");
7
+ function default_1(registration) {
8
+ const { defineComponent, validation, } = registration;
9
+ const { Z } = validation;
10
+ return defineComponent({
11
+ identifier: 'output.tsMediaPlaylist',
12
+ category: 'output',
13
+ name: "TS Media Playlist",
14
+ description: "This component creates, and optionally publishes, a HLS/TS media playlist for a single stream",
15
+ icon: FaHeadphones_1.FaHeadphones,
16
+ subscription: {
17
+ accepts: {
18
+ type: "simple-stream",
19
+ audio: true,
20
+ video: true,
21
+ ancillary: true,
22
+ makeProgram: false
23
+ },
24
+ produces: {
25
+ type: 'simple-stream',
26
+ playlist: true
27
+ }
28
+ },
29
+ extraValidation: (ctx) => {
30
+ const allStreams = ctx.subscriptions.flatMap((s) => s.expectedStreams);
31
+ const mediaStreams = allStreams.filter((a) => a.media == 'audio' || a.media == 'video');
32
+ if (mediaStreams.length > 1) {
33
+ ctx.addError("HLS/TS playlist cannot accept more than one media stream");
34
+ }
35
+ },
36
+ display: (desc) => {
37
+ return {
38
+ name: desc.config.name
39
+ };
40
+ },
41
+ runtime: {
42
+ initialState: () => ({
43
+ enabled: true
44
+ }),
45
+ handleEvent(ev, state) {
46
+ const evType = ev.type;
47
+ switch (evType) {
48
+ case 'output-enabled':
49
+ state.enabled = true;
50
+ break;
51
+ case 'output-disabled':
52
+ state.enabled = false;
53
+ break;
54
+ default:
55
+ (0, util_1.assertUnreachable)(evType);
56
+ }
57
+ return { ...state };
58
+ },
59
+ },
60
+ configForm: {
61
+ form: {
62
+ name: {
63
+ help: "The name of the playlist",
64
+ advanced: true,
65
+ hint: {
66
+ type: 'text', optional: true, validation: Z.string().min(1).max(15).optional()
67
+ }
68
+ },
69
+ sessionId: {
70
+ help: "Generate a unique session id per run to avoid cache collisions",
71
+ hint: {
72
+ type: 'boolean',
73
+ defaultValue: false
74
+ }
75
+ },
76
+ publishingGroup: {
77
+ help: "Each playlist will be published within a 'group', change this if you need multiple playlists for the same stream",
78
+ advanced: true,
79
+ hint: {
80
+ type: 'text',
81
+ optional: true
82
+ }
83
+ },
84
+ segments: cmaf_1.SegmentFormEntry,
85
+ destinations: cmaf_1.DestinationsFormEntry,
86
+ initialState: {
87
+ help: "The publishing state of this endpoint by default on start-up",
88
+ advanced: true,
89
+ hint: {
90
+ type: 'select',
91
+ defaultValue: 'enabled',
92
+ envOverride: true,
93
+ options: [
94
+ {
95
+ display: "Enabled",
96
+ value: 'enabled',
97
+ },
98
+ {
99
+ display: "Disabled",
100
+ value: 'disabled',
101
+ },
102
+ ],
103
+ },
104
+ },
105
+ notes: {
106
+ help: "Additional notes about this component",
107
+ hint: { type: 'text', optional: true }
108
+ },
109
+ }
110
+ }
111
+ });
112
+ }
113
+ //# sourceMappingURL=info.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"info.js","sourceRoot":"","sources":["../../src/output.tsMediaPlaylist/info.ts"],"names":[],"mappings":";;AAMA,4BA6GC;AAjHD,mEAA6E;AAC7E,yEAAsE;AACtE,yCAAyE;AAEzE,mBAAwB,YAA0B;IAChD,MAAM,EACJ,eAAe,EACf,UAAU,GACX,GAAG,YAAY,CAAC;IACjB,MAAM,EAAE,CAAC,EAAE,GAAG,UAAU,CAAC;IAEzB,OAAO,eAAe,CAAsF;QAC1G,UAAU,EAAE,wBAAwB;QACpC,QAAQ,EAAE,QAAQ;QAClB,IAAI,EAAE,mBAAmB;QACzB,WAAW,EAAE,+FAA+F;QAC5G,IAAI,EAAE,2BAAY;QAClB,YAAY,EAAE;YACZ,OAAO,EAAE;gBACP,IAAI,EAAE,eAAe;gBACrB,KAAK,EAAE,IAAI;gBACX,KAAK,EAAE,IAAI;gBACX,SAAS,EAAE,IAAI;gBACf,WAAW,EAAE,KAAK;aACnB;YACD,QAAQ,EAAE;gBACR,IAAI,EAAE,eAAe;gBACrB,QAAQ,EAAE,IAAI;aACf;SACF;QACD,eAAe,EAAE,CAAC,GAAG,EAAE,EAAE;YACvB,MAAM,UAAU,GAAG,GAAG,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,eAAe,CAAC,CAAA;YACtE,MAAM,YAAY,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,IAAI,OAAO,IAAI,CAAC,CAAC,KAAK,IAAI,OAAO,CAAC,CAAA;YACvF,IAAI,YAAY,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBAC5B,GAAG,CAAC,QAAQ,CAAC,0DAA0D,CAAC,CAAC;YAC3E,CAAC;QACH,CAAC;QACD,OAAO,E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,EAAE,4BAAqB;gBACnC,YAAY,EAAE;oBACZ,IAAI,EAAE,8DAA8D;oBACpE,QAAQ,EAAE,IAAI;oBACd,IAAI,EAAE;wBACJ,IAAI,EAAE,QAAQ;wBACd,YAAY,EAAE,SAAS;wBACvB,WAAW,EAAE,IAAI;wBACjB,OAAO,EAAE;4BACP;gCACE,OAAO,EAAE,SAAS;gCAClB,KAAK,EAAE,SAAS;6BACjB;4BACD;gCACE,OAAO,EAAE,UAAU;gCACnB,KAAK,EAAE,UAAU;6BAClB;yBACF;qBACF;iBACF;gBACD,KAAK,EAAE;oBACL,IAAI,EAAE,uCAAuC;oBAC7C,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE;iBACvC;aACF;SACF;KACF,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,41 @@
1
+ import { AncillaryNode, HlsTsAudioOutputNode, CmafDestinationSettings, HlsTsVideoOutputNode, Norsk } from '@norskvideo/norsk-sdk';
2
+ import { InstanceRouteInfo, OnCreated, ServerComponentDefinition, StudioRuntime, StudioComponentInputStream, ServerComponentSchemas } from '@norskvideo/norsk-studio/lib/extension/runtime-types';
3
+ import { CustomAutoDuplexNode } from '@norskvideo/norsk-studio/lib/extension/base-nodes';
4
+ import { CryptoDetails } from '../shared/drm/cpix';
5
+ import { components } from './types';
6
+ export type HlsTsPlaylistSettings = components['schemas']['HlsTsConfig'];
7
+ export type HlsTsPlaylistState = components['schemas']['HlsTsOutputState'];
8
+ export type HlsTsPlaylistCommand = {
9
+ type: 'enable-output' | 'disable-output';
10
+ };
11
+ export type HlsTsPlaylistEvent = {
12
+ type: 'output-enabled' | 'output-disabled';
13
+ };
14
+ declare class HlsTsPlaylist extends CustomAutoDuplexNode {
15
+ norsk: Norsk;
16
+ cfg: HlsTsPlaylistSettings;
17
+ outputNode: HlsTsVideoOutputNode | HlsTsAudioOutputNode | null;
18
+ ancillary: AncillaryNode | null;
19
+ enabled: boolean;
20
+ initialised: Promise<void>;
21
+ runtime: StudioRuntime<HlsTsPlaylistState, HlsTsPlaylistCommand, HlsTsPlaylistEvent>;
22
+ currentSources: StudioComponentInputStream[];
23
+ destinations: CmafDestinationSettings[];
24
+ advertDestinations: string[];
25
+ sessionId?: string;
26
+ crypto?: CryptoDetails;
27
+ static create(norsk: Norsk, cfg: HlsTsPlaylistSettings, runtime: StudioRuntime<HlsTsPlaylistState, HlsTsPlaylistCommand, HlsTsPlaylistEvent>): Promise<HlsTsPlaylist>;
28
+ constructor(cfg: HlsTsPlaylistSettings, norsk: Norsk, runtime: StudioRuntime<HlsTsPlaylistState, HlsTsPlaylistCommand, HlsTsPlaylistEvent>);
29
+ initialise(): Promise<void>;
30
+ enableOutput(): Promise<void>;
31
+ disableOutput(): Promise<void>;
32
+ subscribe(sources: StudioComponentInputStream[]): Promise<void>;
33
+ subscribeImpl(sources: StudioComponentInputStream[]): Promise<void>;
34
+ }
35
+ export default class HlsTsPlaylistDefinition implements ServerComponentDefinition<HlsTsPlaylistSettings, HlsTsPlaylist, HlsTsPlaylistState, HlsTsPlaylistCommand, HlsTsPlaylistEvent> {
36
+ create(norsk: Norsk, cfg: HlsTsPlaylistSettings, cb: OnCreated<HlsTsPlaylist>, runtime: StudioRuntime<HlsTsPlaylistState, HlsTsPlaylistCommand, HlsTsPlaylistEvent>): Promise<void>;
37
+ handleCommand(node: HlsTsPlaylist, command: HlsTsPlaylistCommand): Promise<void>;
38
+ instanceRoutes(): Promise<InstanceRouteInfo<HlsTsPlaylistSettings, HlsTsPlaylist, HlsTsPlaylistState, HlsTsPlaylistCommand, HlsTsPlaylistEvent>[]>;
39
+ schemas(): Promise<ServerComponentSchemas>;
40
+ }
41
+ export {};
@@ -0,0 +1,225 @@
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
+ const base_nodes_1 = require("@norskvideo/norsk-studio/lib/extension/base-nodes");
7
+ const logging_1 = require("@norskvideo/norsk-studio/lib/server/logging");
8
+ const ezdrm_1 = require("../shared/drm/ezdrm");
9
+ const axinom_1 = require("../shared/drm/axinom");
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 cmaf_1 = require("../shared/cmaf");
14
+ class HlsTsPlaylist extends base_nodes_1.CustomAutoDuplexNode {
15
+ norsk;
16
+ cfg;
17
+ outputNode = null;
18
+ ancillary = null;
19
+ enabled = true;
20
+ initialised;
21
+ runtime;
22
+ currentSources = [];
23
+ destinations;
24
+ advertDestinations = [];
25
+ sessionId;
26
+ crypto;
27
+ static async create(norsk, cfg, runtime) {
28
+ const node = new HlsTsPlaylist(cfg, norsk, runtime);
29
+ await node.initialised;
30
+ return node;
31
+ }
32
+ constructor(cfg, norsk, runtime) {
33
+ super(cfg.id);
34
+ this.cfg = cfg;
35
+ this.id = cfg.id;
36
+ this.norsk = norsk;
37
+ this.runtime = runtime;
38
+ this.enabled = cfg.initialState == 'enabled';
39
+ if (!this.enabled) {
40
+ runtime.updates.raiseEvent({ type: 'output-disabled' });
41
+ }
42
+ if (this.cfg.sessionId) {
43
+ this.sessionId = (Math.random() + 1).toString(36).substring(7);
44
+ }
45
+ const r = (0, cmaf_1.reifyDestinations)({ publishingGroup: cfg.publishingGroup ?? "hls", destinations: cfg.destinations, segments: cfg.segments, sessionId: this.sessionId });
46
+ this.destinations = r.destinations;
47
+ this.advertDestinations = r.advertDestinations;
48
+ this.initialised = this.initialise();
49
+ }
50
+ async initialise() {
51
+ if (this.cfg.drmProvider) {
52
+ if (this.cfg.drmProvider === 'ezdrm') {
53
+ this.crypto = await (0, ezdrm_1.ezdrmInit)(this.cfg.__global?.ezdrmConfig);
54
+ }
55
+ if (this.cfg.drmProvider === 'axinom') {
56
+ this.crypto = await (0, axinom_1.axinomInit)(this.cfg.__global?.axinomConfig);
57
+ }
58
+ }
59
+ }
60
+ async enableOutput() {
61
+ if (!this.enabled) {
62
+ this.enabled = true;
63
+ this.runtime.updates.raiseEvent({ type: 'output-enabled' });
64
+ await this.subscribeImpl(this.currentSources);
65
+ (0, logging_1.debuglog)("Output enabled", { id: this.id });
66
+ }
67
+ }
68
+ async disableOutput() {
69
+ if (this.enabled) {
70
+ this.enabled = false;
71
+ if (this.outputNode) {
72
+ await this.outputNode.close();
73
+ this.outputNode = null;
74
+ }
75
+ this.runtime.updates.raiseEvent({
76
+ type: 'output-disabled'
77
+ });
78
+ (0, logging_1.debuglog)("Output disabled", { id: this.id });
79
+ }
80
+ }
81
+ async subscribe(sources) {
82
+ this.currentSources = sources;
83
+ await this.subscribeImpl(this.currentSources);
84
+ }
85
+ async subscribeImpl(sources) {
86
+ if (!this.enabled || sources.filter((s) => s.metadata).length == 0) {
87
+ (0, logging_1.debuglog)("Skipping context handling - output disabled", { id: this.id });
88
+ await this.outputNode?.close();
89
+ this.outputNode = null;
90
+ return;
91
+ }
92
+ const videoSource = sources.find((s) => s.isMedia("video"));
93
+ const audioSource = sources.find((s) => s.isMedia("audio"));
94
+ const ancillarySource = sources.find((s) => s.isMedia("ancillary"));
95
+ if (!this.outputNode) {
96
+ if (videoSource) {
97
+ const videoCryptoSettings = this.crypto ? {
98
+ encryption: this.crypto.video,
99
+ m3uAdditions: this.crypto.video.mediaSignaling,
100
+ mpdAdditions: this.crypto.video.dashSignalling,
101
+ } : {};
102
+ this.outputNode = await this.norsk.output.hlsTsVideo({
103
+ id: `${this.id}-cmaf`,
104
+ name: this.cfg.name ? this.cfg.name : this.id,
105
+ segmentDurationSeconds: this.cfg.segments.targetSegmentDuration,
106
+ destinations: this.destinations,
107
+ ...videoCryptoSettings,
108
+ });
109
+ this.outputNode.subscribe([videoSource.select()]);
110
+ this.setup({ input: this.outputNode, output: [this.outputNode] });
111
+ this.runtime.report.registerOutput(this.outputNode.id, await this.outputNode.url());
112
+ }
113
+ else if (audioSource) {
114
+ const audioCryptoSettings = this.crypto ? {
115
+ encryption: this.crypto.audio,
116
+ m3uAdditions: this.crypto.audio.mediaSignaling,
117
+ mpdAdditions: this.crypto.audio.dashSignalling,
118
+ } : {};
119
+ this.outputNode = await this.norsk.output.hlsTsAudio({
120
+ id: `${this.id}-cmaf`,
121
+ name: this.cfg.name ? this.cfg.name : this.id,
122
+ segmentDurationSeconds: this.cfg.segments.targetSegmentDuration,
123
+ destinations: this.destinations,
124
+ ...audioCryptoSettings,
125
+ });
126
+ this.outputNode.subscribe([audioSource.select()]);
127
+ this.setup({ input: this.outputNode, output: [this.outputNode] });
128
+ this.runtime.report.registerOutput(this.outputNode.id, await this.outputNode.url());
129
+ }
130
+ if (ancillarySource && !this.ancillary) {
131
+ this.ancillary = await this.norsk.processor.transform.ancillary({
132
+ onScte35: (_stream, message) => {
133
+ const commandType = message.spliceCommand.type;
134
+ if (commandType != 'insert')
135
+ return;
136
+ const command = message.spliceCommand.value;
137
+ message.spliceCommand.value;
138
+ const adId = Math.random().toString().slice(-5);
139
+ const schedule = new Date();
140
+ schedule.setSeconds(schedule.getSeconds() + 8);
141
+ const now = new Date();
142
+ for (const d of this.advertDestinations) {
143
+ this.outputNode?.scheduleTag({
144
+ id: adId,
145
+ scte35: message,
146
+ startDate: schedule,
147
+ durationSeconds: Number((command.breakDuration?.duration ?? 0n) / BigInt(90000.0))
148
+ }, now, d);
149
+ }
150
+ }
151
+ });
152
+ this.ancillary.subscribe([ancillarySource.select()]);
153
+ }
154
+ }
155
+ }
156
+ }
157
+ class HlsTsPlaylistDefinition {
158
+ async create(norsk, cfg, cb, runtime) {
159
+ const node = await HlsTsPlaylist.create(norsk, cfg, runtime);
160
+ cb(node);
161
+ }
162
+ async handleCommand(node, command) {
163
+ switch (command.type) {
164
+ case 'enable-output':
165
+ await node.enableOutput();
166
+ break;
167
+ case 'disable-output':
168
+ await node.disableOutput();
169
+ break;
170
+ }
171
+ }
172
+ async instanceRoutes() {
173
+ return (0, api_1.defineApi)(path_1.default.join(__dirname, 'types.yaml'), {
174
+ '/enable': {
175
+ post: ({ runtime }) => async (_req, res) => {
176
+ try {
177
+ const state = runtime.updates.latest();
178
+ if (state.enabled) {
179
+ return res.status(400).json({ error: 'Output is already enabled' });
180
+ }
181
+ runtime.updates.update({ ...state, enabled: true });
182
+ runtime.updates.sendCommand({
183
+ type: 'enable-output'
184
+ });
185
+ runtime.updates.raiseEvent({
186
+ type: 'output-enabled'
187
+ });
188
+ res.sendStatus(204);
189
+ }
190
+ catch (error) {
191
+ console.error('Error in enable handler:', error);
192
+ res.status(500).json({ error: 'Failed to enable output' });
193
+ }
194
+ }
195
+ },
196
+ '/disable': {
197
+ post: ({ runtime }) => async (_req, res) => {
198
+ try {
199
+ const state = runtime.updates.latest();
200
+ if (!state.enabled) {
201
+ return res.status(400).json({ error: 'Output is already disabled' });
202
+ }
203
+ runtime.updates.update({ ...state, enabled: false });
204
+ runtime.updates.sendCommand({
205
+ type: 'disable-output'
206
+ });
207
+ runtime.updates.raiseEvent({
208
+ type: 'output-disabled'
209
+ });
210
+ res.sendStatus(204);
211
+ }
212
+ catch (error) {
213
+ console.error('Error in disable handler:', error);
214
+ res.status(500).json({ error: 'Failed to disable output' });
215
+ }
216
+ }
217
+ }
218
+ });
219
+ }
220
+ async schemas() {
221
+ return (0, schemas_1.schemaFromTypes)(path_1.default.join(__dirname, 'types.yaml'), { config: 'HlsTsConfig', state: 'HlsTsOutputState' });
222
+ }
223
+ }
224
+ exports.default = HlsTsPlaylistDefinition;
225
+ //# sourceMappingURL=runtime.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime.js","sourceRoot":"","sources":["../../src/output.tsMediaPlaylist/runtime.ts"],"names":[],"mappings":";;;;;AAEA,kFAAyF;AACzF,yEAAuE;AAGvE,+CAAgD;AAChD,iDAAkD;AAElD,gDAAwB;AAExB,+CAAoD;AACpD,iEAAoE;AACpE,yCAAmD;AAanD,MAAM,aAAc,SAAQ,iCAAoB;IAC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AC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,0BAA0B,EAAE,CAAC,CAAC;oBAC9D,CAAC;gBACH,CAAC;aACF;SACF,CAAC,CAAC;IACP,CAAC;IAED,KAAK,CAAC,OAAO;QACX,OAAO,IAAA,yBAAe,EAAC,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,YAAY,CAAC,EACvD,EAAE,MAAM,EAAE,aAAa,EAAE,KAAK,EAAE,kBAAkB,EAAE,CACrD,CAAA;IACH,CAAC;CACF;AA/ED,0CA+EC"}
@@ -0,0 +1,155 @@
1
+ export interface paths {
2
+ "/enable": {
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?: never;
19
+ responses: {
20
+ 204: {
21
+ headers: {
22
+ [name: string]: unknown;
23
+ };
24
+ content?: never;
25
+ };
26
+ 400: {
27
+ headers: {
28
+ [name: string]: unknown;
29
+ };
30
+ content?: never;
31
+ };
32
+ 500: {
33
+ headers: {
34
+ [name: string]: unknown;
35
+ };
36
+ content?: never;
37
+ };
38
+ };
39
+ };
40
+ delete?: never;
41
+ options?: never;
42
+ head?: never;
43
+ patch?: never;
44
+ trace?: never;
45
+ };
46
+ "/disable": {
47
+ parameters: {
48
+ query?: never;
49
+ header?: never;
50
+ path?: never;
51
+ cookie?: never;
52
+ };
53
+ get?: never;
54
+ put?: never;
55
+ post: {
56
+ parameters: {
57
+ query?: never;
58
+ header?: never;
59
+ path?: never;
60
+ cookie?: never;
61
+ };
62
+ requestBody?: never;
63
+ responses: {
64
+ 204: {
65
+ headers: {
66
+ [name: string]: unknown;
67
+ };
68
+ content?: never;
69
+ };
70
+ 400: {
71
+ headers: {
72
+ [name: string]: unknown;
73
+ };
74
+ content?: never;
75
+ };
76
+ 500: {
77
+ headers: {
78
+ [name: string]: unknown;
79
+ };
80
+ content?: never;
81
+ };
82
+ };
83
+ };
84
+ delete?: never;
85
+ options?: never;
86
+ head?: never;
87
+ patch?: never;
88
+ trace?: never;
89
+ };
90
+ }
91
+ export type webhooks = Record<string, never>;
92
+ export interface components {
93
+ schemas: {
94
+ InitialState: "enabled" | "disabled";
95
+ HlsTsConfig: {
96
+ id: string;
97
+ displayName: string;
98
+ name: string;
99
+ sessionId: boolean;
100
+ publishingGroup?: string;
101
+ segments: components["schemas"]["AutoCmafSegment"];
102
+ destinations: components["schemas"]["AutoCmafDestination"][];
103
+ initialState: components["schemas"]["InitialState"];
104
+ drmProvider?: "ezdrm" | "axinom";
105
+ notes?: string;
106
+ __global: {
107
+ ezdrmConfig?: components["schemas"]["EzDrmConfig"];
108
+ axinomConfig?: components["schemas"]["AxinomConfig"];
109
+ };
110
+ };
111
+ HlsTsOutputState: {
112
+ url?: string;
113
+ drmToken?: string;
114
+ enabled: boolean;
115
+ };
116
+ AutoCmafSegment: {
117
+ retentionPeriod: number;
118
+ defaultSegmentCount?: number;
119
+ targetSegmentDuration: number;
120
+ targetPartDuration: number;
121
+ holdBackSegments?: number;
122
+ holdBackParts?: number;
123
+ };
124
+ AutoCmafAkamaiDestination: {
125
+ type: "akamai";
126
+ ingest: string;
127
+ playback: string;
128
+ includeAdInsertions: boolean;
129
+ };
130
+ AutoCmafS3Destination: {
131
+ type: "s3";
132
+ host: string;
133
+ prefix: string;
134
+ includeAdInsertions: boolean;
135
+ };
136
+ AutoCmafDestination: components["schemas"]["AutoCmafAkamaiDestination"] | components["schemas"]["AutoCmafS3Destination"];
137
+ EzDrmConfig: {
138
+ token?: string;
139
+ pX?: string;
140
+ };
141
+ AxinomConfig: {
142
+ tenantId?: string;
143
+ managementKey?: string;
144
+ comKeyId?: string;
145
+ comKey?: string;
146
+ };
147
+ };
148
+ responses: never;
149
+ parameters: never;
150
+ requestBodies: never;
151
+ headers: never;
152
+ pathItems: never;
153
+ }
154
+ export type $defs = Record<string, never>;
155
+ 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/output.tsMediaPlaylist/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,90 @@
1
+ openapi: 3.0.0
2
+ info:
3
+ title: Cmaf Media Playlist Component
4
+ version: 1.0.0
5
+
6
+ paths:
7
+ /enable:
8
+ post:
9
+ summary: Enable HLS/TS output
10
+ description: Enables output of HLS/TS streams if currently disabled
11
+ responses:
12
+ 204:
13
+ description: Output successfully enabled
14
+ 400:
15
+ description: Output is already enabled
16
+ 500:
17
+ description: Server error while enabling output
18
+ /disable:
19
+ post:
20
+ summary: Disable HLS/TS output
21
+ description: Disables output of HLS/TS streams if currently enabled
22
+ responses:
23
+ 204:
24
+ description: Output successfully disabled
25
+ 400:
26
+ description: Output is already disabled
27
+ 500:
28
+ description: Server error while disabling output
29
+
30
+ components:
31
+ schemas:
32
+ InitialState:
33
+ type: string
34
+ enum: [enabled, disabled]
35
+
36
+ HlsTsConfig:
37
+ type: object
38
+ required:
39
+ - id
40
+ - displayName
41
+ - name
42
+ - sessionId
43
+ - segments
44
+ - destinations
45
+ - initialState
46
+ - __global
47
+ properties:
48
+ id:
49
+ type: string
50
+ displayName:
51
+ type: string
52
+ name:
53
+ type: string
54
+ sessionId:
55
+ type: boolean
56
+ publishingGroup:
57
+ type: string
58
+ segments:
59
+ $ref: '../shared/types.yaml#/components/schemas/AutoCmafSegment'
60
+ destinations:
61
+ type: array
62
+ items:
63
+ $ref: '../shared/types.yaml#/components/schemas/AutoCmafDestination'
64
+ initialState:
65
+ $ref: '#/components/schemas/InitialState'
66
+ drmProvider:
67
+ type: string
68
+ enum: [ezdrm, axinom]
69
+ notes:
70
+ type: string
71
+ __global:
72
+ type: object
73
+ properties:
74
+ ezdrmConfig:
75
+ $ref: '../shared/types.yaml#/components/schemas/EzDrmConfig'
76
+ axinomConfig:
77
+ $ref: '../shared/types.yaml#/components/schemas/AxinomConfig'
78
+ additionalProperties: false
79
+
80
+ HlsTsOutputState:
81
+ type: object
82
+ required:
83
+ - enabled
84
+ properties:
85
+ url:
86
+ type: string
87
+ drmToken:
88
+ type: string
89
+ enabled:
90
+ type: boolean
@@ -0,0 +1,15 @@
1
+ import type { HlsTsPlaylistCommand, HlsTsPlaylistEvent } from "./runtime";
2
+ import type Registration from "@norskvideo/norsk-studio/lib/extension/registration";
3
+ export default function (registration: Registration): import("@norskvideo/norsk-studio/lib/extension/client-types").NodeInfo<{
4
+ id: string;
5
+ displayName: string;
6
+ name: string;
7
+ publishingGroup?: string;
8
+ destinations: import("./types").components["schemas"]["AutoCmafDestination"][];
9
+ initialState: import("./types").components["schemas"]["InitialState"];
10
+ notes?: string;
11
+ __global: Record<string, never>;
12
+ }, {
13
+ url?: string;
14
+ enabled: boolean;
15
+ }, HlsTsPlaylistCommand, HlsTsPlaylistEvent>;