@foru-ms/sdk 1.1.0 → 1.1.1

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.
Files changed (2) hide show
  1. package/README.md +90 -28
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -40,7 +40,7 @@ client.setToken('user_jwt_token');
40
40
 
41
41
  ### Threads (`client.threads`)
42
42
 
43
- * `list(params: { limit?: number; filter?: 'newest' | 'oldest'; tagId?: string; categoryId?: string; cursor?: string })`: List threads.
43
+ * `list(params: { limit?: number; filter?: 'newest' | 'oldest'; tagId?: string; cursor?: string })`: List threads.
44
44
  * `create(payload: CreateThreadPayload)`: Create a new thread.
45
45
  * `retrieve(id: string)`: Get a thread by ID.
46
46
  * `update(id: string, payload: UpdateThreadPayload)`: Update a thread.
@@ -75,32 +75,34 @@ client.setToken('user_jwt_token');
75
75
 
76
76
  ### Users (`client.users`)
77
77
 
78
- * `list(params: { query?: string; filter?: 'newest' | 'oldest'; cursor?: string })`: List users.
79
- * `retrieve(id: string)`: Get user by ID.
80
- * `create(payload: any)`: Create a user (Admin).
81
- * `update(id: string, payload: any)`: Update a user.
78
+ * `list(params?: { query?: string; filter?: 'newest' | 'oldest'; cursor?: string })`: List users.
79
+ * `retrieve(userId: string)`: Get user by ID.
80
+ * `create(payload: { username: string; email: string; password: string; displayName?: string; emailVerified?: boolean; roles?: string[]; bio?: string; signature?: string; url?: string; extendedData?: Record<string, any> })`: Create a user (Admin).
81
+ * `update(id: string, payload: { username?: string; email?: string; password?: string; displayName?: string; emailVerified?: boolean; roles?: string[]; bio?: string; signature?: string; url?: string; extendedData?: Record<string, any> })`: Update a user.
82
82
  * `delete(id: string)`: Delete a user.
83
- * `getFollowers(id: string, params: { cursor?: string })`: Get user's followers.
84
- * `getFollowing(id: string, params: { cursor?: string })`: Get who a user follows.
83
+ * `getFollowers(id: string, params?: { query?: string; cursor?: string; filter?: 'newest' | 'oldest' })`: Get user's followers.
84
+ * `getFollowing(id: string, params?: { query?: string; cursor?: string; filter?: 'newest' | 'oldest' })`: Get who a user follows.
85
85
  * `follow(id: string, followerId: string, extendedData?: any)`: Follow a user.
86
86
  * `unfollow(id: string, followerId: string)`: Unfollow a user.
87
87
 
88
+
88
89
  ### Tags (`client.tags`)
89
90
 
90
- * `list(params: { query?: string; cursor?: string })`: List tags.
91
- * `create(payload: { name: string; description?: string; color?: string; extendedData?: any })`: Create a tag.
91
+ * `list(params?: { query?: string; cursor?: string })`: List tags.
92
+ * `create(payload: { name: string; description?: string; color?: string; extendedData?: Record<string, any> })`: Create a tag.
92
93
  * `retrieve(id: string, params?: { userId?: string })`: Get a tag.
93
- * `update(id: string, payload: any)`: Update a tag.
94
+ * `update(id: string, payload: { name?: string; description?: string; color?: string; extendedData?: Record<string, any> })`: Update a tag.
94
95
  * `delete(id: string)`: Delete a tag.
95
96
  * `subscribe(id: string, userId: string)`: Subscribe to a tag.
96
97
  * `unsubscribe(id: string, userId: string)`: Unsubscribe from a tag.
97
- * `listSubscribed(params: { userId: string; cursor?: string })`: List tags a user is subscribed to.
98
+ * `listSubscribed(params: { userId: string; query?: string; cursor?: string })`: List tags a user is subscribed to.
99
+
98
100
 
99
101
  ### Notifications (`client.notifications`)
100
102
 
101
- * `list(params: { userId: string; read?: boolean; filter?: string; cursor?: string })`: List notifications.
102
- * `markAllAsRead(userId: string, read?: boolean)`: Bulk update read status.
103
- * `create(payload: any)`: Create a notification manually.
103
+ * `list(params: { userId: string; read?: boolean; filter?: 'newest' | 'oldest'; cursor?: string })`: List notifications.
104
+ * `markAllAsRead(userId: string, read?: boolean)`: Bulk update read status. Default is `true`.
105
+ * `create(payload: { threadId?: string; postId?: string; privateMessageId?: string; notifierId: string; notifiedId: string; type: string; description?: string; extendedData?: Record<string, any> })`: Create a notification manually.
104
106
  * `retrieve(id: string)`: Get a notification.
105
107
  * `update(id: string, payload: { read: boolean })`: Update a notification.
106
108
  * `delete(id: string)`: Delete a notification.
@@ -125,50 +127,110 @@ client.setToken('user_jwt_token');
125
127
  ### Integrations (`client.integrations`)
126
128
 
127
129
  * `list()`: Get all configured integrations.
128
- * `create(payload: { type: string; name: string; config: any })`: Configure an integration (Slack, Discord, etc.).
130
+ * `create(payload: { type: 'SLACK' | 'DISCORD' | 'SALESFORCE' | 'HUBSPOT' | 'OKTA' | 'AUTH0'; name: string; config: any })`: Configure an integration (Slack, Discord, etc.).
129
131
  * `retrieve(id: string)`: Get integration details.
