Skip to content

Commit

Permalink
Regenerate and release version 0.8.6
Browse files Browse the repository at this point in the history
  • Loading branch information
paddybyers committed Oct 8, 2015
1 parent b519069 commit 9f5db2e
Show file tree
Hide file tree
Showing 11 changed files with 362 additions and 360 deletions.
53 changes: 27 additions & 26 deletions browser/static/ably.js
Original file line number Diff line number Diff line change
Expand Up @@ -3898,7 +3898,7 @@ Defaults.suspendedTimeout = 120000;
Defaults.recvTimeout = 90000;
Defaults.sendTimeout = 10000;
Defaults.connectionPersistTimeout = 15000;
Defaults.version = '0.8.5';
Defaults.version = '0.8.6';

Defaults.getHost = function(options, host, ws) {
if(ws)
Expand Down Expand Up @@ -6823,7 +6823,8 @@ var Resource = (function() {
if (err) {
Logger.logAction(Logger.LOG_MICRO, 'Resource.' + verb + '()', 'Received Error; ' + urlFromPathAndParams(path, params) + '; Error: ' + JSON.stringify(err));
} else {
Logger.logAction(Logger.LOG_MICRO, 'Resource.' + verb + '()', 'Received; ' + urlFromPathAndParams(path, params) + '; Headers: ' + paramString(headers) + '; Body: ' + JSON.stringify(body));
Logger.logAction(Logger.LOG_MICRO, 'Resource.' + verb + '()',
'Received; ' + urlFromPathAndParams(path, params) + '; Headers: ' + paramString(headers) + '; Body: ' + (BufferUtils.isBuffer(body) ? body.toString() : body));
}
if (callback) { callback(err, body, headers, unpacked); }
}
Expand All @@ -6847,7 +6848,7 @@ var Resource = (function() {
Http.get(rest, path, headers, params, function(err, res, headers, unpacked) {
if(err && err.code == 40140) {
/* token has expired, so get a new one */
rest.auth.authorise({force:true}, null, function(err) {
rest.auth.authorise(null, {force:true}, function(err) {
if(err) {
callback(err);
return;
Expand Down Expand Up @@ -6889,7 +6890,7 @@ var Resource = (function() {
Http.post(rest, path, headers, body, params, function(err, res, headers, unpacked) {
if(err && err.code == 40140) {
/* token has expired, so get a new one */
rest.auth.authorise({force:true}, null, function(err) {
rest.auth.authorise(null, {force:true}, function(err) {
if(err) {
callback(err);
return;
Expand Down Expand Up @@ -7090,16 +7091,6 @@ var Auth = (function() {
* requested.
* Authorisation will use the parameters supplied on construction except
* where overridden with the options supplied in the call.
* @param authOptions
* an object containing the request params:
* - key: (optional) the key to use; if not specified, a key
* passed in constructing the Rest interface may be used
*
* - queryTime (optional) boolean indicating that the Ably system should be
* queried for the current time when none is specified explicitly.
*
* - force (optional) boolean indicating that a new token should be requested,
* even if a current token is still valid.
*
* @param tokenParams
* an object containing the parameters for the requested token:
Expand All @@ -7118,9 +7109,20 @@ var Auth = (function() {
* - timestamp: (optional) the time in ms since the epoch. If none is specified,
* the system will be queried for a time value to use.
*
* @param authOptions
* an object containing the request params:
* - key: (optional) the key to use; if not specified, a key
* passed in constructing the Rest interface may be used
*
* - queryTime (optional) boolean indicating that the Ably system should be
* queried for the current time when none is specified explicitly.
*
* - force (optional) boolean indicating that a new token should be requested,
* even if a current token is still valid.
*
* @param callback (err, tokenDetails)
*/
Auth.prototype.authorise = function(authOptions, tokenParams, callback) {
Auth.prototype.authorise = function(tokenParams, authOptions, callback) {
var token = this.tokenDetails;
if(token) {
if(this.rest.clientId && token.clientId && this.rest.clientId !== token.clientId) {
Expand All @@ -7140,7 +7142,7 @@ var Auth = (function() {
}
}
var self = this;
this.requestToken(authOptions, tokenParams, function(err, tokenResponse) {
this.requestToken(tokenParams, authOptions, function(err, tokenResponse) {
if(err) {
callback(err);
return;
Expand Down Expand Up @@ -7195,15 +7197,14 @@ var Auth = (function() {
*
* @param callback (err, tokenDetails)
*/
Auth.prototype.requestToken = function(authOptions, tokenParams, callback) {
Auth.prototype.requestToken = function(tokenParams, authOptions, callback) {
/* shuffle and normalise arguments as necessary */
if(typeof(authOptions) == 'function' && !callback) {
callback = authOptions;
if(typeof(tokenParams) == 'function' && !callback) {
callback = tokenParams;
authOptions = tokenParams = null;
}
else if(typeof(tokenParams) == 'function' && !callback) {
callback = tokenParams;
tokenParams = authOptions;
else if(typeof(authOptions) == 'function' && !callback) {
callback = authOptions;
authOptions = null;
}

Expand Down Expand Up @@ -7255,7 +7256,7 @@ var Auth = (function() {
} else if(authOptions.key) {
var self = this;
Logger.logAction(Logger.LOG_MINOR, 'Auth.requestToken()', 'using token auth with client-side signing');
tokenRequestCallback = function(params, cb) { self.createTokenRequest(authOptions, params, cb); };
tokenRequestCallback = function(params, cb) { self.createTokenRequest(params, authOptions, cb); };
} else {
throw new Error('Auth.requestToken(): authOptions must include valid authentication parameters');
}
Expand Down Expand Up @@ -7350,7 +7351,7 @@ var Auth = (function() {
* the system will be queried for a time value to use.
*
*/
Auth.prototype.createTokenRequest = function(authOptions, tokenParams, callback) {
Auth.prototype.createTokenRequest = function(tokenParams, authOptions, callback) {
authOptions = Utils.mixin(Utils.copy(this.rest.options), authOptions);
tokenParams = tokenParams || Utils.copy(this.tokenParams);

Expand Down Expand Up @@ -8415,7 +8416,7 @@ var RealtimePresence = (function() {
};
break;
default:
var err = new Error('Unable to enter presence channel (incompatible state)');
var err = new Error('Unable to ' + action + ' presence channel (incompatible state)');
err.code = 90001;
callback(err);
}
Expand Down Expand Up @@ -8453,7 +8454,7 @@ var RealtimePresence = (function() {
/* we're not attached; therefore we let any entered status
* timeout by itself instead of attaching just in order to leave */
this.pendingPresence = null;
var err = new Error('Unable to enter presence channel (incompatible state)');
var err = new Error('Unable to leave presence channel (incompatible state)');
err.code = 90001;
callback(err);
break;
Expand Down
Loading

0 comments on commit 9f5db2e

Please sign in to comment.