@doist/comms-sdk 2.0.2 → 3.0.0

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 (46) hide show
  1. package/dist/esm/utils/url-helpers.js +104 -16
  2. package/dist/types/utils/url-helpers.d.ts +41 -0
  3. package/package.json +5 -10
  4. package/dist/cjs/authentication.js +0 -256
  5. package/dist/cjs/clients/add-comment-helper.js +0 -43
  6. package/dist/cjs/clients/attachments-client.js +0 -71
  7. package/dist/cjs/clients/base-client.js +0 -33
  8. package/dist/cjs/clients/channels-client.js +0 -211
  9. package/dist/cjs/clients/comments-client.js +0 -175
  10. package/dist/cjs/clients/conversation-messages-client.js +0 -169
  11. package/dist/cjs/clients/conversations-client.js +0 -283
  12. package/dist/cjs/clients/groups-client.js +0 -172
  13. package/dist/cjs/clients/hooks-client.js +0 -52
  14. package/dist/cjs/clients/inbox-client.js +0 -184
  15. package/dist/cjs/clients/notify-audience.js +0 -45
  16. package/dist/cjs/clients/reactions-client.js +0 -97
  17. package/dist/cjs/clients/search-client.js +0 -138
  18. package/dist/cjs/clients/threads-client.js +0 -364
  19. package/dist/cjs/clients/users-client.js +0 -326
  20. package/dist/cjs/clients/workspace-users-client.js +0 -252
  21. package/dist/cjs/clients/workspaces-client.js +0 -174
  22. package/dist/cjs/comms-api.js +0 -70
  23. package/dist/cjs/consts/endpoints.js +0 -34
  24. package/dist/cjs/index.js +0 -53
  25. package/dist/cjs/migration.js +0 -96
  26. package/dist/cjs/package.json +0 -1
  27. package/dist/cjs/testUtils/msw-handlers.js +0 -51
  28. package/dist/cjs/testUtils/msw-setup.js +0 -35
  29. package/dist/cjs/testUtils/obsidian-fetch-adapter.js +0 -53
  30. package/dist/cjs/testUtils/test-defaults.js +0 -106
  31. package/dist/cjs/transport/fetch-with-retry.js +0 -146
  32. package/dist/cjs/transport/http-client.js +0 -56
  33. package/dist/cjs/transport/http-dispatcher.js +0 -190
  34. package/dist/cjs/types/api-version.js +0 -8
  35. package/dist/cjs/types/entities.js +0 -496
  36. package/dist/cjs/types/enums.js +0 -37
  37. package/dist/cjs/types/errors.js +0 -12
  38. package/dist/cjs/types/http.js +0 -4
  39. package/dist/cjs/types/index.js +0 -22
  40. package/dist/cjs/types/requests.js +0 -183
  41. package/dist/cjs/utils/case-conversion.js +0 -54
  42. package/dist/cjs/utils/index.js +0 -19
  43. package/dist/cjs/utils/multipart-upload.js +0 -202
  44. package/dist/cjs/utils/timestamp-conversion.js +0 -58
  45. package/dist/cjs/utils/url-helpers.js +0 -133
  46. package/dist/cjs/utils/uuidv7.js +0 -182
