Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: sparcedge/platform-api-node-client
base: bf40540d80
...
head fork: sparcedge/platform-api-node-client
compare: 4d8cbb1c22
Checking mergeability… Don't worry, you can still create the pull request.
  • 4 commits
  • 6 files changed
  • 0 commit comments
  • 1 contributor
View
10 README.md
@@ -64,14 +64,14 @@ Importing the API client:
// nothing special here...
var Client = require('platform-api-node-client');
-API clients are bound to a specific server host and port, and a specific client landlord. The landlord value should be
-the same value you would provide for the `l` parameter when using the REST API directly. The key value should be the
-private key corresponding with the public key used when defining the landlord. E.g.,
+API clients are bound to a specific server host and port, and a specific client domain. The domain value should be
+the same value you would provide for the `d` parameter when using the REST API directly. The key value should be the
+private key corresponding with the public key used when defining the domain. E.g.,
var client = new Client({
host: 'localhost',
port: 3000,
- landlord: 'sparc',
+ domain: 'sparc',
key: require('fs').readFileSync(__dirname + '/rsa_private.pem')
});
@@ -338,7 +338,7 @@ Equivalent to a `POST: /events` request.
Equivalent to a `POST: /events` request.
Note: this method is equivalent to the one above, except that it will POST a tenant-level Event, rather than a
-landlord-level event.
+domain-level event.
##Running Tests (for internal developers):
View
8 lib/client.js
@@ -7,7 +7,7 @@ var http = require('http'),
/**
* Constructor for a new Client object
- * @param {Object} opts An Object containing the Client options (host, port, landlord, and key are required)
+ * @param {Object} opts An Object containing the Client options (host, port, domain, and key are required)
* @return {Client}
*/
var Client = module.exports = function Client(opts) {
@@ -15,7 +15,7 @@ var Client = module.exports = function Client(opts) {
// validate options
opts || (opts = {});
- ['host', 'port', 'landlord', 'key'].forEach(function(key) {
+ ['host', 'port', 'domain', 'key'].forEach(function(key) {
if (!opts[key]) throw Error('opts.' + key + ' is required');
self[key] = opts[key];
});
@@ -48,7 +48,7 @@ Client.prototype.request = function(opts, body, cb) {
// prepare our query string variables
var query = opts.query || {};
- query.l = self.landlord;
+ query.d = self.domain;
// prepare the request options
var method = opts.method,
@@ -100,7 +100,7 @@ Client.prototype.request = function(opts, body, cb) {
// sign the request
httpSignature.sign(req, {
key: self.key,
- keyId: self.landlord
+ keyId: self.domain
});
if(hasRequestBody) {
View
2  package.json
@@ -1,7 +1,7 @@
{
"name": "platform-api-node-client",
"main": "./lib/client.js",
- "version": "0.1.1",
+ "version": "0.2.0",
"dependencies": {
"http-signature": ">=0.9.8",
"mocha": "0.3.6"
View
2  test-api/test-events.js
@@ -5,7 +5,7 @@ var assert = require('./helpers/assert'),
var client = new Client({
host: 'localhost',
port: 3210,
- landlord: 'test',
+ domain: 'test',
key: require('fs').readFileSync(__dirname + '/rsa_private.pem')
});
View
2  test-api/test-tenants.js
@@ -5,7 +5,7 @@ var assert = require('./helpers/assert'),
var client = new Client({
host: 'localhost',
port: 3210,
- landlord: 'test',
+ domain: 'test',
key: require('fs').readFileSync(__dirname + '/rsa_private.pem')
});
View
2  test-api/test-users.js
@@ -5,7 +5,7 @@ var assert = require('./helpers/assert'),
var client = new Client({
host: 'localhost',
port: 3210,
- landlord: 'test',
+ domain: 'test',
key: require('fs').readFileSync(__dirname + '/rsa_private.pem', 'ascii')
}).tenant('test');

No commit comments for this range

Something went wrong with that request. Please try again.