Flywheel Extension SDK
    Preparing search index...

    Class Extension

    Index
    channel: Channel
    container: Container
    file: File

    Includes user configurable parameters added to Viewer Registration, as well as fileIds from Flywheel.

    See ViewerParameters for more details

    text: {
        autoFormat?: boolean;
        fileName?: string;
        fileType?: string;
        readOnly?: boolean;
        value: string;
    }
    user: User
    • Add a job to the job queue. Automatically determines whether to add a utility or analysis job based on the gear category.

      Parameters

      • addJobInput: AddJob

        Object containing the job configuration

      • Optionalparent: Container

        Parent container to add the job to (required for analysis jobs)

      Returns Promise<string>

      Promise that resolves with the job ID

    • Add a tag to a container or file.

      Parameters

      • target: File | Container

        Container or file to add the tag to

      • tag: string

        Tag value to add

      Returns Promise<void>

    • Send an arbitrary HTTP request to the Flywheel API via the frontend proxy. The path must start with /api/ — other prefixes will be rejected by the host. The caller is responsible for providing the correct return type T. Requires ReadWrite scope for non-GET requests.

      Type Parameters

      • T = unknown

      Parameters

      • method: HttpMethod

        HTTP method

      • path: string

        API path, must start with /api/

      • Optionalparams: Record<string, unknown>

        Optional query parameters

      • Optionalbody: unknown

        Optional request body

      Returns Promise<T>

    • Signal to Flywheel that this application is ready to close, and terminate the message channel.

      Returns void

    • Execute an ad-hoc view, returning data in the preferred format.

      Parameters

      • id: string

        ID of the container

      • body: DataViewPayloadBody

        Object specifying the criteria of a DataView to be created.

      Returns Promise<DataViewResponse>

    • Get a container in the hierarchy.

      Parameters

      • type: ContainerType

        Type of the container

      • id: string

        ID of the container

      Returns Promise<Container>

    • Get the set of permission actions that the user can take on a container.

      Parameters

      • container: Container

        Container in the hierarchy

      Returns Promise<Set<PermissionAction>>

    • Get a file record by unique ID.

      Parameters

      • fileId: string

        file_id that identifies the file across the Flywheel site

      • options: { version?: number } = {}

        Additional options, such as a specific version of the file

      Returns Promise<File>

      File record

      Flywheel 16.18.0

    • Get the contents of a file as a binary Blob.

      Parameters

      Returns Promise<Blob>

      Flywheel 16.3.0

    • Parameters

      Returns Promise<Blob>

      container is not required as of Flywheel 16.3.0

    • Get the contents of a file as a string.

      Parameters

      Returns Promise<string>

      Flywheel 16.3.0

    • Parameters

      Returns Promise<string>

      container is not required as of Flywheel 16.3.0

    • Get a parameterized URL to a file that will expire in a limited amount of time.

      Parameters

      Returns Promise<string>

      Flywheel 16.3.0

    • Parameters

      Returns Promise<string>

      container is not required as of Flywheel 16.3.0

    • Get a job by ID.

      Parameters

      • jobId: string

        ID of the job

      Returns Promise<Job>

      Promise that resolves with the Job object

    • Get a role by ID.

      Parameters

      • roleId: string

        ID of the role

      Returns Promise<Role>

      Promise that resolves with the Role object

    • Get a list of gears on an instance, matching a query if provided.

      Parameters

      Returns Promise<Gear[]>

      A pagination response with current and total items

    • Get a setting associated to a container in the hierarchy.

      Parameters

      • containerId: string = 'site'

        ID of the container. Defaults to 'site'

      • settingKey: string

        Key of the setting

      Returns Promise<any>

    • Remove a tag from a container or file.

      Parameters

      • target: File | Container

        Container or file to remove the tag from

      • tag: string

        Tag value to remove

      Returns Promise<void>

    • Update the custom info of a container.

      Parameters

      • container: Container

        Container instance

      • info: InfoUpdate

        Object specifying which info keys to set or delete, or a total replace object

      Returns Promise<void>

    • Update the custom info of a file.

      Parameters

      • file: File

        File instance

      • info: InfoUpdate

        Object specifying which info keys to set or delete, or a total replace object

      Returns Promise<void>

    • Parameters

      Returns Promise<void>

      container is not required as of Flywheel 16.3.0

    • Update the height and/or width of the extension frame.

      Parameters

      • viewport: { height?: number; width?: number }

        Viewport dimensions

      Returns void

    • Upload a file to a container. Upload progress is emitted as observable events. Use .toPromise() on the return value to get a Promise that resolves when the upload is complete.

      Parameters

      • container: Container

        Container that the file will be attached to

      • file: File

        File instance from an <input> element or FileList

      • options: { filename?: string; preserveMetadata?: boolean } = {}
        • Optionalfilename?: string

          Override the name of the file, default to source filesystem name

        • OptionalpreserveMetadata?: boolean

          Copy info metadata from latest version to the new file version, if there is an existing version of the file. Available from Flywheel 16.8.0.

      Returns Observable<FileUploadEvent>

      Observable that emits upload progress events

    • Upload a string back to the component which instantiated this extension. Used for editing strings in place without an associated file.

      Parameters

      • text: string

        String contents to be passed back to Flywheel Available from Flywheel 17.4.0

      Returns Promise<void>

      Promise signaling completion of upload

    • Wait for Flywheel to connect to this application.

      Returns Promise<Extension>

    • Update a setting for the given container in the hierarchy.

      Parameters

      • containerId: string = 'site'

        ID of the container. Defaults to 'site'

      • settingKey: string

        Key of the setting

      • data: any

        Value of the setting

      Returns Promise<void>