Hierarchy

  • OctoPrintClient

Constructors

Properties

apiKey: string = ""
baseUrl: string = ""
connectPrinter: ((this: OctoPrintClient, port: string, baudrate: number, printerProfile: string, save?: boolean, autoconnect?: boolean) => Promise<HttpResponse<undefined>>) = General.connectPrinter

Type declaration

    • (this: OctoPrintClient, port: string, baudrate: number, printerProfile: string, save?: boolean, autoconnect?: boolean): Promise<HttpResponse<undefined>>
    • Instructs OctoPrint to connect or, if already connected, reconnect to the printer. Additional parameters are:

      Returns

      Parameters

      • this: OctoPrintClient
      • port: string

        Optional, specific port to connect to. If not set the current portPreference will be used, or if no preference is available auto detection will be attempted.

      • baudrate: number

        Optional, specific baudrate to connect with. If not set the current baudratePreference will be used, or if no preference is available auto detection will be attempted.

      • printerProfile: string

        Optional, specific printer profile to use for connection. If not set the current default printer profile will be used.

      • save: boolean = false

        Optional, whether to save the request’s port and baudrate settings as new preferences. Defaults to false if not set.

      • autoconnect: boolean = false

        Optional, whether to automatically connect to the printer on OctoPrint’s startup in the future. If not set no changes will be made to the current configuration.

      Returns Promise<HttpResponse<undefined>>

connection: ((this: OctoPrintClient) => Promise<HttpResponse<ConnectionSettings>>) = General.connection

Type declaration

copyFile: ((this: OctoPrintClient, location: "local" | "sdcard", src: string, dest: string) => Promise<HttpResponse<CopyFileResponse>>) = Files.copyFile

Type declaration

delete: (<T>(this: OctoPrintClient, url: string, bodyArgs?: {}) => Promise<HttpResponse<T>>) = del

Type declaration

deleteFile: ((this: OctoPrintClient, location: "local" | "sdcard", filepath: string) => Promise<HttpResponse<undefined>>) = Files.deleteFile

Type declaration

    • (this: OctoPrintClient, location: "local" | "sdcard", filepath: string): Promise<HttpResponse<undefined>>
    • Returns

      Parameters

      • this: OctoPrintClient
      • location: "local" | "sdcard"
      • filepath: string

        Should start with local/... or sdcard/...

      Returns Promise<HttpResponse<undefined>>

disconnectPrinter: ((this: OctoPrintClient) => Promise<HttpResponse<undefined>>) = General.disconnectPrinter

Type declaration

feedrate: ((this: OctoPrintClient, feedrate: number) => Promise<HttpResponse<unknown>>) = Printer.feedrate

Type declaration

files: ((this: OctoPrintClient) => Promise<HttpResponse<GetFilesResponse>>) = Files.files

Type declaration

    • (this: OctoPrintClient): Promise<HttpResponse<GetFilesResponse>>
    • Retrieve information regarding all files currently available and regarding the disk space still available locally in the system. The results are cached for performance reasons. If you want to override the cache, supply the query parameter force and set it to true. Note that while printing a refresh/override of the cache for files stored on the printer’s SD card is disabled due to bandwidth restrictions on the serial interface. By default only returns the files and folders in the root directory. If the query parameter recursive is provided and set to true, returns all files and folders.

      Returns

      Parameters

      Returns Promise<HttpResponse<GetFilesResponse>>

get: (<T>(this: OctoPrintClient, url: string, bodyArgs?: {}) => Promise<HttpResponse<T>>) = get

Type declaration

home: ((this: OctoPrintClient, axes: HOME) => Promise<HttpResponse<undefined>>) = Printer.home

Type declaration

jobCommand: ((this: OctoPrintClient, cmd: JobCommands) => Promise<HttpResponse<undefined>>) = Job.jobCommand

Type declaration

jobInformation: ((this: OctoPrintClient) => Promise<HttpResponse<JobInformation>>) = Job.jobInformation

Type declaration

jog: ((this: OctoPrintClient, x?: number, y?: number, z?: number, absolute?: boolean, speed?: number) => Promise<HttpResponse<unknown>>) = Printer.jog

Type declaration

    • (this: OctoPrintClient, x?: number, y?: number, z?: number, absolute?: boolean, speed?: number): Promise<HttpResponse<unknown>>
    • Parameters

      • this: OctoPrintClient
      • Optional x: number
      • Optional y: number
      • Optional z: number
      • Optional absolute: boolean
      • Optional speed: number

      Returns Promise<HttpResponse<unknown>>

languages: ((this: OctoPrintClient) => Promise<HttpResponse<LanguagesResponse>>) = Languages.languages

Type declaration

moveFile: ((this: OctoPrintClient, location: "local" | "sdcard", src: string, dest: string) => Promise<HttpResponse<MoveFileResponse>>) = Files.moveFile

Type declaration

post: (<T>(this: OctoPrintClient, url: string, bodyArgs?: {}) => Promise<HttpResponse<T>>) = post

Type declaration

print: ((this: OctoPrintClient, file: string) => Promise<HttpResponse<unknown>>) = Files.print

Type declaration

server: ((this: OctoPrintClient) => Promise<HttpResponse<ServerInformation>>) = General.server

Type declaration

sliceFile: ((this: OctoPrintClient, filepath: string, args: SliceRequest) => Promise<HttpResponse<SliceFileResponse>>) = Files.sliceFile

Type declaration

status: ((this: OctoPrintClient) => Promise<HttpResponse<PrinterStatus>>) = Printer.status

Type declaration

uploadGcode: ((this: OctoPrintClient, location: "local" | "sdcard", filepath: string, gcode: string) => Promise<HttpResponse<UploadFileToLocalResponse>>) = Files.uploadGcode

Type declaration

version: ((this: OctoPrintClient) => Promise<HttpResponse<VersionInformation>>) = General.version

Type declaration

Methods

Generated using TypeDoc