cloud-code

Parse.Com - HTTP method in cloud code, how do I wait for the response

假如想象 提交于 2019-12-08 03:09:49
问题 In my parse cloud code, the HttpRequest in beforeSave is getting executed successfully but the code blows through before I have had time to parse the response and determine whether I want to return a response.success() or a response.error() . I know I am missing something here, any input, ideas from the community here would be appreciated. Thanks Parse.Cloud.beforeSave(Parse.User, function (request, response) { var user = request.object; var key = user.get("recaptcha"); Parse.Cloud

Cloud Code: Creating a Parse.File from URL

若如初见. 提交于 2019-12-07 16:29:13
问题 I'm working on a Cloud Code function that uses facebook graph API to retrieve users profile picture. So I have access to the proper picture URL but I'm not being able to acreate a Parse.File from this URL. This is pretty much what I'm trying: Parse.Cloud.httpRequest({ url: httpResponse.data["attending"]["data"][key]["picture"]["data"]["url"], success: function(httpImgFile) { var imgFile = new Parse.File("file", httpImgFile); fbPerson.set("profilePicture", imgFile); }, error: function

How to access Facebook Graph API in Parse Cloud Code?

烂漫一生 提交于 2019-12-07 08:25:01
问题 I need to get friends of a user that logged in with Facebook at my Parse app, inside a cloud function. How can I achieve this? I've tried to install facebook-node-sdk (https://github.com/Thuzi/facebook-node-sdk/), but even though I've copied all the dependencies into the same folder, it complains about being unable to load the package when I require it. I've also found this question: How can I get the user first name from facebook in cloud code? but the answer there doesn't work ( FB is not

Parse.com Javascript SDK using include, but not working

≡放荡痞女 提交于 2019-12-07 05:16:26
问题 I'm trying to fetch data from a table called Book . Inside Book there's a Pointer<ParseUser> which holds the pointer of one user. The ParseUser has another pointer called Pais (which means Country in spanish). So I want to fetch every single info from any Book : var query = new Parse.Query("Book"); query.include("user"); query.include("user.pais"); query.find({ success: function(books) { response.success(books); }, error: function(error) { response.error({'resp': error.code, 'message': error

How to deploy cloud code on AWS hosted Parse server

旧时模样 提交于 2019-12-06 05:54:01
问题 I am new to AWS elastic beanstalk. I have deployed the Parse example server using deploy to AWS button in the Parse Server Example Link. I want to update the cloud code in main.js but I don't know how can I deploy the cloud code the way I was deploying with Parse in terminal. 回答1: Try this command: eb deploy It will zip your repository, upload to S3 and deploy to eb. Get the CLI tool: https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/eb-cli3-install.html 回答2: You need to have the Parse

Cloud Code: Creating a Parse.File from URL

心已入冬 提交于 2019-12-05 19:41:57
I'm working on a Cloud Code function that uses facebook graph API to retrieve users profile picture. So I have access to the proper picture URL but I'm not being able to acreate a Parse.File from this URL. This is pretty much what I'm trying: Parse.Cloud.httpRequest({ url: httpResponse.data["attending"]["data"][key]["picture"]["data"]["url"], success: function(httpImgFile) { var imgFile = new Parse.File("file", httpImgFile); fbPerson.set("profilePicture", imgFile); }, error: function(httpResponse) { console.log("unsuccessful http request"); } }); And its returning the following: Result:

Is it possible to clone existing cloud code already deployed on server side, through the Parse command line tool?

∥☆過路亽.° 提交于 2019-12-05 18:22:37
How can I clone an existing Parse Cloud Project files to my computer with the command line tool? I tried parse new and selected a project but it created a folder with new files, not the files that I already had in the Parse Cloud. Note: I did not find clue regarding that point in the Parse cloud code documentation neither via Google. Thanks! With the new release of parse-cli, this is possible now. Make sure your cli is at least at version 2.2.5 Follow below instructions to download cloud code files on your new machine: parse new then choose e for existing app, then choose your app. This will

Update Stripe module at Parse Cloud Code

允我心安 提交于 2019-12-05 16:08:48
Turns out that Stripe module at Parse Could Code is out of date and won't be updated. Source: https://developers.facebook.com/bugs/523104684492016/ Parse modules are using an old version of the API and there is no plan to update it in the near future. As a workaround please download the newer SDKs directly off the third party site, place it in "cloud/" folder and import it using require(); We're going to close this by design. I have downloaded Stripe module via terminal with command npm install stripe I'm trying to import this module but when I deploy it to Parse, it seems that most of the

How to access Facebook Graph API in Parse Cloud Code?

99封情书 提交于 2019-12-05 11:58:27
I need to get friends of a user that logged in with Facebook at my Parse app, inside a cloud function. How can I achieve this? I've tried to install facebook-node-sdk ( https://github.com/Thuzi/facebook-node-sdk/ ), but even though I've copied all the dependencies into the same folder, it complains about being unable to load the package when I require it. I've also found this question: How can I get the user first name from facebook in cloud code? but the answer there doesn't work ( FB is not defined). I can do raw REST calls to Graph API with my access token using Parse.Cloud.httpRequest but

Parse.com Javascript SDK using include, but not working

ε祈祈猫儿з 提交于 2019-12-05 11:10:55
I'm trying to fetch data from a table called Book . Inside Book there's a Pointer<ParseUser> which holds the pointer of one user. The ParseUser has another pointer called Pais (which means Country in spanish). So I want to fetch every single info from any Book : var query = new Parse.Query("Book"); query.include("user"); query.include("user.pais"); query.find({ success: function(books) { response.success(books); }, error: function(error) { response.error({'resp': error.code, 'message': error.message}); } }); and I don't get the objects, just the pointers: Why ? I know it works ok when I call