@burdenoff/sdk-libs 2026.523.1 → 2026.529.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/modules/conversations/index.cjs +272 -17
- package/dist/modules/conversations/index.d.cts +193 -0
- package/dist/modules/conversations/index.d.ts +193 -0
- package/dist/modules/conversations/index.js +268 -13
- package/dist/modules/export/index.cjs +69 -15
- package/dist/modules/export/index.d.cts +59 -1
- package/dist/modules/export/index.d.ts +59 -1
- package/dist/modules/export/index.js +69 -15
- package/dist/modules/integrations/index.cjs +132 -16
- package/dist/modules/integrations/index.d.cts +109 -1
- package/dist/modules/integrations/index.d.ts +109 -1
- package/dist/modules/integrations/index.js +132 -16
- package/dist/modules/scheduler/index.cjs +194 -18
- package/dist/modules/scheduler/index.d.cts +193 -1
- package/dist/modules/scheduler/index.d.ts +193 -1
- package/dist/modules/scheduler/index.js +194 -18
- package/dist/modules/vibecontrols/index.cjs +1247 -289
- package/dist/modules/vibecontrols/index.d.cts +1603 -5
- package/dist/modules/vibecontrols/index.d.ts +1603 -5
- package/dist/modules/vibecontrols/index.js +1253 -295
- package/package.json +2 -2
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var ue=["password","secret","clientSecret","apiKey","token","mfaCode","accessToken","refreshToken","workspaceToken","authorization"],pe=/\b(eyJ[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+)\b/g;function Ie(r){let s=r.replace(pe,"<redacted-jwt>");for(let e of ue){let t=new RegExp(`("${e}"\\s*:\\s*")[^"]*(")`,"gi");s=s.replace(t,"$1<redacted>$2");}return s}var i=class extends Error{code;cause;constructor(s,e="SDK_ERROR",t){super(Ie(s)),this.name="SdkError",this.code=e,this.cause=t;}};var d=`
|
|
2
2
|
fragment ConversationFields on Conversation {
|
|
3
3
|
id title type description avatar settings
|
|
4
4
|
state visibility isGroup memberCount unreadCount mentionCount
|
|
5
5
|
workspaceId createdBy createdAt updatedAt deletedAt
|
|
6
6
|
}
|
|
7
|
-
`,
|
|
7
|
+
`,a=`
|
|
8
8
|
fragment MessageFields on Message {
|
|
9
9
|
id conversationId authorId authorType content type
|
|
10
10
|
metadata status isEdited isPinned isHidden isAnonymous
|
|
11
11
|
readCount replyCount threadLevel threadRootId parentMessageId
|
|
12
12
|
createdAt updatedAt editedAt pinnedAt
|
|
13
13
|
}
|
|
14
|
-
`,
|
|
15
|
-
${
|
|
14
|
+
`,u=`
|
|
15
|
+
${d}
|
|
16
16
|
query Conversations($filter: ConversationFilter, $first: Int, $after: String, $sort: ConversationSort) {
|
|
17
17
|
conversations(filter: $filter, first: $first, after: $after, sort: $sort) {
|
|
18
18
|
edges { cursor node { ...ConversationFields } }
|
|
@@ -20,21 +20,21 @@
|
|
|
20
20
|
totalCount
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
-
`,
|
|
24
|
-
${
|
|
23
|
+
`,p=`
|
|
24
|
+
${d}
|
|
25
25
|
query Conversation($id: ID!) {
|
|
26
26
|
conversation(id: $id) { ...ConversationFields }
|
|
27
27
|
}
|
|
28
|
-
`,
|
|
29
|
-
${
|
|
28
|
+
`,I=`
|
|
29
|
+
${d}
|
|
30
30
|
mutation CreateConversation($input: CreateConversationInput!) {
|
|
31
31
|
createConversation(input: $input) {
|
|
32
32
|
success
|
|
33
33
|
conversation { ...ConversationFields }
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
|
-
`,
|
|
37
|
-
${
|
|
36
|
+
`,g=`
|
|
37
|
+
${d}
|
|
38
38
|
mutation UpdateConversation($input: UpdateConversationInput!) {
|
|
39
39
|
updateConversation(input: $input) {
|
|
40
40
|
success
|
|
@@ -48,8 +48,8 @@
|
|
|
48
48
|
conversationId
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
|
-
`,
|
|
52
|
-
${
|
|
51
|
+
`,C=`
|
|
52
|
+
${a}
|
|
53
53
|
query Messages($conversationId: ID!, $first: Int, $after: String, $before: String, $filter: MessageFilter) {
|
|
54
54
|
messages(conversationId: $conversationId, first: $first, after: $after, before: $before, filter: $filter) {
|
|
55
55
|
edges { cursor node { ...MessageFields } }
|
|
@@ -57,22 +57,22 @@
|
|
|
57
57
|
totalCount
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
|
-
`,
|
|
61
|
-
${
|
|
60
|
+
`,m=`
|
|
61
|
+
${a}
|
|
62
62
|
mutation SendMessage($input: SendMessageInput!) {
|
|
63
63
|
sendMessage(input: $input) {
|
|
64
64
|
success
|
|
65
65
|
message { ...MessageFields }
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
|
-
`,
|
|
68
|
+
`,l=`
|
|
69
69
|
query ConversationSettings($conversationId: ID!) {
|
|
70
70
|
conversation(id: $conversationId) {
|
|
71
71
|
id
|
|
72
72
|
settings
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
|
-
`,
|
|
75
|
+
`,E=`
|
|
76
76
|
mutation UpdateConversationSettings($input: UpdateConversationInput!) {
|
|
77
77
|
updateConversation(input: $input) {
|
|
78
78
|
success
|
|
@@ -82,4 +82,259 @@
|
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
|
-
|
|
85
|
+
`,A=`
|
|
86
|
+
${a}
|
|
87
|
+
query Message($id: ID!) {
|
|
88
|
+
message(id: $id) { ...MessageFields }
|
|
89
|
+
}
|
|
90
|
+
`,S=`
|
|
91
|
+
${a}
|
|
92
|
+
mutation EditMessage($input: EditMessageInput!) {
|
|
93
|
+
editMessage(input: $input) { ...MessageFields }
|
|
94
|
+
}
|
|
95
|
+
`,f=`
|
|
96
|
+
mutation DeleteMessage($id: ID!, $hard: Boolean) {
|
|
97
|
+
deleteMessage(id: $id, hard: $hard) { success messageId }
|
|
98
|
+
}
|
|
99
|
+
`,M=`
|
|
100
|
+
${a}
|
|
101
|
+
mutation ForwardMessage($messageId: ID!, $targetConversationId: ID!) {
|
|
102
|
+
forwardMessage(messageId: $messageId, targetConversationId: $targetConversationId) {
|
|
103
|
+
success
|
|
104
|
+
message { ...MessageFields }
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
`,T=`
|
|
108
|
+
${a}
|
|
109
|
+
mutation PinMessage($messageId: ID!) {
|
|
110
|
+
pinMessage(messageId: $messageId) { ...MessageFields }
|
|
111
|
+
}
|
|
112
|
+
`,$=`
|
|
113
|
+
${a}
|
|
114
|
+
mutation UnpinMessage($messageId: ID!) {
|
|
115
|
+
unpinMessage(messageId: $messageId) { ...MessageFields }
|
|
116
|
+
}
|
|
117
|
+
`,N=`
|
|
118
|
+
${a}
|
|
119
|
+
mutation HideMessage($messageId: ID!, $reason: String!) {
|
|
120
|
+
hideMessage(messageId: $messageId, reason: $reason) { ...MessageFields }
|
|
121
|
+
}
|
|
122
|
+
`,R=`
|
|
123
|
+
${a}
|
|
124
|
+
mutation UnhideMessage($messageId: ID!) {
|
|
125
|
+
unhideMessage(messageId: $messageId) { ...MessageFields }
|
|
126
|
+
}
|
|
127
|
+
`,P=`
|
|
128
|
+
${a}
|
|
129
|
+
query SearchMessages($query: String!, $conversationId: ID, $filter: MessageFilter, $first: Int, $after: String) {
|
|
130
|
+
searchMessages(query: $query, conversationId: $conversationId, filter: $filter, first: $first, after: $after) {
|
|
131
|
+
edges { cursor node { ...MessageFields } }
|
|
132
|
+
pageInfo { hasNextPage hasPreviousPage startCursor endCursor }
|
|
133
|
+
totalCount
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
`,_=`
|
|
137
|
+
${a}
|
|
138
|
+
query UnreadMessages($first: Int, $after: String) {
|
|
139
|
+
unreadMessages(first: $first, after: $after) {
|
|
140
|
+
edges { cursor node { ...MessageFields } }
|
|
141
|
+
pageInfo { hasNextPage hasPreviousPage startCursor endCursor }
|
|
142
|
+
totalCount
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
`,D=`
|
|
146
|
+
mutation ReportMessage($messageId: ID!, $reason: String!) {
|
|
147
|
+
reportMessage(messageId: $messageId, reason: $reason) {
|
|
148
|
+
success
|
|
149
|
+
messageId
|
|
150
|
+
reportId
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
`,O=`
|
|
154
|
+
fragment DraftFields on DraftMessage {
|
|
155
|
+
id conversationId userId content parentMessageId createdAt updatedAt
|
|
156
|
+
}
|
|
157
|
+
`,y=`
|
|
158
|
+
${O}
|
|
159
|
+
query Draft($conversationId: ID!) {
|
|
160
|
+
draft(conversationId: $conversationId) { ...DraftFields }
|
|
161
|
+
}
|
|
162
|
+
`,h=`
|
|
163
|
+
${O}
|
|
164
|
+
mutation SaveDraft($input: SaveDraftInput!) {
|
|
165
|
+
saveDraft(input: $input) { ...DraftFields }
|
|
166
|
+
}
|
|
167
|
+
`,x=`
|
|
168
|
+
mutation DeleteDraft($conversationId: ID!) {
|
|
169
|
+
deleteDraft(conversationId: $conversationId) { success conversationId }
|
|
170
|
+
}
|
|
171
|
+
`,b=`
|
|
172
|
+
mutation AddReaction($messageId: ID!, $emoji: String!) {
|
|
173
|
+
addReaction(messageId: $messageId, emoji: $emoji) {
|
|
174
|
+
id messageId userId emoji createdAt
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
`,w=`
|
|
178
|
+
mutation RemoveReaction($messageId: ID!, $emoji: String!) {
|
|
179
|
+
removeReaction(messageId: $messageId, emoji: $emoji) {
|
|
180
|
+
success messageId emoji
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
`,F=`
|
|
184
|
+
${a}
|
|
185
|
+
query Thread($messageId: ID!, $first: Int, $after: String) {
|
|
186
|
+
thread(messageId: $messageId, first: $first, after: $after) {
|
|
187
|
+
edges { cursor node { ...MessageFields } }
|
|
188
|
+
pageInfo { hasNextPage hasPreviousPage startCursor endCursor }
|
|
189
|
+
totalCount
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
`,q=`
|
|
193
|
+
${d}
|
|
194
|
+
mutation GetOrCreateDirectConversation($userId: ID!) {
|
|
195
|
+
getOrCreateDirectConversation(userId: $userId) { ...ConversationFields }
|
|
196
|
+
}
|
|
197
|
+
`,V=`
|
|
198
|
+
${a}
|
|
199
|
+
query Mentions($first: Int, $after: String, $unreadOnly: Boolean) {
|
|
200
|
+
mentions(first: $first, after: $after, unreadOnly: $unreadOnly) {
|
|
201
|
+
edges { cursor node { ...MessageFields } }
|
|
202
|
+
pageInfo { hasNextPage hasPreviousPage startCursor endCursor }
|
|
203
|
+
totalCount
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
`,L=`
|
|
207
|
+
${d}
|
|
208
|
+
query SearchConversations($query: String!, $filter: ConversationFilter, $first: Int, $after: String) {
|
|
209
|
+
searchConversations(query: $query, filter: $filter, first: $first, after: $after) {
|
|
210
|
+
edges { cursor node { ...ConversationFields } }
|
|
211
|
+
pageInfo { hasNextPage hasPreviousPage startCursor endCursor }
|
|
212
|
+
totalCount
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
`,G=`
|
|
216
|
+
fragment PresenceFields on Presence {
|
|
217
|
+
userId status customStatus lastSeenAt
|
|
218
|
+
}
|
|
219
|
+
`,U=`
|
|
220
|
+
${G}
|
|
221
|
+
query Presence($userIds: [ID!]!) {
|
|
222
|
+
presence(userIds: $userIds) { ...PresenceFields }
|
|
223
|
+
}
|
|
224
|
+
`,k=`
|
|
225
|
+
${G}
|
|
226
|
+
mutation UpdatePresence($status: PresenceStatus!, $customStatus: String) {
|
|
227
|
+
updatePresence(status: $status, customStatus: $customStatus) { ...PresenceFields }
|
|
228
|
+
}
|
|
229
|
+
`,j=`
|
|
230
|
+
query TypingIndicators($conversationId: ID!) {
|
|
231
|
+
typingIndicators(conversationId: $conversationId) {
|
|
232
|
+
conversationId userId startedAt
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
`,H=`
|
|
236
|
+
mutation StartTyping($conversationId: ID!) {
|
|
237
|
+
startTyping(conversationId: $conversationId)
|
|
238
|
+
}
|
|
239
|
+
`,K=`
|
|
240
|
+
mutation StopTyping($conversationId: ID!) {
|
|
241
|
+
stopTyping(conversationId: $conversationId)
|
|
242
|
+
}
|
|
243
|
+
`,o=`
|
|
244
|
+
fragment MembershipFields on ConversationMembership {
|
|
245
|
+
id conversationId userId customTitle customAvatar invitedBy
|
|
246
|
+
canAddMembers canRemoveMembers canSendMessages createdAt
|
|
247
|
+
}
|
|
248
|
+
`,Y=`
|
|
249
|
+
${o}
|
|
250
|
+
mutation AddParticipant($input: AddParticipantInput!) {
|
|
251
|
+
addParticipant(input: $input) { ...MembershipFields }
|
|
252
|
+
}
|
|
253
|
+
`,z=`
|
|
254
|
+
mutation RemoveParticipant($input: RemoveParticipantInput!) {
|
|
255
|
+
removeParticipant(input: $input) {
|
|
256
|
+
success conversationId userId
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
`,B=`
|
|
260
|
+
${o}
|
|
261
|
+
mutation UpdateParticipantRole($input: UpdateParticipantRoleInput!) {
|
|
262
|
+
updateParticipantRole(input: $input) { ...MembershipFields }
|
|
263
|
+
}
|
|
264
|
+
`,J=`
|
|
265
|
+
mutation LeaveConversation($conversationId: ID!) {
|
|
266
|
+
leaveConversation(conversationId: $conversationId) {
|
|
267
|
+
success conversationId
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
`,W=`
|
|
271
|
+
${d}
|
|
272
|
+
mutation ArchiveConversation($id: ID!) {
|
|
273
|
+
archiveConversation(id: $id) { ...ConversationFields }
|
|
274
|
+
}
|
|
275
|
+
`,Z=`
|
|
276
|
+
${d}
|
|
277
|
+
mutation UnarchiveConversation($id: ID!) {
|
|
278
|
+
unarchiveConversation(id: $id) { ...ConversationFields }
|
|
279
|
+
}
|
|
280
|
+
`,X=`
|
|
281
|
+
${o}
|
|
282
|
+
mutation MuteConversation($conversationId: ID!, $until: DateTime) {
|
|
283
|
+
muteConversation(conversationId: $conversationId, until: $until) { ...MembershipFields }
|
|
284
|
+
}
|
|
285
|
+
`,Q=`
|
|
286
|
+
${o}
|
|
287
|
+
mutation UnmuteConversation($conversationId: ID!) {
|
|
288
|
+
unmuteConversation(conversationId: $conversationId) { ...MembershipFields }
|
|
289
|
+
}
|
|
290
|
+
`,ee=`
|
|
291
|
+
${o}
|
|
292
|
+
mutation PinConversation($conversationId: ID!) {
|
|
293
|
+
pinConversation(conversationId: $conversationId) { ...MembershipFields }
|
|
294
|
+
}
|
|
295
|
+
`,te=`
|
|
296
|
+
${o}
|
|
297
|
+
mutation UnpinConversation($conversationId: ID!) {
|
|
298
|
+
unpinConversation(conversationId: $conversationId) { ...MembershipFields }
|
|
299
|
+
}
|
|
300
|
+
`,se=`
|
|
301
|
+
${o}
|
|
302
|
+
mutation MarkConversationAsRead($conversationId: ID!, $messageId: ID) {
|
|
303
|
+
markConversationAsRead(conversationId: $conversationId, messageId: $messageId) { ...MembershipFields }
|
|
304
|
+
}
|
|
305
|
+
`,ge=`
|
|
306
|
+
fragment InviteFields on InviteLink {
|
|
307
|
+
code url createdBy currentUses maxUses expiresAt createdAt
|
|
308
|
+
}
|
|
309
|
+
`,ne=`
|
|
310
|
+
${ge}
|
|
311
|
+
mutation CreateInviteLink($input: CreateInviteLinkInput!) {
|
|
312
|
+
createInviteLink(input: $input) { ...InviteFields }
|
|
313
|
+
}
|
|
314
|
+
`,ae=`
|
|
315
|
+
${o}
|
|
316
|
+
mutation JoinViaInviteLink($code: String!) {
|
|
317
|
+
joinViaInviteLink(code: $code) { ...MembershipFields }
|
|
318
|
+
}
|
|
319
|
+
`,oe=`
|
|
320
|
+
query ValidateInviteLink($code: String!) {
|
|
321
|
+
validateInviteLink(code: $code) {
|
|
322
|
+
valid
|
|
323
|
+
usesRemaining
|
|
324
|
+
expiresAt
|
|
325
|
+
conversation { id title type }
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
`,re=`
|
|
329
|
+
mutation VotePoll($pollId: ID!, $optionIds: [ID!]!) {
|
|
330
|
+
votePoll(pollId: $pollId, optionIds: $optionIds) {
|
|
331
|
+
id question totalVotes isClosed
|
|
332
|
+
options { id }
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
`,ie=`
|
|
336
|
+
${o}
|
|
337
|
+
mutation UpdateNotificationSettings($input: UpdateNotificationSettingsInput!) {
|
|
338
|
+
updateNotificationSettings(input: $input) { ...MembershipFields }
|
|
339
|
+
}
|
|
340
|
+
`;function de(r,s){if(s==null)return null;let e=s??{};return {conversationId:r,notificationsEnabled:typeof e.notificationsEnabled=="boolean"?e.notificationsEnabled:null,muted:typeof e.muted=="boolean"?e.muted:null,pinned:typeof e.pinned=="boolean"?e.pinned:null,metadata:e.metadata??null}}function ce(r){let{workspace:s}=r.gql;return {async list(e){return (await s.request(u,{filter:e?.filter,first:e?.first,after:e?.after,sort:e?.sort})).conversations},async get(e){return (await s.request(p,{id:e})).conversation},async create(e){let t=await s.request(I,{input:e});if(!t.createConversation.success||!t.createConversation.conversation)throw new i("conversations.create: server returned empty conversation","CREATE_CONVERSATION_FAILED");return t.createConversation.conversation},async update(e){let t=await s.request(g,{input:e});if(!t.updateConversation.success||!t.updateConversation.conversation)throw new i("conversations.update: server returned empty conversation","UPDATE_CONVERSATION_FAILED");return t.updateConversation.conversation},async delete(e){return (await s.request(v,{id:e})).deleteConversation.success},messages:{async list(e,t){return (await s.request(C,{conversationId:e,first:t?.first,after:t?.after,before:t?.before,filter:t?.filter})).messages},async send(e){let t=await s.request(m,{input:e});if(!t.sendMessage.success||!t.sendMessage.message)throw new i("conversations.messages.send: server returned empty message","SEND_MESSAGE_FAILED");return t.sendMessage.message},async get(e){return (await s.request(A,{id:e})).message},async edit(e){return (await s.request(S,{input:e})).editMessage},async delete(e,t){return (await s.request(f,{id:e,hard:t})).deleteMessage.success},async forward(e,t){let n=await s.request(M,{messageId:e,targetConversationId:t});if(!n.forwardMessage.success||!n.forwardMessage.message)throw new i("conversations.messages.forward: server returned empty message","FORWARD_MESSAGE_FAILED");return n.forwardMessage.message},async pin(e){return (await s.request(T,{messageId:e})).pinMessage},async unpin(e){return (await s.request($,{messageId:e})).unpinMessage},async hide(e,t){return (await s.request(N,{messageId:e,reason:t})).hideMessage},async unhide(e){return (await s.request(R,{messageId:e})).unhideMessage},async search(e,t){return (await s.request(P,{query:e,conversationId:t?.conversationId,filter:t?.filter,first:t?.first,after:t?.after})).searchMessages},async unread(e){return (await s.request(_,{first:e?.first,after:e?.after})).unreadMessages},async report(e,t){let n=await s.request(D,{messageId:e,reason:t});return {success:n.reportMessage.success,reportId:n.reportMessage.reportId}}},drafts:{async get(e){return (await s.request(y,{conversationId:e})).draft},async save(e){return (await s.request(h,{input:e})).saveDraft},async delete(e){return (await s.request(x,{conversationId:e})).deleteDraft.success}},reactions:{async add(e,t){return (await s.request(b,{messageId:e,emoji:t})).addReaction},async remove(e,t){return (await s.request(w,{messageId:e,emoji:t})).removeReaction.success}},threads:{async get(e,t){return (await s.request(F,{messageId:e,first:t?.first,after:t?.after})).thread}},mentions:{async list(e){return (await s.request(V,{first:e?.first,after:e?.after,unreadOnly:e?.unreadOnly})).mentions}},presence:{async get(e){return (await s.request(U,{userIds:e})).presence},async update(e,t){return (await s.request(k,{status:e,customStatus:t})).updatePresence}},typing:{async list(e){return (await s.request(j,{conversationId:e})).typingIndicators},async start(e){return (await s.request(H,{conversationId:e})).startTyping},async stop(e){return (await s.request(K,{conversationId:e})).stopTyping}},participants:{async add(e){return (await s.request(Y,{input:e})).addParticipant},async remove(e){return (await s.request(z,{input:e})).removeParticipant.success},async updateRole(e){return (await s.request(B,{input:e})).updateParticipantRole}},invites:{async create(e){return (await s.request(ne,{input:e})).createInviteLink},async join(e){return (await s.request(ae,{code:e})).joinViaInviteLink},async validate(e){return (await s.request(oe,{code:e})).validateInviteLink}},polls:{async vote(e,t){return (await s.request(re,{pollId:e,optionIds:t})).votePoll}},notifications:{async update(e){return (await s.request(ie,{input:e})).updateNotificationSettings}},async getOrCreateDirect(e){return (await s.request(q,{userId:e})).getOrCreateDirectConversation},async search(e,t){return (await s.request(L,{query:e,filter:t?.filter,first:t?.first,after:t?.after})).searchConversations},async archive(e){return (await s.request(W,{id:e})).archiveConversation},async unarchive(e){return (await s.request(Z,{id:e})).unarchiveConversation},async mute(e,t){return (await s.request(X,{conversationId:e,until:t})).muteConversation},async unmute(e){return (await s.request(Q,{conversationId:e})).unmuteConversation},async pin(e){return (await s.request(ee,{conversationId:e})).pinConversation},async unpin(e){return (await s.request(te,{conversationId:e})).unpinConversation},async markAsRead(e,t){return (await s.request(se,{conversationId:e,messageId:t})).markConversationAsRead},async leave(e){return (await s.request(J,{conversationId:e})).leaveConversation.success},settings:{async get(e){let t=await s.request(l,{conversationId:e});return t.conversation?de(e,t.conversation.settings):null},async set(e){let t={id:e.conversationId,settings:{notificationsEnabled:e.notificationsEnabled,muted:e.muted,pinned:e.pinned,metadata:e.metadata}},n=await s.request(E,{input:t});if(!n.updateConversation.success||!n.updateConversation.conversation)throw new i("conversations.settings.set: server returned empty conversation","UPDATE_CONVERSATION_SETTINGS_FAILED");return de(e.conversationId,n.updateConversation.conversation.settings)??{conversationId:e.conversationId,notificationsEnabled:e.notificationsEnabled??null,muted:e.muted??null,pinned:e.pinned??null,metadata:e.metadata??null}}}}}var ve={id:"conversations",version:"1.0.0",displayName:"Conversations",dependsOn:["auth"],attach(r){return ce(r)}},$e=ve;module.exports=$e;
|
|
@@ -127,6 +127,106 @@ interface UpdateConversationSettingsInput {
|
|
|
127
127
|
pinned?: boolean;
|
|
128
128
|
metadata?: Json;
|
|
129
129
|
}
|
|
130
|
+
interface EditMessageInput {
|
|
131
|
+
id: string;
|
|
132
|
+
content: Json;
|
|
133
|
+
reason?: string;
|
|
134
|
+
}
|
|
135
|
+
interface SaveDraftInput {
|
|
136
|
+
conversationId: string;
|
|
137
|
+
content: Json;
|
|
138
|
+
parentMessageId?: string;
|
|
139
|
+
}
|
|
140
|
+
interface DraftMessage {
|
|
141
|
+
id: string;
|
|
142
|
+
conversationId: string;
|
|
143
|
+
userId: string;
|
|
144
|
+
content: Json;
|
|
145
|
+
parentMessageId?: string | null;
|
|
146
|
+
createdAt: string;
|
|
147
|
+
updatedAt: string;
|
|
148
|
+
}
|
|
149
|
+
interface Reaction {
|
|
150
|
+
id: string;
|
|
151
|
+
messageId: string;
|
|
152
|
+
userId: string;
|
|
153
|
+
emoji: string;
|
|
154
|
+
createdAt: string;
|
|
155
|
+
}
|
|
156
|
+
type PresenceStatus = 'ONLINE' | 'OFFLINE' | 'AWAY' | 'DO_NOT_DISTURB';
|
|
157
|
+
interface Presence {
|
|
158
|
+
userId: string;
|
|
159
|
+
status: PresenceStatus;
|
|
160
|
+
customStatus?: string | null;
|
|
161
|
+
lastSeenAt?: string | null;
|
|
162
|
+
}
|
|
163
|
+
interface TypingIndicator {
|
|
164
|
+
conversationId: string;
|
|
165
|
+
userId: string;
|
|
166
|
+
startedAt: string;
|
|
167
|
+
}
|
|
168
|
+
type ParticipantRole = 'ADMIN' | 'MODERATOR' | 'MEMBER' | 'GUEST';
|
|
169
|
+
interface ConversationMembership {
|
|
170
|
+
id: string;
|
|
171
|
+
conversationId: string;
|
|
172
|
+
userId: string;
|
|
173
|
+
customTitle?: string | null;
|
|
174
|
+
customAvatar?: string | null;
|
|
175
|
+
invitedBy?: string | null;
|
|
176
|
+
canAddMembers: boolean;
|
|
177
|
+
canRemoveMembers: boolean;
|
|
178
|
+
canSendMessages: boolean;
|
|
179
|
+
createdAt: string;
|
|
180
|
+
}
|
|
181
|
+
interface AddParticipantInput {
|
|
182
|
+
conversationId: string;
|
|
183
|
+
userId: string;
|
|
184
|
+
role?: ParticipantRole;
|
|
185
|
+
}
|
|
186
|
+
interface RemoveParticipantInput {
|
|
187
|
+
conversationId: string;
|
|
188
|
+
userId: string;
|
|
189
|
+
reason?: string;
|
|
190
|
+
}
|
|
191
|
+
interface UpdateParticipantRoleInput {
|
|
192
|
+
conversationId: string;
|
|
193
|
+
userId: string;
|
|
194
|
+
role: ParticipantRole;
|
|
195
|
+
}
|
|
196
|
+
interface InviteLink {
|
|
197
|
+
code: string;
|
|
198
|
+
url: string;
|
|
199
|
+
createdBy: string;
|
|
200
|
+
currentUses: number;
|
|
201
|
+
maxUses?: number | null;
|
|
202
|
+
expiresAt?: string | null;
|
|
203
|
+
createdAt: string;
|
|
204
|
+
}
|
|
205
|
+
interface InviteLinkInfo {
|
|
206
|
+
valid: boolean;
|
|
207
|
+
usesRemaining?: number | null;
|
|
208
|
+
expiresAt?: string | null;
|
|
209
|
+
conversation?: Pick<Conversation, 'id' | 'title' | 'type'> | null;
|
|
210
|
+
}
|
|
211
|
+
interface CreateInviteLinkInput {
|
|
212
|
+
conversationId: string;
|
|
213
|
+
maxUses?: number;
|
|
214
|
+
expiresAt?: string;
|
|
215
|
+
}
|
|
216
|
+
type NotificationLevel = 'ALL' | 'MENTIONS' | 'MUTED' | 'NONE';
|
|
217
|
+
interface UpdateNotificationSettingsInput {
|
|
218
|
+
conversationId: string;
|
|
219
|
+
notificationLevel: NotificationLevel;
|
|
220
|
+
}
|
|
221
|
+
interface Poll {
|
|
222
|
+
id: string;
|
|
223
|
+
question: string;
|
|
224
|
+
totalVotes: number;
|
|
225
|
+
isClosed: boolean;
|
|
226
|
+
options: Array<{
|
|
227
|
+
id: string;
|
|
228
|
+
}>;
|
|
229
|
+
}
|
|
130
230
|
|
|
131
231
|
interface ConversationMessagesApi {
|
|
132
232
|
list(conversationId: string, opts?: {
|
|
@@ -136,6 +236,75 @@ interface ConversationMessagesApi {
|
|
|
136
236
|
filter?: MessageFilter;
|
|
137
237
|
}): Promise<MessageConnection>;
|
|
138
238
|
send(input: SendMessageInput): Promise<Message>;
|
|
239
|
+
get(id: string): Promise<Message | null>;
|
|
240
|
+
edit(input: EditMessageInput): Promise<Message>;
|
|
241
|
+
delete(id: string, hard?: boolean): Promise<boolean>;
|
|
242
|
+
forward(messageId: string, targetConversationId: string): Promise<Message>;
|
|
243
|
+
pin(messageId: string): Promise<Message>;
|
|
244
|
+
unpin(messageId: string): Promise<Message>;
|
|
245
|
+
hide(messageId: string, reason: string): Promise<Message>;
|
|
246
|
+
unhide(messageId: string): Promise<Message>;
|
|
247
|
+
search(query: string, opts?: {
|
|
248
|
+
conversationId?: string;
|
|
249
|
+
filter?: MessageFilter;
|
|
250
|
+
first?: number;
|
|
251
|
+
after?: string;
|
|
252
|
+
}): Promise<MessageConnection>;
|
|
253
|
+
unread(opts?: {
|
|
254
|
+
first?: number;
|
|
255
|
+
after?: string;
|
|
256
|
+
}): Promise<MessageConnection>;
|
|
257
|
+
report(messageId: string, reason: string): Promise<{
|
|
258
|
+
success: boolean;
|
|
259
|
+
reportId: string;
|
|
260
|
+
}>;
|
|
261
|
+
}
|
|
262
|
+
interface ConversationDraftsApi {
|
|
263
|
+
get(conversationId: string): Promise<DraftMessage | null>;
|
|
264
|
+
save(input: SaveDraftInput): Promise<DraftMessage>;
|
|
265
|
+
delete(conversationId: string): Promise<boolean>;
|
|
266
|
+
}
|
|
267
|
+
interface ConversationReactionsApi {
|
|
268
|
+
add(messageId: string, emoji: string): Promise<Reaction>;
|
|
269
|
+
remove(messageId: string, emoji: string): Promise<boolean>;
|
|
270
|
+
}
|
|
271
|
+
interface ConversationThreadsApi {
|
|
272
|
+
get(messageId: string, opts?: {
|
|
273
|
+
first?: number;
|
|
274
|
+
after?: string;
|
|
275
|
+
}): Promise<MessageConnection>;
|
|
276
|
+
}
|
|
277
|
+
interface ConversationMentionsApi {
|
|
278
|
+
list(opts?: {
|
|
279
|
+
first?: number;
|
|
280
|
+
after?: string;
|
|
281
|
+
unreadOnly?: boolean;
|
|
282
|
+
}): Promise<MessageConnection>;
|
|
283
|
+
}
|
|
284
|
+
interface ConversationPresenceApi {
|
|
285
|
+
get(userIds: string[]): Promise<Presence[]>;
|
|
286
|
+
update(status: PresenceStatus, customStatus?: string): Promise<Presence>;
|
|
287
|
+
}
|
|
288
|
+
interface ConversationTypingApi {
|
|
289
|
+
list(conversationId: string): Promise<TypingIndicator[]>;
|
|
290
|
+
start(conversationId: string): Promise<boolean>;
|
|
291
|
+
stop(conversationId: string): Promise<boolean>;
|
|
292
|
+
}
|
|
293
|
+
interface ConversationParticipantsApi {
|
|
294
|
+
add(input: AddParticipantInput): Promise<ConversationMembership>;
|
|
295
|
+
remove(input: RemoveParticipantInput): Promise<boolean>;
|
|
296
|
+
updateRole(input: UpdateParticipantRoleInput): Promise<ConversationMembership>;
|
|
297
|
+
}
|
|
298
|
+
interface ConversationInvitesApi {
|
|
299
|
+
create(input: CreateInviteLinkInput): Promise<InviteLink>;
|
|
300
|
+
join(code: string): Promise<ConversationMembership>;
|
|
301
|
+
validate(code: string): Promise<InviteLinkInfo>;
|
|
302
|
+
}
|
|
303
|
+
interface ConversationPollsApi {
|
|
304
|
+
vote(pollId: string, optionIds: string[]): Promise<Poll>;
|
|
305
|
+
}
|
|
306
|
+
interface ConversationNotificationsApi {
|
|
307
|
+
update(input: UpdateNotificationSettingsInput): Promise<ConversationMembership>;
|
|
139
308
|
}
|
|
140
309
|
interface ConversationSettingsApi {
|
|
141
310
|
get(conversationId: string): Promise<ConversationSettings | null>;
|
|
@@ -155,6 +324,30 @@ interface ConversationsApi {
|
|
|
155
324
|
delete(id: string): Promise<boolean>;
|
|
156
325
|
messages: ConversationMessagesApi;
|
|
157
326
|
settings: ConversationSettingsApi;
|
|
327
|
+
drafts: ConversationDraftsApi;
|
|
328
|
+
reactions: ConversationReactionsApi;
|
|
329
|
+
threads: ConversationThreadsApi;
|
|
330
|
+
mentions: ConversationMentionsApi;
|
|
331
|
+
presence: ConversationPresenceApi;
|
|
332
|
+
typing: ConversationTypingApi;
|
|
333
|
+
participants: ConversationParticipantsApi;
|
|
334
|
+
invites: ConversationInvitesApi;
|
|
335
|
+
polls: ConversationPollsApi;
|
|
336
|
+
notifications: ConversationNotificationsApi;
|
|
337
|
+
getOrCreateDirect(userId: string): Promise<Conversation>;
|
|
338
|
+
search(query: string, opts?: {
|
|
339
|
+
filter?: ConversationFilterInput;
|
|
340
|
+
first?: number;
|
|
341
|
+
after?: string;
|
|
342
|
+
}): Promise<ConversationConnection>;
|
|
343
|
+
archive(id: string): Promise<Conversation>;
|
|
344
|
+
unarchive(id: string): Promise<Conversation>;
|
|
345
|
+
mute(conversationId: string, until?: string): Promise<ConversationMembership>;
|
|
346
|
+
unmute(conversationId: string): Promise<ConversationMembership>;
|
|
347
|
+
pin(conversationId: string): Promise<ConversationMembership>;
|
|
348
|
+
unpin(conversationId: string): Promise<ConversationMembership>;
|
|
349
|
+
markAsRead(conversationId: string, messageId?: string): Promise<ConversationMembership>;
|
|
350
|
+
leave(conversationId: string): Promise<boolean>;
|
|
158
351
|
}
|
|
159
352
|
|
|
160
353
|
declare const conversationsModule: SdkModule<ConversationsApi>;
|