Skip to content

Commit

Permalink
added H5p File Response interface
Browse files Browse the repository at this point in the history
  • Loading branch information
MajedAlaitwniCap committed Nov 2, 2023
1 parent 803867d commit 72f713d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 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

0 comments on commit 72f713d

Please sign in to comment.