
Product
Socket Now Supports pylock.toml Files
Socket now supports pylock.toml, enabling secure, reproducible Python builds with advanced scanning and full alignment with PEP 751's new standard.
fms-api-client
Advanced tools
A FileMaker Data API client designed to allow easier interaction with a FileMaker application from a web environment.
A FileMaker Data API client designed to allow easier interaction with a FileMaker application from a web environment. This client abstracts the FileMaker 17 Data API into class based methods. You can find detailed documentation on this project here:
npm install --save fms-api-client
The fms-api-client is a wrapper around the FileMaker Data API. Much :heart: to FileMaker for their work on the Data API. The client attempts to follow the terminology used by FileMaker wherever possible. the client uses a lightweight datastore to hold Data API connections. The client contains methods which are modeled after the Data API Endpoints.
The client requires that you first connect to a datastore before creating or querying the FileMaker class. You can use the datastore to save a multitude of clients. Each client committed to the datastore will automatically handle Data API Sessions. Once saved to the data store a client's methods can be used to interact with a FileMaker Database without the need for additional authentication.
Each client will manage their own FileMaker Data API session, but the clients can manually open or close their FileMaker sessions by calling either the client.login()
method or the client.logout()
method. To remove a client from a datastore and log out a session call client.destroy()
.
The client supports the same parameter syntax as is found in the Data API Documentation. Where appropriate and useful the client also allows additional parameters. Any method that accepts script or portals in a query or body parameters will also accept the following script and portal parameters:
The custom script parameter follows the following syntax:
{
"scripts": [
{
"name": "At Mos Eisley",
"phase": "presort",
"param": "awesome bar"
},
{
"name": "First Shot",
"phase": "prerequest",
"param": "Han"
},
{
"name": "Moof Milker",
"param": "Greedo"
}
]
}
The custom portal parameter follows the following syntax:
{
"portals": [
{ "name": "planets", "limit": 1, "offset": 1 },
{ "name": "vehicles", "limit": 2 }
]
}
Note: The FileMaker script and portal syntax will override the alternative script and portal parameter syntax.
In addition to allowing an exanded syntax for invoking script or selecting portals the client will also automatically parse arrays, objects, and numbers to adhere to the requirements of the Data API. Arrays and objects are stringified before being inserted into field data. Also limits and offsets can be set as either a strings or a numbers.
The client will also automatically convert limit
, find
, and offset
into their underscored conterparts as needed. Additionally, if a script result can be parsed as JSON it will be automatically parsed for you by the client.
All methods on the client return promises and each each method will reject with a message and code upon encountering an error. All messages and codes follow the FileMaker Data API where possible.
This project also provides utility modules to aid in working with FileMaker Data API Results. The provided utility modules are fieldData
, recordId
, and transform
. These utilities will accept and return either an object or an an array objects. For more information on the utility modules see the utility section.
Connect must be called before the FileMaker class is used. This connect uses Marpat. Marpat is a fork of Camo. Thanks and love to Scott Robinson for his creation and maintenance of Camo. My fork of Camo - Marpat is designed to allow the use of multiple datastores with the focus on encrypted file storage and project flexibility.
For more information on marpat and the different types of supported storage visit marpat
const { connect } = require('marpat');
connect('nedb://memory')
Excerpt from ./examples/index.js
After connecting to a datastore you can import and create clients. A client is created using the create method on the Filemaker class. The FileMaker class accepts an object with the following properties:
Property | Type | Description |
---|---|---|
application | String | required The FileMaker application / database to connect to |
server | String | required The FileMaker server to use as the host. Note: Must be an http or https Domain. |
user | String | required The FileMaker user account to be used when authenticating into the Data API |
password | String | required The FileMaker user account's password. |
name | String | optional A name for the client. |
usage | Boolean | optional Track Data API usage for this client. Note: Default is true |
timeout | Number | optional The default timeout time for requests Note: Default is 0, (no timeout) |
proxy | Object | optional settings for a proxy server |
agent | Object | optional settings for a custom request agent |
:warning: You should only use the agent parameter when absolutely necessary. The Data API was designed to be used on https. Deviating from the intended use should be done with caution.
const client = Filemaker.create({
name: process.env.CLIENT_NAME,
application: process.env.APPLICATION,
server: process.env.SERVER,
user: process.env.USERNAME,
password: process.env.PASSWORD,
usage: process.env.CLIENT_USAGE_TRACKING,
agent: { rejectUnauthorized: false }
});
Excerpt from ./examples/index.js
Note: The server must be an http or https domain.
A client can be used directly after saving it. The client.save()
method takes no arguments and will either reject with an error or resolve with a useable client. The client will automatically handle Data API session creation and expiration. Once a client is saved it will be stored on the datastore for reuse later.
return client.save();
})
.then(client => authentication(client))
.then(client => creates(client))
.then(client => gets(client))
.then(client => lists(client))
.then(client => finds(client))
.then(client => edits(client))
.then(client => scripts(client))
.then(client => globals(client))
.then(client => deletes(client))
.then(client => uploads(client))
.then(client => utilities(client))
Excerpt from ./examples/index.js
A client can be removed using either the client.destroy()
method, the Filemaker.deleteOne(query)
method or the Filemaker.deleteMany(query)
method.
Note Only the client.destroy()
method will close a FileMaker session. Any client removed using the the Filemaker.deleteOne(query)
method or the Filemaker.deleteMany(query)
method will not log out before being destroyed.
A client can be used after it is created and saved or recalled from the datastore. The Filemaker.find(query)
or Filemaker.findOne(query)
methods can be used to recall clients. The filemaker.findOne(query)
method will return either an client or null. The filemaker.find(query)
will return an array of clients. All public methods on the client are return promises.
const createManyRecords = client =>
Promise.all([
client.create('Heroes', { name: 'Anakin Skywalker' }, { merge: true }),
client.create('Heroes', { name: 'Obi-Wan' }, { merge: true }),
client.create('Heroes', { name: 'Yoda' }, { merge: true })
]).then(result => log('create-many-records-example', result));
Excerpt from ./examples/create.examples.js
Results:
[
{
"name": "Anakin Skywalker",
"recordId": "746018",
"modId": "0"
},
{
"name": "Obi-Wan",
"recordId": "746019",
"modId": "0"
},
{
"name": "Yoda",
"recordId": "746022",
"modId": "0"
}
]
The client will automatically handle creating and closing Data API sessions. If required the client will authenticate and generate a new session token with each method call. The Data API session is also monitored, updated, and saved as the client interacts with the Data API. A client will always attempt to reuse a valid token whenever possible.
The client contains two methods related to Data API sessions.These methods are client.login()
and client.logout()
. The login method is used to start a Data API session and the logout method will end a Data API session.
The client will automatically call the login method if it does not have a valid token. This method returns an object with a token property. This method will also save the token to the client's connection for future use.
client.login()
const login = client => client.login();
Excerpt from ./examples/authentication.examples.js
The logout method is used to end a Data API session. This method will also remove the current client's authentication token.
client.logout()
Note The logout method will change in an upcoming release. It will be modified to accept a session parameter.
const logout = client =>
client.logout().then(result => log('client-logout-example', result));
Excerpt from ./examples/authentication.examples.js
Using the client you can create filemaker records. To create a record specify the layout to use and the data to insert on creation. The client will automatically convert numbers, arrays, and objects into strings so they can be inserted into a filemaker field. The create method will automatically create a fieldData and add data to that property if there is no fieldData property present.
client.create(layout, data, parameters)
Input | Type | Description |
---|---|---|
layout | String | The layout to use as context for creating the record |
data | Object | The data to use when creating a record. |
parameters | Object | The parameters to use when creating a record. |
const createRecord = client =>
client
.create('Heroes', {
name: 'George Lucas'
})
.then(result => log('create-record-example', result));
Excerpt from ./examples/create.examples.js
Result:
{
"recordId": "746017",
"modId": "0"
}
Both the create method and the edit method accept a merge boolean in their options. If merge is true the data used to create or edit the filemaker record will be merged with
const mergeDataOnCreate = client =>
client
.create(
'Heroes',
{
name: 'George Lucas'
},
{ merge: true }
)
.then(result => log('create-record-merge-example', result));
Excerpt from ./examples/create.examples.js
Result:
{
"name": "George Lucas",
"recordId": "746021",
"modId": "0"
}
The create method also allows you to trigger scripts when creating a record. Notice the scripts property in the following example. You can specify scripts to run using either FileMaker's script.key syntax or specify an array of scripts with a name, phase, and script parameter.
const triggerScriptsOnCreate = client =>
client
.create(
'Heroes',
{ name: 'Anakin Skywalker' },
{
merge: true,
scripts: [
{ name: 'Create Droids', param: { droids: ['C3-PO', 'R2-D2'] } }
]
}
)
.then(result => log('trigger-scripts-on-create-example', result));
Excerpt from ./examples/create.examples.js
Result:
{
"name": "Anakin Skywalker",
"scriptError": "0",
"recordId": "746020",
"modId": "0"
}
File ./examples/results/trigger-scripts-on-create-example.json
The Get method will return a specific FileMaker record based on the recordId passed to it. The recordId can be a string or a number.
client.get(layout, recordId, parameters)
Input | Type | Description |
---|---|---|
layout | String | The layout to use as context for creating the record. |
recordId | String | Number |
parameters | Object | The parameters to use when getting a record a record. |
client
.get('Heroes', response.data[0].recordId)
.then(result => log('get-record-example', result))
Excerpt from ./examples/get.examples.js
Result:
{
"data": [
{
"fieldData": {
"name": "yoda",
"image(1)": "https://some-server.com/Streaming_SSL/MainDB/E8ADD6FFD6AE5AC1F43014030280FAE36E79E5AD03FF4C52BF31649D3798644A?RCType=EmbeddedRCFileProcessor",
"object": "",
"array": "",
"height": "",
"id": "3FFF23CF-EE1E-2C4D-8599-95F2744AFD3C",
"imageName": "placeholder.md",
"faceDescriptor": ""
},
"portalData": {
"Planets": [],
"Vehicles": []
},
"recordId": "733117",
"modId": "2"
}
]
}
You can use the client to list filemaker records. The list method accepts a layout and parameter variable. The client will automatically santize the limit, offset, and sort keys to correspond with the DAPI's requirements.
client.list(layout, parameters)
Input | Type | Description |
---|---|---|
layout | String | The layout to use as context for listing records. |
parameters | Object | The parameters to use when listing records. |
const listHeroes = client =>
client
.list('Heroes', { limit: 2 })
.then(result => log('list-records-example', result));
Excerpt from ./examples/list.examples.js
Result:
{
"data": [
{
"fieldData": {
"name": "George Lucas",
"image(1)": "https://some-server.com/Streaming_SSL/MainDB/D97A1B6810CB39522D4438F85CE8D6857425923B542F3F89B46E96FB387D0A73?RCType=EmbeddedRCFileProcessor",
"object": "",
"array": "",
"height": "",
"id": "0E6DF26C-761E-7947-9A3C-C312C285EE55",
"imageName": "placeholder.md",
"faceDescriptor": ""
},
"portalData": {
"Planets": [],
"Vehicles": [
{
"recordId": "3",
"Vehicles::name": "test",
"Vehicles::type": "",
"modId": "0"
}
]
},
"recordId": "732765",
"modId": "7"
},
{
"fieldData": {
"name": "George Lucas",
"image(1)": "",
"object": "",
"array": "",
"height": "",
"id": "0F628510-432C-0E47-8D03-BA90AAF2EA17",
"imageName": "",
"faceDescriptor": ""
},
"portalData": {
"Planets": [],
"Vehicles": []
},
"recordId": "732766",
"modId": "1"
}
]
}
The client's find method will accept either a single object as find parameters or an array. The find method will also santize the limit, sort, and offset parameters to conform with the Data API's requirements.
client.find(layout, query, parameters)
Input | Type | Description |
---|---|---|
layout | String | The layout to use when performing a find. |
query | Object | Array |
parameters | Object | The parameters to use when listing records. |
const findRecords = client =>
client
.find('Heroes', [{ name: 'Anakin Skywalker' }], { limit: 1 })
.then(result => log('find-records-example', result));
Excerpt from ./examples/find.examples.js
Result:
{
"data": [
{
"fieldData": {
"name": "Anakin Skywalker",
"image(1)": "",
"object": "",
"array": "",
"height": "",
"id": "F3B3D737-FD2F-8945-BE95-B49CB617ED5B",
"imageName": "",
"faceDescriptor": ""
},
"portalData": {
"Planets": [],
"Vehicles": []
},
"recordId": "736984",
"modId": "1"
}
]
}
The client's edit method requires a layout, recordId, and object to use for updating the record.
client.edit(layout, recordId, data, parameters)
Input | Type | Description |
---|---|---|
layout | String | The layout to use when editing the record. |
recordId | String | Number |
data | Object | The data to use to edit the record. |
parameters | Object | The parameters to use when editing a record. |
const editRecord = client =>
client
.find('Heroes', [{ name: 'Anakin Skywalker' }], { limit: 1 })
.then(response => response.data[0].recordId)
.then(recordId => client.edit('Heroes', recordId, { name: 'Darth Vader' }))
.then(result => log('edit-record-example', result));
Excerpt from ./examples/edit.examples.js
Result:
{
"modId": "2"
}
The client's delete method requires a layout and a record id. The recordId can be a number or a string.
client.delete(layout, recordId, parameters)
Input | Type | Description |
---|---|---|
layout | String | The layout to use when deleting the record. |
recordId | String | Number |
parameters | Object | The parameters to use when deleting a record. |
const deleteRecords = client =>
client
.find('Heroes', [{ name: 'yoda' }], { limit: 1 })
.then(response => response.data[0].recordId)
.then(recordId => client.delete('Heroes', recordId))
.then(result => log('delete-record-example', result));
Excerpt from ./examples/delete.examples.js
Result:
{}
The client's script method will trigger a script. You can also trigger scripts with the create, edit, list, find, and delete methods. This method performs a list with a limit of one on the specified layout before triggering the script. this is the most lightweight request possible while still being able to trigger a script.
client.script(layout, script, param, parameters)
Input | Type | Description |
---|---|---|
layout | String | The layout to use when triggering the script. |
script | String | The script to trigger. |
param | Any | The parameter to send to the script |
parameters | Object | The parameters to use making the request. |
const triggerScript = client =>
client
.script('Heroes', 'FMS Triggered Script', { name: 'Han' })
.then(result => log('script-trigger-example', result));
Excerpt from ./examples/script.examples.js
Result:
{
"result": {
"answer": "Han shot first"
}
}
The upload method will upload binary data to a container. The file parameter should be either a path to a file or a buffer. If you need to set a field repetition, you can set that in parameters. If recordId is 0 or undefined a new record will be created.
client.upload(file, layout, container, recordId, parameters)
Input | Type | Description |
---|---|---|
file | Object | String |
layout | String | The layout to use when uploading a file. |
container | String | The container field name to upload into. |
recordId | String | Number |
parameters | Object | The parameters to use making the request. |
const uploadImage = client =>
client
.upload('./assets/placeholder.md', 'Heroes', 'image')
.then(result => log('upload-image-example', result));
Excerpt from ./examples/upload.examples.js
Result:
{
"modId": "1",
"recordId": "746024"
}
You can also provide a record Id to the upload method and the file will be uploaded to that record.
client
.upload('./assets/placeholder.md', 'Heroes', 'image', recordId)
.then(result => log('upload-specific-record-example', result)),
Excerpt from ./examples/upload.examples.js
Result:
{
"modId": "2",
"recordId": "733119"
}
The globals method will set global fields for the current session.
client.globals(data, parameters)
Input | Type | Description |
---|---|---|
data | Object | The global fields to set for the session |
const setGlobals = client =>
client
.globals({ 'Globals::ship': 'Millenium Falcon' })
.then(result => log('set-globals-example', result));
Excerpt from ./examples/globals.examples.js
Result:
{}
The client also provides utility methods to aid in parsing and manipulating FileMaker Data. The client exports the recordId(data)
, fieldData(data)
, and transform(data, options)
to aid in transforming Data API response data into other formats. Each utility method is capable of recieving either an object or a array.
The recordId method retrieves the recordId
properties for a response. This method will return either a single string or an array of strings.
recordId(data)
Input | Type | Description |
---|---|---|
data | Array | Object |
const extractRecordId = client =>
client
.find('Heroes', { name: 'yoda' }, { limit: 2 })
.then(response => recordId(response.data))
.then(result => log('recordid-utility-example', result));
Excerpt from ./examples/utility.examples.js
Result:
[
"733119",
"733125"
]
The fieldData method retrieves the fieldData
, recordId
, and modId
properties from a Data API response. The fieldData method will merge the recordId
and modId
properties into fielData properties. This method will not convert table::field
properties.
fieldData(data)
Input | Type | Description |
---|---|---|
data | Array | Object |
const extractFieldData = client =>
client
.find('Heroes', { name: 'yoda' }, { limit: 2 })
.then(response => fieldData(response.data))
.then(result => log('fielddata-utility-example', result));
Excerpt from ./examples/utility.examples.js
Result:
[
{
"name": "Yoda",
"image(1)": "https://some-server.com/Streaming_SSL/MainDB/9947AD35A5CE2FF5BF085088D09F70AA9C9E8426C65C573872CA015DA76D863C?RCType=EmbeddedRCFileProcessor",
"object": "",
"array": "",
"height": "",
"id": "300AF47D-13DC-9146-97F6-71AD02DE425D",
"imageName": "placeholder.md",
"faceDescriptor": "",
"recordId": "733119",
"modId": "2"
},
{
"name": "yoda",
"image(1)": "",
"object": "",
"array": "",
"height": "",
"id": "53A5A6BE-D8CB-E145-BF60-9FFBA763D59E",
"imageName": "",
"faceDescriptor": "",
"recordId": "733125",
"modId": "1"
}
]
The transform method converts Data API response data by converting table::field
properties to objects. This method will transverse the response data and converting { table::field : value}
properties to { table:{ field : value } }
. The transform method will also convert portalData
into arrays of objects.
The transform method accepts three option properties. The three option properties are all booleans and true by default. The three option properties are convert
,fieldData
,portalData
. The convert
property controls the transfomation of table::field
properties. The fieldData
property controls the merging of fieldData to the result. The portalData
property controls the merging of portalData to the result. Setting any propery to false its transformation off.
transform(data, parameters)
Input | Type | Description |
---|---|---|
data | Array | Object |
parameters | Object | The parameters to use when converting the data. |
const transformData = client =>
client
.find('Transform', { name: 'Han Solo' }, { limit: 1 })
.then(result => transform(result.data))
.then(result => log('transform-utility-example', result));
Excerpt from ./examples/utility.examples.js
Result:
[
{
"starships": "",
"vehicles": "",
"species": "",
"biography": "",
"birthYear": "",
"id": "193B8CEE-00CE-D942-92F0-FEEF4DA87967",
"name": "Han Solo",
"Planets": [
{
"recordId": "2",
"name": "Coriella",
"modId": "2"
}
],
"Vehicles": [
{
"recordId": "1",
"name": "Millenium Falcon",
"type": "Starship",
"modId": "2"
}
],
"recordId": "732824",
"modId": "3"
}
]
The client has the ability to create custom agents and modify requests parameters or use a proxy. Agents, request parameters, and proxies can be configured either when the client is created or when a request is being made.
A client can have a custom Agent. Using a custom request agent will allow you to configure an agent designed for your specific needs. A request agent can be configured to not reject unauthorized request such as those with invalid SSLs, keep the connection alive, or limit the number of sockets to a host. There is no need to create an agent unless theses options are needed.
Note If you are using a custom agent you are responsible for destroying that agent with client.destroy
once the agent is no longer used.
All client methods except client.login()
and client.logout()
accept request parameters. These parameters are request.proxy
and request.timeout
, request.agent
. These properties will apply only to the current request.
The client can be configured to use a proxy. The proxy can be configured either for every request by specifying the proxy during the creation of the client, or just for a particular request by specifying the proxy in the request parameters.
npm install
npm test
> fms-api-client@1.0.0 test /Users/luidelaparra/Documents/Development/fms-api-client
> nyc _mocha --recursive ./tests --timeout=30000 --exit
Agent Configuration Capabilities
(node:17697) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
β should accept no agent configuration
β should not create an agent unless one is defined (239ms)
β adjusts the request protocol according to the server
β should create a https agent
β should use a created request agent
β should destory the agent when the client is deleted
β should create a http agent
β should accept a timeout property
β should use a timeout if one is set
β should use a proxy if one is set (226ms)
β should automatically recreate an agent if one is deleted (212ms)
Authentication Capabilities
β should authenticate into FileMaker. (101ms)
β should automatically request an authentication token (175ms)
β should reuse a saved authentication token (183ms)
β should log out of the filemaker. (184ms)
β should not attempt a logout if there is no valid token.
β should reject if the logout request fails (177ms)
β should reject if the authentication request fails (1429ms)
β should attempt to log out before being removed (175ms)
β should catch the log out error before being removed if the login is not valid
Create Capabilities
β should create FileMaker records without fieldData (170ms)
β should allow you to specify a timeout
β should create FileMaker records using fieldData (80ms)
β should create FileMaker records with portalData (90ms)
β should allow portalData to be an object or number (85ms)
β should reject bad data with an error (84ms)
β should create records with mixed types (84ms)
β should substitute an empty object if data is not provided (84ms)
β should return an object with merged data properties (84ms)
β should allow you to run a script when creating a record with a merge response (90ms)
β should allow you to specify scripts as an array (96ms)
β should allow you to specify scripts as an array with a merge response (92ms)
β should sanitize parameters when creating a new record (91ms)
β should accept both the default script parameters and a scripts array (95ms)
β should remove an expired token (85ms)
Delete Capabilities
β should delete FileMaker records. (268ms)
β should allow you to specify a timeout (100ms)
β should trigger scripts via an array when deleting records. (164ms)
β should trigger scripts via parameters when deleting records. (165ms)
β should allow you to mix script parameters and scripts array when deleting records. (166ms)
β should stringify script parameters. (175ms)
β should reject deletions that do not specify a recordId (81ms)
β should reject deletions that do not specify an invalid recordId (75ms)
β should remove an expired token (85ms)
Edit Capabilities
β should edit FileMaker records without fieldData
β should allow you to specify a timeout (212ms)
β should edit FileMaker records using fieldData
β should edit FileMaker records with portalData
β should edit FileMaker records with portalData and allow portalData to be an array.
β should reject bad data with an error (165ms)
β should return an object with merged filemaker and data properties
β should allow you to run a script when editing a record (176ms)
β should allow you to run a script via a scripts array when editing a record (174ms)
β should allow you to specify scripts as an array (174ms)
β should allow you to specify scripts as an array with a merge response (180ms)
β should sanitize parameters when creating a editing record (182ms)
β should accept both the default script parameters and a scripts array (180ms)
β should remove an expired token (169ms)
FieldData Capabilities
β it should extract field data while maintaining the array (273ms)
β it should extract field data while maintaining the object (167ms)
Find Capabilities
β should perform a find request (309ms)
β should allow you to use an object instead of an array for a find (208ms)
β should specify omit Criterea (137ms)
β should allow additional parameters to manipulate the results (81ms)
β should allow you to limit the number of portal records to return (88ms)
β should allow you to use numbers in the find query parameters (85ms)
β should allow you to sort the results (627ms)
β should return an empty array if the find does not return results (88ms)
β should allow you run a pre request script (96ms)
β should return a response even if a script fails (99ms)
β should allow you to send a parameter to the pre request script (92ms)
β should allow you run script after the find and before the sort (294ms)
β should allow you to pass a parameter to a script after the find and before the sort (291ms)
β should reject of there is an issue with the find request (87ms)
β should remove an expired token (81ms)
Get Capabilities
β should get specific FileMaker records. (280ms)
β should allow you to specify a timeout (97ms)
β should reject get requests that do not specify a recordId (171ms)
β should allow you to limit the number of portal records to return (172ms)
β should accept namespaced portal limit and offset parameters (167ms)
β should remove an expired token (80ms)
Global Capabilities
β should allow you to set session globals (173ms)
β should allow you to specify a timeout
β should reject with a message and code if it fails to set a global (78ms)
β should remove an expired token (79ms)
Request Interceptor Capabilities
β should reject if the server errors (124ms)
β should handle non JSON responses by rejecting with a json error (117ms)
β should reject non http requests to the server with a json error
β should reject non https requests to the server with a json error (129ms)
List Capabilities
β should allow you to list records (300ms)
β should allow you to specify a timeout
β should allow you use parameters to modify the list response (82ms)
β should should allow you to use numbers in parameters (87ms)
β should should allow you to provide an array of portals in parameters (88ms)
β should should remove non used properties from a portal object (81ms)
β should modify requests to comply with DAPI name reservations (84ms)
β should allow strings while complying with DAPI name reservations (79ms)
β should allow you to offset the list response (80ms)
β should santize parameters that would cause unexpected parameters (83ms)
β should allow you to limit the number of portal records to return (83ms)
β should accept namespaced portal limit and offset parameters (82ms)
β should reject invalid parameters (81ms)
β should remove an expired token (81ms)
RecordId Capabilities
β it should extract the recordId while maintaining the array (253ms)
β it should extract recordId while maintaining the object (166ms)
Script Capabilities
β should allow you to trigger a script (189ms)
β should allow you to specify a timeout
β should allow you to trigger a script specifying a string as a parameter (88ms)
β should allow you to trigger a script specifying a number as a parameter (87ms)
β should allow you to trigger a script specifying an object as a parameter (86ms)
β should allow you to trigger a script in a find (222ms)
β should allow you to trigger a script in a list (97ms)
β should reject a script that does not exist (85ms)
β should allow return a result even if a script returns an error (92ms)
β should parse script results if the results are json (86ms)
β should not parse script results if the results are not json (90ms)
β should parse an array of scripts (88ms)
β should trigger scripts on all three script phases (91ms)
β should remove an expired token (80ms)
Storage
β should allow an instance to be created
β should allow an instance to be saved.
β should reject if a client can not be validated
β should allow an instance to be recalled
β should allow instances to be listed
β should allow you to remove an instance
Transform Capabilities
β should merge portal data and field data from an array (309ms)
β should merge portal data and field data from an object (117ms)
β should optionally not convert table::field keys from an array (116ms)
β should optionally not convert table::field keys from an object (116ms)
β should allow you to remove field data from an array (127ms)
β should allow you to remove field data from an object (123ms)
β should allow you to remove portal data from an array (170ms)
β should allow you to remove portal data from an object (122ms)
β should merge portal data and portal data from an array (128ms)
File Upload Capabilities
β should allow you to specify a timeout (193ms)
β should allow you to upload a file to a new record (1267ms)
β should allow you to upload a buffer to a new record (1342ms)
β should allow you to upload a file to a specific container repetition (1270ms)
β should allow you to upload a buffer to a specific container repetition (1288ms)
β should reject with a message if it can not find the file to upload
β should allow you to upload a file to a specific record (1266ms)
β should allow you to upload a file to a specific record (1265ms)
β should allow you to upload a file to a specific record container repetition (1265ms)
β should allow you to upload a buffer to a specific record container repetition (1296ms)
β should reject of the request is invalid (232ms)
β should remove an expired token (83ms)
Data Usage
Tracks Data Usage
β should track API usage data. (181ms)
β should allow you to reset usage data. (83ms)
Does Not Track Data Usage
β should not track data usage in (177ms)
β should not track data usage out (81ms)
Utility Capabilities
Omit Utility
β it should remove properties while maintaing the array
β it should remove properties while maintaing the object
Parse Utility
β it should return a string when given a string
β it should return an object when given a stringified object
isJson Utility
β it should return true for an object
β it should return true for an empty object
β it should return true for a stringified object
β it should return false for a number
β it should return false for undefined
β it should return false for a string
β it should return false for null
161 passing (28s)
------------------------------|----------|----------|----------|----------|-------------------|
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s |
------------------------------|----------|----------|----------|----------|-------------------|
All files | 100 | 100 | 100 | 100 | |
fms-api-client | 100 | 100 | 100 | 100 | |
index.js | 100 | 100 | 100 | 100 | |
fms-api-client/src | 100 | 100 | 100 | 100 | |
index.js | 100 | 100 | 100 | 100 | |
fms-api-client/src/models | 100 | 100 | 100 | 100 | |
agent.model.js | 100 | 100 | 100 | 100 | |
client.model.js | 100 | 100 | 100 | 100 | |
connection.model.js | 100 | 100 | 100 | 100 | |
credentials.model.js | 100 | 100 | 100 | 100 | |
data.model.js | 100 | 100 | 100 | 100 | |
index.js | 100 | 100 | 100 | 100 | |
fms-api-client/src/services | 100 | 100 | 100 | 100 | |
index.js | 100 | 100 | 100 | 100 | |
transform.service.js | 100 | 100 | 100 | 100 | |
fms-api-client/src/utilities | 100 | 100 | 100 | 100 | |
conversion.utilities.js | 100 | 100 | 100 | 100 | |
filemaker.utilities.js | 100 | 100 | 100 | 100 | |
index.js | 100 | 100 | 100 | 100 | |
request.utilities.js | 100 | 100 | 100 | 100 | |
fms-api-client/tests | 100 | 100 | 100 | 100 | |
transform.tests.js | 100 | 100 | 100 | 100 | |
------------------------------|----------|----------|----------|----------|-------------------|
MIT Β© Lui de la Parra
FAQs
A FileMaker Data API client designed to allow easier interaction with a FileMaker database from a web environment.
The npm package fms-api-client receives a total of 15 weekly downloads. As such, fms-api-client popularity was classified as not popular.
We found that fms-api-client demonstrated a not healthy version release cadence and project activity because the last version was released a year ago.Β It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket now supports pylock.toml, enabling secure, reproducible Python builds with advanced scanning and full alignment with PEP 751's new standard.
Security News
Research
Socket uncovered two npm packages that register hidden HTTP endpoints to delete all files on command.
Research
Security News
Malicious Ruby gems typosquat Fastlane plugins to steal Telegram bot tokens, messages, and files, exploiting demand after Vietnamβs Telegram ban.