Conversation
There was a problem hiding this comment.
@ejolly this uses the https://github.com/peerlibrary/meteor-aws-sdk package (@mitar does good work) to call AWS instead of the old janky stuff. It still needs a bunch of work though, see comments.
I could use your help to go through and modify all the TurkServer.mturk() calls appropriately and test them. That should allow you to run your existing experiment.
The lack of TypeScript means we have to basically check and test everything manually instead of getting the data shape checked for us.
admin/admin.js
Outdated
| TurkServer.checkAdmin(); | ||
| try { | ||
| return TurkServer.mturk("GetAccountBalance", {}); | ||
| return TurkServer.mturk.getAccountBalanceSync().AvailableBalance; |
There was a problem hiding this comment.
Every Turkserver.mturk in the codebase now needs to be replaced with this direct JavaScript function variant instead. Note in particular that peerlibrary:aws-sdk conveniently provides a ...Sync() variant of the function that works with Meteor's fibers, so the call looks synchronous (even though it is in fact a callback under the hood).
| switch (op) { | ||
| case "CreateHIT": | ||
| return JSPath.apply("..HITId[0]", result); | ||
| case "GetAccountBalance": |
There was a problem hiding this comment.
The old AWS SDK used to be all XML-based, which means we have this ugly parser stuff. We can remove all that now and access the JSON data directly, but note that this will have to be added to each TurkServer.mturk call as in the example code above.
|
@ejolly see your question at peerlibrary/meteor-aws-sdk#38 |
cc @ejolly.