@nurama/sdk 0.0.0-stage → 1.4.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 (225) hide show
  1. package/LICENSE +202 -0
  2. package/NOTICE +5 -0
  3. package/README.md +1080 -2
  4. package/dist/BotClient.d.ts +66 -0
  5. package/dist/BotClient.d.ts.map +1 -0
  6. package/dist/BotClient.js +68 -0
  7. package/dist/BotClient.js.map +1 -0
  8. package/dist/NuramaClient.d.ts +480 -0
  9. package/dist/NuramaClient.d.ts.map +1 -0
  10. package/dist/NuramaClient.js +902 -0
  11. package/dist/NuramaClient.js.map +1 -0
  12. package/dist/browser/nurama-bot-sdk.js +12051 -0
  13. package/dist/browser/nurama-bot-sdk.min.js +1 -0
  14. package/dist/browser/nurama-sdk.js +12003 -0
  15. package/dist/browser/nurama-sdk.min.js +1 -0
  16. package/dist/routes/ai.d.ts +280 -0
  17. package/dist/routes/ai.d.ts.map +1 -0
  18. package/dist/routes/ai.js +173 -0
  19. package/dist/routes/ai.js.map +1 -0
  20. package/dist/routes/asset.d.ts +493 -0
  21. package/dist/routes/asset.d.ts.map +1 -0
  22. package/dist/routes/asset.js +848 -0
  23. package/dist/routes/asset.js.map +1 -0
  24. package/dist/routes/auth.d.ts +218 -0
  25. package/dist/routes/auth.d.ts.map +1 -0
  26. package/dist/routes/auth.js +454 -0
  27. package/dist/routes/auth.js.map +1 -0
  28. package/dist/routes/blogPosts.d.ts +17 -0
  29. package/dist/routes/blogPosts.d.ts.map +1 -0
  30. package/dist/routes/blogPosts.js +29 -0
  31. package/dist/routes/blogPosts.js.map +1 -0
  32. package/dist/routes/board.d.ts +187 -0
  33. package/dist/routes/board.d.ts.map +1 -0
  34. package/dist/routes/board.js +270 -0
  35. package/dist/routes/board.js.map +1 -0
  36. package/dist/routes/bot.d.ts +202 -0
  37. package/dist/routes/bot.d.ts.map +1 -0
  38. package/dist/routes/bot.js +229 -0
  39. package/dist/routes/bot.js.map +1 -0
  40. package/dist/routes/chat.d.ts +842 -0
  41. package/dist/routes/chat.d.ts.map +1 -0
  42. package/dist/routes/chat.js +863 -0
  43. package/dist/routes/chat.js.map +1 -0
  44. package/dist/routes/chatAi.d.ts +51 -0
  45. package/dist/routes/chatAi.d.ts.map +1 -0
  46. package/dist/routes/chatAi.js +109 -0
  47. package/dist/routes/chatAi.js.map +1 -0
  48. package/dist/routes/config.d.ts +11 -0
  49. package/dist/routes/config.d.ts.map +1 -0
  50. package/dist/routes/config.js +24 -0
  51. package/dist/routes/config.js.map +1 -0
  52. package/dist/routes/convo.d.ts +169 -0
  53. package/dist/routes/convo.d.ts.map +1 -0
  54. package/dist/routes/convo.js +284 -0
  55. package/dist/routes/convo.js.map +1 -0
  56. package/dist/routes/credits.d.ts +82 -0
  57. package/dist/routes/credits.d.ts.map +1 -0
  58. package/dist/routes/credits.js +49 -0
  59. package/dist/routes/credits.js.map +1 -0
  60. package/dist/routes/device.d.ts +74 -0
  61. package/dist/routes/device.d.ts.map +1 -0
  62. package/dist/routes/device.js +122 -0
  63. package/dist/routes/device.js.map +1 -0
  64. package/dist/routes/folder.d.ts +75 -0
  65. package/dist/routes/folder.d.ts.map +1 -0
  66. package/dist/routes/folder.js +99 -0
  67. package/dist/routes/folder.js.map +1 -0
  68. package/dist/routes/invite.d.ts +61 -0
  69. package/dist/routes/invite.d.ts.map +1 -0
  70. package/dist/routes/invite.js +86 -0
  71. package/dist/routes/invite.js.map +1 -0
  72. package/dist/routes/joinLink.d.ts +88 -0
  73. package/dist/routes/joinLink.d.ts.map +1 -0
  74. package/dist/routes/joinLink.js +205 -0
  75. package/dist/routes/joinLink.js.map +1 -0
  76. package/dist/routes/membership.d.ts +116 -0
  77. package/dist/routes/membership.d.ts.map +1 -0
  78. package/dist/routes/membership.js +183 -0
  79. package/dist/routes/membership.js.map +1 -0
  80. package/dist/routes/notification.d.ts +103 -0
  81. package/dist/routes/notification.d.ts.map +1 -0
  82. package/dist/routes/notification.js +89 -0
  83. package/dist/routes/notification.js.map +1 -0
  84. package/dist/routes/oauthGrant.d.ts +45 -0
  85. package/dist/routes/oauthGrant.d.ts.map +1 -0
  86. package/dist/routes/oauthGrant.js +32 -0
  87. package/dist/routes/oauthGrant.js.map +1 -0
  88. package/dist/routes/payment.d.ts +56 -0
  89. package/dist/routes/payment.d.ts.map +1 -0
  90. package/dist/routes/payment.js +78 -0
  91. package/dist/routes/payment.js.map +1 -0
  92. package/dist/routes/product.d.ts +43 -0
  93. package/dist/routes/product.d.ts.map +1 -0
  94. package/dist/routes/product.js +53 -0
  95. package/dist/routes/product.js.map +1 -0
  96. package/dist/routes/project.d.ts +821 -0
  97. package/dist/routes/project.d.ts.map +1 -0
  98. package/dist/routes/project.js +1153 -0
  99. package/dist/routes/project.js.map +1 -0
  100. package/dist/routes/public.d.ts +269 -0
  101. package/dist/routes/public.d.ts.map +1 -0
  102. package/dist/routes/public.js +412 -0
  103. package/dist/routes/public.js.map +1 -0
  104. package/dist/routes/scratch.d.ts +70 -0
  105. package/dist/routes/scratch.d.ts.map +1 -0
  106. package/dist/routes/scratch.js +67 -0
  107. package/dist/routes/scratch.js.map +1 -0
  108. package/dist/routes/settings.d.ts +102 -0
  109. package/dist/routes/settings.d.ts.map +1 -0
  110. package/dist/routes/settings.js +94 -0
  111. package/dist/routes/settings.js.map +1 -0
  112. package/dist/routes/shortlink.d.ts +79 -0
  113. package/dist/routes/shortlink.d.ts.map +1 -0
  114. package/dist/routes/shortlink.js +25 -0
  115. package/dist/routes/shortlink.js.map +1 -0
  116. package/dist/routes/socket.d.ts +108 -0
  117. package/dist/routes/socket.d.ts.map +1 -0
  118. package/dist/routes/socket.js +573 -0
  119. package/dist/routes/socket.js.map +1 -0
  120. package/dist/routes/storage.d.ts +44 -0
  121. package/dist/routes/storage.d.ts.map +1 -0
  122. package/dist/routes/storage.js +49 -0
  123. package/dist/routes/storage.js.map +1 -0
  124. package/dist/routes/subscription.d.ts +184 -0
  125. package/dist/routes/subscription.d.ts.map +1 -0
  126. package/dist/routes/subscription.js +219 -0
  127. package/dist/routes/subscription.js.map +1 -0
  128. package/dist/routes/supportChat.d.ts +40 -0
  129. package/dist/routes/supportChat.d.ts.map +1 -0
  130. package/dist/routes/supportChat.js +53 -0
  131. package/dist/routes/supportChat.js.map +1 -0
  132. package/dist/routes/supportTicket.d.ts +89 -0
  133. package/dist/routes/supportTicket.d.ts.map +1 -0
  134. package/dist/routes/supportTicket.js +54 -0
  135. package/dist/routes/supportTicket.js.map +1 -0
  136. package/dist/routes/tag.d.ts +72 -0
  137. package/dist/routes/tag.d.ts.map +1 -0
  138. package/dist/routes/tag.js +81 -0
  139. package/dist/routes/tag.js.map +1 -0
  140. package/dist/routes/task.d.ts +252 -0
  141. package/dist/routes/task.d.ts.map +1 -0
  142. package/dist/routes/task.js +284 -0
  143. package/dist/routes/task.js.map +1 -0
  144. package/dist/routes/taskRelation.d.ts +80 -0
  145. package/dist/routes/taskRelation.d.ts.map +1 -0
  146. package/dist/routes/taskRelation.js +71 -0
  147. package/dist/routes/taskRelation.js.map +1 -0
  148. package/dist/routes/token.d.ts +97 -0
  149. package/dist/routes/token.d.ts.map +1 -0
  150. package/dist/routes/token.js +73 -0
  151. package/dist/routes/token.js.map +1 -0
  152. package/dist/routes/user.d.ts +112 -0
  153. package/dist/routes/user.d.ts.map +1 -0
  154. package/dist/routes/user.js +151 -0
  155. package/dist/routes/user.js.map +1 -0
  156. package/dist/routes/version.d.ts +42 -0
  157. package/dist/routes/version.d.ts.map +1 -0
  158. package/dist/routes/version.js +38 -0
  159. package/dist/routes/version.js.map +1 -0
  160. package/dist/routes/webhook.d.ts +170 -0
  161. package/dist/routes/webhook.d.ts.map +1 -0
  162. package/dist/routes/webhook.js +173 -0
  163. package/dist/routes/webhook.js.map +1 -0
  164. package/dist/routes/workspace.d.ts +120 -0
  165. package/dist/routes/workspace.d.ts.map +1 -0
  166. package/dist/routes/workspace.js +199 -0
  167. package/dist/routes/workspace.js.map +1 -0
  168. package/dist/utils/uploadSessionManager.d.ts +133 -0
  169. package/dist/utils/uploadSessionManager.d.ts.map +1 -0
  170. package/dist/utils/uploadSessionManager.js +321 -0
  171. package/dist/utils/uploadSessionManager.js.map +1 -0
  172. package/dist/utils/urlParams.d.ts +35 -0
  173. package/dist/utils/urlParams.d.ts.map +1 -0
  174. package/dist/utils/urlParams.js +146 -0
  175. package/dist/utils/urlParams.js.map +1 -0
  176. package/dist/version.d.ts +15 -0
  177. package/dist/version.d.ts.map +1 -0
  178. package/dist/version.js +12 -0
  179. package/dist/version.js.map +1 -0
  180. package/package.json +87 -3
  181. package/src/BotClient.ts +113 -0
  182. package/src/NuramaClient.ts +1253 -0
  183. package/src/bot-browser-entry.js +15 -0
  184. package/src/browser-entry.js +20 -0
  185. package/src/routes/ai.ts +378 -0
  186. package/src/routes/asset.ts +1104 -0
  187. package/src/routes/auth.ts +587 -0
  188. package/src/routes/blogPosts.ts +29 -0
  189. package/src/routes/board.ts +403 -0
  190. package/src/routes/bot.ts +356 -0
  191. package/src/routes/chat.ts +1292 -0
  192. package/src/routes/chatAi.ts +125 -0
  193. package/src/routes/config.ts +31 -0
  194. package/src/routes/convo.ts +321 -0
  195. package/src/routes/credits.ts +112 -0
  196. package/src/routes/device.ts +133 -0
  197. package/src/routes/folder.ts +154 -0
  198. package/src/routes/invite.ts +133 -0
  199. package/src/routes/joinLink.ts +233 -0
  200. package/src/routes/membership.ts +237 -0
  201. package/src/routes/notification.ts +166 -0
  202. package/src/routes/oauthGrant.ts +64 -0
  203. package/src/routes/payment.ts +104 -0
  204. package/src/routes/product.ts +67 -0
  205. package/src/routes/project.ts +1528 -0
  206. package/src/routes/public.ts +496 -0
  207. package/src/routes/scratch.ts +94 -0
  208. package/src/routes/settings.ts +152 -0
  209. package/src/routes/shortlink.ts +90 -0
  210. package/src/routes/socket.ts +757 -0
  211. package/src/routes/storage.ts +83 -0
  212. package/src/routes/subscription.ts +307 -0
  213. package/src/routes/supportChat.ts +62 -0
  214. package/src/routes/supportTicket.ts +114 -0
  215. package/src/routes/tag.ts +131 -0
  216. package/src/routes/task.ts +431 -0
  217. package/src/routes/taskRelation.ts +125 -0
  218. package/src/routes/token.ts +152 -0
  219. package/src/routes/user.ts +214 -0
  220. package/src/routes/version.ts +62 -0
  221. package/src/routes/webhook.ts +295 -0
  222. package/src/routes/workspace.ts +223 -0
  223. package/src/utils/uploadSessionManager.ts +407 -0
  224. package/src/utils/urlParams.ts +181 -0
  225. package/src/version.ts +22 -0
