Project Project File

Endpoints for managing project files.

'/projects/{id}/project-files'

GET

async find(
    @param.path.number('id') id: number,
    @param.query.object('filter') filter?: Filter<ProjectFile>,
  ): Promise<ProjectFile[]>

Auth: No

Retrieve project files for a given project.

'/users/{id}/project-images'

POST

async imageUpload(
    @param.path.string('id') id: typeof User.prototype.id,
    @requestBody.file() request: Request,
    @inject(RestBindings.Http.RESPONSE) response: Response,
  ): Promise<object>

Auth: Yes RBAC: Admin, User (owner)

Upload an image for a given project.

'/users/{id}/project-files'

POST

async fileUpload(
    @param.path.string('id') id: typeof User.prototype.id,
    @requestBody.file() request: Request,
    @inject(RestBindings.Http.RESPONSE) response: Response,
  ): Promise<object>

Auth: Yes RBAC: Admin, User (owner)

Upload a file for a given project.

'/users/{id}/project-files/{fileId}'

GET

async downloadFile(
    @param.path.string('id') id: typeof User.prototype.id,
    @param.path.number('fileId') fileId: typeof ProjectFile.prototype.id,
    @inject(RestBindings.Http.RESPONSE) response: Response,
  ): Promise<Response>

Auth: No

Download a specific file by ID for a given project.

PATCH

async patch(
    @param.path.string('id') id: typeof User.prototype.id,
    @param.path.number('fileId') fileId: typeof ProjectFile.prototype.id,
    @requestBody({
      content: {
        'application/json': {
          schema: getModelSchemaRef(ProjectFile, {partial: true}),
        },
      },
    })
    projectFile: Partial<ProjectFile>,
  ): Promise<void>

Auth: Yes RBAC: Admin, User (owner)

Update a specific file by ID for a given project.

DEL

async delete(
    @param.path.string('id') id: typeof User.prototype.id,
    @param.path.number('fileId') fileId: typeof ProjectFile.prototype.id,
  ): Promise<void>

Auth: Yes RBAC: Admin, User (owner)

Delete a specific file by ID for a given project.

'/project-files/{fileId}/download'

GET

async downloadProjectFile(
    @param.path.number('fileId') fileId: typeof ProjectFile.prototype.id,
    @inject(RestBindings.Http.RESPONSE) response: Response,
  ): Promise<Response>

Auth: No

Download a specific file by ID for a given project.

Last updated