palbase 0.16.1 → 0.17.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ai/index.js +2 -2
- package/dist/backend/engine.js +2 -2
- package/dist/backend/env.js +1 -1
- package/dist/backend/index.js +3 -3
- package/dist/backend/stack.js +1 -1
- package/dist/backend/test.js +2 -2
- package/dist/chunks/{JTVDCPW7.js → 22M4UQVQ.js} +2 -2
- package/dist/chunks/{T2YPRKJ3.js → 2PIDGENK.js} +2 -2
- package/dist/chunks/{KGF5JQ55.js → 3UVLEWTM.js} +1 -1
- package/dist/chunks/{P7GVSVOQ.js → 3Y4K6F6T.js} +2 -2
- package/dist/chunks/{CQFCBON3.js → 6WGPEHCE.js} +1 -1
- package/dist/chunks/{BPDWFY5W.js → 7C7HACEZ.js} +2 -2
- package/dist/chunks/{YAS3UQG4.js → B2IIU37G.js} +1 -1
- package/dist/chunks/CYLNEHKQ.js +2 -0
- package/dist/chunks/{DK4U5V6J.js → DWRLUP7O.js} +2 -2
- package/dist/chunks/{4VWCHDF7.js → E27BZ5SM.js} +2 -2
- package/dist/chunks/{MDWPVJRO.js → FWX3RGVS.js} +2 -2
- package/dist/chunks/{PNWXM3F7.js → K23K6ZFG.js} +2 -2
- package/dist/chunks/{TDJKVGZK.js → KBDCHYSD.js} +1 -1
- package/dist/chunks/{BOD4ISVQ.js → LAHIVWPV.js} +1 -1
- package/dist/chunks/LIKE2KDM.js +22 -0
- package/dist/chunks/{3I7TLVPS.js → LR5ONXTF.js} +2 -2
- package/dist/chunks/{4NM7FLWE.js → NJFKRHS6.js} +2 -2
- package/dist/chunks/{RPMMGWJZ.js → OER3S5NN.js} +2 -2
- package/dist/chunks/{W65UTO2K.js → R7PRW7FG.js} +1 -1
- package/dist/chunks/{W4QRU33N.js → VXT46THA.js} +2 -2
- package/dist/chunks/{RLBTQDNG.js → XT3I7PG3.js} +2 -2
- package/dist/chunks/{2ZGWY65B.js → Y6NZV7LU.js} +1 -1
- package/dist/chunks/{DZBKUOW6.js → ZSUSEU5H.js} +2 -2
- package/dist/cli.js +126 -120
- package/dist/refuse/ai.js +1 -1
- package/dist/refuse/backend.js +1 -1
- package/dist/refuse/server.js +1 -1
- package/dist/server/index.js +2 -2
- package/dist/server/testing.js +2 -2
- package/dist/web/index.js +2 -2
- package/dist/web/message.js +2 -2
- package/dist/web/palbe.js +2 -2
- package/dist/web/paywall.js +2 -2
- package/dist/web/push-sw.js +2 -2
- package/dist/web/ssr.js +2 -2
- package/dist/web/vite.js +2 -2
- package/package.json +2 -2
- package/types/internal/src/modules/ai.d.ts +39 -0
- package/types/internal/src/modules/events.d.ts +4 -3
- package/types/internal/src/modules/index.d.ts +1 -0
- package/types/internal/src/modules/messaging.d.ts +2322 -0
- package/types/internal/src/modules/notify.d.ts +54 -1
- package/types/internal/src/modules/purchases.d.ts +383 -0
- package/types/internal/src/modules/stores.d.ts +685 -3
- package/types/web/src/socket.d.ts +7 -0
- package/dist/chunks/AVVQBB3X.js +0 -22
- package/dist/chunks/LVST7TZJ.js +0 -2
|
@@ -0,0 +1,2322 @@
|
|
|
1
|
+
import { type Reply, type Transport } from '../transport.js';
|
|
2
|
+
/**
|
|
3
|
+
* One time the project's server read or removed people's messages.
|
|
4
|
+
*/
|
|
5
|
+
export type AccessEntry = {
|
|
6
|
+
/**
|
|
7
|
+
* read_messages, read_report, delete_message, delete_conversation or send_message.
|
|
8
|
+
*/
|
|
9
|
+
action: string;
|
|
10
|
+
/**
|
|
11
|
+
* The key that made the call.
|
|
12
|
+
*/
|
|
13
|
+
actor: string;
|
|
14
|
+
/**
|
|
15
|
+
* When.
|
|
16
|
+
*/
|
|
17
|
+
at: string;
|
|
18
|
+
/**
|
|
19
|
+
* The conversation.
|
|
20
|
+
*/
|
|
21
|
+
conversation_id: string | null;
|
|
22
|
+
/**
|
|
23
|
+
* How many messages.
|
|
24
|
+
*/
|
|
25
|
+
count: number;
|
|
26
|
+
/**
|
|
27
|
+
* The entry.
|
|
28
|
+
*/
|
|
29
|
+
id: number;
|
|
30
|
+
/**
|
|
31
|
+
* The request.
|
|
32
|
+
*/
|
|
33
|
+
request_id: string | null;
|
|
34
|
+
/**
|
|
35
|
+
* The person.
|
|
36
|
+
*/
|
|
37
|
+
user_id: string | null;
|
|
38
|
+
};
|
|
39
|
+
export type AccessLogPage = {
|
|
40
|
+
/**
|
|
41
|
+
* The entries, the newest first.
|
|
42
|
+
*/
|
|
43
|
+
data: AccessEntry[];
|
|
44
|
+
/**
|
|
45
|
+
* The next page's cursor; absent on the last page.
|
|
46
|
+
*/
|
|
47
|
+
next_cursor?: string;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* Adds people to a group.
|
|
51
|
+
*/
|
|
52
|
+
export type AddMembersRequest = {
|
|
53
|
+
/**
|
|
54
|
+
* The people (1 to 100).
|
|
55
|
+
*/
|
|
56
|
+
user_ids: string[];
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* Makes a conversation for people.
|
|
60
|
+
*/
|
|
61
|
+
export type AdminConversationRequest = {
|
|
62
|
+
/**
|
|
63
|
+
* A group's description.
|
|
64
|
+
*/
|
|
65
|
+
description?: string;
|
|
66
|
+
/**
|
|
67
|
+
* direct (member_ids: the two) or group.
|
|
68
|
+
*/
|
|
69
|
+
kind: "direct" | "group";
|
|
70
|
+
/**
|
|
71
|
+
* Its people.
|
|
72
|
+
*/
|
|
73
|
+
member_ids: string[];
|
|
74
|
+
/**
|
|
75
|
+
* A group's owner (none: the server keeps it).
|
|
76
|
+
*/
|
|
77
|
+
owner_id?: string;
|
|
78
|
+
/**
|
|
79
|
+
* Where the app reads a group's picture.
|
|
80
|
+
*/
|
|
81
|
+
photo?: string;
|
|
82
|
+
settings?: GroupSettings;
|
|
83
|
+
/**
|
|
84
|
+
* A group's title.
|
|
85
|
+
*/
|
|
86
|
+
title?: string;
|
|
87
|
+
};
|
|
88
|
+
/**
|
|
89
|
+
* A message the project's server says, as the app.
|
|
90
|
+
*/
|
|
91
|
+
export type AdminMessageRequest = {
|
|
92
|
+
/**
|
|
93
|
+
* The server's own id of it: sent again with it, it is the same message.
|
|
94
|
+
*/
|
|
95
|
+
client_message_id: string;
|
|
96
|
+
/**
|
|
97
|
+
* Whom its words name.
|
|
98
|
+
*/
|
|
99
|
+
mentions?: Mention[];
|
|
100
|
+
/**
|
|
101
|
+
* What it says.
|
|
102
|
+
*/
|
|
103
|
+
text: string;
|
|
104
|
+
};
|
|
105
|
+
/**
|
|
106
|
+
* The project's server's word on a person's name and picture.
|
|
107
|
+
*/
|
|
108
|
+
export type AdminProfileRequest = {
|
|
109
|
+
/**
|
|
110
|
+
* Where the app reads the picture.
|
|
111
|
+
*/
|
|
112
|
+
image?: string | null;
|
|
113
|
+
/**
|
|
114
|
+
* A name (1 to 100 characters).
|
|
115
|
+
*/
|
|
116
|
+
name?: string | null;
|
|
117
|
+
};
|
|
118
|
+
/**
|
|
119
|
+
* A file a message carries.
|
|
120
|
+
*/
|
|
121
|
+
export type Attachment = {
|
|
122
|
+
/**
|
|
123
|
+
* Its type, as the app gave it.
|
|
124
|
+
*/
|
|
125
|
+
content_type: string;
|
|
126
|
+
/**
|
|
127
|
+
* A voice message's or video's length.
|
|
128
|
+
*/
|
|
129
|
+
duration_ms: number | null;
|
|
130
|
+
/**
|
|
131
|
+
* The key that opens the file (the app encrypted it); null on a message seen a limited number of times — POST …/view gives it.
|
|
132
|
+
*/
|
|
133
|
+
file_key: string | null;
|
|
134
|
+
/**
|
|
135
|
+
* A picture's or video's height.
|
|
136
|
+
*/
|
|
137
|
+
height: number | null;
|
|
138
|
+
/**
|
|
139
|
+
* The file (its upload's id).
|
|
140
|
+
*/
|
|
141
|
+
id: string;
|
|
142
|
+
/**
|
|
143
|
+
* Its name, as the app gave it.
|
|
144
|
+
*/
|
|
145
|
+
name: string | null;
|
|
146
|
+
/**
|
|
147
|
+
* Its size in bytes (encrypted).
|
|
148
|
+
*/
|
|
149
|
+
size: number;
|
|
150
|
+
/**
|
|
151
|
+
* A small preview, as the app made it (encrypted with the file's key); null on a message seen once.
|
|
152
|
+
*/
|
|
153
|
+
thumbnail: string | null;
|
|
154
|
+
/**
|
|
155
|
+
* A voice message's waveform, as the app made it.
|
|
156
|
+
*/
|
|
157
|
+
waveform?: number[];
|
|
158
|
+
/**
|
|
159
|
+
* A picture's or video's width.
|
|
160
|
+
*/
|
|
161
|
+
width: number | null;
|
|
162
|
+
};
|
|
163
|
+
/**
|
|
164
|
+
* A file a message carries.
|
|
165
|
+
*/
|
|
166
|
+
export type AttachmentRequest = {
|
|
167
|
+
/**
|
|
168
|
+
* Its type.
|
|
169
|
+
*/
|
|
170
|
+
content_type: string;
|
|
171
|
+
/**
|
|
172
|
+
* A voice message's or video's length.
|
|
173
|
+
*/
|
|
174
|
+
duration_ms?: number;
|
|
175
|
+
/**
|
|
176
|
+
* The key that opens it (the app encrypted it with it).
|
|
177
|
+
*/
|
|
178
|
+
file_key: string;
|
|
179
|
+
/**
|
|
180
|
+
* A picture's or video's height.
|
|
181
|
+
*/
|
|
182
|
+
height?: number;
|
|
183
|
+
/**
|
|
184
|
+
* Its name.
|
|
185
|
+
*/
|
|
186
|
+
name?: string;
|
|
187
|
+
/**
|
|
188
|
+
* A small preview the app made, encrypted with the file's key (at most 24 KiB).
|
|
189
|
+
*/
|
|
190
|
+
thumbnail?: string;
|
|
191
|
+
/**
|
|
192
|
+
* An upload of the conversation's (POST …/uploads), uploaded.
|
|
193
|
+
*/
|
|
194
|
+
upload_id: string;
|
|
195
|
+
/**
|
|
196
|
+
* A voice message's waveform.
|
|
197
|
+
*/
|
|
198
|
+
waveform?: number[];
|
|
199
|
+
/**
|
|
200
|
+
* A picture's or video's width.
|
|
201
|
+
*/
|
|
202
|
+
width?: number;
|
|
203
|
+
};
|
|
204
|
+
/**
|
|
205
|
+
* A person the reader blocks.
|
|
206
|
+
*/
|
|
207
|
+
export type Block = {
|
|
208
|
+
/**
|
|
209
|
+
* Since when.
|
|
210
|
+
*/
|
|
211
|
+
created_at: string;
|
|
212
|
+
/**
|
|
213
|
+
* The person blocked.
|
|
214
|
+
*/
|
|
215
|
+
user_id: string;
|
|
216
|
+
};
|
|
217
|
+
export type BlockPage = {
|
|
218
|
+
/**
|
|
219
|
+
* The people blocked.
|
|
220
|
+
*/
|
|
221
|
+
data: Block[];
|
|
222
|
+
/**
|
|
223
|
+
* The next page's cursor; absent on the last page.
|
|
224
|
+
*/
|
|
225
|
+
next_cursor?: string;
|
|
226
|
+
};
|
|
227
|
+
/**
|
|
228
|
+
* A conversation as a member reads it.
|
|
229
|
+
*/
|
|
230
|
+
export type Conversation = {
|
|
231
|
+
/**
|
|
232
|
+
* When it was made.
|
|
233
|
+
*/
|
|
234
|
+
created_at: string;
|
|
235
|
+
/**
|
|
236
|
+
* Who made it; null: the project's server.
|
|
237
|
+
*/
|
|
238
|
+
created_by: string | null;
|
|
239
|
+
/**
|
|
240
|
+
* Deleted for everyone.
|
|
241
|
+
*/
|
|
242
|
+
deleted: boolean;
|
|
243
|
+
/**
|
|
244
|
+
* A group's description.
|
|
245
|
+
*/
|
|
246
|
+
description: string | null;
|
|
247
|
+
/**
|
|
248
|
+
* How what it says is kept: server — sealed with its own key, which the platform holds (not end-to-end).
|
|
249
|
+
*/
|
|
250
|
+
encryption: "server";
|
|
251
|
+
/**
|
|
252
|
+
* More of its messages changed than a sync carries: what the reader keeps of it is read again, a page at a time.
|
|
253
|
+
*/
|
|
254
|
+
gap?: boolean;
|
|
255
|
+
/**
|
|
256
|
+
* The conversation.
|
|
257
|
+
*/
|
|
258
|
+
id: string;
|
|
259
|
+
/**
|
|
260
|
+
* direct (two people) or group.
|
|
261
|
+
*/
|
|
262
|
+
kind: "direct" | "group";
|
|
263
|
+
last_message?: Message;
|
|
264
|
+
/**
|
|
265
|
+
* When its timeline last moved.
|
|
266
|
+
*/
|
|
267
|
+
last_message_at: string | null;
|
|
268
|
+
/**
|
|
269
|
+
* Its last message's place.
|
|
270
|
+
*/
|
|
271
|
+
last_seq: number;
|
|
272
|
+
/**
|
|
273
|
+
* The reader's own place in it.
|
|
274
|
+
*/
|
|
275
|
+
me: MemberState | null;
|
|
276
|
+
/**
|
|
277
|
+
* How many people are in it.
|
|
278
|
+
*/
|
|
279
|
+
member_count: number;
|
|
280
|
+
/**
|
|
281
|
+
* Its people, when it is small (32 or fewer).
|
|
282
|
+
*/
|
|
283
|
+
members?: Member[];
|
|
284
|
+
/**
|
|
285
|
+
* A direct conversation's other person.
|
|
286
|
+
*/
|
|
287
|
+
peer_id: string | null;
|
|
288
|
+
/**
|
|
289
|
+
* Where the app reads a group's picture.
|
|
290
|
+
*/
|
|
291
|
+
photo: string | null;
|
|
292
|
+
settings: ConversationSettings;
|
|
293
|
+
/**
|
|
294
|
+
* A group's title.
|
|
295
|
+
*/
|
|
296
|
+
title: string | null;
|
|
297
|
+
/**
|
|
298
|
+
* How many times it changed.
|
|
299
|
+
*/
|
|
300
|
+
version: number;
|
|
301
|
+
};
|
|
302
|
+
/**
|
|
303
|
+
* A conversation made, and whom it did not take.
|
|
304
|
+
*/
|
|
305
|
+
export type ConversationCreated = {
|
|
306
|
+
conversation: Conversation;
|
|
307
|
+
/**
|
|
308
|
+
* Whom it did not take.
|
|
309
|
+
*/
|
|
310
|
+
not_added: NotAdded[];
|
|
311
|
+
};
|
|
312
|
+
/**
|
|
313
|
+
* messaging.conversation.created
|
|
314
|
+
*/
|
|
315
|
+
export type ConversationCreatedEvent = {
|
|
316
|
+
/**
|
|
317
|
+
* The conversation.
|
|
318
|
+
*/
|
|
319
|
+
conversation_id: string;
|
|
320
|
+
/**
|
|
321
|
+
* Who made it; null: the project's server.
|
|
322
|
+
*/
|
|
323
|
+
created_by: string | null;
|
|
324
|
+
/**
|
|
325
|
+
* direct or group.
|
|
326
|
+
*/
|
|
327
|
+
kind: string;
|
|
328
|
+
/**
|
|
329
|
+
* Its people.
|
|
330
|
+
*/
|
|
331
|
+
member_ids: string[];
|
|
332
|
+
};
|
|
333
|
+
/**
|
|
334
|
+
* messaging.conversation.deleted
|
|
335
|
+
*/
|
|
336
|
+
export type ConversationDeletedEvent = {
|
|
337
|
+
/**
|
|
338
|
+
* The conversation.
|
|
339
|
+
*/
|
|
340
|
+
conversation_id: string;
|
|
341
|
+
/**
|
|
342
|
+
* Who deleted it; null: the project's server.
|
|
343
|
+
*/
|
|
344
|
+
deleted_by: string | null;
|
|
345
|
+
};
|
|
346
|
+
export type ConversationPage = {
|
|
347
|
+
/**
|
|
348
|
+
* The conversations.
|
|
349
|
+
*/
|
|
350
|
+
data: Conversation[];
|
|
351
|
+
/**
|
|
352
|
+
* The next page's cursor; absent on the last page.
|
|
353
|
+
*/
|
|
354
|
+
next_cursor?: string;
|
|
355
|
+
};
|
|
356
|
+
/**
|
|
357
|
+
* How a conversation runs.
|
|
358
|
+
*/
|
|
359
|
+
export type ConversationSettings = {
|
|
360
|
+
/**
|
|
361
|
+
* Who adds people to it: all or admins.
|
|
362
|
+
*/
|
|
363
|
+
add_policy: "all" | "admins";
|
|
364
|
+
/**
|
|
365
|
+
* Who changes its title, description, picture and timer: all or admins.
|
|
366
|
+
*/
|
|
367
|
+
edit_policy: "all" | "admins";
|
|
368
|
+
/**
|
|
369
|
+
* Whether someone added reads what was said before them.
|
|
370
|
+
*/
|
|
371
|
+
history_for_new_members: boolean;
|
|
372
|
+
/**
|
|
373
|
+
* Who writes in the group: all or admins.
|
|
374
|
+
*/
|
|
375
|
+
send_policy: "all" | "admins";
|
|
376
|
+
/**
|
|
377
|
+
* How long a new message lives (seconds); null: for good.
|
|
378
|
+
*/
|
|
379
|
+
timer_seconds: number | null;
|
|
380
|
+
/**
|
|
381
|
+
* Vanish mode (a direct conversation's): a message read goes once its reader leaves the conversation.
|
|
382
|
+
*/
|
|
383
|
+
vanish: boolean;
|
|
384
|
+
};
|
|
385
|
+
/**
|
|
386
|
+
* Opens the direct conversation with a person.
|
|
387
|
+
*/
|
|
388
|
+
export type DirectRequest = {
|
|
389
|
+
/**
|
|
390
|
+
* The other person.
|
|
391
|
+
*/
|
|
392
|
+
user_id: string;
|
|
393
|
+
};
|
|
394
|
+
/**
|
|
395
|
+
* A message's new words.
|
|
396
|
+
*/
|
|
397
|
+
export type EditRequest = {
|
|
398
|
+
/**
|
|
399
|
+
* Whom its words name.
|
|
400
|
+
*/
|
|
401
|
+
mentions?: Mention[];
|
|
402
|
+
/**
|
|
403
|
+
* What the message says now.
|
|
404
|
+
*/
|
|
405
|
+
text: string;
|
|
406
|
+
};
|
|
407
|
+
/**
|
|
408
|
+
* The error envelope.
|
|
409
|
+
*/
|
|
410
|
+
export type ErrorResponse = {
|
|
411
|
+
/**
|
|
412
|
+
* Machine-readable error code (snake_case)
|
|
413
|
+
*/
|
|
414
|
+
error: string;
|
|
415
|
+
/**
|
|
416
|
+
* Human-readable explanation
|
|
417
|
+
*/
|
|
418
|
+
error_description: string;
|
|
419
|
+
/**
|
|
420
|
+
* Correlation ID for log/audit lookup
|
|
421
|
+
*/
|
|
422
|
+
request_id: string;
|
|
423
|
+
/**
|
|
424
|
+
* Seconds to wait before retrying; present on a refusal that ends with time.
|
|
425
|
+
*/
|
|
426
|
+
retry_after?: number;
|
|
427
|
+
/**
|
|
428
|
+
* HTTP status code (mirrors the response status)
|
|
429
|
+
*/
|
|
430
|
+
status: number;
|
|
431
|
+
};
|
|
432
|
+
/**
|
|
433
|
+
* Where a file is read.
|
|
434
|
+
*/
|
|
435
|
+
export type FileURL = {
|
|
436
|
+
/**
|
|
437
|
+
* Until when.
|
|
438
|
+
*/
|
|
439
|
+
expires_at: string;
|
|
440
|
+
/**
|
|
441
|
+
* Where the file (encrypted) is read.
|
|
442
|
+
*/
|
|
443
|
+
url: string;
|
|
444
|
+
};
|
|
445
|
+
/**
|
|
446
|
+
* Makes a group.
|
|
447
|
+
*/
|
|
448
|
+
export type GroupRequest = {
|
|
449
|
+
/**
|
|
450
|
+
* Its description (at most 1,000 characters).
|
|
451
|
+
*/
|
|
452
|
+
description?: string;
|
|
453
|
+
/**
|
|
454
|
+
* Its people besides the reader (at most 999).
|
|
455
|
+
*/
|
|
456
|
+
member_ids?: string[];
|
|
457
|
+
/**
|
|
458
|
+
* Where the app reads its picture.
|
|
459
|
+
*/
|
|
460
|
+
photo?: string;
|
|
461
|
+
settings?: GroupSettings;
|
|
462
|
+
/**
|
|
463
|
+
* Its title.
|
|
464
|
+
*/
|
|
465
|
+
title: string;
|
|
466
|
+
};
|
|
467
|
+
/**
|
|
468
|
+
* How a group runs, as it is made.
|
|
469
|
+
*/
|
|
470
|
+
export type GroupSettings = {
|
|
471
|
+
/**
|
|
472
|
+
* Who adds people: all or admins (default).
|
|
473
|
+
*/
|
|
474
|
+
add_policy?: "all" | "admins";
|
|
475
|
+
/**
|
|
476
|
+
* Who changes its details and timer: all or admins.
|
|
477
|
+
*/
|
|
478
|
+
edit_policy?: "all" | "admins";
|
|
479
|
+
/**
|
|
480
|
+
* Whether someone added reads what was said before them (default true).
|
|
481
|
+
*/
|
|
482
|
+
history_for_new_members?: boolean;
|
|
483
|
+
/**
|
|
484
|
+
* Who writes: all or admins.
|
|
485
|
+
*/
|
|
486
|
+
send_policy?: "all" | "admins";
|
|
487
|
+
/**
|
|
488
|
+
* How long a message lives (seconds).
|
|
489
|
+
*/
|
|
490
|
+
timer_seconds?: number;
|
|
491
|
+
};
|
|
492
|
+
/**
|
|
493
|
+
* A message the reader removed for themselves.
|
|
494
|
+
*/
|
|
495
|
+
export type HiddenMessage = {
|
|
496
|
+
/**
|
|
497
|
+
* Its conversation.
|
|
498
|
+
*/
|
|
499
|
+
conversation_id: string;
|
|
500
|
+
/**
|
|
501
|
+
* The message.
|
|
502
|
+
*/
|
|
503
|
+
message_id: string;
|
|
504
|
+
};
|
|
505
|
+
/**
|
|
506
|
+
* The hook asked whom one may reach.
|
|
507
|
+
*/
|
|
508
|
+
export type HookSettings = {
|
|
509
|
+
/**
|
|
510
|
+
* When it does not answer: allow everyone, or deny (the client retries).
|
|
511
|
+
*/
|
|
512
|
+
on_error: "allow" | "deny";
|
|
513
|
+
/**
|
|
514
|
+
* How long it is waited for.
|
|
515
|
+
*/
|
|
516
|
+
timeout_ms: number;
|
|
517
|
+
/**
|
|
518
|
+
* The project's endpoint.
|
|
519
|
+
*/
|
|
520
|
+
url: string;
|
|
521
|
+
};
|
|
522
|
+
/**
|
|
523
|
+
* Sets the hook.
|
|
524
|
+
*/
|
|
525
|
+
export type HookSettingsRequest = {
|
|
526
|
+
/**
|
|
527
|
+
* allow or deny (default).
|
|
528
|
+
*/
|
|
529
|
+
on_error?: "allow" | "deny";
|
|
530
|
+
/**
|
|
531
|
+
* 100 to 5,000 (default 2,000).
|
|
532
|
+
*/
|
|
533
|
+
timeout_ms?: number;
|
|
534
|
+
/**
|
|
535
|
+
* An https URL on the public internet.
|
|
536
|
+
*/
|
|
537
|
+
url: string;
|
|
538
|
+
};
|
|
539
|
+
/**
|
|
540
|
+
* A person in a conversation, as the others see them.
|
|
541
|
+
*/
|
|
542
|
+
export type Member = {
|
|
543
|
+
/**
|
|
544
|
+
* The conversation.
|
|
545
|
+
*/
|
|
546
|
+
conversation_id: string;
|
|
547
|
+
/**
|
|
548
|
+
* How far their apps took the conversation (a delivery receipt; a read moves read_seq alone).
|
|
549
|
+
*/
|
|
550
|
+
delivered_seq: number;
|
|
551
|
+
/**
|
|
552
|
+
* When they joined.
|
|
553
|
+
*/
|
|
554
|
+
joined_at: string;
|
|
555
|
+
/**
|
|
556
|
+
* When they left or were removed.
|
|
557
|
+
*/
|
|
558
|
+
left_at: string | null;
|
|
559
|
+
/**
|
|
560
|
+
* How far they read; null in a direct conversation where either person turned their read receipts off (the reader's own always says it).
|
|
561
|
+
*/
|
|
562
|
+
read_seq: number | null;
|
|
563
|
+
/**
|
|
564
|
+
* owner, admin or member.
|
|
565
|
+
*/
|
|
566
|
+
role: "owner" | "admin" | "member";
|
|
567
|
+
/**
|
|
568
|
+
* active, left or removed.
|
|
569
|
+
*/
|
|
570
|
+
state: "active" | "left" | "removed";
|
|
571
|
+
/**
|
|
572
|
+
* The person.
|
|
573
|
+
*/
|
|
574
|
+
user_id: string;
|
|
575
|
+
/**
|
|
576
|
+
* How many times it changed.
|
|
577
|
+
*/
|
|
578
|
+
version: number;
|
|
579
|
+
};
|
|
580
|
+
export type MemberPage = {
|
|
581
|
+
/**
|
|
582
|
+
* The people.
|
|
583
|
+
*/
|
|
584
|
+
data: Member[];
|
|
585
|
+
/**
|
|
586
|
+
* The next page's cursor; absent on the last page.
|
|
587
|
+
*/
|
|
588
|
+
next_cursor?: string;
|
|
589
|
+
};
|
|
590
|
+
/**
|
|
591
|
+
* The reader's own place in a conversation.
|
|
592
|
+
*/
|
|
593
|
+
export type MemberState = {
|
|
594
|
+
/**
|
|
595
|
+
* What they cleared for themselves: up to this one.
|
|
596
|
+
*/
|
|
597
|
+
cleared_seq: number;
|
|
598
|
+
/**
|
|
599
|
+
* How far their apps took the conversation.
|
|
600
|
+
*/
|
|
601
|
+
delivered_seq: number;
|
|
602
|
+
/**
|
|
603
|
+
* They see the messages after this one.
|
|
604
|
+
*/
|
|
605
|
+
joined_seq: number;
|
|
606
|
+
/**
|
|
607
|
+
* They see the messages up to this one, once they left or were removed.
|
|
608
|
+
*/
|
|
609
|
+
left_seq: number | null;
|
|
610
|
+
/**
|
|
611
|
+
* Muted until then; null: not muted.
|
|
612
|
+
*/
|
|
613
|
+
muted_until: string | null;
|
|
614
|
+
/**
|
|
615
|
+
* What notifies them: every message, those naming them, none.
|
|
616
|
+
*/
|
|
617
|
+
notify_level: "all" | "mentions" | "none";
|
|
618
|
+
/**
|
|
619
|
+
* How far they read.
|
|
620
|
+
*/
|
|
621
|
+
read_seq: number;
|
|
622
|
+
/**
|
|
623
|
+
* owner, admin or member (a direct conversation's two are members).
|
|
624
|
+
*/
|
|
625
|
+
role: "owner" | "admin" | "member";
|
|
626
|
+
/**
|
|
627
|
+
* active; left; removed (they keep what was said while they were in it).
|
|
628
|
+
*/
|
|
629
|
+
state: "active" | "left" | "removed";
|
|
630
|
+
/**
|
|
631
|
+
* Messages of the conversation's own timeline they have not read (not theirs, not the platform's), counted to 1,000.
|
|
632
|
+
*/
|
|
633
|
+
unread_count: number;
|
|
634
|
+
/**
|
|
635
|
+
* How many times it changed.
|
|
636
|
+
*/
|
|
637
|
+
version: number;
|
|
638
|
+
};
|
|
639
|
+
/**
|
|
640
|
+
* Whom a group took, and whom not.
|
|
641
|
+
*/
|
|
642
|
+
export type MembersAdded = {
|
|
643
|
+
/**
|
|
644
|
+
* Whom the group took.
|
|
645
|
+
*/
|
|
646
|
+
added: string[];
|
|
647
|
+
/**
|
|
648
|
+
* Whom it did not take.
|
|
649
|
+
*/
|
|
650
|
+
not_added: NotAdded[];
|
|
651
|
+
};
|
|
652
|
+
/**
|
|
653
|
+
* The members a change changed.
|
|
654
|
+
*/
|
|
655
|
+
export type MembersChanged = {
|
|
656
|
+
/**
|
|
657
|
+
* The members whose role changed.
|
|
658
|
+
*/
|
|
659
|
+
members: Member[];
|
|
660
|
+
};
|
|
661
|
+
/**
|
|
662
|
+
* A person a message's words name.
|
|
663
|
+
*/
|
|
664
|
+
export type Mention = {
|
|
665
|
+
/**
|
|
666
|
+
* How long, in UTF-16 code units.
|
|
667
|
+
*/
|
|
668
|
+
length: number;
|
|
669
|
+
/**
|
|
670
|
+
* Where in the text, in UTF-16 code units.
|
|
671
|
+
*/
|
|
672
|
+
offset: number;
|
|
673
|
+
/**
|
|
674
|
+
* The person named.
|
|
675
|
+
*/
|
|
676
|
+
user_id: string;
|
|
677
|
+
};
|
|
678
|
+
/**
|
|
679
|
+
* A message as a member reads it.
|
|
680
|
+
*/
|
|
681
|
+
export type Message = {
|
|
682
|
+
/**
|
|
683
|
+
* A thread answer the conversation's timeline shows too.
|
|
684
|
+
*/
|
|
685
|
+
also_in_conversation: boolean;
|
|
686
|
+
/**
|
|
687
|
+
* Its files.
|
|
688
|
+
*/
|
|
689
|
+
attachments: Attachment[];
|
|
690
|
+
/**
|
|
691
|
+
* The writer's app's own id of it.
|
|
692
|
+
*/
|
|
693
|
+
client_message_id: string | null;
|
|
694
|
+
/**
|
|
695
|
+
* Its conversation.
|
|
696
|
+
*/
|
|
697
|
+
conversation_id: string;
|
|
698
|
+
/**
|
|
699
|
+
* When it was sent.
|
|
700
|
+
*/
|
|
701
|
+
created_at: string;
|
|
702
|
+
/**
|
|
703
|
+
* Removed: what it said is gone.
|
|
704
|
+
*/
|
|
705
|
+
deleted: boolean;
|
|
706
|
+
/**
|
|
707
|
+
* When its writer last changed it.
|
|
708
|
+
*/
|
|
709
|
+
edited_at: string | null;
|
|
710
|
+
/**
|
|
711
|
+
* It goes this many seconds after everyone it was for read it.
|
|
712
|
+
*/
|
|
713
|
+
expires_after_read: number | null;
|
|
714
|
+
/**
|
|
715
|
+
* When it goes.
|
|
716
|
+
*/
|
|
717
|
+
expires_at: string | null;
|
|
718
|
+
/**
|
|
719
|
+
* The message.
|
|
720
|
+
*/
|
|
721
|
+
id: string;
|
|
722
|
+
/**
|
|
723
|
+
* text, media (files) or system.
|
|
724
|
+
*/
|
|
725
|
+
kind: "text" | "media" | "system";
|
|
726
|
+
/**
|
|
727
|
+
* When its thread was last answered.
|
|
728
|
+
*/
|
|
729
|
+
last_reply_at: string | null;
|
|
730
|
+
/**
|
|
731
|
+
* Whom its words name.
|
|
732
|
+
*/
|
|
733
|
+
mentions: Mention[];
|
|
734
|
+
/**
|
|
735
|
+
* Its reactions, each emoji's.
|
|
736
|
+
*/
|
|
737
|
+
reactions: Reaction[];
|
|
738
|
+
/**
|
|
739
|
+
* Why it was removed: sender, admin, server, expired, viewed, vanished, retention, user_deleted.
|
|
740
|
+
*/
|
|
741
|
+
removed_reason: string | null;
|
|
742
|
+
/**
|
|
743
|
+
* How many answers its thread holds.
|
|
744
|
+
*/
|
|
745
|
+
reply_count: number;
|
|
746
|
+
/**
|
|
747
|
+
* The message it answers inline.
|
|
748
|
+
*/
|
|
749
|
+
reply_to_id: string | null;
|
|
750
|
+
/**
|
|
751
|
+
* Its writer; null: the platform's or the project's server's.
|
|
752
|
+
*/
|
|
753
|
+
sender_id: string | null;
|
|
754
|
+
/**
|
|
755
|
+
* Its place in its conversation.
|
|
756
|
+
*/
|
|
757
|
+
seq: number;
|
|
758
|
+
/**
|
|
759
|
+
* What a system message tells.
|
|
760
|
+
*/
|
|
761
|
+
system: SystemEvent | null;
|
|
762
|
+
/**
|
|
763
|
+
* What it says.
|
|
764
|
+
*/
|
|
765
|
+
text: string | null;
|
|
766
|
+
/**
|
|
767
|
+
* The message whose thread it answers.
|
|
768
|
+
*/
|
|
769
|
+
thread_id: string | null;
|
|
770
|
+
/**
|
|
771
|
+
* Sent in vanish mode: it goes once read and left.
|
|
772
|
+
*/
|
|
773
|
+
vanish: boolean;
|
|
774
|
+
/**
|
|
775
|
+
* How many times it changed (a reaction, an answer in its thread, an edit).
|
|
776
|
+
*/
|
|
777
|
+
version: number;
|
|
778
|
+
/**
|
|
779
|
+
* When it is seen a limited number of times.
|
|
780
|
+
*/
|
|
781
|
+
view_once: ViewOnce | null;
|
|
782
|
+
};
|
|
783
|
+
export type MessagePage = {
|
|
784
|
+
/**
|
|
785
|
+
* The messages.
|
|
786
|
+
*/
|
|
787
|
+
data: Message[];
|
|
788
|
+
/**
|
|
789
|
+
* The next page's cursor; absent on the last page.
|
|
790
|
+
*/
|
|
791
|
+
next_cursor?: string;
|
|
792
|
+
};
|
|
793
|
+
/**
|
|
794
|
+
* The reader's own profile and settings.
|
|
795
|
+
*/
|
|
796
|
+
export type MyProfile = {
|
|
797
|
+
/**
|
|
798
|
+
* How long the messages of conversations they open from now on live; null: for good.
|
|
799
|
+
*/
|
|
800
|
+
default_timer_seconds: number | null;
|
|
801
|
+
/**
|
|
802
|
+
* Where the app reads their picture.
|
|
803
|
+
*/
|
|
804
|
+
image: string | null;
|
|
805
|
+
/**
|
|
806
|
+
* When they were last here.
|
|
807
|
+
*/
|
|
808
|
+
last_seen_at: string | null;
|
|
809
|
+
/**
|
|
810
|
+
* Their name.
|
|
811
|
+
*/
|
|
812
|
+
name: string | null;
|
|
813
|
+
/**
|
|
814
|
+
* Whether their reads show in a direct conversation; off, nor do the other's to them. A group's always show.
|
|
815
|
+
*/
|
|
816
|
+
read_receipts: boolean;
|
|
817
|
+
/**
|
|
818
|
+
* Whether others see when they were last here (they see others' only then).
|
|
819
|
+
*/
|
|
820
|
+
show_last_seen: boolean;
|
|
821
|
+
/**
|
|
822
|
+
* The reader.
|
|
823
|
+
*/
|
|
824
|
+
user_id: string;
|
|
825
|
+
};
|
|
826
|
+
/**
|
|
827
|
+
* A person a group did not take, and why.
|
|
828
|
+
*/
|
|
829
|
+
export type NotAdded = {
|
|
830
|
+
/**
|
|
831
|
+
* not_allowed (the project's hook did not let them be reached, or they block whoever added them) or group_full.
|
|
832
|
+
*/
|
|
833
|
+
reason: "not_allowed" | "group_full";
|
|
834
|
+
/**
|
|
835
|
+
* The person.
|
|
836
|
+
*/
|
|
837
|
+
user_id: string;
|
|
838
|
+
};
|
|
839
|
+
/**
|
|
840
|
+
* How a conversation notifies the reader; what it names changes.
|
|
841
|
+
*/
|
|
842
|
+
export type NotificationsRequest = {
|
|
843
|
+
/**
|
|
844
|
+
* Muted until then; null: unmuted.
|
|
845
|
+
*/
|
|
846
|
+
muted_until?: string | null;
|
|
847
|
+
/**
|
|
848
|
+
* What notifies the reader.
|
|
849
|
+
*/
|
|
850
|
+
notify_level?: "all" | "mentions" | "none";
|
|
851
|
+
};
|
|
852
|
+
/**
|
|
853
|
+
* A person as the conversations show them.
|
|
854
|
+
*/
|
|
855
|
+
export type Profile = {
|
|
856
|
+
/**
|
|
857
|
+
* Where the app reads their picture.
|
|
858
|
+
*/
|
|
859
|
+
image: string | null;
|
|
860
|
+
/**
|
|
861
|
+
* When they were last here (the same).
|
|
862
|
+
*/
|
|
863
|
+
last_seen_at: string | null;
|
|
864
|
+
/**
|
|
865
|
+
* Their name.
|
|
866
|
+
*/
|
|
867
|
+
name: string | null;
|
|
868
|
+
/**
|
|
869
|
+
* Here now (when they let others see it, and the reader does).
|
|
870
|
+
*/
|
|
871
|
+
online: boolean;
|
|
872
|
+
/**
|
|
873
|
+
* The person.
|
|
874
|
+
*/
|
|
875
|
+
user_id: string;
|
|
876
|
+
};
|
|
877
|
+
/**
|
|
878
|
+
* People's profiles.
|
|
879
|
+
*/
|
|
880
|
+
export type ProfileList = {
|
|
881
|
+
/**
|
|
882
|
+
* The profiles there are.
|
|
883
|
+
*/
|
|
884
|
+
data: Profile[];
|
|
885
|
+
};
|
|
886
|
+
/**
|
|
887
|
+
* How a reaction is added.
|
|
888
|
+
*/
|
|
889
|
+
export type ReactRequest = {
|
|
890
|
+
/**
|
|
891
|
+
* The reader's other reactions to the message go: one a person (WhatsApp's).
|
|
892
|
+
*/
|
|
893
|
+
replace?: boolean;
|
|
894
|
+
};
|
|
895
|
+
/**
|
|
896
|
+
* One emoji's reactions to a message (a person gives several, one of each emoji).
|
|
897
|
+
*/
|
|
898
|
+
export type Reaction = {
|
|
899
|
+
/**
|
|
900
|
+
* How many gave it.
|
|
901
|
+
*/
|
|
902
|
+
count: number;
|
|
903
|
+
/**
|
|
904
|
+
* The reaction.
|
|
905
|
+
*/
|
|
906
|
+
emoji: string;
|
|
907
|
+
/**
|
|
908
|
+
* Whether the reader gave it.
|
|
909
|
+
*/
|
|
910
|
+
me: boolean;
|
|
911
|
+
/**
|
|
912
|
+
* Who gave it (the first 32).
|
|
913
|
+
*/
|
|
914
|
+
user_ids: string[];
|
|
915
|
+
};
|
|
916
|
+
/**
|
|
917
|
+
* Who of a conversation read a message, and whose apps took it.
|
|
918
|
+
*/
|
|
919
|
+
export type Readers = {
|
|
920
|
+
/**
|
|
921
|
+
* Whose apps took it.
|
|
922
|
+
*/
|
|
923
|
+
delivered: string[];
|
|
924
|
+
/**
|
|
925
|
+
* Who read it.
|
|
926
|
+
*/
|
|
927
|
+
read: string[];
|
|
928
|
+
};
|
|
929
|
+
/**
|
|
930
|
+
* How far the reader read a conversation or thread, and how far their app took it.
|
|
931
|
+
*/
|
|
932
|
+
export type Receipt = {
|
|
933
|
+
/**
|
|
934
|
+
* The conversation.
|
|
935
|
+
*/
|
|
936
|
+
conversation_id: string;
|
|
937
|
+
/**
|
|
938
|
+
* How far their app took it.
|
|
939
|
+
*/
|
|
940
|
+
delivered_seq?: number;
|
|
941
|
+
/**
|
|
942
|
+
* How far the reader read.
|
|
943
|
+
*/
|
|
944
|
+
read_seq?: number;
|
|
945
|
+
/**
|
|
946
|
+
* A thread of it the reader follows.
|
|
947
|
+
*/
|
|
948
|
+
thread_id?: string;
|
|
949
|
+
};
|
|
950
|
+
/**
|
|
951
|
+
* The reader's receipts.
|
|
952
|
+
*/
|
|
953
|
+
export type ReceiptsRequest = {
|
|
954
|
+
/**
|
|
955
|
+
* 1 to 100 receipts.
|
|
956
|
+
*/
|
|
957
|
+
receipts: Receipt[];
|
|
958
|
+
};
|
|
959
|
+
/**
|
|
960
|
+
* A conversation the reader no longer has.
|
|
961
|
+
*/
|
|
962
|
+
export type RemovedConversation = {
|
|
963
|
+
/**
|
|
964
|
+
* The conversation.
|
|
965
|
+
*/
|
|
966
|
+
conversation_id: string;
|
|
967
|
+
/**
|
|
968
|
+
* Why: deleted.
|
|
969
|
+
*/
|
|
970
|
+
reason: string;
|
|
971
|
+
};
|
|
972
|
+
/**
|
|
973
|
+
* A report as the project's server reads it.
|
|
974
|
+
*/
|
|
975
|
+
export type Report = {
|
|
976
|
+
/**
|
|
977
|
+
* The conversation.
|
|
978
|
+
*/
|
|
979
|
+
conversation_id: string;
|
|
980
|
+
/**
|
|
981
|
+
* When it was made.
|
|
982
|
+
*/
|
|
983
|
+
created_at: string;
|
|
984
|
+
/**
|
|
985
|
+
* The report.
|
|
986
|
+
*/
|
|
987
|
+
id: string;
|
|
988
|
+
/**
|
|
989
|
+
* The messages it names.
|
|
990
|
+
*/
|
|
991
|
+
message_ids: string[];
|
|
992
|
+
/**
|
|
993
|
+
* What the messages said (read one report to get them).
|
|
994
|
+
*/
|
|
995
|
+
messages?: ReportedMessage[];
|
|
996
|
+
/**
|
|
997
|
+
* The reporter's words (read one report to get them).
|
|
998
|
+
*/
|
|
999
|
+
note?: string;
|
|
1000
|
+
/**
|
|
1001
|
+
* Why.
|
|
1002
|
+
*/
|
|
1003
|
+
reason: string;
|
|
1004
|
+
/**
|
|
1005
|
+
* Whom.
|
|
1006
|
+
*/
|
|
1007
|
+
reported_user_id: string | null;
|
|
1008
|
+
/**
|
|
1009
|
+
* Who reported (null once they were deleted).
|
|
1010
|
+
*/
|
|
1011
|
+
reporter_id: string | null;
|
|
1012
|
+
/**
|
|
1013
|
+
* What came of it.
|
|
1014
|
+
*/
|
|
1015
|
+
resolution: string | null;
|
|
1016
|
+
/**
|
|
1017
|
+
* When it was resolved.
|
|
1018
|
+
*/
|
|
1019
|
+
resolved_at: string | null;
|
|
1020
|
+
/**
|
|
1021
|
+
* open or resolved.
|
|
1022
|
+
*/
|
|
1023
|
+
status: "open" | "resolved";
|
|
1024
|
+
};
|
|
1025
|
+
/**
|
|
1026
|
+
* A report made.
|
|
1027
|
+
*/
|
|
1028
|
+
export type ReportCreated = {
|
|
1029
|
+
/**
|
|
1030
|
+
* When.
|
|
1031
|
+
*/
|
|
1032
|
+
created_at: string;
|
|
1033
|
+
/**
|
|
1034
|
+
* The report.
|
|
1035
|
+
*/
|
|
1036
|
+
id: string;
|
|
1037
|
+
/**
|
|
1038
|
+
* open.
|
|
1039
|
+
*/
|
|
1040
|
+
status: string;
|
|
1041
|
+
};
|
|
1042
|
+
/**
|
|
1043
|
+
* messaging.report.created
|
|
1044
|
+
*/
|
|
1045
|
+
export type ReportCreatedEvent = {
|
|
1046
|
+
/**
|
|
1047
|
+
* The conversation.
|
|
1048
|
+
*/
|
|
1049
|
+
conversation_id: string;
|
|
1050
|
+
/**
|
|
1051
|
+
* How many messages it names.
|
|
1052
|
+
*/
|
|
1053
|
+
message_count: number;
|
|
1054
|
+
/**
|
|
1055
|
+
* Why.
|
|
1056
|
+
*/
|
|
1057
|
+
reason: string;
|
|
1058
|
+
/**
|
|
1059
|
+
* The report: read it with the secret key (GET /messaging/admin/reports/{report_id}).
|
|
1060
|
+
*/
|
|
1061
|
+
report_id: string;
|
|
1062
|
+
/**
|
|
1063
|
+
* Whom.
|
|
1064
|
+
*/
|
|
1065
|
+
reported_user_id: string | null;
|
|
1066
|
+
/**
|
|
1067
|
+
* Who reported.
|
|
1068
|
+
*/
|
|
1069
|
+
reporter_id: string;
|
|
1070
|
+
};
|
|
1071
|
+
export type ReportPage = {
|
|
1072
|
+
/**
|
|
1073
|
+
* The reports.
|
|
1074
|
+
*/
|
|
1075
|
+
data: Report[];
|
|
1076
|
+
/**
|
|
1077
|
+
* The next page's cursor; absent on the last page.
|
|
1078
|
+
*/
|
|
1079
|
+
next_cursor?: string;
|
|
1080
|
+
};
|
|
1081
|
+
/**
|
|
1082
|
+
* Reports a conversation, a person in it, or messages of it.
|
|
1083
|
+
*/
|
|
1084
|
+
export type ReportRequest = {
|
|
1085
|
+
/**
|
|
1086
|
+
* The conversation.
|
|
1087
|
+
*/
|
|
1088
|
+
conversation_id: string;
|
|
1089
|
+
/**
|
|
1090
|
+
* Messages the reader sees in it (at most 50).
|
|
1091
|
+
*/
|
|
1092
|
+
message_ids?: string[];
|
|
1093
|
+
/**
|
|
1094
|
+
* The reader's own words (at most 1,000 characters).
|
|
1095
|
+
*/
|
|
1096
|
+
note?: string;
|
|
1097
|
+
/**
|
|
1098
|
+
* Why.
|
|
1099
|
+
*/
|
|
1100
|
+
reason: "spam" | "harassment" | "hate" | "violence" | "sexual" | "self_harm" | "illegal" | "other";
|
|
1101
|
+
/**
|
|
1102
|
+
* The person reported.
|
|
1103
|
+
*/
|
|
1104
|
+
user_id?: string;
|
|
1105
|
+
};
|
|
1106
|
+
/**
|
|
1107
|
+
* A reported message as it was when reported.
|
|
1108
|
+
*/
|
|
1109
|
+
export type ReportedMessage = {
|
|
1110
|
+
/**
|
|
1111
|
+
* Its files, with their keys.
|
|
1112
|
+
*/
|
|
1113
|
+
attachments: Attachment[];
|
|
1114
|
+
/**
|
|
1115
|
+
* When it was sent.
|
|
1116
|
+
*/
|
|
1117
|
+
created_at: string;
|
|
1118
|
+
/**
|
|
1119
|
+
* The message.
|
|
1120
|
+
*/
|
|
1121
|
+
id: string;
|
|
1122
|
+
/**
|
|
1123
|
+
* text, media or system.
|
|
1124
|
+
*/
|
|
1125
|
+
kind: string;
|
|
1126
|
+
/**
|
|
1127
|
+
* Its writer.
|
|
1128
|
+
*/
|
|
1129
|
+
sender_id: string | null;
|
|
1130
|
+
/**
|
|
1131
|
+
* Its place.
|
|
1132
|
+
*/
|
|
1133
|
+
seq: number;
|
|
1134
|
+
/**
|
|
1135
|
+
* What it said when reported.
|
|
1136
|
+
*/
|
|
1137
|
+
text: string | null;
|
|
1138
|
+
};
|
|
1139
|
+
/**
|
|
1140
|
+
* Resolves a report.
|
|
1141
|
+
*/
|
|
1142
|
+
export type ResolveRequest = {
|
|
1143
|
+
/**
|
|
1144
|
+
* What came of it (1 to 64 characters).
|
|
1145
|
+
*/
|
|
1146
|
+
resolution: string;
|
|
1147
|
+
};
|
|
1148
|
+
/**
|
|
1149
|
+
* A message its writer scheduled; request is what it will say, while it is still to be sent.
|
|
1150
|
+
*/
|
|
1151
|
+
export type ScheduledMessage = {
|
|
1152
|
+
/**
|
|
1153
|
+
* The app's own id of it.
|
|
1154
|
+
*/
|
|
1155
|
+
client_message_id: string;
|
|
1156
|
+
/**
|
|
1157
|
+
* Its conversation.
|
|
1158
|
+
*/
|
|
1159
|
+
conversation_id: string;
|
|
1160
|
+
/**
|
|
1161
|
+
* When it was scheduled.
|
|
1162
|
+
*/
|
|
1163
|
+
created_at: string;
|
|
1164
|
+
/**
|
|
1165
|
+
* Why it was not sent (failed): not_a_member, conversation_deleted, blocked, admins_only…
|
|
1166
|
+
*/
|
|
1167
|
+
failure: string | null;
|
|
1168
|
+
/**
|
|
1169
|
+
* The scheduled message.
|
|
1170
|
+
*/
|
|
1171
|
+
id: string;
|
|
1172
|
+
/**
|
|
1173
|
+
* The message it became (sent).
|
|
1174
|
+
*/
|
|
1175
|
+
message_id: string | null;
|
|
1176
|
+
request?: SendRequest;
|
|
1177
|
+
/**
|
|
1178
|
+
* When it goes.
|
|
1179
|
+
*/
|
|
1180
|
+
send_at: string;
|
|
1181
|
+
/**
|
|
1182
|
+
* scheduled, sent, cancelled or failed.
|
|
1183
|
+
*/
|
|
1184
|
+
state: "scheduled" | "sent" | "cancelled" | "failed";
|
|
1185
|
+
/**
|
|
1186
|
+
* When it last changed.
|
|
1187
|
+
*/
|
|
1188
|
+
updated_at: string;
|
|
1189
|
+
/**
|
|
1190
|
+
* How many times it changed.
|
|
1191
|
+
*/
|
|
1192
|
+
version: number;
|
|
1193
|
+
};
|
|
1194
|
+
export type ScheduledPage = {
|
|
1195
|
+
/**
|
|
1196
|
+
* The scheduled messages.
|
|
1197
|
+
*/
|
|
1198
|
+
data: ScheduledMessage[];
|
|
1199
|
+
/**
|
|
1200
|
+
* The next page's cursor; absent on the last page.
|
|
1201
|
+
*/
|
|
1202
|
+
next_cursor?: string;
|
|
1203
|
+
};
|
|
1204
|
+
/**
|
|
1205
|
+
* A message to send.
|
|
1206
|
+
*/
|
|
1207
|
+
export type SendRequest = {
|
|
1208
|
+
/**
|
|
1209
|
+
* A thread answer the conversation's timeline shows too.
|
|
1210
|
+
*/
|
|
1211
|
+
also_in_conversation?: boolean;
|
|
1212
|
+
/**
|
|
1213
|
+
* Its files (at most 10).
|
|
1214
|
+
*/
|
|
1215
|
+
attachments?: AttachmentRequest[];
|
|
1216
|
+
/**
|
|
1217
|
+
* The app's own id of the message: sent again with it, it is the same message.
|
|
1218
|
+
*/
|
|
1219
|
+
client_message_id: string;
|
|
1220
|
+
/**
|
|
1221
|
+
* When its time starts: send (default) or read — once everyone it is for read it.
|
|
1222
|
+
*/
|
|
1223
|
+
expires_from?: "send" | "read";
|
|
1224
|
+
/**
|
|
1225
|
+
* It goes this many seconds after it is sent (or read: expires_from).
|
|
1226
|
+
*/
|
|
1227
|
+
expires_in?: number;
|
|
1228
|
+
/**
|
|
1229
|
+
* Whom its words name (at most 50).
|
|
1230
|
+
*/
|
|
1231
|
+
mentions?: Mention[];
|
|
1232
|
+
/**
|
|
1233
|
+
* A message it answers inline.
|
|
1234
|
+
*/
|
|
1235
|
+
reply_to_id?: string;
|
|
1236
|
+
/**
|
|
1237
|
+
* Send it then (words only): it is scheduled.
|
|
1238
|
+
*/
|
|
1239
|
+
send_at?: string;
|
|
1240
|
+
/**
|
|
1241
|
+
* What it says (1 to 4,096 characters).
|
|
1242
|
+
*/
|
|
1243
|
+
text?: string;
|
|
1244
|
+
/**
|
|
1245
|
+
* A message whose thread it answers (one level).
|
|
1246
|
+
*/
|
|
1247
|
+
thread_id?: string;
|
|
1248
|
+
view_once?: ViewOnceRequest;
|
|
1249
|
+
};
|
|
1250
|
+
/**
|
|
1251
|
+
* How the project runs its conversations.
|
|
1252
|
+
*/
|
|
1253
|
+
export type Settings = {
|
|
1254
|
+
/**
|
|
1255
|
+
* A deleted user's messages: keep (their writer anonymous) or delete.
|
|
1256
|
+
*/
|
|
1257
|
+
deleted_user_messages: "keep" | "delete";
|
|
1258
|
+
/**
|
|
1259
|
+
* The hook asked whom one may reach; null: anyone may reach anyone.
|
|
1260
|
+
*/
|
|
1261
|
+
hook: HookSettings | null;
|
|
1262
|
+
/**
|
|
1263
|
+
* The hook's signing secret, given once: as the hook is set, and as it is made anew.
|
|
1264
|
+
*/
|
|
1265
|
+
hook_secret?: string;
|
|
1266
|
+
/**
|
|
1267
|
+
* Pushes say what a message says (false: that one came).
|
|
1268
|
+
*/
|
|
1269
|
+
push_preview: boolean;
|
|
1270
|
+
/**
|
|
1271
|
+
* Messages older are removed; null: kept for good.
|
|
1272
|
+
*/
|
|
1273
|
+
retention_days: number | null;
|
|
1274
|
+
};
|
|
1275
|
+
/**
|
|
1276
|
+
* Changes how the project runs its conversations; what it names changes.
|
|
1277
|
+
*/
|
|
1278
|
+
export type SettingsRequest = {
|
|
1279
|
+
/**
|
|
1280
|
+
* keep or delete.
|
|
1281
|
+
*/
|
|
1282
|
+
deleted_user_messages?: "keep" | "delete";
|
|
1283
|
+
/**
|
|
1284
|
+
* The hook; null removes it.
|
|
1285
|
+
*/
|
|
1286
|
+
hook?: HookSettingsRequest | null;
|
|
1287
|
+
/**
|
|
1288
|
+
* Pushes say what a message says.
|
|
1289
|
+
*/
|
|
1290
|
+
push_preview?: boolean;
|
|
1291
|
+
/**
|
|
1292
|
+
* 1 to 36,500; null: for good.
|
|
1293
|
+
*/
|
|
1294
|
+
retention_days?: number | null;
|
|
1295
|
+
};
|
|
1296
|
+
/**
|
|
1297
|
+
* What changed for the reader since their cursor.
|
|
1298
|
+
*/
|
|
1299
|
+
export type SyncPage = {
|
|
1300
|
+
/**
|
|
1301
|
+
* The reader's conversations that changed, with their own place in each.
|
|
1302
|
+
*/
|
|
1303
|
+
conversations: Conversation[];
|
|
1304
|
+
/**
|
|
1305
|
+
* What to ask the next sync with (since).
|
|
1306
|
+
*/
|
|
1307
|
+
cursor: string;
|
|
1308
|
+
/**
|
|
1309
|
+
* The messages the reader removed for themselves.
|
|
1310
|
+
*/
|
|
1311
|
+
hidden: HiddenMessage[];
|
|
1312
|
+
/**
|
|
1313
|
+
* The people of the reader's small conversations who changed (reads, roles, comings and goings).
|
|
1314
|
+
*/
|
|
1315
|
+
members: Member[];
|
|
1316
|
+
/**
|
|
1317
|
+
* The messages written, changed or removed, the reader sees.
|
|
1318
|
+
*/
|
|
1319
|
+
messages: Message[];
|
|
1320
|
+
/**
|
|
1321
|
+
* The conversations the reader no longer has.
|
|
1322
|
+
*/
|
|
1323
|
+
removed_conversations: RemovedConversation[];
|
|
1324
|
+
/**
|
|
1325
|
+
* Everything to start from: the reader drops what it kept and keeps this (its conversations without their messages).
|
|
1326
|
+
*/
|
|
1327
|
+
reset: boolean;
|
|
1328
|
+
/**
|
|
1329
|
+
* The reader's scheduled messages that changed.
|
|
1330
|
+
*/
|
|
1331
|
+
scheduled: ScheduledMessage[];
|
|
1332
|
+
/**
|
|
1333
|
+
* The threads the reader follows that changed.
|
|
1334
|
+
*/
|
|
1335
|
+
threads: ThreadState[];
|
|
1336
|
+
};
|
|
1337
|
+
/**
|
|
1338
|
+
* What a message of the platform's tells: a change to its conversation.
|
|
1339
|
+
*/
|
|
1340
|
+
export type SystemEvent = {
|
|
1341
|
+
/**
|
|
1342
|
+
* Who did it; null: the project's server.
|
|
1343
|
+
*/
|
|
1344
|
+
actor_id: string | null;
|
|
1345
|
+
/**
|
|
1346
|
+
* A role it gave.
|
|
1347
|
+
*/
|
|
1348
|
+
role?: string;
|
|
1349
|
+
/**
|
|
1350
|
+
* A timer it set.
|
|
1351
|
+
*/
|
|
1352
|
+
timer_seconds?: number;
|
|
1353
|
+
/**
|
|
1354
|
+
* A title it set.
|
|
1355
|
+
*/
|
|
1356
|
+
title?: string;
|
|
1357
|
+
/**
|
|
1358
|
+
* What happened: created, members_added, member_left, member_removed, role_changed, title_changed, description_changed, photo_changed, timer_changed, vanish_on, vanish_off, settings_changed, screenshot.
|
|
1359
|
+
*/
|
|
1360
|
+
type: string;
|
|
1361
|
+
/**
|
|
1362
|
+
* Whom it was done to.
|
|
1363
|
+
*/
|
|
1364
|
+
user_ids?: string[];
|
|
1365
|
+
};
|
|
1366
|
+
/**
|
|
1367
|
+
* A thread the reader follows, with the message it answers.
|
|
1368
|
+
*/
|
|
1369
|
+
export type ThreadItem = {
|
|
1370
|
+
root: Message;
|
|
1371
|
+
thread: ThreadState;
|
|
1372
|
+
};
|
|
1373
|
+
export type ThreadPage = {
|
|
1374
|
+
/**
|
|
1375
|
+
* The threads.
|
|
1376
|
+
*/
|
|
1377
|
+
data: ThreadItem[];
|
|
1378
|
+
/**
|
|
1379
|
+
* The next page's cursor; absent on the last page.
|
|
1380
|
+
*/
|
|
1381
|
+
next_cursor?: string;
|
|
1382
|
+
};
|
|
1383
|
+
/**
|
|
1384
|
+
* The reader's place in a thread they follow.
|
|
1385
|
+
*/
|
|
1386
|
+
export type ThreadState = {
|
|
1387
|
+
/**
|
|
1388
|
+
* Its conversation.
|
|
1389
|
+
*/
|
|
1390
|
+
conversation_id: string;
|
|
1391
|
+
/**
|
|
1392
|
+
* When it was last answered.
|
|
1393
|
+
*/
|
|
1394
|
+
last_reply_at: string | null;
|
|
1395
|
+
/**
|
|
1396
|
+
* How far the reader read it.
|
|
1397
|
+
*/
|
|
1398
|
+
read_seq: number;
|
|
1399
|
+
/**
|
|
1400
|
+
* The message the thread answers.
|
|
1401
|
+
*/
|
|
1402
|
+
thread_id: string;
|
|
1403
|
+
/**
|
|
1404
|
+
* Its answers the reader has not read.
|
|
1405
|
+
*/
|
|
1406
|
+
unread_count: number;
|
|
1407
|
+
/**
|
|
1408
|
+
* How many times it changed.
|
|
1409
|
+
*/
|
|
1410
|
+
version: number;
|
|
1411
|
+
};
|
|
1412
|
+
/**
|
|
1413
|
+
* The reader is typing.
|
|
1414
|
+
*/
|
|
1415
|
+
export type TypingRequest = {
|
|
1416
|
+
/**
|
|
1417
|
+
* The thread they type in.
|
|
1418
|
+
*/
|
|
1419
|
+
thread_id?: string;
|
|
1420
|
+
};
|
|
1421
|
+
/**
|
|
1422
|
+
* Changes a conversation's details and how it runs; what it names changes.
|
|
1423
|
+
*/
|
|
1424
|
+
export type UpdateConversation = {
|
|
1425
|
+
/**
|
|
1426
|
+
* Who adds people (admins change it).
|
|
1427
|
+
*/
|
|
1428
|
+
add_policy?: "all" | "admins";
|
|
1429
|
+
/**
|
|
1430
|
+
* A group's description; null clears it.
|
|
1431
|
+
*/
|
|
1432
|
+
description?: string | null;
|
|
1433
|
+
/**
|
|
1434
|
+
* Who changes details and timer (admins change it).
|
|
1435
|
+
*/
|
|
1436
|
+
edit_policy?: "all" | "admins";
|
|
1437
|
+
/**
|
|
1438
|
+
* Whether someone added reads what was said before them (admins change it).
|
|
1439
|
+
*/
|
|
1440
|
+
history_for_new_members?: boolean;
|
|
1441
|
+
/**
|
|
1442
|
+
* Where the app reads a group's picture; null clears it.
|
|
1443
|
+
*/
|
|
1444
|
+
photo?: string | null;
|
|
1445
|
+
/**
|
|
1446
|
+
* Who writes: all or admins (admins change it).
|
|
1447
|
+
*/
|
|
1448
|
+
send_policy?: "all" | "admins";
|
|
1449
|
+
/**
|
|
1450
|
+
* How long a new message lives; null: for good.
|
|
1451
|
+
*/
|
|
1452
|
+
timer_seconds?: number | null;
|
|
1453
|
+
/**
|
|
1454
|
+
* A group's title.
|
|
1455
|
+
*/
|
|
1456
|
+
title?: string | null;
|
|
1457
|
+
/**
|
|
1458
|
+
* A direct conversation's vanish mode.
|
|
1459
|
+
*/
|
|
1460
|
+
vanish?: boolean;
|
|
1461
|
+
};
|
|
1462
|
+
/**
|
|
1463
|
+
* Changes a member's role.
|
|
1464
|
+
*/
|
|
1465
|
+
export type UpdateMemberRequest = {
|
|
1466
|
+
/**
|
|
1467
|
+
* owner (the owner hands the group over), admin or member.
|
|
1468
|
+
*/
|
|
1469
|
+
role: "owner" | "admin" | "member";
|
|
1470
|
+
};
|
|
1471
|
+
/**
|
|
1472
|
+
* Changes a profile; what it names changes.
|
|
1473
|
+
*/
|
|
1474
|
+
export type UpdateProfile = {
|
|
1475
|
+
/**
|
|
1476
|
+
* How long the messages of conversations they open from now on live.
|
|
1477
|
+
*/
|
|
1478
|
+
default_timer_seconds?: number | null;
|
|
1479
|
+
/**
|
|
1480
|
+
* Where the app reads the picture.
|
|
1481
|
+
*/
|
|
1482
|
+
image?: string | null;
|
|
1483
|
+
/**
|
|
1484
|
+
* A name (1 to 100 characters).
|
|
1485
|
+
*/
|
|
1486
|
+
name?: string | null;
|
|
1487
|
+
/**
|
|
1488
|
+
* Whether their reads show in a direct conversation (off: nor do the other's to them).
|
|
1489
|
+
*/
|
|
1490
|
+
read_receipts?: boolean;
|
|
1491
|
+
/**
|
|
1492
|
+
* Whether others see when they were last here.
|
|
1493
|
+
*/
|
|
1494
|
+
show_last_seen?: boolean;
|
|
1495
|
+
};
|
|
1496
|
+
/**
|
|
1497
|
+
* Changes a message still to be sent.
|
|
1498
|
+
*/
|
|
1499
|
+
export type UpdateScheduled = {
|
|
1500
|
+
/**
|
|
1501
|
+
* Whom its words name.
|
|
1502
|
+
*/
|
|
1503
|
+
mentions?: Mention[];
|
|
1504
|
+
/**
|
|
1505
|
+
* When it goes.
|
|
1506
|
+
*/
|
|
1507
|
+
send_at?: string;
|
|
1508
|
+
/**
|
|
1509
|
+
* What it will say.
|
|
1510
|
+
*/
|
|
1511
|
+
text?: string;
|
|
1512
|
+
};
|
|
1513
|
+
/**
|
|
1514
|
+
* Where a file is uploaded.
|
|
1515
|
+
*/
|
|
1516
|
+
export type Upload = {
|
|
1517
|
+
/**
|
|
1518
|
+
* Until when the URL takes it.
|
|
1519
|
+
*/
|
|
1520
|
+
expires_at: string;
|
|
1521
|
+
/**
|
|
1522
|
+
* The upload: a message carries it by this id.
|
|
1523
|
+
*/
|
|
1524
|
+
id: string;
|
|
1525
|
+
/**
|
|
1526
|
+
* The size it takes.
|
|
1527
|
+
*/
|
|
1528
|
+
size: number;
|
|
1529
|
+
/**
|
|
1530
|
+
* Where the app PUTs the file (encrypted).
|
|
1531
|
+
*/
|
|
1532
|
+
url: string;
|
|
1533
|
+
};
|
|
1534
|
+
/**
|
|
1535
|
+
* Asks for a URL to upload one file to.
|
|
1536
|
+
*/
|
|
1537
|
+
export type UploadRequest = {
|
|
1538
|
+
/**
|
|
1539
|
+
* The file's size (encrypted), 1 byte to 100 MiB.
|
|
1540
|
+
*/
|
|
1541
|
+
size: number;
|
|
1542
|
+
};
|
|
1543
|
+
/**
|
|
1544
|
+
* How a message seen a limited number of times stands for the reader.
|
|
1545
|
+
*/
|
|
1546
|
+
export type ViewOnce = {
|
|
1547
|
+
/**
|
|
1548
|
+
* How many times each may open it: 1, or 2 (once more).
|
|
1549
|
+
*/
|
|
1550
|
+
limit: number;
|
|
1551
|
+
/**
|
|
1552
|
+
* Who opened it (its writer reads this).
|
|
1553
|
+
*/
|
|
1554
|
+
opened_by?: string[];
|
|
1555
|
+
/**
|
|
1556
|
+
* How long the app shows it each time (the app's to keep).
|
|
1557
|
+
*/
|
|
1558
|
+
seconds: number | null;
|
|
1559
|
+
/**
|
|
1560
|
+
* How many times the reader opened it.
|
|
1561
|
+
*/
|
|
1562
|
+
views: number;
|
|
1563
|
+
};
|
|
1564
|
+
/**
|
|
1565
|
+
* Makes a message's files seen a limited number of times.
|
|
1566
|
+
*/
|
|
1567
|
+
export type ViewOnceRequest = {
|
|
1568
|
+
/**
|
|
1569
|
+
* How many times each may open it: 1, or 2 (once more).
|
|
1570
|
+
*/
|
|
1571
|
+
limit: number;
|
|
1572
|
+
/**
|
|
1573
|
+
* How long the app shows it each time.
|
|
1574
|
+
*/
|
|
1575
|
+
seconds?: number;
|
|
1576
|
+
};
|
|
1577
|
+
/**
|
|
1578
|
+
* A message seen once, opened.
|
|
1579
|
+
*/
|
|
1580
|
+
export type Viewed = {
|
|
1581
|
+
/**
|
|
1582
|
+
* Its files.
|
|
1583
|
+
*/
|
|
1584
|
+
attachments: ViewedFile[];
|
|
1585
|
+
/**
|
|
1586
|
+
* How many times they may.
|
|
1587
|
+
*/
|
|
1588
|
+
limit: number;
|
|
1589
|
+
/**
|
|
1590
|
+
* How long the app shows it.
|
|
1591
|
+
*/
|
|
1592
|
+
seconds: number | null;
|
|
1593
|
+
/**
|
|
1594
|
+
* How many times the reader opened it, this one counted.
|
|
1595
|
+
*/
|
|
1596
|
+
views: number;
|
|
1597
|
+
};
|
|
1598
|
+
/**
|
|
1599
|
+
* One file of a message seen once, as its opening gives it.
|
|
1600
|
+
*/
|
|
1601
|
+
export type ViewedFile = {
|
|
1602
|
+
/**
|
|
1603
|
+
* Its type.
|
|
1604
|
+
*/
|
|
1605
|
+
content_type: string;
|
|
1606
|
+
/**
|
|
1607
|
+
* Until when.
|
|
1608
|
+
*/
|
|
1609
|
+
expires_at: string;
|
|
1610
|
+
/**
|
|
1611
|
+
* The key that opens it.
|
|
1612
|
+
*/
|
|
1613
|
+
file_key: string;
|
|
1614
|
+
/**
|
|
1615
|
+
* The file.
|
|
1616
|
+
*/
|
|
1617
|
+
id: string;
|
|
1618
|
+
/**
|
|
1619
|
+
* Its size.
|
|
1620
|
+
*/
|
|
1621
|
+
size: number;
|
|
1622
|
+
/**
|
|
1623
|
+
* Its preview.
|
|
1624
|
+
*/
|
|
1625
|
+
thumbnail: string | null;
|
|
1626
|
+
/**
|
|
1627
|
+
* Where it is read.
|
|
1628
|
+
*/
|
|
1629
|
+
url: string;
|
|
1630
|
+
};
|
|
1631
|
+
/** The events this module sends the project's webhooks (x-palbase-events), by type: each one's payload, the event's data. */
|
|
1632
|
+
export interface Events {
|
|
1633
|
+
/**
|
|
1634
|
+
* messaging.conversation.created: a conversation was made — by a person, or the project's server.
|
|
1635
|
+
*/
|
|
1636
|
+
"messaging.conversation.created": ConversationCreatedEvent;
|
|
1637
|
+
/**
|
|
1638
|
+
* messaging.conversation.deleted: a conversation was deleted for everyone.
|
|
1639
|
+
*/
|
|
1640
|
+
"messaging.conversation.deleted": ConversationDeletedEvent;
|
|
1641
|
+
/**
|
|
1642
|
+
* messaging.report.created: a person reported a conversation, someone in it or messages of it; read it with the secret key.
|
|
1643
|
+
*/
|
|
1644
|
+
"messaging.report.created": ReportCreatedEvent;
|
|
1645
|
+
}
|
|
1646
|
+
/** Palbase Messaging */
|
|
1647
|
+
export declare function client(t: Transport): {
|
|
1648
|
+
/**
|
|
1649
|
+
* When the project's server read people's messages
|
|
1650
|
+
*
|
|
1651
|
+
* Every time the project's server read or removed people's messages, the newest first (kept 400 days).
|
|
1652
|
+
*/
|
|
1653
|
+
adminAccessLog(input?: {
|
|
1654
|
+
query?: {
|
|
1655
|
+
limit?: number; /** The cursor a page handed out (next_cursor). */
|
|
1656
|
+
cursor?: string;
|
|
1657
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
1658
|
+
signal?: AbortSignal;
|
|
1659
|
+
}): Promise<Reply<200, AccessLogPage>>;
|
|
1660
|
+
/**
|
|
1661
|
+
* The project's conversations
|
|
1662
|
+
*
|
|
1663
|
+
* The project's conversations (a person's, when `user_id` names one), the latest first.
|
|
1664
|
+
*/
|
|
1665
|
+
adminListConversations(input?: {
|
|
1666
|
+
query?: {
|
|
1667
|
+
user_id?: string; /** How many (1 to 100; 30 when absent). */
|
|
1668
|
+
limit?: number; /** The cursor a page handed out (next_cursor). */
|
|
1669
|
+
cursor?: string;
|
|
1670
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
1671
|
+
signal?: AbortSignal;
|
|
1672
|
+
}): Promise<Reply<200, ConversationPage>>;
|
|
1673
|
+
/**
|
|
1674
|
+
* Make a conversation for people
|
|
1675
|
+
*
|
|
1676
|
+
* The project's server makes a conversation for people — the direct one between two (the one there is, 200, when there is), or a group it may give an owner (`owner_id`) or keep its own. The project's hook is not asked: the server decides.
|
|
1677
|
+
*/
|
|
1678
|
+
adminCreateConversation(input: {
|
|
1679
|
+
body: AdminConversationRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
1680
|
+
signal?: AbortSignal;
|
|
1681
|
+
}): Promise<Reply<200, ConversationCreated> | Reply<201, ConversationCreated>>;
|
|
1682
|
+
/**
|
|
1683
|
+
* A conversation with its people
|
|
1684
|
+
*
|
|
1685
|
+
* A conversation of the project's, with its people.
|
|
1686
|
+
*/
|
|
1687
|
+
adminGetConversation(input: {
|
|
1688
|
+
path: {
|
|
1689
|
+
conversation_id: string;
|
|
1690
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
1691
|
+
signal?: AbortSignal;
|
|
1692
|
+
}): Promise<Reply<200, Conversation>>;
|
|
1693
|
+
/**
|
|
1694
|
+
* Delete a conversation
|
|
1695
|
+
*
|
|
1696
|
+
* The conversation goes for everyone, its messages, files and keys with it. In the access log.
|
|
1697
|
+
*/
|
|
1698
|
+
adminDeleteConversation(input: {
|
|
1699
|
+
path: {
|
|
1700
|
+
conversation_id: string;
|
|
1701
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
1702
|
+
signal?: AbortSignal;
|
|
1703
|
+
}): Promise<Reply<204, undefined>>;
|
|
1704
|
+
/**
|
|
1705
|
+
* Add people to a group
|
|
1706
|
+
*
|
|
1707
|
+
* The project's server adds people to a group (no hook asked).
|
|
1708
|
+
*/
|
|
1709
|
+
adminAddMembers(input: {
|
|
1710
|
+
path: {
|
|
1711
|
+
conversation_id: string;
|
|
1712
|
+
};
|
|
1713
|
+
body: AddMembersRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
1714
|
+
signal?: AbortSignal;
|
|
1715
|
+
}): Promise<Reply<200, MembersAdded>>;
|
|
1716
|
+
/**
|
|
1717
|
+
* Take a person out of a group
|
|
1718
|
+
*
|
|
1719
|
+
* The project's server takes a person out of a group.
|
|
1720
|
+
*/
|
|
1721
|
+
adminRemoveMember(input: {
|
|
1722
|
+
path: {
|
|
1723
|
+
conversation_id: string; /** The member. */
|
|
1724
|
+
user_id: string;
|
|
1725
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
1726
|
+
signal?: AbortSignal;
|
|
1727
|
+
}): Promise<Reply<204, undefined>>;
|
|
1728
|
+
/**
|
|
1729
|
+
* What a conversation said
|
|
1730
|
+
*
|
|
1731
|
+
* What the conversation said, the newest first — every read in the access log.
|
|
1732
|
+
*/
|
|
1733
|
+
adminListMessages(input: {
|
|
1734
|
+
path: {
|
|
1735
|
+
conversation_id: string;
|
|
1736
|
+
};
|
|
1737
|
+
query?: {
|
|
1738
|
+
limit?: number; /** The cursor a page handed out (next_cursor). */
|
|
1739
|
+
cursor?: string;
|
|
1740
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
1741
|
+
signal?: AbortSignal;
|
|
1742
|
+
}): Promise<Reply<200, MessagePage>>;
|
|
1743
|
+
/**
|
|
1744
|
+
* Say something in a conversation
|
|
1745
|
+
*
|
|
1746
|
+
* The project's server says something in a conversation, as the app. Sent again with the same `client_message_id`, it is the same message.
|
|
1747
|
+
*/
|
|
1748
|
+
adminSendMessage(input: {
|
|
1749
|
+
path: {
|
|
1750
|
+
conversation_id: string;
|
|
1751
|
+
};
|
|
1752
|
+
body: AdminMessageRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
1753
|
+
signal?: AbortSignal;
|
|
1754
|
+
}): Promise<Reply<200, Message> | Reply<201, Message>>;
|
|
1755
|
+
/**
|
|
1756
|
+
* Remove a message
|
|
1757
|
+
*
|
|
1758
|
+
* What a message said goes, for everyone. In the access log.
|
|
1759
|
+
*/
|
|
1760
|
+
adminDeleteMessage(input: {
|
|
1761
|
+
path: {
|
|
1762
|
+
conversation_id: string; /** The message. */
|
|
1763
|
+
message_id: string;
|
|
1764
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
1765
|
+
signal?: AbortSignal;
|
|
1766
|
+
}): Promise<Reply<204, undefined>>;
|
|
1767
|
+
/**
|
|
1768
|
+
* A person's name and picture
|
|
1769
|
+
*
|
|
1770
|
+
* The project's server names a person and gives their picture, as its own records say.
|
|
1771
|
+
*/
|
|
1772
|
+
adminPutProfile(input: {
|
|
1773
|
+
path: {
|
|
1774
|
+
user_id: string;
|
|
1775
|
+
};
|
|
1776
|
+
body: AdminProfileRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
1777
|
+
signal?: AbortSignal;
|
|
1778
|
+
}): Promise<Reply<200, Profile>>;
|
|
1779
|
+
/**
|
|
1780
|
+
* The reports people made
|
|
1781
|
+
*
|
|
1782
|
+
* The reports the project's people made, the newest first (without what they carry: read one to get it).
|
|
1783
|
+
*/
|
|
1784
|
+
adminListReports(input?: {
|
|
1785
|
+
query?: {
|
|
1786
|
+
status?: "open" | "resolved"; /** How many (1 to 100; 30 when absent). */
|
|
1787
|
+
limit?: number; /** The cursor a page handed out (next_cursor). */
|
|
1788
|
+
cursor?: string;
|
|
1789
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
1790
|
+
signal?: AbortSignal;
|
|
1791
|
+
}): Promise<Reply<200, ReportPage>>;
|
|
1792
|
+
/**
|
|
1793
|
+
* One report, with what it carries
|
|
1794
|
+
*
|
|
1795
|
+
* A report with its reporter's note and what the messages it names said when reported (their files with the keys that open them). In the access log.
|
|
1796
|
+
*/
|
|
1797
|
+
adminGetReport(input: {
|
|
1798
|
+
path: {
|
|
1799
|
+
report_id: string;
|
|
1800
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
1801
|
+
signal?: AbortSignal;
|
|
1802
|
+
}): Promise<Reply<200, Report>>;
|
|
1803
|
+
/**
|
|
1804
|
+
* Resolve a report
|
|
1805
|
+
*
|
|
1806
|
+
* The report is dealt with, and how (the project's own word).
|
|
1807
|
+
*/
|
|
1808
|
+
adminResolveReport(input: {
|
|
1809
|
+
path: {
|
|
1810
|
+
report_id: string;
|
|
1811
|
+
};
|
|
1812
|
+
body: ResolveRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
1813
|
+
signal?: AbortSignal;
|
|
1814
|
+
}): Promise<Reply<200, Report>>;
|
|
1815
|
+
/**
|
|
1816
|
+
* The people the reader blocks
|
|
1817
|
+
*
|
|
1818
|
+
* The people the reader blocks.
|
|
1819
|
+
*/
|
|
1820
|
+
listBlocks(input?: {
|
|
1821
|
+
query?: {
|
|
1822
|
+
limit?: number; /** The cursor a page handed out (next_cursor). */
|
|
1823
|
+
cursor?: string;
|
|
1824
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
1825
|
+
signal?: AbortSignal;
|
|
1826
|
+
}): Promise<Reply<200, BlockPage>>;
|
|
1827
|
+
/**
|
|
1828
|
+
* Block a person
|
|
1829
|
+
*
|
|
1830
|
+
* The reader blocks a person: their direct messages never reach the reader (they are not told), and they open no conversation with them and add them to no group.
|
|
1831
|
+
*/
|
|
1832
|
+
block(input: {
|
|
1833
|
+
path: {
|
|
1834
|
+
user_id: string;
|
|
1835
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
1836
|
+
signal?: AbortSignal;
|
|
1837
|
+
}): Promise<Reply<200, Block>>;
|
|
1838
|
+
/**
|
|
1839
|
+
* Unblock a person
|
|
1840
|
+
*
|
|
1841
|
+
* The reader no longer blocks a person. What they sent while blocked stays unseen.
|
|
1842
|
+
*/
|
|
1843
|
+
unblock(input: {
|
|
1844
|
+
path: {
|
|
1845
|
+
user_id: string;
|
|
1846
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
1847
|
+
signal?: AbortSignal;
|
|
1848
|
+
}): Promise<Reply<204, undefined>>;
|
|
1849
|
+
/**
|
|
1850
|
+
* The reader's conversations
|
|
1851
|
+
*
|
|
1852
|
+
* The signed-in person's conversations, the latest first, with their own place in each, what they have not read and the last message each shows. A direct conversation someone else opened shows once something is said in it; one they cleared, once something new is.
|
|
1853
|
+
*/
|
|
1854
|
+
listConversations(input?: {
|
|
1855
|
+
query?: {
|
|
1856
|
+
limit?: number; /** The cursor a page handed out (next_cursor). */
|
|
1857
|
+
cursor?: string;
|
|
1858
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
1859
|
+
signal?: AbortSignal;
|
|
1860
|
+
}): Promise<Reply<200, ConversationPage>>;
|
|
1861
|
+
/**
|
|
1862
|
+
* The direct conversation with a person
|
|
1863
|
+
*
|
|
1864
|
+
* The one conversation between the reader and another person: made the first time — when the project's hook lets them reach them — and the same one every time after (200). The other sees it once something is said in it.
|
|
1865
|
+
*/
|
|
1866
|
+
openDirectConversation(input: {
|
|
1867
|
+
body: DirectRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
1868
|
+
signal?: AbortSignal;
|
|
1869
|
+
}): Promise<Reply<200, Conversation> | Reply<201, Conversation>>;
|
|
1870
|
+
/**
|
|
1871
|
+
* Make a group
|
|
1872
|
+
*
|
|
1873
|
+
* A group the reader owns, with the people the project's hook lets them reach and who do not block them (`not_added` says whom else, and why). An Idempotency-Key makes it once.
|
|
1874
|
+
*/
|
|
1875
|
+
createGroup(input: {
|
|
1876
|
+
headers?: {
|
|
1877
|
+
"Idempotency-Key"?: string;
|
|
1878
|
+
};
|
|
1879
|
+
body: GroupRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
1880
|
+
signal?: AbortSignal;
|
|
1881
|
+
}): Promise<Reply<201, ConversationCreated>>;
|
|
1882
|
+
/**
|
|
1883
|
+
* One of the reader's conversations
|
|
1884
|
+
*
|
|
1885
|
+
* One of the reader's conversations, with their own place in it, and its people when it is small (a larger one's are paged: …/members).
|
|
1886
|
+
*/
|
|
1887
|
+
getConversation(input: {
|
|
1888
|
+
path: {
|
|
1889
|
+
conversation_id: string;
|
|
1890
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
1891
|
+
signal?: AbortSignal;
|
|
1892
|
+
}): Promise<Reply<200, Conversation>>;
|
|
1893
|
+
/**
|
|
1894
|
+
* Delete a group for everyone
|
|
1895
|
+
*
|
|
1896
|
+
* A group's owner or admin deletes it for everyone: its messages, its files and its keys go. A direct conversation is cleared, not deleted (…/clear).
|
|
1897
|
+
*/
|
|
1898
|
+
deleteConversation(input: {
|
|
1899
|
+
path: {
|
|
1900
|
+
conversation_id: string;
|
|
1901
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
1902
|
+
signal?: AbortSignal;
|
|
1903
|
+
}): Promise<Reply<204, undefined>>;
|
|
1904
|
+
/**
|
|
1905
|
+
* Change a conversation
|
|
1906
|
+
*
|
|
1907
|
+
* A group's title, description and picture and its timer (whom its edit policy lets), its policies (its admins); a direct conversation's timer and vanish mode (either of the two). Each change is told in the conversation, as a message of the platform's. Leaving vanish mode takes with it what was read in it.
|
|
1908
|
+
*/
|
|
1909
|
+
updateConversation(input: {
|
|
1910
|
+
path: {
|
|
1911
|
+
conversation_id: string;
|
|
1912
|
+
};
|
|
1913
|
+
body: UpdateConversation; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
1914
|
+
signal?: AbortSignal;
|
|
1915
|
+
}): Promise<Reply<200, Conversation>>;
|
|
1916
|
+
/**
|
|
1917
|
+
* Clear a conversation for oneself
|
|
1918
|
+
*
|
|
1919
|
+
* The reader removes what the conversation said, for themselves; it leaves their list until something new is said.
|
|
1920
|
+
*/
|
|
1921
|
+
clearConversation(input: {
|
|
1922
|
+
path: {
|
|
1923
|
+
conversation_id: string;
|
|
1924
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
1925
|
+
signal?: AbortSignal;
|
|
1926
|
+
}): Promise<Reply<200, MemberState>>;
|
|
1927
|
+
/**
|
|
1928
|
+
* The reader left the conversation's screen
|
|
1929
|
+
*
|
|
1930
|
+
* The reader's app says they left the conversation's screen. In vanish mode, what the other sent that they read goes.
|
|
1931
|
+
*/
|
|
1932
|
+
closeConversation(input: {
|
|
1933
|
+
path: {
|
|
1934
|
+
conversation_id: string;
|
|
1935
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
1936
|
+
signal?: AbortSignal;
|
|
1937
|
+
}): Promise<Reply<204, undefined>>;
|
|
1938
|
+
/**
|
|
1939
|
+
* A conversation's people
|
|
1940
|
+
*
|
|
1941
|
+
* The conversation's people, a page at a time (by id).
|
|
1942
|
+
*/
|
|
1943
|
+
listMembers(input: {
|
|
1944
|
+
path: {
|
|
1945
|
+
conversation_id: string;
|
|
1946
|
+
};
|
|
1947
|
+
query?: {
|
|
1948
|
+
limit?: number; /** The cursor a page handed out (next_cursor). */
|
|
1949
|
+
cursor?: string;
|
|
1950
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
1951
|
+
signal?: AbortSignal;
|
|
1952
|
+
}): Promise<Reply<200, MemberPage>>;
|
|
1953
|
+
/**
|
|
1954
|
+
* Add people to a group
|
|
1955
|
+
*
|
|
1956
|
+
* The reader adds people to a group — when its add policy lets them, the project's hook lets them reach them and they do not block the reader. Someone who left is let back in.
|
|
1957
|
+
*/
|
|
1958
|
+
addMembers(input: {
|
|
1959
|
+
path: {
|
|
1960
|
+
conversation_id: string;
|
|
1961
|
+
};
|
|
1962
|
+
body: AddMembersRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
1963
|
+
signal?: AbortSignal;
|
|
1964
|
+
}): Promise<Reply<200, MembersAdded>>;
|
|
1965
|
+
/**
|
|
1966
|
+
* Leave a group, or remove someone
|
|
1967
|
+
*
|
|
1968
|
+
* The reader leaves a group (their own id), or its admins remove another (never the owner). An owner who leaves hands the group to an admin, or to whoever was in it longest; a group left by everyone is deleted. They keep what it said while they were in it.
|
|
1969
|
+
*/
|
|
1970
|
+
removeMember(input: {
|
|
1971
|
+
path: {
|
|
1972
|
+
conversation_id: string; /** The member. */
|
|
1973
|
+
user_id: string;
|
|
1974
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
1975
|
+
signal?: AbortSignal;
|
|
1976
|
+
}): Promise<Reply<204, undefined>>;
|
|
1977
|
+
/**
|
|
1978
|
+
* Change a member's role
|
|
1979
|
+
*
|
|
1980
|
+
* A group's admins make a member an admin, or a member again; its owner hands the group to another (becoming an admin).
|
|
1981
|
+
*/
|
|
1982
|
+
updateMember(input: {
|
|
1983
|
+
path: {
|
|
1984
|
+
conversation_id: string; /** The member. */
|
|
1985
|
+
user_id: string;
|
|
1986
|
+
};
|
|
1987
|
+
body: UpdateMemberRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
1988
|
+
signal?: AbortSignal;
|
|
1989
|
+
}): Promise<Reply<200, MembersChanged>>;
|
|
1990
|
+
/**
|
|
1991
|
+
* A conversation's messages
|
|
1992
|
+
*
|
|
1993
|
+
* The conversation's own timeline as the reader sees it, the newest first, a page at a time; a message removed is there, said removed.
|
|
1994
|
+
*/
|
|
1995
|
+
listMessages(input: {
|
|
1996
|
+
path: {
|
|
1997
|
+
conversation_id: string;
|
|
1998
|
+
};
|
|
1999
|
+
query?: {
|
|
2000
|
+
limit?: number; /** The cursor a page handed out (next_cursor). */
|
|
2001
|
+
cursor?: string;
|
|
2002
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
2003
|
+
signal?: AbortSignal;
|
|
2004
|
+
}): Promise<Reply<200, MessagePage>>;
|
|
2005
|
+
/**
|
|
2006
|
+
* Send a message
|
|
2007
|
+
*
|
|
2008
|
+
* The reader says something in the conversation — words, files (uploaded first), an answer to a message or in its thread, for a while (`expires_in`) or to be seen a limited number of times (`view_once`) — now (201), or at `send_at` (202, a scheduled message). Sent again with the same `client_message_id`, it is the same message (200), never a second. A direct message to someone who blocks the reader never reaches them.
|
|
2009
|
+
*/
|
|
2010
|
+
sendMessage(input: {
|
|
2011
|
+
path: {
|
|
2012
|
+
conversation_id: string;
|
|
2013
|
+
};
|
|
2014
|
+
body: SendRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
2015
|
+
signal?: AbortSignal;
|
|
2016
|
+
}): Promise<Reply<200, Message> | Reply<201, Message> | Reply<202, ScheduledMessage>>;
|
|
2017
|
+
/**
|
|
2018
|
+
* One message
|
|
2019
|
+
*
|
|
2020
|
+
* One message the reader sees.
|
|
2021
|
+
*/
|
|
2022
|
+
getMessage(input: {
|
|
2023
|
+
path: {
|
|
2024
|
+
conversation_id: string; /** The message. */
|
|
2025
|
+
message_id: string;
|
|
2026
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
2027
|
+
signal?: AbortSignal;
|
|
2028
|
+
}): Promise<Reply<200, Message>>;
|
|
2029
|
+
/**
|
|
2030
|
+
* Remove a message
|
|
2031
|
+
*
|
|
2032
|
+
* `for=everyone` (the default): its writer removes a message for everyone within 48 hours (a group's admins at any time). `for=me`: anyone removes it for themselves.
|
|
2033
|
+
*/
|
|
2034
|
+
deleteMessage(input: {
|
|
2035
|
+
path: {
|
|
2036
|
+
conversation_id: string; /** The message. */
|
|
2037
|
+
message_id: string;
|
|
2038
|
+
};
|
|
2039
|
+
query?: {
|
|
2040
|
+
for?: "everyone" | "me";
|
|
2041
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
2042
|
+
signal?: AbortSignal;
|
|
2043
|
+
}): Promise<Reply<200, Message> | Reply<204, undefined>>;
|
|
2044
|
+
/**
|
|
2045
|
+
* Change a message
|
|
2046
|
+
*
|
|
2047
|
+
* Its writer changes what a message says, within 15 minutes of sending it; its files stay.
|
|
2048
|
+
*/
|
|
2049
|
+
editMessage(input: {
|
|
2050
|
+
path: {
|
|
2051
|
+
conversation_id: string; /** The message. */
|
|
2052
|
+
message_id: string;
|
|
2053
|
+
};
|
|
2054
|
+
body: EditRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
2055
|
+
signal?: AbortSignal;
|
|
2056
|
+
}): Promise<Reply<200, Message>>;
|
|
2057
|
+
/**
|
|
2058
|
+
* Where a message's file is read
|
|
2059
|
+
*
|
|
2060
|
+
* A URL reading one of a message's files (encrypted: its key is in the message). A message seen once gives its files by …/view alone.
|
|
2061
|
+
*/
|
|
2062
|
+
attachmentUrl(input: {
|
|
2063
|
+
path: {
|
|
2064
|
+
conversation_id: string; /** The message. */
|
|
2065
|
+
message_id: string; /** The file. */
|
|
2066
|
+
attachment_id: string;
|
|
2067
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
2068
|
+
signal?: AbortSignal;
|
|
2069
|
+
}): Promise<Reply<200, FileURL>>;
|
|
2070
|
+
/**
|
|
2071
|
+
* React to a message
|
|
2072
|
+
*
|
|
2073
|
+
* The reader reacts to a message with an emoji, beside their other reactions to it (Slack's); with `replace`, in their place (one a person, WhatsApp's). Again with the same emoji, nothing more. A person gives one message 20 emoji at most.
|
|
2074
|
+
*/
|
|
2075
|
+
react(input: {
|
|
2076
|
+
path: {
|
|
2077
|
+
conversation_id: string; /** The message. */
|
|
2078
|
+
message_id: string; /** The emoji, percent-encoded in the path. */
|
|
2079
|
+
emoji: string;
|
|
2080
|
+
};
|
|
2081
|
+
body?: ReactRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
2082
|
+
signal?: AbortSignal;
|
|
2083
|
+
}): Promise<Reply<200, Message>>;
|
|
2084
|
+
/**
|
|
2085
|
+
* Take a reaction back
|
|
2086
|
+
*
|
|
2087
|
+
* The reader takes back their reaction with the emoji.
|
|
2088
|
+
*/
|
|
2089
|
+
unreact(input: {
|
|
2090
|
+
path: {
|
|
2091
|
+
conversation_id: string; /** The message. */
|
|
2092
|
+
message_id: string; /** The emoji, percent-encoded in the path. */
|
|
2093
|
+
emoji: string;
|
|
2094
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
2095
|
+
signal?: AbortSignal;
|
|
2096
|
+
}): Promise<Reply<200, Message>>;
|
|
2097
|
+
/**
|
|
2098
|
+
* Who read a message
|
|
2099
|
+
*
|
|
2100
|
+
* Who of the conversation read the message, and whose apps took it (its writer aside).
|
|
2101
|
+
*/
|
|
2102
|
+
messageReaders(input: {
|
|
2103
|
+
path: {
|
|
2104
|
+
conversation_id: string; /** The message. */
|
|
2105
|
+
message_id: string;
|
|
2106
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
2107
|
+
signal?: AbortSignal;
|
|
2108
|
+
}): Promise<Reply<200, Readers>>;
|
|
2109
|
+
/**
|
|
2110
|
+
* A thread's answers
|
|
2111
|
+
*
|
|
2112
|
+
* The answers in a message's thread, the oldest first, a page at a time.
|
|
2113
|
+
*/
|
|
2114
|
+
listReplies(input: {
|
|
2115
|
+
path: {
|
|
2116
|
+
conversation_id: string; /** The message. */
|
|
2117
|
+
message_id: string;
|
|
2118
|
+
};
|
|
2119
|
+
query?: {
|
|
2120
|
+
limit?: number; /** The cursor a page handed out (next_cursor). */
|
|
2121
|
+
cursor?: string;
|
|
2122
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
2123
|
+
signal?: AbortSignal;
|
|
2124
|
+
}): Promise<Reply<200, MessagePage>>;
|
|
2125
|
+
/**
|
|
2126
|
+
* Open a message seen once
|
|
2127
|
+
*
|
|
2128
|
+
* The reader opens a message seen a limited number of times: its files and the keys that open them, once (or twice when it allows once more). Once everyone it was for opened it as often as it allows, what it carried goes.
|
|
2129
|
+
*/
|
|
2130
|
+
viewOnce(input: {
|
|
2131
|
+
path: {
|
|
2132
|
+
conversation_id: string; /** The message. */
|
|
2133
|
+
message_id: string;
|
|
2134
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
2135
|
+
signal?: AbortSignal;
|
|
2136
|
+
}): Promise<Reply<200, Viewed>>;
|
|
2137
|
+
/**
|
|
2138
|
+
* How a conversation notifies the reader
|
|
2139
|
+
*
|
|
2140
|
+
* Mutes the conversation until a time (null: unmuted), and says what notifies the reader of it — every message, those that name them, none.
|
|
2141
|
+
*/
|
|
2142
|
+
setConversationNotifications(input: {
|
|
2143
|
+
path: {
|
|
2144
|
+
conversation_id: string;
|
|
2145
|
+
};
|
|
2146
|
+
body: NotificationsRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
2147
|
+
signal?: AbortSignal;
|
|
2148
|
+
}): Promise<Reply<200, MemberState>>;
|
|
2149
|
+
/**
|
|
2150
|
+
* The reader took a screenshot
|
|
2151
|
+
*
|
|
2152
|
+
* The reader's app saw them take a picture of the conversation's screen: the others are told, in the conversation, as a message of the platform's.
|
|
2153
|
+
*/
|
|
2154
|
+
reportScreenshot(input: {
|
|
2155
|
+
path: {
|
|
2156
|
+
conversation_id: string;
|
|
2157
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
2158
|
+
signal?: AbortSignal;
|
|
2159
|
+
}): Promise<Reply<201, Message>>;
|
|
2160
|
+
/**
|
|
2161
|
+
* The reader is typing
|
|
2162
|
+
*
|
|
2163
|
+
* The conversation's other people hear the reader is typing (in a thread, when it names one), for a few seconds, on their realtime channels. Nothing is kept.
|
|
2164
|
+
*/
|
|
2165
|
+
typing(input: {
|
|
2166
|
+
path: {
|
|
2167
|
+
conversation_id: string;
|
|
2168
|
+
};
|
|
2169
|
+
body?: TypingRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
2170
|
+
signal?: AbortSignal;
|
|
2171
|
+
}): Promise<Reply<204, undefined>>;
|
|
2172
|
+
/**
|
|
2173
|
+
* A URL to upload a file to
|
|
2174
|
+
*
|
|
2175
|
+
* A URL the reader's app uploads one file to — encrypted with a key of its own, which the message carries — before a message carries it. The file is the project's: counted under its storage. One no message carries within a day is removed.
|
|
2176
|
+
*/
|
|
2177
|
+
createUpload(input: {
|
|
2178
|
+
path: {
|
|
2179
|
+
conversation_id: string;
|
|
2180
|
+
};
|
|
2181
|
+
body: UploadRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
2182
|
+
signal?: AbortSignal;
|
|
2183
|
+
}): Promise<Reply<201, Upload>>;
|
|
2184
|
+
/**
|
|
2185
|
+
* The reader's own profile
|
|
2186
|
+
*
|
|
2187
|
+
* The reader's own profile and settings.
|
|
2188
|
+
*/
|
|
2189
|
+
getMyProfile(input?: {
|
|
2190
|
+
signal?: AbortSignal;
|
|
2191
|
+
}): Promise<Reply<200, MyProfile>>;
|
|
2192
|
+
/**
|
|
2193
|
+
* Change the reader's own profile
|
|
2194
|
+
*
|
|
2195
|
+
* The reader's name and picture, whether others see when they were last here, and how long the messages of the conversations they open from now on live (null: for good).
|
|
2196
|
+
*/
|
|
2197
|
+
updateMyProfile(input: {
|
|
2198
|
+
body: UpdateProfile; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
2199
|
+
signal?: AbortSignal;
|
|
2200
|
+
}): Promise<Reply<200, MyProfile>>;
|
|
2201
|
+
/**
|
|
2202
|
+
* The reader is here
|
|
2203
|
+
*
|
|
2204
|
+
* The reader's app says they are here (every half minute while it is open); they show online a while after.
|
|
2205
|
+
*/
|
|
2206
|
+
presence(input?: {
|
|
2207
|
+
signal?: AbortSignal;
|
|
2208
|
+
}): Promise<Reply<204, undefined>>;
|
|
2209
|
+
/**
|
|
2210
|
+
* People's profiles
|
|
2211
|
+
*
|
|
2212
|
+
* People as the conversations show them — their name and picture, and whether they are here, when they let others see it and the reader lets others see theirs.
|
|
2213
|
+
*/
|
|
2214
|
+
getProfiles(input: {
|
|
2215
|
+
query: {
|
|
2216
|
+
user_ids: string;
|
|
2217
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
2218
|
+
signal?: AbortSignal;
|
|
2219
|
+
}): Promise<Reply<200, ProfileList>>;
|
|
2220
|
+
/**
|
|
2221
|
+
* How far the reader read
|
|
2222
|
+
*
|
|
2223
|
+
* How far the reader read conversations and threads, and how far their app took them. A read moves forward only. A message meant to go once read goes its time after everyone it was for read it. A small conversation's people hear it as it happens.
|
|
2224
|
+
*/
|
|
2225
|
+
receipts(input: {
|
|
2226
|
+
body: ReceiptsRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
2227
|
+
signal?: AbortSignal;
|
|
2228
|
+
}): Promise<Reply<204, undefined>>;
|
|
2229
|
+
/**
|
|
2230
|
+
* Report a conversation, a person or messages
|
|
2231
|
+
*
|
|
2232
|
+
* The reader reports a conversation, someone in it or messages they see in it, saying why. What the messages say is kept with the report, sealed — it outlives them — and the project's backend is told (`messaging.report.created`) to read it with its secret key.
|
|
2233
|
+
*/
|
|
2234
|
+
report(input: {
|
|
2235
|
+
body: ReportRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
2236
|
+
signal?: AbortSignal;
|
|
2237
|
+
}): Promise<Reply<201, ReportCreated>>;
|
|
2238
|
+
/**
|
|
2239
|
+
* The reader's scheduled messages
|
|
2240
|
+
*
|
|
2241
|
+
* The reader's messages still to be sent, the soonest first.
|
|
2242
|
+
*/
|
|
2243
|
+
listScheduled(input?: {
|
|
2244
|
+
query?: {
|
|
2245
|
+
limit?: number; /** The cursor a page handed out (next_cursor). */
|
|
2246
|
+
cursor?: string;
|
|
2247
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
2248
|
+
signal?: AbortSignal;
|
|
2249
|
+
}): Promise<Reply<200, ScheduledPage>>;
|
|
2250
|
+
/**
|
|
2251
|
+
* Take a scheduled message back
|
|
2252
|
+
*
|
|
2253
|
+
* The reader takes a message still to be sent back; it never goes.
|
|
2254
|
+
*/
|
|
2255
|
+
cancelScheduled(input: {
|
|
2256
|
+
path: {
|
|
2257
|
+
scheduled_id: string;
|
|
2258
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
2259
|
+
signal?: AbortSignal;
|
|
2260
|
+
}): Promise<Reply<204, undefined>>;
|
|
2261
|
+
/**
|
|
2262
|
+
* Change a scheduled message
|
|
2263
|
+
*
|
|
2264
|
+
* What a message still to be sent says, or when it goes.
|
|
2265
|
+
*/
|
|
2266
|
+
updateScheduled(input: {
|
|
2267
|
+
path: {
|
|
2268
|
+
scheduled_id: string;
|
|
2269
|
+
};
|
|
2270
|
+
body: UpdateScheduled; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
2271
|
+
signal?: AbortSignal;
|
|
2272
|
+
}): Promise<Reply<200, ScheduledMessage>>;
|
|
2273
|
+
/**
|
|
2274
|
+
* How the project runs its conversations
|
|
2275
|
+
*
|
|
2276
|
+
* How long messages are kept, whether pushes say what a message says, what becomes of a deleted user's messages, and the hook asked whom one may reach.
|
|
2277
|
+
*/
|
|
2278
|
+
getSettings(input?: {
|
|
2279
|
+
signal?: AbortSignal;
|
|
2280
|
+
}): Promise<Reply<200, Settings>>;
|
|
2281
|
+
/**
|
|
2282
|
+
* Change how the project runs its conversations
|
|
2283
|
+
*
|
|
2284
|
+
* What it names changes: how long messages are kept (null: for good), whether pushes say what a message says, what becomes of a deleted user's messages, and the hook asked whom one may reach (null: none). The hook is POSTed `{event: "messaging.can_message", action: "direct" | "group_add", from_user_id, to_user_ids, conversation_id}`, signed as Standard Webhooks sign (webhook-id, webhook-timestamp, webhook-signature), and answers 200 `{allowed_user_ids: [...]}`. A hook set for the first time is given its signing secret, here, once.
|
|
2285
|
+
*/
|
|
2286
|
+
putSettings(input: {
|
|
2287
|
+
body: SettingsRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
2288
|
+
signal?: AbortSignal;
|
|
2289
|
+
}): Promise<Reply<200, Settings>>;
|
|
2290
|
+
/**
|
|
2291
|
+
* Make the hook's secret anew
|
|
2292
|
+
*
|
|
2293
|
+
* The hook's signing secret made anew, given here once; the old one signs nothing more.
|
|
2294
|
+
*/
|
|
2295
|
+
rotateHookSecret(input?: {
|
|
2296
|
+
signal?: AbortSignal;
|
|
2297
|
+
}): Promise<Reply<200, Settings>>;
|
|
2298
|
+
/**
|
|
2299
|
+
* What changed for the reader
|
|
2300
|
+
*
|
|
2301
|
+
* What changed for the signed-in person since `since` (the `cursor` the last sync handed out): their conversations with their own place in each and what they have not read, the people of the small ones, the messages written, changed or removed, what they removed for themselves, the threads they follow, the messages they scheduled. Nothing is missed; a change may come twice — each says its `version`. With no `since`, or one older than 30 days, it is everything to start from (`reset`): the conversations without their messages, read a page at a time.
|
|
2302
|
+
*/
|
|
2303
|
+
sync(input?: {
|
|
2304
|
+
query?: {
|
|
2305
|
+
since?: string;
|
|
2306
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
2307
|
+
signal?: AbortSignal;
|
|
2308
|
+
}): Promise<Reply<200, SyncPage>>;
|
|
2309
|
+
/**
|
|
2310
|
+
* The threads the reader follows
|
|
2311
|
+
*
|
|
2312
|
+
* The threads the reader follows — the ones they answered in, started, or were named in — the last answered first, each with the message it answers and what they have not read of it.
|
|
2313
|
+
*/
|
|
2314
|
+
listThreads(input?: {
|
|
2315
|
+
query?: {
|
|
2316
|
+
limit?: number; /** The cursor a page handed out (next_cursor). */
|
|
2317
|
+
cursor?: string;
|
|
2318
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
2319
|
+
signal?: AbortSignal;
|
|
2320
|
+
}): Promise<Reply<200, ThreadPage>>;
|
|
2321
|
+
};
|
|
2322
|
+
export type Client = ReturnType<typeof client>;
|