Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ protos/
src/openapi/
README.md
tsconfig.json
docker-compose-dev.yaml
docker-compose-dev.yaml
packages/fishjam-openapi/src/generated/
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ models/StreamsListingResponse.ts
models/SubscribeMode.ts
models/SubscribeTracksRequest.ts
models/Subscriptions.ts
models/TemplateSource.ts
models/TemplateSourceResolution.ts
models/Track.ts
models/TrackForwarding.ts
models/TrackForwardingInfo.ts
Expand Down
12 changes: 6 additions & 6 deletions packages/fishjam-openapi/src/generated/apis/RecordingsApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import {
RecordingStatusToJSON,
} from '../models/RecordingStatus';

export interface CreateRecordingRequest {
export interface CreateRecordingOperationRequest {
recordingConfig: RecordingConfig;
}

Expand Down Expand Up @@ -63,7 +63,7 @@ export class RecordingsApi extends runtime.BaseAPI {
/**
* Creates request options for createRecording without sending the request
*/
async createRecordingRequestOpts(requestParameters: CreateRecordingRequest): Promise<runtime.RequestOpts> {
async createRecordingRequestOpts(requestParameters: CreateRecordingOperationRequest): Promise<runtime.RequestOpts> {
if (requestParameters['recordingConfig'] == null) {
throw new runtime.RequiredError(
'recordingConfig',
Expand Down Expand Up @@ -98,21 +98,21 @@ export class RecordingsApi extends runtime.BaseAPI {
}

/**
* Create a recording resource. Capturing starts synchronously, so it is returned with status `active`.
* Create a recording resource. Capturing starts synchronously, so it is returned with status `active`. A source naming an `outputId` records an output the composition already has and is sent as JSON. A template source renders its own scene and has to be sent as `multipart/form-data`: the configuration in a `config` part, the React bundle in a `template` part.
* Create a recording
*/
async createRecordingRaw(requestParameters: CreateRecordingRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<RecordingDetailsResponse>> {
async createRecordingRaw(requestParameters: CreateRecordingOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<RecordingDetailsResponse>> {
const requestOptions = await this.createRecordingRequestOpts(requestParameters);
const response = await this.request(requestOptions, initOverrides);

return new runtime.JSONApiResponse(response, (jsonValue) => RecordingDetailsResponseFromJSON(jsonValue));
}

/**
* Create a recording resource. Capturing starts synchronously, so it is returned with status `active`.
* Create a recording resource. Capturing starts synchronously, so it is returned with status `active`. A source naming an `outputId` records an output the composition already has and is sent as JSON. A template source renders its own scene and has to be sent as `multipart/form-data`: the configuration in a `config` part, the React bundle in a `template` part.
* Create a recording
*/
async createRecording(requestParameters: CreateRecordingRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<RecordingDetailsResponse> {
async createRecording(requestParameters: CreateRecordingOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<RecordingDetailsResponse> {
const response = await this.createRecordingRaw(requestParameters, initOverrides);
return await response.value();
}
Expand Down
83 changes: 38 additions & 45 deletions packages/fishjam-openapi/src/generated/models/RecordingSource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,41 +12,27 @@
* Do not edit the class manually.
*/

import { mapValues } from '../runtime';
import type { CompositionSource } from './CompositionSource';
import {
instanceOfCompositionSource,
CompositionSourceFromJSON,
CompositionSourceFromJSONTyped,
CompositionSourceToJSON,
} from './CompositionSource';
import type { TemplateSource } from './TemplateSource';
import {
instanceOfTemplateSource,
TemplateSourceFromJSON,
TemplateSourceFromJSONTyped,
TemplateSourceToJSON,
} from './TemplateSource';

/**
* @type RecordingSource
* The source for the recording
* @export
* @interface RecordingSource
*/
export interface RecordingSource {
/**
* URL of the composition to record
* @type {string}
* @memberof RecordingSource
*/
compositionURL: string;
/**
* Id of the output being recorded
* @type {string}
* @memberof RecordingSource
*/
outputId: string;
/**
* Scale factor for the recording relative to the source output (>0; may upscale or downscale). Defaults to 1.
* @type {number}
* @memberof RecordingSource
*/
scaleRatio?: number;
}

/**
* Check if a given object implements the RecordingSource interface.
*/
export function instanceOfRecordingSource(value: object): value is RecordingSource {
if (!('compositionURL' in value) || value['compositionURL'] === undefined) return false;
if (!('outputId' in value) || value['outputId'] === undefined) return false;
return true;
}
export type RecordingSource = CompositionSource | TemplateSource;

export function RecordingSourceFromJSON(json: any): RecordingSource {
return RecordingSourceFromJSONTyped(json, false);
Expand All @@ -56,28 +42,35 @@ export function RecordingSourceFromJSONTyped(json: any, ignoreDiscriminator: boo
if (json == null) {
return json;
}
return {

'compositionURL': json['compositionURL'],
'outputId': json['outputId'],
'scaleRatio': json['scaleRatio'] == null ? undefined : json['scaleRatio'],
};
if (typeof json !== 'object') {
return json;
}
if (instanceOfCompositionSource(json)) {
return CompositionSourceFromJSONTyped(json, true);
}
if (instanceOfTemplateSource(json)) {
return TemplateSourceFromJSONTyped(json, true);
}
return {} as any;
}

export function RecordingSourceToJSON(json: any): RecordingSource {
export function RecordingSourceToJSON(json: any): any {
return RecordingSourceToJSONTyped(json, false);
}

export function RecordingSourceToJSONTyped(value?: RecordingSource | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}

return {

'compositionURL': value['compositionURL'],
'outputId': value['outputId'],
'scaleRatio': value['scaleRatio'],
};
if (typeof value !== 'object') {
return value;
}
if (instanceOfCompositionSource(value)) {
return CompositionSourceToJSON(value as CompositionSource);
}
if (instanceOfTemplateSource(value)) {
return TemplateSourceToJSON(value as TemplateSource);
}
return {};
}

90 changes: 90 additions & 0 deletions packages/fishjam-openapi/src/generated/models/TemplateSource.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
/* tslint:disable */
/* eslint-disable */
/**
* Fishjam API
* API for managing Fishjam real-time media resources. ## Authentication ## Credentials (Fishjam ID, Fishjam Management Token) can be obtained at https://fishjam.io/app. All requests require HTTP Bearer authorization using the Fishjam Management Token. ## Fishjam SDKs ## For TypeScript and Python users, we provide SDKs that simplify using this API. We recommend using them instead of manually consuming the API in these languages. You can learn more about our SDKs in our [SDK Docs](http://fishjam.swmansion.com/docs/how-to/backend/server-setup)
*
* The version of the OpenAPI document: 0.30.0
* Contact: [email protected]
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/

import { mapValues } from '../runtime';
import type { TemplateSourceResolution } from './TemplateSourceResolution';
import {
TemplateSourceResolutionFromJSON,
TemplateSourceResolutionFromJSONTyped,
TemplateSourceResolutionToJSON,
TemplateSourceResolutionToJSONTyped,
} from './TemplateSourceResolution';

/**
* Recording source that renders its own scene from a template, rather than cloning an existing output of the composition
* @export
* @interface TemplateSource
*/
export interface TemplateSource {
/**
* Whether the recording captures audio. Defaults to true.
* @type {boolean}
* @memberof TemplateSource
*/
audio?: boolean;
/**
* URL of the composition to record
* @type {string}
* @memberof TemplateSource
*/
compositionURL: string;
/**
*
* @type {TemplateSourceResolution}
* @memberof TemplateSource
*/
resolution?: TemplateSourceResolution;
}

/**
* Check if a given object implements the TemplateSource interface.
*/
export function instanceOfTemplateSource(value: object): value is TemplateSource {
if (!('compositionURL' in value) || value['compositionURL'] === undefined) return false;
return true;
}

export function TemplateSourceFromJSON(json: any): TemplateSource {
return TemplateSourceFromJSONTyped(json, false);
}

export function TemplateSourceFromJSONTyped(json: any, ignoreDiscriminator: boolean): TemplateSource {
if (json == null) {
return json;
}
return {

'audio': json['audio'] == null ? undefined : json['audio'],
'compositionURL': json['compositionURL'],
'resolution': json['resolution'] == null ? undefined : TemplateSourceResolutionFromJSON(json['resolution']),
};
}

export function TemplateSourceToJSON(json: any): TemplateSource {
return TemplateSourceToJSONTyped(json, false);
}

export function TemplateSourceToJSONTyped(value?: TemplateSource | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}

return {

'audio': value['audio'],
'compositionURL': value['compositionURL'],
'resolution': TemplateSourceResolutionToJSON(value['resolution']),
};
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
/* tslint:disable */
/* eslint-disable */
/**
* Fishjam API
* API for managing Fishjam real-time media resources. ## Authentication ## Credentials (Fishjam ID, Fishjam Management Token) can be obtained at https://fishjam.io/app. All requests require HTTP Bearer authorization using the Fishjam Management Token. ## Fishjam SDKs ## For TypeScript and Python users, we provide SDKs that simplify using this API. We recommend using them instead of manually consuming the API in these languages. You can learn more about our SDKs in our [SDK Docs](http://fishjam.swmansion.com/docs/how-to/backend/server-setup)
*
* The version of the OpenAPI document: 0.30.0
* Contact: [email protected]
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/

import { mapValues } from '../runtime';
/**
* Resolution the scene is rendered at. Defaults to 1280x720.
* @export
* @interface TemplateSourceResolution
*/
export interface TemplateSourceResolution {
/**
*
* @type {number}
* @memberof TemplateSourceResolution
*/
height: number;
/**
*
* @type {number}
* @memberof TemplateSourceResolution
*/
width: number;
}

/**
* Check if a given object implements the TemplateSourceResolution interface.
*/
export function instanceOfTemplateSourceResolution(value: object): value is TemplateSourceResolution {
if (!('height' in value) || value['height'] === undefined) return false;
if (!('width' in value) || value['width'] === undefined) return false;
return true;
}

export function TemplateSourceResolutionFromJSON(json: any): TemplateSourceResolution {
return TemplateSourceResolutionFromJSONTyped(json, false);
}

export function TemplateSourceResolutionFromJSONTyped(json: any, ignoreDiscriminator: boolean): TemplateSourceResolution {
if (json == null) {
return json;
}
return {

'height': json['height'],
'width': json['width'],
};
}

export function TemplateSourceResolutionToJSON(json: any): TemplateSourceResolution {
return TemplateSourceResolutionToJSONTyped(json, false);
}

export function TemplateSourceResolutionToJSONTyped(value?: TemplateSourceResolution | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}

return {

'height': value['height'],
'width': value['width'],
};
}

2 changes: 2 additions & 0 deletions packages/fishjam-openapi/src/generated/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ export * from './StreamsListingResponse';
export * from './SubscribeMode';
export * from './SubscribeTracksRequest';
export * from './Subscriptions';
export * from './TemplateSource';
export * from './TemplateSourceResolution';
export * from './Track';
export * from './TrackForwarding';
export * from './TrackForwardingInfo';
Expand Down
2 changes: 1 addition & 1 deletion packages/fishjam-proto/protos
Loading
Loading