Inital Commit
[oweals/finalsclub.git] / node_modules / aws-lib / lib / simpledb.js
1 exports.init = function(genericAWSClient) {
2   // Creates a SimpleDB API client
3   var createSimpleDBClient = function (accessKeyId, secretAccessKey, options) {
4     options = options || {};
5
6     var client = simpledbClient({
7       host: options.host || "sdb.amazonaws.com",
8       path: options.path || "/",
9       accessKeyId: accessKeyId,
10       secretAccessKey: secretAccessKey,
11       secure: options.secure,
12       version: options.version
13     });
14     return client;
15   }
16   // Amazon SimpleDB API client
17   var simpledbClient = function(obj) {
18     var aws = genericAWSClient({
19       host: obj.host, path: obj.path, accessKeyId: obj.accessKeyId,
20       secretAccessKey: obj.secretAccessKey, secure: obj.secure
21     })
22     obj.call = function(action, query, callback) {
23       query["Action"] = action
24       query["Version"] = obj.version || '2009-04-15'
25       query["SignatureMethod"] = "HmacSHA256"
26       query["SignatureVersion"] = "2"
27       return aws.call(action, query, callback);
28     }
29     return obj;
30   }
31   return createSimpleDBClient;
32 }