130
132
  * `delete(id: string)`: Remove an integration.
131
133
 
132
134
  ### Private Messages (`client.privateMessages`)
133
135
 
134
- * `list(params: { userId?: string; cursor?: string })`: List private messages.
135
- * `create(payload: { title?: string; body: string; recipientId: string; senderId?: string })`: Send a direct message.
136
+ * `list(params?: { query?: string; userId?: string; filter?: 'newest' | 'oldest'; cursor?: string })`: List private messages.
137
+ * `create(payload: { title?: string; body: string; recipientId: string; senderId?: string; extendedData?: Record<string, any> })`: Send a direct message.
136
138
  * `retrieve(id: string)`: Get a message thread.
137
- * `reply(id: string, payload: { body: string; senderId: string; recipientId: string })`: Reply to a message.
139
+ * `reply(id: string, payload: { body: string; senderId: string; recipientId: string; extendedData?: Record<string, any> })`: Reply to a message.
138
140
  * `delete(id: string)`: Delete a message.
139
141
 
140
142
  ### Reports (`client.reports`)
141
143
 
142
- * `list(params: { reporterId?: string; reportedId?: string; read?: boolean; cursor?: string })`: List reports.
143
- * `create(payload: { reporterId: string; type: string; description?: string; ... })`: Submit a report.
144
+ * `list(params?: { reporterId?: string; reportedId?: string; read?: boolean; cursor?: string; filter?: 'newest' | 'oldest' })`: List reports.
145
+ * `create(payload: { reporterId: string; reportedId?: string; threadId?: string; postId?: string; privateMessageId?: string; type?: string; description?: string; extendedData?: Record<string, any> })`: Submit a report.
144
146
  * `batchUpdate(payload: { reportIds: string[]; read: boolean })`: Bulk update status.
145
147
  * `retrieve(id: string)`: Get a report.
146
- * `update(id: string, payload: any)`: Update report details.
148
+ * `update(id: string, payload: { threadId?: string; postId?: string; privateMessageId?: string; reportedId?: string; reporterId?: string; type?: string; description?: string; read?: boolean; extendedData?: Record<string, any> })`: Update report details.
147
149
  * `delete(id: string)`: Delete a report.
148
150
  * `updateStatus(id: string, read: boolean)`: Update read status of a report.
149
151
 
150
152
  ### Roles (`client.roles`)
151
153
 
152
- * `list(params: { cursor?: string })`: List user roles.
153
- * `create(payload: { name: string; description?: string; color?: string })`: Create a new role.
154
+ * `list(params?: { filter?: 'newest' | 'oldest'; cursor?: string })`: List user roles.
155
+ * `create(payload: { name: string; description?: string; color?: string; extendedData?: Record<string, any> })`: Create a new role.
154
156
  * `retrieve(id: string)`: Get a role.
155
- * `update(id: string, payload: any)`: Update a role.
157
+ * `update(id: string, payload: { name?: string; description?: string; color?: string; extendedData?: Record<string, any> })`: Update a role.
156
158
  * `delete(id: string)`: Delete a role.
157
159
 
158
160
  ### SSO (`client.sso`)
159
161
 
160
162
  * `list()`: List SSO providers.
161
- * `create(payload: { provider: string; domain: string; config: any })`: Configure SSO.
163
+ * `create(payload: { provider: 'OKTA' | 'AUTH0' | 'SAML'; domain: string; config: any })`: Configure SSO.
162
164
  * `delete(id: string)`: Remove SSO provider.
163
165
 
164
166
  ## Types
165
167
 
166
- Import interfaces directly from the package:
168
+ Import all available interfaces and types directly from the package:
167
169
 
168
170
  ```typescript
169
171
  import {
170
- Thread, Post, User, Tag, Notification,
171
- LoginResponse, RegisterPayload
172
+ // Auth Types
173
+ RegisterPayload,
174
+ User,
175
+ LoginResponse,
176
+
177
+ // Thread Types
178
+ Thread,
179
+ CreateThreadPayload,
180
+ UpdateThreadPayload,
181
+ ThreadListResponse,
182
+ ThreadFilter,
183
+
184
+ // Post Types
185
+ Post,
186
+ CreatePostPayload,
187
+ UpdatePostPayload,
188
+ PostListResponse,
189
+
190
+ // Tag Types
191
+ Tag,
192
+ TagListResponse,
193
+
194
+ // User Types
195
+ UserListResponse,
196
+
197
+ // Notification Types
198
+ Notification,
199
+ NotificationListResponse,
200
+
201
+ // Search Types
202
+ SearchResponse,
203
+
204
+ // Webhook Types
205
+ Webhook,
206
+ WebhookListResponse,
207
+
208
+ // Stats Types
209
+ StatsResponse,
210
+
211
+ // Integration Types
212
+ Integration,
213
+ IntegrationListResponse,
214
+
215
+ // Private Message Types
216
+ PrivateMessage,
217
+ PrivateMessageListResponse,
218
+
219
+ // Report Types
220
+ Report,
221
+ ReportListResponse,
222
+
223
+ // Role Types
224
+ Role,
225
+ RoleListResponse,
226
+
227
+ // SSO Types
228
+ SSOProvider,
229
+ SSOProviderListResponse,
230
+
231
+ // Utility Types
232
+ PaginatedResponse,
233
+ InteractionType
172
234
  } from '@foru-ms/sdk';
173
235
  ```
174
236
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@foru-ms/sdk",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "JavaScript SDK for Foru.ms",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",