Socket
Socket
Sign inDemoInstall

cf-nodejs-client

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cf-nodejs-client - npm Package Compare versions

Comparing version 0.9.0 to 0.9.1

lib/model/Users.js

42

CHANGELOG.md

@@ -0,1 +1,43 @@

## Version 0.9.1 2015-10-29
- Adding the dependency Bluebird to improve the performance
- Adding support for Quotas (Org/Space)
- It is possible to create users in the system. (Quota/Org/Space/User)
Environment: LOCAL_INSTANCE_1
65 passing (2m)
23 pending
Environment: PIVOTAL
58 passing (3m)
19 pending
Environment: BLUEMIX
58 passing (3m)
19 pending
## Version 0.9.0 2015-10-23
- Adding support for Java Buildpack
- Testing development in 3 environments: Local Instance (Yudai), PSW & Bluemix
- Initial support for Organizations & Spaces
Environment: LOCAL_INSTANCE_1
57 passing (1m)
16 pending
Environment: PIVOTAL
57 passing (1m)
16 pending
Environment: BLUEMIX
57 passing (4m)
16 pending
## Version 0.8.3 2015-10-19

@@ -2,0 +44,0 @@

@@ -106,2 +106,77 @@ /*jslint node: true*/

/**
* http://apidocs.cloudfoundry.org/222/organizations/creating_an_organization.html
* @param {[type]} token_type [description]
* @param {[type]} access_token [description]
* @param {[type]} orgOptions [description]
*/
Organizations.prototype.add = function (token_type, access_token, orgOptions) {
var url = this.API_URL + "/v2/organizations";
var options = {
method: 'POST',
url: url,
headers: {
Authorization: token_type + ' ' + access_token
},
form: JSON.stringify(orgOptions)
};
return this.REST.request(options, "201", true);
};
/**
* http://apidocs.cloudfoundry.org/222/organizations/delete_a_particular_organization.html
* @param {[type]} token_type [description]
* @param {[type]} access_token [description]
* @param {[type]} org_guid [description]
* @param {[type]} orgOptions [description]
* @return {[type]} [description]
*/
Organizations.prototype.remove = function (token_type, access_token, org_guid, orgOptions) {
var url = this.API_URL + "/v2/organizations/" + org_guid;
var qs = { };
if (orgOptions) {
qs = orgOptions;
}
var options = {
method: 'DELETE',
url: url,
headers: {
Authorization: token_type + ' ' + access_token
},
qs:qs
};
return this.REST.request(options, "204", false);
};
/**
* http://apidocs.cloudfoundry.org/222/organizations/list_all_users_for_the_organization.html
* @param {[type]} token_type [description]
* @param {[type]} access_token [description]
* @param {[type]} org_guid [description]
* @param {[type]} filter [description]
* @return {[type]} [description]
*/
Organizations.prototype.getUsers = function (token_type, access_token, org_guid, filter) {
var url = this.API_URL + "/v2/organizations/" + org_guid + "/users";
var qs = { };
if (filter) {
qs = filter;
}
var options = {
method: 'GET',
url: url,
headers: {
Authorization: token_type + ' ' + access_token
},
qs:qs
};
return this.REST.request(options, "200", true);
};
module.exports = Organizations;

50

lib/model/OrganizationsQuota.js

@@ -34,3 +34,3 @@ /*jslint node: true*/

headers: {
'Authorization': token_type + ' ' + access_token
Authorization: token_type + ' ' + access_token
}

@@ -55,3 +55,3 @@ };

headers: {
'Authorization': token_type + ' ' + access_token
Authorization: token_type + ' ' + access_token
}

@@ -62,2 +62,48 @@ };

/**
* http://apidocs.cloudfoundry.org/222/organization_quota_definitions/creating_a_organization_quota_definition.html
* @param {[type]} token_type [description]
* @param {[type]} access_token [description]
* @param {[type]} quotaOptions [description]
*/
OrganizationsQuota.prototype.add = function (token_type, access_token, quotaOptions) {
var url = this.API_URL + "/v2/quota_definitions";
var options = {
method: 'POST',
url: url,
headers: {
Authorization: token_type + ' ' + access_token
},
form: JSON.stringify(quotaOptions)
};
return this.REST.request(options, "201", true);
};
/**
* http://apidocs.cloudfoundry.org/222/organization_quota_definitions/delete_a_particular_organization_quota_definition.html
* @param {[type]} token_type [description]
* @param {[type]} access_token [description]
* @param {[type]} quota_guid [description]
* @param {[type]} async [description]
* @return {[type]} [description]
*/
OrganizationsQuota.prototype.remove = function (token_type, access_token, quota_guid, async) {
var url = this.API_URL + "/v2/quota_definitions/" + quota_guid;
var qs = { };
if (async) {
qs = async;
}
var options = {
method: 'DELETE',
url: url,
headers: {
Authorization: token_type + ' ' + access_token
},
qs:qs
};
return this.REST.request(options, "204", false);
};
module.exports = OrganizationsQuota;

@@ -137,2 +137,55 @@ /*jslint node: true*/

/**
* http://apidocs.cloudfoundry.org/222/spaces/creating_a_space.html
*
* var spaceOptions = {
*
* }
*
* @param {[type]} token_type [description]
* @param {[type]} access_token [description]
* @param {[type]} spaceOptions [description]
*/
Spaces.prototype.add = function (token_type, access_token, spaceOptions) {
var url = this.API_URL + "/v2/spaces";
var options = {
method: 'POST',
url: url,
headers: {
'Authorization': token_type + ' ' + access_token
},
form : JSON.stringify(spaceOptions)
};
return this.REST.request(options, "201", true);
};
/**
* http://apidocs.cloudfoundry.org/222/spaces/delete_a_particular_space.html
*
* @param {[type]} token_type [description]
* @param {[type]} access_token [description]
* @param {[type]} org_guid [description]
* @param {[type]} spaceOptions [description]
* @return {[type]} [description]
*/
Spaces.prototype.remove = function (token_type, access_token, org_guid, spaceOptions) {
var url = this.API_URL + "/v2/spaces/" + org_guid;
var qs = { };
if (spaceOptions) {
qs = spaceOptions;
}
var options = {
method: 'DELETE',
url: url,
headers: {
Authorization: token_type + ' ' + access_token
},
qs:qs
};
return this.REST.request(options, "204", false);
};
module.exports = Spaces;

