Skip to content

Commit 0fac70f

Browse files
committed
Merge branch 'release53' into chore/tidy-reexports
2 parents dd1f5bd + 3b36681 commit 0fac70f

File tree

89 files changed

+701
-696
lines changed

Some content is hidden

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

89 files changed

+701
-696
lines changed

meteor/__mocks__/defaultCollectionObjects.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ export function defaultRundownPlaylist(_id: RundownPlaylistId, studioId: StudioI
3737
_id: _id,
3838

3939
externalId: 'MOCK_RUNDOWNPLAYLIST',
40-
organizationId: null,
4140
studioId: studioId,
4241

4342
name: 'Default RundownPlaylist',
@@ -68,8 +67,6 @@ export function defaultRundown(
6867
showStyleBaseId: showStyleBaseId,
6968
showStyleVariantId: showStyleVariantId,
7069

71-
organizationId: null,
72-
7370
playlistId: playlistId,
7471

7572
_id: getRundownId(studioId, externalId),
@@ -102,7 +99,6 @@ export function defaultStudio(_id: StudioId): DBStudio {
10299
_id: _id,
103100

104101
name: 'mockStudio',
105-
organizationId: null,
106102
mappingsWithOverrides: wrapDefaultObject({}),
107103
supportedShowStyleBase: [],
108104
blueprintConfigWithOverrides: wrapDefaultObject({}),

meteor/__mocks__/helpers/database.ts

Lines changed: 14 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ import {
6262
import { UIShowStyleBase } from '@sofie-automation/meteor-lib/dist/api/showStyles'
6363
import {
6464
BlueprintId,
65-
OrganizationId,
6665
RundownId,
6766
RundownPlaylistId,
6867
ShowStyleBaseId,
@@ -119,7 +118,6 @@ export async function setupMockPeripheralDevice(
119118
const defaultDevice: PeripheralDevice = {
120119
_id: protectString('mockDevice' + dbI++),
121120
name: 'mockDevice',
122-
organizationId: null,
123121
studioAndConfigId: studio ? { studioId: studio._id, configId: 'test' } : undefined,
124122

125123
category: category,
@@ -252,7 +250,6 @@ export async function setupMockShowStyleBase(
252250
const defaultShowStyleBase: DBShowStyleBase = {
253251
_id: protectString('mockShowStyleBase' + dbI++),
254252
name: 'mockShowStyleBase',
255-
organizationId: null,
256253
outputLayersWithOverrides: wrapDefaultObject(
257254
normalizeArray(
258255
[
@@ -347,10 +344,7 @@ export function packageBlueprint<T extends BlueprintManifestBase>(
347344
})
348345
return `({default: (${code})()})`
349346
}
350-
export async function setupMockStudioBlueprint(
351-
showStyleBaseId: ShowStyleBaseId,
352-
organizationId: OrganizationId | null = null
353-
): Promise<Blueprint> {
347+
export async function setupMockStudioBlueprint(showStyleBaseId: ShowStyleBaseId): Promise<Blueprint> {
354348
const { INTEGRATION_VERSION, TSR_VERSION } = getBlueprintDependencyVersions()
355349

356350
const BLUEPRINT_TYPE = BlueprintManifestType.STUDIO
@@ -394,20 +388,12 @@ export async function setupMockStudioBlueprint(
394388
const blueprintId: BlueprintId = protectString('mockBlueprint' + dbI++)
395389
const blueprintName = 'mockBlueprint'
396390

397-
return internalUploadBlueprint(
398-
blueprintId,
399-
code,
400-
{
401-
blueprintName,
402-
ignoreIdChange: true,
403-
},
404-
organizationId
405-
)
391+
return internalUploadBlueprint(blueprintId, code, {
392+
blueprintName,
393+
ignoreIdChange: true,
394+
})
406395
}
407-
export async function setupMockShowStyleBlueprint(
408-
showStyleVariantId: ShowStyleVariantId,
409-
organizationId?: OrganizationId | null
410-
): Promise<Blueprint> {
396+
export async function setupMockShowStyleBlueprint(showStyleVariantId: ShowStyleVariantId): Promise<Blueprint> {
411397
const { INTEGRATION_VERSION, TSR_VERSION } = getBlueprintDependencyVersions()
412398

413399
const BLUEPRINT_TYPE = BlueprintManifestType.SHOWSTYLE
@@ -533,15 +519,10 @@ export async function setupMockShowStyleBlueprint(
533519
const blueprintId: BlueprintId = protectString('mockBlueprint' + dbI++)
534520
const blueprintName = 'mockBlueprint'
535521

536-
return internalUploadBlueprint(
537-
blueprintId,
538-
code,
539-
{
540-
blueprintName,
541-
ignoreIdChange: true,
542-
},
543-
organizationId
544-
)
522+
return internalUploadBlueprint(blueprintId, code, {
523+
blueprintName,
524+
ignoreIdChange: true,
525+
})
545526
}
546527
export interface DefaultEnvironment {
547528
showStyleBaseId: ShowStyleBaseId
@@ -560,36 +541,31 @@ export interface DefaultEnvironment {
560541

561542
ingestDevice: PeripheralDevice
562543
}
563-
export async function setupDefaultStudioEnvironment(
564-
organizationId: OrganizationId | null = null
565-
): Promise<DefaultEnvironment> {
544+
export async function setupDefaultStudioEnvironment(): Promise<DefaultEnvironment> {
566545
const core = await setupMockCore({})
567546
const systemTriggeredActions = await setupMockTriggeredActions()
568547

569548
const showStyleBaseId: ShowStyleBaseId = getRandomId()
570549
const showStyleVariantId: ShowStyleVariantId = getRandomId()
571550

572-
const studioBlueprint = await setupMockStudioBlueprint(showStyleBaseId, organizationId)
573-
const showStyleBlueprint = await setupMockShowStyleBlueprint(showStyleVariantId, organizationId)
551+
const studioBlueprint = await setupMockStudioBlueprint(showStyleBaseId)
552+
const showStyleBlueprint = await setupMockShowStyleBlueprint(showStyleVariantId)
574553

575554
const showStyleBase = await setupMockShowStyleBase(showStyleBlueprint._id, {
576555
_id: showStyleBaseId,
577-
organizationId: organizationId,
578556
})
579557
const triggeredActions = await setupMockTriggeredActions(showStyleBase._id)
580558
const showStyleVariant = await setupMockShowStyleVariant(showStyleBase._id, { _id: showStyleVariantId })
581559

582560
const studio = await setupMockStudio({
583561
blueprintId: studioBlueprint._id,
584562
supportedShowStyleBase: [showStyleBaseId],
585-
organizationId: organizationId,
586563
})
587564
const ingestDevice = await setupMockPeripheralDevice(
588565
PeripheralDeviceCategory.INGEST,
589566
PeripheralDeviceType.MOS,
590567
PERIPHERAL_SUBTYPE_PROCESS,
591-
studio,
592-
{ organizationId: organizationId }
568+
studio
593569
)
594570
const { worker, workerThreadStatuses } = await setupMockWorker()
595571

@@ -641,7 +617,6 @@ export async function setupDefaultRundown(
641617
const sourceLayerIds = Object.keys(applyAndValidateOverrides(env.showStyleBase.sourceLayersWithOverrides).obj)
642618

643619
const rundown: DBRundown = {
644-
organizationId: null,
645620
studioId: env.studio._id,
646621
showStyleBaseId: env.showStyleBase._id,
647622
showStyleVariantId: env.showStyleVariant._id,

meteor/server/__tests__/cronjobs.test.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,6 @@ describe('cronjobs', () => {
424424
const userAction0 = protectString<UserActionsLogItemId>(getRandomString())
425425
await UserActionsLog.insertAsync({
426426
_id: userAction0,
427-
organizationId: null,
428427
userId: null,
429428
args: '',
430429
clientAddress: '',
@@ -437,7 +436,6 @@ describe('cronjobs', () => {
437436
const userAction1 = protectString<UserActionsLogItemId>(getRandomString())
438437
await UserActionsLog.insertAsync({
439438
_id: userAction1,
440-
organizationId: null,
441439
userId: null,
442440
args: '',
443441
clientAddress: '',
@@ -458,7 +456,6 @@ describe('cronjobs', () => {
458456
const snapshot0 = protectString<SnapshotId>(getRandomString())
459457
await Snapshots.insertAsync({
460458
_id: snapshot0,
461-
organizationId: null,
462459
comment: '',
463460
fileName: '',
464461
name: '',
@@ -471,7 +468,6 @@ describe('cronjobs', () => {
471468
const snapshot1 = protectString<SnapshotId>(getRandomString())
472469
await Snapshots.insertAsync({
473470
_id: snapshot1,
474-
organizationId: null,
475471
comment: '',
476472
fileName: '',
477473
name: '',
@@ -498,7 +494,6 @@ describe('cronjobs', () => {
498494
const deviceId = protectString<PeripheralDeviceId>(getRandomString())
499495
await PeripheralDevices.insertAsync({
500496
_id: deviceId,
501-
organizationId: null,
502497
type: PeripheralDeviceType.PLAYOUT,
503498
category: PeripheralDeviceCategory.PLAYOUT,
504499
configManifest: {
@@ -578,7 +573,6 @@ describe('cronjobs', () => {
578573
const studioId = protectString<StudioId>(getRandomString())
579574
await Studios.insertAsync({
580575
_id: studioId,
581-
organizationId: null,
582576
name: 'Studio',
583577
blueprintConfigWithOverrides: newObjectWithOverrides({}),
584578
_rundownVersionHash: '',

meteor/server/api/__tests__/cleanup.test.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ import { Collections } from '../../collections/lib'
5151
import { generateTranslationBundleOriginId } from '../translationsBundles'
5252
import { CollectionCleanupResult } from '@sofie-automation/meteor-lib/dist/api/system'
5353
import { DBNotificationTargetType } from '@sofie-automation/corelib/dist/dataModel/Notifications'
54+
import { CollectionName } from '@sofie-automation/corelib/dist/dataModel/Collections'
5455

5556
describe('Cleanup', () => {
5657
let env: DefaultEnvironment
@@ -67,6 +68,15 @@ describe('Cleanup', () => {
6768
expect(typeof result).not.toBe('string')
6869

6970
for (const name of Collections.keys()) {
71+
// Some collections have no 'owner'
72+
if (
73+
name === CollectionName.Blueprints ||
74+
name === CollectionName.Studios ||
75+
name === CollectionName.ShowStyleBases ||
76+
name === CollectionName.PeripheralDevices
77+
)
78+
continue
79+
7080
// Check that the collection has been handled in the function cleanupOldDataInner:
7181
expect(result).toHaveProperty(name)
7282
}
@@ -248,7 +258,6 @@ async function setDefaultDatatoDB(env: DefaultEnvironment, now: number) {
248258
await Evaluations.insertAsync({
249259
_id: getRandomId(),
250260
answers: {} as any,
251-
organizationId: null,
252261
playlistId,
253262
studioId,
254263
timestamp: now,
@@ -401,7 +410,6 @@ async function setDefaultDatatoDB(env: DefaultEnvironment, now: number) {
401410
created: now,
402411
fileName: '',
403412
name: '',
404-
organizationId: null,
405413
type: '' as any,
406414
version: '',
407415
})
@@ -427,7 +435,6 @@ async function setDefaultDatatoDB(env: DefaultEnvironment, now: number) {
427435
clientAddress: '',
428436
context: '',
429437
method: '',
430-
organizationId: null,
431438
timestamp: now,
432439
userId: null,
433440
})
@@ -469,7 +476,6 @@ async function setDefaultDatatoDB(env: DefaultEnvironment, now: number) {
469476
if (
470477
[
471478
// Ignore these:
472-
'organizations',
473479
'Users',
474480
// Deprecated:
475481
'mediaObjects',

meteor/server/api/__tests__/externalMessageQueue.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ describe('Test external message queue static methods', () => {
6565
peripheralDeviceId: studioEnv.ingestDevice._id,
6666
nrcsName: 'mockNRCS',
6767
},
68-
organizationId: protectString(''),
6968
timing: {
7069
type: PlaylistTimingType.None,
7170
},

meteor/server/api/__tests__/peripheralDevice.test.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ describe('test peripheralDevice general API methods', () => {
101101
peripheralDeviceId: env.ingestDevice._id,
102102
nrcsName: 'mockNRCS',
103103
},
104-
organizationId: protectString(''),
105104
timing: {
106105
type: PlaylistTimingType.None,
107106
},
@@ -632,7 +631,6 @@ describe('test peripheralDevice general API methods', () => {
632631
env = await setupDefaultStudioEnvironment()
633632
await PeripheralDevices.insertAsync({
634633
_id: deviceId,
635-
organizationId: null,
636634
name: 'Mock Media Manager',
637635
deviceName: 'Media Manager',
638636
studioAndConfigId: {

meteor/server/api/__tests__/userActions/system.test.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,13 @@ describe('User Actions - Disable Peripheral SubDevice', () => {
3131
const mockSubDeviceId = 'mockSubDevice0'
3232

3333
beforeEach(async () => {
34-
const organizationId = null
35-
env = await setupDefaultStudioEnvironment(organizationId)
34+
env = await setupDefaultStudioEnvironment()
3635
pDevice = await setupMockPeripheralDevice(
3736
PeripheralDeviceCategory.PLAYOUT,
3837
PeripheralDeviceType.PLAYOUT,
3938
PERIPHERAL_SUBTYPE_PROCESS,
4039
env.studio,
4140
{
42-
organizationId,
4341
configManifest: {
4442
deviceConfigSchema: JSONBlobStringify({}), // unused
4543
subdeviceManifest: {
@@ -163,7 +161,6 @@ describe('User Actions - Disable Peripheral SubDevice', () => {
163161
PERIPHERAL_SUBTYPE_PROCESS,
164162
env.studio,
165163
{
166-
organizationId: null,
167164
configManifest: {
168165
deviceConfigSchema: JSONBlobStringify({}), // unused
169166
subdeviceManifest: {

meteor/server/api/blueprints/__tests__/api.test.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ describe('Test blueprint management api', () => {
4242
const blueprint: Blueprint = {
4343
_id: getRandomId(),
4444
name: 'Fake blueprint',
45-
organizationId: null,
4645
hasCode: true,
4746
code: `({default: (() => 5)()})`,
4847
created: 0,
@@ -305,7 +304,6 @@ describe('Test blueprint management api', () => {
305304
literal<Omit<Blueprint, 'created' | 'modified' | 'databaseVersion' | 'blueprintHash'>>({
306305
_id: protectString('tmp_showstyle'),
307306
name: 'tmp_showstyle',
308-
organizationId: null,
309307
blueprintType: BLUEPRINT_TYPE,
310308
blueprintId: 'ss1',
311309
blueprintVersion: '0.1.0',
@@ -345,7 +343,6 @@ describe('Test blueprint management api', () => {
345343
literal<Omit<Blueprint, 'created' | 'modified' | 'databaseVersion' | 'blueprintHash'>>({
346344
_id: protectString('tmp_studio'),
347345
name: 'tmp name',
348-
organizationId: null,
349346
blueprintId: '',
350347
blueprintType: BLUEPRINT_TYPE,
351348
blueprintVersion: '0.1.0',
@@ -386,7 +383,6 @@ describe('Test blueprint management api', () => {
386383
literal<Omit<Blueprint, 'created' | 'modified' | 'databaseVersion' | 'blueprintHash'>>({
387384
_id: protectString('tmp_system'),
388385
name: 'tmp name',
389-
organizationId: null,
390386
blueprintId: 'sys',
391387
blueprintType: BLUEPRINT_TYPE,
392388
blueprintVersion: '0.1.0',
@@ -430,7 +426,6 @@ describe('Test blueprint management api', () => {
430426
literal<Omit<Blueprint, 'created' | 'modified' | 'databaseVersion' | 'blueprintHash'>>({
431427
_id: existingBlueprint._id,
432428
name: existingBlueprint.name,
433-
organizationId: null,
434429
blueprintId: '',
435430
blueprintType: BLUEPRINT_TYPE,
436431
blueprintVersion: '0.1.0',
@@ -476,7 +471,6 @@ describe('Test blueprint management api', () => {
476471
literal<Omit<Blueprint, 'created' | 'modified' | 'databaseVersion' | 'blueprintHash'>>({
477472
_id: existingBlueprint._id,
478473
name: existingBlueprint.name,
479-
organizationId: null,
480474
blueprintId: 'ss1',
481475
blueprintType: BLUEPRINT_TYPE,
482476
blueprintVersion: '0.1.0',

meteor/server/api/blueprints/__tests__/lib.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ export function generateFakeBlueprint(
2929
return literal<Blueprint>({
3030
_id: protectString(id),
3131
name: 'Fake blueprint',
32-
organizationId: null,
3332
hasCode: true,
3433
code: `({default: (${codeFcnString})()})`,
3534
created: 0,

0 commit comments

Comments
 (0)