@foru-ms/sdk 1.3.1 → 1.3.3

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
@@ -304,7 +304,7 @@ Check the `/examples` directory for detailed examples:
304
304
  * `list(params?: { userId?: string; status?: string; filter?: 'newest' | 'oldest'; cursor?: string; limit?: number })`: List notifications for a user. `limit` controls page size (1-50, default: 15).
305
305
  * `create(payload: { threadId?: string; postId?: string; privateMessageId?: string; notifierId?: string; notifiedId: string; type: string; description?: string; extendedData?: Record<string, any> })`: Create a notification manually.
306
306
  * `retrieve(id: string, userId?: string)`: Get a notification by ID.
307
- * `update(id: string, payload: { userId?: string; status: string })`: Update a notification's status.
307
+ * `update(id: string, payload: { userId?: string; status?: string })`: Update a notification's status.
308
308
  * `delete(id: string, userId?: string)`: Delete a notification.
309
309
  * `markAllAsRead(userId?: string, status?: string)`: Bulk update status for all of a user's notifications. Default status is `'read'`.
310
310
 
@@ -352,8 +352,8 @@ Check the `/examples` directory for detailed examples:
352
352
  * `create(payload: { reporterId?: string; reportedId?: string; threadId?: string; postId?: string; privateMessageId?: string; type?: string; description?: string; extendedData?: Record<string, any> })`: Submit a new report.
353
353
  * `retrieve(id: string)`: Get a report by ID.
354
354
  * `update(id: string, payload: { threadId?: string; postId?: string; privateMessageId?: string; reportedId?: string; reporterId?: string; type?: string; description?: string; status?: string; extendedData?: Record<string, any> })`: Update report details (full update).
355
- * `updateStatus(id: string, status: string)`: Update status of a report (partial update).
356
- * `batchUpdate(payload: { reportIds: string[]; status: string })`: Bulk update status for multiple reports.
355
+ * `updateStatus(id: string, status?: string)`: Update status of a report (partial update).
356
+ * `batchUpdate(payload: { reportIds: string[]; status?: string })`: Bulk update status for multiple reports.
357
357
  * `delete(id: string)`: Delete a report.
358
358
 
359
359
  ### Roles (`client.roles`)
@@ -553,6 +553,14 @@ We welcome contributions! Please see our contributing guidelines for more inform
553
553
 
554
554
  ## Changelog
555
555
 
556
+ ### v1.3.3
557
+ - Added postsCount?: number and threadsCount?: number to User interface
558
+ - Added postsCount?: number and lastPostAt?: string to Thread interface
559
+ - Added tags?: string[] to UpdateThreadPayload
560
+
561
+ ### v1.3.2
562
+ - Fixed issue with optional parameters not being optional in typescript
563
+
556
564
  ### v1.3.1
557
565
  - Updated Notifications, PrivateMessages, Reports to use `status` (string) instead of `read` (boolean)
558
566
 
package/dist/types.d.ts CHANGED
@@ -14,6 +14,8 @@ export interface User {
14
14
  displayName: string | null;
15
15
  roles?: any[];
16
16
  extendedData?: Record<string, any>;
17
+ postsCount?: number;
18
+ threadsCount?: number;
17
19
  createdAt?: string;
18
20
  updatedAt?: string;
19
21
  }
@@ -25,6 +27,8 @@ export interface Thread {
25
27
  userId: string;
26
28
  locked: boolean;
27
29
  pinned: boolean;
30
+ postsCount?: number;
31
+ lastPostAt?: string;
28
32
  createdAt: string;
29
33
  updatedAt: string;
30
34
  user?: User;
@@ -64,6 +68,7 @@ export interface UpdateThreadPayload {
64
68
  userId?: string;
65
69
  locked?: boolean;
66
70
  pinned?: boolean;
71
+ tags?: string[];
67
72
  extendedData?: Record<string, any>;
68
73
  }
69
74
  export interface Post {
@@ -160,7 +165,7 @@ export interface Notification {
160
165
  notifiedId: string;
161
166
  type: string;
162
167
  description?: string;
163
- status: string;
168
+ status?: string;
164
169
  createdAt: string;
165
170
  extendedData?: Record<string, any>;
166
171
  post?: Post;
@@ -237,7 +242,7 @@ export interface PrivateMessage {
237
242
  recipientId: string;
238
243
  title?: string;
239
244
  body: string;
240
- status: string;
245
+ status?: string;
241
246
  parentId?: string;
242
247
  children?: PrivateMessage[];
243
248
  sender?: User;
@@ -260,7 +265,7 @@ export interface Report {
260
265
  privateMessageId?: string;
261
266
  type: string;
262
267
  description?: string;
263
- status: string;
268
+ status?: string;
264
269
  createdAt: string;
265
270
  post?: Post;
266
271
  thread?: Thread;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@foru-ms/sdk",
3
- "version": "1.3.1",
3
+ "version": "1.3.3",
4
4
  "description": "JavaScript SDK for Foru.ms",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/src/types.ts CHANGED
@@ -16,6 +16,8 @@ export interface User {
16
16
  displayName: string | null;
17
17
  roles?: any[]; // Refine if needed
18
18
  extendedData?: Record<string, any>;
19
+ postsCount?: number;
20
+ threadsCount?: number;
19
21
  createdAt?: string;
20
22
  updatedAt?: string;
21
23
  }
@@ -29,6 +31,8 @@ export interface Thread {
29
31
  userId: string;
30
32
  locked: boolean;
31
33
  pinned: boolean;
34
+ postsCount?: number;
35
+ lastPostAt?: string;
32
36
  createdAt: string;
33
37
  updatedAt: string;
34
38
  user?: User;
@@ -70,6 +74,7 @@ export interface UpdateThreadPayload {
70
74
  userId?: string;
71
75
  locked?: boolean;
72
76
  pinned?: boolean;
77
+ tags?: string[];
73
78
  extendedData?: Record<string, any>;
74
79
  }
75
80
 
@@ -181,7 +186,7 @@ export interface Notification {
181
186
  notifiedId: string;
182
187
  type: string;
183
188
  description?: string;
184
- status: string;
189
+ status?: string;
185
190
  createdAt: string;
186
191
  extendedData?: Record<string, any>;
187
192
  post?: Post;
@@ -264,7 +269,7 @@ export interface PrivateMessage {
264
269
  recipientId: string;
265
270
  title?: string;
266
271
  body: string;
267
- status: string;
272
+ status?: string;
268
273
  parentId?: string;
269
274
  children?: PrivateMessage[];
270
275
  sender?: User;
@@ -289,7 +294,7 @@ export interface Report {
289
294
  privateMessageId?: string;
290
295
  type: string;
291
296
  description?: string;
292
- status: string;
297
+ status?: string;
293
298
  createdAt: string;
294
299
  post?: Post;
295
300
  thread?: Thread;