beamsocial 0.19.0 → 0.19.2

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.
@@ -22,11 +22,11 @@ export declare class Inbox {
22
22
  private __session?;
23
23
  id: string;
24
24
  outgoing: {
25
- child: OutgoingRequest[];
25
+ children: OutgoingRequest[];
26
26
  follow: OutgoingRequest[];
27
27
  };
28
28
  incoming: {
29
- child: IncomingRequest[];
29
+ children: IncomingRequest[];
30
30
  follow: IncomingRequest[];
31
31
  };
32
32
  unread: Notification[];
@@ -44,11 +44,11 @@ export class OutgoingRequest {
44
44
  export class Inbox {
45
45
  constructor(id) {
46
46
  this.outgoing = {
47
- child: [],
47
+ children: [],
48
48
  follow: []
49
49
  };
50
50
  this.incoming = {
51
- child: [],
51
+ children: [],
52
52
  follow: []
53
53
  };
54
54
  this.unread = [];
@@ -60,11 +60,11 @@ export class Inbox {
60
60
  this.__session = __session;
61
61
  this.__url = __url + '/me';
62
62
  this.outgoing = {
63
- child: data.outgoing.child.map((req) => new OutgoingRequest(req, __session, __url)),
63
+ children: data.outgoing.children.map((req) => new OutgoingRequest(req, __session, __url)),
64
64
  follow: data.outgoing.follow.map((req) => new OutgoingRequest(req, __session, __url))
65
65
  };
66
66
  this.incoming = {
67
- child: data.incoming.child.map((req) => new IncomingRequest(req, __session, __url)),
67
+ children: data.incoming.children.map((req) => new IncomingRequest(req, __session, __url)),
68
68
  follow: data.incoming.follow.map((req) => new IncomingRequest(req, __session, __url))
69
69
  };
70
70
  this.unread = data.unread;
@@ -34,11 +34,11 @@ export type RawPendingRequest = {
34
34
  export type RawInbox = {
35
35
  id: string;
36
36
  outgoing: {
37
- child: RawPendingRequest[];
37
+ children: RawPendingRequest[];
38
38
  follow: RawPendingRequest[];
39
39
  };
40
40
  incoming: {
41
- child: RawPendingRequest[];
41
+ children: RawPendingRequest[];
42
42
  follow: RawPendingRequest[];
43
43
  };
44
44
  unread: Notification[];
@@ -123,7 +123,7 @@ export class User {
123
123
  if (res.status == 200) {
124
124
  this.followers += 1;
125
125
  }
126
- else if (res.status == 206) {
126
+ else if (res.status == 202) {
127
127
  (_a = this.__session) === null || _a === void 0 ? void 0 : _a.relations.outgoing.push(this.id);
128
128
  }
129
129
  return;
@@ -156,7 +156,9 @@ export class User {
156
156
  const res = yield axios.post(this.__url + `/unfollow`, {}, {
157
157
  withCredentials: true,
158
158
  });
159
- this.followers -= 1;
159
+ if (res.status == 200) {
160
+ this.followers -= 1;
161
+ }
160
162
  return;
161
163
  }
162
164
  catch (err) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "beamsocial",
3
- "version": "0.19.0",
3
+ "version": "0.19.2",
4
4
  "type": "module",
5
5
  "description": "API-wrapper pour Beam",
6
6
  "main": "index.js",