@@ -1,211 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ChannelsClient = exports.ChannelListSchema = void 0;
4
- const zod_1 = require("zod");
5
- const endpoints_1 = require("../consts/endpoints");
6
- const http_client_1 = require("../transport/http-client");
7
- const entities_1 = require("../types/entities");
8
- const uuidv7_1 = require("../utils/uuidv7");
9
- const base_client_1 = require("./base-client");
10
- exports.ChannelListSchema = zod_1.z.array(entities_1.ChannelSchema);
11
- /**
12
- * Client for `/api/v1/channels/`. The SDK auto-generates an `id` on
13
- * `createChannel` when the caller doesn't supply one — pass your own `id`
14
- * to keep an optimistic-UI ID stable through the round-trip.
15
- */
16
- class ChannelsClient extends base_client_1.BaseClient {
17
- constructor() {
18
- super(...arguments);
19
- this.linkBaseUrl = this.getLinkBaseUrl();
20
- // Reuse the shared singletons when no custom base is configured.
21
- this.channelSchema = this.linkBaseUrl
22
- ? (0, entities_1.createChannelSchema)(this.linkBaseUrl)
23
- : entities_1.ChannelSchema;
24
- this.channelListSchema = this.linkBaseUrl
25
- ? zod_1.z.array(this.channelSchema)
26
- : exports.ChannelListSchema;
27
- }
28
- /**
29
- * Gets all channels for a given workspace.
30
- *
31
- * @param args - The arguments for getting channels.
32
- * @param args.workspaceId - The workspace ID.
33
- * @param args.archived - Optional flag to include archived channels.
34
- * @returns An array of channel objects.
35
- *
36
- * @example
37
- * ```typescript
38
- * const channels = await api.channels.getChannels({ workspaceId: 123 })
39
- * channels.forEach(ch => console.log(ch.name))
40
- * ```
41
- */
42
- getChannels(args) {
43
- return (0, http_client_1.request)({
44
- httpMethod: 'GET',
45
- baseUri: this.getBaseUri(),
46
- relativePath: `${endpoints_1.ENDPOINT_CHANNELS}/get`,
47
- apiToken: this.apiToken,
48
- payload: args,
49
- customFetch: this.customFetch,
50
- }).then((response) => this.channelListSchema.parse(response.data));
51
- }
52
- /**
53
- * Gets a single channel object by id.
54
- *
55
- * @param id - The channel ID.
56
- * @returns The channel object.
57
- */
58
- getChannel(id) {
59
- return this.simple('GET', 'getone', { id }, this.channelSchema);
60
- }
61
- /**
62
- * Creates a new channel. `id` is auto-generated if not supplied — pass your
63
- * own `id` to keep an optimistic-UI ID stable through the round-trip.
64
- *
65
- * @param args - The arguments for creating a channel.
66
- * @param args.workspaceId - The workspace ID.
67
- * @param args.name - The channel name.
68
- * @param args.description - Optional channel description.
69
- * @param args.color - Optional channel color.
70
- * @param args.userIds - Optional array of user IDs to add to the channel.
71
- * @param args.public - Optional flag to make the channel public.
72
- * @returns The created channel object.
73
- *
74
- * @example
75
- * ```typescript
76
- * const channel = await api.channels.createChannel({
77
- * workspaceId: 123,
78
- * name: 'Engineering',
79
- * description: 'Engineering team channel',
80
- * })
81
- * ```
82
- */
83
- createChannel(args) {
84
- return this.simple('POST', 'add', { ...args, id: (0, uuidv7_1.resolveCreateId)(args.id) }, this.channelSchema);
85
- }
86
- /**
87
- * Partial update of an existing channel.
88
- *
89
- * @param args - The arguments for updating a channel.
90
- * @param args.id - The channel ID.
91
- * @param args.name - Optional new channel name.
92
- * @param args.description - Optional new channel description.
93
- * @param args.color - Optional new channel color.
94
- * @param args.public - Optional flag to change channel visibility.
95
- * @returns The updated channel object.
96
- */
97
- updateChannel(args) {
98
- return this.simple('POST', 'update', { ...args }, this.channelSchema);
99
- }
100
- /**
101
- * Updates the channel's view filter (`only_open` / `all` / `only_closed`).
102
- *
103
- * @param args - The arguments for updating the channel filter.
104
- * @param args.id - The channel ID.
105
- * @param args.filterClosed - The new filter value.
106
- */
107
- updateFilters(args) {
108
- return this.simple('POST', 'update_filters', { ...args }, entities_1.StatusOkSchema);
109
- }
110
- /**
111
- * Permanently deletes a channel.
112
- *
113
- * @param id - The channel ID.
114
- */
115
- deleteChannel(id) {
116
- return this.simple('POST', 'remove', { id }, entities_1.StatusOkSchema);
117
- }
118
- /**
119
- * Archives a channel.
120
- *
121
- * @param id - The channel ID.
122
- */
123
- archiveChannel(id) {
124
- return this.simple('POST', 'archive', { id }, entities_1.StatusOkSchema);
125
- }
126
- /**
127
- * Unarchives a channel.
128
- *
129
- * @param id - The channel ID.
130
- */
131
- unarchiveChannel(id) {
132
- return this.simple('POST', 'unarchive', { id }, entities_1.StatusOkSchema);
133
- }
134
- /**
135
- * Favorites a channel.
136
- *
137
- * @param id - The channel ID.
138
- */
139
- favoriteChannel(id) {
140
- return this.simple('POST', 'favorite', { id }, entities_1.StatusOkSchema);
141
- }
142
- /**
143
- * Unfavorites a channel.
144
- *
145
- * @param id - The channel ID.
146
- */
147
- unfavoriteChannel(id) {
148
- return this.simple('POST', 'unfavorite', { id }, entities_1.StatusOkSchema);
149
- }
150
- /**
151
- * Adds a user to a channel.
152
- *
153
- * @param args - The arguments for adding a user.
154
- * @param args.id - The channel ID.
155
- * @param args.userId - The user ID to add.
156
- *
157
- * @example
158
- * ```typescript
159
- * await api.channels.addUser({ id: '7YpL3oZ4kZ9vP7Q1tR2sX44', userId: 101 })
160
- * ```
161
- */
162
- addUser(args) {
163
- return this.simple('POST', 'add_user', { ...args }, this.channelSchema);
164
- }
165
- /**
166
- * Adds multiple users to a channel.
167
- *
168
- * @param args - The arguments for adding users.
169
- * @param args.id - The channel ID.
170
- * @param args.userIds - Array of user IDs to add.
171
- *
172
- * @example
173
- * ```typescript
174
- * await api.channels.addUsers({ id: '7YpL3oZ4kZ9vP7Q1tR2sX44', userIds: [101, 202] })
175
- * ```
176
- */
177
- addUsers(args) {
178
- return this.simple('POST', 'add_users', { ...args }, this.channelSchema);
179
- }
180
- /**
181
- * Removes a user from a channel.
182
- *
183
- * @param args - The arguments for removing a user.
184
- * @param args.id - The channel ID.
185
- * @param args.userId - The user ID to remove.
186
- */
187
- removeUser(args) {
188
- return this.simple('POST', 'remove_user', { ...args }, this.channelSchema);
189
- }
190
- /**
191
- * Removes multiple users from a channel.
192
- *
193
- * @param args - The arguments for removing users.
194
- * @param args.id - The channel ID.
195
- * @param args.userIds - Array of user IDs to remove.
196
- */
197
- removeUsers(args) {
198
- return this.simple('POST', 'remove_users', { ...args }, this.channelSchema);
199
- }
200
- simple(httpMethod, suffix, params, schema) {
201
- return (0, http_client_1.request)({
202
- httpMethod,
203
- baseUri: this.getBaseUri(),
204
- relativePath: `${endpoints_1.ENDPOINT_CHANNELS}/${suffix}`,
205
- apiToken: this.apiToken,
206
- payload: params,
207
- customFetch: this.customFetch,
208
- }).then((response) => schema.parse(response.data));
209
- }
210
- }
211
- exports.ChannelsClient = ChannelsClient;
@@ -1,175 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CommentsClient = exports.CommentListSchema = void 0;
4
- const zod_1 = require("zod");
5
- const endpoints_1 = require("../consts/endpoints");
6
- const http_client_1 = require("../transport/http-client");
7
- const entities_1 = require("../types/entities");
8
- const add_comment_helper_1 = require("./add-comment-helper");
9
- const base_client_1 = require("./base-client");
10
- exports.CommentListSchema = zod_1.z.array(entities_1.CommentSchema);
11
- /**
12
- * Client for `/api/v1/comments/`. The SDK auto-generates the comment `id`
13
- * on `createComment` when the caller doesn't supply one.
14
- */
15
- class CommentsClient extends base_client_1.BaseClient {
16
- constructor() {
17
- super(...arguments);
18
- this.linkBaseUrl = this.getLinkBaseUrl();
19
- // Reuse the shared singletons when no custom base is configured.
20
- this.commentSchema = this.linkBaseUrl
21
- ? (0, entities_1.createCommentSchema)(this.linkBaseUrl)
22
- : entities_1.CommentSchema;
23
- this.commentListSchema = this.linkBaseUrl
24
- ? zod_1.z.array(this.commentSchema)
25
- : exports.CommentListSchema;
26
- }
27
- /**
28
- * Gets all comments for a thread. `newerThan` / `olderThan` (`Date`) are
29
- * converted to `newer_than_ts` / `older_than_ts` epoch seconds on the
30
- * wire.
31
- *
32
- * @param args - The arguments for getting comments.
33
- * @param args.threadId - The thread ID.
34
- * @param args.newerThan - Optional date to get comments newer than.
35
- * @param args.olderThan - Optional date to get comments older than.
36
- * @param args.limit - Optional limit on number of comments returned.
37
- * @returns An array of comment objects.
38
- *
39
- * @example
40
- * ```typescript
41
- * const comments = await api.comments.getComments({
42
- * threadId: '7YpL3oZ4kZ9vP7Q1tR2sX3z',
43
- * newerThan: new Date('2024-01-01'),
44
- * })
45
- * comments.forEach(c => console.log(c.content))
46
- * ```
47
- */
48
- getComments(args) {
49
- const params = { threadId: args.threadId };
50
- if (args.newerThan)
51
- params.newerThanTs = Math.floor(args.newerThan.getTime() / 1000);
52
- if (args.olderThan)
53
- params.olderThanTs = Math.floor(args.olderThan.getTime() / 1000);
54
- if (args.limit)
55
- params.limit = args.limit;
56
- return (0, http_client_1.request)({
57
- httpMethod: 'GET',
58
- baseUri: this.getBaseUri(),
59
- relativePath: `${endpoints_1.ENDPOINT_COMMENTS}/get`,
60
- apiToken: this.apiToken,
61
- payload: params,
62
- customFetch: this.customFetch,
63
- }).then((response) => this.commentListSchema.parse(response.data));
64
- }
65
- /**
66
- * Gets a single comment object by id. The `getone` endpoint returns the
67
- * comment object directly (the same shape as `add`), not wrapped.
68
- *
69
- * @param id - The comment ID.
70
- * @returns The comment object.
71
- */
72
- getComment(id) {
73
- return (0, http_client_1.request)({
74
- httpMethod: 'GET',
75
- baseUri: this.getBaseUri(),
76
- relativePath: `${endpoints_1.ENDPOINT_COMMENTS}/getone`,
77
- apiToken: this.apiToken,
78
- payload: { id },
79
- customFetch: this.customFetch,
80
- }).then((response) => this.commentSchema.parse(response.data));
81
- }
82
- /**
83
- * Creates a new comment on a thread. `id` is auto-generated if not supplied.
84
- *
85
- * @param args - The arguments for creating a comment.
86
- * @param args.threadId - The thread ID.
87
- * @param args.content - The comment content.
88
- * @param args.recipients - Optional array of user IDs to notify directly.
89
- * @param args.groups - Optional array of custom group IDs to notify.
90
- * @param args.directMentions - Optional array of user IDs that were @-mentioned in
91
- * `content`.
92
- * @param args.notifyAudience - Optional broader audience to notify in addition to
93
- * `recipients` and `groups`. `'channel'` notifies everyone in the channel;
94
- * `'thread'` notifies everyone who has interacted with the thread.
95
- * @param args.attachments - Optional array of {@link Attachment} objects.
96
- * @returns The created comment object.
97
- *
98
- * @example
99
- * ```typescript
100
- * // Notify everyone who has interacted with the thread, plus two extra users.
101
- * const comment = await api.comments.createComment({
102
- * threadId: '7YpL3oZ4kZ9vP7Q1tR2sX3z',
103
- * content: 'Great idea! Let\'s proceed.',
104
- * notifyAudience: 'thread',
105
- * recipients: [101, 202],
106
- * })
107
- * ```
108
- */
109
- createComment(args) {
110
- return (0, add_comment_helper_1.addCommentRequest)({
111
- baseUri: this.getBaseUri(),
112
- apiToken: this.apiToken,
113
- customFetch: this.customFetch,
114
- schema: this.commentSchema,
115
- }, args);
116
- }
117
- /**
118
- * Updates a comment's properties.
119
- *
120
- * @param args - The arguments for updating a comment.
121
- * @param args.id - The comment ID.
122
- * @param args.content - The new comment content.
123
- * @returns The updated comment object.
124
- */
125
- updateComment(args) {
126
- return (0, http_client_1.request)({
127
- httpMethod: 'POST',
128
- baseUri: this.getBaseUri(),
129
- relativePath: `${endpoints_1.ENDPOINT_COMMENTS}/update`,
130
- apiToken: this.apiToken,
131
- payload: { ...args },
132
- customFetch: this.customFetch,
133
- }).then((response) => this.commentSchema.parse(response.data));
134
- }
135
- /**
136
- * Permanently deletes a comment.
137
- *
138
- * @param id - The comment ID.
139
- */
140
- deleteComment(id) {
141
- return (0, http_client_1.request)({
142
- httpMethod: 'POST',
143
- baseUri: this.getBaseUri(),
144
- relativePath: `${endpoints_1.ENDPOINT_COMMENTS}/remove`,
145
- apiToken: this.apiToken,
146
- payload: { id },
147
- customFetch: this.customFetch,
148
- }).then((response) => entities_1.StatusOkSchema.parse(response.data));
149
- }
150
- /**
151
- * Marks the user's read position in a thread. Used to track where the user has read up to,
152
- * so clients can scroll to this position and show a visual indicator (blue line).
153
- * Comment IDs are strings.
154
- *
155
- * @param args - The arguments for marking read position.
156
- * @param args.threadId - The thread ID.
157
- * @param args.commentId - The comment ID to mark as the last read position.
158
- *
159
- * @example
160
- * ```typescript
161
- * await api.comments.markPosition({ threadId: '7YpL3oZ4kZ9vP7Q1tR2sX3z', commentId: '7YpL3oZ4kZ9vP7Q1tR2sX41' })
162
- * ```
163
- */
164
- markPosition(args) {
165
- return (0, http_client_1.request)({
166
- httpMethod: 'POST',
167
- baseUri: this.getBaseUri(),
168
- relativePath: `${endpoints_1.ENDPOINT_COMMENTS}/mark_position`,
169
- apiToken: this.apiToken,
170
- payload: { threadId: args.threadId, commentId: args.commentId },
171
- customFetch: this.customFetch,
172
- }).then((response) => entities_1.StatusOkSchema.parse(response.data));
173
- }
174
- }
175
- exports.CommentsClient = CommentsClient;
@@ -1,169 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ConversationMessagesClient = exports.ConversationMessageListSchema = void 0;
4
- const zod_1 = require("zod");
5
- const endpoints_1 = require("../consts/endpoints");
6
- const http_client_1 = require("../transport/http-client");
7
- const entities_1 = require("../types/entities");
8
- const uuidv7_1 = require("../utils/uuidv7");
9
- const base_client_1 = require("./base-client");
10
- exports.ConversationMessageListSchema = zod_1.z.array(entities_1.ConversationMessageSchema);
11
- /**
12
- * Client for `/api/v1/conversation_messages/`. The SDK auto-generates the
13
- * message `id` on `createMessage` when the caller doesn't supply one.
14
- */
15
- class ConversationMessagesClient extends base_client_1.BaseClient {
16
- constructor() {
17
- super(...arguments);
18
- this.linkBaseUrl = this.getLinkBaseUrl();
19
- // Reuse the shared singletons when no custom base is configured.
20
- this.messageSchema = this.linkBaseUrl
21
- ? (0, entities_1.createConversationMessageSchema)(this.linkBaseUrl)
22
- : entities_1.ConversationMessageSchema;
23
- this.messageListSchema = this.linkBaseUrl
24
- ? zod_1.z.array(this.messageSchema)
25
- : exports.ConversationMessageListSchema;
26
- }
27
- /**
28
- * Gets all messages in a conversation.
29
- *
30
- * @param args - The arguments for getting messages.
31
- * @param args.conversationId - The conversation ID.
32
- * @param args.newerThan - Optional date to get messages newer than.
33
- * @param args.olderThan - Optional date to get messages older than.
34
- * @param args.limit - Optional limit on number of messages returned.
35
- * @param args.cursor - Optional cursor for pagination.
36
- * @returns An array of message objects.
37
- *
38
- * @example
39
- * ```typescript
40
- * const messages = await api.conversationMessages.getMessages({
41
- * conversationId: '7YpL3oZ4kZ9vP7Q1tR2sX42',
42
- * newerThan: new Date('2024-01-01'),
43
- * })
44
- * ```
45
- */
46
- getMessages(args) {
47
- const params = { conversationId: args.conversationId };
48
- if (args.newerThan)
49
- params.newerThanTs = Math.floor(args.newerThan.getTime() / 1000);
50
- if (args.olderThan)
51
- params.olderThanTs = Math.floor(args.olderThan.getTime() / 1000);
52
- if (args.limit)
53
- params.limit = args.limit;
54
- if (args.cursor)
55
- params.cursor = args.cursor;
56
- return (0, http_client_1.request)({
57
- httpMethod: 'GET',
58
- baseUri: this.getBaseUri(),
59
- relativePath: `${endpoints_1.ENDPOINT_CONVERSATION_MESSAGES}/get`,
60
- apiToken: this.apiToken,
61
- payload: params,
62
- customFetch: this.customFetch,
63
- }).then((response) => this.messageListSchema.parse(response.data));
64
- }
65
- /**
66
- * Gets a single conversation message by id.
67
- *
68
- * @param id - The message ID.
69
- * @returns The conversation message object.
70
- *
71
- * @example
72
- * ```typescript
73
- * const message = await api.conversationMessages.getMessage('7YpL3oZ4kZ9vP7Q1tR2sX43')
74
- * ```
75
- */
76
- getMessage(id) {
77
- return this.simple('GET', 'getone', { id }, this.messageSchema);
78
- }
79
- /**
80
- * Creates a new message in a conversation. `id` is auto-generated if not
81
- * supplied.
82
- *
83
- * @param args - The arguments for creating a message.
84
- * @param args.conversationId - The conversation ID.
85
- * @param args.content - The message content.
86
- * @param args.attachments - Optional array of {@link Attachment} objects.
87
- * @param args.actions - Optional array of action objects.
88
- * @returns The created message object.
89
- *
90
- * @example
91
- * ```typescript
92
- * const message = await api.conversationMessages.createMessage({
93
- * conversationId: '7YpL3oZ4kZ9vP7Q1tR2sX42',
94
- * content: 'Thanks for the update!',
95
- * })
96
- * ```
97
- */
98
- createMessage(args) {
99
- const params = {
100
- conversationId: args.conversationId,
101
- content: args.content,
102
- id: (0, uuidv7_1.resolveCreateId)(args.id),
103
- };
104
- if (args.attachments)
105
- params.attachments = args.attachments;
106
- if (args.actions)
107
- params.actions = args.actions;
108
- if (args.directMentions)
109
- params.directMentions = args.directMentions;
110
- if (args.directGroupMentions)
111
- params.directGroupMentions = args.directGroupMentions;
112
- if (args.notify !== undefined)
113
- params.notify = args.notify;
114
- return this.simple('POST', 'add', params, this.messageSchema);
115
- }
116
- /**
117
- * Updates a conversation message.
118
- *
119
- * @param args - The arguments for updating a message.
120
- * @param args.id - The message ID.
121
- * @param args.content - The new message content.
122
- * @param args.attachments - Optional array of {@link Attachment} objects.
123
- * @returns The updated message object.
124
- *
125
- * @example
126
- * ```typescript
127
- * const message = await api.conversationMessages.updateMessage({
128
- * id: '7YpL3oZ4kZ9vP7Q1tR2sX43',
129
- * content: 'Updated message content',
130
- * })
131
- * ```
132
- */
133
- updateMessage(args) {
134
- const params = { id: args.id, content: args.content };
135
- if (args.attachments)
136
- params.attachments = args.attachments;
137
- if (args.actions)
138
- params.actions = args.actions;
139
- if (args.directMentions)
140
- params.directMentions = args.directMentions;
141
- if (args.directGroupMentions)
142
- params.directGroupMentions = args.directGroupMentions;
143
- return this.simple('POST', 'update', params, this.messageSchema);
144
- }
145
- /**
146
- * Permanently deletes a conversation message.
147
- *
148
- * @param id - The message ID.
149
- *
150
- * @example
151
- * ```typescript
152
- * await api.conversationMessages.deleteMessage('7YpL3oZ4kZ9vP7Q1tR2sX43')
153
- * ```
154
- */
155
- deleteMessage(id) {
156
- return this.simple('POST', 'remove', { id }, entities_1.StatusOkSchema);
157
- }
158
- simple(httpMethod, suffix, params, schema) {
159
- return (0, http_client_1.request)({
160
- httpMethod,
161
- baseUri: this.getBaseUri(),
162
- relativePath: `${endpoints_1.ENDPOINT_CONVERSATION_MESSAGES}/${suffix}`,
163
- apiToken: this.apiToken,
164
- payload: params,
165
- customFetch: this.customFetch,
166
- }).then((response) => schema.parse(response.data));
167
- }
168
- }
169
- exports.ConversationMessagesClient = ConversationMessagesClient;