@@ -0,0 +1,842 @@
1
+ import NuramaClient from '../NuramaClient.js';
2
+ import { type Asset, type Chat, type ChatMessage, type ChatMember, type Folder, type LinkPreview, type Membership, type PaginatedResult, type CursorPaginatedResult } from '@nurama/types';
3
+ export interface PaginationParams {
4
+ limit?: number;
5
+ paginate?: 'cursor' | 'index';
6
+ cursor?: string;
7
+ paginateReverse?: boolean;
8
+ includeCounts?: boolean;
9
+ includeCursorRecord?: boolean;
10
+ startAt?: string;
11
+ includeStartAtRecord?: boolean;
12
+ page?: number;
13
+ }
14
+ export interface SortParams {
15
+ sort?: Record<string, 1 | -1>;
16
+ }
17
+ export interface DateRangeParams {
18
+ createdBefore?: string | number;
19
+ createdAfter?: string | number;
20
+ updatedBefore?: string | number;
21
+ }
22
+ export interface CreateTopicChatData {
23
+ topicType: 'project' | 'asset';
24
+ topicId: string;
25
+ subject?: string;
26
+ visibility?: 'creator' | 'reviewer';
27
+ }
28
+ export interface CreateMemberChatData {
29
+ /** Only `workspace` is accepted by the API; `project` is rejected with 400 (project-scoped member chats are no longer created). */
30
+ scopeType: 'workspace' | 'project';
31
+ scopeId: string;
32
+ subject?: string;
33
+ memberIds: string[];
34
+ /** Optional hex colour from the approved palette (see `GET /config`). */
35
+ color?: string;
36
+ }
37
+ export interface UpdateChatSubjectData {
38
+ subject: string;
39
+ }
40
+ export interface UpdateMemberChatData {
41
+ subject?: string;
42
+ color?: string;
43
+ }
44
+ export interface UpdateMemberChatIconData {
45
+ name: string;
46
+ checksum: string;
47
+ sizeInMB: number;
48
+ }
49
+ export interface MemberIdList {
50
+ memberIds: string[];
51
+ }
52
+ export interface FileAttachmentData {
53
+ id: number;
54
+ name: string;
55
+ checksum: string;
56
+ sizeInMB: number;
57
+ }
58
+ /**
59
+ * Scratch-shape attachment ref — points at bytes already uploaded to a
60
+ * Scratch row. Used by AI Revision (Attach to chat) and the Nurama
61
+ * Support chat (image attachments). The chat-send endpoint accepts
62
+ * either this shape OR the upload-shape (`FileAttachmentData`) in the
63
+ * same `attachments[]` array; `chat.service.createMessage` partitions
64
+ * and routes per-item.
65
+ */
66
+ export interface ScratchAttachmentRef {
67
+ scratchId: string;
68
+ name?: string;
69
+ }
70
+ export interface PercentageCoordinates {
71
+ x: number;
72
+ y: number;
73
+ }
74
+ export interface BaseAnnotation {
75
+ color?: string;
76
+ frame?: number;
77
+ timestamp?: number;
78
+ startTimestamp?: number;
79
+ endTimestamp?: number;
80
+ left?: number;
81
+ top?: number;
82
+ width?: number;
83
+ height?: number;
84
+ scaleX?: number;
85
+ scaleY?: number;
86
+ angle?: number;
87
+ skewX?: number;
88
+ skewY?: number;
89
+ flipX?: boolean;
90
+ flipY?: boolean;
91
+ originX?: 'left' | 'center' | 'right';
92
+ originY?: 'top' | 'center' | 'bottom';
93
+ opacity?: number;
94
+ visible?: boolean;
95
+ shadow?: {
96
+ color?: string;
97
+ blur?: number;
98
+ offsetX?: number;
99
+ offsetY?: number;
100
+ };
101
+ strokeLineCap?: 'butt' | 'round' | 'square';
102
+ strokeLineJoin?: 'miter' | 'round' | 'bevel';
103
+ strokeMiterLimit?: number;
104
+ strokeDashArray?: number[];
105
+ fillRule?: 'nonzero' | 'evenodd';
106
+ }
107
+ export interface NestedDotAnnotation extends BaseAnnotation {
108
+ type: 'dot';
109
+ coordinates: PercentageCoordinates;
110
+ radius?: number;
111
+ }
112
+ export interface NestedShapeAnnotation extends BaseAnnotation {
113
+ type: 'rectangle' | 'circle' | 'triangle' | 'arrow' | 'line';
114
+ coordinates: PercentageCoordinates[];
115
+ strokeColor?: string;
116
+ fillColor?: string;
117
+ strokeWidth?: number;
118
+ }
119
+ export interface NestedTextAnnotation extends BaseAnnotation {
120
+ type: 'text';
121
+ coordinates: PercentageCoordinates;
122
+ content: string;
123
+ fontSize?: number;
124
+ fontFamily?: 'Arial' | 'Helvetica' | 'Times New Roman' | 'Courier New' | 'Georgia' | 'Verdana';
125
+ fontWeight?: 'normal' | 'bold';
126
+ fontStyle?: 'normal' | 'italic';
127
+ textColor?: string;
128
+ }
129
+ export interface NestedPathAnnotation extends BaseAnnotation {
130
+ type: 'path';
131
+ pathData: string;
132
+ strokeColor?: string;
133
+ strokeWidth?: number;
134
+ }
135
+ export type NestedAnnotation = NestedDotAnnotation | NestedShapeAnnotation | NestedTextAnnotation | NestedPathAnnotation;
136
+ export interface DotAnnotation extends BaseAnnotation {
137
+ type: 'dot';
138
+ coordinates: PercentageCoordinates;
139
+ radius?: number;
140
+ nestedAnnotations?: NestedAnnotation[];
141
+ }
142
+ export interface FrameCommentAnnotation extends BaseAnnotation {
143
+ type: 'frameComment';
144
+ nestedAnnotations?: NestedAnnotation[];
145
+ }
146
+ export interface ShapeAnnotation extends BaseAnnotation {
147
+ type: 'rectangle' | 'circle' | 'triangle' | 'arrow' | 'line';
148
+ coordinates: PercentageCoordinates[];
149
+ strokeColor?: string;
150
+ fillColor?: string;
151
+ strokeWidth?: number;
152
+ nestedAnnotations?: NestedAnnotation[];
153
+ }
154
+ export interface TextAnnotation extends BaseAnnotation {
155
+ type: 'text';
156
+ coordinates: PercentageCoordinates;
157
+ content: string;
158
+ fontSize?: number;
159
+ fontFamily?: 'Arial' | 'Helvetica' | 'Times New Roman' | 'Courier New' | 'Georgia' | 'Verdana';
160
+ fontWeight?: 'normal' | 'bold';
161
+ fontStyle?: 'normal' | 'italic';
162
+ textColor?: string;
163
+ nestedAnnotations?: NestedAnnotation[];
164
+ }
165
+ export interface PathAnnotation extends BaseAnnotation {
166
+ type: 'path';
167
+ pathData: string;
168
+ strokeColor?: string;
169
+ strokeWidth?: number;
170
+ nestedAnnotations?: NestedAnnotation[];
171
+ }
172
+ export type Annotation = DotAnnotation | FrameCommentAnnotation | ShapeAnnotation | TextAnnotation | PathAnnotation;
173
+ export interface CreateMessageData {
174
+ content?: string;
175
+ attachments?: (FileAttachmentData | ScratchAttachmentRef)[];
176
+ replyToId?: string;
177
+ annotations?: Annotation[];
178
+ mentions?: string[];
179
+ assetMentions?: string[];
180
+ folderMentions?: string[];
181
+ submissionMentions?: string[];
182
+ publicMentions?: string[];
183
+ taskMentions?: string[];
184
+ quotes?: string[];
185
+ linkPreviews?: LinkPreview[];
186
+ /**
187
+ * AI-chat only. Sent on the regular chat endpoint when the target
188
+ * chat is an AI topic so the orchestrator gets the page snapshot the
189
+ * user was looking at. Regular chats ignore this field.
190
+ */
191
+ pageContext?: {
192
+ path?: string;
193
+ pageTitle?: string;
194
+ visibleAssetIds?: string[];
195
+ };
196
+ }
197
+ export interface CreateAssetChatAndMessageData extends CreateMessageData {
198
+ }
199
+ export interface ReviseMessageData {
200
+ content?: string;
201
+ mentions?: string[];
202
+ assetMentions?: string[];
203
+ folderMentions?: string[];
204
+ submissionMentions?: string[];
205
+ publicMentions?: string[];
206
+ taskMentions?: string[];
207
+ annotations?: Annotation[];
208
+ quotes?: string[];
209
+ linkPreviews?: LinkPreview[];
210
+ }
211
+ export interface FetchLinkPreviewsData {
212
+ urls: string[];
213
+ }
214
+ export interface LinkPreviewResponse {
215
+ previews: LinkPreview[];
216
+ }
217
+ export interface CreateReactionData {
218
+ emoji: string;
219
+ }
220
+ export interface GetUsersMemberChatsParams extends PaginationParams, SortParams, DateRangeParams {
221
+ recentMessages?: number;
222
+ scopeId?: string;
223
+ subjectSearch?: string;
224
+ memberSearch?: string;
225
+ archived?: boolean;
226
+ }
227
+ export interface GetUsersMentionsParams extends PaginationParams, SortParams, DateRangeParams {
228
+ chatId?: string;
229
+ authorId?: string;
230
+ }
231
+ export interface GetChatByTopicIdParams extends SortParams {
232
+ topicType: 'project' | 'asset' | string;
233
+ visibility?: 'creator' | 'reviewer';
234
+ messages?: number;
235
+ replies?: number;
236
+ }
237
+ export interface GetMessagesParams extends PaginationParams, SortParams, DateRangeParams {
238
+ replies?: number;
239
+ replyLimit?: number;
240
+ replySort?: Record<string, 1 | -1>;
241
+ excludeReplies?: boolean;
242
+ contentSearch?: string;
243
+ authorId?: string;
244
+ type?: 'user' | 'system';
245
+ highlighted?: boolean;
246
+ hasAttachments?: boolean;
247
+ hasAnnotations?: boolean;
248
+ isConvoMessage?: boolean;
249
+ }
250
+ export interface CreateAssetChatAndMessageParams extends SortParams {
251
+ messages?: number;
252
+ replies?: number;
253
+ }
254
+ export interface GetMessageParams extends SortParams {
255
+ replies?: number;
256
+ }
257
+ export interface GetRepliesParams extends PaginationParams, SortParams, DateRangeParams {
258
+ }
259
+ export interface GetMentionableAssetsParams extends PaginationParams, SortParams {
260
+ nameSearch?: string;
261
+ }
262
+ export interface GetMentionableFoldersParams extends PaginationParams, SortParams {
263
+ nameSearch?: string;
264
+ }
265
+ export interface GetMentionableTasksParams extends PaginationParams, SortParams {
266
+ nameSearch?: string;
267
+ }
268
+ export interface GetMentionableSubmissionsParams extends PaginationParams, SortParams {
269
+ nameSearch?: string;
270
+ }
271
+ export interface GetMentionablePublicsParams extends PaginationParams, SortParams {
272
+ nameSearch?: string;
273
+ }
274
+ /**
275
+ * Mentionable submission entry returned by
276
+ * `getMentionableSubmissions`. Each submission's `id` doubles as the
277
+ * `chatId` (the ChatSubmission row IS the submission chat).
278
+ */
279
+ export interface MentionableSubmission {
280
+ id: string;
281
+ subject: string;
282
+ description: string | null;
283
+ version: string | null;
284
+ status: string;
285
+ totalMessages: number;
286
+ lastMessageAt: string | null;
287
+ publishedAt: string;
288
+ chatId: string;
289
+ creator: {
290
+ id: string;
291
+ firstName?: string;
292
+ lastName?: string;
293
+ displayName?: string;
294
+ } | null;
295
+ }
296
+ /**
297
+ * Mentionable public collection entry returned by
298
+ * `getMentionablePublics`. `token` is the URL-safe stable identifier
299
+ * used in the `publicMention:<token>` message-token payload.
300
+ */
301
+ export interface MentionablePublic {
302
+ id: string;
303
+ token: string;
304
+ title: string;
305
+ description: string | null;
306
+ status: string;
307
+ expiresAt: string | null;
308
+ createdAt: string;
309
+ chatId: string | null;
310
+ creator: {
311
+ id: string;
312
+ firstName?: string;
313
+ lastName?: string;
314
+ displayName?: string;
315
+ } | null;
316
+ }
317
+ export type ChatResponse = Chat;
318
+ export type MemberChatResponse = ChatMember;
319
+ export type ChatMessageResponse = ChatMessage;
320
+ export type MemberResponse = Membership;
321
+ /** Addable members for a legacy project-scoped member chat, split by the membership they come from. */
322
+ export interface AddableMembersByScope {
323
+ projectMembership: MemberResponse[];
324
+ workspaceMembership: MemberResponse[];
325
+ }
326
+ /**
327
+ * One entry of an upload response: the created asset plus the signed upload data the
328
+ * caller uses to PUT the bytes, or a per-file failure (`status: 'fail'` with `error`).
329
+ */
330
+ export interface AttachmentUploadRecord {
331
+ id: number | string;
332
+ name: string;
333
+ status: 'success' | 'fail';
334
+ asset?: Asset;
335
+ signedUrlData?: any;
336
+ uploadChunkSizeInBytes?: number;
337
+ error?: string;
338
+ }
339
+ export type AttachmentResponse = AttachmentUploadRecord;
340
+ export type PaginatedResponse<T> = (PaginatedResult | CursorPaginatedResult) & {
341
+ results?: T[];
342
+ };
343
+ /**
344
+ * Defines chat-related methods for the NuramaClient.
345
+ * @param {NuramaClient} client - The NuramaClient instance.
346
+ * @returns {object} An object containing the chat-related methods.
347
+ */
348
+ export default function createChatMethods(client: NuramaClient): {
349
+ /**
350
+ * Creates a topic chat for a project or asset at a given visibility.
351
+ * Requires `canCreateCreatorChat` (visibility `creator`) or `canCreateReviewerChat`
352
+ * (visibility `reviewer`) on the topic resource. Although `visibility` is optional in
353
+ * the type, the permission check only passes when it is one of those two values, so
354
+ * omitting it results in 403.
355
+ * @param {CreateTopicChatData} data - `topicType` (`project` | `asset`), `topicId`, optional `subject` (max 100 chars) and `visibility`.
356
+ * @returns {Promise<ChatResponse>} The created chat.
357
+ */
358
+ createTopicChat(data: CreateTopicChatData): Promise<ChatResponse>;
359
+ /**
360
+ * Retrieves the topic chat for a project, asset, public release or task, together
361
+ * with its most recent messages and their replies.
362
+ * Requires `canGetCreatorChat` or `canGetReviewerChat` on the chat, matching
363
+ * `params.visibility`. `replies` (default 10, max 100) and `sort` (default `{ id: -1 }`)
364
+ * are honoured, but `messages` is accepted and then not forwarded by the API handler,
365
+ * so 10 recent messages are always returned.
366
+ * @param {string} topicId - The ID of the topic resource (project, asset, public release or task).
367
+ * @param {GetChatByTopicIdParams} params - See GetChatByTopicIdParams. `topicType` is one of `project`, `asset`, `public`, `task`.
368
+ * @returns {Promise<ChatResponse>} The chat, including `recentMessages`.
369
+ * @throws {Error} 'topicId is required.' when `topicId` is falsy.
370
+ */
371
+ getChatByTopicId(topicId: string, params: GetChatByTopicIdParams): Promise<ChatResponse>;
372
+ /**
373
+ * Creates a member ("Team") chat in a workspace with the given members.
374
+ * Only `scopeType: 'workspace'` is accepted by the API: project-scoped member chats
375
+ * are deprecated and `social` is not supported yet, so both are rejected with 400
376
+ * even though the type still allows them. Requires `canCreateWorkspaceMemberChat` on
377
+ * the workspace. The caller is always added as the first member, every member must
378
+ * be chat-eligible in the scope (`membersInvalid` otherwise), and a random approved
379
+ * colour is assigned (the API also accepts an optional `color`, not exposed on this type).
380
+ * @param {CreateMemberChatData} data - `scopeType`, `scopeId`, `memberIds` and optional `subject` (max 100 chars).
381
+ * @returns {Promise<MemberChatResponse>} The created member chat.
382
+ */
383
+ createMemberChat(data: CreateMemberChatData): Promise<MemberChatResponse>;
384
+ /**
385
+ * Lists the member chats the caller belongs to, most recently updated first, each
386
+ * with its recent messages.
387
+ * Defaults to index pagination (`page`, `limit` max 20); pass `paginate: 'cursor'` for
388
+ * cursor pagination. `updatedBefore` is only accepted with index pagination,
389
+ * `recentMessages` caps the messages returned per chat (default and max 20), and
390
+ * `archived` narrows to chats the caller has (`true`) or has not (`false`) archived.
391
+ * `createdBefore` / `createdAfter` from DateRangeParams are not accepted by this
392
+ * endpoint and cause a 400.
393
+ * @param {GetUsersMemberChatsParams} [params] - See GetUsersMemberChatsParams.
394
+ * @returns {Promise<PaginatedResponse<MemberChatResponse>>} A paginated list of member chats.
395
+ */
396
+ getUsersMemberChats(params?: GetUsersMemberChatsParams): Promise<PaginatedResponse<MemberChatResponse>>;
397
+ /**
398
+ * Retrieves a member chat by ID without its messages.
399
+ * The caller must be a member of the chat.
400
+ * @param {string} chatId - The ID of the member chat.
401
+ * @returns {Promise<MemberChatResponse>} The member chat with `participants`, `members` and `icon` populated.
402
+ * @throws {Error} 'chatId is required.' when `chatId` is falsy.
403
+ */
404
+ getMemberChat(chatId: string): Promise<MemberChatResponse>;
405
+ /**
406
+ * Retrieves every project topic chat (creator/reviewer) the caller can
407
+ * access across all projects in a workspace, with the latest message and
408
+ * message count for each, ordered by most recent activity. Powers the
409
+ * workspace-level "Project Chat" list.
410
+ * Requires `canGetWorkspace` on the workspace; access to each project's chats is
411
+ * derived from the caller's inherited `canGetCreatorChat` / `canGetReviewerChat`.
412
+ * @param {string} workspaceId - The ID of the workspace.
413
+ * @returns {Promise<Array<object>>} An array of `{ project, visibility, chat }` entries; `chat.recentMessages` holds at most the latest message.
414
+ * @throws {Error} 'workspaceId is required.' when `workspaceId` is falsy.
415
+ */
416
+ getWorkspaceProjectChats(workspaceId: string): Promise<any[]>;
417
+ /**
418
+ * Updates a member chat's subject and/or colour.
419
+ * The caller must be a member of the chat. `subject` is limited to 100 characters
420
+ * and `color` must be one of the approved palette colours.
421
+ * @param {string} chatId - The ID of the member chat.
422
+ * @param {UpdateMemberChatData} data - The new `subject` and/or `color`.
423
+ * @returns {Promise<MemberChatResponse>} The updated member chat.
424
+ * @throws {Error} 'chatId is required.' when `chatId` is falsy.
425
+ */
426
+ updateMemberChat(chatId: string, data: UpdateMemberChatData): Promise<MemberChatResponse>;
427
+ /**
428
+ * Marks a member chat, its messages and its attachments for deletion.
429
+ * Only the chat's creator may delete it; other members receive 403. From the
430
+ * members' perspective the chat disappears immediately; the rows are removed later
431
+ * by the cleanup service.
432
+ * @param {string} chatId - The ID of the member chat.
433
+ * @returns {Promise<void>} Resolves with `null` (the API sends an empty body).
434
+ * @throws {Error} 'chatId is required.' when `chatId` is falsy.
435
+ */
436
+ deleteMemberChat(chatId: string): Promise<void>;
437
+ /**
438
+ * Archives a member chat for the calling user only.
439
+ * Adds the caller to the chat's `archivedBy` list; other members' view of the chat
440
+ * is unaffected. The caller must be a member of the chat.
441
+ * @param {string} chatId - The ID of the member chat.
442
+ * @returns {Promise<MemberChatResponse>} The updated member chat.
443
+ * @throws {Error} 'chatId is required.' when `chatId` is falsy.
444
+ */
445
+ archiveMemberChat(chatId: string): Promise<MemberChatResponse>;
446
+ /**
447
+ * Unarchives a member chat for the calling user only.
448
+ * Removes the caller from the chat's `archivedBy` list. The caller must be a member
449
+ * of the chat.
450
+ * @param {string} chatId - The ID of the member chat.
451
+ * @returns {Promise<MemberChatResponse>} The updated member chat.
452
+ * @throws {Error} 'chatId is required.' when `chatId` is falsy.
453
+ */
454
+ unarchiveMemberChat(chatId: string): Promise<MemberChatResponse>;
455
+ /**
456
+ * Creates an icon asset for a member chat and returns signed upload URLs for it.
457
+ * Any existing icon is marked for deletion. The caller must be a member of the chat;
458
+ * `sizeInMB` is capped at 10 and `name` at 100 characters. Upload the file to the
459
+ * returned `signedUrlData.urls` afterwards, exactly as for any asset upload.
460
+ * @param {string} chatId - The ID of the member chat.
461
+ * @param {UpdateMemberChatIconData} data - `name` (with extension), `checksum` (MD5 or SHA-256) and `sizeInMB`.
462
+ * @returns {Promise<{ chat: MemberChatResponse } & AttachmentUploadRecord>} The updated `chat` plus the created upload record. Note the record's fields (`asset`, `signedUrlData`, `status`, ...) are spread directly onto the response; there is no `iconData` key despite the declared type.
463
+ * @throws {Error} 'chatId is required.' when `chatId` is falsy.
464
+ */
465
+ updateMemberChatIcon(chatId: string, data: UpdateMemberChatIconData): Promise<{
466
+ chat: MemberChatResponse;
467
+ } & AttachmentUploadRecord>;
468
+ /**
469
+ * Lists the members that can be added to an existing member chat, based on the chat's
470
+ * scope and the caller's role in it.
471
+ * The caller must be a member of the chat. For workspace-scoped chats the result is a
472
+ * flat array of memberships; for legacy project-scoped chats it is an
473
+ * `AddableMembersByScope` object.
474
+ * @param {string} chatId - The ID of the member chat.
475
+ * @returns {Promise<MemberResponse[] | AddableMembersByScope>} Addable memberships, each with its `user` populated.
476
+ * @throws {Error} 'chatId is required.' when `chatId` is falsy.
477
+ */
478
+ getAddableMembers(chatId: string): Promise<MemberResponse[] | AddableMembersByScope>;
479
+ /**
480
+ * Lists the members addable to a NEW member chat, by scope, before the chat
481
+ * exists. Use this to populate the create-chat member picker — unlike the
482
+ * raw membership-list endpoints it isn't admin-gated, so non-admin members
483
+ * allowed to start a Team Chat still get the correct list.
484
+ * Requires `canCreateWorkspaceMemberChat` (or `canCreateProjectMemberChat`) on the
485
+ * scope. For `project` scope the result is an `AddableMembersByScope` object; note
486
+ * that project-scoped member chats can no longer be created.
487
+ * @param {'workspace' | 'project'} scopeType - Scope of the chat to create.
488
+ * @param {string} scopeId - ID of the scope resource.
489
+ * @returns {Promise<MemberResponse[] | AddableMembersByScope>} Addable memberships, each with its `user` populated.
490
+ * @throws {Error} 'scopeType is required.' or 'scopeId is required.' when either is falsy.
491
+ */
492
+ getScopeAddableMembers(scopeType: "workspace" | "project", scopeId: string): Promise<MemberResponse[] | AddableMembersByScope>;
493
+ /**
494
+ * Adds users to a member chat by user ID.
495
+ * The caller must be a member of the chat, and every user must be chat-eligible in
496
+ * the chat's scope (`membersInvalid` otherwise). `memberIds` is not enforced by
497
+ * validation, but the request cannot succeed without it.
498
+ * @param {string} chatId - The ID of the member chat.
499
+ * @param {MemberIdList} data - `memberIds`: the user IDs to add.
500
+ * @returns {Promise<MemberChatResponse>} The updated member chat.
501
+ * @throws {Error} 'chatId is required.' when `chatId` is falsy.
502
+ */
503
+ addMembers(chatId: string, data: MemberIdList): Promise<MemberChatResponse>;
504
+ /**
505
+ * Removes users from a member chat by user ID.
506
+ * The caller must be a member of the chat. The chat's creator cannot be removed
507
+ * (`ownerCannotLeaveChat`) and unknown user IDs produce `userNotFound`. Sent as a
508
+ * DELETE with a JSON body.
509
+ * @param {string} chatId - The ID of the member chat.
510
+ * @param {MemberIdList} data - `memberIds`: the user IDs to remove.
511
+ * @returns {Promise<MemberChatResponse>} The updated member chat.
512
+ * @throws {Error} 'chatId is required.' when `chatId` is falsy.
513
+ */
514
+ removeMembers(chatId: string, data: MemberIdList): Promise<MemberChatResponse>;
515
+ /**
516
+ * Retrieves a topic chat (project, asset, task or public) by ID without its messages.
517
+ * Requires `canGetCreatorChat` or `canGetReviewerChat` on the chat, matching its
518
+ * visibility. Only topic chats are served here; member chats are served by
519
+ * `getMemberChat` and a member chat ID yields `chatNotFound`.
520
+ * @param {string} chatId - The ID of the topic chat.
521
+ * @returns {Promise<ChatResponse>} The chat with `participants` populated.
522
+ * @throws {Error} 'chatId is required.' when `chatId` is falsy.
523
+ */
524
+ getChat(chatId: string): Promise<ChatResponse>;
525
+ /**
526
+ * Updates the subject of a topic chat.
527
+ * Requires `canUpdateCreatorChat` or `canUpdateReviewerChat` on the chat, matching
528
+ * its visibility. `subject` is limited to 100 characters. For member chats use
529
+ * `updateMemberChat`.
530
+ * @param {string} chatId - The ID of the topic chat.
531
+ * @param {UpdateChatSubjectData} data - The new `subject`.
532
+ * @returns {Promise<ChatResponse>} The updated chat.
533
+ * @throws {Error} 'chatId is required.' when `chatId` is falsy.
534
+ */
535
+ updateChatSubject(chatId: string, data: UpdateChatSubjectData): Promise<ChatResponse>;
536
+ /**
537
+ * Marks a topic chat for deletion.
538
+ * In practice this only succeeds for `user`-topic chats owned by the caller: project
539
+ * and asset topic chats are refused with `topicChatsMayNotBeDeleted`, and any other
540
+ * topic type with `unknownError`. Member chats are deleted with `deleteMemberChat`.
541
+ * @param {string} chatId - The ID of the chat.
542
+ * @returns {Promise<void>} Resolves with `null` (the API sends an empty body).
543
+ * @throws {Error} 'chatId is required.' when `chatId` is falsy.
544
+ */
545
+ deleteChat(chatId: string): Promise<void>;
546
+ /**
547
+ * Posts a message to any chat type (topic, member, submission, AI, support).
548
+ * Either `content` (max 10,000 chars) or at least one attachment is required. API
549
+ * tokens need the `chat:write` scope (`tokenScopeMissing` / 403 otherwise); users
550
+ * need message-create permission on the chat, e.g. `canCreateCreatorChatMessage` /
551
+ * `canCreateReviewerChatMessage` for topic chats or membership for member chats.
552
+ * Limits: 6 attachments, 10 of each mention kind, 5 quotes, 5 link previews and
553
+ * 100 annotations. Mentioning users in topic/member/submission chats creates tasks
554
+ * and notifications for them. `pageContext` is only read by AI chats and ignored by
555
+ * every other chat type.
556
+ * @param {string} chatId - The ID of the chat to post in.
557
+ * @param {CreateMessageData} data - See CreateMessageData. `attachments` may mix upload-shape (`FileAttachmentData`) and scratch-shape (`ScratchAttachmentRef`) items.
558
+ * @returns {Promise<ChatMessageResponse>} The created message. When upload-shape attachments were sent it also carries `attachmentData` with the created assets and their signed upload URLs.
559
+ * @throws {Error} 'chatId is required.' when `chatId` is falsy.
560
+ */
561
+ createMessage(chatId: string, data: CreateMessageData): Promise<ChatMessageResponse>;
562
+ /**
563
+ * Posts a message to an asset's chat at the given visibility, creating the chat first
564
+ * if it does not exist yet (asset chats are normally auto-created, so this mainly
565
+ * covers legacy assets).
566
+ * Only media assets are accepted (`assetInvalidFunctionType` / 404 otherwise).
567
+ * Requires both `canCreate{Creator|Reviewer}Chat` and
568
+ * `canCreate{Creator|Reviewer}ChatMessage` on the asset for the chosen visibility.
569
+ * The body follows the same rules as `createMessage`. The `params` argument is
570
+ * neither validated nor forwarded by the API handler, so the returned chat always
571
+ * carries 10 recent messages with 10 replies each, sorted `{ id: -1 }`.
572
+ * @param {string} assetId - The ID of the media asset.
573
+ * @param {'creator' | 'reviewer'} visibility - Which of the asset's two chats to post in.
574
+ * @param {CreateAssetChatAndMessageData} data - See CreateMessageData.
575
+ * @param {CreateAssetChatAndMessageParams} [params] - Accepted for backwards compatibility only; currently ignored by the API.
576
+ * @returns {Promise<any>} `{ chat, message }`: the chat re-read after the message landed (so `recentMessages` includes it) and the created message, which carries `attachmentData` when upload-shape attachments were sent.
577
+ * @throws {Error} 'assetId is required.' when `assetId` is falsy.
578
+ */
579
+ createAssetChatAndMessage(assetId: string, visibility: "creator" | "reviewer", data: CreateAssetChatAndMessageData, params?: CreateAssetChatAndMessageParams): Promise<any>;
580
+ /**
581
+ * Lists a chat's active messages with their recent replies and populated
582
+ * attachments and mentions.
583
+ * Requires read access to the chat (`canGetChat`); API tokens need the `chat:read`
584
+ * scope (`tokenScopeMissing` / 403 otherwise). Defaults to index pagination (`page`,
585
+ * `limit` max 100, sort `{ id: -1 }`); pass `paginate: 'cursor'` for cursor
586
+ * pagination. `createdBefore` / `createdAfter` are only accepted with index
587
+ * pagination and `updatedBefore` is not accepted at all. `replyLimit` (default 10,
588
+ * max 100) sets the replies returned per message; `replies` is a deprecated alias
589
+ * that takes precedence over `replyLimit` whenever it is set to anything other than 10.
590
+ * @param {string} chatId - The ID of the chat.
591
+ * @param {GetMessagesParams} [params] - See GetMessagesParams.
592
+ * @returns {Promise<PaginatedResponse<ChatMessageResponse>>} A paginated list of messages.
593
+ * @throws {Error} 'chatId is required.' when `chatId` is falsy.
594
+ */
595
+ getMessages(chatId: string, params?: GetMessagesParams): Promise<PaginatedResponse<ChatMessageResponse>>;
596
+ /**
597
+ * Retrieves a single message by ID with its most recent replies.
598
+ * Requires read access to the message's chat (`canGetChatMessage`). `replies`
599
+ * defaults to 10 (max 100) and `sort` (default `{ id: -1 }`) orders the included replies.
600
+ * @param {string} messageId - The ID of the message.
601
+ * @param {GetMessageParams} [params] - See GetMessageParams.
602
+ * @returns {Promise<ChatMessageResponse>} The message.
603
+ * @throws {Error} 'messageId is required.' when `messageId` is falsy.
604
+ */
605
+ getMessage(messageId: string, params?: GetMessageParams): Promise<ChatMessageResponse>;
606
+ /**
607
+ * Revises a message's content, mentions, quotes, annotations and link previews,
608
+ * keeping the previous version as a revision.
609
+ * Only the author may revise, and in topic/submission chats they also need
610
+ * `canUpdateOwnChatMessage`. Annotations are replaced, not merged: omit
611
+ * `annotations` to keep the current ones, send `[]` to remove them all.
612
+ * `linkPreviews` likewise replaces the stored previews. Same size limits as
613
+ * `createMessage`.
614
+ * @param {string} messageId - The ID of the message to revise.
615
+ * @param {ReviseMessageData} data - See ReviseMessageData.
616
+ * @returns {Promise<ChatMessageResponse>} The revised message.
617
+ * @throws {Error} 'messageId is required.' when `messageId` is falsy.
618
+ */
619
+ reviseMessage(messageId: string, data: ReviseMessageData): Promise<ChatMessageResponse>;
620
+ /**
621
+ * Marks a message for deletion.
622
+ * Only the author may delete, and in topic/submission chats they also need
623
+ * `canDeleteOwnChatMessage`. The row is removed later by the cleanup service.
624
+ * @param {string} messageId - The ID of the message.
625
+ * @returns {Promise<ChatMessageResponse>} The deleted message.
626
+ * @throws {Error} 'messageId is required.' when `messageId` is falsy.
627
+ */
628
+ deleteMessage(messageId: string): Promise<ChatMessageResponse>;
629
+ /**
630
+ * Lists the active replies to a message, with attachments populated.
631
+ * Requires read access to the message's chat (`canGetChatMessage`). Defaults to
632
+ * index pagination (`page`, `limit` max 100, sort `{ id: -1 }`); pass
633
+ * `paginate: 'cursor'` for cursor pagination. `createdBefore` / `createdAfter` are
634
+ * only accepted with index pagination and `updatedBefore` is not accepted at all.
635
+ * @param {string} messageId - The ID of the parent message.
636
+ * @param {GetRepliesParams} [params] - See GetRepliesParams.
637
+ * @returns {Promise<PaginatedResponse<ChatMessageResponse>>} A paginated list of replies.
638
+ * @throws {Error} 'messageId is required.' when `messageId` is falsy.
639
+ */
640
+ getReplies(messageId: string, params?: GetRepliesParams): Promise<PaginatedResponse<ChatMessageResponse>>;
641
+ /**
642
+ * Creates attachment assets for an existing message and returns signed upload URLs
643
+ * for them.
644
+ * Only the message's author may attach, and in topic/submission chats they also
645
+ * need `canCreateAttachment`. Only image and video file names are accepted, each
646
+ * `checksum` must be a 32-64 character hex MD5/SHA-256 digest, `id` must be an
647
+ * integer no greater than 10, and the message may hold at most 6 attachments in
648
+ * total (`exceedsMaxAttachments`). The request is also checked against the
649
+ * workspace storage quota (`uploadRequestExceedsSubscription`).
650
+ * @param {string} messageId - The ID of the message.
651
+ * @param {FileAttachmentData[]} attachments - The files to attach; sent as the raw JSON body array.
652
+ * @returns {Promise<AttachmentResponse[]>} One record per input file: the input item plus `status` and, on success, `asset` and `signedUrlData` (or `error` on failure). Not a bare `Asset` as the declared type suggests.
653
+ * @throws {Error} 'messageId is required.' when `messageId` is falsy.
654
+ */
655
+ addAttachments(messageId: string, attachments: FileAttachmentData[]): Promise<AttachmentResponse[]>;
656
+ /**
657
+ * Removes an attachment from a message and marks the asset for deletion.
658
+ * Only the author may remove attachments, and in topic/submission chats they also
659
+ * need `canDeleteOwnAttachment`. If the message is left with no content and no
660
+ * attachments it is marked for deletion as well, and the deleted message is returned.
661
+ * @param {string} messageId - The ID of the message.
662
+ * @param {string} assetId - The ID of the attached asset to remove.
663
+ * @returns {Promise<ChatMessageResponse>} The updated (or deleted) message.
664
+ * @throws {Error} 'messageId is required.' or 'assetId is required.' when either is falsy.
665
+ */
666
+ removeAttachment(messageId: string, assetId: string): Promise<ChatMessageResponse>;
667
+ /**
668
+ * Lists the messages in which the caller was mentioned.
669
+ * Defaults to index pagination (`page`, `limit` max 100, sort `{ id: -1 }`); pass
670
+ * `paginate: 'cursor'` for cursor pagination. Filter with `chatId` and/or
671
+ * `authorId`. `createdBefore` is only accepted with index pagination;
672
+ * `createdAfter` and `updatedBefore` from DateRangeParams are not accepted by this
673
+ * endpoint and cause a 400.
674
+ * @param {GetUsersMentionsParams} [params] - See GetUsersMentionsParams.
675
+ * @returns {Promise<PaginatedResponse<ChatMessageResponse>>} A paginated list of messages.
676
+ */
677
+ getMentions(params?: GetUsersMentionsParams): Promise<PaginatedResponse<ChatMessageResponse>>;
678
+ /**
679
+ * Adds the caller's emoji reaction to a message, replacing any reaction they already
680
+ * had on it.
681
+ * Each user holds at most one reaction per message. Requires message-create
682
+ * permission on the chat (`canCreateReaction`). `emoji` must be 1-10 characters.
683
+ * @param {string} messageId - The ID of the message.
684
+ * @param {CreateReactionData} data - The `emoji` to react with.
685
+ * @returns {Promise<ChatMessageResponse>} The updated message, including `reactions`.
686
+ * @throws {Error} 'messageId is required.' when `messageId` is falsy.
687
+ */
688
+ createReaction(messageId: string, data: CreateReactionData): Promise<ChatMessageResponse>;
689
+ /**
690
+ * Removes the caller's own reaction from a message.
691
+ * Gated by the same permission as `createReaction`. Calling it when the caller has
692
+ * no reaction is a no-op that still returns the message.
693
+ * @param {string} messageId - The ID of the message.
694
+ * @returns {Promise<ChatMessageResponse>} The updated message.
695
+ * @throws {Error} 'messageId is required.' when `messageId` is falsy.
696
+ */
697
+ removeReaction(messageId: string): Promise<ChatMessageResponse>;
698
+ /**
699
+ * Adds the caller to a chat's following list so they are notified about new
700
+ * messages and updates.
701
+ * Works with topic, member and submission chats and is idempotent. Requires
702
+ * message-create permission on the chat (`canCreateChatMessage`).
703
+ * @param {string} chatId - The ID of the chat to follow.
704
+ * @returns {Promise<void>} Resolves once followed. The API sends an empty body; re-fetch the chat if you need its `following` list.
705
+ * @throws {Error} 'chatId is required.' when `chatId` is falsy.
706
+ */
707
+ followChat(chatId: string): Promise<void>;
708
+ /**
709
+ * Removes the caller from a chat's following list.
710
+ * Works with topic, member and submission chats and is idempotent. No chat
711
+ * permission is checked, so users can stop notifications for a chat they have
712
+ * since lost access to.
713
+ * @param {string} chatId - The ID of the chat to unfollow.
714
+ * @returns {Promise<void>} Resolves once unfollowed. The API sends an empty body.
715
+ * @throws {Error} 'chatId is required.' when `chatId` is falsy.
716
+ */
717
+ unfollowChat(chatId: string): Promise<void>;
718
+ /**
719
+ * Lists the active assets that can be mentioned (`{{assetMention:assetId}}`) in a chat.
720
+ * What is returned depends on the chat: project and asset topic chats return the
721
+ * project's assets at the chat's visibility; project-scoped member chats and
722
+ * submission chats return all of the project's assets; AI chats return the topic
723
+ * project's assets filtered to the caller's own visibility tiers; workspace/social
724
+ * member chats return an empty list. Requires read access to the chat
725
+ * (`canGetChatMentionableAssets`). Defaults to index pagination (`page`, `limit`
726
+ * max 100, sort `{ name: 1 }`); pass `paginate: 'cursor'` for cursor pagination.
727
+ * `startAt` / `includeStartAtRecord` are not accepted here.
728
+ * @param {string} chatId - The ID of the chat.
729
+ * @param {GetMentionableAssetsParams} [params] - See GetMentionableAssetsParams. `nameSearch` is a case-insensitive partial match.
730
+ * @returns {Promise<PaginatedResponse<Asset>>} A paginated list of assets.
731
+ * @throws {Error} 'chatId is required.' when `chatId` is falsy.
732
+ */
733
+ getMentionableAssets(chatId: string, params?: GetMentionableAssetsParams): Promise<PaginatedResponse<Asset>>;
734
+ /**
735
+ * Lists the active folders that can be mentioned (`{{folderMention:folderId}}`) in a chat.
736
+ * What is returned depends on the chat: project and asset topic chats return the
737
+ * project's folders at the chat's visibility; project-scoped member chats return
738
+ * all of the project's folders; submission chats return the project's
739
+ * reviewer-visibility folders; AI chats return the topic project's folders filtered
740
+ * to the caller's own visibility tiers; workspace/social member chats return an
741
+ * empty list. Requires read access to the chat (`canGetChatMentionableFolders`).
742
+ * Defaults to index pagination (`page`, `limit` max 100, sort `{ name: 1 }`); pass
743
+ * `paginate: 'cursor'` for cursor pagination. `startAt` / `includeStartAtRecord`
744
+ * are not accepted here.
745
+ * @param {string} chatId - The ID of the chat.
746
+ * @param {GetMentionableFoldersParams} [params] - See GetMentionableFoldersParams. `nameSearch` is a case-insensitive partial match.
747
+ * @returns {Promise<PaginatedResponse<Folder>>} A paginated list of folders.
748
+ * @throws {Error} 'chatId is required.' when `chatId` is falsy.
749
+ */
750
+ getMentionableFolders(chatId: string, params?: GetMentionableFoldersParams): Promise<PaginatedResponse<Folder>>;
751
+ /**
752
+ * Lists the active submissions in a chat's project that can be mentioned
753
+ * (`{{submissionMention:submissionId}}`).
754
+ * The project is resolved from the chat (project/asset/task topic chats,
755
+ * project-scoped member chats, submission chats and project-scoped AI chats); chats
756
+ * without a project return an empty page. Requires read access to the chat
757
+ * (`canGetChatMentionableSubmissions`). Index pagination only (`page`, `limit` max
758
+ * 100, sort `{ createdAt: -1 }`, also sortable by `subject` and `lastMessageAt`);
759
+ * cursor-pagination params cause a 400.
760
+ * @param {string} chatId - The ID of the chat.
761
+ * @param {GetMentionableSubmissionsParams} [params] - See GetMentionableSubmissionsParams. `nameSearch` is a case-insensitive partial match on the subject.
762
+ * @returns {Promise<PaginatedResponse<MentionableSubmission>>} A paginated list of submissions.
763
+ * @throws {Error} 'chatId is required.' when `chatId` is falsy.
764
+ */
765
+ getMentionableSubmissions(chatId: string, params?: GetMentionableSubmissionsParams): Promise<PaginatedResponse<MentionableSubmission>>;
766
+ /**
767
+ * Lists the active public releases (share links) owned by a chat's project that can
768
+ * be mentioned (`{{publicMention:token}}`).
769
+ * The project is resolved from the chat exactly as for `getMentionableSubmissions`;
770
+ * chats without a project return an empty page. Requires read access to the chat
771
+ * (`canGetChatMentionablePublics`). Index pagination only (`page`, `limit` max 100,
772
+ * sort `{ createdAt: -1 }`, also sortable by `title` and `expires`);
773
+ * cursor-pagination params cause a 400.
774
+ * @param {string} chatId - The ID of the chat.
775
+ * @param {GetMentionablePublicsParams} [params] - See GetMentionablePublicsParams. `nameSearch` is a case-insensitive partial match on the title.
776
+ * @returns {Promise<PaginatedResponse<MentionablePublic>>} A paginated list of public releases; use each entry's `token` in the mention.
777
+ * @throws {Error} 'chatId is required.' when `chatId` is falsy.
778
+ */
779
+ getMentionablePublics(chatId: string, params?: GetMentionablePublicsParams): Promise<PaginatedResponse<MentionablePublic>>;
780
+ /**
781
+ * Lists the board tasks that can be mentioned (`{{taskMention:taskId}}`) in a chat.
782
+ * Requires the workspace to have the `boards` capability (`capabilityNotAvailable`
783
+ * / 403 otherwise) and read access to the chat (`canGetChatMentionableTasks`).
784
+ * Project, asset and task topic chats return tasks in the project on boards whose
785
+ * visibility includes the chat's; project-scoped member chats return every board
786
+ * task in the project; submission chats return tasks on reviewer-visible boards;
787
+ * workspace/social member chats return an empty list. Legacy tasks without a board
788
+ * are never returned. Defaults to index pagination (`page`, `limit` max 100, sort
789
+ * `{ updatedAt: -1 }`); pass `paginate: 'cursor'` for cursor pagination.
790
+ * @param {string} chatId - The ID of the chat.
791
+ * @param {GetMentionableTasksParams} [params] - See GetMentionableTasksParams. `nameSearch` matches a subject substring, an exact task number or an exact task ID.
792
+ * @returns {Promise<PaginatedResponse<any>>} A paginated list of task summaries (`id`, `subject`, `taskNumber`, `status`, `projectId`, `boardId`, `assignedToId`, `createdAt`, `updatedAt`).
793
+ * @throws {Error} 'chatId is required.' when `chatId` is falsy.
794
+ */
795
+ getMentionableTasks(chatId: string, params?: GetMentionableTasksParams): Promise<PaginatedResponse<any>>;
796
+ /**
797
+ * Highlights a message, recording the caller as the highlighter.
798
+ * In topic and submission chats this requires `canHighlightMessage` on the chat; in
799
+ * member chats any member may highlight. For project and asset topic chats a system
800
+ * message is posted in the project chat of the same visibility, a
801
+ * `chatHighlightMessage` notification is sent and project members are emailed.
802
+ * @param {string} messageId - The ID of the message.
803
+ * @returns {Promise<ChatMessageResponse>} The highlighted message.
804
+ * @throws {Error} 'messageId is required.' when `messageId` is falsy.
805
+ */
806
+ highlightMessage(messageId: string): Promise<ChatMessageResponse>;
807
+ /**
808
+ * Removes the highlight from a message.
809
+ * Clears the highlighter fields and removes the associated system messages and
810
+ * notification. Same permission as `highlightMessage`.
811
+ * @param {string} messageId - The ID of the message.
812
+ * @returns {Promise<ChatMessageResponse>} The unhighlighted message.
813
+ * @throws {Error} 'messageId is required.' when `messageId` is falsy.
814
+ */
815
+ unhighlightMessage(messageId: string): Promise<ChatMessageResponse>;
816
+ /**
817
+ * Creates a short link for a chat message, or returns the existing one if the
818
+ * message already has a short link.
819
+ * Visibility is inherited from the parent chat (`creator` / `reviewer` for topic
820
+ * chats, `null` for member chats). Requires read access to the message's chat
821
+ * (`canCreateMessageShortLink`).
822
+ * @param {string} messageId - The ID of the message.
823
+ * @returns {Promise<{ code: string; shortUrl: string }>} The 8-character alphanumeric `code` and the complete `shortUrl`.
824
+ * @throws {Error} 'messageId is required.' when `messageId` is falsy.
825
+ */
826
+ createMessageShortLink(messageId: string): Promise<{
827
+ code: string;
828
+ shortUrl: string;
829
+ }>;
830
+ /**
831
+ * Fetches Open Graph / meta-tag preview data for one to five URLs.
832
+ * Each preview carries an HMAC-SHA256 `signature` that must be passed back
833
+ * unchanged in `linkPreviews` when creating or revising a message, as the API
834
+ * verifies it to reject spoofed previews. Duplicate URLs are collapsed and URLs
835
+ * that fail validation, fetching or SSRF checks are omitted, so `previews` may be
836
+ * shorter than `urls`. Rate limited to 30 requests per minute per IP.
837
+ * @param {FetchLinkPreviewsData} data - `urls`: 1-5 absolute http(s) URLs, each at most 2048 characters.
838
+ * @returns {Promise<LinkPreviewResponse>} `{ previews }`.
839
+ */
840
+ fetchLinkPreviews(data: FetchLinkPreviewsData): Promise<LinkPreviewResponse>;
841
+ };
842
+ //# sourceMappingURL=chat.d.ts.map