feat(add-multi-source-support): add multi source support #77
feat(add-multi-source-support): add multi source support #77axel-biehler wants to merge 24 commits intomainfrom
Conversation
ea38848 to
ad2307f
Compare
7212421 to
f6ef12e
Compare
libs/shared/types/src/lib/types.ts
Outdated
| status: EventStatus; | ||
| endpoints: EventEndpoint[]; | ||
| logs: EventLog[]; | ||
| inputType: InputType; |
There was a problem hiding this comment.
Could we move this in the Source object itself instead of having it next to the source?
| SrtDecryptionAlgorithm, | ||
| } from '@trackflix-live/types'; | ||
| import { JSONSchemaType } from 'ajv'; | ||
|
|
There was a problem hiding this comment.
We have to find a way to avoid duplication here, it's would be crazy to have to edit all the schemas when we just want to make a small change
| if (!validate(body)) { | ||
| throw new BadRequestError('Body does not match schema.'); | ||
| } | ||
| if (!body) { |
There was a problem hiding this comment.
Shouldn't AJV validate this already? What is the issue here?
| if (isSrtCaller(source, type)) { | ||
| return this.buildSrtCaller(source, inputName); | ||
| } | ||
| return { |
There was a problem hiding this comment.
Shouldn't we just throw an error here? It shouldn't be possible this reach this return statement right?
libs/shared/types/src/lib/types.ts
Outdated
| @@ -1,3 +1,5 @@ | |||
| import { InputType } from '@aws-sdk/client-medialive'; | |||
There was a problem hiding this comment.
We don't want to couple our shared types with the medialive library, we should redefine InputType ourselves here in this file.
libs/shared/types/src/lib/types.ts
Outdated
| } | ||
|
|
||
| export type S3Source = string; | ||
| export type S3Source = { inputType: InputType; value: string }; |
There was a problem hiding this comment.
We want inputType to be something like InputType.S3 or something, any input type cannot be here, it should be the specific one for the source.
Same for all of them in this file.
| TsFile, | ||
| } from '@trackflix-live/types'; | ||
| import { InputType } from '@aws-sdk/client-medialive'; | ||
|
|
There was a problem hiding this comment.
All theses functions shouldn't take unknown as a parameter, they should take Source and only check for the inputType.
libs/shared/types/src/lib/types.ts
Outdated
|
|
||
| export type S3Source = { inputType: InputType.MP4_FILE; value: string }; | ||
|
|
||
| export type TsFile = { inputType: InputType.TS_FILE; value: string }; |
There was a problem hiding this comment.
Could we make sure all those types end with Source?
TsFileSource, HlsSource, etc...
|
All input types have been tested apart from MediaConnect, however critical information is missing from the front-end which would make the product unusable (you would have to go look the information on the AWS console) |
No description provided.