@doist/comms-sdk 0.1.0-alpha.1 → 0.2.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 (67) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/clients/add-comment-helper.js +18 -2
  3. package/dist/cjs/clients/base-client.js +11 -5
  4. package/dist/cjs/clients/channels-client.js +142 -14
  5. package/dist/cjs/clients/comments-client.js +99 -14
  6. package/dist/cjs/clients/conversation-messages-client.js +91 -9
  7. package/dist/cjs/clients/conversations-client.js +166 -15
  8. package/dist/cjs/clients/groups-client.js +98 -5
  9. package/dist/cjs/clients/inbox-client.js +102 -16
  10. package/dist/cjs/clients/reactions-client.js +40 -2
  11. package/dist/cjs/clients/search-client.js +50 -0
  12. package/dist/cjs/clients/threads-client.js +238 -24
  13. package/dist/cjs/clients/users-client.js +138 -11
  14. package/dist/cjs/clients/workspace-users-client.js +110 -10
  15. package/dist/cjs/clients/workspaces-client.js +89 -8
  16. package/dist/cjs/comms-api.js +1 -0
  17. package/dist/cjs/consts/endpoints.js +8 -3
  18. package/dist/cjs/testUtils/test-defaults.js +3 -1
  19. package/dist/cjs/types/api-version.js +8 -0
  20. package/dist/cjs/types/entities.js +119 -98
  21. package/dist/cjs/types/index.js +1 -0
  22. package/dist/cjs/types/requests.js +0 -1
  23. package/dist/cjs/utils/url-helpers.js +3 -1
  24. package/dist/esm/clients/add-comment-helper.js +18 -2
  25. package/dist/esm/clients/base-client.js +11 -5
  26. package/dist/esm/clients/channels-client.js +143 -15
  27. package/dist/esm/clients/comments-client.js +100 -15
  28. package/dist/esm/clients/conversation-messages-client.js +92 -10
  29. package/dist/esm/clients/conversations-client.js +167 -16
  30. package/dist/esm/clients/groups-client.js +98 -5
  31. package/dist/esm/clients/inbox-client.js +102 -16
  32. package/dist/esm/clients/reactions-client.js +40 -2
  33. package/dist/esm/clients/search-client.js +50 -0
  34. package/dist/esm/clients/threads-client.js +239 -25
  35. package/dist/esm/clients/users-client.js +138 -11
  36. package/dist/esm/clients/workspace-users-client.js +110 -10
  37. package/dist/esm/clients/workspaces-client.js +90 -9
  38. package/dist/esm/comms-api.js +1 -0
  39. package/dist/esm/consts/endpoints.js +8 -3
  40. package/dist/esm/testUtils/test-defaults.js +2 -0
  41. package/dist/esm/types/api-version.js +5 -0
  42. package/dist/esm/types/entities.js +111 -97
  43. package/dist/esm/types/index.js +1 -0
  44. package/dist/esm/types/requests.js +0 -1
  45. package/dist/esm/utils/url-helpers.js +3 -1
  46. package/dist/types/clients/add-comment-helper.d.ts +20 -1
  47. package/dist/types/clients/base-client.d.ts +10 -0
  48. package/dist/types/clients/channels-client.d.ts +126 -6
  49. package/dist/types/clients/comments-client.d.ts +77 -6
  50. package/dist/types/clients/conversation-messages-client.d.ts +79 -5
  51. package/dist/types/clients/conversations-client.d.ts +146 -3
  52. package/dist/types/clients/groups-client.d.ts +98 -5
  53. package/dist/types/clients/inbox-client.d.ts +463 -5
  54. package/dist/types/clients/reactions-client.d.ts +40 -2
  55. package/dist/types/clients/search-client.d.ts +50 -0
  56. package/dist/types/clients/threads-client.d.ts +204 -8
  57. package/dist/types/clients/users-client.d.ts +138 -11
  58. package/dist/types/clients/workspace-users-client.d.ts +110 -10
  59. package/dist/types/clients/workspaces-client.d.ts +82 -7
  60. package/dist/types/comms-api.d.ts +3 -0
  61. package/dist/types/consts/endpoints.d.ts +6 -1
  62. package/dist/types/testUtils/test-defaults.d.ts +1 -0
  63. package/dist/types/types/api-version.d.ts +6 -0
  64. package/dist/types/types/entities.d.ts +1654 -126
  65. package/dist/types/types/index.d.ts +1 -0
  66. package/dist/types/types/requests.d.ts +2 -21
  67. package/package.json +1 -1
