@@ -397,14 +397,14 @@ WOQLClient.prototype.insertTriples = function(gtype, gid, turtle, commit_msg) {
397
397
* Inserts a csv from a specified path
398
398
*
399
399
* @param {array } csv_path is an array of csv file names with file path
400
- * @param {string } commitMsg Textual message describing the reason for the update
400
+ * @param {string } commit_msg Textual message describing the reason for the update
401
401
* @param {string } gtype type of graph |instance|schema|inference|
402
402
* @param {string } gid TerminusDB Graph ID to update, main is the default value
403
403
* @return {Promise } An API success message
404
404
*/
405
405
WOQLClient . prototype . insertCSV = function ( csv_path , commit_msg , gtype , gid ) {
406
- if ( commitMsg && csv_path ) {
407
- let commit = this . generateCommitInfo ( commitMsg )
406
+ if ( commit_msg && csv_path ) {
407
+ let commit = this . generateCommitInfo ( commit_msg )
408
408
const formData = new FormData ( ) ;
409
409
csv_path . map ( ( item ) => {
410
410
if ( typeof ( item . name ) == "string" ) {
@@ -429,17 +429,17 @@ WOQLClient.prototype.insertCSV = function(csv_path, commit_msg, gtype, gid) {
429
429
* Updates the contents of the specified path with a csv, creating the appropriate
430
430
* diff object as the commit.
431
431
*
432
- * @param {array } csvPaths Array csvs to upload
433
- * @param {string } commitMsg Textual message describing the reason for the update
432
+ * @param {array } csv_path Array csvs to upload
433
+ * @param {string } commit_msg Textual message describing the reason for the update
434
434
* @param {string } gtype type of graph |instance|schema|inference|
435
435
* @param {string } gid TerminusDB Graph ID to update, main is the default value
436
436
* @return {Promise } An API success message
437
437
*/
438
- WOQLClient . prototype . updateCSV = function ( csv , commit_msg , gtype , gid ) {
439
- if ( commitMsg && csv ) {
440
- let commit = this . generateCommitInfo ( commitMsg )
438
+ WOQLClient . prototype . updateCSV = function ( csv_path , commit_msg , gtype , gid ) {
439
+ if ( commit_msg && csv_path ) {
440
+ let commit = this . generateCommitInfo ( commit_msg )
441
441
const formData = new FormData ( ) ;
442
- csv . map ( ( item ) => {
442
+ csv_path . map ( ( item ) => {
443
443
formData . append ( item . fileToBeUpdated , item . updateWith )
444
444
} )
445
445
formData . append ( 'payload' , JSON . stringify ( commit ) )
@@ -454,23 +454,22 @@ WOQLClient.prototype.updateCSV = function(csv, commit_msg, gtype, gid) {
454
454
/**
455
455
* Retrieves the contents of the specified graph as a CSV
456
456
*
457
- * @param {string } csvName Name of csv to dump from the specified database to extract
458
- * @param {string } csvDirectory CSV output directory path. (defaults to current directory).
457
+ * @param {string } csv_name Name of csv to dump from the specified database to extract
459
458
* @param {string } download flag to download csv file
460
459
* @param {string } gtype Type of graph (instance|schema|inference)
461
460
* @param {string } gid identifier.
462
461
* @return {Promise } An API success message
463
462
*
464
463
*/
465
- WOQLClient . prototype . getCSV = function ( csvName , download , gtype , gid ) {
464
+ WOQLClient . prototype . getCSV = function ( csv_name , download , gtype , gid ) {
466
465
let options = { } , filePath
467
- options . name = csvName ;
466
+ options . name = csv_name ;
468
467
return this . dispatch ( CONST . GET_CSV , this . connectionConfig . csvURL ( gtype , gid ) , options ) . then ( results => {
469
468
if ( download ) {
470
469
const url = window . URL . createObjectURL ( new Blob ( [ results ] ) ) ;
471
470
const link = document . createElement ( 'a' ) ;
472
471
link . href = url ;
473
- link . setAttribute ( 'download' , csvName ) ;
472
+ link . setAttribute ( 'download' , csv_name ) ;
474
473
document . body . appendChild ( link ) ;
475
474
link . click ( ) ;
476
475
}
@@ -481,17 +480,17 @@ WOQLClient.prototype.getCSV = function(csvName, download, gtype, gid) {
481
480
/**
482
481
* Deletes a csv into the specified path
483
482
*
484
- * @param {array } csvName is an array of csv file names
485
- * @param {string } commitMsg Textual message describing the reason for the delete
483
+ * @param {array } csv_name is an array of csv file names
484
+ * @param {string } commit_msg Textual message describing the reason for the delete
486
485
* @param {string } gtype type of graph |instance|schema|inference|
487
486
* @param {string } gid TerminusDB Graph ID to update, main is the default value
488
487
* @return {Promise } An API success message
489
488
*/
490
- WOQLClient . prototype . deleteCSV = function ( csvName , commit_msg , gtype , gid ) {
491
- if ( commitMsg && csvName ) {
492
- let commit = this . generateCommitInfo ( commitMsg )
489
+ WOQLClient . prototype . deleteCSV = function ( csv_name , commit_msg , gtype , gid ) {
490
+ if ( commit_msg && csv_name ) {
491
+ let commit = this . generateCommitInfo ( commit_msg )
493
492
let options = { } , filePath
494
- options . name = csvName ;
493
+ options . name = csv_name ;
495
494
options . commit_info = commit . commit_info
496
495
return this . dispatch ( CONST . DELETE_CSV , this . connectionConfig . csvURL ( ) , options ) . then ( results => {
497
496
return results ;
0 commit comments