Skip to content

Commit 934b8ff

Browse files
authored
Merge pull request #1543 from SuperFlyTV/chore/refactor-lsg-asyncapi-schema
chore: refactor lsg asyncapi schema
2 parents df631e1 + 2360758 commit 934b8ff

File tree

125 files changed

+2678
-1052
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

125 files changed

+2678
-1052
lines changed

packages/live-status-gateway-api/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
node_modules
22
dist
3+
temp
34
test
45
src/**.js
56

Lines changed: 26 additions & 116 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
asyncapi: 2.6.0
2-
id: 'urn:nrk:no:sofie:live-status-gateway:server'
1+
asyncapi: '2.6.0'
2+
id: 'sofie:live-status-gateway:server'
33
info:
44
title: Sofie Live Status Service
5+
version: '2.0.1'
56
description: This service provides subscriptions for status updates from Sofie
6-
version: 2.0.0
77
license:
88
name: MIT License
99
url: http://opensource.org/licenses/MIT
1010
contact:
11-
name: Sofie TV Automation - NRK Team
11+
name: Sofie TV Automation
1212
url: https://github.com/Sofie-Automation/sofie-core/issues
1313

1414
servers:
1515
development:
1616
url: localhost
17-
description: Server available without authorisation
17+
description: Server available without authorization
1818
protocol: ws
1919
protocolVersion: '13'
2020

@@ -26,114 +26,24 @@ tags:
2626
- name: broadcast
2727

2828
channels:
29-
/:
30-
publish:
31-
description: Send messages to the root API
32-
operationId: processRootMessage
33-
message:
34-
oneOf:
35-
- $ref: '#/components/messages/ping'
36-
- $ref: '#/components/messages/subscribe'
37-
- $ref: '#/components/messages/unsubscribe'
38-
subscribe:
39-
description: Messages that are received from the API
40-
operationId: sendRootMessage
41-
message:
42-
oneOf:
43-
- $ref: '#/components/messages/pong'
44-
- $ref: '#/components/messages/heartbeat'
45-
- $ref: '#/components/messages/subscriptionStatus'
46-
- $ref: '#/components/messages/studio'
47-
- $ref: '#/components/messages/activePlaylist'
48-
- $ref: '#/components/messages/activePieces'
49-
- $ref: '#/components/messages/segments'
50-
- $ref: '#/components/messages/adLibs'
51-
- $ref: '#/components/messages/packages'
52-
- $ref: '#/components/messages/buckets'
53-
components:
54-
messages:
55-
ping:
56-
name: ping
57-
messageId: ping
58-
summary: Ping server to determine whether connection is alive
59-
description: Client can ping server to determine whether connection is alive, server responds with pong. This is an application level ping as opposed to default ping in websockets standard which is server initiated
60-
payload:
61-
$ref: './schemas/root.yaml#/$defs/ping'
62-
x-response:
63-
$ref: '#/components/messages/pong'
64-
pong:
65-
name: pong
66-
messageId: pong
67-
summary: Pong is a response to ping message
68-
description: Server pong response to a ping to determine whether connection is alive. This is an application level pong as opposed to default pong in websockets standard which is sent by client in response to a ping
69-
payload:
70-
$ref: './schemas/root.yaml#/$defs/pong'
71-
heartbeat:
72-
name: heartbeat
73-
messageId: heartbeat
74-
description: Server heartbeat sent if no subscription traffic within 1 second (approximately)
75-
payload:
76-
$ref: './schemas/root.yaml#/$defs/heartbeat'
77-
subscribe:
78-
name: subscribe
79-
messageId: subscribe
80-
description: Subscribe to a topic
81-
payload:
82-
$ref: './schemas/root.yaml#/$defs/subscribe'
83-
x-response:
84-
$ref: './schemas/root.yaml#/$defs/subscriptionStatus'
85-
unsubscribe:
86-
name: unsubscribe
87-
messageId: unsubscribe
88-
description: Unsubscribe from a topic
89-
payload:
90-
$ref: './schemas/root.yaml#/$defs/unsubscribe'
91-
x-response:
92-
$ref: './schemas/root.yaml#/$defs/subscriptionStatus'
93-
subscriptionStatus:
94-
messageId: subscriptionStatus
95-
description: Subscription status response to subscribe or unsubscribe
96-
payload:
97-
$ref: './schemas/root.yaml#/$defs/subscriptionStatus'
98-
studio:
99-
name: studio
100-
messageId: studioUpdate
101-
description: Studio status
102-
payload:
103-
$ref: './schemas/studio.yaml#/$defs/studio'
104-
activePlaylist:
105-
name: activePlaylist
106-
messageId: activePlaylistUpdate
107-
description: Active Playlist status
108-
payload:
109-
$ref: './schemas/activePlaylist.yaml#/$defs/activePlaylist'
110-
activePieces:
111-
name: activePieces
112-
messageId: activePiecesUpdate
113-
summary: Active Pieces status
114-
description: Pieces from the active Playlist that are currently active (on air)
115-
payload:
116-
$ref: './schemas/activePieces.yaml#/$defs/activePieces'
117-
segments:
118-
name: segments
119-
messageId: segmentsUpdate
120-
description: Segments in active Playlist
121-
payload:
122-
$ref: './schemas/segments.yaml#/$defs/segments'
123-
adLibs:
124-
name: adLibs
125-
messageId: adLibsUpdate
126-
description: AdLibs in active Playlist
127-
payload:
128-
$ref: './schemas/adLibs.yaml#/$defs/adLibs'
129-
packages:
130-
name: packages
131-
messageId: packages
132-
description: Status of Packages expected by Pieces
133-
payload:
134-
$ref: './schemas/packages.yaml#/$defs/packages'
135-
buckets:
136-
name: buckets
137-
description: Buckets in Studio
138-
payload:
139-
$ref: './schemas/buckets.yaml#/$defs/buckets'
29+
# As the LSG is websocket only, channels are only used for logical grouping for the generated docs and folder structure.
30+
ping:
31+
$ref: './topics/ping/pingTopic.yaml'
32+
heartbeat:
33+
$ref: './topics/heartbeat/heartbeatTopic.yaml'
34+
subscriptions:
35+
$ref: './topics/subscriptions/subscriptionsTopic.yaml'
36+
studio:
37+
$ref: './topics/studio/studioTopic.yaml'
38+
activePlaylist:
39+
$ref: './topics/activePlaylist/activePlaylistTopic.yaml'
40+
activePieces:
41+
$ref: './topics/activePieces/activePiecesTopic.yaml'
42+
segments:
43+
$ref: './topics/segments/segmentsTopic.yaml'
44+
adLibs:
45+
$ref: './topics/adLibs/adLibsTopic.yaml'
46+
packages:
47+
$ref: './topics/packages/packagesTopic.yaml'
48+
buckets:
49+
$ref: './topics/buckets/bucketsTopic.yaml'
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
name: pvw
2+
label: Preview
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
$defs:
2+
adLibActionType:
3+
title: AdLibActionType
4+
type: object
5+
properties:
6+
name:
7+
type: string
8+
description: The string to be passed to the ExecuteAdlib function
9+
label:
10+
type: string
11+
description: The label for the AdLib type
12+
required: [name, label]
13+
additionalProperties: false
14+
examples:
15+
- $ref: './actionType-example.yaml'
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
id: 'C6K_yIMuGFUk8X_L9A9_jRT6aq4_'
2+
name: Music video clip
3+
sourceLayer: Video Clip
4+
actionType:
5+
- $ref: '../actionType/actionType-example.yaml'
6+
tags: ['music_video']
7+
publicData:
8+
fileName: MV000123.mxf
9+
optionsSchema: '{"$schema":"https://json-schema.org/draft/2020-12/schema","title":"Play Video Clip","type":"object","properties":{"type":"adlib_action_video_clip","label":{"type":"string"},"clipId":{"type":"string"},"vo":{"type":"boolean"},"target":{"$schema":"https://json-schema.org/draft/2020-12/schema","title":"Object Id","description":"Id of an object sent to Sofie","type":"string"},"duration":{"type":"number","exclusiveMinimum":0},"takeType":{"$schema":"https://json-schema.org/draft/2020-12/schema","title":"AdLib Action Take Type","type":"string","enum":["take_immediate","queue"]},"transition":{"$schema":"https://json-schema.org/draft/2020-12/schema","title":"AdLib Action Transition Type","oneOf":[{"type":"object","properties":{"type":"cut"},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":"mix","duration":{"type":"number","exclusiveMinimum":0,"description":"Duration in ms"}},"required":["type","duration"],"additionalProperties":false},{"type":"object","properties":{"type":"wipe","duration":{"type":"number","exclusiveMinimum":0,"description":"Duration in ms"},"patternId":{"type":"string","description":"Type of wipe to use"}},"required":["type","duration","patternId"],"additionalProperties":false},{"type":"object","properties":{"type":"macro","macroId":{"type":"string","description":"Macro template to recall"}},"required":["type","macroId"],"additionalProperties":false}]}},"required":["type","clipId","vo","target"],"additionalProperties":false}"'
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
$defs:
2+
adLibBase:
3+
title: AdLibBase
4+
type: object
5+
properties:
6+
id:
7+
type: string
8+
description: Unique id of the AdLib
9+
name:
10+
type: string
11+
description: The user defined AdLib name
12+
sourceLayer:
13+
type: string
14+
description: The source layer name for this AdLib
15+
outputLayer:
16+
type: string
17+
description: The output layer name for this AdLib
18+
actionType:
19+
type: array
20+
description: The available action type names that can be used to modify the execution of the AdLib
21+
items:
22+
$ref: '../actionType/actionType.yaml#/$defs/adLibActionType'
23+
tags:
24+
type: array
25+
description: Tags attached to this AdLib
26+
items:
27+
type: string
28+
publicData:
29+
description: Optional arbitrary data
30+
optionsSchema:
31+
type: string
32+
description: JSON schema definition of the adLib properties that can be modified using the adLibOptions property in executeAdLib
33+
required: [id, name, sourceLayer, actionType]
34+
examples:
35+
- $ref: './adLibBase-example.yaml'
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
$ref: '../adLibBase/adLibBase-example.yaml'
2+
segmentId: HsD8_QwE1ZmR5vN3XcK_Ab7y
3+
partId: JkL3_OpR6WxT1bF8Vq2_Zy9u
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
$defs:
2+
adLibStatus:
3+
title: AdLibStatus
4+
allOf:
5+
- $ref: '../adLibBase/adLibBase.yaml#/$defs/adLibBase'
6+
- type: object
7+
title: AdLibStatus
8+
properties:
9+
segmentId:
10+
description: Unique id of the segment this adLib belongs to
11+
type: string
12+
partId:
13+
description: Unique id of the part this adLib belongs to
14+
type: string
15+
required: [segmentId, partId]
16+
examples:
17+
- $ref: './adLibStatus-example.yaml'
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
event: 'adLibs'
2+
rundownPlaylistId: 'OKAgZmZ0Buc99lE_2uPPSKVbMrQ_'
3+
adLibs:
4+
- $ref: '../adLibStatus/adLibStatus-example.yaml'
5+
globalAdLibs:
6+
- $ref: '../globalAdLibStatus/globalAdLibStatus-example.yaml'
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
$defs:
2+
adLibsEvent:
3+
type: object
4+
title: AdLibsEvent
5+
properties:
6+
event:
7+
type: string
8+
const: adLibs
9+
rundownPlaylistId:
10+
description: Unique id of the rundown playlist, or null if no playlist is active
11+
oneOf:
12+
- type: string
13+
title: Unique id of the rundown playlist
14+
- type: 'null'
15+
title: Null if no playlist is active
16+
adLibs:
17+
type: array
18+
description: The available AdLibs for this playlist
19+
items:
20+
$ref: '../adLibStatus/adLibStatus.yaml#/$defs/adLibStatus'
21+
globalAdLibs:
22+
type: array
23+
description: The available Global AdLibs for this playlist
24+
items:
25+
$ref: '../globalAdLibStatus/globalAdLibStatus.yaml#/$defs/globalAdLibStatus'
26+
required: [event, rundownPlaylistId, adLibs, globalAdLibs]
27+
additionalProperties: false
28+
examples:
29+
- $ref: './adLibsEvent-example.yaml'

0 commit comments

Comments
 (0)