@@ -20,14 +20,51 @@ export declare const GroupListSchema: z.ZodArray<z.ZodObject<{
20
20
  * `workspace_id` alongside the group `id`.
21
21
  */
22
22
  export declare class GroupsClient extends BaseClient {
23
- /** Lists groups in a workspace. */
23
+ /**
24
+ * Gets all groups for a given workspace.
25
+ *
26
+ * @param workspaceId - The workspace ID.
27
+ * @returns An array of group objects.
28
+ *
29
+ * @example
30
+ * ```typescript
31
+ * const groups = await api.groups.getGroups(123)
32
+ * groups.forEach(g => console.log(g.name))
33
+ * ```
34
+ */
24
35
  getGroups(workspaceId: number): Promise<Group[]>;
25
- /** Fetches a single group by ID (requires `workspaceId`). */
36
+ /**
37
+ * Gets a single group object by id. Requires `workspaceId`.
38
+ *
39
+ * @param args - The arguments for getting a group.
40
+ * @param args.id - The group ID.
41
+ * @param args.workspaceId - The workspace ID.
42
+ * @returns The group object.
43
+ */
26
44
  getGroup(args: {
27
45
  id: string;
28
46
  workspaceId: number;
29
47
  }): Promise<Group>;
30
- /** Creates a new group. `id` is auto-generated if not supplied. */
48
+ /**
49
+ * Creates a new group. `id` is auto-generated if not supplied.
50
+ *
51
+ * @param args - The arguments for creating a group.
52
+ * @param args.workspaceId - The workspace ID.
53
+ * @param args.name - The group name.
54
+ * @param args.id - Optional caller-supplied group ID (for optimistic-UI workflows).
55
+ * @param args.description - Optional group description.
56
+ * @param args.userIds - Optional array of user IDs to add to the group.
57
+ * @returns The created group object.
58
+ *
59
+ * @example
60
+ * ```typescript
61
+ * const group = await api.groups.createGroup({
62
+ * workspaceId: 123,
63
+ * name: 'Engineering Team',
64
+ * userIds: [1, 2, 3],
65
+ * })
66
+ * ```
67
+ */
31
68
  createGroup(args: {
32
69
  workspaceId: number;
33
70
  name: string;
@@ -35,21 +72,77 @@ export declare class GroupsClient extends BaseClient {
35
72
  description?: string;
36
73
  userIds?: number[];
37
74
  }): Promise<Group>;
38
- /** Updates a group. Requires `workspaceId`. */
75
+ /**
76
+ * Updates a group's properties. Requires `workspaceId`.
77
+ *
78
+ * @param args - The arguments for updating a group.
79
+ * @param args.id - The group ID.
80
+ * @param args.workspaceId - The workspace ID.
81
+ * @param args.name - Optional new group name.
82
+ * @param args.description - Optional new group description.
83
+ * @returns The updated group object.
84
+ */
39
85
  updateGroup(args: {
40
86
  id: string;
41
87
  workspaceId: number;
42
88
  name?: string;
43
89
  description?: string;
44
90
  }): Promise<Group>;
45
- /** Permanently deletes a group. Requires `workspaceId`. */
91
+ /**
92
+ * Permanently deletes a group. Requires `workspaceId`.
93
+ *
94
+ * @param args - The arguments for deleting a group.
95
+ * @param args.id - The group ID.
96
+ * @param args.workspaceId - The workspace ID.
97
+ */
46
98
  deleteGroup(args: {
47
99
  id: string;
48
100
  workspaceId: number;
49
101
  }): Promise<StatusOk>;
102
+ /**
103
+ * Adds a user to a group.
104
+ *
105
+ * @param args - The arguments for adding a user.
106
+ * @param args.id - The group ID.
107
+ * @param args.workspaceId - The workspace ID.
108
+ * @param args.userId - The user ID to add.
109
+ */
50
110
  addUser(args: AddGroupUserArgs): Promise<StatusOk>;
111
+ /**
112
+ * Adds multiple users to a group.
113
+ *
114
+ * @param args - The arguments for adding users.
115
+ * @param args.id - The group ID.
116
+ * @param args.workspaceId - The workspace ID.
117
+ * @param args.userIds - Array of user IDs to add.
118
+ *
119
+ * @example
120
+ * ```typescript
121
+ * await api.groups.addUsers({
122
+ * id: '7YpL3oZ4kZ9vP7Q1tR2sX45',
123
+ * workspaceId: 123,
124
+ * userIds: [101, 202, 303],
125
+ * })
126
+ * ```
127
+ */
51
128
  addUsers(args: AddGroupUsersArgs): Promise<StatusOk>;
129
+ /**
130
+ * Removes a user from a group.
131
+ *
132
+ * @param args - The arguments for removing a user.
133
+ * @param args.id - The group ID.
134
+ * @param args.workspaceId - The workspace ID.
135
+ * @param args.userId - The user ID to remove.
136
+ */
52
137
  removeUser(args: RemoveGroupUserArgs): Promise<StatusOk>;
138
+ /**
139
+ * Removes multiple users from a group.
140
+ *
141
+ * @param args - The arguments for removing users.
142
+ * @param args.id - The group ID.
143
+ * @param args.workspaceId - The workspace ID.
144
+ * @param args.userIds - Array of user IDs to remove.
145
+ */
53
146
  removeUsers(args: RemoveGroupUsersArgs): Promise<StatusOk>;
54
147
  private simple;
55
148
  }
@@ -1,20 +1,478 @@
1
+ import { z } from 'zod';
1
2
  import { type InboxThread } from '../types/entities.js';
2
3
  import type { ArchiveAllArgs, GetInboxArgs } from '../types/requests.js';
3
4
  import { BaseClient } from './base-client.js';
5
+ export declare const InboxThreadListSchema: z.ZodArray<z.ZodPipe<z.ZodObject<{
6
+ id: z.ZodString;
7
+ title: z.ZodString;
8
+ content: z.ZodString;
9
+ creator: z.ZodNumber;
10
+ creatorName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
11
+ channelId: z.ZodString;
12
+ workspaceId: z.ZodNumber;
13
+ actions: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodUnknown>>>;
14
+ attachments: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
15
+ attachmentId: z.ZodString;
16
+ urlType: z.ZodString;
17
+ title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
18
+ url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
19
+ fileName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
20
+ fileSize: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
21
+ underlyingType: z.ZodOptional<z.ZodNullable<z.ZodString>>;
22
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
23
+ image: z.ZodOptional<z.ZodNullable<z.ZodString>>;
24
+ imageWidth: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
25
+ imageHeight: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
26
+ duration: z.ZodOptional<z.ZodNullable<z.ZodString>>;
27
+ uploadState: z.ZodOptional<z.ZodNullable<z.ZodString>>;
28
+ video: z.ZodOptional<z.ZodNullable<z.ZodString>>;
29
+ videoType: z.ZodOptional<z.ZodNullable<z.ZodString>>;
30
+ videoAutoPlay: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
31
+ }, z.core.$loose>>>>;
32
+ commentCount: z.ZodNumber;
33
+ directGroupMentions: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
34
+ directMentions: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber>>>;
35
+ groups: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
36
+ lastEdited: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
37
+ lastObjIndex: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
38
+ lastUpdated: z.ZodDate;
39
+ mutedUntil: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
40
+ participants: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber>>>;
41
+ pinned: z.ZodOptional<z.ZodBoolean>;
42
+ pinnedTs: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
43
+ posted: z.ZodDate;
44
+ reactions: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodNumber>>>>;
45
+ recipients: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber>>>;
46
+ snippet: z.ZodString;
47
+ snippetCreator: z.ZodNumber;
48
+ snippetMaskAvatarUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
49
+ snippetMaskPoster: z.ZodOptional<z.ZodNullable<z.ZodString>>;
50
+ systemMessage: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodUnknown]>>>;
51
+ isArchived: z.ZodBoolean;
52
+ inInbox: z.ZodBoolean;
53
+ isSaved: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
54
+ closed: z.ZodBoolean;
55
+ responders: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber>>>;
56
+ lastComment: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodObject<{
57
+ id: z.ZodString;
58
+ content: z.ZodString;
59
+ creator: z.ZodNumber;
60
+ threadId: z.ZodString;
61
+ workspaceId: z.ZodNumber;
62
+ conversationId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
63
+ posted: z.ZodDate;
64
+ lastEdited: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
65
+ directMentions: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber>>>;
66
+ directGroupMentions: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
67
+ systemMessage: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodUnknown]>>>;
68
+ attachments: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
69
+ attachmentId: z.ZodString;
70
+ urlType: z.ZodString;
71
+ title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
72
+ url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
73
+ fileName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
74
+ fileSize: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
75
+ underlyingType: z.ZodOptional<z.ZodNullable<z.ZodString>>;
76
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
77
+ image: z.ZodOptional<z.ZodNullable<z.ZodString>>;
78
+ imageWidth: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
79
+ imageHeight: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
80
+ duration: z.ZodOptional<z.ZodNullable<z.ZodString>>;
81
+ uploadState: z.ZodOptional<z.ZodNullable<z.ZodString>>;
82
+ video: z.ZodOptional<z.ZodNullable<z.ZodString>>;
83
+ videoType: z.ZodOptional<z.ZodNullable<z.ZodString>>;
84
+ videoAutoPlay: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
85
+ }, z.core.$loose>>>>;
86
+ reactions: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
87
+ objIndex: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
88
+ creatorName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
89
+ channelId: z.ZodString;
90
+ recipients: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber>>>;
91
+ groups: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
92
+ toEmails: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
93
+ deleted: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
94
+ deletedBy: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
95
+ version: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
96
+ actions: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodUnknown>>>;
97
+ }, z.core.$strip>, z.ZodTransform<{
98
+ url: string;
99
+ id: string;
100
+ content: string;
101
+ creator: number;
102
+ threadId: string;
103
+ workspaceId: number;
104
+ posted: Date;
105
+ channelId: string;
106
+ conversationId?: string | null | undefined;
107
+ lastEdited?: Date | null | undefined;
108
+ directMentions?: number[] | null | undefined;
109
+ directGroupMentions?: string[] | null | undefined;
110
+ systemMessage?: unknown;
111
+ attachments?: {
112
+ [x: string]: unknown;
113
+ attachmentId: string;
114
+ urlType: string;
115
+ title?: string | null | undefined;
116
+ url?: string | null | undefined;
117
+ fileName?: string | null | undefined;
118
+ fileSize?: number | null | undefined;
119
+ underlyingType?: string | null | undefined;
120
+ description?: string | null | undefined;
121
+ image?: string | null | undefined;
122
+ imageWidth?: number | null | undefined;
123
+ imageHeight?: number | null | undefined;
124
+ duration?: string | null | undefined;
125
+ uploadState?: string | null | undefined;
126
+ video?: string | null | undefined;
127
+ videoType?: string | null | undefined;
128
+ videoAutoPlay?: boolean | null | undefined;
129
+ }[] | null | undefined;
130
+ reactions?: Record<string, unknown> | null | undefined;
131
+ objIndex?: number | null | undefined;
132
+ creatorName?: string | null | undefined;
133
+ recipients?: number[] | null | undefined;
134
+ groups?: string[] | null | undefined;
135
+ toEmails?: string[] | null | undefined;
136
+ deleted?: boolean | null | undefined;
137
+ deletedBy?: number | null | undefined;
138
+ version?: number | null | undefined;
139
+ actions?: unknown[] | null | undefined;
140
+ }, {
141
+ id: string;
142
+ content: string;
143
+ creator: number;
144
+ threadId: string;
145
+ workspaceId: number;
146
+ posted: Date;
147
+ channelId: string;
148
+ conversationId?: string | null | undefined;
149
+ lastEdited?: Date | null | undefined;
150
+ directMentions?: number[] | null | undefined;
151
+ directGroupMentions?: string[] | null | undefined;
152
+ systemMessage?: unknown;
153
+ attachments?: {
154
+ [x: string]: unknown;
155
+ attachmentId: string;
156
+ urlType: string;
157
+ title?: string | null | undefined;
158
+ url?: string | null | undefined;
159
+ fileName?: string | null | undefined;
160
+ fileSize?: number | null | undefined;
161
+ underlyingType?: string | null | undefined;
162
+ description?: string | null | undefined;
163
+ image?: string | null | undefined;
164
+ imageWidth?: number | null | undefined;
165
+ imageHeight?: number | null | undefined;
166
+ duration?: string | null | undefined;
167
+ uploadState?: string | null | undefined;
168
+ video?: string | null | undefined;
169
+ videoType?: string | null | undefined;
170
+ videoAutoPlay?: boolean | null | undefined;
171
+ }[] | null | undefined;
172
+ reactions?: Record<string, unknown> | null | undefined;
173
+ objIndex?: number | null | undefined;
174
+ creatorName?: string | null | undefined;
175
+ recipients?: number[] | null | undefined;
176
+ groups?: string[] | null | undefined;
177
+ toEmails?: string[] | null | undefined;
178
+ deleted?: boolean | null | undefined;
179
+ deletedBy?: number | null | undefined;
180
+ version?: number | null | undefined;
181
+ actions?: unknown[] | null | undefined;
182
+ }>>>>;
183
+ toEmails: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
184
+ version: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
185
+ }, z.core.$strip>, z.ZodTransform<{
186
+ url: string;
187
+ id: string;
188
+ title: string;
189
+ content: string;
190
+ creator: number;
191
+ channelId: string;
192
+ workspaceId: number;
193
+ commentCount: number;
194
+ lastUpdated: Date;
195
+ posted: Date;
196
+ snippet: string;
197
+ snippetCreator: number;
198
+ isArchived: boolean;
199
+ inInbox: boolean;
200
+ closed: boolean;
201
+ creatorName?: string | null | undefined;
202
+ actions?: unknown[] | null | undefined;
203
+ attachments?: {
204
+ [x: string]: unknown;
205
+ attachmentId: string;
206
+ urlType: string;
207
+ title?: string | null | undefined;
208
+ url?: string | null | undefined;
209
+ fileName?: string | null | undefined;
210
+ fileSize?: number | null | undefined;
211
+ underlyingType?: string | null | undefined;
212
+ description?: string | null | undefined;
213
+ image?: string | null | undefined;
214
+ imageWidth?: number | null | undefined;
215
+ imageHeight?: number | null | undefined;
216
+ duration?: string | null | undefined;
217
+ uploadState?: string | null | undefined;
218
+ video?: string | null | undefined;
219
+ videoType?: string | null | undefined;
220
+ videoAutoPlay?: boolean | null | undefined;
221
+ }[] | null | undefined;
222
+ directGroupMentions?: string[] | null | undefined;
223
+ directMentions?: number[] | null | undefined;
224
+ groups?: string[] | null | undefined;
225
+ lastEdited?: Date | null | undefined;
226
+ lastObjIndex?: number | null | undefined;
227
+ mutedUntil?: Date | null | undefined;
228
+ participants?: number[] | null | undefined;
229
+ pinned?: boolean | undefined;
230
+ pinnedTs?: number | null | undefined;
231
+ reactions?: Record<string, number[]> | null | undefined;
232
+ recipients?: number[] | null | undefined;
233
+ snippetMaskAvatarUrl?: string | null | undefined;
234
+ snippetMaskPoster?: string | null | undefined;
235
+ systemMessage?: unknown;
236
+ isSaved?: boolean | null | undefined;
237
+ responders?: number[] | null | undefined;
238
+ lastComment?: {
239
+ url: string;
240
+ id: string;
241
+ content: string;
242
+ creator: number;
243
+ threadId: string;
244
+ workspaceId: number;
245
+ posted: Date;
246
+ channelId: string;
247
+ conversationId?: string | null | undefined;
248
+ lastEdited?: Date | null | undefined;
249
+ directMentions?: number[] | null | undefined;
250
+ directGroupMentions?: string[] | null | undefined;
251
+ systemMessage?: unknown;
252
+ attachments?: {
253
+ [x: string]: unknown;
254
+ attachmentId: string;
255
+ urlType: string;
256
+ title?: string | null | undefined;
257
+ url?: string | null | undefined;
258
+ fileName?: string | null | undefined;
259
+ fileSize?: number | null | undefined;
260
+ underlyingType?: string | null | undefined;
261
+ description?: string | null | undefined;
262
+ image?: string | null | undefined;
263
+ imageWidth?: number | null | undefined;
264
+ imageHeight?: number | null | undefined;
265
+ duration?: string | null | undefined;
266
+ uploadState?: string | null | undefined;
267
+ video?: string | null | undefined;
268
+ videoType?: string | null | undefined;
269
+ videoAutoPlay?: boolean | null | undefined;
270
+ }[] | null | undefined;
271
+ reactions?: Record<string, unknown> | null | undefined;
272
+ objIndex?: number | null | undefined;
273
+ creatorName?: string | null | undefined;
274
+ recipients?: number[] | null | undefined;
275
+ groups?: string[] | null | undefined;
276
+ toEmails?: string[] | null | undefined;
277
+ deleted?: boolean | null | undefined;
278
+ deletedBy?: number | null | undefined;
279
+ version?: number | null | undefined;
280
+ actions?: unknown[] | null | undefined;
281
+ } | null | undefined;
282
+ toEmails?: string[] | null | undefined;
283
+ version?: number | null | undefined;
284
+ }, {
285
+ id: string;
286
+ title: string;
287
+ content: string;
288
+ creator: number;
289
+ channelId: string;
290
+ workspaceId: number;
291
+ commentCount: number;
292
+ lastUpdated: Date;
293
+ posted: Date;
294
+ snippet: string;
295
+ snippetCreator: number;
296
+ isArchived: boolean;
297
+ inInbox: boolean;
298
+ closed: boolean;
299
+ creatorName?: string | null | undefined;
300
+ actions?: unknown[] | null | undefined;
301
+ attachments?: {
302
+ [x: string]: unknown;
303
+ attachmentId: string;
304
+ urlType: string;
305
+ title?: string | null | undefined;
306
+ url?: string | null | undefined;
307
+ fileName?: string | null | undefined;
308
+ fileSize?: number | null | undefined;
309
+ underlyingType?: string | null | undefined;
310
+ description?: string | null | undefined;
311
+ image?: string | null | undefined;
312
+ imageWidth?: number | null | undefined;
313
+ imageHeight?: number | null | undefined;
314
+ duration?: string | null | undefined;
315
+ uploadState?: string | null | undefined;
316
+ video?: string | null | undefined;
317
+ videoType?: string | null | undefined;
318
+ videoAutoPlay?: boolean | null | undefined;
319
+ }[] | null | undefined;
320
+ directGroupMentions?: string[] | null | undefined;
321
+ directMentions?: number[] | null | undefined;
322
+ groups?: string[] | null | undefined;
323
+ lastEdited?: Date | null | undefined;
324
+ lastObjIndex?: number | null | undefined;
325
+ mutedUntil?: Date | null | undefined;
326
+ participants?: number[] | null | undefined;
327
+ pinned?: boolean | undefined;
328
+ pinnedTs?: number | null | undefined;
329
+ reactions?: Record<string, number[]> | null | undefined;
330
+ recipients?: number[] | null | undefined;
331
+ snippetMaskAvatarUrl?: string | null | undefined;
332
+ snippetMaskPoster?: string | null | undefined;
333
+ systemMessage?: unknown;
334
+ isSaved?: boolean | null | undefined;
335
+ responders?: number[] | null | undefined;
336
+ lastComment?: {
337
+ url: string;
338
+ id: string;
339
+ content: string;
340
+ creator: number;
341
+ threadId: string;
342
+ workspaceId: number;
343
+ posted: Date;
344
+ channelId: string;
345
+ conversationId?: string | null | undefined;
346
+ lastEdited?: Date | null | undefined;
347
+ directMentions?: number[] | null | undefined;
348
+ directGroupMentions?: string[] | null | undefined;
349
+ systemMessage?: unknown;
350
+ attachments?: {
351
+ [x: string]: unknown;
352
+ attachmentId: string;
353
+ urlType: string;
354
+ title?: string | null | undefined;
355
+ url?: string | null | undefined;
356
+ fileName?: string | null | undefined;
357
+ fileSize?: number | null | undefined;
358
+ underlyingType?: string | null | undefined;
359
+ description?: string | null | undefined;
360
+ image?: string | null | undefined;
361
+ imageWidth?: number | null | undefined;
362
+ imageHeight?: number | null | undefined;
363
+ duration?: string | null | undefined;
364
+ uploadState?: string | null | undefined;
365
+ video?: string | null | undefined;
366
+ videoType?: string | null | undefined;
367
+ videoAutoPlay?: boolean | null | undefined;
368
+ }[] | null | undefined;
369
+ reactions?: Record<string, unknown> | null | undefined;
370
+ objIndex?: number | null | undefined;
371
+ creatorName?: string | null | undefined;
372
+ recipients?: number[] | null | undefined;
373
+ groups?: string[] | null | undefined;
374
+ toEmails?: string[] | null | undefined;
375
+ deleted?: boolean | null | undefined;
376
+ deletedBy?: number | null | undefined;
377
+ version?: number | null | undefined;
378
+ actions?: unknown[] | null | undefined;
379
+ } | null | undefined;
380
+ toEmails?: string[] | null | undefined;
381
+ version?: number | null | undefined;
382
+ }>>>;
4
383
  /** Client for `/api/v1/inbox/`. */
