-
Notifications
You must be signed in to change notification settings - Fork 3
/
constants.js
77 lines (74 loc) · 2.5 KB
/
constants.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
const URL_DATA = 'https://chat.google.com/_/DynamiteWebUi/data';
const URL_MUTATE = 'https://chat.google.com/_/DynamiteWebUi/mutate';
const URL_EVENTS = 'https://chat.google.com/u/0/webchannel/events';
const URL_REGISTER = 'https://chat.google.com/u/0/webchannel/register';
const URL_BATCHEXECUTE =
'https://chat.google.com/u/0/_/DynamiteWebUi/data/batchexecute';
const DEFAULT_HEADERS = {
'content-type': 'application/x-www-form-urlencoded;charset=UTF-8',
'User-Agent': 'glycerin-tui/0.0.1',
accept: '*/*',
};
const ACTIONID_GET_CHATS = '115617451';
// _GET_CHAT_THREADS seems unnecessary.
// we COULD use _GET_CHAT_MESSAGES here as it returns the same threads + messages
// but with slightly more (as of yet unknown) metadata
// at any rate, we call this to populate the initial threads
// but need to call _MESSAGES to load *more*
// ¯\_(ツ)_/¯
const ACTIONID_GET_CHAT_THREADS = '120296683';
const ACTIONID_GET_USERS = '147662381';
const ACTIONID_GET_THREAD_MESSAGES = '120296731';
const ACTIONID_SEND_THREAD_MESSAGE = '115099363';
const ACTIONID_CREATE_THREAD = '120594192'; // yes, the same as SEND_DM_MESSAGE
const ACTIONID_GET_CHAT_MESSAGES = '120296718';
const ACTIONID_SEND_CHAT_MESSAGE = '120594192';
const ACTIONID_GET_AVAILABLE_ROOMS = '144362466';
const ACTIONID_SET_ROOM_MEMBERSHIP = '145360970'; // join or leave a room
const ACTIONID_WHOAMI = '115617453';
const ACTIONID_HIDE_CHAT = '145597873'; // hide a DM
const ACTIONID_MARK_THREAD_READ = '120296768';
const ACTIONID_MARK_DM_READ = '163732318';
// const ACTIONID_CHAT_MEMBERS = '115617454'; // [[[115617454,[{"115617454":[["space/AAAAnDXy3Ws","AAAAnDXy3Ws",2],true]}],null,null,0]]]
const RPCID_GET_SPACE_DETAILS = 'W9QdYe';
const COLORS_ACTIVE_ITEM = {
fg: 'white',
};
const COLORS_ACTIVE_SELECTED = {
fg: 'white',
bg: 'grey',
};
const COLORS_INACTIVE_ITEM = {
fg: 'grey',
};
const COLORS_INACTIVE_SELECTED = {
fg: 'black',
bg: 'grey',
};
module.exports = {
URL_DATA,
URL_MUTATE,
URL_EVENTS,
URL_REGISTER,
URL_BATCHEXECUTE,
DEFAULT_HEADERS,
ACTIONID_GET_CHATS,
ACTIONID_GET_CHAT_MESSAGES,
ACTIONID_GET_CHAT_THREADS,
ACTIONID_GET_THREAD_MESSAGES,
ACTIONID_GET_USERS,
ACTIONID_SEND_CHAT_MESSAGE,
ACTIONID_SEND_THREAD_MESSAGE,
ACTIONID_CREATE_THREAD,
ACTIONID_GET_AVAILABLE_ROOMS,
ACTIONID_SET_ROOM_MEMBERSHIP,
ACTIONID_MARK_THREAD_READ,
ACTIONID_MARK_DM_READ,
ACTIONID_WHOAMI,
ACTIONID_HIDE_CHAT,
COLORS_ACTIVE_ITEM,
COLORS_ACTIVE_SELECTED,
COLORS_INACTIVE_ITEM,
COLORS_INACTIVE_SELECTED,
RPCID_GET_SPACE_DETAILS,
};