blob: 6bb43f8149ffb677cf4944f899861de31297a432 [file] [log] [blame]
avm9996304def3e2016-11-27 22:53:05 +01001var Site = function(id) {
2 this.siteId = id;
3};
4
5Site.prototype = {
6 /**
7 * Get access token by user's authorization.
8 * @param {Function} callback call-back function, parameters:
9 * {String} result, success or failure; {User|String} user with access
10 * token, etc. or error message.
11 */
12 getAccessToken: function(callback) {},
13
14 /**
15 * Check if the url is redirect url for retrieving access token of current
16 * site.
17 * @param {String} url
18 * @return {Boolean} result
19 */
20 isRedirectUrl: function(url) {},
21
22 /**
23 * Parse and get access token from redirect url, then call call-back function
24 * of passed by calling getAccessToken method with access token.
25 * @param {String} url
26 */
27 parseAccessToken: function(url) {},
28
29 /**
30 * Get user information.
31 * @param {User} user
32 * @param {Function} callback call-back function, parameters:
33 * {String} result, success or failure; {User|String} user with user id,
34 * user name, etc. or error message.
35 */
36 getUserInfo: function(user, callback) {},
37
38 /**
39 * Upload image.
40 * @param {User} user user data with access token, etc.
41 * @param {String} caption image description
42 * @param {String} imageData binary image data
43 * @param callback call-back function, parameters:
44 * {String} result, success or failure; {String} photo id or error message.
45 */
46 upload: function(user, caption, imageData, callback) {},
47
48 /**
49 * Get photo link.
50 * @param {User} user user data with id, access token, etc.
51 * @param {String} photoId
52 * @param {Function} callback call-back function, parameters:
53 * {String} result, success or failure; {String} photo link or error
54 * message.
55 */
56 getPhotoLink: function(user, photoId, callback) {},
57
58 /**
59 * Log out current signed in user.
60 * @param callback
61 */
62 logout: function(callback) {}
63};