Options
All
  • Public
  • Public/Protected
  • All
Menu

Helper class for tracking intent when creating a File object for uploading

Hierarchy

Index

Constructors

  • new EdgeFile(data?: any, fileFormat?: string, name?: string, createOpts?: {}, urlOpts?: string): EdgeFile

Methods

  • createFile(client: Client, force?: boolean): Promise<any>
  • Helper function to create the file on the server but not yet upload its data

    By default, this will skip recreating files that have already been created.

    Parameters

    • client: Client

      Client object to use for uploading

    • force: boolean = false

      If true, will force creation of a new ID even if file has already been uploaded

    Returns Promise<any>

  • setData(data: any): void
  • Populate data for later uploading if it wasn't set during construction

    Cannot run this function if the file has already been uploaded

    Overwrites any existing data

    Parameters

    • data: any

      Data to use for uploading

    Returns void

  • upload(client: Client, force?: boolean): Promise<File>
  • Upload curent File object to the server

    By default, this will skip reuploading files that have already been uploaded.

    Parameters

    • client: Client

      Client object to use for uploading

    • force: boolean = false

      If true, will force upload even if file has already been uploaded

    Returns Promise<File>

    Promise that resolves to the uploaded File object when it completes uploading

  • uploadData(client: Client, force?: boolean): Promise<any>
  • Helper function to upload the data to the server

    By default, this will skip reuploading data that has already been uploaded.

    Parameters

    • client: Client

      Client object to use for uploading

    • force: boolean = false

      If true, will force upload even if file has already been uploaded

    Returns Promise<any>

Properties

createOpts: Record<string, any>
fileFormat: string
name: string
type: FileType
uploadUrlOpts: string

Accessors

  • get data(): any
  • Returns any

  • get fileCreateResponse(): any
  • Returns any

  • get fileCreated(): boolean
  • Returns boolean

  • get fileID(): undefined | string
  • Returns undefined | string

  • get fileUploadResponse(): any
  • Returns any

  • get fileUploaded(): any
  • Returns any