|
1 | 1 | import { PeripheralDeviceId, StudioId } from '@sofie-automation/corelib/dist/dataModel/Ids' |
2 | 2 | import { getRandomId } from '@sofie-automation/corelib/dist/lib' |
3 | | -import { ProtectedString, unprotectString } from '@sofie-automation/corelib/dist/protectedString' |
| 3 | +import { unprotectString } from '@sofie-automation/corelib/dist/protectedString' |
4 | 4 | import { check } from 'meteor/check' |
5 | 5 | import { Meteor } from 'meteor/meteor' |
6 | 6 | import { ReadonlyDeep } from 'type-fest' |
7 | 7 | import { CustomCollectionName, MeteorPubSub } from '../../lib/api/pubsub' |
8 | | -import { DeviceTriggerArguments } from '../../lib/api/triggers/MountedTriggers' |
| 8 | +import { DeviceTriggerArguments, UIDeviceTriggerPreview } from '../../lib/api/triggers/MountedTriggers' |
9 | 9 | import { getCurrentTime } from '../../lib/lib' |
10 | 10 | import { setUpOptimizedObserverArray, TriggerUpdate } from '../lib/customPublication' |
11 | 11 | import { CustomPublish, meteorCustomPublish } from '../lib/customPublication/publish' |
12 | 12 | import { StudioReadAccess } from '../security/studio' |
13 | 13 | import { PeripheralDevices } from '../collections' |
14 | 14 |
|
15 | | -type DeviceTriggerPreviewId = ProtectedString<'deviceTriggerPreviewId'> |
16 | | - |
17 | 15 | /** IDEA: This could potentially be a Capped Collection, thus enabling scaling Core horizontally: |
18 | 16 | * https://www.mongodb.com/docs/manual/core/capped-collections/ */ |
19 | 17 | const lastTriggers: Record<string, { triggers: UIDeviceTriggerPreview[]; updated?: (() => void) | undefined }> = {} |
20 | 18 |
|
21 | | -export interface UIDeviceTriggerPreview { |
22 | | - _id: DeviceTriggerPreviewId |
23 | | - peripheralDeviceId: PeripheralDeviceId |
24 | | - triggerDeviceId: string |
25 | | - triggerId: string |
26 | | - timestamp: number |
27 | | - values?: DeviceTriggerArguments |
28 | | -} |
29 | | - |
30 | 19 | meteorCustomPublish( |
31 | 20 | MeteorPubSub.deviceTriggersPreview, |
32 | 21 | CustomCollectionName.UIDeviceTriggerPreviews, |
|
0 commit comments