import { CellsApi,Color,Range,RangeSetOutlineBorderRequest,PostWorksheetCellsRangeOutlineBorderRequest,UploadFileRequest } from "asposecellscloud";
var fs = require('fs');
var path = require('path');
var process = require('process');
const _ = require('asposecellscloud');

const cellsApi = new CellsApi(process.env.CellsCloudClientId, process.env.CellsCloudClientSecret);

var remoteFolder = "TestData/In"
var localPath = "TestData/CellsCloud/"
var localName = "Book1.xlsx"
var remoteName = "Book1.xlsx"

describe('example', function(){
  it("should call successfully" , function(){

  var localNameRequest = new UploadFileRequest();
      localNameRequest.uploadFiles ={localName:fs.createReadStream(localPath  + localName)};
      localNameRequest.path = remoteFolder + "/" + remoteName ;
      localNameRequest.storageName ="";
      cellsApi.uploadFile(localNameRequest );

var rangeOperateborderColor = new Color();
 rangeOperateborderColor.r = 48  ;
 rangeOperateborderColor.g = 48  ;
 rangeOperateborderColor.b = 48  ;
var rangeOperateRange = new Range();
 rangeOperateRange.columnCount = 1  ;
 rangeOperateRange.columnWidth = 10.0  ;
 rangeOperateRange.firstRow = 1  ;
 rangeOperateRange.rowCount = 10  ;
var rangeOperate = new RangeSetOutlineBorderRequest();
 rangeOperate.borderEdge = "LeftBorder"  ;
 rangeOperate.borderStyle = "Dotted"  ;
 rangeOperate.borderColor = rangeOperateborderColor  ;
 rangeOperate.range = rangeOperateRange  ;

var request = new PostWorksheetCellsRangeOutlineBorderRequest();
request.name =  remoteName;
request.sheetName =  "Sheet1";
request.rangeOperate =  rangeOperate;
request.folder =  remoteFolder;
request.storageName =  "";
return cellsApi.postWorksheetCellsRangeOutlineBorder(request)

  });
});