@@ -5,2 +5,3 @@ /*jslint node: true*/

var Promise = require('bluebird');
var request = require('request');

@@ -7,0 +8,0 @@ var rest = require('restler');

5

package.json
{
"name": "cf-nodejs-client",
"version": "0.9.0",
"version": "0.9.1",
"description": "A Cloud Foundry Client for Node.js",

@@ -16,3 +16,3 @@ "author": "Juan Antonio Breña Moral <bren@juanantonio.info>",

"start": "node index.js",
"test": "mocha test --config=LOCAL_INSTANCE_1 && mocha test --config=PIVOTAL && mocha test --config=BLUEMIX",
"test": "mocha test --config=LOCAL_INSTANCE_1 ",
"localTests": "mocha test --config=LOCAL_INSTANCE_1 && mocha test --config=PIVOTAL && mocha test --config=BLUEMIX"

@@ -39,2 +39,3 @@ },

"dependencies": {
"bluebird": "2.10.2",
"request": "2.65.0",

@@ -41,0 +42,0 @@ "restler": "3.4.0"

@@ -7,5 +7,10 @@ # cf-nodejs-client [![Build Status](https://travis-ci.org/prosociallearnEU/cf-nodejs-client.svg)](https://travis-ci.org/prosociallearnEU/cf-nodejs-client) [![Dependency Status](https://david-dm.org/prosociallearnEU/cf-nodejs-client.svg)](https://david-dm.org/prosociallearnEU/cf-nodejs-client) [![devDependency Status](https://david-dm.org/prosociallearnEU/cf-nodejs-client/dev-status.svg)](https://david-dm.org/prosociallearnEU/cf-nodejs-client#info=devDependencies)

This project provides a simple client library to interact with the [Cloud Foundry REST API](http://apidocs.cloudfoundry.org/) platform installed on [Pivotal](https://console.run.pivotal.io)
, [IBM Bluemix](https://console.ng.bluemix.net/) or a [Local Cloud Foundry instance](https://github.com/yudai/cf_nise_installer) using [Node.js](https://nodejs.org/). The client provides objects to retrieve information about the following concepts:
This project provides a simple client library to interact with some components used on the [Cloud Foundry Architecture](http://apidocs.cloudfoundry.org/):
![ScreenShot](https://raw.githubusercontent.com/prosociallearnEU/cf-nodejs-client/master/docs/cf_architecture_block.png)
The features implemented are:
**[Cloud Controller Layer](http://apidocs.cloudfoundry.org/):**
* Apps

@@ -15,3 +20,2 @@ * BuildPacks

* Jobs
* Logs
* Organizations

@@ -25,9 +29,23 @@ * Organizations Quota

* User Provided Services
* Users
**Authentication layer:**
* UAA Users
**Logging & Metrics layer:**
* Logs
Using this library, you could interact with [PWS](https://console.run.pivotal.io)
, [Bluemix](https://console.ng.bluemix.net/) or a [Local Cloud Foundry instance](https://github.com/yudai/cf_nise_installer) using [Node.js](https://nodejs.org/).
# Applications
[Node.js](https://nodejs.org/) with [Express](http://expressjs.com/) are a great combination to develop Web applications. If you <a href="https://www.google.com/trends/explore#q=python%20flask%2C%20node%20express%2C%20go%20pat%2C%20java%20spark%2C%20ruby%20sinatra&cmpt=q&tz=Etc%2FGMT-2" target="_blank">observe the Sinatra market</a>, you will notice that the community goes in that address. This library could be useful for you to develop a Web Application to interact with a Cloud Foundry Instance.
[Node.js](https://nodejs.org/) with [Express](http://expressjs.com/) are a great combination to develop Web applications. If you <a href="https://www.google.com/trends/explore#q=python%20flask%2C%20node%20express%2C%20go%20pat%2C%20java%20spark%2C%20ruby%20sinatra&cmpt=q&tz=Etc%2FGMT-2" target="_blank">observe the Sinatra market</a>, you will notice that Node.js has a huge Traction.
The development doesn't cover the whole API. This library puts the focus in the Application life cycle to handle the following tasks:
The development doesn't cover the whole CC API. Main areas of development are:
**App life cycle:**
* Create an App

@@ -43,2 +61,10 @@ * Upload source code in .zip or .war (Support for Static, Node.js & JEE)

**PaaS Management:**
* Organization quota
* Organization
* Space
* UAA Users
* Users
# Getting Started

@@ -103,6 +129,8 @@

* [Commercial Pivotal PaaS platform](https://console.run.pivotal.io)
* [Commercial IBM Bluemix PaaS platform](https://console.ng.bluemix.net/)
* [Local Cloud Foundry instance](https://github.com/yudai/cf_nise_installer)
| [Local Instance](https://github.com/yudai/cf_nise_installer) | [PWS](https://console.run.pivotal.io) | [Bluemix](https://console.ng.bluemix.net/) |
| -------------- |:-------------:| -------:|
| 2.25.0 | 2.41.0 | 2.27.0 |
Note: Last test: 2015/10/29
**Test suite:**

@@ -109,0 +137,0 @@

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