stormpath / stormpath-sdk-node

Official Node.js SDK for the Stormpath User Management REST API
https://docs.stormpath.com/nodejs/jsdoc/
Apache License 2.0
92 stars 40 forks source link

Feature/client api #583

Open the-overengineer opened 7 years ago

the-overengineer commented 7 years ago

Adds support for the Client API configuration getting, enabling, disabling, and editing. Adds unit tests for the new resources and methods, and integration tests to describe the four desired scenarios.

Example:

var application; // Fetched beforehand

application.getWebConfig(function(err, webConfig) {
  webConfig.status = 'ENABLED'; // 'enabled' also works, but will be set to uppercase when saving
  webConfig.save(function(err, webConfigEnabled) {
    if (err) {
      throw err;
    }

    console.log(webConfigEnabled.status === 'ENABLED'); // true
    webConfigEnabled.me.expand.tenant = true;

    webConfigEnabled.save(function(err, webConfigSaved) {
      if (err) {
        throw err;
      }

      console.log(webConfigSaved.me.expand.tenant); // true
    });
  });
});

Fixes #579

coveralls commented 7 years ago

Coverage Status

Coverage increased (+0.07%) to 89.557% when pulling 11cc87a05a74ba707df06c4f320627e4a7c84bcd on feature/client-api into bcc45974a2564b9759e7a047a5d042f03fa8e313 on master.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-1.3%) to 88.227% when pulling 104d113c12c9bf94670a1e7afe3e58a718b26e58 on feature/client-api into bcc45974a2564b9759e7a047a5d042f03fa8e313 on master.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-0.03%) to 88.125% when pulling 421cf1a6b2f796c9542520d01d1b34fc9e09dc05 on feature/client-api into 9ba364209e522d39fcc28ff689d67a12fb325f97 on master.