import { CellsApi,Font,Style,PostRowStyleRequest,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 styleFont = new Font();
 styleFont.size = 16  ;
var style = new Style();
 style.font = styleFont  ;

var request = new PostRowStyleRequest();
request.name =  remoteName;
request.sheetName =  "Sheet1";
request.rowIndex =  1;
request.style =  style;
request.folder =  remoteFolder;
request.storageName =  "";
return cellsApi.postRowStyle(request)
  });
});