Skip to content

Commit e9e8f54

Browse files
committed
feat: GW config types in Blueprints
1 parent 1f00f7f commit e9e8f54

File tree

6 files changed

+115
-1
lines changed

6 files changed

+115
-1
lines changed

packages/blueprints-integration/src/api/studio.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ import type {
2828
} from '@sofie-automation/shared-lib/dist/core/model/StudioRouteSet'
2929
import type { StudioPackageContainer } from '@sofie-automation/shared-lib/dist/core/model/PackageContainer'
3030
import type { IStudioSettings } from '@sofie-automation/shared-lib/dist/core/model/StudioSettings'
31+
import type { MosDeviceConfig } from '@sofie-automation/shared-lib/dist/generated/MosGatewayDevicesTypes'
32+
import type { PlayoutGatewayConfig } from '@sofie-automation/shared-lib/dist/generated/PlayoutGatewayConfigTypes'
3133

3234
export interface StudioBlueprintManifest<TRawConfig = IBlueprintConfig, TProcessedConfig = unknown>
3335
extends BlueprintManifestBase {
@@ -149,7 +151,7 @@ export interface BlueprintResultApplyStudioConfig {
149151
/** Playout-gateway subdevices */
150152
playoutDevices: Record<string, TSR.DeviceOptionsAny>
151153
/** Ingest-gateway subdevices, the types here depend on the gateway you use */
152-
ingestDevices: Record<string, unknown>
154+
ingestDevices: Record<string, BlueprintMosDeviceConfig | unknown>
153155
/** Input-gateway subdevices */
154156
inputDevices: Record<string, unknown>
155157
/** Route Sets */
@@ -170,6 +172,10 @@ export interface BlueprintParentDeviceSettings {
170172
options: Record<string, any>
171173
}
172174

175+
export type BlueprintMosDeviceConfig = MosDeviceConfig
176+
177+
export type BlueprintPlayoutGatewayConfig = PlayoutGatewayConfig
178+
173179
export interface IStudioConfigPreset<TConfig = IBlueprintConfig> {
174180
name: string
175181

packages/scripts/schema-types.mjs

+4
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ try {
2323
})
2424

2525
await fs.writeFile('./playout-gateway/src/generated/options.ts', BANNER + '\n' + schema)
26+
await fs.writeFile('./shared-lib/src/generated/PlayoutGatewayConfigTypes.ts', BANNER + '\n' + schema)
2627
} catch (e) {
2728
console.error('Error while generating playout-gateway options.json, continuing...')
2829
console.error(e)
@@ -37,6 +38,7 @@ try {
3738
})
3839

3940
await fs.writeFile('./mos-gateway/src/generated/options.ts', BANNER + '\n' + schema)
41+
await fs.writeFile('./shared-lib/src/generated/MosGatewayOptionsTypes.ts', BANNER + '\n' + schema)
4042
} catch (e) {
4143
console.error('Error while generating mos-gateway options.json, continuing...')
4244
console.error(e)
@@ -49,6 +51,7 @@ try {
4951
})
5052

5153
await fs.writeFile('./mos-gateway/src/generated/devices.ts', BANNER + '\n' + schema)
54+
await fs.writeFile('./shared-lib/src/generated/MosGatewayDevicesTypes.ts', BANNER + '\n' + schema)
5255
} catch (e) {
5356
console.error('Error while generating mos-gateway devices.json, continuing...')
5457
console.error(e)
@@ -63,6 +66,7 @@ try {
6366
})
6467

6568
await fs.writeFile('./live-status-gateway/src/generated/options.ts', BANNER + '\n' + schema)
69+
await fs.writeFile('./shared-lib/src/generated/LiveStatusGatewayOptionsTypes.ts', BANNER + '\n' + schema)
6670
} catch (e) {
6771
console.error('Error while generating live-status-gateway options.json, continuing...')
6872
console.error(e)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/* eslint-disable */
2+
/**
3+
* This file was automatically generated by json-schema-to-typescript.
4+
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
5+
* and run "yarn generate-schema-types" to regenerate this file.
6+
*/
7+
8+
export interface LiveStatusGatewayConfig {
9+
/**
10+
* Activate Debug Logging
11+
*/
12+
debugLogging?: boolean
13+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/* eslint-disable */
2+
/**
3+
* This file was automatically generated by json-schema-to-typescript.
4+
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
5+
* and run "yarn generate-schema-types" to regenerate this file.
6+
*/
7+
8+
export interface MosDeviceConfig {
9+
primary: {
10+
id: string
11+
host: string
12+
dontUseQueryPort?: boolean
13+
timeout?: number
14+
heartbeatInterval?: number
15+
ports?: {
16+
lower: number
17+
upper: number
18+
query: number
19+
}
20+
}
21+
secondary?: {
22+
id: string
23+
host: string
24+
dontUseQueryPort?: boolean
25+
timeout?: number
26+
heartbeatInterval?: number
27+
openMediaHotStandby?: boolean
28+
ports?: {
29+
lower: number
30+
upper: number
31+
query: number
32+
}
33+
}
34+
statuses: MosDeviceStatusesConfig
35+
}
36+
export interface MosDeviceStatusesConfig {
37+
enabled: boolean
38+
sendInRehearsal?: boolean
39+
onlySendPlay?: boolean
40+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/* eslint-disable */
2+
/**
3+
* This file was automatically generated by json-schema-to-typescript.
4+
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
5+
* and run "yarn generate-schema-types" to regenerate this file.
6+
*/
7+
8+
export interface MosGatewayConfig {
9+
mosId: string
10+
debugLogging?: boolean
11+
strict?: boolean
12+
ports?: {
13+
lower: number
14+
upper: number
15+
query: number
16+
}
17+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/* eslint-disable */
2+
/**
3+
* This file was automatically generated by json-schema-to-typescript.
4+
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
5+
* and run "yarn generate-schema-types" to regenerate this file.
6+
*/
7+
8+
export interface PlayoutGatewayConfig {
9+
/**
10+
* Activate Debug Logging
11+
*/
12+
debugLogging?: boolean
13+
debugState?: boolean
14+
/**
15+
* Activate Multi-Threading
16+
*/
17+
multiThreading?: boolean
18+
/**
19+
* Requires restart of Gateway to apply
20+
*/
21+
multiThreadedResolver?: boolean
22+
/**
23+
* Requires restart of Gateway to apply
24+
*/
25+
useCacheWhenResolving?: boolean
26+
/**
27+
* Report command timings on all commands
28+
*/
29+
reportAllCommands?: boolean
30+
/**
31+
* Adjust resolve-time estimation
32+
*/
33+
estimateResolveTimeMultiplier?: number
34+
}

0 commit comments

Comments
 (0)