Class: Fmrest

Fmrest

An API that wraps all common classes together AuthAPI RecordAPI FindAPI GlobalAPI


new Fmrest(obj)

Create an Fmrest object

Parameters:
Name Type Description
obj Object

An object

Properties
Name Type Description
user string

username

password string

password

host string

host

solution string

solution

layout string

layout

Methods


createGlobal(field, value)

Create Global wrapper

Parameters:
Name Type Description
field string

a field name from filemaker

value string

the fields value

Returns:
Type
Global

createPortal(name, offset, range)

Create Portal wrapper

Parameters:
Name Type Description
name string

a portal's name from filemaker

offset number

starting point of records to return

range number

how many records should be returned

Returns:
Type
Portal

createRecord(json)

Create Record wrapper

Parameters:
Name Type Description
json Object

a json object with field-value pairs

Returns:
  • A promise that resolves with a record id
Type
Promise

createRequest()

Create Request wrapper

Returns:
Type
Request

createSort(field, sort)

Create Sort wrapper

Parameters:
Name Type Description
field string

a field name from filemaker

sort string

a sort order (ascend, descend or value list name)

Returns:
Type
Sort

deleteRecord(id)

Delete Record wrapper

Parameters:
Name Type Description
id number

filemakers internal record id

Returns:
  • A promise that resolves with a boolean
Type
Promise

editRecord(id, json, modId)

Edit Record wrapper

Parameters:
Name Type Description
id number

filemakers internal record id

json Object

a json object with field-value pairs

modId number

the last modification id

Returns:
  • A promise that resolves with a record id
Type
Promise

find(obj)

Find wrapper

Parameters:
Name Type Description
obj Object

An object

Properties
Name Type Description
requests Array

An array of Request Objects

sorts Array

An array of Sort Objects

offset number

starting point of records to return

range number

how many records should be returned

portals Array

An array of Portal Objects

Returns:
  • A promise that resolves with multiple records
Type
Promise

getAllRecords(obj)

Get All Records wrapper

Parameters:
Name Type Description
obj Object

An object

Properties
Name Type Description
offset number

starting point of records to return

range number

how many records should be returned

sorts Array

An array of Sort Objects

portals Array

An array of Portal Objects

Returns:
  • A promise that resolves with multiple records
Type
Promise

getRecord(id, portals)

Get Record wrapper

Parameters:
Name Type Description
id number

filemakers internal record id

portals Array

An Array of Portal Objects

Returns:
  • A promise that resolves with a record
Type
Promise

login()

Login wrapper

Returns:
  • A promise that resolves with a token
Type
Promise

logout()

Logout wrapper

Returns:
  • A promise that resolves with a boolean
Type
Promise

setGlobals(globals)

Set Globals wrapper

Parameters:
Name Type Description
globals Array

An Array of Global Objects

Returns:
  • A promise that resolves with a boolean
Type
Promise