@doist/twist-sdk 2.6.0 → 2.8.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 (37) hide show
  1. package/dist/cjs/clients/add-comment-helper.js +1 -2
  2. package/dist/cjs/clients/base-client.js +10 -0
  3. package/dist/cjs/clients/channels-client.js +9 -6
  4. package/dist/cjs/clients/comments-client.js +16 -6
  5. package/dist/cjs/clients/conversation-messages-client.js +9 -8
  6. package/dist/cjs/clients/conversations-client.js +11 -8
  7. package/dist/cjs/clients/inbox-client.js +6 -3
  8. package/dist/cjs/clients/threads-client.js +18 -9
  9. package/dist/cjs/clients/workspace-users-client.js +9 -2
  10. package/dist/cjs/clients/workspaces-client.js +7 -3
  11. package/dist/cjs/types/entities.js +130 -84
  12. package/dist/cjs/types/requests.js +3 -2
  13. package/dist/esm/clients/add-comment-helper.js +1 -2
  14. package/dist/esm/clients/base-client.js +10 -0
  15. package/dist/esm/clients/channels-client.js +10 -7
  16. package/dist/esm/clients/comments-client.js +17 -7
  17. package/dist/esm/clients/conversation-messages-client.js +10 -9
  18. package/dist/esm/clients/conversations-client.js +12 -9
  19. package/dist/esm/clients/inbox-client.js +7 -4
  20. package/dist/esm/clients/threads-client.js +19 -10
  21. package/dist/esm/clients/workspace-users-client.js +9 -2
  22. package/dist/esm/clients/workspaces-client.js +8 -4
  23. package/dist/esm/types/entities.js +123 -83
  24. package/dist/esm/types/requests.js +3 -2
  25. package/dist/types/clients/add-comment-helper.d.ts +3 -1
  26. package/dist/types/clients/base-client.d.ts +4 -0
  27. package/dist/types/clients/channels-client.d.ts +1 -0
  28. package/dist/types/clients/comments-client.d.ts +2 -2
  29. package/dist/types/clients/conversation-messages-client.d.ts +3 -2
  30. package/dist/types/clients/conversations-client.d.ts +1 -0
  31. package/dist/types/clients/inbox-client.d.ts +1 -0
  32. package/dist/types/clients/threads-client.d.ts +4 -4
  33. package/dist/types/clients/workspace-users-client.d.ts +5 -0
  34. package/dist/types/clients/workspaces-client.d.ts +1 -0
  35. package/dist/types/types/entities.d.ts +1845 -65
  36. package/dist/types/types/requests.d.ts +44 -4
  37. package/package.json +6 -2
@@ -6,6 +6,7 @@ import { BaseClient } from './base-client.js';
6
6
  * Client for interacting with Twist channel endpoints.
7
7
  */
