sunsama-api 0.4.0 → 0.6.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.
- package/README.md +58 -0
- package/dist/cjs/scripts/test-real-auth.js +127 -0
- package/dist/cjs/scripts/test-real-auth.js.map +1 -1
- package/dist/cjs/src/client/index.js +208 -6
- package/dist/cjs/src/client/index.js.map +1 -1
- package/dist/cjs/src/queries/mutations/index.js +1 -0
- package/dist/cjs/src/queries/mutations/index.js.map +1 -1
- package/dist/cjs/src/queries/mutations/updateTaskNotes.js +554 -0
- package/dist/cjs/src/queries/mutations/updateTaskNotes.js.map +1 -0
- package/dist/cjs/src/queries/tasks.js +17 -1
- package/dist/cjs/src/queries/tasks.js.map +1 -1
- package/dist/esm/scripts/test-real-auth.js +127 -0
- package/dist/esm/scripts/test-real-auth.js.map +1 -1
- package/dist/esm/src/client/index.js +208 -7
- package/dist/esm/src/client/index.js.map +1 -1
- package/dist/esm/src/queries/mutations/index.js +1 -0
- package/dist/esm/src/queries/mutations/index.js.map +1 -1
- package/dist/esm/src/queries/mutations/updateTaskNotes.js +551 -0
- package/dist/esm/src/queries/mutations/updateTaskNotes.js.map +1 -0
- package/dist/esm/src/queries/tasks.js +16 -0
- package/dist/esm/src/queries/tasks.js.map +1 -1
- package/dist/types/src/client/index.d.ts +93 -4
- package/dist/types/src/client/index.d.ts.map +1 -1
- package/dist/types/src/queries/mutations/index.d.ts +1 -0
- package/dist/types/src/queries/mutations/index.d.ts.map +1 -1
- package/dist/types/src/queries/mutations/updateTaskNotes.d.ts +5 -0
- package/dist/types/src/queries/mutations/updateTaskNotes.d.ts.map +1 -0
- package/dist/types/src/queries/tasks.d.ts +1 -0
- package/dist/types/src/queries/tasks.d.ts.map +1 -1
- package/dist/types/src/types/api.d.ts +33 -1
- package/dist/types/src/types/api.d.ts.map +1 -1
- package/package.json +2 -1
|
@@ -0,0 +1,551 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GraphQL mutation for updating task notes
|
|
3
|
+
*/
|
|
4
|
+
import { gql } from 'graphql-tag';
|
|
5
|
+
export const UPDATE_TASK_NOTES_MUTATION = gql `
|
|
6
|
+
mutation updateTaskNotes($input: UpdateTaskNotesInput!) {
|
|
7
|
+
updateTaskNotes(input: $input) {
|
|
8
|
+
...UpdateTaskPayload
|
|
9
|
+
__typename
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
fragment UpdateTaskPayload on UpdateTaskPayload {
|
|
14
|
+
updatedTask {
|
|
15
|
+
...Task
|
|
16
|
+
__typename
|
|
17
|
+
}
|
|
18
|
+
updatedFields {
|
|
19
|
+
...PartialTask
|
|
20
|
+
__typename
|
|
21
|
+
}
|
|
22
|
+
success
|
|
23
|
+
skipped
|
|
24
|
+
__typename
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
fragment Task on Task {
|
|
28
|
+
_id
|
|
29
|
+
groupId
|
|
30
|
+
taskType
|
|
31
|
+
streamIds
|
|
32
|
+
recommendedStreamId
|
|
33
|
+
eventInfo {
|
|
34
|
+
eventId
|
|
35
|
+
clone
|
|
36
|
+
__typename
|
|
37
|
+
}
|
|
38
|
+
seededEventIds
|
|
39
|
+
private
|
|
40
|
+
assigneeId
|
|
41
|
+
createdBy
|
|
42
|
+
integration {
|
|
43
|
+
...TaskIntegration
|
|
44
|
+
__typename
|
|
45
|
+
}
|
|
46
|
+
deleted
|
|
47
|
+
text
|
|
48
|
+
notes
|
|
49
|
+
notesMarkdown
|
|
50
|
+
notesChecksum
|
|
51
|
+
editorVersion
|
|
52
|
+
collabSnapshot
|
|
53
|
+
completed
|
|
54
|
+
completedBy
|
|
55
|
+
completeDate
|
|
56
|
+
completeOn
|
|
57
|
+
archivedAt
|
|
58
|
+
duration
|
|
59
|
+
runDate {
|
|
60
|
+
startDate
|
|
61
|
+
endDate
|
|
62
|
+
__typename
|
|
63
|
+
}
|
|
64
|
+
snooze {
|
|
65
|
+
userId
|
|
66
|
+
date
|
|
67
|
+
until
|
|
68
|
+
__typename
|
|
69
|
+
}
|
|
70
|
+
timeHorizon {
|
|
71
|
+
type
|
|
72
|
+
relativeTo
|
|
73
|
+
__typename
|
|
74
|
+
}
|
|
75
|
+
dueDate
|
|
76
|
+
comments {
|
|
77
|
+
userId
|
|
78
|
+
text
|
|
79
|
+
markdown
|
|
80
|
+
editorVersion
|
|
81
|
+
groupId
|
|
82
|
+
createdAt
|
|
83
|
+
editedAt
|
|
84
|
+
deleted
|
|
85
|
+
file
|
|
86
|
+
fileMetadata {
|
|
87
|
+
url
|
|
88
|
+
filename
|
|
89
|
+
mimetype
|
|
90
|
+
size
|
|
91
|
+
width
|
|
92
|
+
height
|
|
93
|
+
__typename
|
|
94
|
+
}
|
|
95
|
+
__typename
|
|
96
|
+
}
|
|
97
|
+
orderings {
|
|
98
|
+
ordinal
|
|
99
|
+
panelDate
|
|
100
|
+
channelId
|
|
101
|
+
userId
|
|
102
|
+
__typename
|
|
103
|
+
}
|
|
104
|
+
backlogOrderings {
|
|
105
|
+
horizonType
|
|
106
|
+
position
|
|
107
|
+
streamId
|
|
108
|
+
__typename
|
|
109
|
+
}
|
|
110
|
+
subtasks {
|
|
111
|
+
_id
|
|
112
|
+
title
|
|
113
|
+
completedDate
|
|
114
|
+
completedBy
|
|
115
|
+
timeEstimate
|
|
116
|
+
actualTime {
|
|
117
|
+
...TaskActualTime
|
|
118
|
+
__typename
|
|
119
|
+
}
|
|
120
|
+
snooze {
|
|
121
|
+
userId
|
|
122
|
+
date
|
|
123
|
+
until
|
|
124
|
+
__typename
|
|
125
|
+
}
|
|
126
|
+
scheduledTime {
|
|
127
|
+
...TaskScheduledTime
|
|
128
|
+
__typename
|
|
129
|
+
}
|
|
130
|
+
integration {
|
|
131
|
+
...TaskIntegration
|
|
132
|
+
__typename
|
|
133
|
+
}
|
|
134
|
+
mergedTaskId
|
|
135
|
+
recommendedTimeEstimate
|
|
136
|
+
__typename
|
|
137
|
+
}
|
|
138
|
+
subtasksCollapsed
|
|
139
|
+
sequence {
|
|
140
|
+
date
|
|
141
|
+
id
|
|
142
|
+
expiresDate
|
|
143
|
+
ruleString
|
|
144
|
+
searchable
|
|
145
|
+
forked
|
|
146
|
+
final
|
|
147
|
+
estimatedStart {
|
|
148
|
+
hour
|
|
149
|
+
minute
|
|
150
|
+
__typename
|
|
151
|
+
}
|
|
152
|
+
master
|
|
153
|
+
finalDate
|
|
154
|
+
template {
|
|
155
|
+
streamIds
|
|
156
|
+
private
|
|
157
|
+
text
|
|
158
|
+
notes
|
|
159
|
+
notesMarkdown
|
|
160
|
+
notesChecksum
|
|
161
|
+
editorVersion
|
|
162
|
+
subtasks {
|
|
163
|
+
_id
|
|
164
|
+
title
|
|
165
|
+
completedDate
|
|
166
|
+
completedBy
|
|
167
|
+
timeEstimate
|
|
168
|
+
actualTime {
|
|
169
|
+
...TaskActualTime
|
|
170
|
+
__typename
|
|
171
|
+
}
|
|
172
|
+
__typename
|
|
173
|
+
}
|
|
174
|
+
timeEstimate
|
|
175
|
+
assigneeId
|
|
176
|
+
__typename
|
|
177
|
+
}
|
|
178
|
+
__typename
|
|
179
|
+
}
|
|
180
|
+
followers
|
|
181
|
+
recommendedTimeEstimate
|
|
182
|
+
timeEstimate
|
|
183
|
+
actualTime {
|
|
184
|
+
...TaskActualTime
|
|
185
|
+
__typename
|
|
186
|
+
}
|
|
187
|
+
scheduledTime {
|
|
188
|
+
...TaskScheduledTime
|
|
189
|
+
__typename
|
|
190
|
+
}
|
|
191
|
+
createdAt
|
|
192
|
+
lastModified
|
|
193
|
+
objectiveId
|
|
194
|
+
ritual {
|
|
195
|
+
id
|
|
196
|
+
period {
|
|
197
|
+
interval
|
|
198
|
+
startCalendarDay
|
|
199
|
+
endCalendarDay
|
|
200
|
+
__typename
|
|
201
|
+
}
|
|
202
|
+
__typename
|
|
203
|
+
}
|
|
204
|
+
__typename
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
fragment TaskActualTime on TaskActualTime {
|
|
208
|
+
userId
|
|
209
|
+
startDate
|
|
210
|
+
endDate
|
|
211
|
+
duration
|
|
212
|
+
isTimerEntry
|
|
213
|
+
__typename
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
fragment TaskScheduledTime on TaskScheduledTime {
|
|
217
|
+
eventId
|
|
218
|
+
serviceIds {
|
|
219
|
+
google
|
|
220
|
+
microsoft
|
|
221
|
+
microsoftUniqueId
|
|
222
|
+
apple
|
|
223
|
+
appleRecurrenceId
|
|
224
|
+
sunsama
|
|
225
|
+
__typename
|
|
226
|
+
}
|
|
227
|
+
calendarId
|
|
228
|
+
userId
|
|
229
|
+
startDate
|
|
230
|
+
endDate
|
|
231
|
+
isAllDay
|
|
232
|
+
importedFromCalendar
|
|
233
|
+
__typename
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
fragment TaskIntegration on TaskIntegration {
|
|
237
|
+
... on TaskAsanaIntegration {
|
|
238
|
+
service
|
|
239
|
+
identifier {
|
|
240
|
+
id
|
|
241
|
+
url
|
|
242
|
+
accountId
|
|
243
|
+
__typename
|
|
244
|
+
}
|
|
245
|
+
__typename
|
|
246
|
+
}
|
|
247
|
+
... on TaskTrelloIntegration {
|
|
248
|
+
service
|
|
249
|
+
identifier {
|
|
250
|
+
id
|
|
251
|
+
url
|
|
252
|
+
accountId
|
|
253
|
+
__typename
|
|
254
|
+
}
|
|
255
|
+
__typename
|
|
256
|
+
}
|
|
257
|
+
... on TaskJiraIntegration {
|
|
258
|
+
service
|
|
259
|
+
identifier {
|
|
260
|
+
id
|
|
261
|
+
cloudId
|
|
262
|
+
accountId
|
|
263
|
+
url
|
|
264
|
+
__typename
|
|
265
|
+
}
|
|
266
|
+
__typename
|
|
267
|
+
}
|
|
268
|
+
... on TaskGithubIntegration {
|
|
269
|
+
service
|
|
270
|
+
identifier {
|
|
271
|
+
id
|
|
272
|
+
repositoryOwnerLogin
|
|
273
|
+
repositoryName
|
|
274
|
+
number
|
|
275
|
+
type
|
|
276
|
+
url
|
|
277
|
+
__typename
|
|
278
|
+
}
|
|
279
|
+
__typename
|
|
280
|
+
}
|
|
281
|
+
... on TaskTodoistIntegration {
|
|
282
|
+
service
|
|
283
|
+
identifier {
|
|
284
|
+
id
|
|
285
|
+
url
|
|
286
|
+
deepUrl
|
|
287
|
+
__typename
|
|
288
|
+
}
|
|
289
|
+
__typename
|
|
290
|
+
}
|
|
291
|
+
... on TaskGoogleCalendarIntegration {
|
|
292
|
+
service
|
|
293
|
+
identifier {
|
|
294
|
+
sunsamaId
|
|
295
|
+
__typename
|
|
296
|
+
}
|
|
297
|
+
__typename
|
|
298
|
+
}
|
|
299
|
+
... on TaskOutlookCalendarIntegration {
|
|
300
|
+
service
|
|
301
|
+
identifier {
|
|
302
|
+
sunsamaId
|
|
303
|
+
__typename
|
|
304
|
+
}
|
|
305
|
+
__typename
|
|
306
|
+
}
|
|
307
|
+
... on TaskAppleCalendarIntegration {
|
|
308
|
+
service
|
|
309
|
+
identifier {
|
|
310
|
+
sunsamaId
|
|
311
|
+
__typename
|
|
312
|
+
}
|
|
313
|
+
__typename
|
|
314
|
+
}
|
|
315
|
+
... on TaskSunsamaCalendarIntegration {
|
|
316
|
+
service
|
|
317
|
+
identifier {
|
|
318
|
+
sunsamaId
|
|
319
|
+
__typename
|
|
320
|
+
}
|
|
321
|
+
__typename
|
|
322
|
+
}
|
|
323
|
+
... on TaskGmailIntegration {
|
|
324
|
+
service
|
|
325
|
+
identifier {
|
|
326
|
+
id
|
|
327
|
+
messageId
|
|
328
|
+
accountId
|
|
329
|
+
url
|
|
330
|
+
__typename
|
|
331
|
+
}
|
|
332
|
+
__typename
|
|
333
|
+
}
|
|
334
|
+
... on TaskOutlookIntegration {
|
|
335
|
+
service
|
|
336
|
+
identifier {
|
|
337
|
+
id
|
|
338
|
+
internetMessageId
|
|
339
|
+
conversationId
|
|
340
|
+
accountId
|
|
341
|
+
url
|
|
342
|
+
__typename
|
|
343
|
+
}
|
|
344
|
+
__typename
|
|
345
|
+
}
|
|
346
|
+
... on TaskSlackIntegration {
|
|
347
|
+
service
|
|
348
|
+
identifier {
|
|
349
|
+
permalink
|
|
350
|
+
notesMarkdown
|
|
351
|
+
__typename
|
|
352
|
+
}
|
|
353
|
+
__typename
|
|
354
|
+
}
|
|
355
|
+
... on TaskNotionIntegration {
|
|
356
|
+
service
|
|
357
|
+
identifier {
|
|
358
|
+
id
|
|
359
|
+
workspaceId
|
|
360
|
+
url
|
|
361
|
+
deepUrl
|
|
362
|
+
__typename
|
|
363
|
+
}
|
|
364
|
+
__typename
|
|
365
|
+
}
|
|
366
|
+
... on TaskClickUpIntegration {
|
|
367
|
+
service
|
|
368
|
+
identifier {
|
|
369
|
+
id
|
|
370
|
+
userId
|
|
371
|
+
teamId
|
|
372
|
+
url
|
|
373
|
+
__typename
|
|
374
|
+
}
|
|
375
|
+
__typename
|
|
376
|
+
}
|
|
377
|
+
... on TaskGitlabIntegration {
|
|
378
|
+
service
|
|
379
|
+
identifier {
|
|
380
|
+
id
|
|
381
|
+
__typename
|
|
382
|
+
}
|
|
383
|
+
__typename
|
|
384
|
+
}
|
|
385
|
+
... on TaskEmailIntegration {
|
|
386
|
+
service
|
|
387
|
+
identifier {
|
|
388
|
+
id
|
|
389
|
+
__typename
|
|
390
|
+
}
|
|
391
|
+
content {
|
|
392
|
+
subject
|
|
393
|
+
text
|
|
394
|
+
html
|
|
395
|
+
from {
|
|
396
|
+
name
|
|
397
|
+
email
|
|
398
|
+
__typename
|
|
399
|
+
}
|
|
400
|
+
date
|
|
401
|
+
__typename
|
|
402
|
+
}
|
|
403
|
+
__typename
|
|
404
|
+
}
|
|
405
|
+
... on TaskLinearIntegration {
|
|
406
|
+
service
|
|
407
|
+
identifier {
|
|
408
|
+
id
|
|
409
|
+
url
|
|
410
|
+
identifier
|
|
411
|
+
linearUserId
|
|
412
|
+
linearOrganizationId
|
|
413
|
+
number
|
|
414
|
+
_version
|
|
415
|
+
__typename
|
|
416
|
+
}
|
|
417
|
+
__typename
|
|
418
|
+
}
|
|
419
|
+
... on TaskMondayIntegration {
|
|
420
|
+
service
|
|
421
|
+
identifier {
|
|
422
|
+
id
|
|
423
|
+
boardId
|
|
424
|
+
mondayAccountId
|
|
425
|
+
url
|
|
426
|
+
__typename
|
|
427
|
+
}
|
|
428
|
+
__typename
|
|
429
|
+
}
|
|
430
|
+
... on TaskWebsiteIntegration {
|
|
431
|
+
service
|
|
432
|
+
identifier {
|
|
433
|
+
url
|
|
434
|
+
private
|
|
435
|
+
canonicalUrl
|
|
436
|
+
description
|
|
437
|
+
faviconUrl
|
|
438
|
+
imageUrl
|
|
439
|
+
siteName
|
|
440
|
+
title
|
|
441
|
+
__typename
|
|
442
|
+
}
|
|
443
|
+
__typename
|
|
444
|
+
}
|
|
445
|
+
... on TaskLoomVideoIntegration {
|
|
446
|
+
service
|
|
447
|
+
identifier {
|
|
448
|
+
url
|
|
449
|
+
videoId
|
|
450
|
+
title
|
|
451
|
+
description
|
|
452
|
+
thumbnail {
|
|
453
|
+
width
|
|
454
|
+
height
|
|
455
|
+
url
|
|
456
|
+
__typename
|
|
457
|
+
}
|
|
458
|
+
__typename
|
|
459
|
+
}
|
|
460
|
+
__typename
|
|
461
|
+
}
|
|
462
|
+
... on TaskMicrosoftTeamsIntegration {
|
|
463
|
+
service
|
|
464
|
+
identifier {
|
|
465
|
+
permalink
|
|
466
|
+
notesMarkdown
|
|
467
|
+
__typename
|
|
468
|
+
}
|
|
469
|
+
__typename
|
|
470
|
+
}
|
|
471
|
+
... on TaskAppleRemindersIntegration {
|
|
472
|
+
service
|
|
473
|
+
identifier {
|
|
474
|
+
id
|
|
475
|
+
listId
|
|
476
|
+
autoImported
|
|
477
|
+
__typename
|
|
478
|
+
}
|
|
479
|
+
__typename
|
|
480
|
+
}
|
|
481
|
+
... on TaskGoogleTasksIntegration {
|
|
482
|
+
service
|
|
483
|
+
identifier {
|
|
484
|
+
id
|
|
485
|
+
listId
|
|
486
|
+
accountId
|
|
487
|
+
__typename
|
|
488
|
+
}
|
|
489
|
+
__typename
|
|
490
|
+
}
|
|
491
|
+
... on TaskMicrosoftToDoIntegration {
|
|
492
|
+
service
|
|
493
|
+
identifier {
|
|
494
|
+
id
|
|
495
|
+
listId
|
|
496
|
+
accountId
|
|
497
|
+
parentTaskId
|
|
498
|
+
__typename
|
|
499
|
+
}
|
|
500
|
+
__typename
|
|
501
|
+
}
|
|
502
|
+
... on TaskSunsamaTaskIntegration {
|
|
503
|
+
service
|
|
504
|
+
identifier {
|
|
505
|
+
taskId
|
|
506
|
+
groupId
|
|
507
|
+
sunsamaUserId
|
|
508
|
+
__typename
|
|
509
|
+
}
|
|
510
|
+
__typename
|
|
511
|
+
}
|
|
512
|
+
__typename
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
fragment PartialTask on PartialTask {
|
|
516
|
+
_id
|
|
517
|
+
recommendedStreamId
|
|
518
|
+
streamIds
|
|
519
|
+
recommendedTimeEstimate
|
|
520
|
+
subtasks {
|
|
521
|
+
_id
|
|
522
|
+
title
|
|
523
|
+
completedDate
|
|
524
|
+
completedBy
|
|
525
|
+
timeEstimate
|
|
526
|
+
actualTime {
|
|
527
|
+
...TaskActualTime
|
|
528
|
+
__typename
|
|
529
|
+
}
|
|
530
|
+
snooze {
|
|
531
|
+
userId
|
|
532
|
+
date
|
|
533
|
+
until
|
|
534
|
+
__typename
|
|
535
|
+
}
|
|
536
|
+
scheduledTime {
|
|
537
|
+
...TaskScheduledTime
|
|
538
|
+
__typename
|
|
539
|
+
}
|
|
540
|
+
integration {
|
|
541
|
+
...TaskIntegration
|
|
542
|
+
__typename
|
|
543
|
+
}
|
|
544
|
+
mergedTaskId
|
|
545
|
+
recommendedTimeEstimate
|
|
546
|
+
__typename
|
|
547
|
+
}
|
|
548
|
+
__typename
|
|
549
|
+
}
|
|
550
|
+
`;
|
|
551
|
+
//# sourceMappingURL=updateTaskNotes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"updateTaskNotes.js","sourceRoot":"","sources":["../../../../../src/queries/mutations/updateTaskNotes.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAElC,MAAM,CAAC,MAAM,0BAA0B,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiiB5C,CAAC"}
|
|
@@ -51,4 +51,20 @@ export const GET_ARCHIVED_TASKS_QUERY = gql `
|
|
|
51
51
|
|
|
52
52
|
${TASK_INTEGRATION_FRAGMENT}
|
|
53
53
|
`;
|
|
54
|
+
export const GET_TASK_BY_ID_QUERY = gql `
|
|
55
|
+
query getTaskById($taskId: String!, $groupId: String!) {
|
|
56
|
+
taskById(taskId: $taskId, groupId: $groupId) {
|
|
57
|
+
...Task
|
|
58
|
+
__typename
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
${TASK_FRAGMENT}
|
|
63
|
+
|
|
64
|
+
${TASK_ACTUAL_TIME_FRAGMENT}
|
|
65
|
+
|
|
66
|
+
${TASK_SCHEDULED_TIME_FRAGMENT}
|
|
67
|
+
|
|
68
|
+
${TASK_INTEGRATION_FRAGMENT}
|
|
69
|
+
`;
|
|
54
70
|
//# sourceMappingURL=tasks.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tasks.js","sourceRoot":"","sources":["../../../../src/queries/tasks.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,EACL,aAAa,EACb,yBAAyB,EACzB,4BAA4B,EAC5B,yBAAyB,GAC1B,MAAM,sBAAsB,CAAC;AAE9B,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAG,CAAA;;;;;;;;IAQrC,aAAa;;IAEb,yBAAyB;;IAEzB,4BAA4B;;IAE5B,yBAAyB;CAC5B,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAG,CAAA;;;;;;;;IAQtC,aAAa;;IAEb,yBAAyB;;IAEzB,4BAA4B;;IAE5B,yBAAyB;CAC5B,CAAC;AAEF,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAG,CAAA;;;;;;;;IAQvC,aAAa;;IAEb,yBAAyB;;IAEzB,4BAA4B;;IAE5B,yBAAyB;CAC5B,CAAC"}
|
|
1
|
+
{"version":3,"file":"tasks.js","sourceRoot":"","sources":["../../../../src/queries/tasks.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,EACL,aAAa,EACb,yBAAyB,EACzB,4BAA4B,EAC5B,yBAAyB,GAC1B,MAAM,sBAAsB,CAAC;AAE9B,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAG,CAAA;;;;;;;;IAQrC,aAAa;;IAEb,yBAAyB;;IAEzB,4BAA4B;;IAE5B,yBAAyB;CAC5B,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAG,CAAA;;;;;;;;IAQtC,aAAa;;IAEb,yBAAyB;;IAEzB,4BAA4B;;IAE5B,yBAAyB;CAC5B,CAAC;AAEF,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAG,CAAA;;;;;;;;IAQvC,aAAa;;IAEb,yBAAyB;;IAEzB,4BAA4B;;IAE5B,yBAAyB;CAC5B,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAG,CAAA;;;;;;;;IAQnC,aAAa;;IAEb,yBAAyB;;IAEzB,4BAA4B;;IAE5B,yBAAyB;CAC5B,CAAC"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Provides a type-safe interface to interact with all Sunsama API endpoints.
|
|
5
5
|
*/
|
|
6
|
-
import type { CreateTaskOptions, CreateTaskPayload, Stream, SunsamaClientConfig, Task, UpdateTaskPayload, User } from '../types/index.js';
|
|
6
|
+
import type { CollabSnapshot, CreateTaskOptions, CreateTaskPayload, Stream, SunsamaClientConfig, Task, UpdateTaskPayload, User } from '../types/index.js';
|
|
7
7
|
/**
|
|
8
8
|
* Main Sunsama API client class
|
|
9
9
|
*
|
|
@@ -93,6 +93,26 @@ export declare class SunsamaClient {
|
|
|
93
93
|
* @throws SunsamaAuthError if not authenticated or request fails
|
|
94
94
|
*/
|
|
95
95
|
getArchivedTasks(offset?: number, limit?: number): Promise<Task[]>;
|
|
96
|
+
/**
|
|
97
|
+
* Gets a specific task by its ID
|
|
98
|
+
*
|
|
99
|
+
* @param taskId - The ID of the task to retrieve
|
|
100
|
+
* @returns The task if found, null if not found
|
|
101
|
+
* @throws SunsamaAuthError if not authenticated or request fails
|
|
102
|
+
*
|
|
103
|
+
* @example
|
|
104
|
+
* ```typescript
|
|
105
|
+
* // Get a task by ID
|
|
106
|
+
* const task = await client.getTaskById('685022edbdef77163d659d4a');
|
|
107
|
+
*
|
|
108
|
+
* if (task) {
|
|
109
|
+
* console.log('Task found:', task.text);
|
|
110
|
+
* } else {
|
|
111
|
+
* console.log('Task not found');
|
|
112
|
+
* }
|
|
113
|
+
* ```
|
|
114
|
+
*/
|
|
115
|
+
getTaskById(taskId: string): Promise<Task | null>;
|
|
96
116
|
/**
|
|
97
117
|
* Gets streams for the user's group
|
|
98
118
|
*
|
|
@@ -208,11 +228,15 @@ export declare class SunsamaClient {
|
|
|
208
228
|
*/
|
|
209
229
|
private static getNextCounter;
|
|
210
230
|
/**
|
|
211
|
-
* Creates a collaborative editing snapshot for task notes
|
|
231
|
+
* Creates a collaborative editing snapshot for task notes using Yjs
|
|
232
|
+
*
|
|
233
|
+
* This method creates a proper Yjs document with the provided notes content
|
|
234
|
+
* and encodes it as a collaborative snapshot that can be used for real-time
|
|
235
|
+
* collaborative editing in Sunsama.
|
|
212
236
|
*
|
|
213
237
|
* @param taskId - The task ID
|
|
214
|
-
* @param notes - The notes content
|
|
215
|
-
* @returns CollabSnapshot object
|
|
238
|
+
* @param notes - The notes content to initialize the document with
|
|
239
|
+
* @returns CollabSnapshot object with Yjs-generated state, or null if no notes
|
|
216
240
|
* @internal
|
|
217
241
|
*/
|
|
218
242
|
private createCollabSnapshot;
|
|
@@ -253,6 +277,71 @@ export declare class SunsamaClient {
|
|
|
253
277
|
timezone?: string;
|
|
254
278
|
limitResponsePayload?: boolean;
|
|
255
279
|
}): Promise<UpdateTaskPayload>;
|
|
280
|
+
/**
|
|
281
|
+
* Updates the notes of a task
|
|
282
|
+
*
|
|
283
|
+
* This method allows you to update both the HTML and markdown versions of task notes.
|
|
284
|
+
* It uses the existing collaborative editing snapshot from the task to ensure proper
|
|
285
|
+
* synchronization with the Sunsama editor and maintain collaborative editing history.
|
|
286
|
+
*
|
|
287
|
+
* @param taskId - The ID of the task to update
|
|
288
|
+
* @param notes - The new notes content in HTML format
|
|
289
|
+
* @param notesMarkdown - The new notes content in markdown format
|
|
290
|
+
* @param options - Additional options for the operation
|
|
291
|
+
* @returns The update result with success status
|
|
292
|
+
* @throws SunsamaAuthError if not authenticated, task not found, or no collaborative snapshot available
|
|
293
|
+
*
|
|
294
|
+
* @example
|
|
295
|
+
* ```typescript
|
|
296
|
+
* // Update task notes with simple text
|
|
297
|
+
* const result = await client.updateTaskNotes(
|
|
298
|
+
* 'taskId123',
|
|
299
|
+
* '<p>Updated task notes</p>',
|
|
300
|
+
* 'Updated task notes'
|
|
301
|
+
* );
|
|
302
|
+
*
|
|
303
|
+
* // Update with more complex HTML content
|
|
304
|
+
* const result = await client.updateTaskNotes(
|
|
305
|
+
* 'taskId123',
|
|
306
|
+
* '<p>Updated notes with <strong>bold</strong> text</p><p>Second paragraph</p>',
|
|
307
|
+
* 'Updated notes with **bold** text\n\nSecond paragraph'
|
|
308
|
+
* );
|
|
309
|
+
*
|
|
310
|
+
* // Get full response payload instead of limited response
|
|
311
|
+
* const result = await client.updateTaskNotes(
|
|
312
|
+
* 'taskId123',
|
|
313
|
+
* '<p>New notes</p>',
|
|
314
|
+
* 'New notes',
|
|
315
|
+
* { limitResponsePayload: false }
|
|
316
|
+
* );
|
|
317
|
+
*
|
|
318
|
+
* // Provide a specific collaborative snapshot to use
|
|
319
|
+
* const task = await client.getTaskById('taskId123');
|
|
320
|
+
* const result = await client.updateTaskNotes(
|
|
321
|
+
* 'taskId123',
|
|
322
|
+
* '<p>New notes</p>',
|
|
323
|
+
* 'New notes',
|
|
324
|
+
* { collabSnapshot: task.collabSnapshot }
|
|
325
|
+
* );
|
|
326
|
+
* ```
|
|
327
|
+
*/
|
|
328
|
+
updateTaskNotes(taskId: string, notes: string, notesMarkdown: string, options?: {
|
|
329
|
+
limitResponsePayload?: boolean;
|
|
330
|
+
collabSnapshot?: CollabSnapshot;
|
|
331
|
+
}): Promise<UpdateTaskPayload>;
|
|
332
|
+
/**
|
|
333
|
+
* Creates an updated collaborative editing snapshot based on existing state
|
|
334
|
+
*
|
|
335
|
+
* This method takes an existing collaborative snapshot and creates a new one
|
|
336
|
+
* with the updated content, properly handling the Yjs document state and
|
|
337
|
+
* incrementing version clocks.
|
|
338
|
+
*
|
|
339
|
+
* @param existingSnapshot - The existing collaborative snapshot
|
|
340
|
+
* @param newContent - The new content to apply
|
|
341
|
+
* @returns Updated CollabSnapshot object
|
|
342
|
+
* @internal
|
|
343
|
+
*/
|
|
344
|
+
private createUpdatedCollabSnapshot;
|
|
256
345
|
/**
|
|
257
346
|
* Sets a session token as a cookie in the jar
|
|
258
347
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/client/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/client/index.ts"],"names":[],"mappings":"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"}
|