Giter VIP home page Giter VIP logo

commercecloud-ocapi-client's People

Contributors

bendvc avatar jkeane64 avatar johnboxall avatar kevinxh avatar olibrook avatar

Stargazers

 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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

commercecloud-ocapi-client's Issues

client_id

Hi, I don't see any documentation of how I add a client_id, I can see stuff about in testing , but I am part testing, I can't to set a client_id for my api calls,

Fault {
message: 'The client ID is missing.',
type: 'MissingClientIdException',
arguments: undefined
}

If it is using the config.json, where do I put it in relation to my files and how do I have a different baseUrl for different environments

Tree Shaking ES modules

When compiled its around 202 kb of file size. This will come down if the we have Tree Shaking ES module.

babel src --out-dir es
"module": "es/index.js",

Oauth Access Token

Would be nice to have some functionality to generate an oauth access token as it is pretty difficult to figure out. Looks like most of your code is generated via swagger which I have never used so I won't PR anything.

  1. Generate access token on api client construct
  2. Save it on the api client instance.
  3. in callApi function if the endpoint requires oauth2
    - check the token expiration and if it is expired then get a new one
    - send token in header

Looks like you are using superagent so this is how I am getting my oauth token. Took me awhile to get it right:

function getAccessToken(clientId, password) {
    const key = new Buffer(clientId + ":" + password).toString("base64");
    return new Promise((resolve, reject) => {
        request
            .post("https://account.demandware.com/dw/oauth2/access_token")
            .set("Authorization", "Basic " + key)
            .set("Content-Type", "application/x-www-form-urlencoded")
            .send("grant_type=client_credentials")
            .end((err: any, res: any) => {
                if (err) {
                    reject(err);
                }
                resolve(res.body);
            });
        });
}

Missing basket functions

there are 2 missing basket functions

PATCH
patchBasketsByIDGiftCertificateItems(basketId, body)
to update and existing gift certificate item on a basket

and

DELETE
deleteBasketsByIDGiftCertificateItems(basketId, giftCertificateId)
to delete an existing gift certificate item on a basket

can these be added please ?

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.