beamsocial 0.12.0 → 0.13.0

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,29 +1,56 @@
1
- export interface NotificationSingle {
1
+ import type { Profile } from './profiles.js';
2
+ export type PartialNotificationBase = {
2
3
  id: string;
3
4
  date: Date;
4
5
  type: string;
5
6
  isGroupable: boolean;
6
7
  read: boolean;
8
+ };
9
+ export type PartialNotificationSingle = PartialNotificationBase & {
7
10
  author: string;
8
- }
9
- export interface NotificationPost extends NotificationSingle {
11
+ };
12
+ export type NotificationBase = {
13
+ id: string;
14
+ date: Date;
15
+ type: string;
16
+ isGroupable: boolean;
17
+ read: boolean;
18
+ author: Profile;
19
+ };
20
+ export type NotificationSingle = NotificationBase & {
21
+ author: Profile;
22
+ };
23
+ export type PartialNotificationPost = PartialNotificationSingle & {
24
+ target: string;
25
+ };
26
+ export type NotificationPost = NotificationSingle & {
10
27
  target: string;
11
- }
12
- export interface NotificationWarn extends NotificationSingle {
28
+ };
29
+ export type NotificationWarn = NotificationBase & {
13
30
  reason: string;
14
- }
15
- export interface NotificationBan extends NotificationSingle {
31
+ };
32
+ export type NotificationBan = NotificationBase & {
16
33
  soft: boolean;
17
34
  until: Date;
18
35
  reason: string;
19
- }
20
- export type Notification = NotificationSingle | NotificationPost | NotificationWarn | NotificationBan;
21
- export type Inbox = {
36
+ };
37
+ export type Notification = NotificationSingle | NotificationWarn | NotificationBan;
38
+ export type PartialNotification = PartialNotificationSingle | PartialNotificationPost;
39
+ export type PartialInbox = {
22
40
  id: string;
23
41
  requests: {
24
42
  children: string[];
25
43
  following: string[];
26
44
  followers: string[];
27
45
  };
46
+ other: PartialNotificationSingle[];
47
+ };
48
+ export type Inbox = {
49
+ id: string;
50
+ requests: {
51
+ children: Profile[];
52
+ following: Profile[];
53
+ followers: Profile[];
54
+ };
28
55
  other: Notification[];
29
56
  };
@@ -54,7 +54,7 @@ export class User {
54
54
  this.followers += 1;
55
55
  }
56
56
  else if (res.status == 206) {
57
- (_a = this.__session) === null || _a === void 0 ? void 0 : _a.inbox.requests.following.push(this.id);
57
+ (_a = this.__session) === null || _a === void 0 ? void 0 : _a.inbox.requests.following.push(this);
58
58
  }
59
59
  return;
60
60
  }
@@ -122,7 +122,7 @@ export class User {
122
122
  this.followers += 1;
123
123
  }
124
124
  else if (res.status == 206) {
125
- (_a = this.__session) === null || _a === void 0 ? void 0 : _a.inbox.requests.following.push(this.id);
125
+ (_a = this.__session) === null || _a === void 0 ? void 0 : _a.inbox.requests.following.push(this);
126
126
  }
127
127
  return;
128
128
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "beamsocial",
3
- "version": "0.12.0",
3
+ "version": "0.13.0",
4
4
  "type": "module",
5
5
  "description": "API-wrapper pour Beam",
6
6
  "main": "index.js",