@@ -39,15 +39,8 @@ import { Blueprint } from '@sofie-automation/corelib/dist/dataModel/Blueprint'
3939import { ICoreSystem , SYSTEM_ID } from '@sofie-automation/meteor-lib/dist/collections/CoreSystem'
4040import { stripVersion } from '../../server/systemStatus/semverUtils'
4141import { internalUploadBlueprint } from '../../server/api/blueprints/api'
42- import {
43- literal ,
44- protectString ,
45- unprotectString ,
46- getRandomId ,
47- getRandomString ,
48- Complete ,
49- normalizeArray ,
50- } from '../../server/lib/tempLib'
42+ import { literal , getRandomId , getRandomString , Complete , normalizeArray } from '@sofie-automation/corelib/dist/lib'
43+ import { protectString , unprotectString } from '@sofie-automation/corelib/dist/protectedString'
5144import { DBRundown } from '@sofie-automation/corelib/dist/dataModel/Rundown'
5245import { DBSegment } from '@sofie-automation/corelib/dist/dataModel/Segment'
5346import { DBPart } from '@sofie-automation/corelib/dist/dataModel/Part'
@@ -69,7 +62,6 @@ import {
6962import { UIShowStyleBase } from '@sofie-automation/meteor-lib/dist/api/showStyles'
7063import {
7164 BlueprintId ,
72- OrganizationId ,
7365 RundownId ,
7466 RundownPlaylistId ,
7567 ShowStyleBaseId ,
@@ -126,7 +118,6 @@ export async function setupMockPeripheralDevice(
126118 const defaultDevice : PeripheralDevice = {
127119 _id : protectString ( 'mockDevice' + dbI ++ ) ,
128120 name : 'mockDevice' ,
129- organizationId : null ,
130121 studioAndConfigId : studio ? { studioId : studio . _id , configId : 'test' } : undefined ,
131122
132123 category : category ,
@@ -259,7 +250,6 @@ export async function setupMockShowStyleBase(
259250 const defaultShowStyleBase : DBShowStyleBase = {
260251 _id : protectString ( 'mockShowStyleBase' + dbI ++ ) ,
261252 name : 'mockShowStyleBase' ,
262- organizationId : null ,
263253 outputLayersWithOverrides : wrapDefaultObject (
264254 normalizeArray (
265255 [
@@ -354,10 +344,7 @@ export function packageBlueprint<T extends BlueprintManifestBase>(
354344 } )
355345 return `({default: (${ code } )()})`
356346}
357- export async function setupMockStudioBlueprint (
358- showStyleBaseId : ShowStyleBaseId ,
359- organizationId : OrganizationId | null = null
360- ) : Promise < Blueprint > {
347+ export async function setupMockStudioBlueprint ( showStyleBaseId : ShowStyleBaseId ) : Promise < Blueprint > {
361348 const { INTEGRATION_VERSION , TSR_VERSION } = getBlueprintDependencyVersions ( )
362349
363350 const BLUEPRINT_TYPE = BlueprintManifestType . STUDIO
@@ -401,20 +388,12 @@ export async function setupMockStudioBlueprint(
401388 const blueprintId : BlueprintId = protectString ( 'mockBlueprint' + dbI ++ )
402389 const blueprintName = 'mockBlueprint'
403390
404- return internalUploadBlueprint (
405- blueprintId ,
406- code ,
407- {
408- blueprintName,
409- ignoreIdChange : true ,
410- } ,
411- organizationId
412- )
391+ return internalUploadBlueprint ( blueprintId , code , {
392+ blueprintName,
393+ ignoreIdChange : true ,
394+ } )
413395}
414- export async function setupMockShowStyleBlueprint (
415- showStyleVariantId : ShowStyleVariantId ,
416- organizationId ?: OrganizationId | null
417- ) : Promise < Blueprint > {
396+ export async function setupMockShowStyleBlueprint ( showStyleVariantId : ShowStyleVariantId ) : Promise < Blueprint > {
418397 const { INTEGRATION_VERSION , TSR_VERSION } = getBlueprintDependencyVersions ( )
419398
420399 const BLUEPRINT_TYPE = BlueprintManifestType . SHOWSTYLE
@@ -540,15 +519,10 @@ export async function setupMockShowStyleBlueprint(
540519 const blueprintId : BlueprintId = protectString ( 'mockBlueprint' + dbI ++ )
541520 const blueprintName = 'mockBlueprint'
542521
543- return internalUploadBlueprint (
544- blueprintId ,
545- code ,
546- {
547- blueprintName,
548- ignoreIdChange : true ,
549- } ,
550- organizationId
551- )
522+ return internalUploadBlueprint ( blueprintId , code , {
523+ blueprintName,
524+ ignoreIdChange : true ,
525+ } )
552526}
553527export interface DefaultEnvironment {
554528 showStyleBaseId : ShowStyleBaseId
@@ -567,36 +541,31 @@ export interface DefaultEnvironment {
567541
568542 ingestDevice : PeripheralDevice
569543}
570- export async function setupDefaultStudioEnvironment (
571- organizationId : OrganizationId | null = null
572- ) : Promise < DefaultEnvironment > {
544+ export async function setupDefaultStudioEnvironment ( ) : Promise < DefaultEnvironment > {
573545 const core = await setupMockCore ( { } )
574546 const systemTriggeredActions = await setupMockTriggeredActions ( )
575547
576548 const showStyleBaseId : ShowStyleBaseId = getRandomId ( )
577549 const showStyleVariantId : ShowStyleVariantId = getRandomId ( )
578550
579- const studioBlueprint = await setupMockStudioBlueprint ( showStyleBaseId , organizationId )
580- const showStyleBlueprint = await setupMockShowStyleBlueprint ( showStyleVariantId , organizationId )
551+ const studioBlueprint = await setupMockStudioBlueprint ( showStyleBaseId )
552+ const showStyleBlueprint = await setupMockShowStyleBlueprint ( showStyleVariantId )
581553
582554 const showStyleBase = await setupMockShowStyleBase ( showStyleBlueprint . _id , {
583555 _id : showStyleBaseId ,
584- organizationId : organizationId ,
585556 } )
586557 const triggeredActions = await setupMockTriggeredActions ( showStyleBase . _id )
587558 const showStyleVariant = await setupMockShowStyleVariant ( showStyleBase . _id , { _id : showStyleVariantId } )
588559
589560 const studio = await setupMockStudio ( {
590561 blueprintId : studioBlueprint . _id ,
591562 supportedShowStyleBase : [ showStyleBaseId ] ,
592- organizationId : organizationId ,
593563 } )
594564 const ingestDevice = await setupMockPeripheralDevice (
595565 PeripheralDeviceCategory . INGEST ,
596566 PeripheralDeviceType . MOS ,
597567 PERIPHERAL_SUBTYPE_PROCESS ,
598- studio ,
599- { organizationId : organizationId }
568+ studio
600569 )
601570 const { worker, workerThreadStatuses } = await setupMockWorker ( )
602571
@@ -648,7 +617,6 @@ export async function setupDefaultRundown(
648617 const sourceLayerIds = Object . keys ( applyAndValidateOverrides ( env . showStyleBase . sourceLayersWithOverrides ) . obj )
649618
650619 const rundown : DBRundown = {
651- organizationId : null ,
652620 studioId : env . studio . _id ,
653621 showStyleBaseId : env . showStyleBase . _id ,
654622 showStyleVariantId : env . showStyleVariant . _id ,
0 commit comments