@myronsi/messenger-api 2.1.0-alpha.28 → 2.1.0-alpha.29

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.
@@ -1,4 +1,4 @@
1
- /* Generated from api/openapi.yaml 2.1.0-alpha.28. Do not edit. */
1
+ /* Generated from api/openapi.yaml 2.1.0-alpha.29. Do not edit. */
2
2
 
3
3
  /**
4
4
  * Any WebSocket event, in either direction.
@@ -59,6 +59,18 @@ export type ServerEvent =
59
59
  export type Timestamp = string;
60
60
  export type ApprovalRequestType = "direct_message" | "group_invite";
61
61
  export type ApprovalRequestStatus = "pending" | "approved" | "rejected";
62
+ export type AttachmentKind = "image" | "audio" | "voice" | "video" | "file";
63
+ /**
64
+ * `media` an uploaded image, GIF or short video (`attachment`), `preset` one of the clients' built-in
65
+ * gradients (`preset`), `color` one color or a gradient of two (`colors`).
66
+ *
67
+ */
68
+ export type ProfileBackgroundKind = "media" | "preset" | "color";
69
+ /**
70
+ * Name of a built-in gradient. Clients show their default background for a name they do not know.
71
+ */
72
+ export type BackgroundPreset = string;
73
+ export type BackgroundColor = string;
62
74
  export type Username = string;
63
75
  /**
64
76
  * `ringing` until someone answers, `active` while people are in it, `ended` afterwards.
@@ -82,7 +94,6 @@ export type CallParticipantState = "ringing" | "joined" | "declined" | "missed"
82
94
  export type CallIdentityKey = string;
83
95
  export type ChatType = "direct" | "group";
84
96
  export type MessageType = "text" | "file" | "voice" | "system" | "sticker";
85
- export type AttachmentKind = "image" | "audio" | "voice" | "video" | "file";
86
97
  export type StickerPackSlug = string;
87
98
  export type SystemEventKind =
88
99
  "group_created" | "member_added" | "member_joined" | "member_removed" | "member_left" | "call";
@@ -294,9 +305,27 @@ export interface ApprovalRequest {
294
305
  export interface User {
295
306
  id: Id;
296
307
  /**
297
- * Grows whenever the username, display name, bio or avatar changes (not with presence). Clients keep a stored profile until a higher version arrives.
308
+ * Grows whenever the username, display name, bio, avatar, pronouns, birthday, profile music or profile
309
+ * background changes (not with presence). Clients keep a stored profile until a higher version arrives.
310
+ *
298
311
  */
299
312
  profile_version: number;
313
+ /**
314
+ * Free text such as "she/her". Visible like the bio (`profile_visibility`).
315
+ */
316
+ pronouns: string | null;
317
+ /**
318
+ * Visible by `birthday_visibility`; `null` when not set or hidden.
319
+ */
320
+ birthday: Birthday | null;
321
+ /**
322
+ * A short song on the profile, visible like the bio. Clients never play it on their own.
323
+ */
324
+ music: ProfileMusic | null;
325
+ /**
326
+ * The banner and page background of the profile, visible like the bio.
327
+ */
328
+ background: ProfileBackground | null;
300
329
  username: Username;
301
330
  display_name: string;
302
331
  /**
@@ -312,6 +341,117 @@ export interface User {
312
341
  last_seen: Timestamp | null;
313
342
  is_deleted: boolean;
314
343
  }
344
+ export interface Birthday {
345
+ day: number;
346
+ month: number;
347
+ /**
348
+ * Optional; `null` when the user keeps the year to themselves.
349
+ */
350
+ year: number | null;
351
+ }
352
+ export interface ProfileMusic {
353
+ /**
354
+ * The clip (at most 30 s). `thumbnail_url` is the cover when the file had one.
355
+ */
356
+ attachment: Attachment;
357
+ title: string | null;
358
+ artist: string | null;
359
+ }
360
+ export interface Attachment {
361
+ id: AttachmentRef;
362
+ kind: AttachmentKind;
363
+ filename: string;
364
+ /**
365
+ * Detected by the server
366
+ */
367
+ content_type: string;
368
+ /**
369
+ * Bytes
370
+ */
371
+ size: number;
372
+ /**
373
+ * Same-origin path (`/api/v2/attachments/{id}/content`) set by the server.
374
+ */
375
+ url: string;
376
+ width?: number | null;
377
+ height?: number | null;
378
+ thumbnail_url?: string | null;
379
+ /**
380
+ * A JPEG of at most 1600 px to show in an image viewer instead of the original; `null` for small images and GIFs, which are shown as they are.
381
+ */
382
+ display_url?: string | null;
383
+ duration_ms?: number | null;
384
+ waveform?: number[] | null;
385
+ tags?: AudioTags;
386
+ drawing?: Drawing;
387
+ }
388
+ /**
389
+ * Only in the answer to a `profile_music` upload; what the file says about itself.
390
+ */
391
+ export interface AudioTags {
392
+ title: string | null;
393
+ artist: string | null;
394
+ }
395
+ /**
396
+ * What the sender drew on this image of this message. Clients show the image with the drawing on top
397
+ * and never without it. Absent when the image has no drawing. The same image can carry another drawing
398
+ * in another message.
399
+ *
400
+ */
401
+ export interface Drawing {
402
+ version: number;
403
+ /**
404
+ * @minItems 1
405
+ * @maxItems 200
406
+ */
407
+ items: [DrawingItem, ...DrawingItem[]];
408
+ }
409
+ export interface DrawingItem {
410
+ type: "stroke" | "text";
411
+ color: string;
412
+ /**
413
+ * Stroke only. Line width as a fraction of the image width.
414
+ */
415
+ width?: number;
416
+ /**
417
+ * Stroke only. Flat list of x, y pairs. A drawing has at most 10000 numbers in all its strokes.
418
+ *
419
+ * @minItems 2
420
+ * @maxItems 10000
421
+ */
422
+ points?: [number, number, ...number[]];
423
+ /**
424
+ * Text only. Left edge of the label.
425
+ */
426
+ x?: number;
427
+ /**
428
+ * Text only. Top edge of the label.
429
+ */
430
+ y?: number;
431
+ /**
432
+ * Text only. Font height as a fraction of the image height.
433
+ */
434
+ size?: number;
435
+ /**
436
+ * Text only.
437
+ */
438
+ text?: string;
439
+ }
440
+ export interface ProfileBackground {
441
+ kind: ProfileBackgroundKind;
442
+ /**
443
+ * Set for `media`. An image, an animated GIF or a muted video of at most 15 s; `thumbnail_url` is a still
444
+ * frame to show while it loads and when the viewer prefers reduced motion.
445
+ *
446
+ */
447
+ attachment?: Attachment;
448
+ preset?: BackgroundPreset;
449
+ /**
450
+ * @minItems 1
451
+ * @maxItems 2
452
+ */
453
+ colors?: [BackgroundColor] | [BackgroundColor, BackgroundColor];
454
+ }
315
455
  /**
316
456
  * Sealed sender keys for this session (see docs/calls-e2ee.md). Sent only to the recipient session.
317
457
  */
