import { CellsApi,GetDocumentPropertiesRequest,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 request = new GetDocumentPropertiesRequest();
request.name =  remoteName;
request.type =  "All";
request.folder =  remoteFolder;
request.storageName =  "";
return cellsApi.getDocumentProperties(request)
  });
});