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

orchestrate

Package Overview
Dependencies
Maintainers
4
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

orchestrate - npm Package Compare versions

Comparing version 0.4.4 to 0.4.5

41

lib/client.js

@@ -25,7 +25,8 @@ // Copyright 2013 Bowery Software, LLC

* @param {string} token
* @param {string} apiEndpoint
*/
function Client (token) {
assert(token, 'API key required.')
function Client (token, apiEndpoint) {
assert(token, 'API key required.');
if (!(this instanceof Client)) {
return new Client(token)
return new Client(token, apiEndpoint);
}

@@ -37,3 +38,3 @@

*/
this.contentType = 'application/json'
this.contentType = 'application/json';

@@ -45,5 +46,12 @@ /**

*/
this._token = token
this._token = token;
/**
* API Endpoint used for connecting to DB.
* @type {string}
* @protected
*/
this._apiEndPoint = apiEndpoint || 'api.orchestrate.io';
/**
* Identifies the orchestrate.js client as the UserAgent to Orchestrate Service.

@@ -53,15 +61,8 @@ * @type {string}

*/
this._userAgent = 'orchestrate.js/' + pjson.version +
' (Bowery.io; node.js ' + process.version + ')'
this._userAgent = 'orchestrate.js/' + pjson.version + ' (Bowery.io; node.js ' + process.version + ')';
}
/**
* Api endpoint.
* @enum {string}
*/
Client.ApiEndPoint = 'api.orchestrate.io'
Client.ApiProtocol = 'https:';
Client.ApiProtocol = 'https:'
/**

@@ -71,3 +72,3 @@ * Api version

*/
Client.ApiVersion = 'v0'
Client.ApiVersion = 'v0';

@@ -82,7 +83,7 @@

Client.prototype.get = function (collection, key, ref) {
assert(collection && key, 'Collection and key required.')
assert(collection && key, 'Collection and key required.');
if (!ref) {
return this._get(this.generateApiUrl([collection, key]))
return this._get(this.generateApiUrl([collection, key]));
} else {
return this._get(this.generateApiUrl([collection, key, 'refs', ref]))
return this._get(this.generateApiUrl([collection, key, 'refs', ref]));
}

@@ -472,3 +473,3 @@ }

link.get = function (linkUrl) {
return this._get(Client.ApiProtocol + '//' + Client.ApiEndPoint + linkUrl)
return this._get(Client.ApiProtocol + '//' + this._apiEndPoint + linkUrl)
}.bind(this, link.url)

@@ -546,3 +547,3 @@ }

protocol: Client.ApiProtocol,
host: Client.ApiEndPoint + '/' + Client.ApiVersion,
host: this._apiEndPoint + '/' + Client.ApiVersion,
pathname: pathname,

@@ -549,0 +550,0 @@ query: query

@@ -28,3 +28,3 @@ {

},
"version": "0.4.4",
"version": "0.4.5",
"main": "index",

@@ -31,0 +31,0 @@ "tags": [

@@ -37,5 +37,4 @@ # orchestrate.js [![Build Status](https://travis-ci.org/orchestrate-io/orchestrate.js.png)](https://travis-ci.org/orchestrate-io/orchestrate.js) [![Coverage Status](https://coveralls.io/repos/orchestrate-io/orchestrate.js/badge.png)](https://coveralls.io/r/orchestrate-io/orchestrate.js)

```javascript
var oio = require('orchestrate')
oio.ApiEndPoint = "api.aws-eu-west-1.orchestrate.io"
var db = oio(token)
var oio = require('orchestrate');
var db = oio(token, 'api.aws-eu-west-1.orchestrate.io');
```

@@ -42,0 +41,0 @@

var oio = require('../lib-cov/client');
oio.ApiProtocol = process.env.ORCHESTRATE_API_PROTOCOL || 'https:'
oio.ApiEndPoint = process.env.ORCHESTRATE_API_ENDPOINT || 'api.orchestrate.io'
var token = process.env.ORCHESTRATE_API_KEY || 'sample_token';
var apiEndPoint = process.env.ORCHESTRATE_API_ENDPOINT || 'api.orchestrate.io';
module.exports = function() {
return oio(token);
return oio(token, apiEndPoint);
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc