@oneblink/storage
    Preparing search index...

    Class OneBlinkDownloader

    Used to create an instance of the OneBlinkDownloader, exposing methods to download submissions and other types of files

    Index

    Constructors

    Properties

    apiOrigin: string
    getBearerToken: () => Promise<string | undefined>
    region: string

    Methods

    • Download a draft form submission.

      const result = await downloader.downloadDraftSubmission({
      formSubmissionDraftVersionId: '5ad46e62-f466-451c-8cd6-29ba23ac50b7',
      formId: 1,
      abortSignal: new AbortController().signal,
      })

      Parameters

      • data: DownloadOptions & { formSubmissionDraftVersionId: string }

        The submission upload data and options

        • formSubmissionDraftVersionId: string

          The identifier of the draft form submission version.

      Returns Promise<S3SubmissionData | undefined>

      The submission

    • Download pre-fill form submission data.

      const result = await downloader.downloadPrefillData({
      preFillFormDataId: '5ad46e62-f466-451c-8cd6-29ba23ac50b7',
      formId: 1,
      abortSignal: new AbortController().signal,
      })

      Type Parameters

      • T extends Record<string, unknown>

      Parameters

      • data: DownloadOptions & { formId: number; preFillFormDataId: string }

        The submission upload data and options

        • formId: number

          The identifier of the form associated with the pre-fill data.

        • preFillFormDataId: string

          The identifier of the pre-fill data.

      Returns Promise<T | undefined>

      The submission

    • Download a form submission.

      const result = await downloader.downloadSubmission({
      submissionId: '5ad46e62-f466-451c-8cd6-29ba23ac50b7',
      formId: 1,
      abortSignal: new AbortController().signal,
      })

      Parameters

      • data: DownloadOptions & { formId: number; submissionId: string }

        The submission upload data and options

        • formId: number

          The identifier of the form associated with the submission.

        • submissionId: string

          The identifier of the submission.

      Returns Promise<S3SubmissionData | undefined>

      The submission