5
384
  export declare class InboxClient extends BaseClient {
385
+ private readonly linkBaseUrl;
386
+ private readonly inboxThreadSchema;
387
+ private readonly inboxThreadListSchema;
6
388
  /**
7
389
  * Gets inbox items (threads).
390
+ *
391
+ * @param args - The arguments for getting inbox.
392
+ * @param args.workspaceId - The workspace ID.
393
+ * @param args.newerThan - Optional date to get items newer than.
394
+ * @param args.olderThan - Optional date to get items older than.
395
+ * @param args.limit - Optional limit on number of items returned.
396
+ * @param args.cursor - Optional cursor for pagination.
397
+ * @param args.archiveFilter - Optional filter: 'active' (default), 'archived', or 'all'.
398
+ * @returns Inbox threads.
399
+ *
400
+ * @example
401
+ * ```typescript
402
+ * const inbox = await api.inbox.getInbox({
403
+ * workspaceId: 123,
404
+ * newerThan: new Date('2024-01-01'),
405
+ * })
406
+ *
407
+ * // Include archived (done) items alongside active ones
408
+ * const allInbox = await api.inbox.getInbox({
409
+ * workspaceId: 123,
410
+ * archiveFilter: 'all',
411
+ * })
412
+ * ```
8
413
  */
9
414
  getInbox(args: GetInboxArgs): Promise<InboxThread[]>;
10
- /** Gets unread count for inbox. */
415
+ /**
416
+ * Gets unread count for inbox.
417
+ *
418
+ * @param workspaceId - The workspace ID.
419
+ * @returns The unread count.
420
+ *
421
+ * @example
422
+ * ```typescript
423
+ * const count = await api.inbox.getCount(123)
424
+ * console.log(`Unread items: ${count}`)
425
+ * ```
426
+ */
11
427
  getCount(workspaceId: number): Promise<number>;
12
- /** Archives a thread in the inbox. */
428
+ /**
429
+ * Archives a thread in the inbox.
430
+ *
431
+ * @param id - The thread ID.
432
+ *
433
+ * @example
434
+ * ```typescript
435
+ * await api.inbox.archiveThread('7YpL3oZ4kZ9vP7Q1tR2sX3z')
436
+ * ```
437
+ */
13
438
  archiveThread(id: string): Promise<void>;
14
- /** Unarchives a thread in the inbox. */
439
+ /**
440
+ * Unarchives a thread in the inbox.
441
+ *
442
+ * @param id - The thread ID.
443
+ *
444
+ * @example
445
+ * ```typescript
446
+ * await api.inbox.unarchiveThread('7YpL3oZ4kZ9vP7Q1tR2sX3z')
447
+ * ```
448
+ */
15
449
  unarchiveThread(id: string): Promise<void>;
16
- /** Marks all inbox items as read in a workspace. */
450
+ /**
451
+ * Marks all inbox items as read in a workspace.
452
+ *
453
+ * @param workspaceId - The workspace ID.
454
+ *
455
+ * @example
456
+ * ```typescript
457
+ * await api.inbox.markAllRead(123)
458
+ * ```
459
+ */
17
460
  markAllRead(workspaceId: number): Promise<void>;
18
- /** Archives all inbox items in a workspace. */
461
+ /**
462
+ * Archives all inbox items in a workspace.
463
+ *
464
+ * @param args - The arguments for archiving all.
465
+ * @param args.workspaceId - The workspace ID.
466
+ * @param args.channelIds - Optional array of channel IDs to filter by.
467
+ * @param args.olderThan - Optional date to filter items older than.
468
+ *
469
+ * @example
470
+ * ```typescript
471
+ * await api.inbox.archiveAll({
472
+ * workspaceId: 123,
473
+ * olderThan: new Date('2024-01-01'),
474
+ * })
475
+ * ```
476
+ */
19
477
  archiveAll(args: ArchiveAllArgs): Promise<void>;
20
478
  }
