-
Notifications
You must be signed in to change notification settings - Fork 1
/
spec.btm
332 lines (262 loc) · 7.45 KB
/
spec.btm
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
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
/*
* Common structures
*/
@cast func followUserWithId as "followers.add" (userId as "user_id": String)
func followUserWithId2 as "followers.add" () -> AnswerNotify
func followUserWithId3 as "followers.add" (userId as "user_id": String,
anotherId: String = "")
protocol SomeProtocol {
var someProperty: Bool
}
struct User as "users" {
let id: String
let name: String
let sex: Int
let age: Int
let city: String
let photoId as "photo_id": String
let photoURL as "photo": NSURL
let thumbnailURL as "photo_small": NSURL
let onlineStatus as "online_state": String
let isFollowed as "is_following": Bool
}
/*
* Notification center
*/
struct MessageNotify as "messageNotifies" {
let timestamp as "date": Int
let lastMessage as "text": String
let userId: String
let isLastMessageFromUser as "ourLast": Bool
let bi: String
let unreadCount: String
}
struct AnswerNotify as "answerNotifies": PushX, Some {
let timestamp as "date": Int
let lastMessage as "text": String
let userId: String
let isLastMessageFromUser as "ourLast": Bool
let bi: String
let unreadCount: String
}
struct FollowerNotify as "followerNotifies" {
let timestamp as "date": Int
let lastMessage as "text": String
let userId: String
let isFacebookFriend as "is_facebook": Bool
let bi: String
let unreadCount: String
}
struct UserMeta as "userMeta" {
let messagesBadge as "notify_badge_messages": Int = 0
let messagesViewTimestamp as "notify_last_read_messages": NSTimeInterval = 0
let answersBadge as "notify_last_read_people": Int = 0
let answersViewTimestamp as "notify_last_read_quizzes": NSTimeInterval = 0
let followersBadge as "notify_badge_people": Int = 0
let followersViewTimestamp as "notify_last_read_people": NSTimeInterval = 0
}
struct Contact as "contacts" {
let userId as "user_id": String
let socialFirstName as "social_first_name": String?
let socialLastName as "social_last_name": String?
let isSocialFriend as "is_social_friend": Bool = false
let bi: String
}
/*
@oneway func unfollowUserWithId as "followers.delete" (userId as "user_id": String)
rec Push
userMeta UserMeta?
users {String : User}?
messageNotifies {String : MessageNotify}?
answerNotifies {String : AnswerNotify}?
followersNotifies {String : FollowerNotify}?
contactsSearchResult {String : Contact}?
feedCards {String : FeedCard}?
questions {String : Question}?
feedColsMeta {String : FeedColsMeta}?
met Notifications.MessagesLoad as msgNotifications
bi String
count NSNumber
met Notifications.AnswersLoad as answersNotifications
bi String
count NSNumber
met notifications.getFollowers as followersNotifications: FollowerNotifyResponse
bi String
count NSNumber
rec FollowerNotifyResponse: WithPush
followersNotifies [String]?
push Push?
met contacts.searchByName as searchByName: ContactListResponse
name String
bi String
count NSNumber
met contacts.getContacts as getContacts: ContactListResponse
bi String
count NSNumber
rec ContactListResponse: WithPush
push Push?
contactsSearchResult [String]?
met Image.makeChatPhoto as makeChatPhoto: MakeImageResponse
blobId String
rec MakeImageResponse
imageId String?
rec MakeQuizImageResponse
variant String
id String
idBig String
met Image.MakeQuizImage as makeQuizImage: MakeQuizImageResponse
fileToken String
variant String
rec RemoteImage
image_id String
image_url String
thumb_url String
rec ImageSearchResponse
imageSearchResult [String: RemoteImage]
met Image.Search as imageSearch: ImageSearchResponse
query String
rec SaveQuestionResponse
met quiz.saveQuestion as saveQuestion: SaveQuestionResponse
rightAnswer String
upload1 String
uploadBig1 String
upload2 String
uploadBig2 String
question String
text1 String
text2 String
isOnePhoto Bool
met Notifications.DeleteMessageNotify as deleteMessageNotify
notifyId String
met Notifications.DeleteAnswerNotify as deleteAnswerNotify
notifyId String
met UserAction.BlockUser as blockUser
userId String
rec Question
question String
text1 String
photo_id1 String
photo1 String
text2 String
photo_id2 String
photo2 String
met Feed.get as getFeed
bi String
rec FeedColsMeta
type String
bi String
rec FeedCard
type String
questionId String?
userId String?
bi String
met Feed.getColumn as getColumn
bi String
biCol String
rec FollowerUpdatedResponse
met followers.add as followUserWithId: FollowerUpdatedResponse
user_id String
met followers.delete as unfollowUserWithId: FollowerUpdatedResponse
user_id String
rec MessageNotify
date String?
text String?
counter String?
userId String?
ourLast NSNumber?
bi String?
unreadCount String?
rec AnswerNotify
date String?
text String?
counter String?
userId String?
ourLast NSNumber?
bi String?
unreadCount String?
rec FollowerNotify
date String?
text String?
user_id String?
is_facebook NSNumber?
new NSNumber?
bi String?
rec Contact
user_id String?
social_first_name String?
social_last_name String?
is_social_friend NSNumber?
bi String?
rec Push
userMeta UserMeta?
users {String : User}?
messageNotifies {String : MessageNotify}?
answerNotifies {String : AnswerNotify}?
followersNotifies {String : FollowerNotify}?
contactsSearchResult {String : Contact}?
feedCards {String : FeedCard}?
met Notifications.MessagesLoad as msgNotifications
bi String
count NSNumber
met Notifications.AnswersLoad as answersNotifications
bi String
count NSNumber
met notifications.getFollowers as followersNotifications: FollowerNotifyResponse
bi String
count NSNumber
rec FollowerNotifyResponse: WithPush
followersNotifies [String]?
push Push?
met contacts.searchByName as searchByName: ContactListResponse
name String
bi String
count NSNumber
met contacts.getContacts as getContacts: ContactListResponse
bi String
count NSNumber
rec ContactListResponse: WithPush
push Push?
contactsSearchResult [String]?
met Image.makeChatPhoto as makeChatPhoto: MakeImageResponse
blobId String
rec MakeImageResponse
imageId String?
met Feed.get as getFeed: FeedResponse
bi String
rec FeedResponse: WithPush
feedCards [String]?
push Push?
rec FeedCard
bi String
rec MakeQuizImageResponse
variant String
id String
idBig String
met Image.MakeQuizImage as makeQuizImage: MakeQuizImageResponse
fileToken String
variant String
rec SaveQuestionResponse
met quiz.saveQuestion as saveQuestion: SaveQuestionResponse
rightAnswer String
upload1 String
uploadBig1 String
upload2 String
uploadBig2 String
question String
text1 String
text2 String
met Notifications.DeleteMessageNotify as deleteMessageNotify
notifyId String
met Notifications.DeleteAnswerNotify as deleteAnswerNotify
notifyId String
met UserAction.BlockUser as blockUser
userId String
func server.ping as ping :: () -> ()
func register :: username as userName: String,
password : String
-> RegisterResponse
data RegisterResponse :: ok as isOK: ,Bool,
error: Optional<String>
data UserInfo :: username as userName: String,
password: String
*/