-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
56 lines (50 loc) · 1.75 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
var objectStorage = require("./lib/storage/objectStorage");
var game = require("./lib/game/game");
var connectivity = require("./lib/connectivity/connectivity");
var common = require("./lib/common");
var auth = require("./lib/auth/auth");
var cloudCode = require("./lib/cloudCode/cloudCode");
var sentry = require("./lib/sentry/client");
var error = require("./lib/errors");
var config = require("./lib/config");
var Backtory = module.exports = {
common: common,
Object: objectStorage.Object,
Relation: objectStorage.Relation,
Query: objectStorage.Query,
Error: error,
LeaderBoard: game.LeaderBoard,
Event: game.Event,
EventBulk: game.EventBulk,
Game: game.Game,
Users: auth.Users,
Function: cloudCode.Function,
ChatGroup: connectivity.ChatGroup,
ChatMessage: connectivity.ChatMessage,
Messages: connectivity.Messages,
DirectMessages: connectivity.DirectMessages,
OnlineUsers: connectivity.OnlineUsers,
MatchProperties: connectivity.MatchProperties,
MatchResult: connectivity.MatchResult,
RealtimeGame: connectivity.RealtimeGame,
OnlineUser: connectivity.OnlineUser,
DirectChat: connectivity.DirectChat,
GroupChat: connectivity.GroupChat,
setConfigFileLocation: function(path) {
if (!path || (typeof path != "string"))
throw new Error("Config file location must be a valid string.");
common.setConfigFileLocation(path);
},
getBaseUrl: function() {
return config.backtory.baseUrl;
},
getVersion: function() {
return config.sdk.version;
}
};
auth.init(Backtory.common);
objectStorage.init(Backtory.common);
game.init(Backtory.common);
connectivity.init(Backtory.common);
cloudCode.init(Backtory.common);
sentry.init(Backtory.common);