New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More

pusher-platform-node

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pusher-platform-node - npm Package Compare versions

Comparing version 0.7.1 to 0.8.0

@@ -5,2 +5,7 @@ # Change Log

## [v0.8.0] 2017-07-19
### Changes
- Renamed the `instance` to `instanceId` when instantiating an `Instance`. `Instance` class now has a parameter `id` that used to be `instance`.
## [v0.7.1] 2017-07-18

@@ -7,0 +12,0 @@

{
"name": "pusher-platform-node",
"version": "0.7.1",
"version": "0.8.0",
"main": "./target/index.js",

@@ -5,0 +5,0 @@ "types": "./target/index.d.ts",

@@ -12,3 +12,3 @@ # pusher-platform-node

"dependencies": {
"pusher-platform-node": "^0.7.1"
"pusher-platform-node": "^0.8.0"
}

@@ -27,3 +27,3 @@ }

var pusherPlatform = new pusher.Instance({
instance: "",
instanceId: "",
serviceName: "",

@@ -35,3 +35,3 @@ serviceVersion: "",

`instance` is the ID that is unique to app developers' instance - they get that from the dashboard. The service SDKs will need to relay that down. Same for the `key`.
`instanceId` is the ID that is unique to app developers' instance - they get that from the dashboard. The service SDKs will need to relay that down. Same for the `key`.
`serviceName` and `serviceVersion` should come from the service SDK itself. They can be hardcoded there. Think `feeds` and `v1`.

@@ -117,3 +117,3 @@

## Issues, Bugs, and Feature Requests
## Issues, Bugs, and Feature Requests

@@ -124,4 +124,4 @@ Feel free to create an issue on Github if you find anything wrong. Please use the existing template.

## License
## License
pusher-platform-node is released under the MIT license. See LICENSE for details.

@@ -20,3 +20,3 @@ import extend = require("extend");

export interface InstanceOptions {
instance: string;
instanceId: string;
key: string;

@@ -33,3 +33,3 @@ serviceName: string;

private client: BaseClient;
private instanceId: string;
private id: string;
private serviceName: string;

@@ -48,11 +48,11 @@ private serviceVersion: string;

if (!options.instance) throw new Error('Expected `instance` property in Instance options!');
if (options.instance.split(":").length !== 3) throw new Error('The instance property is in the wrong format!');
if (!options.instanceId) throw new Error('Expected `instance` property in Instance options!');
if (options.instanceId.split(":").length !== 3) throw new Error('The instance property is in the wrong format!');
if(!options.serviceName) throw new Error('Expected `serviceName` property in Instance options!');
if(!options.serviceVersion) throw new Error('Expected `serviceVersion` property in Instance otpions!');
let splitInstance = options.instance.split(":");
let splitInstance = options.instanceId.split(":");
this.platformVersion = splitInstance[0];
this.cluster = splitInstance[1];
this.instanceId = splitInstance[2];
this.id = splitInstance[2];

@@ -71,3 +71,3 @@ this.serviceName = options.serviceName;

host: options.host || `${this.cluster}.${HOST_BASE}`,
instanceId: this.instanceId,
instanceId: this.id,
serviceName: this.serviceName,

@@ -79,3 +79,3 @@ serviceVersion: this.serviceVersion,

this.authenticator = new Authenticator(
this.instanceId, this.keyId, this.keySecret
this.id, this.keyId, this.keySecret
);

@@ -82,0 +82,0 @@ }

@@ -5,3 +5,3 @@ import { TokenWithExpiry, AuthenticationResponse } from "./authenticator";

export interface InstanceOptions {
instance: string;
instanceId: string;
key: string;

@@ -16,3 +16,3 @@ serviceName: string;

private client;
private instanceId;
private id;
private serviceName;

@@ -19,0 +19,0 @@ private serviceVersion;

@@ -10,5 +10,5 @@ "use strict";

function Instance(options) {
if (!options.instance)
if (!options.instanceId)
throw new Error('Expected `instance` property in Instance options!');
if (options.instance.split(":").length !== 3)
if (options.instanceId.split(":").length !== 3)
throw new Error('The instance property is in the wrong format!');

@@ -19,6 +19,6 @@ if (!options.serviceName)

throw new Error('Expected `serviceVersion` property in Instance otpions!');
var splitInstance = options.instance.split(":");
var splitInstance = options.instanceId.split(":");
this.platformVersion = splitInstance[0];
this.cluster = splitInstance[1];
this.instanceId = splitInstance[2];
this.id = splitInstance[2];
this.serviceName = options.serviceName;

@@ -34,3 +34,3 @@ this.serviceVersion = options.serviceVersion;

host: options.host || this.cluster + "." + HOST_BASE,
instanceId: this.instanceId,
instanceId: this.id,
serviceName: this.serviceName,

@@ -40,3 +40,3 @@ serviceVersion: this.serviceVersion,

});
this.authenticator = new authenticator_1.default(this.instanceId, this.keyId, this.keySecret);
this.authenticator = new authenticator_1.default(this.id, this.keyId, this.keySecret);
}

@@ -43,0 +43,0 @@ Instance.prototype.request = function (options) {

Sorry, the diff of this file is not supported yet