Skip to content

Commit

Permalink
Merge branch 'THR-18-dev-feature-h5p-editor' of https://github.com/hp…
Browse files Browse the repository at this point in the history
…i-schul-cloud/schulcloud-server into THR-18-dev-feature-h5p-editor
  • Loading branch information
casparneumann-cap committed Nov 2, 2023
2 parents 3fd8d88 + 72f713d commit da8e01f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,12 @@ export class H5pFileDto implements File {

mimeType: string;
}

export interface GetH5pFileResponse {
data: Readable;
etag?: string;
contentType?: string;
contentLength?: number;
contentRange?: string;
name: string;
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import { createMock, DeepMocked } from '@golevelup/ts-jest';
import { IUser } from '@lumieducation/h5p-server';
import { Test, TestingModule } from '@nestjs/testing';
import { File, S3ClientAdapter } from '@shared/infra/s3-client';
import { GetFileResponse } from '@src/modules/files-storage/interface';
import { ReadStream } from 'fs';
import { Readable } from 'node:stream';
import { GetH5pFileResponse } from '../controller/dto';
import { H5pEditorTempFile } from '../entity/base-entity-with-timestamp.entity';
import { H5P_CONTENT_S3_CONNECTION } from '../h5p-editor.config';
import { TemporaryFileRepo } from '../repo/temporary-file.repo';
Expand Down Expand Up @@ -187,7 +187,7 @@ describe('TemporaryFileStorage', () => {
it('should return readable file stream', async () => {
const { user1, file1 } = setup();
const actualContent = fileContent(user1.id, file1.filename);
const response: Required<GetFileResponse> = {
const response: Required<GetH5pFileResponse> = {
data: Readable.from(actualContent),
etag: '',
contentType: '',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import { Inject, Injectable, NotAcceptableException } from '@nestjs/common';
import { S3ClientAdapter } from '@shared/infra/s3-client';
import { ReadStream } from 'fs';
import { Readable } from 'stream';
import { H5pFileDto } from '../controller/dto/h5p-file.dto';
import { H5pEditorTempFile } from '../entity/base-entity-with-timestamp.entity';
import { H5P_CONTENT_S3_CONNECTION } from '../h5p-editor.config';
import { TemporaryFileRepo } from '../repo/temporary-file.repo';
import { H5pFileDto } from '../controller/dto/h5p-file.dto';

@Injectable()
export class TemporaryFileStorage implements ITemporaryFileStorage {
Expand Down

0 comments on commit da8e01f

Please sign in to comment.