@@ -504,78 +644,6 @@ export interface Message {
504
644
  system_event?: SystemEvent;
505
645
  client_temp_id?: ClientTempId;
506
646
  }
507
- export interface Attachment {
508
- id: AttachmentRef;
509
- kind: AttachmentKind;
510
- filename: string;
511
- /**
512
- * Detected by the server
513
- */
514
- content_type: string;
515
- /**
516
- * Bytes
517
- */
518
- size: number;
519
- /**
520
- * Same-origin path (`/api/v2/attachments/{id}/content`) set by the server.
521
- */
522
- url: string;
523
- width?: number | null;
524
- height?: number | null;
525
- thumbnail_url?: string | null;
526
- /**
527
- * A JPEG of at most 1600 px to show in an image viewer instead of the original; `null` for small images and GIFs, which are shown as they are.
528
- */
529
- display_url?: string | null;
530
- duration_ms?: number | null;
531
- waveform?: number[] | null;
532
- drawing?: Drawing;
533
- }
534
- /**
535
- * What the sender drew on this image of this message. Clients show the image with the drawing on top
536
- * and never without it. Absent when the image has no drawing. The same image can carry another drawing
537
- * in another message.
538
- *
539
- */
540
- export interface Drawing {
541
- version: number;
542
- /**
543
- * @minItems 1
544
- * @maxItems 200
545
- */
546
- items: [DrawingItem, ...DrawingItem[]];
547
- }
548
- export interface DrawingItem {
549
- type: "stroke" | "text";
550
- color: string;
551
- /**
552
- * Stroke only. Line width as a fraction of the image width.
553
- */
554
- width?: number;
555
- /**
556
- * Stroke only. Flat list of x, y pairs. A drawing has at most 10000 numbers in all its strokes.
557
- *
558
- * @minItems 2
559
- * @maxItems 10000
560
- */
561
- points?: [number, number, ...number[]];
562
- /**
563
- * Text only. Left edge of the label.
564
- */
565
- x?: number;
566
- /**
567
- * Text only. Top edge of the label.
568
- */
569
- y?: number;
570
- /**
571
- * Text only. Font height as a fraction of the image height.
572
- */
573
- size?: number;
574
- /**
575
- * Text only.
576
- */
577
- text?: string;
578
- }
579
647
  /**
580
648
  * What a reply shows of the message it answers, so a client can draw the quote without loading that
581
649
  * message. Set on messages of history pages and `message` events when the recipient can see the answered
@@ -726,6 +794,10 @@ export interface Group {
726
794
  name: string;
727
795
  description: string | null;
728
796
  avatar_url: string | null;
797
+ /**
798
+ * The banner and page background of the group profile; set by the owner and admins.
799
+ */
800
+ background: ProfileBackground | null;
729
801
  owner_id: Id;
730
802
  my_role: GroupRole;
731
803
  members: GroupMember[];
@@ -926,7 +998,7 @@ export interface ServerTypingEvent {
926
998
  };
927
999
  }
928
1000
  /**
929
- * A user you share a chat with changed their username, display name, bio or avatar. Fetch GET /users/{user_id} again when profile_version is higher than the one you keep.
1001
+ * A user you share a chat with changed their username, display name, bio, avatar, pronouns, birthday, profile music or profile background. Fetch GET /users/{user_id} again when profile_version is higher than the one you keep.
930
1002
  */
931
1003
  export interface ServerUserUpdatedEvent {
932
1004
  type: "user_updated";