Code Monkey home page Code Monkey logo

kloudless-node's People

Contributors

cabarnes avatar chri-roch12 avatar chriskuehl avatar david-thorman avatar elldritch avatar fsworld009 avatar galkin avatar hong19 avatar joesonchiang avatar nquinlan avatar perelman avatar pseudonumos avatar vinodc avatar vinodc-kloudless avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kloudless-node's Issues

Update dependencies

I use

  • Node 10.14.1
  • NPM 6.4.1

There is such message:

npm install kloudless
npm WARN deprecated [email protected]: Use uuid module instead
npm WARN deprecated [email protected]: The major version is no longer supported. Please update to 4.x or newer
+ [email protected]
updated 1 package and audited 22475 packages in 13.078s
found 8 moderate severity vulnerabilities

So we have two deprecated package and 8 possible vulnerabilities.

'msecs must be a number' after upgrading to Node 0.12.6

I upgraded to Node 0.12.6, and begun getting the following error on the first request to Kloudless web api:

throw new TypeError('msecs must be a number');
      ^

TypeError: msecs must be a number
at Object.exports.enroll (timers.js:165:11)
at TLSSocket.Socket.setTimeout (net.js:337:12)
at ClientRequest. (_http_client.js:565:10)
at ClientRequest.g (events.js:199:16)
at ClientRequest.emit (events.js:129:20)
at tickOnSocket (_http_client.js:493:7)
at _http_client.js:504:7
at process._tickDomainCallback (node.js:381:11)

After investigation, it seems there was a default value on the msec parameter of the setTimeout function on the previous version of node (0.10), which has disappeared.

I fixed this temporarily on line 21 of kloudless.js (added the timeout property):

this._api = {
    auth: null,
    protocol: Kloudless.defaultConfig.protocol,
    host: Kloudless.defaultConfig.host,
    port: Kloudless.defaultConfig.port,
    ca: null,
    basePath: Kloudless.defaultConfig.basePath,
    timeout: 2000
};

Could we get a better fix ?

Issue with uploading files: `name` and `parent_id` must be strings...

The message I get is:
Error uploading file: Error: Request failed: name and parent_id must be strings representing the name of the new file and ID of the pa
rent folder object respectively. url must be the URL to upload the file from.

The code we use is:
kloudless.files.upload({
"name": "test.docx",
"account_id": accountId,
"parent_id": "Fp7u6cdR6tt3njEN3j4Cya3NJsaltoX3SwxA5-opkWm0=",
"file": filestream,
// all API calls can specify URL query parameters by defining "queryParams"
"queryParams": {
"overwrite": "true"
}
followed with error handling.

kloudless.files.contents() returns corrupted stream

I'm using kloudless.files.contents to get a download stream and pipe it to S3, but the output files in S3 are corrupt. The same issue can be seen when piping the stream to a local file. For example, when I download a jpg, the output file is corrupt:

kloudless.files.contents({
  account_id: [account_id],
  file_id: [file_id]
}, (err, stream) => {
  if(err){
    console.log(err);
  } else {
    var output = require('fs').createWriteStream('./output.jpg');
    stream.pipe(output);
  }
});

I can fix the issue by removing the line res.setEncoding('binary'); in lib/resources.js (https://github.com/Kloudless/kloudless-node/blob/master/lib/resources.js#L44) and the files download properly, but I'm not sure what other consequences there may be to that. Do you think this fix is appropriate?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.