8
8
  export declare class ChannelsClient extends BaseClient {
9
+ private readonly channelSchema;
9
10
  /**
10
11
  * Gets all channels for a given workspace.
11
12
  *
@@ -6,6 +6,7 @@ import { BaseClient } from './base-client.js';
6
6
  * Client for interacting with Twist comment endpoints.
7
7
  */
8
8
  export declare class CommentsClient extends BaseClient {
9
+ private readonly commentSchema;
9
10
  /**
10
11
  * Gets all comments for a thread.
11
12
  *
@@ -59,7 +60,7 @@ export declare class CommentsClient extends BaseClient {
59
60
  * @param args.notifyAudience - Optional broader audience to notify in addition to
60
61
  * `recipients` and `groups`. `'channel'` notifies everyone in the channel;
61
62
  * `'thread'` notifies everyone who has interacted with the thread.
62
- * @param args.attachments - Optional array of attachment objects.
63
+ * @param args.attachments - Optional array of {@link Attachment} objects.
63
64
  * @param args.sendAsIntegration - Optional flag to send as integration.
64
65
  * @param options - Optional configuration. Set `batch: true` to return a descriptor for batch requests.
65
66
  * @returns The created comment object.
@@ -88,7 +89,6 @@ export declare class CommentsClient extends BaseClient {
88
89
  * @param args.id - The comment ID.
89
90
  * @param args.content - Optional new comment content.
90
91
  * @param args.recipients - Optional array of user IDs to notify.
91
- * @param args.attachments - Optional array of attachment objects.
92
92
  * @param options - Optional configuration. Set `batch: true` to return a descriptor for batch requests.
93
93
  * @returns The updated comment object.
94
94
  */
@@ -6,6 +6,7 @@ import { BaseClient } from './base-client.js';
6
6
  * Client for interacting with Twist conversation message endpoints.
7
7
  */
8
8
  export declare class ConversationMessagesClient extends BaseClient {
9
+ private readonly messageSchema;
9
10
  /**
10
11
  * Gets all messages in a conversation.
11
12
  *
@@ -56,7 +57,7 @@ export declare class ConversationMessagesClient extends BaseClient {
56
57
  * @param args - The arguments for creating a message.
57
58
  * @param args.conversationId - The conversation ID.
58
59
  * @param args.content - The message content.
59
- * @param args.attachments - Optional array of attachment objects.
60
+ * @param args.attachments - Optional array of {@link Attachment} objects.
60
61
  * @param args.actions - Optional array of action objects.
61
62
  * @param options - Optional configuration. Set `batch: true` to return a descriptor for batch requests.
62
63
  * @returns The created message object.
@@ -81,7 +82,7 @@ export declare class ConversationMessagesClient extends BaseClient {
81
82
  * @param args - The arguments for updating a message.
82
83
  * @param args.id - The message ID.
83
84
  * @param args.content - The new message content.
84
- * @param args.attachments - Optional array of attachment objects.
85
+ * @param args.attachments - Optional array of {@link Attachment} objects.
85
86
  * @param options - Optional configuration. Set `batch: true` to return a descriptor for batch requests.
86
87
  * @returns The updated message object.
87
88
  *
@@ -6,6 +6,7 @@ import { BaseClient } from './base-client.js';
6
6
  * Client for interacting with Twist conversation endpoints.
7
7
  */
8
8
  export declare class ConversationsClient extends BaseClient {
9
+ private readonly conversationSchema;
9
10
  /**
10
11
  * Gets all conversations for a workspace.
11
12
  *
@@ -6,6 +6,7 @@ import { BaseClient } from './base-client.js';
6
6
  * Client for interacting with Twist inbox endpoints.
7
7
  */
8
8
  export declare class InboxClient extends BaseClient {
9
+ private readonly inboxThreadSchema;
9
10
  /**
10
11
  * Gets inbox items (threads).
11
12
  *
@@ -6,6 +6,8 @@ import { BaseClient } from './base-client.js';
6
6
  * Client for interacting with Twist thread endpoints.
7
7
  */
8
8
  export declare class ThreadsClient extends BaseClient {
9
+ private readonly threadSchema;
10
+ private readonly commentSchema;
9
11
  /**
10
12
  * Gets all threads in a channel.
11
13
  *
@@ -54,7 +56,6 @@ export declare class ThreadsClient extends BaseClient {
54
56
  * @param args.title - The thread title.
55
57
  * @param args.content - The thread content.
56
58
  * @param args.recipients - Optional array of user IDs to notify.
57
- * @param args.attachments - Optional array of attachment objects.
58
59
  * @param args.sendAsIntegration - Optional flag to send as integration.
59
60
  * @param options - Optional configuration. Set `batch: true` to return a descriptor for batch requests.
60
61
  * @returns The created thread object.
@@ -82,7 +83,6 @@ export declare class ThreadsClient extends BaseClient {
82
83
  * @param args.title - Optional new thread title.
83
84
  * @param args.content - Optional new thread content.
84
85
  * @param args.recipients - Optional array of user IDs to notify.
85
- * @param args.attachments - Optional array of attachment objects.
86
86
  * @param options - Optional configuration. Set `batch: true` to return a descriptor for batch requests.
87
87
  * @returns The updated thread object.
88
88
  */
@@ -328,7 +328,7 @@ export declare class ThreadsClient extends BaseClient {
328
328
  * @param args.id - The thread ID.
329
329
  * @param args.content - The comment content.
330
330
  * @param args.tempId - Optional temporary identifier.
331
- * @param args.attachments - Optional array of attachment objects.
331
+ * @param args.attachments - Optional array of {@link Attachment} objects.
332
332
  * @param args.actions - Optional array of action objects.
333
333
  * @param args.recipients - Optional array of user IDs to notify directly.
334
334
  * @param args.groups - Optional array of custom group IDs to notify.
@@ -361,7 +361,7 @@ export declare class ThreadsClient extends BaseClient {
361
361
  * @param args.id - The thread ID.
362
362
  * @param args.content - The comment content.
363
363
  * @param args.tempId - Optional temporary identifier.
364
- * @param args.attachments - Optional array of attachment objects.
364
+ * @param args.attachments - Optional array of {@link Attachment} objects.
365
365
  * @param args.actions - Optional array of action objects.
366
366
  * @param args.recipients - Optional array of user IDs to notify directly.
367
367
  * @param args.groups - Optional array of custom group IDs to notify.
@@ -10,9 +10,14 @@ export declare class WorkspaceUsersClient extends BaseClient {
10
10
  /**
11
11
  * Returns a list of workspace user objects for the given workspace id.
12
12
  *
13
+ * Removed users are excluded by default; set `args.includeRemoved` to `true` to include them.
14
+ * The Twist API always returns removed users, so the filtering happens client-side (in both the
15
+ * awaited and batch modes).
16
+ *
13
17
  * @param args - The arguments for getting workspace users.
14
18
  * @param args.workspaceId - The workspace ID.
15
19
  * @param args.archived - Optional flag to filter archived users.
20
+ * @param args.includeRemoved - Include users removed from the workspace. Defaults to `false`.
16
21
  * @param options - Optional configuration. Set `batch: true` to return a descriptor for batch requests.
17
22
  * @returns An array of workspace user objects.
18
23
  *
@@ -5,6 +5,7 @@ import { BaseClient } from './base-client.js';
5
5
  * Client for interacting with Twist workspace endpoints.
6
6
  */
7
7
  export declare class WorkspacesClient extends BaseClient {
8
+ private readonly channelSchema;
8
9
  /**
9
10
  * Gets all the user's workspaces.
10
11
  *