You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
These nodes can also be installed using the Node-RED palette manager.
99
103
104
+
# Storage
105
+
106
+
The nodes in this project all depend on a configurable Data API client. By default the client is saved in-memory. When saved in-memory a client will not persist between restarts of the Node-RED runtime. This means that each restart of the Node-RED runtime will cause the client to open new Data API sessions.
107
+
108
+
To persist a client between Node-RED runtime restarts and allow active session monitoring and maintenance additional datastores can be configured. This project will accept a url property and an options property from a marpat object in the Node-RED settings.js file. Any datastore made available by [marpat](https://github.com/luidog/marpat). The url property accepts the following formats:
The status node will return the current state of the configured client. The status node will return the client's data usage, urls for all pending and queued requests, and currently open sessions.
The login node will open a FileMaker Data API session. This node will also save the resulting session token for future use by the configured client. You are _not required_ to login before using any other node in a flow.
@@ -137,10 +166,15 @@ The product info node gets server product info. This node gets metadata for the
137
166
138
167
The databases node gets all the scripts and script folders accesible to the client.
139
168
169
+
These nodes can be installed from the command line by running the following command in your Node-RED directory:
These nodes can also be installed using the Node-RED palette manager.
177
+
144
178
### Databases Flow
145
179
146
180
[](https://github.com/Luidog/node-red-contrib-filemaker/blob/master/examples/flows/databases-example.json)
@@ -357,30 +391,55 @@ npm test
357
391
```
358
392
359
393
```default
360
-
> node-red-contrib-filemaker@2.0.0 test /node-red-contrib-filemaker
394
+
> node-red-contrib-filemaker@2.2.0 test node-red-contrib-filemaker
361
395
> snyk test && nyc _mocha --recursive "test/**/*_spec.js" --timeout=30000 --exit
362
396
363
-
364
397
Testing /node-red-contrib-filemaker...
365
398
366
-
Organisation: luidog
399
+
Organization: luidog
367
400
Package manager: npm
368
401
Target file: package-lock.json
369
402
Open source: yes
370
403
Project path: /node-red-contrib-filemaker
371
404
Local Snyk policy: found
405
+
Licenses: enabled
372
406
373
-
✓ Tested 363 dependencies for known vulnerabilities, no vulnerable paths found.
407
+
✓ Tested 364 dependencies for known issues, no vulnerable paths found.
374
408
375
409
Client Node
376
-
✓ should be loaded
410
+
Client Save
411
+
✓ should save on close
412
+
Reused Client Tests
413
+
✓ should be loaded
414
+
✓ should create a persistent client (152ms)
415
+
✓ should reuse a client (113ms)
416
+
✓ should allow a client's server configuration to be modified
417
+
✓ should allow a client's database configuration to be modified
418
+
✓ should allow a client's account user configuration to be modified
419
+
✓ should allow a client's account password configuration to be modified
420
+
✓ should allow multiple clients
421
+
✓ should create a client of one does not exist
422
+
✓ should reuse a client if it exists
423
+
✓ should handle datastore errors
424
+
New Client Tests
425
+
✓ should be loaded
426
+
✓ should create a persistent client (215ms)
427
+
✓ should reuse a client (113ms)
428
+
✓ should allow a client's server configuration to be modified
429
+
✓ should allow a client's database configuration to be modified
430
+
✓ should allow a client's account user configuration to be modified
431
+
✓ should allow a client's account password configuration to be modified
432
+
✓ should allow multiple clients
433
+
✓ should create a client of one does not exist
434
+
✓ should reuse a client if it exists
435
+
✓ should handle datastore errors
377
436
378
437
Container Data Node
379
438
✓ should be loaded
380
-
✓ should download an object with container data to a buffer (1524ms)
381
-
✓ should download an array of objects with container data to a buffer (332ms)
382
-
✓ should download an object with container data to the filesystem (329ms)
383
-
✓ should download an array of objects with container data to the filesystem (329ms)
439
+
✓ should download an object with container data to a buffer (547ms)
440
+
✓ should download an array of objects with container data to a buffer (2579ms)
441
+
✓ should download an object with container data to the filesystem (1526ms)
442
+
✓ should download an array of objects with container data to the filesystem (1430ms)
384
443
✓ should throw an error with a message and a code when writing an object to a buffer and an error is triggered
385
444
✓ should throw an error with a message and a code when writing an array to a buffer an error is triggered
386
445
✓ should handle undefined data input when writing to a buffer
@@ -390,101 +449,119 @@ Local Snyk policy: found
390
449
391
450
Create Record Node
392
451
✓ should be loaded
393
-
✓ should create a record (188ms)
394
-
✓ should create allow the filemaker response to be merged to the message object (188ms)
395
-
✓ should use flow context to create a record. (187ms)
396
-
✓ should use global context to create a record. (189ms)
397
-
✓ should throw an error with a message and a code (209ms)
452
+
✓ should create a record (208ms)
453
+
✓ should allow the filemaker response to be merged to the message object (308ms)
454
+
✓ should use flow context to create a record. (217ms)
455
+
✓ should use global context to create a record. (209ms)
456
+
✓ should throw an error with a message and a code (264ms)
398
457
399
458
Databases Node
400
459
✓ should be loaded
401
-
✓ should return available databases (87ms)
402
-
✓ should reject with an error message and a code (144ms)
460
+
✓ should return available databases (89ms)
461
+
✓ should reject with an error message and a code (115ms)
462
+
✓ should reject if a client can not be initialized
403
463
404
464
Delete Record Node
405
465
✓ should be loaded
406
-
✓ should delete a record (309ms)
407
-
✓ should throw an error with a message and a code (188ms)
466
+
✓ should delete a record (345ms)
467
+
✓ should throw an error with a message and a code (214ms)
468
+
✓ should handle client initilization errors
408
469
409
470
Duplicate Record Node
410
471
✓ should be loaded
411
-
✓ should duplicate a record (298ms)
412
-
✓ should reject with an error message and a code (192ms)
472
+
✓ should duplicate a record (356ms)
473
+
✓ should reject with an error message and a code (206ms)
474
+
✓ should rehject with an error if the client cannot be initialized
413
475
414
476
Edit Record Node
415
477
✓ should be loaded
416
-
✓ should edit a record (312ms)
417
-
✓ should support merging data when editing a record (322ms)
418
-
✓ should throw an error with a message and a code (197ms)
478
+
✓ should edit a record (357ms)
479
+
✓ should support merging data when editing a record (356ms)
480
+
✓ should throw an error with a message and a code (225ms)
481
+
✓ should reject with an error if a client cannot be initialized
419
482
420
483
FieldData Utility Node
421
484
✓ should be loaded
422
-
✓ should transform an array of objects (314ms)
423
-
✓ should transform a a single object (330ms)
485
+
✓ should transform an array of objects (370ms)
486
+
✓ should transform a a single object (386ms)
424
487
✓ should reject with an error message and code
425
488
426
489
Find Records Node
427
490
✓ should be loaded
428
-
✓ should perform a find (298ms)
429
-
✓ should throw an error with a message and a code (216ms)
491
+
✓ should perform a find (352ms)
492
+
✓ should handle client connection errors
493
+
✓ should handle client initialization errors
494
+
✓ allows multiple clients
495
+
✓ will reuse previous clients
496
+
✓ should throw an error with a message and a code (158ms)
430
497
431
498
Get Record Node
432
499
✓ should be loaded
433
-
✓ should get a specific record (338ms)
434
-
✓ should throw an error with a message and a code (221ms)
500
+
✓ should get a specific record (408ms)
501
+
✓ should throw an error with a message and a code (144ms)
502
+
✓ should handle client connection errors
435
503
436
504
Set Globals Node
437
505
✓ should be loaded
438
-
✓ should set globals (222ms)
439
-
✓ should throw an error with a message and a code (231ms)
506
+
✓ should set globals (169ms)
507
+
✓ should throw an error with a message and a code (162ms)
508
+
✓ should reject with an error if the client cannot be initialized
440
509
441
510
Layout Info Node
442
511
✓ should be loaded
443
-
✓ should get layout information (230ms)
444
-
✓ should throw an error with a message and a code (218ms)
512
+
✓ should get layout information (168ms)
513
+
✓ should throw an error with a message and a code (172ms)
514
+
✓ should throw an error with a message and a code
445
515
446
516
Get Layouts Node
447
517
✓ should be loaded
448
-
✓ should return a list of layouts (207ms)
518
+
✓ should return a list of layouts (168ms)
449
519
✓ should reject with an error message and a code
520
+
✓ should reject if a client cannot be initialized
450
521
451
522
List Records Node
452
523
✓ should be loaded
453
-
✓ should List records (346ms)
454
-
✓ should throw an error with a message and a code (227ms)
524
+
✓ should List records (405ms)
525
+
✓ should throw an error with a message and a code (164ms)
526
+
✓ should reject with an error if a client cannot be initialized
455
527
456
528
Login Node
457
529
✓ should be loaded
458
-
✓ should login to a Data API session (100ms)
459
-
✓ should throw an error with a message and a code (1423ms)
530
+
✓ should login to a Data API session (104ms)
531
+
✓ should throw an error with a message and a code (1437ms)
532
+
✓ should reject with an error if a client cannot be initialized
460
533
461
534
Logout Node
462
535
✓ should be loaded
463
-
✓ should close a Data API Session (170ms)
536
+
✓ should close a Data API Session (656ms)
464
537
✓ should throw an error with a message and a code
538
+
✓ should throw an error if a client cannot be initialized
465
539
466
540
Product Info Node
467
541
✓ should be loaded
468
-
✓ should return Data API Server Info (76ms)
469
-
✓ should reject with an error message and a code (119ms)
542
+
✓ should return Data API Server Info (93ms)
543
+
✓ should reject with an error message and a code (102ms)
544
+
✓ should reject with an error if the client cannot be initialized
470
545
471
546
Record Id Utility Node
472
547
✓ should be loaded
473
-
✓ should extract record ids from a single object (287ms)
474
-
✓ should extract record ids from an array of objects (280ms)
548
+
✓ should extract record ids from a single object (338ms)
549
+
✓ should extract record ids from an array of objects (258ms)
475
550
✓ should reject with an error message and a code
476
551
477
552
Trigger Script Node
478
553
✓ should be loaded
479
-
✓ should trigger a script (230ms)
480
-
✓ should parse a script result if it is valid json (245ms)
481
-
✓ should not parse a script result if it is not valid json (230ms)
482
-
✓ should throw an error with a message and a code (242ms)
554
+
✓ should trigger a script (193ms)
555
+
✓ should parse a script result if it is valid json (165ms)
556
+
✓ should not parse a script result if it is not valid json (182ms)
557
+
✓ should throw an error with a message and a code (274ms)
558
+
✓ should throw an error if a client cannot be initialized
483
559
484
560
Get Scripts Node
485
561
✓ should be loaded
486
-
✓ should return a list of scripts (241ms)
562
+
✓ should return a list of scripts (176ms)
487
563
✓ should reject with an error message and a code
564
+
✓ should throw an error if a client cannot be initialized
488
565
489
566
Utility Services
490
567
merge utility
@@ -513,20 +590,26 @@ Local Snyk policy: found
513
590
✓ it should cast multiple string values as booleans
514
591
✓ it should only cast strings of true or false
515
592
593
+
Client Status Node
594
+
✓ should be loaded
595
+
✓ should return Data API Client Status
596
+
✓ should reject with an error if the client cannot be initialized
597
+
516
598
Transform Utility Node
517
599
✓ should be loaded
518
-
✓ should transform an array of objects (377ms)
519
-
✓ should transform a single object (272ms)
600
+
✓ should transform an array of objects (411ms)
601
+
✓ should transform a single object (270ms)
520
602
✓ should throw an error with a message and a code
521
603
522
604
Upload File Node
523
605
✓ should be loaded
524
-
✓ should upload to an existing record (460ms)
525
-
✓ should upload to a file to a new record (494ms)
606
+
✓ should upload to an existing record (436ms)
607
+
✓ should upload to a file to a new record (1455ms)
526
608
✓ should throw an error with a message and a code
609
+
✓ should throw an error if a client cannot be initialized
0 commit comments