• Get an attachment upload url

    Parameters

    • bucketFolder: string

      bucket folder you want to hold the attachment

    • contentType: string

      content type of the attachment

    • contentLength: number

      content length of the attachment

    • config: AttachmentUploadConfigurations

      attachment upload configurations

      • allowedAttachmentContentTypes : allowed attachment content types eg. ['image/png', 'image/jpeg']
      • maxAttachmentSizeMB : max attachment size in MB
    • attachmentService: AttachmentService

      injected service use to handle the attachment related operations

      • generateUploadSignedUrl
    • logger: Logger

      injected logger used to handle the logging

    • context: AdapterHandlerContext

      request context [headers, body, params, query].

    Returns Promise<AdapterHandlerResponse>

    200 Status OK

    • data: upload signed url

    Description

    This handler is used to get an attachment upload url by applying the following steps in sequence:

    1. Check if contentType is allowed

    2. Check if contentLength is bigger than allowed max content length

    3. Generate upload signed url (attachmentService.generateUploadSignedUrl)

    4. Return the upload signed url

    Throws

    400 NBError Bad Request

    • contentType is not allowed
    • contentLength is bigger than allowed max content length

    Example: example response body

    {
    "data": "https://example.com/signed-url"
    }

Generated using TypeDoc