Titanium JIRA Archive
Appcelerator Community (AC)

[AC-738] Ti.Cloud Node.ACS Statuses Methods Incomplete in Node.ACS

GitHub Issuen/a
TypeBug
Priorityn/a
StatusResolved
ResolutionDuplicate
Resolution Date2014-06-16T21:45:07.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsAppcelerator Modules
Labelsnode-acs
ReporterDave Hudson
AssigneeShuo Liang
Created2014-05-06T14:50:32.000+0000
Updated2016-03-08T07:36:59.000+0000

Description

When using Node.ACS the acs-node lib is incomplete compared to the normally available methods for Statuses. If you try to either edit, update or delete a status using Node.ACS you will get an error similar to the following: TypeError: Object # has no method 'update' The global npm for acs-node installed at /usr/local/lib/node_modules/acs/node_modules/acs-node/lib/acs.js shows that only: - create - search - query are listed as options. It would be helpful if: - show - update - delete were also available as per the docs for the Cloud Statuses: http://docs.appcelerator.com/cloud/latest/#!/api/Statuses

Comments

  1. Seth Toda 2014-05-06

    Hello Dave, The API has not been completely ported to the node-acs library. But this is an ongoing process. In the mean time, I would suggest using an xhr request to simulate a curl request. // Seth
  2. Shuo Liang 2014-05-07

    Hi Dave, For now, if you want use show, update or delete method in Node.ACS app, you can go with REST API way to work around. Like this:
       var ACS = require('acs').ACS;
       var acs = ACS.initACS('<App Key>');
       var logger = require('acs').logger;
       
       // status show method 
       function show(req, res) {	
       	var data = {
       		status_id: '5369a57415d82732262876c7'
       	};
       	acs.rest('statuses/show.json', 'GET', data, function(e){
       		if(e && e.meta) {
       			if(e.meta.status == 'ok') {
       				var status = e.response.statuses[0];
               		logger.info('Success:\n' + 'id: ' + status.id + '\n' + 'updated_at: ' + status.updated_at);
               		res.redirect('/main');
       			} else {
       				res.render('index', {message: e.meta.message});
       			}
       		} else {
       			res.render('index', {message: e.meta.message});
       		}
       	}, req, res);
       }
       
  3. Dave Hudson 2014-05-16

    Thanks Shuo, that works great!
  4. Radamantis Torres-Lechuga 2014-06-16

JSON Source