@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.
- package/dist/cjs/clients/add-comment-helper.js +1 -2
- package/dist/cjs/clients/base-client.js +10 -0
- package/dist/cjs/clients/channels-client.js +9 -6
- package/dist/cjs/clients/comments-client.js +16 -6
- package/dist/cjs/clients/conversation-messages-client.js +9 -8
- package/dist/cjs/clients/conversations-client.js +11 -8
- package/dist/cjs/clients/inbox-client.js +6 -3
- package/dist/cjs/clients/threads-client.js +18 -9
- package/dist/cjs/clients/workspace-users-client.js +9 -2
- package/dist/cjs/clients/workspaces-client.js +7 -3
- package/dist/cjs/types/entities.js +130 -84
- package/dist/cjs/types/requests.js +3 -2
- package/dist/esm/clients/add-comment-helper.js +1 -2
- package/dist/esm/clients/base-client.js +10 -0
- package/dist/esm/clients/channels-client.js +10 -7
- package/dist/esm/clients/comments-client.js +17 -7
- package/dist/esm/clients/conversation-messages-client.js +10 -9
- package/dist/esm/clients/conversations-client.js +12 -9
- package/dist/esm/clients/inbox-client.js +7 -4
- package/dist/esm/clients/threads-client.js +19 -10
- package/dist/esm/clients/workspace-users-client.js +9 -2
- package/dist/esm/clients/workspaces-client.js +8 -4
- package/dist/esm/types/entities.js +123 -83
- package/dist/esm/types/requests.js +3 -2
- package/dist/types/clients/add-comment-helper.d.ts +3 -1
- package/dist/types/clients/base-client.d.ts +4 -0
- package/dist/types/clients/channels-client.d.ts +1 -0
- package/dist/types/clients/comments-client.d.ts +2 -2
- package/dist/types/clients/conversation-messages-client.d.ts +3 -2
- package/dist/types/clients/conversations-client.d.ts +1 -0
- package/dist/types/clients/inbox-client.d.ts +1 -0
- package/dist/types/clients/threads-client.d.ts +4 -4
- package/dist/types/clients/workspace-users-client.d.ts +5 -0
- package/dist/types/clients/workspaces-client.d.ts +1 -0
- package/dist/types/types/entities.d.ts +1845 -65
- package/dist/types/types/requests.d.ts +44 -4
- package/package.json +6 -2
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { type Attachment } from './entities.js';
|
|
2
3
|
export declare const CreateChannelArgsSchema: z.ZodObject<{
|
|
3
4
|
workspaceId: z.ZodNumber;
|
|
4
5
|
name: z.ZodString;
|
|
@@ -44,7 +45,24 @@ export declare const CreateCommentArgsSchema: z.ZodObject<{
|
|
|
44
45
|
threadId: z.ZodNumber;
|
|
45
46
|
content: z.ZodString;
|
|
46
47
|
tempId: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
47
|
-
attachments: z.ZodOptional<z.ZodNullable<z.
|
|
48
|
+
attachments: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
49
|
+
attachmentId: z.ZodString;
|
|
50
|
+
urlType: z.ZodString;
|
|
51
|
+
title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
52
|
+
url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
53
|
+
fileName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
54
|
+
fileSize: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
55
|
+
underlyingType: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
56
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
57
|
+
image: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
58
|
+
imageWidth: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
59
|
+
imageHeight: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
60
|
+
duration: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
61
|
+
uploadState: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
62
|
+
video: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
63
|
+
videoType: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
64
|
+
videoAutoPlay: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
65
|
+
}, z.core.$loose>>>>;
|
|
48
66
|
actions: z.ZodOptional<z.ZodNullable<z.ZodUnknown>>;
|
|
49
67
|
recipients: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber>>>;
|
|
50
68
|
groups: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber>>>;
|
|
@@ -70,7 +88,24 @@ export declare const CreateMessageArgsSchema: z.ZodObject<{
|
|
|
70
88
|
conversationId: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
71
89
|
threadId: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
72
90
|
content: z.ZodString;
|
|
73
|
-
attachments: z.ZodOptional<z.ZodNullable<z.ZodArray<z.
|
|
91
|
+
attachments: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
92
|
+
attachmentId: z.ZodString;
|
|
93
|
+
urlType: z.ZodString;
|
|
94
|
+
title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
95
|
+
url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
96
|
+
fileName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
97
|
+
fileSize: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
98
|
+
underlyingType: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
99
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
100
|
+
image: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
101
|
+
imageWidth: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
102
|
+
imageHeight: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
103
|
+
duration: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
104
|
+
uploadState: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
105
|
+
video: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
106
|
+
videoType: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
107
|
+
videoAutoPlay: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
108
|
+
}, z.core.$loose>>>>;
|
|
74
109
|
}, z.core.$strip>;
|
|
75
110
|
export type CreateMessageArgs = z.infer<typeof CreateMessageArgsSchema>;
|
|
76
111
|
export declare const GetChannelsArgsSchema: z.ZodObject<{
|
|
@@ -174,13 +209,13 @@ export type GetConversationMessagesArgs = {
|
|
|
174
209
|
export type CreateConversationMessageArgs = {
|
|
175
210
|
conversationId: number;
|
|
176
211
|
content: string;
|
|
177
|
-
attachments?:
|
|
212
|
+
attachments?: Attachment[];
|
|
178
213
|
actions?: unknown[];
|
|
179
214
|
};
|
|
180
215
|
export type UpdateConversationMessageArgs = {
|
|
181
216
|
id: number;
|
|
182
217
|
content: string;
|
|
183
|
-
attachments?:
|
|
218
|
+
attachments?: Attachment[];
|
|
184
219
|
};
|
|
185
220
|
export declare const ARCHIVE_FILTER_VALUES: readonly ["active", "archived", "all"];
|
|
186
221
|
export type ArchiveFilter = (typeof ARCHIVE_FILTER_VALUES)[number];
|
|
@@ -318,6 +353,11 @@ export type RemoveGroupUsersArgs = {
|
|
|
318
353
|
export type GetWorkspaceUsersArgs = {
|
|
319
354
|
workspaceId: number;
|
|
320
355
|
archived?: boolean;
|
|
356
|
+
/**
|
|
357
|
+
* Include users who have been removed from the workspace. Defaults to `false`.
|
|
358
|
+
* The Twist API always returns removed users, so the SDK filters them client-side.
|
|
359
|
+
*/
|
|
360
|
+
includeRemoved?: boolean;
|
|
321
361
|
};
|
|
322
362
|
export type GetUserByIdArgs = {
|
|
323
363
|
workspaceId: number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@doist/twist-sdk",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.8.1",
|
|
4
4
|
"description": "A TypeScript wrapper for the Twist REST API.",
|
|
5
5
|
"author": "Doist developers",
|
|
6
6
|
"homepage": "https://doist.github.io/twist-sdk-typescript/",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"type-check": "npx tsc --noEmit",
|
|
37
37
|
"check": "oxlint src && oxfmt --check",
|
|
38
38
|
"check:fix": "oxlint src --fix && oxfmt",
|
|
39
|
-
"attw": "
|
|
39
|
+
"attw": "attw --pack --ignore-rules fallback-condition false-esm",
|
|
40
40
|
"audit": "npm audit --audit-level=moderate",
|
|
41
41
|
"integrity-checks": "npm-run-all clean check test build attw",
|
|
42
42
|
"prepublishOnly": "npm run integrity-checks",
|
|
@@ -50,6 +50,7 @@
|
|
|
50
50
|
"zod": "4.1.12"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
|
+
"@arethetypeswrong/cli": "0.18.2",
|
|
53
54
|
"@semantic-release/changelog": "6.0.3",
|
|
54
55
|
"@semantic-release/git": "10.0.1",
|
|
55
56
|
"conventional-changelog-conventionalcommits": "9.3.0",
|
|
@@ -70,6 +71,9 @@
|
|
|
70
71
|
"peerDependencies": {
|
|
71
72
|
"type-fest": "^4.12.0 || ^5.1.0"
|
|
72
73
|
},
|
|
74
|
+
"overrides": {
|
|
75
|
+
"fflate": "0.8.2"
|
|
76
|
+
},
|
|
73
77
|
"husky": {
|
|
74
78
|
"hooks": {
|
|
75
79
|
"pre-commit": "npx lint-staged && npm run build"
|