Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
node and browser connection for FileMaker Server
The api is under development and may change. Backwards compatibility will be maintained if feasible. See node stability ratings
fms-js can be installed using npm
npm install fms-js
Once installed you can require the fms object, and start to use it
var fms = require('fms-js');
// create a connection object
var connection = fms.connection({
url : '<url>',
userName : 'username',
password : 'password'
});
//use the connection object to create requests
var listDBNamesRequest = connection.dbnames();
//and send it to FileMaker Server
//all request are asynchronous.
//Pass the callback to the 'send()' method
listDBNamesRequest.send(callback)
The API is chainable. So you can do some fun expressive things. The following will find the first 10 contacts who have the firstName 'todd"
connection
.db('Contacts')
.layout('contacts')
.find({
'firstName' : 'todd'
})
.set('-max', 10)
.send(callback)
You can keep a reference to any point in the chain. So this is the equivilent of the above
var db = connection.db('Contacts');
var layout = db.layout('contacts');
var findRequest = layout.find({
'firstName' : 'todd'
})
var findRequestFirstTen = findRequest.set('-max', 10)
findRequestFirstTen.send(callback)
fms-js uses the same commands and parameters as the XML Gateway provided by the FileMaker Server. They are just exposed in a more fluent chainable way.
The API creates requests which you then send to the server
All requests made to the FileMaker Server are asynchronous. That means they will take a 'callback'. The callback gets two parameters, the first is an error, the second is the result. This is standard node callback style.
Example: Get all script names from the contactsTest db.
connection
.db('contactTest')
.scriptnames()
.send(function(err, result){
//err will be null on a succesful request
//err will contain an Error when it fails
//result be null on error
//result will contains the request result on success
})
Options
Returns
This can be used to perform any layout based request. You provide the name value pairs in the form of an object. For example this object
{
'-scriptname' : "RunOnFoundSet"
'-max' : 100
'-findall' : ''
}
would return an Request Object that would return the first 100 records on the layout, and a run a script called "RunOnFoundSet". For more information on what options are available see the XML Web Publishing Guide for FileMaker Server.
The rest of the API provides short hand methods on top of this query
you can use this to modify a request before sending it. It will override any options that were sent in before. For example, give a findall request in the variable 'request'
request
.set('-max', 100)
.set('-sortfield', 'lastName')
.set('-sortorder, 'ascend' )
.send(callback)
would set the max returned to 100, and the sort to lastName ascending, before sending it with .send(callback). This gives you another more fluent way of building up requests.
FAQs
FileMaker Server Connection for Node and the browser
The npm package fms-js receives a total of 4 weekly downloads. As such, fms-js popularity was classified as not popular.
We found that fms-js 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.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.