@@ -5,15 +5,53 @@ import { BaseClient } from './base-client.js';
5
5
  * Client for interacting with Comms reaction endpoints.
6
6
  */
7
7
  export declare class ReactionsClient extends BaseClient {
8
- /** Adds an emoji reaction to a thread, comment, or conversation message. */
8
+ /**
9
+ * Adds an emoji reaction to a thread, comment, or conversation message.
10
+ *
11
+ * @param args - The arguments for adding a reaction.
12
+ * @param args.threadId - Optional thread ID.
13
+ * @param args.commentId - Optional comment ID.
14
+ * @param args.messageId - Optional message ID (for conversation messages).
15
+ * @param args.reaction - The reaction emoji to add.
16
+ *
17
+ * @example
18
+ * ```typescript
19
+ * await api.reactions.add({ threadId: '7YpL3oZ4kZ9vP7Q1tR2sX3z', reaction: '👍' })
20
+ * ```
21
+ */
9
22
  add(args: AddReactionArgs): Promise<void>;
10
23
  /**
11
24
  * Gets reactions for a thread, comment, or conversation message.
12
25
  *
13
26
  * Returns an object with emoji reactions as keys and arrays of user IDs as
14
27
  * values, or null if no reactions.
28
+ *
29
+ * @param args - The arguments for getting reactions.
30
+ * @param args.threadId - Optional thread ID.
31
+ * @param args.commentId - Optional comment ID.
32
+ * @param args.messageId - Optional message ID (for conversation messages).
33
+ * @returns A reaction object with emoji reactions as keys and arrays of user IDs as values, or null if no reactions.
34
+ *
35
+ * @example
36
+ * ```typescript
37
+ * const reactions = await api.reactions.get({ threadId: '7YpL3oZ4kZ9vP7Q1tR2sX3z' })
38
+ * // Returns: { "👍": [101, 202, 303], "❤️": [101, 202] }
39
+ * ```
15
40
  */
16
41
  get(args: GetReactionsArgs): Promise<ReactionObject>;
17
- /** Removes an emoji reaction from a thread, comment, or conversation message. */
42
+ /**
43
+ * Removes an emoji reaction from a thread, comment, or conversation message.
44
+ *
45
+ * @param args - The arguments for removing a reaction.
46
+ * @param args.threadId - Optional thread ID.
47
+ * @param args.commentId - Optional comment ID.
48
+ * @param args.messageId - Optional message ID (for conversation messages).
49
+ * @param args.reaction - The reaction emoji to remove.
50
+ *
51
+ * @example
52
+ * ```typescript
53
+ * await api.reactions.remove({ threadId: '7YpL3oZ4kZ9vP7Q1tR2sX3z', reaction: '👍' })
54
+ * ```
55
+ */
18
56
  remove(args: RemoveReactionArgs): Promise<void>;
19
57
  }