@@ -6,10 +6,10 @@ For in depth documentation head to the [`docs`](https://luidog.github.io/fms-api
66
77## Installation
88
9- This is a [ Node.js] ( https://nodejs.org/ ) module available through the
10- [ npm registry] ( https://www.npmjs.com/ ) . It can be installed using the
9+ This is a [ Node.js] ( https://nodejs.org/ ) module available through the
10+ [ npm registry] ( https://www.npmjs.com/ ) . It can be installed using the
1111[ ` npm ` ] ( https://docs.npmjs.com/getting-started/installing-npm-packages-locally )
12- or
12+ or
1313[ ` yarn ` ] ( https://yarnpkg.com/en/ )
1414command line tools.
1515
@@ -31,7 +31,7 @@ const colors = require('colors');
3131const environment = require (' dotenv' );
3232const varium = require (' varium' );
3333const { connect } = require (' marpat' );
34- const { Filemaker } = require (' ./index.js ' );
34+ const { Filemaker } = require (' fms-api-client ' );
3535environment .config ({ path: ' ./tests/.env' });
3636
3737varium (process .env , ' ./tests/env.manifest' );
@@ -219,6 +219,7 @@ const rewind = () => {
219219};
220220
221221setTimeout (() => rewind (), 10000 );
222+
222223```
223224
224225## Tests
@@ -227,129 +228,132 @@ setTimeout(() => rewind(), 10000);
227228npm install
228229npm test
229230```
230-
231231```
232- > [email protected] test /Users/luidelaparra/Documents/Development/fms-api-client 232+
233+ > [email protected] test /fms-api-client 233234> nyc _mocha --recursive ./tests --timeout=30000
234235 Authentication Capabilities
235- ✓ should authenticate into FileMaker. (144ms )
236- ✓ should automatically request an authentication token (169ms )
237- ✓ should reuse a saved authentication token (164ms )
238- ✓ should log out of the filemaker. (158ms )
236+ ✓ should authenticate into FileMaker. (238ms )
237+ ✓ should automatically request an authentication token (172ms )
238+ ✓ should reuse a saved authentication token (156ms )
239+ ✓ should log out of the filemaker. (152ms )
239240 ✓ should not attempt a logout if there is no valid token.
240- ✓ should reject if the logout request fails (153ms )
241- ✓ should reject if the authentication request fails (1407ms )
241+ ✓ should reject if the logout request fails (163ms )
242+ ✓ should reject if the authentication request fails (1405ms )
242243 Create Capabilities
243- ✓ should create FileMaker records. (160ms )
244- ✓ should reject bad data with an error (153ms )
245- ✓ should create FileMaker records with mixed types (157ms )
244+ ✓ should create FileMaker records. (149ms )
245+ ✓ should reject bad data with an error (158ms )
246+ ✓ should create FileMaker records with mixed types (159ms )
246247 Delete Capabilities
247- ✓ should delete FileMaker records. (238ms )
248- ✓ should reject deletions that do not specify a recordId (161ms )
248+ ✓ should delete FileMaker records. (249ms )
249+ ✓ should reject deletions that do not specify a recordId (157ms )
249250 Edit Capabilities
250251 ✓ should edit FileMaker records.
251- ✓ should reject bad data with an error (255ms )
252+ ✓ should reject bad data with an error (240ms )
252253 Find Capabilities
253- ✓ should perform a find request (191ms )
254- ✓ should allow you to use an object instead of an array for a find (194ms )
255- ✓ should specify omit Criterea (189ms )
256- ✓ should allow additional parameters to manipulate the results (163ms )
257- ✓ should allow you to use numbers in the find query parameters (165ms )
258- ✓ should allow you to sort the results (191ms )
259- ✓ should return an empty array if the find does not return results (166ms )
260- ✓ should allow you run a pre request script (175ms )
261- ✓ should return a response even if a script fails (171ms )
262- ✓ should allow you to send a parameter to the pre request script (164ms )
263- ✓ should allow you run script after the find and before the sort (195ms )
264- ✓ should allow you to pass a parameter to a script after the find and before the sort (201ms )
265- ✓ should reject of there is an issue with the find request (155ms )
254+ ✓ should perform a find request (199ms )
255+ ✓ should allow you to use an object instead of an array for a find (163ms )
256+ ✓ should specify omit Criterea (201ms )
257+ ✓ should allow additional parameters to manipulate the results (167ms )
258+ ✓ should allow you to use numbers in the find query parameters (153ms )
259+ ✓ should allow you to sort the results (172ms )
260+ ✓ should return an empty array if the find does not return results (156ms )
261+ ✓ should allow you run a pre request script (172ms )
262+ ✓ should return a response even if a script fails (182ms )
263+ ✓ should allow you to send a parameter to the pre request script (162ms )
264+ ✓ should allow you run script after the find and before the sort (181ms )
265+ ✓ should allow you to pass a parameter to a script after the find and before the sort (177ms )
266+ ✓ should reject of there is an issue with the find request (162ms )
266267 Get Capabilities
267- ✓ should get specific FileMaker records. (238ms )
268- ✓ should reject get requests that do not specify a recordId (234ms )
268+ ✓ should get specific FileMaker records. (247ms )
269+ ✓ should reject get requests that do not specify a recordId (235ms )
269270 Global Capabilities
270- ✓ should allow you to set FileMaker globals (167ms )
271- ✓ should reject with a message and code if it fails to set a global (158ms )
271+ ✓ should allow you to set FileMaker globals (164ms )
272+ ✓ should reject with a message and code if it fails to set a global (150ms )
272273 List Capabilities
273- ✓ should allow you to list records (194ms )
274- ✓ should allow you use parameters to modify the list response (160ms )
275- ✓ should should allow you to use numbers in parameters (158ms )
276- ✓ should modify requests to comply with DAPI name reservations (151ms )
277- ✓ should allow strings while complying with DAPI name reservations (156ms )
274+ ✓ should allow you to list records (209ms )
275+ ✓ should allow you use parameters to modify the list response (154ms )
276+ ✓ should should allow you to use numbers in parameters (160ms )
277+ ✓ should modify requests to comply with DAPI name reservations (152ms )
278+ ✓ should allow strings while complying with DAPI name reservations (154ms )
278279 ✓ should allow you to offset the list response (164ms)
279- ✓ should reject requests that use unexpected parameters (154ms )
280+ ✓ should reject requests that use unexpected parameters (152ms )
280281 Script Capabilities
281- ✓ should allow you to trigger a script in FileMaker (171ms )
282- ✓ should allow you to trigger a script in FileMaker (175ms )
282+ ✓ should allow you to trigger a script in FileMaker (169ms )
283+ ✓ should allow you to trigger a script in FileMaker (183ms )
283284 ✓ should allow you to trigger a script in a find (206ms)
284- ✓ should allow you to trigger a script in a list (158ms )
285- ✓ should allow reject a script that does not exist (151ms )
286- ✓ should allow return a result even if a script returns an error (167ms )
287- ✓ should parse script results if the results are json (169ms )
288- ✓ should not parse script results if the results are not json (163ms )
285+ ✓ should allow you to trigger a script in a list (173ms )
286+ ✓ should allow reject a script that does not exist (157ms )
287+ ✓ should allow return a result even if a script returns an error (171ms )
288+ ✓ should parse script results if the results are json (163ms )
289+ ✓ should not parse script results if the results are not json (180ms )
289290 Storage
290291 ✓ should allow an instance to be created
291292 ✓ should allow an instance to be saved.
292293 ✓ should allow an instance to be recalled
293294 ✓ should allow insances to be listed
294295 ✓ should allow you to remove an instance
295296 File Upload Capabilities
296- ✓ should allow you to upload a file to a new record (1644ms)
297- ✓ should allow you to upload a file to a specific container repetition (1346ms)
298- ✓ should reject with a message if it can not find the file to upload (157ms)
299- ✓ should allow you to upload a file to a specific record (1326ms)
297+ ✓ should allow you to upload a file to a new record (1400ms)
298+ ✓ should allow you to upload a file to a specific container repetition (1426ms)
299+ ✓ should reject with a message if it can not find the file to upload (159ms)
300+ ✓ should allow you to upload a file to a specific record (1417ms)
301+ ✓ should allow you to upload a file to a specific record container repetition (1424ms)
302+ ✓ should reject of the request is invalid (304ms)
300303 Data Usage Tracking Capabilities
301- ✓ should track API usage data. (167ms )
302- ✓ should allow you to reset usage data. (161ms )
304+ ✓ should track API usage data. (164ms )
305+ ✓ should allow you to reset usage data. (158ms )
303306 Utility Capabilities
304- ✓ should extract field while maintaining the array (243ms )
305- ✓ should extract field data while maintaining the object (236ms )
307+ ✓ should extract field while maintaining the array (235ms )
308+ ✓ should extract field data while maintaining the object (248ms )
306309 ✓ should extract the recordId while maintaining the array (239ms)
307- ✓ should extract field data while maintaining the object (231ms )
308- 61 passing (15s )
310+ ✓ should extract field data while maintaining the object (230ms )
311+ 63 passing (16s )
309312-----------------------|----------|----------|----------|----------|-------------------|
310313File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s |
311314-----------------------|----------|----------|----------|----------|-------------------|
312- All files | 100 | 95 | 100 | 100 | |
315+ All files | 100 | 100 | 100 | 100 | |
313316 fms-api-client | 100 | 100 | 100 | 100 | |
314317 index.js | 100 | 100 | 100 | 100 | |
315- fms-api-client/src | 100 | 95 | 100 | 100 | |
316- client.model.js | 100 | 94.74 | 100 | 100 | 194,581 |
318+ fms-api-client/src | 100 | 100 | 100 | 100 | |
319+ client.model.js | 100 | 100 | 100 | 100 | |
317320 connection.model.js | 100 | 100 | 100 | 100 | |
318321 credentials.model.js | 100 | 100 | 100 | 100 | |
319322 data.model.js | 100 | 100 | 100 | 100 | |
320323 index.js | 100 | 100 | 100 | 100 | |
321324-----------------------|----------|----------|----------|----------|-------------------|
325+
322326```
323327
324328## Dependencies
325329
326- * [ axios] ( https://ghub.io/axios ) : Promise based HTTP client for the browser and node.js
327- * [ form-data] ( https://ghub.io/form-data ) : A library to create readable " ; multipart/form-data" ; streams. Can be used to submit forms and file uploads to other web applications.
328- * [ lodash] ( https://ghub.io/lodash ) : Lodash modular utilities.
329- * [ marpat] ( https://ghub.io/marpat ) : A class-based ES6 ODM for Mongo-like databases.
330- * [ moment] ( https://ghub.io/moment ) : Parse, validate, manipulate, and display dates
331- * [ object-sizeof] ( https://ghub.io/object-sizeof ) : Sizeof of a JavaScript object in Bytes
332- * [ prettysize] ( https://ghub.io/prettysize ) : Convert bytes to other sizes for prettier logging
330+ - [ axios] ( https://ghub.io/axios ) : Promise based HTTP client for the browser and node.js
331+ - [ form-data] ( https://ghub.io/form-data ) : A library to create readable " ; multipart/form-data" ; streams. Can be used to submit forms and file uploads to other web applications.
332+ - [ lodash] ( https://ghub.io/lodash ) : Lodash modular utilities.
333+ - [ marpat] ( https://ghub.io/marpat ) : A class-based ES6 ODM for Mongo-like databases.
334+ - [ moment] ( https://ghub.io/moment ) : Parse, validate, manipulate, and display dates
335+ - [ object-sizeof] ( https://ghub.io/object-sizeof ) : Sizeof of a JavaScript object in Bytes
336+ - [ prettysize] ( https://ghub.io/prettysize ) : Convert bytes to other sizes for prettier logging
333337
334338## Dev Dependencies
335339
336- * [ chai] ( https://ghub.io/chai ) : BDD/TDD assertion library for node.js and the browser. Test framework agnostic.
337- * [ chai-as-promised] ( https://ghub.io/chai-as-promised ) : Extends Chai with assertions about promises.
338- * [ colors] ( https://ghub.io/colors ) : get colors in your node.js console
339- * [ coveralls] ( https://ghub.io/coveralls ) : takes json-cov output into stdin and POSTs to coveralls.io
340- * [ dotenv] ( https://ghub.io/dotenv ) : Loads environment variables from .env file
341- * [ eslint] ( https://ghub.io/eslint ) : An AST-based pattern checker for JavaScript.
342- * [ eslint-config-google] ( https://ghub.io/eslint-config-google ) : ESLint shareable config for the Google style
343- * [ eslint-config-prettier] ( https://ghub.io/eslint-config-prettier ) : Turns off all rules that are unnecessary or might conflict with Prettier.
344- * [ eslint-plugin-prettier] ( https://ghub.io/eslint-plugin-prettier ) : Runs prettier as an eslint rule
345- * [ jsdocs] ( https://ghub.io/jsdocs ) : jsdocs
346- * [ minami] ( https://ghub.io/minami ) : Clean and minimal JSDoc 3 Template / Theme
347- * [ mocha] ( https://ghub.io/mocha ) : simple, flexible, fun test framework
348- * [ mocha-lcov-reporter] ( https://ghub.io/mocha-lcov-reporter ) : LCOV reporter for Mocha
349- * [ nyc] ( https://ghub.io/nyc ) : the Istanbul command line interface
350- * [ package-json-to-readme] ( https://ghub.io/package-json-to-readme ) : Generate a README.md from package.json contents
351- * [ prettier] ( https://ghub.io/prettier ) : Prettier is an opinionated code formatter
352- * [ varium] ( https://ghub.io/varium ) : A strict parser and validator of environment config variables
340+ - [ chai] ( https://ghub.io/chai ) : BDD/TDD assertion library for node.js and the browser. Test framework agnostic.
341+ - [ chai-as-promised] ( https://ghub.io/chai-as-promised ) : Extends Chai with assertions about promises.
342+ - [ colors] ( https://ghub.io/colors ) : get colors in your node.js console
343+ - [ coveralls] ( https://ghub.io/coveralls ) : takes json-cov output into stdin and POSTs to coveralls.io
344+ - [ dotenv] ( https://ghub.io/dotenv ) : Loads environment variables from .env file
345+ - [ eslint] ( https://ghub.io/eslint ) : An AST-based pattern checker for JavaScript.
346+ - [ eslint-config-google] ( https://ghub.io/eslint-config-google ) : ESLint shareable config for the Google style
347+ - [ eslint-config-prettier] ( https://ghub.io/eslint-config-prettier ) : Turns off all rules that are unnecessary or might conflict with Prettier.
348+ - [ eslint-plugin-prettier] ( https://ghub.io/eslint-plugin-prettier ) : Runs prettier as an eslint rule
349+ - [ jsdocs] ( https://ghub.io/jsdocs ) : jsdocs
350+ - [ minami] ( https://ghub.io/minami ) : Clean and minimal JSDoc 3 Template / Theme
351+ - [ mocha] ( https://ghub.io/mocha ) : simple, flexible, fun test framework
352+ - [ mocha-lcov-reporter] ( https://ghub.io/mocha-lcov-reporter ) : LCOV reporter for Mocha
353+ - [ nyc] ( https://ghub.io/nyc ) : the Istanbul command line interface
354+ - [ package-json-to-readme] ( https://ghub.io/package-json-to-readme ) : Generate a README.md from package.json contents
355+ - [ prettier] ( https://ghub.io/prettier ) : Prettier is an opinionated code formatter
356+ - [ varium] ( https://ghub.io/varium ) : A strict parser and validator of environment config variables
353357
354358## License
355359
0 commit comments