appc-platform-sdk
Advanced tools
Comparing version 3.0.3 to 3.1.0
@@ -19,2 +19,3 @@ 'use strict'; | ||
// eslint-disable-next-line no-unused-vars | ||
let Cloud = exports = module.exports = { | ||
@@ -33,2 +34,7 @@ ACS_BASE, | ||
* createACSResponseHandler | ||
* | ||
* @param {string} key response body key to return data from | ||
* @param {Function} callback callback to hit on completion | ||
* | ||
* @returns {undefined} | ||
*/ | ||
@@ -62,2 +68,6 @@ function createACSResponseHandler(key, callback) { | ||
* Create cloud response handler | ||
* | ||
* @param {Function} callback callback to hit on completion | ||
* | ||
* @returns {undefined} | ||
*/ | ||
@@ -94,2 +104,7 @@ function createCloudResponseHandler(callback) { | ||
* login to ACS backend using Platform session | ||
* | ||
* @param {Object} session session object | ||
* @param {Function} callback callback to hit on completion | ||
* | ||
* @returns {undefined} | ||
*/ | ||
@@ -114,5 +129,7 @@ function login(session, callback) { | ||
* | ||
* @param {Object} session | ||
* @param {Object} session session object | ||
* @param {string} name application name | ||
* @param {Function} callback | ||
* @param {Function} callback callback to hit on completion | ||
* | ||
* @returns {undefined} | ||
*/ | ||
@@ -124,3 +141,2 @@ function createNamedApp(session, name, callback) { | ||
// jscs:disable requireCamelCaseOrUpperCaseIdentifiers | ||
if (!session.acs_session) { | ||
@@ -168,3 +184,2 @@ tasks.push(function (next) { | ||
form.append('type', 'data'); | ||
// jscs:disable requireCamelCaseOrUpperCaseIdentifiers | ||
form.append('org_id', session.user.org_id); | ||
@@ -195,7 +210,7 @@ debug('form parameters for %s, %o', req.url, form); | ||
* | ||
* @param {Object} session | ||
* @param {string} name of the app Appclerator by default | ||
* @param {Object} session session object | ||
* @param {string} appName name of the app Appcelerator by default | ||
* @param {string} orgId id of the org to create in | ||
* @param {string} appGuid application guid | ||
* @param {Function} callback | ||
* @param {Function} callback callback to hit on completion | ||
*/ | ||
@@ -208,5 +223,5 @@ function createApp(session, appName, orgId, appGuid, callback) { | ||
var req = Appc.createRequest(session, uri, 'post', createACSResponseHandler('apps', callback)); | ||
let req = Appc.createRequest(session, uri, 'post', createACSResponseHandler('apps', callback)); | ||
if (req) { | ||
var form = req.form(); | ||
let form = req.form(); | ||
if (appGuid) { | ||
@@ -225,9 +240,10 @@ form.append('app_guid', appGuid); | ||
* | ||
* @param {Object} session | ||
* @param {string} guid api guid | ||
* @param {Object} session session object | ||
* @param {string} group_id api group_id | ||
* @param {string} env one of production, development, or the ID of a VPC env | ||
* @param {Object} keyvalues object of the properties to pass to create | ||
* @param {Function} callback | ||
* @param {Function} callback callback to hit on completion | ||
*/ | ||
function createUser(session, guid, keyvalues, callback) { | ||
let req = Appc.createRequest(session, '/api/v1/acs/' + guid + '/data.next/user', 'post', createACSResponseHandler('users', callback)); | ||
function createUser(session, group_id, env, keyvalues, callback) { | ||
let req = Appc.createRequest(session, '/api/v1/acs/' + group_id + '/' + env + '/data.next/user', 'post', createACSResponseHandler('users', callback)); | ||
if (req) { | ||
@@ -245,4 +261,7 @@ let form = req.form(); | ||
* | ||
* @param {string} type is one of NODE_ACS, ACS_BASE or AUTH_BASE | ||
* @param {string} name is one of production or development or another environment name | ||
* @param {Object} session session object | ||
* @param {string} type one of NODE_ACS, ACS_BASE or AUTH_BASE | ||
* @param {string} name one of production or development or another environment name | ||
* | ||
* @returns {undefined} | ||
*/ | ||
@@ -267,8 +286,9 @@ function getEnvironment(session, type, name) { | ||
* | ||
* @param {Object} session | ||
* @param {string} guid api guid | ||
* @param {Function} callback | ||
* @param {Object} session session object | ||
* @param {string} group_id api group_id | ||
* @param {string} env one of production, development, or the ID of a VPC env | ||
* @param {Function} callback callback to hit on completion | ||
*/ | ||
function retrieveUsers(session, guid, callback) { | ||
Appc.createRequest(session, '/api/v1/acs/' + guid + '/data.next/user', createACSResponseHandler('users', callback)); | ||
function retrieveUsers(session, group_id, env, callback) { | ||
Appc.createRequest(session, '/api/v1/acs/' + group_id + '/' + env + '/data.next/user', createACSResponseHandler('users', callback)); | ||
} |
{ | ||
"name": "appc-platform-sdk", | ||
"version": "3.0.3", | ||
"description": "Appcelerator Platform SDK for node.js", | ||
"version": "3.1.0", | ||
"description": "Appcelerator Platform SDK for Node.JS", | ||
"main": "index.js", | ||
@@ -6,0 +6,0 @@ "scripts": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2244
198228