@foru-ms/sdk 1.2.6 → 1.2.7

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/README.md CHANGED
@@ -552,6 +552,9 @@ We welcome contributions! Please see our contributing guidelines for more inform
552
552
 
553
553
  ## Changelog
554
554
 
555
+ ### v1.2.7
556
+ - Fixed issue with optional parameters not being optional in typescript
557
+
555
558
  ### v1.2.6
556
559
  - Fixed issue with optional parameters not being optional in typescript
557
560
 
@@ -59,8 +59,8 @@ export declare class UsersResource {
59
59
  nextUserCursor?: string;
60
60
  count: number;
61
61
  }>;
62
- follow(id: string, followerId: string, extendedData?: any): Promise<any>;
63
- unfollow(id: string, followerId: string): Promise<any>;
62
+ follow(id: string, followerId?: string, extendedData?: any): Promise<any>;
63
+ unfollow(id: string, followerId?: string): Promise<any>;
64
64
  getFollowing(id: string, params?: {
65
65
  query?: string;
66
66
  cursor?: string;
@@ -86,8 +86,9 @@ class UsersResource {
86
86
  });
87
87
  }
88
88
  async unfollow(id, followerId) {
89
- return this.client.request(`/user/${id}/followers?followerId=${followerId}`, {
89
+ return this.client.request(`/user/${id}/followers`, {
90
90
  method: 'DELETE',
91
+ body: JSON.stringify({ followerId }),
91
92
  });
92
93
  }
93
94
  async getFollowing(id, params) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@foru-ms/sdk",
3
- "version": "1.2.6",
3
+ "version": "1.2.7",
4
4
  "description": "JavaScript SDK for Foru.ms",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -133,16 +133,17 @@ export class UsersResource {
133
133
  });
134
134
  }
135
135
 
136
- async follow(id: string, followerId: string, extendedData?: any): Promise<any> {
136
+ async follow(id: string, followerId?: string, extendedData?: any): Promise<any> {
137
137
  return this.client.request(`/user/${id}/followers`, {
138
138
  method: 'POST',
139
139
  body: JSON.stringify({ followerId, extendedData }),
140
140
  });
141
141
  }
142
142
 
143
- async unfollow(id: string, followerId: string): Promise<any> {
144
- return this.client.request(`/user/${id}/followers?followerId=${followerId}`, {
143
+ async unfollow(id: string, followerId?: string): Promise<any> {
144
+ return this.client.request(`/user/${id}/followers`, {
145
145
  method: 'DELETE',
146
+ body: JSON.stringify({ followerId }),
146
147
  });
147
148
  }
148
149