Options
All
  • Public
  • Public/Protected
  • All
Menu

Class lines

The LineService allows you to access data about Lines in Qminder.

For example, list all Lines of your Location:

import * as Qminder from 'qminder-api';
Qminder.setKey('API_KEY_GOES_HERE');

const locationId = 12345;
const lines = await Qminder.lines.list(locationId);

console.log(lines);

Hierarchy

  • lines

Index

Constructors

constructor

Methods

Static archive

  • archive(line: IdOrObject<Line>): Promise<any>
  • Archive a Line. This archives the line and removes it from the line list, from iPads and TVs, from the service screen and from statistics. The line can be unarchived.

    Calls the following HTTP API: POST /lines/<ID>/archive

    For example:

    await Qminder.lines.archive(1425);
    

    Parameters

    • line: IdOrObject<Line>

      the Line or the line's ID to archive

    Returns Promise<any>

    A Promise that resolves when the line was archived, and rejects when something went wrong.

Static create

  • create(location: IdOrObject<Location>, line: LineCreateParameters): Promise<Line>
  • Create a new Line and return its details.

    Calls the following HTTP API: POST /locations/<ID>/lines

    For example:

    const line: Line = await Qminder.lines.create(950, { name: 'Priority Service' });
    console.log(line.id); // 1425
    

    Parameters

    • location: IdOrObject<Location>

      the location to add the line under

    • line: LineCreateParameters

      the parameters of the new line - must include the line name

    Returns Promise<Line>

    a Promise that resolves to a new Line object, created according to the parameters.

Static delete

  • delete(line: IdOrObject<Line>): Promise<any>
  • Delete a Line. This deletes the line and removes it from the line list, from iPads and TVs, from the service screen and from statistics. This action cannot be undone.

    Calls the following HTTP API: DELETE /lines/<ID>

    For example:

    await Qminder.lines.delete(1425);
    

    Parameters

    • line: IdOrObject<Line>

      the Line or the line's ID to delete

    Returns Promise<any>

    A Promise that resolves when the line was deleted, and rejects when something went wrong.

Static details

  • details(line: IdOrObject<Line>): Promise<Line>
  • Fetch detailed information about one line.

    Calls the following HTTP API: GET /lines/<ID>

    For example:

    const line: Line = await Qminder.lines.details(1425);
    

    Parameters

    • line: IdOrObject<Line>

      The line to get detailed info about, or the line's ID.

    Returns Promise<Line>

    a promise that resolves to the Line object, or rejects if something went wrong.

Static disable

  • disable(line: IdOrObject<Line>): Promise<any>
  • Disable a Line.

    Calls the following HTTP API: POST /lines/<ID>/disable

    For example:

    await Qminder.lines.disable(1425);
    

    Parameters

    • line: IdOrObject<Line>

      the Line or the ID of the line to be disabled.

    Returns Promise<any>

    A Promise that resolves when the line was disabled, and rejects when there active tickets in the line or something went wrong.

Static enable

  • enable(line: IdOrObject<Line>): Promise<any>
  • Enable a disabled Line.

    Calls the following HTTP API: POST /lines/<ID>/enable

    For example:

    await Qminder.lines.enable(1425);
    

    Parameters

    • line: IdOrObject<Line>

      the Line or the ID of the line to be enabled.

    Returns Promise<any>

    A Promise that resolves when the line was enabled, and rejects when something went wrong.

Static list

  • Fetch the location's line list. The lines will have the line ID, name, and color filled in.

    Calls the following HTTP API: GET /locations/<ID>/lines

    For example:

    const lines = await Qminder.lines.list(159);
    

    Parameters

    • location: IdOrObject<Location>

      the Location or its ID

    Returns Promise<Line[]>

    a promise that resolves to a list of lines, or rejects if something went wrong.

Static unarchive

  • unarchive(line: IdOrObject<Line>): Promise<any>
  • Unarchive a Line.

    Calls the following HTTP API: POST /lines/<ID>/unarchive

    For example:

    await Qminder.lines.unarchive(1425);
    

    Parameters

    • line: IdOrObject<Line>

      the Line or the line's ID to unarchive

    Returns Promise<any>

    A Promise that resolves when the line was unarchived, and rejects when something went wrong.

Static update

  • update(line: LineUpdateParameters): Promise<any>
  • Update an existing Line name and color.

    Calls the following HTTP API: POST /lines/<ID>

    For example:

    const line = { "id": 950, "name": "Front Desk", "color": "#ffffff" };
    await Qminder.lines.update(line);
    

    Parameters

    • line: LineUpdateParameters

      the Line to be updated - must include the line id, the desired new name and color.

    Returns Promise<any>

    A Promise that resolves when the line was updated, and rejects when something went wrong.

Generated using TypeDoc