Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
fms-xml-client
Advanced tools
A Promise based FileMaker Server XML gateway client for node.js. note! Because of CORS issues with FileMaker server this is only useful in node. It will not work in the browser.
Starting with version 3.1.0 we use fast-xml-parser instead of xml2js to parse the XML
if you need the old request object api it is still available as an additional export
const request = require('fas-xml-client').request
Using the provided factory functions you create a Layout Object, for the layout you want to target. The Layout Object has a bunch of usefule methods for find, updates, etc. See API below for details.
// get as server factory function
const fms = require('fms-xml-client');
//config options
const options = {
server : "<serverURL>",
auth : {
user : "admin"
pass : "pass"
}
}
//use it to create a server object
const server = fms(options);
//get a DB object
const db = server.db("Test");
//finally get a Layout Object
const People = db.layout("people")
// query can use all the xml gateway options for finding.
// finds all the records where the firstName contains 'joe'
const query = ({firstName : 'joe', "firstName.op" : 'cn' })
People.find(query).then(resultset=>{
//do stuff
})
// See API below for each method available to a Layout Object
Each method can take two optional parameters
Everything returns a Promise. If you care what flavor, we use bluebird Promise.
find records using a query
People.find(query, additionalCommands, auth)
find all the records
People.findAll(addtionalCommands, auth)
Save a record to the db. it will create it if it doesn't exist.
People.save(data, additionalCommands, auth)
update the first record found with the query
People.update(query, data, additionalCommands, auth)
update or the first record found with the query, or insert it if it doesn't exist
People.upsert(query, data, additionalCommands, auth)
delete the first record found by the query
People.delete(query, additionalCommands, auth)
delete the first record found by the query
People.delete(query, additionalCommands, auth)
All off the FileMaker XML Gateway command and parameters are supported in the command object.
All of the query commands are documented in the FileMaker® Server 15 Custom Web Publishing Guide starting on paging 37.
const request = require('fms-xml-client').request;
const options = {
server : "<serverURL>",
auth : {
user : "admin"
pass : "pass"
},
command : {
'-db' : 'Test',
'-findall' : true,
'-lay' : 'people'
}
}
// make the request
request(options)
.then(json=>{
// do stuff with son
})
.catch(err=>{
// do stuff with error
})
You'll need to put the Test.fmp12 file on a FileMaker Server.
We use dotenv for setting the required ENV variables. You can see the required vars in test/required.en. Copy the file to test/.env and set the vars correctly.
.env is never committed to git
finally run npm test
FAQs
FileMaker Server XML Gateway JS Client
The npm package fms-xml-client receives a total of 3 weekly downloads. As such, fms-xml-client popularity was classified as not popular.
We found that fms-xml-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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
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.