Giter VIP home page Giter VIP logo

node-shapeways's Introduction

Node Shapeways

Build Status Coverage Status NPM version Shapeways API Version

node.js module for accessing the Shapeways api http://developers.shapeways.com.

Installation

NPM

npm install shapeways

Git

git clone git://github.com/Shapeways/node-shapeways.git
cd ./node-shapeways
npm install

Version before 1.0.0

Questions concerning versions of the shapeways module before version 1.0.0 should be addressed to ShapeWaysJS which was originally contributed by mikolalysenko.

API

Api Documentation

You can build documentation with.

git clone git://github.com/Shapeways/node-shapeways.git
cd ./node-shapeways
make docs

Then access documentation at /docs/index.html

Examples

See examples directory.

License

The MIT License (MIT) Copyright (c) 2014 Shapeways <[email protected]> (http://developers.shapeways.com)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

node-shapeways's People

Contributors

bmcbarron avatar brettlangdon avatar d33psky avatar dhritzkiv avatar mboylevt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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

node-shapeways's Issues

Signature Invalid on POST requests

I've noticed this has been an issue more than once, I've looked at other posts about it but it failed to help me solve it.

I'm using the http example in the node-shapeways module, however instead of the getApiInfo call, I'm using the addModel call. The getApiInfo call works fine, as well as other GET functions, but I get a signature error on POST requests or at least in this case, addModel function.

User @giles7777 suggested I should make sure oauth uses headers with Accept and Content-Type set to application/json, I've done that in client.js in the client constructor on line 49

  this.connection = new oauth.OAuth(
        this.url("/oauth1/request_token/"),
        this.url("/oauth1/access_token/"),
        this.consumerKey,
        this.consumerSecret,
        "1.0A",
        this.authorizationCallback,
        "HMAC-SHA1",
        null,
        {"Accept" : "application/json",
         "Content-Type" : "application/json",
            "Connection" : "close",
            "User-Agent" : "Node authentication"
        }
    );

But that still didn't work, was still getting signature invalid error from oauth, I also tried switching to PLAINTEXT instead of HMAC-SHA1, but same results.
Could this problem be coming from the Shapeways API or the node module?

This is how I'm calling addModel, I am not encoding the file content because I know this module does that for me as I saw in the addModel function

var data = fs.readFileSync(modelFile);
var postData = {
    hasRightsToModel: 1,
    acceptTermsAndConditions: 1,
    title: "Test",
    description: "Just Testing",
    fileName : "couch.obj",
    file: data
};

client.addModel(postData, function(result){
    res.writeHead(200, {"Content-Type": "application/json"});
    res.end(JSON.stringify(result));
});

Is there anything wrong with the way I'm doing that? Please let me know how to solve this if you have any idea, thanks!

oauth invalid signature with POST

Getting invalid signature when doing any POST calls (like addModel), the error goes away when using PLAINTEXT rather than HMAC-SHA1

oauth_signature_invalid

I am consistenly getting a 401 oauth_signature_invalid when using the addModel function. Are you aware of any issue with the OAuth library?

Add streaming API to model upload

"If I may presume to make one suggestion going forward, it would be that you consider adding a streaming API for uploading the models themselves. For performance reasons, I think that this is absolutely essential, especially when you are consuming larger models produced by external processes or redirected from disk. Globbing an entire mesh into memory for each upload can quickly consume all of the limited heap available to a node process and cause server crashes. Streams also implement back pressure which optimally handles performance and routing problems for throttling. I half-heartedly tried to get something like this to work in the older SOAP api, but was unsuccessful mostly due to the undue hassle of inserting a stream into the middle of a SOAP request and the general crappiness of the current options for handling SOAP/XML in node. However with the current REST system, I believe that this should be much easier to implement and that it really ought to be exposed as the default method for uploading."

From @mikolalysenko via e-mail.

API response contains unparsable error.data string

The string contents of error.data look like a json object, but it is actually unparsable.

I made an example of something similar I am trying to do here: awongh@5ecee61

The specific string I am seeing is:

"{"result":"failure","reason":"You attempted to upload the file \"example\" which has an unsupported or missing file extension. We currently only support STL, OBJ, X3D, Collada, VRML97, VRML2 and ZIP file formats. Please ensure that your files are of one of our supported formats with the correct file extensions. If you can't export to those formats, please see our tutorial \"<a href='\/tutorials\/converting-with-accutrans-3d'>Converting with AccuTrans<\/a>\"."}{"result":"failure","reason":"Model Upload Failed. (Reason: 100)"}"

Can error.data be a valid json parseable string?

Thanks.

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.