-
Notifications
You must be signed in to change notification settings - Fork 4
/
plan.txt
193 lines (164 loc) · 3.82 KB
/
plan.txt
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
//
// All requests must have a header "Auth" which carries an empty JWT token
//
PUT /api/v1/register
{
name: "myext",
handlers: [
{
network: "something", // Optional
channel: "something", // Optional
event: "001",
},
],
commands: [
{
network: "something", // Optional
channel: "something", // Optional
cmd: {
name: "cmd",
extension: "name",
description: "description",
kind: 1,
scope: 1,
args: ["arg", "two"],
require_auth: true,
req_level: 5,
req_flags: "ab"
}
}
],
}
Response:
200 OK
/////////////////////////////////////////
PUT /api/v1/unregister
{
name: "myext"
}
Response:
200 OK
/////////////////////////////////////////
State:
/////////////////////////////////////////
GET /api/v1/net/{network}/state/self
{
"user": { "host": "[email protected]", "name": "Who Bot" },
"modes": CHANNELMODES
}
GET /api/v1/net/{network}/state/user/{user}
Response: 200 404 { "host": "[email protected]", "name": "Dylan Johnstoner" }
GET /api/v1/net/{network}/state/users?channel="#channel"
Response: 200 404 [ "[email protected]", "[email protected]" ]
GET /api/v1/net/{network}/state/users/count?channel="#channel"
Response: 200 404 { "count": N }
GET /api/v1/net/{network}/state/user_modes/{channel}/{nick_or_host}
Response: 200 404
CHANNELMODES
GET /api/v1/net/{network}/state/channel/{channel}
Response: 200 404
{
"name": "#deviate",
"topic": "meetup at cm's house whatever... just show up and say hello!"
"modes": {
"arg_modes": {
"l": "5",
"k": "password"
},
"address_modes": {
"b": ["fish*", "cm*"],
},
}
}
GET /api/v1/net/{network}/state/channels?user="fish"
Response: 200 ["#deviate", "#bots"]
GET /api/v1/net/{network}/state/channels/count?user="fish"
Response: 200 404 { "count": N }
GET /api/v1/net/{network}/state/is_on/{channel}/{nick_or_host}
Response: 200 404
CHANNELMODES:
{
"modes": N,
"kinds": {
"user_prefixs": [
{ "symbol": "@", "char": "o" },
]
"channel_modes": {
"l": 2,
"b": 4,
}
}
}
/////////////////////////////////////////
Store:
/////////////////////////////////////////
PUT /api/v1/auth_user
{
"network": "irc.zkpq.ca",
"host": "[email protected]",
"username": "username",
"password": "bcrypt",
"permanent": true
}
Response: 200 / 401
GET /api/v1/store/net/{network}/authed_user/{host}
Response: 200 / 404
STOREDUSER
GET /api/v1/store/user/{username}
Response: 200 / 404
STOREDUSER
GET /api/v1/store/users
Response: 200
[ STOREDUSER ]
GET /api/v1/store/net/{network}/users
Response: 200 / 404
[ STOREDUSER ]
GET /api/v1/store/net/{network}/channel/{channel}/users
Response: 200 / 404
[ STOREDUSER ]
GET /api/v1/store/net/{network}/channel/{channel}
Response: 200 / 404
STOREDCHANNEL
GET /api/v1/store/channels
Response: 200
[ STOREDCHANNEL ]
PUT /api/v1/store/user
STOREDUSER
Response: 200 500
{ "error": "description" }
PUT /api/v1/store/channel
STOREDCHANNEL
Response: 200 500
{ "error": "description" }
DELETE /api/v1/store/user/{username}
Response: 200 404
DELETE /api/v1/store/net/{network}/channel/{channel}
Response: 200 404
// Username OR Net+Host
DELETE /api/v1/logout?network={network}&host={host}&username={username}
Response: 200 404
STOREDUSER:
{
"username": "stuff",
"password": "bcrypt",
"masks": ["*!*@fish.com"],
"access": {
"irc.zkpq.ca:#deviate": ACCESS
}
"data": {
Arbitrary Key Value Data store string -> string
}
}
STOREDCHANNEL:
{
"network": "irc.zkpq.ca",
"name": "#deviate",
"data": {
Arbitrary Key Value Data store string -> string
}
}
ACCESS:
{
"level": 10,
"flags": "weEdpants",
}