@workast/sdk 3.0.0 → 3.2.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/dist/mock.cjs ADDED
@@ -0,0 +1,4721 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/mock.ts
21
+ var mock_exports = {};
22
+ __export(mock_exports, {
23
+ errors: () => errors,
24
+ examples: () => examples_exports,
25
+ mockWorkast: () => mockWorkast
26
+ });
27
+ module.exports = __toCommonJS(mock_exports);
28
+
29
+ // src/errors.ts
30
+ var ApiError = class extends Error {
31
+ status;
32
+ body;
33
+ constructor(message, status, body) {
34
+ super(message);
35
+ this.name = "ApiError";
36
+ this.status = status;
37
+ this.body = body;
38
+ }
39
+ };
40
+ var AuthenticationError = class extends ApiError {
41
+ constructor(message, status = 401, body) {
42
+ super(message, status, body);
43
+ this.name = "AuthenticationError";
44
+ }
45
+ };
46
+ var PermissionError = class extends ApiError {
47
+ constructor(message, status = 403, body) {
48
+ super(message, status, body);
49
+ this.name = "PermissionError";
50
+ }
51
+ };
52
+ var NotFoundError = class extends ApiError {
53
+ constructor(message, status = 404, body) {
54
+ super(message, status, body);
55
+ this.name = "NotFoundError";
56
+ }
57
+ };
58
+ var ValidationError = class extends ApiError {
59
+ constructor(message, status = 400, body) {
60
+ super(message, status, body);
61
+ this.name = "ValidationError";
62
+ }
63
+ };
64
+ function errorFromResponse(status, body) {
65
+ const message = messageFromBody(body) ?? `Request failed with status ${status}`;
66
+ switch (status) {
67
+ case 400:
68
+ return new ValidationError(message, status, body);
69
+ case 401:
70
+ return new AuthenticationError(message, status, body);
71
+ case 403:
72
+ return new PermissionError(message, status, body);
73
+ case 404:
74
+ return new NotFoundError(message, status, body);
75
+ default:
76
+ return new ApiError(message, status, body);
77
+ }
78
+ }
79
+ function messageFromBody(body) {
80
+ if (!body || typeof body !== "object") {
81
+ return void 0;
82
+ }
83
+ const { error, message } = body;
84
+ if (typeof error === "string") {
85
+ return typeof message === "string" ? message : error;
86
+ }
87
+ if (error && typeof error === "object") {
88
+ const nested = error;
89
+ if (typeof nested.message === "string") {
90
+ return nested.message;
91
+ }
92
+ }
93
+ if (typeof message === "string") {
94
+ return message;
95
+ }
96
+ return void 0;
97
+ }
98
+
99
+ // src/request.ts
100
+ function withoutAuthorization(headers = {}) {
101
+ const next = {};
102
+ for (const [key, value] of Object.entries(headers)) {
103
+ if (key.toLowerCase() !== "authorization") {
104
+ next[key] = value;
105
+ }
106
+ }
107
+ return next;
108
+ }
109
+ async function request(ctx, method, path, body, options) {
110
+ const token = await ctx.resolveAuth();
111
+ const headers = {
112
+ ...body !== void 0 ? { "Content-Type": "application/json" } : {},
113
+ ...ctx.headers,
114
+ ...withoutAuthorization(options?.headers),
115
+ Authorization: `Bearer ${token}`
116
+ };
117
+ let url = `${ctx.baseUrl.replace(/\/$/, "")}${path}`;
118
+ const qs = options?.query?.toString();
119
+ if (qs) {
120
+ url += `?${qs}`;
121
+ }
122
+ const response = await ctx.fetch(url, {
123
+ method,
124
+ headers,
125
+ body: body !== void 0 ? JSON.stringify(body) : void 0
126
+ });
127
+ if (!response.ok) {
128
+ let errorBody;
129
+ try {
130
+ errorBody = await response.json();
131
+ } catch {
132
+ errorBody = void 0;
133
+ }
134
+ throw errorFromResponse(response.status, errorBody);
135
+ }
136
+ if (response.status === 204) {
137
+ return void 0;
138
+ }
139
+ const text = await response.text();
140
+ if (!text) {
141
+ return void 0;
142
+ }
143
+ return JSON.parse(text);
144
+ }
145
+
146
+ // src/resources/attachments.ts
147
+ var Attachments = class {
148
+ constructor(client) {
149
+ this.client = client;
150
+ }
151
+ client;
152
+ /**
153
+ * Get a signed URL to download an attachment file.
154
+ * Requires `file:find`.
155
+ *
156
+ * @example
157
+ * const attachment = await workast.attachments.retrieveFileUrl('attachment-id');
158
+ */
159
+ retrieveFileUrl(attachmentId, query, options) {
160
+ const params = new URLSearchParams(options?.query);
161
+ if (query?.download != null) {
162
+ params.set("download", String(query.download));
163
+ }
164
+ return this.client.request(
165
+ "GET",
166
+ `/attachment/${encodeURIComponent(attachmentId)}/file`,
167
+ void 0,
168
+ params.toString() ? { ...options, query: params } : options
169
+ );
170
+ }
171
+ };
172
+
173
+ // src/resources/calendar.ts
174
+ var CalendarEventsResource = class {
175
+ constructor(client) {
176
+ this.client = client;
177
+ }
178
+ client;
179
+ /**
180
+ * List user calendar events.
181
+ * Requires `calendar:find`.
182
+ *
183
+ * @example
184
+ * const results = await workast.calendar.events.list({ from: '2025-10-29', to: '2025-11-05' });
185
+ */
186
+ list(query, options) {
187
+ const params = new URLSearchParams(options?.query);
188
+ if (query?.from) {
189
+ params.set("from", query.from);
190
+ }
191
+ if (query?.to) {
192
+ params.set("to", query.to);
193
+ }
194
+ if (query?.tzid) {
195
+ params.set("tzid", query.tzid);
196
+ }
197
+ if (query?.attendees) {
198
+ for (const value of query.attendees) {
199
+ params.append("attendees", value);
200
+ }
201
+ }
202
+ return this.client.request(
203
+ "GET",
204
+ "/calendar/events",
205
+ void 0,
206
+ params.toString() ? { ...options, query: params } : options
207
+ );
208
+ }
209
+ };
210
+ var CalendarResource = class {
211
+ events;
212
+ constructor(client) {
213
+ this.events = new CalendarEventsResource(client);
214
+ }
215
+ };
216
+
217
+ // src/resources/fields.ts
218
+ var Fields = class {
219
+ constructor(client) {
220
+ this.client = client;
221
+ }
222
+ client;
223
+ /**
224
+ * List custom fields in the team.
225
+ * Requires one of: `field:find` (least privilege) or `field:manage`.
226
+ *
227
+ * @example
228
+ * const fields = await workast.fields.list({ listId: 'list-id' });
229
+ */
230
+ list(query, options) {
231
+ const params = new URLSearchParams(options?.query);
232
+ if (query?.listId) {
233
+ params.set("listId", query.listId);
234
+ }
235
+ return this.client.request(
236
+ "GET",
237
+ "/field",
238
+ void 0,
239
+ params.toString() ? { ...options, query: params } : options
240
+ );
241
+ }
242
+ /**
243
+ * Create a custom field.
244
+ * Requires `field:manage`.
245
+ *
246
+ * @example
247
+ * const field = await workast.fields.create({ name: 'Priority', type: 'text' });
248
+ */
249
+ create(body, options) {
250
+ return this.client.request("POST", "/field", body, options);
251
+ }
252
+ /**
253
+ * Update a custom field.
254
+ * Requires `field:manage`.
255
+ *
256
+ * @example
257
+ * const field = await workast.fields.update('field-id', { name: 'Priority' });
258
+ */
259
+ update(fieldId, body, options) {
260
+ return this.client.request(
261
+ "PUT",
262
+ `/field/${encodeURIComponent(fieldId)}`,
263
+ body,
264
+ options
265
+ );
266
+ }
267
+ /**
268
+ * Remove a custom field.
269
+ * Requires `field:manage`.
270
+ *
271
+ * @example
272
+ * await workast.fields.del('field-id');
273
+ */
274
+ del(fieldId, options) {
275
+ return this.client.request(
276
+ "DELETE",
277
+ `/field/${encodeURIComponent(fieldId)}`,
278
+ void 0,
279
+ options
280
+ );
281
+ }
282
+ };
283
+
284
+ // src/resources/lists.ts
285
+ var ListSublists = class {
286
+ constructor(client) {
287
+ this.client = client;
288
+ }
289
+ client;
290
+ /**
291
+ * List unique sublist names across lists.
292
+ * Requires one of: `list:find` (least privilege) or `list:manage`.
293
+ *
294
+ * @example
295
+ * const names = await workast.lists.sublists.list({ types: ['group'] });
296
+ */
297
+ list(query, options) {
298
+ const params = new URLSearchParams(options?.query);
299
+ if (query?.onlyUserLists != null) {
300
+ params.set("onlyUserLists", String(query.onlyUserLists));
301
+ }
302
+ if (query?.types) {
303
+ for (const value of query.types) {
304
+ params.append("types", value);
305
+ }
306
+ }
307
+ return this.client.request(
308
+ "GET",
309
+ "/list/sublists",
310
+ void 0,
311
+ params.toString() ? { ...options, query: params } : options
312
+ );
313
+ }
314
+ /**
315
+ * Create a sublist in a list.
316
+ * Requires one of: `list:create` (least privilege) or `list:manage`.
317
+ *
318
+ * @example
319
+ * const sublist = await workast.lists.sublists.create('list-id', { name: 'To-do' });
320
+ */
321
+ create(listId, body, options) {
322
+ return this.client.request(
323
+ "POST",
324
+ `/list/${encodeURIComponent(listId)}/sublist`,
325
+ body,
326
+ options
327
+ );
328
+ }
329
+ /**
330
+ * Update a sublist.
331
+ * Requires one of: `list:update` (least privilege) or `list:manage`.
332
+ *
333
+ * @example
334
+ * await workast.lists.sublists.update('list-id', 'sublist-id', { name: 'Done' });
335
+ */
336
+ update(listId, subListId, body, options) {
337
+ return this.client.request(
338
+ "PATCH",
339
+ `/list/${encodeURIComponent(listId)}/sublist/${encodeURIComponent(subListId)}`,
340
+ body,
341
+ options
342
+ );
343
+ }
344
+ /**
345
+ * Remove a sublist.
346
+ * Requires one of: `list:update` (least privilege) or `list:manage`.
347
+ *
348
+ * @example
349
+ * await workast.lists.sublists.del('list-id', 'sublist-id');
350
+ */
351
+ del(listId, subListId, options) {
352
+ return this.client.request(
353
+ "DELETE",
354
+ `/list/${encodeURIComponent(listId)}/sublist/${encodeURIComponent(subListId)}`,
355
+ void 0,
356
+ options
357
+ );
358
+ }
359
+ };
360
+ var ListParticipantsResource = class {
361
+ constructor(client) {
362
+ this.client = client;
363
+ }
364
+ client;
365
+ /**
366
+ * List participants on a list.
367
+ * Requires one of: `list:participant:find` (least privilege) or `list:manage`.
368
+ *
369
+ * @example
370
+ * const users = await workast.lists.participants.list('list-id');
371
+ */
372
+ list(listId, options) {
373
+ return this.client.request(
374
+ "GET",
375
+ `/list/${encodeURIComponent(listId)}/participant`,
376
+ void 0,
377
+ options
378
+ );
379
+ }
380
+ /**
381
+ * Add participants to a list.
382
+ * Requires one of: `list:participant:manage` (least privilege) or `list:manage`.
383
+ *
384
+ * @example
385
+ * await workast.lists.participants.add('list-id', { users: ['user-id'] });
386
+ */
387
+ add(listId, body, options) {
388
+ return this.client.request(
389
+ "POST",
390
+ `/list/${encodeURIComponent(listId)}/participant`,
391
+ body,
392
+ options
393
+ );
394
+ }
395
+ /**
396
+ * Remove participants from a list.
397
+ * Requires one of: `list:participant:manage` (least privilege) or `list:manage`.
398
+ *
399
+ * @example
400
+ * await workast.lists.participants.del('list-id', { users: ['user-id'] });
401
+ */
402
+ del(listId, body, options) {
403
+ return this.client.request(
404
+ "DELETE",
405
+ `/list/${encodeURIComponent(listId)}/participant`,
406
+ body,
407
+ options
408
+ );
409
+ }
410
+ };
411
+ var ListFields = class {
412
+ constructor(client) {
413
+ this.client = client;
414
+ }
415
+ client;
416
+ /**
417
+ * Enable a custom field on a list.
418
+ * Requires `field:manage`.
419
+ *
420
+ * @example
421
+ * await workast.lists.fields.enable('list-id', 'field-id');
422
+ */
423
+ enable(listId, fieldId, options) {
424
+ return this.client.request(
425
+ "POST",
426
+ `/list/${encodeURIComponent(listId)}/field/${encodeURIComponent(fieldId)}`,
427
+ void 0,
428
+ options
429
+ );
430
+ }
431
+ /**
432
+ * Disable a custom field on a list.
433
+ * Requires `field:manage`.
434
+ *
435
+ * @example
436
+ * await workast.lists.fields.disable('list-id', 'field-id');
437
+ */
438
+ disable(listId, fieldId, options) {
439
+ return this.client.request(
440
+ "DELETE",
441
+ `/list/${encodeURIComponent(listId)}/field/${encodeURIComponent(fieldId)}`,
442
+ void 0,
443
+ options
444
+ );
445
+ }
446
+ };
447
+ var Lists = class {
448
+ constructor(client) {
449
+ this.client = client;
450
+ this.sublists = new ListSublists(client);
451
+ this.participants = new ListParticipantsResource(client);
452
+ this.fields = new ListFields(client);
453
+ }
454
+ client;
455
+ sublists;
456
+ participants;
457
+ fields;
458
+ /**
459
+ * Create a list.
460
+ * Requires one of: `list:create` (least privilege) or `list:manage`.
461
+ *
462
+ * @example
463
+ * const list = await workast.lists.create({ name: 'Engineering' });
464
+ */
465
+ create(body, options) {
466
+ return this.client.request("POST", "/list", body, options);
467
+ }
468
+ /**
469
+ * Get a list by ID.
470
+ * Requires one of: `list:find` (least privilege) or `list:manage`.
471
+ *
472
+ * @example
473
+ * const list = await workast.lists.retrieve('list-id');
474
+ */
475
+ retrieve(listId, options) {
476
+ return this.client.request("GET", `/list/${encodeURIComponent(listId)}`, void 0, options);
477
+ }
478
+ /**
479
+ * Update a list.
480
+ * Requires one of: `list:update` (least privilege) or `list:manage`.
481
+ *
482
+ * @example
483
+ * await workast.lists.update('list-id', { name: 'Engineering' });
484
+ */
485
+ update(listId, body, options) {
486
+ return this.client.request("PATCH", `/list/${encodeURIComponent(listId)}`, body, options);
487
+ }
488
+ /**
489
+ * Search lists.
490
+ * Requires one of: `list:find` (least privilege) or `list:manage`.
491
+ *
492
+ * @example
493
+ * const lists = await workast.lists.list({ type: 'group', limit: 10 });
494
+ */
495
+ list(query, options) {
496
+ const params = new URLSearchParams(options?.query);
497
+ if (query?.onlyUserLists != null) {
498
+ params.set("onlyUserLists", String(query.onlyUserLists));
499
+ }
500
+ if (query?.statusIs) {
501
+ params.set("statusIs", query.statusIs);
502
+ }
503
+ if (query?.includeTemplates != null) {
504
+ params.set("includeTemplates", String(query.includeTemplates));
505
+ }
506
+ if (query?.type) {
507
+ params.set("type", query.type);
508
+ }
509
+ if (query?.channelId) {
510
+ params.set("channelId", query.channelId);
511
+ }
512
+ if (query?.participants) {
513
+ for (const value of query.participants) {
514
+ params.append("participants", value);
515
+ }
516
+ }
517
+ if (query?.name) {
518
+ params.set("name", query.name);
519
+ }
520
+ if (query?.limit != null) {
521
+ params.set("limit", String(query.limit));
522
+ }
523
+ if (query?.skip != null) {
524
+ params.set("skip", String(query.skip));
525
+ }
526
+ if (query?.sort) {
527
+ params.set("sort", query.sort);
528
+ }
529
+ return this.client.request(
530
+ "GET",
531
+ "/list",
532
+ void 0,
533
+ params.toString() ? { ...options, query: params } : options
534
+ );
535
+ }
536
+ /**
537
+ * Get the personal list.
538
+ * Requires one of: `list:find` (least privilege) or `list:manage`.
539
+ *
540
+ * @example
541
+ * const list = await workast.lists.retrievePersonal();
542
+ */
543
+ retrievePersonal(options) {
544
+ return this.client.request("GET", "/list/personal", void 0, options);
545
+ }
546
+ /**
547
+ * Archive a list.
548
+ * Requires `list:manage`.
549
+ *
550
+ * @example
551
+ * await workast.lists.archive('list-id');
552
+ */
553
+ archive(listId, options) {
554
+ return this.client.request(
555
+ "POST",
556
+ `/list/${encodeURIComponent(listId)}/archive`,
557
+ void 0,
558
+ options
559
+ );
560
+ }
561
+ /**
562
+ * Unarchive a list.
563
+ * Requires `list:manage`.
564
+ *
565
+ * @example
566
+ * await workast.lists.unarchive('list-id');
567
+ */
568
+ unarchive(listId, options) {
569
+ return this.client.request(
570
+ "POST",
571
+ `/list/${encodeURIComponent(listId)}/unarchive`,
572
+ void 0,
573
+ options
574
+ );
575
+ }
576
+ /**
577
+ * Join a list.
578
+ * Requires `list:join`.
579
+ *
580
+ * @example
581
+ * await workast.lists.join('list-id');
582
+ */
583
+ join(listId, options) {
584
+ return this.client.request(
585
+ "POST",
586
+ `/list/${encodeURIComponent(listId)}/participant/join`,
587
+ void 0,
588
+ options
589
+ );
590
+ }
591
+ /**
592
+ * Request access to a private list.
593
+ * Requires `list:join`.
594
+ *
595
+ * @example
596
+ * await workast.lists.requestAccess('list-id');
597
+ */
598
+ requestAccess(listId, options) {
599
+ return this.client.request(
600
+ "POST",
601
+ `/list/${encodeURIComponent(listId)}/participant/request`,
602
+ void 0,
603
+ options
604
+ );
605
+ }
606
+ /**
607
+ * Import a template into a list.
608
+ * Requires one of: `task:create` (least privilege) or `task:manage`.
609
+ *
610
+ * @example
611
+ * await workast.lists.importTemplate('list-id', 'template-id', { updateDueDates: 30 });
612
+ */
613
+ importTemplate(listId, templateId, body, options) {
614
+ return this.client.request(
615
+ "POST",
616
+ `/list/${encodeURIComponent(listId)}/import/${encodeURIComponent(templateId)}`,
617
+ body,
618
+ options
619
+ );
620
+ }
621
+ };
622
+
623
+ // src/resources/meetings.ts
624
+ var MeetingsResource = class {
625
+ constructor(client) {
626
+ this.client = client;
627
+ }
628
+ client;
629
+ /**
630
+ * List meetings.
631
+ * Requires one of: `meeting:find` (least privilege) or `meeting:manage`.
632
+ *
633
+ * @example
634
+ * const results = await workast.meetings.list({ timeMin: '2026-01-01T00:00:00Z', maxResults: 15 });
635
+ */
636
+ list(query, options) {
637
+ const params = new URLSearchParams(options?.query);
638
+ if (query?.timeMin) {
639
+ params.set("timeMin", query.timeMin);
640
+ }
641
+ if (query?.timeMax) {
642
+ params.set("timeMax", query.timeMax);
643
+ }
644
+ if (query?.maxResults != null) {
645
+ params.set("maxResults", String(query.maxResults));
646
+ }
647
+ if (query?.pageToken) {
648
+ params.set("pageToken", query.pageToken);
649
+ }
650
+ if (query?.attendees) {
651
+ for (const value of query.attendees) {
652
+ params.append("attendees", value);
653
+ }
654
+ }
655
+ return this.client.request(
656
+ "GET",
657
+ "/meeting",
658
+ void 0,
659
+ params.toString() ? { ...options, query: params } : options
660
+ );
661
+ }
662
+ /**
663
+ * Create a meeting from a calendar event, or create a new calendar event.
664
+ * Requires `meeting:manage`.
665
+ *
666
+ * @example
667
+ * const meeting = await workast.meetings.createFromEvent({
668
+ * listId: 'list-id',
669
+ * summary: 'Standup',
670
+ * eventId: 'evt-1',
671
+ * });
672
+ */
673
+ createFromEvent(body, options) {
674
+ return this.client.request("POST", "/meeting", body, options);
675
+ }
676
+ /**
677
+ * Get a meeting by ID.
678
+ * Requires one of: `meeting:find` (least privilege) or `meeting:manage`.
679
+ *
680
+ * @example
681
+ * const meeting = await workast.meetings.retrieve('meeting-id');
682
+ */
683
+ retrieve(meetingId, options) {
684
+ return this.client.request("GET", `/meeting/${encodeURIComponent(meetingId)}`, void 0, options);
685
+ }
686
+ /**
687
+ * Update meeting notes.
688
+ * Requires `meeting:manage`.
689
+ *
690
+ * @example
691
+ * const meeting = await workast.meetings.update('meeting-id', { notes: 'Ship v3' });
692
+ */
693
+ update(meetingId, body, options) {
694
+ return this.client.request("PATCH", `/meeting/${encodeURIComponent(meetingId)}`, body, options);
695
+ }
696
+ /**
697
+ * Get meeting recording assets and transcript.
698
+ * Requires one of: `meeting:find` (least privilege) or `meeting:manage`.
699
+ *
700
+ * @example
701
+ * const recording = await workast.meetings.retrieveRecording('meeting-id');
702
+ */
703
+ retrieveRecording(meetingId, options) {
704
+ return this.client.request(
705
+ "GET",
706
+ `/meeting/${encodeURIComponent(meetingId)}/recording`,
707
+ void 0,
708
+ options
709
+ );
710
+ }
711
+ /**
712
+ * Enable the notetaker for a meeting.
713
+ * Requires `meeting:manage`.
714
+ *
715
+ * @example
716
+ * const meeting = await workast.meetings.enableNotetaker('meeting-id', {
717
+ * joinUrl: 'https://meet.example.com/abc',
718
+ * });
719
+ */
720
+ enableNotetaker(meetingId, body, options) {
721
+ return this.client.request(
722
+ "POST",
723
+ `/meeting/${encodeURIComponent(meetingId)}/notetaker`,
724
+ body,
725
+ options
726
+ );
727
+ }
728
+ /**
729
+ * Disable or remove the notetaker from a meeting.
730
+ * Requires `meeting:manage`.
731
+ *
732
+ * @example
733
+ * const meeting = await workast.meetings.disableNotetaker('meeting-id');
734
+ */
735
+ disableNotetaker(meetingId, options) {
736
+ return this.client.request(
737
+ "DELETE",
738
+ `/meeting/${encodeURIComponent(meetingId)}/notetaker`,
739
+ void 0,
740
+ options
741
+ );
742
+ }
743
+ };
744
+
745
+ // src/resources/notes.ts
746
+ var NotesResource = class {
747
+ constructor(client) {
748
+ this.client = client;
749
+ }
750
+ client;
751
+ /**
752
+ * List notes.
753
+ * Requires one of: `note:find` (least privilege) or `note:manage`.
754
+ *
755
+ * @example
756
+ * const results = await workast.notes.list({ title: 'Spec', limit: 10 });
757
+ */
758
+ list(query, options) {
759
+ const params = new URLSearchParams(options?.query);
760
+ if (query?.showDeleted != null) {
761
+ params.set("showDeleted", String(query.showDeleted));
762
+ }
763
+ if (query?.lists) {
764
+ for (const value of query.lists) {
765
+ params.append("lists", value);
766
+ }
767
+ }
768
+ if (query?.title) {
769
+ params.set("title", query.title);
770
+ }
771
+ if (query?.owners) {
772
+ for (const value of query.owners) {
773
+ params.append("owners", value);
774
+ }
775
+ }
776
+ if (query?.sort) {
777
+ params.set("sort", query.sort);
778
+ }
779
+ if (query?.limit != null) {
780
+ params.set("limit", String(query.limit));
781
+ }
782
+ if (query?.skip != null) {
783
+ params.set("skip", String(query.skip));
784
+ }
785
+ return this.client.request(
786
+ "GET",
787
+ "/note",
788
+ void 0,
789
+ params.toString() ? { ...options, query: params } : options
790
+ );
791
+ }
792
+ /**
793
+ * Get a note by ID.
794
+ * Requires one of: `note:find` (least privilege) or `note:manage`.
795
+ *
796
+ * @example
797
+ * const note = await workast.notes.retrieve('note-id');
798
+ */
799
+ retrieve(noteId, options) {
800
+ return this.client.request("GET", `/note/${encodeURIComponent(noteId)}`, void 0, options);
801
+ }
802
+ /**
803
+ * Update a note.
804
+ * Requires one of: `note:update` (least privilege) or `note:manage`.
805
+ *
806
+ * @example
807
+ * const note = await workast.notes.update('note-id', { title: 'Spec', version: 1, body: '<p>Hello</p>' });
808
+ */
809
+ update(noteId, body, options) {
810
+ return this.client.request("PATCH", `/note/${encodeURIComponent(noteId)}`, body, options);
811
+ }
812
+ /**
813
+ * Delete a note.
814
+ * Requires `note:manage`.
815
+ *
816
+ * @example
817
+ * await workast.notes.del('note-id');
818
+ */
819
+ del(noteId, options) {
820
+ return this.client.request("DELETE", `/note/${encodeURIComponent(noteId)}`, void 0, options);
821
+ }
822
+ };
823
+
824
+ // src/resources/notifications.ts
825
+ var NotificationsResource = class {
826
+ constructor(client) {
827
+ this.client = client;
828
+ }
829
+ client;
830
+ /**
831
+ * List notifications for the logged-in user.
832
+ * Requires one of: `notification:find` (least privilege) or `notification:manage`.
833
+ *
834
+ * @example
835
+ * const results = await workast.notifications.list({ read: false, limit: 10 });
836
+ */
837
+ list(query, options) {
838
+ const params = new URLSearchParams(options?.query);
839
+ if (query?.read != null) {
840
+ params.set("read", String(query.read));
841
+ }
842
+ if (query?.limit != null) {
843
+ params.set("limit", String(query.limit));
844
+ }
845
+ if (query?.skip != null) {
846
+ params.set("skip", String(query.skip));
847
+ }
848
+ if (query?.sort) {
849
+ params.set("sort", query.sort);
850
+ }
851
+ return this.client.request(
852
+ "GET",
853
+ "/notification",
854
+ void 0,
855
+ params.toString() ? { ...options, query: params } : options
856
+ );
857
+ }
858
+ /**
859
+ * Mark a notification as read.
860
+ * Requires `notification:manage`.
861
+ *
862
+ * @example
863
+ * await workast.notifications.markRead('notification-id');
864
+ */
865
+ markRead(notificationId, options) {
866
+ return this.client.request(
867
+ "POST",
868
+ `/notification/${encodeURIComponent(notificationId)}/read`,
869
+ void 0,
870
+ options
871
+ );
872
+ }
873
+ /**
874
+ * Mark a notification as unread.
875
+ * Requires `notification:manage`.
876
+ *
877
+ * @example
878
+ * await workast.notifications.markUnread('notification-id');
879
+ */
880
+ markUnread(notificationId, options) {
881
+ return this.client.request(
882
+ "POST",
883
+ `/notification/${encodeURIComponent(notificationId)}/unread`,
884
+ void 0,
885
+ options
886
+ );
887
+ }
888
+ };
889
+
890
+ // src/resources/reactions.ts
891
+ var Reactions = class {
892
+ constructor(client) {
893
+ this.client = client;
894
+ }
895
+ client;
896
+ /**
897
+ * Add a reaction to an activity.
898
+ * Requires one of: `activity:react` (least privilege) or `task:manage`.
899
+ *
900
+ * @example
901
+ * const reaction = await workast.reactions.add('activity-id', { emoji: ':+1:' });
902
+ */
903
+ add(activityId, body, options) {
904
+ return this.client.request(
905
+ "POST",
906
+ `/activity/${encodeURIComponent(activityId)}/reaction`,
907
+ body,
908
+ options
909
+ );
910
+ }
911
+ /**
912
+ * Remove a reaction from an activity.
913
+ * Requires one of: `activity:react` (least privilege) or `task:manage`.
914
+ *
915
+ * @example
916
+ * await workast.reactions.del('activity-id', 'reaction-id');
917
+ */
918
+ del(activityId, reactionId, options) {
919
+ return this.client.request(
920
+ "DELETE",
921
+ `/activity/${encodeURIComponent(activityId)}/reaction/${encodeURIComponent(reactionId)}`,
922
+ void 0,
923
+ options
924
+ );
925
+ }
926
+ };
927
+
928
+ // src/resources/searches.ts
929
+ var SearchesResource = class {
930
+ constructor(client) {
931
+ this.client = client;
932
+ }
933
+ client;
934
+ /**
935
+ * List searches for the logged-in user.
936
+ * Requires one of: `search:find` (least privilege) or `search:manage`.
937
+ *
938
+ * @example
939
+ * const results = await workast.searches.list({ limit: 10 });
940
+ */
941
+ list(query, options) {
942
+ const params = new URLSearchParams(options?.query);
943
+ if (query?.limit != null) {
944
+ params.set("limit", String(query.limit));
945
+ }
946
+ if (query?.skip != null) {
947
+ params.set("skip", String(query.skip));
948
+ }
949
+ if (query?.sort) {
950
+ params.set("sort", query.sort);
951
+ }
952
+ return this.client.request(
953
+ "GET",
954
+ "/search",
955
+ void 0,
956
+ params.toString() ? { ...options, query: params } : options
957
+ );
958
+ }
959
+ /**
960
+ * Create a search.
961
+ * Requires `search:manage`.
962
+ *
963
+ * @example
964
+ * const search = await workast.searches.create({
965
+ * name: 'My tasks',
966
+ * payload: { predicates: [{ type: 'status', attribute: 'status', comparison: 'eq', value: 'pending' }] },
967
+ * });
968
+ */
969
+ create(body, options) {
970
+ return this.client.request("POST", "/search", body, options);
971
+ }
972
+ /**
973
+ * Get a search by ID.
974
+ * Requires one of: `search:find` (least privilege) or `search:manage`.
975
+ *
976
+ * @example
977
+ * const search = await workast.searches.retrieve('search-id');
978
+ */
979
+ retrieve(searchId, query, options) {
980
+ const params = new URLSearchParams(options?.query);
981
+ if (query?.getTasks != null) {
982
+ params.set("getTasks", String(query.getTasks));
983
+ }
984
+ if (query?.expand) {
985
+ for (const value of query.expand) {
986
+ params.append("expand", value);
987
+ }
988
+ }
989
+ return this.client.request(
990
+ "GET",
991
+ `/search/${encodeURIComponent(searchId)}`,
992
+ void 0,
993
+ params.toString() ? { ...options, query: params } : options
994
+ );
995
+ }
996
+ /**
997
+ * Update a search.
998
+ * Requires `search:manage`.
999
+ *
1000
+ * @example
1001
+ * const search = await workast.searches.update('search-id', { name: 'Updated' });
1002
+ */
1003
+ update(searchId, body, options) {
1004
+ return this.client.request(
1005
+ "PATCH",
1006
+ `/search/${encodeURIComponent(searchId)}`,
1007
+ body,
1008
+ options
1009
+ );
1010
+ }
1011
+ /**
1012
+ * Delete a search.
1013
+ * Requires `search:manage`.
1014
+ *
1015
+ * @example
1016
+ * await workast.searches.del('search-id');
1017
+ */
1018
+ del(searchId, options) {
1019
+ return this.client.request(
1020
+ "DELETE",
1021
+ `/search/${encodeURIComponent(searchId)}`,
1022
+ void 0,
1023
+ options
1024
+ );
1025
+ }
1026
+ /**
1027
+ * List searches pinned on the home screen.
1028
+ * Requires one of: `home:search:find` (least privilege) or `home:search:manage`.
1029
+ *
1030
+ * @example
1031
+ * const results = await workast.searches.listHome({ limit: 10 });
1032
+ */
1033
+ listHome(query, options) {
1034
+ const params = new URLSearchParams(options?.query);
1035
+ if (query?.limit != null) {
1036
+ params.set("limit", String(query.limit));
1037
+ }
1038
+ if (query?.skip != null) {
1039
+ params.set("skip", String(query.skip));
1040
+ }
1041
+ return this.client.request(
1042
+ "GET",
1043
+ "/search/home",
1044
+ void 0,
1045
+ params.toString() ? { ...options, query: params } : options
1046
+ );
1047
+ }
1048
+ /**
1049
+ * Add a search to the home screen.
1050
+ * Requires `home:search:manage`.
1051
+ *
1052
+ * @example
1053
+ * await workast.searches.addHome('search-id');
1054
+ */
1055
+ addHome(searchId, options) {
1056
+ return this.client.request(
1057
+ "POST",
1058
+ `/search/${encodeURIComponent(searchId)}/home`,
1059
+ void 0,
1060
+ options
1061
+ );
1062
+ }
1063
+ /**
1064
+ * Remove a search from the home screen.
1065
+ * Requires `home:search:manage`.
1066
+ *
1067
+ * @example
1068
+ * await workast.searches.removeHome('search-id');
1069
+ */
1070
+ removeHome(searchId, options) {
1071
+ return this.client.request(
1072
+ "DELETE",
1073
+ `/search/${encodeURIComponent(searchId)}/home`,
1074
+ void 0,
1075
+ options
1076
+ );
1077
+ }
1078
+ /**
1079
+ * Share a search with users.
1080
+ * Requires `search:manage`.
1081
+ *
1082
+ * @example
1083
+ * await workast.searches.share('search-id', { users: ['user-id'] });
1084
+ */
1085
+ share(searchId, body, options) {
1086
+ return this.client.request(
1087
+ "POST",
1088
+ `/search/${encodeURIComponent(searchId)}/user`,
1089
+ body,
1090
+ options
1091
+ );
1092
+ }
1093
+ /**
1094
+ * Unshare a search from users.
1095
+ * Requires `search:manage`.
1096
+ *
1097
+ * @example
1098
+ * await workast.searches.unshare('search-id', { users: ['user-id'] });
1099
+ */
1100
+ unshare(searchId, body, options) {
1101
+ return this.client.request(
1102
+ "DELETE",
1103
+ `/search/${encodeURIComponent(searchId)}/user`,
1104
+ body,
1105
+ options
1106
+ );
1107
+ }
1108
+ /**
1109
+ * Set a reminder on a search.
1110
+ * Requires `search:manage`.
1111
+ *
1112
+ * @example
1113
+ * await workast.searches.setReminder('search-id', {
1114
+ * repeat: { freq: 'weekly', byhour: 9, byminute: 0 },
1115
+ * });
1116
+ */
1117
+ setReminder(searchId, body, options) {
1118
+ return this.client.request(
1119
+ "PUT",
1120
+ `/search/${encodeURIComponent(searchId)}/reminder`,
1121
+ body,
1122
+ options
1123
+ );
1124
+ }
1125
+ /**
1126
+ * Delete a reminder from a search.
1127
+ * Requires `search:manage`.
1128
+ *
1129
+ * @example
1130
+ * await workast.searches.delReminder('search-id');
1131
+ */
1132
+ delReminder(searchId, options) {
1133
+ return this.client.request(
1134
+ "DELETE",
1135
+ `/search/${encodeURIComponent(searchId)}/reminder`,
1136
+ void 0,
1137
+ options
1138
+ );
1139
+ }
1140
+ };
1141
+
1142
+ // src/resources/tags.ts
1143
+ var Tags = class {
1144
+ constructor(client) {
1145
+ this.client = client;
1146
+ }
1147
+ client;
1148
+ /**
1149
+ * List tags in the team.
1150
+ * Requires one of: `tag:find` (least privilege) or `tag:manage`.
1151
+ *
1152
+ * @example
1153
+ * const tags = await workast.tags.list({ listId: 'list-id' });
1154
+ */
1155
+ list(query, options) {
1156
+ const params = new URLSearchParams(options?.query);
1157
+ if (query?.listId) {
1158
+ params.set("listId", query.listId);
1159
+ }
1160
+ if (query?.name) {
1161
+ params.set("name", query.name);
1162
+ }
1163
+ return this.client.request(
1164
+ "GET",
1165
+ "/tag",
1166
+ void 0,
1167
+ params.toString() ? { ...options, query: params } : options
1168
+ );
1169
+ }
1170
+ /**
1171
+ * Create a tag.
1172
+ * Requires `tag:manage`.
1173
+ *
1174
+ * @example
1175
+ * const tag = await workast.tags.create({ name: 'Priority', color: '#ff0000' });
1176
+ */
1177
+ create(body, options) {
1178
+ return this.client.request("POST", "/tag", body, options);
1179
+ }
1180
+ /**
1181
+ * Update a tag.
1182
+ * Requires `tag:manage`.
1183
+ *
1184
+ * @example
1185
+ * const tag = await workast.tags.update('tag-id', { name: 'Priority' });
1186
+ */
1187
+ update(tagId, body, options) {
1188
+ return this.client.request(
1189
+ "PATCH",
1190
+ `/tag/${encodeURIComponent(tagId)}`,
1191
+ body,
1192
+ options
1193
+ );
1194
+ }
1195
+ /**
1196
+ * Delete a tag.
1197
+ * Requires `tag:manage`.
1198
+ *
1199
+ * @example
1200
+ * await workast.tags.del('tag-id');
1201
+ */
1202
+ del(tagId, options) {
1203
+ return this.client.request(
1204
+ "DELETE",
1205
+ `/tag/${encodeURIComponent(tagId)}`,
1206
+ void 0,
1207
+ options
1208
+ );
1209
+ }
1210
+ };
1211
+
1212
+ // src/resources/tasks.ts
1213
+ var TaskSubtasks = class {
1214
+ constructor(client) {
1215
+ this.client = client;
1216
+ }
1217
+ client;
1218
+ /**
1219
+ * Create a subtask on a task.
1220
+ * Requires one of: `task:create` (least privilege) or `task:manage`.
1221
+ *
1222
+ * @example
1223
+ * const subtask = await workast.tasks.subtasks.create('task-id', { text: 'Write tests' });
1224
+ */
1225
+ create(taskId, body, options) {
1226
+ return this.client.request("POST", `/task/${encodeURIComponent(taskId)}/subtask`, body, options);
1227
+ }
1228
+ };
1229
+ var TaskDependencies = class {
1230
+ constructor(client) {
1231
+ this.client = client;
1232
+ }
1233
+ client;
1234
+ /**
1235
+ * Add a dependency to a task.
1236
+ * Requires one of: `task:manage:dependency` (least privilege) or `task:manage`.
1237
+ *
1238
+ * @example
1239
+ * await workast.tasks.dependencies.add('task-id', 'dependency-id');
1240
+ */
1241
+ add(taskId, dependencyId, options) {
1242
+ return this.client.request(
1243
+ "POST",
1244
+ `/task/${encodeURIComponent(taskId)}/dependency/${encodeURIComponent(dependencyId)}`,
1245
+ void 0,
1246
+ options
1247
+ );
1248
+ }
1249
+ /**
1250
+ * Remove a dependency from a task.
1251
+ * Requires one of: `task:manage:dependency` (least privilege) or `task:manage`.
1252
+ *
1253
+ * @example
1254
+ * await workast.tasks.dependencies.del('task-id', 'dependency-id');
1255
+ */
1256
+ del(taskId, dependencyId, options) {
1257
+ return this.client.request(
1258
+ "DELETE",
1259
+ `/task/${encodeURIComponent(taskId)}/dependency/${encodeURIComponent(dependencyId)}`,
1260
+ void 0,
1261
+ options
1262
+ );
1263
+ }
1264
+ };
1265
+ var TaskAttachments = class {
1266
+ constructor(client) {
1267
+ this.client = client;
1268
+ }
1269
+ client;
1270
+ /**
1271
+ * Create an attachment on a task.
1272
+ * Requires one of: `task:manage:attachment` (least privilege) or `task:manage`.
1273
+ *
1274
+ * @example
1275
+ * const attachment = await workast.tasks.attachments.create('task-id', { author: 'user-id' });
1276
+ */
1277
+ create(taskId, body, options) {
1278
+ return this.client.request("POST", `/task/${encodeURIComponent(taskId)}/attachment`, body, options);
1279
+ }
1280
+ /**
1281
+ * Update a task attachment.
1282
+ * Requires one of: `task:manage:attachment` (least privilege) or `task:manage`.
1283
+ *
1284
+ * @example
1285
+ * const attachment = await workast.tasks.attachments.update('task-id', 'attachment-id', { date: '2026-01-01' });
1286
+ */
1287
+ update(taskId, attachmentId, body, options) {
1288
+ return this.client.request(
1289
+ "PATCH",
1290
+ `/task/${encodeURIComponent(taskId)}/attachment/${encodeURIComponent(attachmentId)}`,
1291
+ body,
1292
+ options
1293
+ );
1294
+ }
1295
+ /**
1296
+ * Delete a task attachment.
1297
+ * Requires one of: `task:manage:attachment` (least privilege) or `task:manage`.
1298
+ *
1299
+ * @example
1300
+ * await workast.tasks.attachments.del('task-id', 'attachment-id');
1301
+ */
1302
+ del(taskId, attachmentId, options) {
1303
+ return this.client.request(
1304
+ "DELETE",
1305
+ `/task/${encodeURIComponent(taskId)}/attachment/${encodeURIComponent(attachmentId)}`,
1306
+ void 0,
1307
+ options
1308
+ );
1309
+ }
1310
+ };
1311
+ var TaskActivitiesResource = class {
1312
+ constructor(client) {
1313
+ this.client = client;
1314
+ }
1315
+ client;
1316
+ /**
1317
+ * List activities on a task.
1318
+ * Requires one of: `task:activity:find` (least privilege) or `task:manage`.
1319
+ *
1320
+ * @example
1321
+ * const results = await workast.tasks.activities.list('task-id', { type: ['comment'], limit: 10 });
1322
+ */
1323
+ list(taskId, query, options) {
1324
+ const params = new URLSearchParams(options?.query);
1325
+ if (query?.type) {
1326
+ for (const value of query.type) {
1327
+ params.append("type", value);
1328
+ }
1329
+ }
1330
+ if (query?.actorTypes) {
1331
+ for (const value of query.actorTypes) {
1332
+ params.append("actorTypes", value);
1333
+ }
1334
+ }
1335
+ if (query?.limit != null) {
1336
+ params.set("limit", String(query.limit));
1337
+ }
1338
+ if (query?.skip != null) {
1339
+ params.set("skip", String(query.skip));
1340
+ }
1341
+ if (query?.sort) {
1342
+ params.set("sort", query.sort);
1343
+ }
1344
+ return this.client.request(
1345
+ "GET",
1346
+ `/task/${encodeURIComponent(taskId)}/activity`,
1347
+ void 0,
1348
+ params.toString() ? { ...options, query: params } : options
1349
+ );
1350
+ }
1351
+ /**
1352
+ * Create a comment activity on a task.
1353
+ * Requires one of: `task:manage:activity` (least privilege) or `task:manage`.
1354
+ *
1355
+ * @example
1356
+ * const activity = await workast.tasks.activities.create('task-id', { type: 'comment', value: 'Looks good' });
1357
+ */
1358
+ create(taskId, body, options) {
1359
+ return this.client.request("POST", `/task/${encodeURIComponent(taskId)}/activity`, body, options);
1360
+ }
1361
+ /**
1362
+ * Update a task activity.
1363
+ * Requires one of: `task:manage:activity` (least privilege) or `task:manage`.
1364
+ *
1365
+ * @example
1366
+ * await workast.tasks.activities.update('task-id', 'activity-id', { value: 'Updated comment' });
1367
+ */
1368
+ update(taskId, activityId, body, options) {
1369
+ return this.client.request(
1370
+ "PATCH",
1371
+ `/task/${encodeURIComponent(taskId)}/activity/${encodeURIComponent(activityId)}`,
1372
+ body,
1373
+ options
1374
+ );
1375
+ }
1376
+ /**
1377
+ * Delete a task activity.
1378
+ * Requires one of: `task:manage:activity` (least privilege) or `task:manage`.
1379
+ *
1380
+ * @example
1381
+ * await workast.tasks.activities.del('task-id', 'activity-id');
1382
+ */
1383
+ del(taskId, activityId, options) {
1384
+ return this.client.request(
1385
+ "DELETE",
1386
+ `/task/${encodeURIComponent(taskId)}/activity/${encodeURIComponent(activityId)}`,
1387
+ void 0,
1388
+ options
1389
+ );
1390
+ }
1391
+ };
1392
+ var Tasks = class {
1393
+ constructor(client) {
1394
+ this.client = client;
1395
+ this.subtasks = new TaskSubtasks(client);
1396
+ this.dependencies = new TaskDependencies(client);
1397
+ this.attachments = new TaskAttachments(client);
1398
+ this.activities = new TaskActivitiesResource(client);
1399
+ }
1400
+ client;
1401
+ subtasks;
1402
+ dependencies;
1403
+ attachments;
1404
+ activities;
1405
+ /**
1406
+ * Create a task in a list.
1407
+ * Requires one of: `task:create` (least privilege) or `task:manage`.
1408
+ *
1409
+ * @example
1410
+ * const task = await workast.tasks.create('list-id', { text: 'Ship v3' });
1411
+ */
1412
+ create(listId, body, options) {
1413
+ return this.client.request("POST", `/list/${encodeURIComponent(listId)}/task`, body, options);
1414
+ }
1415
+ /**
1416
+ * Create a task in the personal list.
1417
+ * Requires one of: `task:create` (least privilege) or `task:manage`.
1418
+ *
1419
+ * @example
1420
+ * const task = await workast.tasks.createPersonal({ text: 'Ship v3' });
1421
+ */
1422
+ createPersonal(body, options) {
1423
+ return this.client.request("POST", "/list/personal/task", body, options);
1424
+ }
1425
+ /**
1426
+ * Get a task by ID.
1427
+ * Requires one of: `task:find` (least privilege) or `task:manage`.
1428
+ *
1429
+ * @example
1430
+ * const task = await workast.tasks.retrieve('task-id');
1431
+ */
1432
+ retrieve(taskId, options) {
1433
+ return this.client.request("GET", `/task/${encodeURIComponent(taskId)}`, void 0, options);
1434
+ }
1435
+ /**
1436
+ * Get a task by short ID.
1437
+ * Requires one of: `task:find` (least privilege) or `task:manage`.
1438
+ *
1439
+ * @example
1440
+ * const task = await workast.tasks.retrieveByShortId('t4k1');
1441
+ */
1442
+ retrieveByShortId(shortId, options) {
1443
+ return this.client.request("GET", `/task/shortid/${encodeURIComponent(shortId)}`, void 0, options);
1444
+ }
1445
+ /**
1446
+ * Update a task.
1447
+ * Requires `task:manage`.
1448
+ *
1449
+ * @example
1450
+ * await workast.tasks.update('task-id', { text: 'Ship v3' });
1451
+ */
1452
+ update(taskId, body, options) {
1453
+ return this.client.request("PATCH", `/task/${encodeURIComponent(taskId)}`, body, options);
1454
+ }
1455
+ /**
1456
+ * Delete a task.
1457
+ * Requires one of: `task:manage:remove` (least privilege) or `task:manage`.
1458
+ *
1459
+ * @example
1460
+ * await workast.tasks.del('task-id');
1461
+ */
1462
+ del(taskId, options) {
1463
+ return this.client.request("DELETE", `/task/${encodeURIComponent(taskId)}`, void 0, options);
1464
+ }
1465
+ /**
1466
+ * Search tasks.
1467
+ * Requires one of: `task:find` (least privilege) or `task:manage`.
1468
+ *
1469
+ * @example
1470
+ * const results = await workast.tasks.list({
1471
+ * predicates: [{ type: 'status', attribute: 'status', comparison: 'eq', value: 'pending' }],
1472
+ * });
1473
+ */
1474
+ list(body, options) {
1475
+ return this.client.request("POST", "/task/search", body, options);
1476
+ }
1477
+ /**
1478
+ * Complete a task.
1479
+ * Requires one of: `task:manage:status` (least privilege) or `task:manage`.
1480
+ *
1481
+ * @example
1482
+ * await workast.tasks.complete('task-id');
1483
+ */
1484
+ complete(taskId, options) {
1485
+ return this.client.request("POST", `/task/${encodeURIComponent(taskId)}/done`, void 0, options);
1486
+ }
1487
+ /**
1488
+ * Uncomplete a task.
1489
+ * Requires one of: `task:manage:status` (least privilege) or `task:manage`.
1490
+ *
1491
+ * @example
1492
+ * await workast.tasks.uncomplete('task-id');
1493
+ */
1494
+ uncomplete(taskId, options) {
1495
+ return this.client.request("POST", `/task/${encodeURIComponent(taskId)}/undone`, void 0, options);
1496
+ }
1497
+ /**
1498
+ * Assign users to a task.
1499
+ * Requires one of: `task:manage:assignee` (least privilege) or `task:manage`.
1500
+ *
1501
+ * @example
1502
+ * await workast.tasks.assign('task-id', { users: ['user-id'] });
1503
+ */
1504
+ assign(taskId, body, options) {
1505
+ return this.client.request("POST", `/task/${encodeURIComponent(taskId)}/assigned`, body, options);
1506
+ }
1507
+ /**
1508
+ * Unassign users from a task.
1509
+ * Requires one of: `task:manage:assignee` (least privilege) or `task:manage`.
1510
+ *
1511
+ * @example
1512
+ * await workast.tasks.unassign('task-id', { users: ['user-id'] });
1513
+ */
1514
+ unassign(taskId, body, options) {
1515
+ return this.client.request("DELETE", `/task/${encodeURIComponent(taskId)}/assigned`, body, options);
1516
+ }
1517
+ /**
1518
+ * Add followers to a task.
1519
+ * Requires `user:task:follow`.
1520
+ *
1521
+ * @example
1522
+ * await workast.tasks.follow('task-id', { users: ['user-id'] });
1523
+ */
1524
+ follow(taskId, body, options) {
1525
+ return this.client.request("POST", `/task/${encodeURIComponent(taskId)}/follow`, body, options);
1526
+ }
1527
+ /**
1528
+ * Remove followers from a task.
1529
+ * Requires `user:task:follow`.
1530
+ *
1531
+ * @example
1532
+ * await workast.tasks.unfollow('task-id', { users: ['user-id'] });
1533
+ */
1534
+ unfollow(taskId, body, options) {
1535
+ return this.client.request("POST", `/task/${encodeURIComponent(taskId)}/unfollow`, body, options);
1536
+ }
1537
+ /**
1538
+ * Move tasks to another list.
1539
+ * Requires one of: `task:manage:move` (least privilege) or `task:manage`.
1540
+ *
1541
+ * @example
1542
+ * await workast.tasks.move('list-id', { tasks: ['task-id'], target: 'other-list-id' });
1543
+ */
1544
+ move(listId, body, options) {
1545
+ return this.client.request("POST", `/list/${encodeURIComponent(listId)}/move`, body, options);
1546
+ }
1547
+ /**
1548
+ * Create many tasks in a list.
1549
+ * Requires one of: `task:create` (least privilege) or `task:manage`.
1550
+ *
1551
+ * @example
1552
+ * await workast.tasks.createMany('list-id', [{ text: 'One' }, { text: 'Two' }]);
1553
+ */
1554
+ createMany(listId, body, options) {
1555
+ return this.client.request("POST", `/list/${encodeURIComponent(listId)}/task/bulk`, body, options);
1556
+ }
1557
+ /**
1558
+ * Update many tasks.
1559
+ * Requires `task:manage`.
1560
+ *
1561
+ * @example
1562
+ * const result = await workast.tasks.updateMany({ tasks: ['task-id'], status: 'done' });
1563
+ */
1564
+ updateMany(body, options) {
1565
+ return this.client.request("PUT", "/task", body, options);
1566
+ }
1567
+ /**
1568
+ * List home (favourite) tasks.
1569
+ * Requires one of: `home:task:find` (least privilege) or `home:task:manage`.
1570
+ *
1571
+ * @example
1572
+ * const home = await workast.tasks.listHome();
1573
+ */
1574
+ listHome(options) {
1575
+ return this.client.request("GET", "/task/home", void 0, options);
1576
+ }
1577
+ /**
1578
+ * Add a task to the home screen.
1579
+ * Requires `home:task:manage`.
1580
+ *
1581
+ * @example
1582
+ * await workast.tasks.addHome('task-id');
1583
+ */
1584
+ addHome(taskId, options) {
1585
+ return this.client.request("POST", `/task/${encodeURIComponent(taskId)}/home`, void 0, options);
1586
+ }
1587
+ /**
1588
+ * Remove a task from the home screen.
1589
+ * Requires `home:task:manage`.
1590
+ *
1591
+ * @example
1592
+ * await workast.tasks.removeHome('task-id');
1593
+ */
1594
+ removeHome(taskId, options) {
1595
+ return this.client.request("DELETE", `/task/${encodeURIComponent(taskId)}/home`, void 0, options);
1596
+ }
1597
+ /**
1598
+ * Add tags to a task.
1599
+ * Requires one of: `task:manage:tag` (least privilege) or `task:manage`.
1600
+ *
1601
+ * @example
1602
+ * await workast.tasks.addTag('task-id', { tags: ['tag-id'] });
1603
+ */
1604
+ addTag(taskId, body, options) {
1605
+ return this.client.request("POST", `/task/${encodeURIComponent(taskId)}/tag`, body, options);
1606
+ }
1607
+ /**
1608
+ * Remove tags from a task.
1609
+ * Requires one of: `task:manage:tag` (least privilege) or `task:manage`.
1610
+ *
1611
+ * @example
1612
+ * await workast.tasks.removeTag('task-id', { tags: ['tag-id'] });
1613
+ */
1614
+ removeTag(taskId, body, options) {
1615
+ return this.client.request("DELETE", `/task/${encodeURIComponent(taskId)}/tag`, body, options);
1616
+ }
1617
+ /**
1618
+ * Convert a task into a subtask of another task.
1619
+ * Requires `task:manage`.
1620
+ *
1621
+ * @example
1622
+ * await workast.tasks.convertToSubtask('task-id', { parentTaskId: 'parent-id' });
1623
+ */
1624
+ convertToSubtask(taskId, body, options) {
1625
+ return this.client.request(
1626
+ "POST",
1627
+ `/task/${encodeURIComponent(taskId)}/convert-to-subtask`,
1628
+ body,
1629
+ options
1630
+ );
1631
+ }
1632
+ /**
1633
+ * Convert a subtask into a standalone task.
1634
+ * Requires `task:manage`.
1635
+ *
1636
+ * @example
1637
+ * const task = await workast.tasks.convertToTask('task-id');
1638
+ */
1639
+ convertToTask(taskId, options) {
1640
+ return this.client.request(
1641
+ "POST",
1642
+ `/task/${encodeURIComponent(taskId)}/convert-to-task`,
1643
+ void 0,
1644
+ options
1645
+ );
1646
+ }
1647
+ };
1648
+
1649
+ // src/resources/tokens.ts
1650
+ var Tokens = class {
1651
+ constructor(client) {
1652
+ this.client = client;
1653
+ }
1654
+ client;
1655
+ /**
1656
+ * Get the token details.
1657
+ * Requires any authenticated token (no specific scope).
1658
+ *
1659
+ * @example
1660
+ * const token = await workast.tokens.retrieve();
1661
+ */
1662
+ retrieve(options) {
1663
+ return this.client.request("GET", "/me", void 0, options);
1664
+ }
1665
+ };
1666
+
1667
+ // src/resources/users.ts
1668
+ function appendValues(params, key, value) {
1669
+ if (value == null) {
1670
+ return;
1671
+ }
1672
+ if (Array.isArray(value)) {
1673
+ for (const item of value) {
1674
+ params.append(key, item);
1675
+ }
1676
+ return;
1677
+ }
1678
+ params.set(key, value);
1679
+ }
1680
+ var Users = class {
1681
+ constructor(client) {
1682
+ this.client = client;
1683
+ }
1684
+ client;
1685
+ /**
1686
+ * Get the logged-in user.
1687
+ * Requires any authenticated token (no specific scope).
1688
+ *
1689
+ * @example
1690
+ * const me = await workast.users.me();
1691
+ */
1692
+ me(options) {
1693
+ return this.client.request("GET", "/user/me", void 0, options);
1694
+ }
1695
+ /**
1696
+ * List users in the team.
1697
+ * Requires one of: `user:find` (least privilege) or `user:manage`.
1698
+ *
1699
+ * @example
1700
+ * const users = await workast.users.list({ name: 'Ada', limit: 10 });
1701
+ */
1702
+ list(query, options) {
1703
+ const params = new URLSearchParams(options?.query);
1704
+ if (query?.name) {
1705
+ params.set("name", query.name);
1706
+ }
1707
+ if (query?.email) {
1708
+ params.set("email", query.email);
1709
+ }
1710
+ appendValues(params, "slackUserId", query?.slackUserId);
1711
+ appendValues(params, "webexUserId", query?.webexUserId);
1712
+ if (query?.random != null) {
1713
+ params.set("random", String(query.random));
1714
+ }
1715
+ appendValues(params, "status", query?.status);
1716
+ appendValues(params, "role", query?.role);
1717
+ if (query?.sort) {
1718
+ params.set("sort", query.sort);
1719
+ }
1720
+ if (query?.limit != null) {
1721
+ params.set("limit", String(query.limit));
1722
+ }
1723
+ if (query?.offset != null) {
1724
+ params.set("offset", String(query.offset));
1725
+ }
1726
+ return this.client.request(
1727
+ "GET",
1728
+ "/user",
1729
+ void 0,
1730
+ params.toString() ? { ...options, query: params } : options
1731
+ );
1732
+ }
1733
+ /**
1734
+ * Get a user by ID.
1735
+ * Requires one of: `user:find` (least privilege) or `user:manage`.
1736
+ *
1737
+ * @example
1738
+ * const user = await workast.users.retrieve('user-id');
1739
+ */
1740
+ retrieve(userId, options) {
1741
+ return this.client.request("GET", `/user/${encodeURIComponent(userId)}`, void 0, options);
1742
+ }
1743
+ /**
1744
+ * Get a user by email.
1745
+ * Requires one of: `user:find` (least privilege) or `user:manage`.
1746
+ *
1747
+ * @example
1748
+ * const user = await workast.users.retrieveByEmail('ada@example.com');
1749
+ */
1750
+ retrieveByEmail(email, query, options) {
1751
+ const params = new URLSearchParams(options?.query);
1752
+ if (query?.platform) {
1753
+ params.set("platform", query.platform);
1754
+ }
1755
+ return this.client.request(
1756
+ "GET",
1757
+ `/user/email/${encodeURIComponent(email)}`,
1758
+ void 0,
1759
+ params.toString() ? { ...options, query: params } : options
1760
+ );
1761
+ }
1762
+ /**
1763
+ * Invite a user to the team.
1764
+ * Requires one of: `user:invite` (least privilege) or `user:manage`.
1765
+ *
1766
+ * @example
1767
+ * const user = await workast.users.invite({ name: 'Ada', email: 'ada@example.com', role: 'member' });
1768
+ */
1769
+ invite(body, options) {
1770
+ return this.client.request("POST", "/user/invite", body, options);
1771
+ }
1772
+ };
1773
+
1774
+ // src/resources/workflows.ts
1775
+ function pagingOptions(query, options) {
1776
+ const params = new URLSearchParams(options?.query);
1777
+ if (query?.limit != null) {
1778
+ params.set("limit", String(query.limit));
1779
+ }
1780
+ if (query?.skip != null) {
1781
+ params.set("skip", String(query.skip));
1782
+ }
1783
+ return params.toString() ? { ...options, query: params } : options;
1784
+ }
1785
+ var WorkflowsResource = class {
1786
+ constructor(client) {
1787
+ this.client = client;
1788
+ }
1789
+ client;
1790
+ /**
1791
+ * List workflows created by the logged-in user.
1792
+ * Requires one of: `workflow:find` (least privilege) or `workflow:manage`.
1793
+ *
1794
+ * @example
1795
+ * const results = await workast.workflows.list({ limit: 10, skip: 0 });
1796
+ */
1797
+ list(query, options) {
1798
+ return this.client.request("GET", "/workflow", void 0, pagingOptions(query, options));
1799
+ }
1800
+ /**
1801
+ * Create a workflow.
1802
+ * Requires `workflow:manage`.
1803
+ *
1804
+ * @example
1805
+ * const workflow = await workast.workflows.create({
1806
+ * type: 'event',
1807
+ * trigger: 'task_created',
1808
+ * prompt: 'Ship v3',
1809
+ * lists: ['list-id'],
1810
+ * });
1811
+ */
1812
+ create(body, options) {
1813
+ return this.client.request("POST", "/workflow", body, options);
1814
+ }
1815
+ /**
1816
+ * Get a workflow by ID.
1817
+ * Requires one of: `workflow:find` (least privilege) or `workflow:manage`.
1818
+ *
1819
+ * @example
1820
+ * const workflow = await workast.workflows.retrieve('workflow-id');
1821
+ */
1822
+ retrieve(workflowId, options) {
1823
+ return this.client.request(
1824
+ "GET",
1825
+ `/workflow/${encodeURIComponent(workflowId)}`,
1826
+ void 0,
1827
+ options
1828
+ );
1829
+ }
1830
+ /**
1831
+ * Update a workflow.
1832
+ * Requires `workflow:manage`.
1833
+ *
1834
+ * @example
1835
+ * await workast.workflows.update('workflow-id', { prompt: 'Ship v3' });
1836
+ */
1837
+ update(workflowId, body, options) {
1838
+ return this.client.request(
1839
+ "PATCH",
1840
+ `/workflow/${encodeURIComponent(workflowId)}`,
1841
+ body,
1842
+ options
1843
+ );
1844
+ }
1845
+ /**
1846
+ * Delete a workflow.
1847
+ * Requires `workflow:manage`.
1848
+ *
1849
+ * @example
1850
+ * await workast.workflows.del('workflow-id');
1851
+ */
1852
+ del(workflowId, options) {
1853
+ return this.client.request(
1854
+ "DELETE",
1855
+ `/workflow/${encodeURIComponent(workflowId)}`,
1856
+ void 0,
1857
+ options
1858
+ );
1859
+ }
1860
+ /**
1861
+ * Activate a workflow.
1862
+ * Requires `workflow:manage`.
1863
+ *
1864
+ * @example
1865
+ * await workast.workflows.activate('workflow-id');
1866
+ */
1867
+ activate(workflowId, options) {
1868
+ return this.client.request(
1869
+ "PATCH",
1870
+ `/workflow/${encodeURIComponent(workflowId)}/activate`,
1871
+ void 0,
1872
+ options
1873
+ );
1874
+ }
1875
+ /**
1876
+ * Deactivate a workflow.
1877
+ * Requires `workflow:manage`.
1878
+ *
1879
+ * @example
1880
+ * await workast.workflows.deactivate('workflow-id');
1881
+ */
1882
+ deactivate(workflowId, options) {
1883
+ return this.client.request(
1884
+ "PATCH",
1885
+ `/workflow/${encodeURIComponent(workflowId)}/deactivate`,
1886
+ void 0,
1887
+ options
1888
+ );
1889
+ }
1890
+ };
1891
+
1892
+ // src/client.ts
1893
+ var DEFAULT_BASE_URL = "https://api.workast.com";
1894
+ var Workast = class _Workast {
1895
+ attachments;
1896
+ calendar;
1897
+ fields;
1898
+ lists;
1899
+ meetings;
1900
+ notes;
1901
+ notifications;
1902
+ reactions;
1903
+ searches;
1904
+ tags;
1905
+ tasks;
1906
+ tokens;
1907
+ users;
1908
+ workflows;
1909
+ apiKey;
1910
+ token;
1911
+ getTokenFn;
1912
+ baseUrl;
1913
+ fetchFn;
1914
+ headers;
1915
+ constructor(options) {
1916
+ const opts = typeof options === "string" ? { apiKey: options } : options;
1917
+ const passedApiKey = typeof options === "string" || "apiKey" in opts;
1918
+ if (typeof window !== "undefined" && passedApiKey) {
1919
+ throw new Error("apiKey cannot be used in a browser. Use token or getToken instead.");
1920
+ }
1921
+ if ("getToken" in opts) {
1922
+ this.getTokenFn = opts.getToken;
1923
+ } else if ("token" in opts) {
1924
+ this.token = opts.token;
1925
+ } else if ("apiKey" in opts) {
1926
+ this.apiKey = opts.apiKey;
1927
+ } else {
1928
+ throw new Error("Missing authentication. Provide apiKey, token, or getToken.");
1929
+ }
1930
+ this.baseUrl = opts.baseUrl ?? DEFAULT_BASE_URL;
1931
+ this.fetchFn = opts.fetch ?? globalThis.fetch.bind(globalThis);
1932
+ this.headers = withoutAuthorization(opts.headers);
1933
+ this.attachments = new Attachments(this);
1934
+ this.calendar = new CalendarResource(this);
1935
+ this.fields = new Fields(this);
1936
+ this.lists = new Lists(this);
1937
+ this.meetings = new MeetingsResource(this);
1938
+ this.notes = new NotesResource(this);
1939
+ this.notifications = new NotificationsResource(this);
1940
+ this.reactions = new Reactions(this);
1941
+ this.searches = new SearchesResource(this);
1942
+ this.tags = new Tags(this);
1943
+ this.tasks = new Tasks(this);
1944
+ this.tokens = new Tokens(this);
1945
+ this.users = new Users(this);
1946
+ this.workflows = new WorkflowsResource(this);
1947
+ }
1948
+ withHeaders(headers) {
1949
+ return new _Workast({
1950
+ ...this.authOptions(),
1951
+ baseUrl: this.baseUrl,
1952
+ fetch: this.fetchFn,
1953
+ headers: { ...this.headers, ...withoutAuthorization(headers) }
1954
+ });
1955
+ }
1956
+ setHeaders(headers) {
1957
+ this.headers = { ...this.headers, ...withoutAuthorization(headers) };
1958
+ }
1959
+ request(method, path, body, options) {
1960
+ return request(this.context(), method, path, body, options);
1961
+ }
1962
+ context() {
1963
+ return {
1964
+ baseUrl: this.baseUrl,
1965
+ headers: this.headers,
1966
+ fetch: this.fetchFn,
1967
+ resolveAuth: () => this.resolveAuth()
1968
+ };
1969
+ }
1970
+ authOptions() {
1971
+ if (this.getTokenFn) {
1972
+ return { getToken: this.getTokenFn };
1973
+ }
1974
+ if (this.token) {
1975
+ return { token: this.token };
1976
+ }
1977
+ if (this.apiKey) {
1978
+ return { apiKey: this.apiKey };
1979
+ }
1980
+ throw new Error("Missing authentication. Provide apiKey, token, or getToken.");
1981
+ }
1982
+ async resolveAuth() {
1983
+ const auth = this.authOptions();
1984
+ if ("getToken" in auth) {
1985
+ return auth.getToken();
1986
+ }
1987
+ if ("token" in auth) {
1988
+ return auth.token;
1989
+ }
1990
+ return auth.apiKey;
1991
+ }
1992
+ };
1993
+
1994
+ // src/types/examples.ts
1995
+ var examples_exports = {};
1996
+ __export(examples_exports, {
1997
+ attachment: () => attachment,
1998
+ attachmentFileUrl: () => attachmentFileUrl,
1999
+ calendarEvents: () => calendarEvents,
2000
+ commentActivity: () => commentActivity,
2001
+ customField: () => customField,
2002
+ homeTasks: () => homeTasks,
2003
+ list: () => list,
2004
+ listEnumerate: () => listEnumerate,
2005
+ meeting: () => meeting,
2006
+ meetingDetail: () => meetingDetail,
2007
+ meetingRecordingResource: () => meetingRecordingResource,
2008
+ meetings: () => meetings,
2009
+ note: () => note,
2010
+ noteDetail: () => noteDetail,
2011
+ notes: () => notes,
2012
+ notifications: () => notifications,
2013
+ reactionReadOnly: () => reactionReadOnly,
2014
+ search: () => search,
2015
+ searchDetail: () => searchDetail,
2016
+ searchResults: () => searchResults,
2017
+ searches: () => searches,
2018
+ subList: () => subList,
2019
+ tag: () => tag,
2020
+ task: () => task,
2021
+ taskActivities: () => taskActivities,
2022
+ taskBulkUpdateResult: () => taskBulkUpdateResult,
2023
+ tokenDetails: () => tokenDetails,
2024
+ user: () => user,
2025
+ userDetail: () => userDetail,
2026
+ userDetailWithTeam: () => userDetailWithTeam,
2027
+ userResource: () => userResource,
2028
+ workflow: () => workflow,
2029
+ workflowDetail: () => workflowDetail,
2030
+ workflows: () => workflows
2031
+ });
2032
+ var attachment = {
2033
+ "id": "6a844d3965f82309911408ca",
2034
+ "title": {
2035
+ "text": "Ship v3"
2036
+ },
2037
+ "createdAt": "2026-08-18T12:16:57.347Z",
2038
+ "updatedAt": "2026-08-18T12:16:57.347Z",
2039
+ "user": {
2040
+ "id": "4214932441cb21eebdb396bfe34a8340",
2041
+ "name": "Grace Hopper",
2042
+ "userName": "grace",
2043
+ "avatar": "https://cdn.workast.io/avatar.png",
2044
+ "platformDetails": {
2045
+ "name": "slack",
2046
+ "imChannel": "D3EEXS3J6",
2047
+ "selfChannel": "D1HN843U3",
2048
+ "userId": "U0HBQESA1",
2049
+ "teamId": "T0HBUA0TC"
2050
+ }
2051
+ },
2052
+ "app": {
2053
+ "id": "5d9a6b09269e415d36380d23",
2054
+ "name": "Example App",
2055
+ "description": "Ship v3",
2056
+ "icon": "https://cdn.workast.io/avatar.png",
2057
+ "createdAt": "2019-10-06T22:30:33.687Z",
2058
+ "updatedAt": "2020-03-06T21:14:00.371Z",
2059
+ "clientId": "S4GuidJp6frYrxLTuQBM5JoTug",
2060
+ "accessType": "user",
2061
+ "developedByWorkast": true
2062
+ },
2063
+ "author": {
2064
+ "id": "4214932441cb21eebdb396bfe34a8340",
2065
+ "name": "Grace Hopper",
2066
+ "userName": "grace",
2067
+ "email": "grace@example.com",
2068
+ "platformDetails": {
2069
+ "name": "slack",
2070
+ "imChannel": "D3EEXS3J6",
2071
+ "selfChannel": "D1HN843U3",
2072
+ "userId": "U0HBQESA1",
2073
+ "teamId": "T0HBUA0TC"
2074
+ },
2075
+ "confirmed": true,
2076
+ "avatar": "https://cdn.workast.io/avatar.png",
2077
+ "costCenter": "5c1b92b0a57d2b342c1a610e"
2078
+ }
2079
+ };
2080
+ var attachmentFileUrl = {
2081
+ "id": "6a844fd765f8230991142151",
2082
+ "createdAt": "2026-08-18T12:28:07.685Z",
2083
+ "updatedAt": "2026-08-18T12:28:09.193Z",
2084
+ "user": {
2085
+ "id": "4214932441cb21eebdb396bfe34a8340",
2086
+ "virtualId": "c2xhY2svL1QwSEJVQTBUQzpVMEhCUUVTQTE=",
2087
+ "name": "Grace Hopper",
2088
+ "userName": "grace",
2089
+ "avatar": "https://cdn.workast.io/avatar.png",
2090
+ "platformDetails": {
2091
+ "name": "slack",
2092
+ "imChannel": "D3EEXS3J6",
2093
+ "selfChannel": "D1HN843U3",
2094
+ "userId": "U0HBQESA1",
2095
+ "teamId": "T0HBUA0TC"
2096
+ }
2097
+ },
2098
+ "file": {
2099
+ "name": "avatar.png",
2100
+ "type": "image/png",
2101
+ "size": 17101,
2102
+ "url": "/files/5dc40cff038a590f79c403c0/b9ca2e09-12e8-4c34-99dd-10dfaf345660",
2103
+ "thumbnails": {
2104
+ "250": "https://example.com/file",
2105
+ "500": "https://example.com/file"
2106
+ }
2107
+ },
2108
+ "link": "https://example.com/file",
2109
+ "fileUrl": "https://example.com/file"
2110
+ };
2111
+ var calendarEvents = {
2112
+ "events": [
2113
+ {
2114
+ "busy": true,
2115
+ "calendarId": "grace@example.com",
2116
+ "createdAt": 1781850701,
2117
+ "icalUid": "3b5ei15dmlrh6et2aqf7q07hbk@example.com",
2118
+ "id": "3b5ei15dmlrh6et2aqf7q07hbk",
2119
+ "organizer": {
2120
+ "email": "grace@example.com",
2121
+ "name": "Grace Hopper"
2122
+ },
2123
+ "participants": [],
2124
+ "readOnly": false,
2125
+ "status": "confirmed",
2126
+ "title": "Standup",
2127
+ "updatedAt": 1782098660,
2128
+ "visibility": "default",
2129
+ "when": {
2130
+ "endDate": "2026-07-18",
2131
+ "object": "datespan",
2132
+ "startDate": "2026-06-27"
2133
+ },
2134
+ "meeting": null
2135
+ }
2136
+ ]
2137
+ };
2138
+ var commentActivity = {
2139
+ "id": "686f7912fc2fef09733c6f58",
2140
+ "type": "comment",
2141
+ "value": "Standup",
2142
+ "status": "active",
2143
+ "createdAt": "2025-07-10T08:25:54.274Z",
2144
+ "updatedAt": "2025-07-10T08:25:54.274Z",
2145
+ "mentions": [
2146
+ {
2147
+ "id": "b2956627fe26a2c1e4b6d5202413f779",
2148
+ "name": "Ada Lovelace",
2149
+ "userName": "ada",
2150
+ "email": "ada@example.com",
2151
+ "platformDetails": {
2152
+ "name": "slack",
2153
+ "imChannel": "D3F5RQA6B",
2154
+ "selfChannel": "D1LGYBCFQ",
2155
+ "userId": "U0JU26WRG",
2156
+ "teamId": "T0HBUA0TC"
2157
+ },
2158
+ "confirmed": true,
2159
+ "avatar": "https://cdn.workast.io/avatar.png",
2160
+ "costCenter": "5c1b92b0a57d2b342c1a610e"
2161
+ }
2162
+ ],
2163
+ "reactions": [],
2164
+ "actor": {
2165
+ "type": "User",
2166
+ "data": {
2167
+ "id": "4214932441cb21eebdb396bfe34a8340",
2168
+ "name": "Grace Hopper",
2169
+ "userName": "grace",
2170
+ "email": "grace@example.com",
2171
+ "platformDetails": {
2172
+ "name": "slack",
2173
+ "imChannel": "D3EEXS3J6",
2174
+ "selfChannel": "D1HN843U3",
2175
+ "userId": "U0HBQESA1",
2176
+ "teamId": "T0HBUA0TC"
2177
+ },
2178
+ "confirmed": true,
2179
+ "avatar": "https://cdn.workast.io/avatar.png",
2180
+ "costCenter": "5c1b92b0a57d2b342c1a610e"
2181
+ }
2182
+ }
2183
+ };
2184
+ var customField = {
2185
+ "id": "61a50f7ed892d94d8c9d285e",
2186
+ "name": "Priority",
2187
+ "description": "Ship v3",
2188
+ "type": "options",
2189
+ "useAsTaskColor": false,
2190
+ "options": [
2191
+ {
2192
+ "id": "61a50f7ed892d94d8c9d285f",
2193
+ "name": "Low",
2194
+ "color": "#F2994A"
2195
+ },
2196
+ {
2197
+ "id": "63ec2019d467b10e1de14f02",
2198
+ "name": "Medium",
2199
+ "color": "#20e48b"
2200
+ },
2201
+ {
2202
+ "id": "63ec2019d467b10e1de14f03",
2203
+ "name": "Normal",
2204
+ "color": "#1156ff"
2205
+ },
2206
+ {
2207
+ "id": "63ec2019d467b10e1de14f04",
2208
+ "name": "High",
2209
+ "color": "#f50c0c"
2210
+ }
2211
+ ]
2212
+ };
2213
+ var homeTasks = {
2214
+ "tasks": [
2215
+ {
2216
+ "status": "pending",
2217
+ "text": "Ship v3",
2218
+ "shortId": "T4GNY",
2219
+ "createdAt": "2022-01-10T12:12:46.308Z",
2220
+ "updatedAt": "2025-07-10T08:25:54.460Z",
2221
+ "listPosition": 99999,
2222
+ "link": "https://open.workast.app/ca19601b6bb816ca95386698b3385d49/task/3634dc043f0d415ec2d307284a3cfe69",
2223
+ "calendars": [
2224
+ "b2956627fe26a2c1e4b6d5202413f779"
2225
+ ],
2226
+ "id": "3634dc043f0d415ec2d307284a3cfe69",
2227
+ "list": {
2228
+ "id": "603449f6f107b67c63e8cee9",
2229
+ "name": "Product",
2230
+ "type": "group",
2231
+ "privacy": "private",
2232
+ "subLists": [
2233
+ {
2234
+ "id": "603449f6f107b67c63e8cee8",
2235
+ "name": "To-do",
2236
+ "listPosition": 1e5,
2237
+ "createdBy": "4214932441cb21eebdb396bfe34a8340"
2238
+ },
2239
+ {
2240
+ "id": "610ffd8c7374d6331a4178d8",
2241
+ "name": "In Progress",
2242
+ "listPosition": 7e5,
2243
+ "createdBy": "4214932441cb21eebdb396bfe34a8340"
2244
+ }
2245
+ ],
2246
+ "link": "https://app.workast.com/list/603449f6f107b67c63e8cee9"
2247
+ },
2248
+ "listId": "603449f6f107b67c63e8cee9",
2249
+ "subListId": "610ffd8c7374d6331a4178d8",
2250
+ "subList": {
2251
+ "id": "610ffd8c7374d6331a4178d8",
2252
+ "name": "To-do"
2253
+ },
2254
+ "assignedTo": [
2255
+ {
2256
+ "id": "b2956627fe26a2c1e4b6d5202413f779",
2257
+ "name": "Ada Lovelace",
2258
+ "userName": "ada",
2259
+ "email": "ada@example.com",
2260
+ "platformDetails": {
2261
+ "name": "slack",
2262
+ "imChannel": "D3F5RQA6B",
2263
+ "selfChannel": "D1LGYBCFQ",
2264
+ "userId": "U0JU26WRG",
2265
+ "teamId": "T0HBUA0TC"
2266
+ },
2267
+ "confirmed": true,
2268
+ "avatar": "https://cdn.workast.io/avatar.png",
2269
+ "costCenter": "5c1b92b0a57d2b342c1a610e"
2270
+ }
2271
+ ],
2272
+ "subscribers": [
2273
+ {
2274
+ "id": "b2956627fe26a2c1e4b6d5202413f779",
2275
+ "name": "Ada Lovelace",
2276
+ "userName": "ada",
2277
+ "email": "ada@example.com",
2278
+ "platformDetails": {
2279
+ "name": "slack",
2280
+ "imChannel": "D3F5RQA6B",
2281
+ "selfChannel": "D1LGYBCFQ",
2282
+ "userId": "U0JU26WRG",
2283
+ "teamId": "T0HBUA0TC"
2284
+ },
2285
+ "confirmed": true,
2286
+ "avatar": "https://cdn.workast.io/avatar.png",
2287
+ "costCenter": "5c1b92b0a57d2b342c1a610e"
2288
+ },
2289
+ {
2290
+ "id": "4214932441cb21eebdb396bfe34a8340",
2291
+ "name": "Grace Hopper",
2292
+ "userName": "grace",
2293
+ "email": "grace@example.com",
2294
+ "platformDetails": {
2295
+ "name": "slack",
2296
+ "imChannel": "D3EEXS3J6",
2297
+ "selfChannel": "D1HN843U3",
2298
+ "userId": "U0HBQESA1",
2299
+ "teamId": "T0HBUA0TC"
2300
+ },
2301
+ "confirmed": true,
2302
+ "avatar": "https://cdn.workast.io/avatar.png",
2303
+ "costCenter": "5c1b92b0a57d2b342c1a610e"
2304
+ }
2305
+ ],
2306
+ "allDay": false,
2307
+ "createdBy": {
2308
+ "id": "b2956627fe26a2c1e4b6d5202413f779",
2309
+ "name": "Ada Lovelace",
2310
+ "userName": "ada",
2311
+ "email": "ada@example.com",
2312
+ "platformDetails": {
2313
+ "name": "slack",
2314
+ "imChannel": "D3F5RQA6B",
2315
+ "selfChannel": "D1LGYBCFQ",
2316
+ "userId": "U0JU26WRG",
2317
+ "teamId": "T0HBUA0TC"
2318
+ },
2319
+ "confirmed": true,
2320
+ "avatar": "https://cdn.workast.io/avatar.png",
2321
+ "costCenter": "5c1b92b0a57d2b342c1a610e"
2322
+ },
2323
+ "hasDescription": true,
2324
+ "numberOfComments": 1,
2325
+ "numberOfAttachments": 0,
2326
+ "totalSubTasks": 1,
2327
+ "completedSubTasks": 0,
2328
+ "isSubscribed": true,
2329
+ "lastComment": {
2330
+ "id": "686f7912fc2fef09733c6f58",
2331
+ "type": "comment",
2332
+ "value": "Standup",
2333
+ "status": "active",
2334
+ "createdAt": "2025-07-10T08:25:54.274Z",
2335
+ "updatedAt": "2025-07-10T08:25:54.274Z",
2336
+ "mentions": [
2337
+ {
2338
+ "id": "b2956627fe26a2c1e4b6d5202413f779",
2339
+ "name": "Ada Lovelace",
2340
+ "userName": "ada",
2341
+ "email": "ada@example.com",
2342
+ "platformDetails": {
2343
+ "name": "slack",
2344
+ "imChannel": "D3F5RQA6B",
2345
+ "selfChannel": "D1LGYBCFQ",
2346
+ "userId": "U0JU26WRG",
2347
+ "teamId": "T0HBUA0TC"
2348
+ },
2349
+ "confirmed": true,
2350
+ "avatar": "https://cdn.workast.io/avatar.png",
2351
+ "costCenter": "5c1b92b0a57d2b342c1a610e"
2352
+ }
2353
+ ],
2354
+ "reactions": [],
2355
+ "actor": {
2356
+ "type": "User",
2357
+ "data": {
2358
+ "id": "4214932441cb21eebdb396bfe34a8340",
2359
+ "name": "Grace Hopper",
2360
+ "userName": "grace",
2361
+ "email": "grace@example.com",
2362
+ "platformDetails": {
2363
+ "name": "slack",
2364
+ "imChannel": "D3EEXS3J6",
2365
+ "selfChannel": "D1HN843U3",
2366
+ "userId": "U0HBQESA1",
2367
+ "teamId": "T0HBUA0TC"
2368
+ },
2369
+ "confirmed": true,
2370
+ "avatar": "https://cdn.workast.io/avatar.png",
2371
+ "costCenter": "5c1b92b0a57d2b342c1a610e"
2372
+ }
2373
+ }
2374
+ },
2375
+ "taskStatus": {
2376
+ "id": "5c7184fa40721e2ed4175a6e",
2377
+ "label": "Open",
2378
+ "color": "#808080",
2379
+ "createdAt": "2019-02-23T17:38:02.928Z",
2380
+ "updatedAt": "2019-02-23T17:38:02.928Z"
2381
+ },
2382
+ "milestones": [],
2383
+ "inHome": true,
2384
+ "fields": []
2385
+ }
2386
+ ],
2387
+ "total": 1
2388
+ };
2389
+ var list = {
2390
+ "id": "5a6ebde81519395731f90e2f",
2391
+ "hash": "26873fa18b3a3c5bfd82f9d8e2dafa05",
2392
+ "avatar": "https://cdn.workast.io/list-avatar.png",
2393
+ "name": "Engineering",
2394
+ "numberOfParticipants": 2,
2395
+ "type": "group",
2396
+ "privacy": "private",
2397
+ "platformDetails": {
2398
+ "name": "slack",
2399
+ "channelId": "G8TRB56E8",
2400
+ "channelName": "engineering",
2401
+ "type": "group",
2402
+ "teamId": "T0HBUA0TC"
2403
+ },
2404
+ "isArchived": false,
2405
+ "createdBy": "b2956627fe26a2c1e4b6d5202413f779",
2406
+ "participants": [
2407
+ "4214932441cb21eebdb396bfe34a8340",
2408
+ "c51a9c1a2ddfbcefa7abf74036e0c616",
2409
+ "b2956627fe26a2c1e4b6d5202413f779"
2410
+ ],
2411
+ "platformNotifications": {
2412
+ "taskCreated": true,
2413
+ "taskCompleted": true
2414
+ },
2415
+ "apps": [
2416
+ {
2417
+ "id": "5af007dff36d2837eae6e56c",
2418
+ "name": "Slack",
2419
+ "description": "Ship v3",
2420
+ "icon": "https://cdn.workast.io/integrations/Slack/icon.png",
2421
+ "updatedAt": "2023-11-15T03:23:37.468Z",
2422
+ "clientId": "nUsktT5eDzpbJE15WLfMejf9oJ",
2423
+ "accessType": "user",
2424
+ "developedByWorkast": true,
2425
+ "integration": {
2426
+ "spaceActions": [
2427
+ {
2428
+ "actionId": "SHOW_SETTINGS",
2429
+ "label": "Slack"
2430
+ }
2431
+ ],
2432
+ "taskActions": []
2433
+ }
2434
+ },
2435
+ {
2436
+ "id": "5b23da45e7179a589282a60c",
2437
+ "name": "Email",
2438
+ "description": "Ship v3",
2439
+ "icon": "https://cdn.workast.io/integrations/Email/icon.png",
2440
+ "updatedAt": "2020-03-06T21:14:00.371Z",
2441
+ "clientId": "Jr5LKksQ9PZhr89R3l93aaaaab",
2442
+ "accessType": "user",
2443
+ "developedByWorkast": true,
2444
+ "integration": {
2445
+ "spaceActions": [
2446
+ {
2447
+ "actionId": "SHOW_SETTINGS",
2448
+ "label": "Email"
2449
+ }
2450
+ ],
2451
+ "taskActions": []
2452
+ }
2453
+ }
2454
+ ],
2455
+ "defaultSubList": "5a6ebde81519395731f90e30",
2456
+ "subLists": [
2457
+ {
2458
+ "id": "5a6ebde81519395731f90e30",
2459
+ "name": "To-do",
2460
+ "listPosition": 1e5,
2461
+ "createdBy": "b2956627fe26a2c1e4b6d5202413f779"
2462
+ }
2463
+ ],
2464
+ "link": "https://app.workast.com/list/5a6ebde81519395731f90e2f",
2465
+ "isParticipant": true,
2466
+ "someParticipants": [
2467
+ {
2468
+ "id": "4214932441cb21eebdb396bfe34a8340",
2469
+ "name": "Grace Hopper",
2470
+ "userName": "grace",
2471
+ "email": "grace@example.com",
2472
+ "platformDetails": {
2473
+ "name": "slack",
2474
+ "imChannel": "D3EEXS3J6",
2475
+ "selfChannel": "D1HN843U3",
2476
+ "userId": "U0HBQESA1",
2477
+ "teamId": "T0HBUA0TC"
2478
+ },
2479
+ "confirmed": true,
2480
+ "avatar": "https://cdn.workast.io/avatar.png",
2481
+ "costCenter": "5c1b92b0a57d2b342c1a610e"
2482
+ },
2483
+ {
2484
+ "id": "b2956627fe26a2c1e4b6d5202413f779",
2485
+ "name": "Ada Lovelace",
2486
+ "userName": "ada",
2487
+ "email": "ada@example.com",
2488
+ "platformDetails": {
2489
+ "name": "slack",
2490
+ "imChannel": "D3F5RQA6B",
2491
+ "selfChannel": "D1LGYBCFQ",
2492
+ "userId": "U0JU26WRG",
2493
+ "teamId": "T0HBUA0TC"
2494
+ },
2495
+ "confirmed": true,
2496
+ "avatar": "https://cdn.workast.io/avatar.png",
2497
+ "costCenter": "5c1b92b0a57d2b342c1a610e"
2498
+ }
2499
+ ],
2500
+ "columns": [
2501
+ "assignedTo",
2502
+ "dueDate",
2503
+ "doneBy",
2504
+ "doneAt"
2505
+ ],
2506
+ "groupBy": "subList",
2507
+ "isBookmarked": false
2508
+ };
2509
+ var listEnumerate = {
2510
+ "id": "5a6ebde81519395731f90e2f",
2511
+ "hash": "26873fa18b3a3c5bfd82f9d8e2dafa05",
2512
+ "name": "Engineering",
2513
+ "createdAt": "2018-01-29T06:23:36.194Z",
2514
+ "createdBy": {
2515
+ "id": "b2956627fe26a2c1e4b6d5202413f779",
2516
+ "name": "Ada Lovelace",
2517
+ "userName": "ada",
2518
+ "email": "ada@example.com",
2519
+ "platformDetails": {
2520
+ "name": "slack",
2521
+ "imChannel": "D3F5RQA6B",
2522
+ "selfChannel": "D1LGYBCFQ",
2523
+ "userId": "U0JU26WRG",
2524
+ "teamId": "T0HBUA0TC"
2525
+ },
2526
+ "confirmed": true,
2527
+ "avatar": "https://cdn.workast.io/avatar.png",
2528
+ "costCenter": "5c1b92b0a57d2b342c1a610e"
2529
+ },
2530
+ "avatar": "https://cdn.workast.io/list-avatar.png",
2531
+ "numberOfParticipants": 3,
2532
+ "type": "group",
2533
+ "privacy": "private",
2534
+ "isArchived": false,
2535
+ "platformDetails": {
2536
+ "name": "slack",
2537
+ "channelId": "G8TRB56E8",
2538
+ "channelName": "engineering",
2539
+ "type": "group",
2540
+ "teamId": "T0HBUA0TC"
2541
+ },
2542
+ "platformNotifications": {
2543
+ "taskCreated": true,
2544
+ "taskCompleted": true
2545
+ },
2546
+ "subLists": [
2547
+ {
2548
+ "id": "5a6ebde81519395731f90e30",
2549
+ "name": "To-do",
2550
+ "listPosition": 1e5,
2551
+ "createdBy": "b2956627fe26a2c1e4b6d5202413f779"
2552
+ }
2553
+ ],
2554
+ "defaultSubList": "5a6ebde81519395731f90e30",
2555
+ "isParticipant": true,
2556
+ "link": "https://app.workast.com/list/5a6ebde81519395731f90e2f"
2557
+ };
2558
+ var meeting = {
2559
+ "id": "6a844c4c6bc4270979c79d34",
2560
+ "createdAt": "2026-08-18T12:13:00.327Z",
2561
+ "updatedAt": "2026-08-18T12:13:00.327Z",
2562
+ "summary": "Standup",
2563
+ "status": "active",
2564
+ "eventId": "2bi7qgtg2k615gsm4fom4oa2l8",
2565
+ "isRecurrent": false,
2566
+ "organizer": {
2567
+ "id": "4214932441cb21eebdb396bfe34a8340",
2568
+ "name": "Grace Hopper",
2569
+ "userName": "grace",
2570
+ "email": "grace@example.com",
2571
+ "platformDetails": {
2572
+ "name": "slack",
2573
+ "imChannel": "D3EEXS3J6",
2574
+ "selfChannel": "D1HN843U3",
2575
+ "userId": "U0HBQESA1",
2576
+ "teamId": "T0HBUA0TC"
2577
+ },
2578
+ "confirmed": true,
2579
+ "avatar": "https://cdn.workast.io/avatar.png",
2580
+ "costCenter": "5c1b92b0a57d2b342c1a610e"
2581
+ },
2582
+ "totalAttendees": 1,
2583
+ "someAttendees": [],
2584
+ "list": {
2585
+ "id": "5a6ebde81519395731f90e2f",
2586
+ "name": "Engineering",
2587
+ "type": "group",
2588
+ "status": "active",
2589
+ "privacy": "private",
2590
+ "link": "https://app.workast.com/list/5a6ebde81519395731f90e2f"
2591
+ },
2592
+ "link": "https://open.workast.app/ca19601b6bb816ca95386698b3385d49/meeting/6a844c4c6bc4270979c79d34",
2593
+ "notetaker": {
2594
+ "enabled": false
2595
+ },
2596
+ "start": "2026-09-01T15:00:00.000Z",
2597
+ "end": "2026-09-01T15:30:00.000Z",
2598
+ "allDay": false
2599
+ };
2600
+ var meetingDetail = {
2601
+ "id": "6a6840c6cc9ea3097a801627",
2602
+ "createdAt": "2026-07-28T05:40:22.966Z",
2603
+ "updatedAt": "2026-08-11T01:56:10.130Z",
2604
+ "summary": "Standup",
2605
+ "status": "active",
2606
+ "eventId": "gobiji6ddnsgaausdrhftf2cb2_20260728T223000Z",
2607
+ "isRecurrent": true,
2608
+ "organizer": {
2609
+ "id": "4214932441cb21eebdb396bfe34a8340",
2610
+ "name": "Grace Hopper",
2611
+ "userName": "grace",
2612
+ "email": "grace@example.com",
2613
+ "platformDetails": {
2614
+ "name": "slack",
2615
+ "imChannel": "D3EEXS3J6",
2616
+ "selfChannel": "D1HN843U3",
2617
+ "userId": "U0HBQESA1",
2618
+ "teamId": "T0HBUA0TC"
2619
+ },
2620
+ "confirmed": true,
2621
+ "avatar": "https://cdn.workast.io/avatar.png",
2622
+ "costCenter": "5c1b92b0a57d2b342c1a610e"
2623
+ },
2624
+ "totalAttendees": 2,
2625
+ "someAttendees": [
2626
+ {
2627
+ "id": "4214932441cb21eebdb396bfe34a8340",
2628
+ "name": "Grace Hopper",
2629
+ "userName": "grace",
2630
+ "email": "grace@example.com",
2631
+ "platformDetails": {
2632
+ "name": "slack",
2633
+ "imChannel": "D3EEXS3J6",
2634
+ "selfChannel": "D1HN843U3",
2635
+ "userId": "U0HBQESA1",
2636
+ "teamId": "T0HBUA0TC"
2637
+ },
2638
+ "confirmed": true,
2639
+ "avatar": "https://cdn.workast.io/avatar.png",
2640
+ "costCenter": "5c1b92b0a57d2b342c1a610e"
2641
+ }
2642
+ ],
2643
+ "list": {
2644
+ "id": "5fc58f3d15ff9110b64ca426",
2645
+ "type": "group",
2646
+ "status": "active",
2647
+ "privacy": "team",
2648
+ "link": "https://app.workast.com/list/5fc58f3d15ff9110b64ca426",
2649
+ "name": "Product"
2650
+ },
2651
+ "link": "https://app.workast.com/meeting/6a6840c6cc9ea3097a801627",
2652
+ "conferenceData": {
2653
+ "joinUrl": "https://example.com/file",
2654
+ "provider": "Google Meet"
2655
+ },
2656
+ "notetaker": {
2657
+ "enabled": false
2658
+ },
2659
+ "start": "2026-07-31T00:30:00.000Z",
2660
+ "end": "2026-07-31T02:00:00.000Z",
2661
+ "allDay": false,
2662
+ "totalTasks": 0,
2663
+ "completedTasks": 0
2664
+ };
2665
+ var meetingRecordingResource = {
2666
+ "transcript": {
2667
+ "object": "transcript",
2668
+ "type": "speaker_labelled",
2669
+ "language": "es",
2670
+ "transcript": [
2671
+ {
2672
+ "speaker": "Speaker A",
2673
+ "start": 37850,
2674
+ "end": 116040,
2675
+ "text": "Standup"
2676
+ }
2677
+ ]
2678
+ }
2679
+ };
2680
+ var meetings = {
2681
+ "meetings": [
2682
+ {
2683
+ "id": "6a6840c6cc9ea3097a801627",
2684
+ "summary": "Standup",
2685
+ "eventId": "gobiji6ddnsgaausdrhftf2cb2_20260728T223000Z",
2686
+ "isRecurrent": true,
2687
+ "organizer": {
2688
+ "id": "4214932441cb21eebdb396bfe34a8340",
2689
+ "name": "Grace Hopper",
2690
+ "userName": "grace",
2691
+ "email": "grace@example.com",
2692
+ "platformDetails": {
2693
+ "name": "slack",
2694
+ "imChannel": "D3EEXS3J6",
2695
+ "selfChannel": "D1HN843U3",
2696
+ "userId": "U0HBQESA1",
2697
+ "teamId": "T0HBUA0TC"
2698
+ },
2699
+ "confirmed": true,
2700
+ "avatar": "https://cdn.workast.io/avatar.png",
2701
+ "costCenter": "5c1b92b0a57d2b342c1a610e"
2702
+ },
2703
+ "totalAttendees": 2,
2704
+ "someAttendees": [
2705
+ {
2706
+ "id": "4214932441cb21eebdb396bfe34a8340",
2707
+ "name": "Grace Hopper",
2708
+ "userName": "grace",
2709
+ "email": "grace@example.com",
2710
+ "platformDetails": {
2711
+ "name": "slack",
2712
+ "imChannel": "D3EEXS3J6",
2713
+ "selfChannel": "D1HN843U3",
2714
+ "userId": "U0HBQESA1",
2715
+ "teamId": "T0HBUA0TC"
2716
+ },
2717
+ "confirmed": true,
2718
+ "avatar": "https://cdn.workast.io/avatar.png",
2719
+ "costCenter": "5c1b92b0a57d2b342c1a610e"
2720
+ },
2721
+ {
2722
+ "id": "67c6206fc7cb0feb115113cdf71aa72d",
2723
+ "name": "Katherine Johnson",
2724
+ "userName": "katherine",
2725
+ "email": "katherine@example.com",
2726
+ "platformDetails": {
2727
+ "name": "slack",
2728
+ "imChannel": "D06JN8RT8KB",
2729
+ "selfChannel": "D06HV290V6K",
2730
+ "userId": "U06J9JSF6R0",
2731
+ "teamId": "T0HBUA0TC"
2732
+ },
2733
+ "confirmed": false,
2734
+ "avatar": "https://cdn.workast.io/avatar.png",
2735
+ "costCenter": "5c1b92b0a57d2b342c1a610e"
2736
+ }
2737
+ ],
2738
+ "link": "https://app.workast.com/meeting/6a6840c6cc9ea3097a801627",
2739
+ "start": "2026-07-31T00:30:00.000Z",
2740
+ "end": "2026-07-31T02:00:00.000Z",
2741
+ "allDay": false,
2742
+ "totalTasks": 0,
2743
+ "completedTasks": 0
2744
+ }
2745
+ ],
2746
+ "nextPageToken": "eyJzdGFydCI6IjIwMjYtMDctMzFUMDA6MzA6MDAuMDAwWiIsImlkIjoiNmE2ODQwYzZjYzllYTMwOTdhODAxNjI3In0"
2747
+ };
2748
+ var note = {
2749
+ "id": "6994a3e051b10d097caddd0f",
2750
+ "title": "Ship v3",
2751
+ "createdAt": "2026-02-17T17:22:40.359Z",
2752
+ "updatedAt": "2026-02-23T22:00:53.158Z",
2753
+ "version": 58,
2754
+ "list": {
2755
+ "id": "6938534c1679f90979e5ccf4",
2756
+ "avatar": "https://cdn.workast.io/list-avatar.png",
2757
+ "name": "Engineering",
2758
+ "numberOfParticipants": 2,
2759
+ "type": "group",
2760
+ "slug": "engineering",
2761
+ "privacy": "team",
2762
+ "platformDetails": {
2763
+ "type": "group"
2764
+ },
2765
+ "isArchived": false,
2766
+ "createdBy": "67c6206fc7cb0feb115113cdf71aa72d",
2767
+ "participants": [
2768
+ "67c6206fc7cb0feb115113cdf71aa72d",
2769
+ "4214932441cb21eebdb396bfe34a8340"
2770
+ ],
2771
+ "platformNotifications": {
2772
+ "taskCreated": true,
2773
+ "taskCompleted": true
2774
+ },
2775
+ "apps": [
2776
+ {
2777
+ "id": "5b23da45e7179a589282a60c",
2778
+ "name": "Email",
2779
+ "description": "Ship v3",
2780
+ "icon": "https://cdn.workast.io/integrations/Email/icon.png",
2781
+ "updatedAt": "2020-03-06T21:14:00.371Z",
2782
+ "clientId": "Jr5LKksQ9PZhr89R3l93aaaaab",
2783
+ "accessType": "user",
2784
+ "developedByWorkast": true,
2785
+ "integration": {
2786
+ "spaceActions": [
2787
+ {
2788
+ "actionId": "SHOW_SETTINGS",
2789
+ "label": "Email"
2790
+ }
2791
+ ],
2792
+ "taskActions": []
2793
+ }
2794
+ },
2795
+ {
2796
+ "name": "Example App",
2797
+ "description": "Ship v3",
2798
+ "icon": "https://cdn.workast.io/avatar.png",
2799
+ "createdAt": "2019-10-06T22:30:33.687Z",
2800
+ "updatedAt": "2020-03-06T21:14:00.371Z",
2801
+ "clientId": "S4GuidJp6frYrxLTuQBM5JoTug",
2802
+ "accessType": "user",
2803
+ "developedByWorkast": true,
2804
+ "id": "5d83a3de767119000151da7a"
2805
+ }
2806
+ ],
2807
+ "defaultSubList": "6938534c1679f90979e5ccf3",
2808
+ "subLists": [
2809
+ {
2810
+ "id": "6938534c1679f90979e5ccf3",
2811
+ "name": "To-do",
2812
+ "listPosition": 1e5,
2813
+ "createdBy": "67c6206fc7cb0feb115113cdf71aa72d"
2814
+ },
2815
+ {
2816
+ "id": "693853701679f90979e5d186",
2817
+ "name": "In Progress",
2818
+ "listPosition": 2e5,
2819
+ "createdBy": "67c6206fc7cb0feb115113cdf71aa72d"
2820
+ }
2821
+ ],
2822
+ "link": "https://app.workast.com/list/6938534c1679f90979e5ccf4",
2823
+ "isParticipant": true,
2824
+ "someParticipants": [
2825
+ {
2826
+ "id": "67c6206fc7cb0feb115113cdf71aa72d",
2827
+ "name": "Katherine Johnson",
2828
+ "userName": "katherine",
2829
+ "email": "katherine@example.com",
2830
+ "platformDetails": {
2831
+ "name": "slack",
2832
+ "imChannel": "D06JN8RT8KB",
2833
+ "selfChannel": "D06HV290V6K",
2834
+ "userId": "U06J9JSF6R0",
2835
+ "teamId": "T0HBUA0TC"
2836
+ },
2837
+ "confirmed": false,
2838
+ "avatar": "https://cdn.workast.io/avatar.png",
2839
+ "costCenter": "5c1b92b0a57d2b342c1a610e"
2840
+ }
2841
+ ],
2842
+ "columns": [
2843
+ "assignedTo",
2844
+ "dueDate",
2845
+ "doneBy",
2846
+ "doneAt"
2847
+ ],
2848
+ "groupBy": "subList"
2849
+ },
2850
+ "createdBy": {
2851
+ "id": "67c6206fc7cb0feb115113cdf71aa72d",
2852
+ "name": "Katherine Johnson",
2853
+ "userName": "katherine",
2854
+ "email": "katherine@example.com",
2855
+ "platformDetails": {
2856
+ "name": "slack",
2857
+ "imChannel": "D06JN8RT8KB",
2858
+ "selfChannel": "D06HV290V6K",
2859
+ "userId": "U06J9JSF6R0",
2860
+ "teamId": "T0HBUA0TC"
2861
+ },
2862
+ "confirmed": false,
2863
+ "avatar": "https://cdn.workast.io/avatar.png",
2864
+ "costCenter": "5c1b92b0a57d2b342c1a610e"
2865
+ }
2866
+ };
2867
+ var noteDetail = {
2868
+ "id": "6994a3e051b10d097caddd0f",
2869
+ "title": "Ship v3",
2870
+ "createdAt": "2026-02-17T17:22:40.359Z",
2871
+ "updatedAt": "2026-02-23T22:00:53.158Z",
2872
+ "version": 58,
2873
+ "list": {
2874
+ "id": "6938534c1679f90979e5ccf4",
2875
+ "avatar": "https://cdn.workast.io/list-avatar.png",
2876
+ "name": "Engineering",
2877
+ "numberOfParticipants": 2,
2878
+ "type": "group",
2879
+ "slug": "engineering",
2880
+ "privacy": "team",
2881
+ "platformDetails": {
2882
+ "type": "group"
2883
+ },
2884
+ "isArchived": false,
2885
+ "createdBy": "67c6206fc7cb0feb115113cdf71aa72d",
2886
+ "participants": [
2887
+ "67c6206fc7cb0feb115113cdf71aa72d",
2888
+ "4214932441cb21eebdb396bfe34a8340"
2889
+ ],
2890
+ "platformNotifications": {
2891
+ "taskCreated": true,
2892
+ "taskCompleted": true
2893
+ },
2894
+ "apps": [
2895
+ {
2896
+ "id": "5b23da45e7179a589282a60c",
2897
+ "name": "Email",
2898
+ "description": "Ship v3",
2899
+ "icon": "https://cdn.workast.io/integrations/Email/icon.png",
2900
+ "updatedAt": "2020-03-06T21:14:00.371Z",
2901
+ "clientId": "Jr5LKksQ9PZhr89R3l93aaaaab",
2902
+ "accessType": "user",
2903
+ "developedByWorkast": true,
2904
+ "integration": {
2905
+ "spaceActions": [
2906
+ {
2907
+ "actionId": "SHOW_SETTINGS",
2908
+ "label": "Email"
2909
+ }
2910
+ ],
2911
+ "taskActions": []
2912
+ }
2913
+ },
2914
+ {
2915
+ "name": "Example App",
2916
+ "description": "Ship v3",
2917
+ "icon": "https://cdn.workast.io/avatar.png",
2918
+ "createdAt": "2019-10-06T22:30:33.687Z",
2919
+ "updatedAt": "2020-03-06T21:14:00.371Z",
2920
+ "clientId": "S4GuidJp6frYrxLTuQBM5JoTug",
2921
+ "accessType": "user",
2922
+ "developedByWorkast": true,
2923
+ "id": "5d83a3de767119000151da7a"
2924
+ }
2925
+ ],
2926
+ "defaultSubList": "6938534c1679f90979e5ccf3",
2927
+ "subLists": [
2928
+ {
2929
+ "id": "6938534c1679f90979e5ccf3",
2930
+ "name": "To-do",
2931
+ "listPosition": 1e5,
2932
+ "createdBy": "67c6206fc7cb0feb115113cdf71aa72d"
2933
+ },
2934
+ {
2935
+ "id": "693853701679f90979e5d186",
2936
+ "name": "In Progress",
2937
+ "listPosition": 2e5,
2938
+ "createdBy": "67c6206fc7cb0feb115113cdf71aa72d"
2939
+ }
2940
+ ],
2941
+ "link": "https://app.workast.com/list/6938534c1679f90979e5ccf4",
2942
+ "isParticipant": true,
2943
+ "someParticipants": [
2944
+ {
2945
+ "id": "67c6206fc7cb0feb115113cdf71aa72d",
2946
+ "name": "Katherine Johnson",
2947
+ "userName": "katherine",
2948
+ "email": "katherine@example.com",
2949
+ "platformDetails": {
2950
+ "name": "slack",
2951
+ "imChannel": "D06JN8RT8KB",
2952
+ "selfChannel": "D06HV290V6K",
2953
+ "userId": "U06J9JSF6R0",
2954
+ "teamId": "T0HBUA0TC"
2955
+ },
2956
+ "confirmed": false,
2957
+ "avatar": "https://cdn.workast.io/avatar.png",
2958
+ "costCenter": "5c1b92b0a57d2b342c1a610e"
2959
+ }
2960
+ ],
2961
+ "columns": [
2962
+ "assignedTo",
2963
+ "dueDate",
2964
+ "doneBy",
2965
+ "doneAt"
2966
+ ],
2967
+ "groupBy": "subList"
2968
+ },
2969
+ "createdBy": {
2970
+ "id": "67c6206fc7cb0feb115113cdf71aa72d",
2971
+ "name": "Katherine Johnson",
2972
+ "userName": "katherine",
2973
+ "email": "katherine@example.com",
2974
+ "platformDetails": {
2975
+ "name": "slack",
2976
+ "imChannel": "D06JN8RT8KB",
2977
+ "selfChannel": "D06HV290V6K",
2978
+ "userId": "U06J9JSF6R0",
2979
+ "teamId": "T0HBUA0TC"
2980
+ },
2981
+ "confirmed": false,
2982
+ "avatar": "https://cdn.workast.io/avatar.png",
2983
+ "costCenter": "5c1b92b0a57d2b342c1a610e"
2984
+ },
2985
+ "body": "<p>Ship v3</p>"
2986
+ };
2987
+ var notes = {
2988
+ "notes": [
2989
+ {
2990
+ "id": "6994a3e051b10d097caddd0f",
2991
+ "title": "Ship v3",
2992
+ "createdAt": "2026-02-17T17:22:40.359Z",
2993
+ "updatedAt": "2026-02-23T22:00:53.158Z",
2994
+ "version": 58,
2995
+ "list": {
2996
+ "id": "6938534c1679f90979e5ccf4",
2997
+ "avatar": "https://cdn.workast.io/list-avatar.png",
2998
+ "name": "Engineering",
2999
+ "numberOfParticipants": 2,
3000
+ "type": "group",
3001
+ "slug": "engineering",
3002
+ "privacy": "team",
3003
+ "platformDetails": {
3004
+ "type": "group"
3005
+ },
3006
+ "isArchived": false,
3007
+ "createdBy": "67c6206fc7cb0feb115113cdf71aa72d",
3008
+ "participants": [
3009
+ "67c6206fc7cb0feb115113cdf71aa72d",
3010
+ "4214932441cb21eebdb396bfe34a8340"
3011
+ ],
3012
+ "platformNotifications": {
3013
+ "taskCreated": true,
3014
+ "taskCompleted": true
3015
+ },
3016
+ "apps": [
3017
+ {
3018
+ "id": "5b23da45e7179a589282a60c",
3019
+ "name": "Email",
3020
+ "description": "Ship v3",
3021
+ "icon": "https://cdn.workast.io/integrations/Email/icon.png",
3022
+ "updatedAt": "2020-03-06T21:14:00.371Z",
3023
+ "clientId": "Jr5LKksQ9PZhr89R3l93aaaaab",
3024
+ "accessType": "user",
3025
+ "developedByWorkast": true,
3026
+ "integration": {
3027
+ "spaceActions": [
3028
+ {
3029
+ "actionId": "SHOW_SETTINGS",
3030
+ "label": "Email"
3031
+ }
3032
+ ],
3033
+ "taskActions": []
3034
+ }
3035
+ },
3036
+ {
3037
+ "name": "Example App",
3038
+ "description": "Ship v3",
3039
+ "icon": "https://cdn.workast.io/avatar.png",
3040
+ "createdAt": "2019-10-06T22:30:33.687Z",
3041
+ "updatedAt": "2020-03-06T21:14:00.371Z",
3042
+ "clientId": "S4GuidJp6frYrxLTuQBM5JoTug",
3043
+ "accessType": "user",
3044
+ "developedByWorkast": true,
3045
+ "id": "5d83a3de767119000151da7a"
3046
+ }
3047
+ ],
3048
+ "defaultSubList": "6938534c1679f90979e5ccf3",
3049
+ "subLists": [
3050
+ {
3051
+ "id": "6938534c1679f90979e5ccf3",
3052
+ "name": "To-do",
3053
+ "listPosition": 1e5,
3054
+ "createdBy": "67c6206fc7cb0feb115113cdf71aa72d"
3055
+ },
3056
+ {
3057
+ "id": "693853701679f90979e5d186",
3058
+ "name": "In Progress",
3059
+ "listPosition": 2e5,
3060
+ "createdBy": "67c6206fc7cb0feb115113cdf71aa72d"
3061
+ }
3062
+ ],
3063
+ "link": "https://app.workast.com/list/6938534c1679f90979e5ccf4",
3064
+ "isParticipant": true,
3065
+ "someParticipants": [
3066
+ {
3067
+ "id": "67c6206fc7cb0feb115113cdf71aa72d",
3068
+ "name": "Katherine Johnson",
3069
+ "userName": "katherine",
3070
+ "email": "katherine@example.com",
3071
+ "platformDetails": {
3072
+ "name": "slack",
3073
+ "imChannel": "D06JN8RT8KB",
3074
+ "selfChannel": "D06HV290V6K",
3075
+ "userId": "U06J9JSF6R0",
3076
+ "teamId": "T0HBUA0TC"
3077
+ },
3078
+ "confirmed": false,
3079
+ "avatar": "https://cdn.workast.io/avatar.png",
3080
+ "costCenter": "5c1b92b0a57d2b342c1a610e"
3081
+ }
3082
+ ],
3083
+ "columns": [
3084
+ "assignedTo",
3085
+ "dueDate",
3086
+ "doneBy",
3087
+ "doneAt"
3088
+ ],
3089
+ "groupBy": "subList"
3090
+ },
3091
+ "createdBy": {
3092
+ "id": "67c6206fc7cb0feb115113cdf71aa72d",
3093
+ "name": "Katherine Johnson",
3094
+ "userName": "katherine",
3095
+ "email": "katherine@example.com",
3096
+ "platformDetails": {
3097
+ "name": "slack",
3098
+ "imChannel": "D06JN8RT8KB",
3099
+ "selfChannel": "D06HV290V6K",
3100
+ "userId": "U06J9JSF6R0",
3101
+ "teamId": "T0HBUA0TC"
3102
+ },
3103
+ "confirmed": false,
3104
+ "avatar": "https://cdn.workast.io/avatar.png",
3105
+ "costCenter": "5c1b92b0a57d2b342c1a610e"
3106
+ }
3107
+ }
3108
+ ],
3109
+ "total": 168
3110
+ };
3111
+ var notifications = {
3112
+ "notifications": [
3113
+ {
3114
+ "id": "6a7ea6b48e9808acbda8914f",
3115
+ "type": "meeting_media_ready",
3116
+ "read": false,
3117
+ "activityId": "6a7ea6b48e9808acbda89147",
3118
+ "sentAt": "2026-08-14T05:25:08.472Z",
3119
+ "createdAt": "2026-08-14T05:25:08.474Z",
3120
+ "content": {
3121
+ "actor": {
3122
+ "type": "App",
3123
+ "id": {
3124
+ "id": "5ed17524aa2ab23bf71d324d",
3125
+ "name": "Meetings",
3126
+ "icon": "https://cdn.workast.io/avatar.png"
3127
+ }
3128
+ },
3129
+ "message": "Standup"
3130
+ },
3131
+ "activityType": "meeting_media_ready"
3132
+ }
3133
+ ],
3134
+ "total": 2244
3135
+ };
3136
+ var reactionReadOnly = {
3137
+ "id": "6a844d5e6bc4270979c7a8ee",
3138
+ "emoji": ":+1:",
3139
+ "total": 1,
3140
+ "users": [
3141
+ {
3142
+ "name": "Grace Hopper"
3143
+ }
3144
+ ]
3145
+ };
3146
+ var search = {
3147
+ "id": "5f0e23098d49422410c20540",
3148
+ "custom": true,
3149
+ "name": "Ship v3",
3150
+ "payload": {
3151
+ "sort": [
3152
+ {
3153
+ "direction": 1,
3154
+ "field": "listName"
3155
+ }
3156
+ ],
3157
+ "includeSubTasks": true,
3158
+ "predicates": [
3159
+ {
3160
+ "value": "pending",
3161
+ "comparison": "eq",
3162
+ "attribute": "status",
3163
+ "type": "status"
3164
+ }
3165
+ ],
3166
+ "columns": [
3167
+ "list"
3168
+ ]
3169
+ },
3170
+ "link": "https://open.workast.app/ca19601b6bb816ca95386698b3385d49/search/5f0e23098d49422410c20540",
3171
+ "isPrimary": false,
3172
+ "users": [],
3173
+ "createdBy": {
3174
+ "user": {
3175
+ "id": "4214932441cb21eebdb396bfe34a8340",
3176
+ "name": "Grace Hopper",
3177
+ "userName": "grace",
3178
+ "email": "grace@example.com",
3179
+ "platformDetails": {
3180
+ "name": "slack",
3181
+ "imChannel": "D3EEXS3J6",
3182
+ "selfChannel": "D1HN843U3",
3183
+ "userId": "U0HBQESA1",
3184
+ "teamId": "T0HBUA0TC"
3185
+ },
3186
+ "confirmed": true,
3187
+ "avatar": "https://cdn.workast.io/avatar.png",
3188
+ "costCenter": "5c1b92b0a57d2b342c1a610e"
3189
+ }
3190
+ },
3191
+ "createdAt": "2020-07-14T21:26:33.254Z",
3192
+ "updatedAt": "2023-05-31T23:15:19.277Z",
3193
+ "values": {
3194
+ "list": {
3195
+ "5a99a7a58373fa652992e665": {
3196
+ "id": "5a99a7a58373fa652992e665",
3197
+ "type": "group",
3198
+ "status": "active",
3199
+ "privacy": "team",
3200
+ "link": "https://app.workast.com/list/5a99a7a58373fa652992e665",
3201
+ "name": "Engineering"
3202
+ },
3203
+ "5dc40cff038a590f79c403c0": {
3204
+ "id": "5dc40cff038a590f79c403c0",
3205
+ "type": "group",
3206
+ "status": "active",
3207
+ "privacy": "team",
3208
+ "link": "https://app.workast.com/list/5dc40cff038a590f79c403c0",
3209
+ "name": "Product"
3210
+ },
3211
+ "5fc58f3d15ff9110b64ca426": {
3212
+ "id": "5fc58f3d15ff9110b64ca426",
3213
+ "type": "group",
3214
+ "status": "active",
3215
+ "privacy": "team",
3216
+ "link": "https://app.workast.com/list/5fc58f3d15ff9110b64ca426",
3217
+ "name": "Engineering"
3218
+ }
3219
+ }
3220
+ }
3221
+ };
3222
+ var searchDetail = {
3223
+ "id": "5ddfeab45ff6d925d23c929e",
3224
+ "custom": true,
3225
+ "name": "Ship v3",
3226
+ "payload": {
3227
+ "includeSubTasks": true,
3228
+ "predicates": [
3229
+ {
3230
+ "value": "pending",
3231
+ "comparison": "eq",
3232
+ "attribute": "status",
3233
+ "type": "status"
3234
+ },
3235
+ {
3236
+ "predicates": [
3237
+ {
3238
+ "value": "5a176b5aa67ba147e5057516",
3239
+ "comparison": "eq",
3240
+ "attribute": "listId",
3241
+ "type": "list"
3242
+ },
3243
+ {
3244
+ "value": "5d7be323c662860f7c97ba12",
3245
+ "comparison": "eq",
3246
+ "attribute": "listId",
3247
+ "type": "list"
3248
+ },
3249
+ {
3250
+ "value": "5de581bdf2cec034545231fb",
3251
+ "comparison": "eq",
3252
+ "attribute": "listId",
3253
+ "type": "list"
3254
+ },
3255
+ {
3256
+ "value": "5de5818df2cec034545231a2",
3257
+ "comparison": "eq",
3258
+ "attribute": "listId",
3259
+ "type": "list"
3260
+ },
3261
+ {
3262
+ "value": "5dc40cff038a590f79c403c0",
3263
+ "comparison": "eq",
3264
+ "attribute": "listId",
3265
+ "type": "list"
3266
+ },
3267
+ {
3268
+ "type": "list",
3269
+ "attribute": "listId",
3270
+ "comparison": "eq",
3271
+ "value": "5e3d61b624e278106e8f6cf1"
3272
+ },
3273
+ {
3274
+ "type": "list",
3275
+ "attribute": "listId",
3276
+ "comparison": "eq",
3277
+ "value": "5f230805bf972326deafab16"
3278
+ },
3279
+ {
3280
+ "type": "list",
3281
+ "attribute": "listId",
3282
+ "comparison": "eq",
3283
+ "value": "5fc58f3d15ff9110b64ca426"
3284
+ }
3285
+ ],
3286
+ "type": "or"
3287
+ },
3288
+ {
3289
+ "value": "4214932441cb21eebdb396bfe34a8340",
3290
+ "comparison": "eq",
3291
+ "attribute": "assignedTo",
3292
+ "type": "user"
3293
+ }
3294
+ ],
3295
+ "sort": [
3296
+ {
3297
+ "field": "listName",
3298
+ "direction": 1
3299
+ }
3300
+ ],
3301
+ "columns": [
3302
+ "list",
3303
+ "subList",
3304
+ "assignedTo",
3305
+ "dueDate"
3306
+ ]
3307
+ },
3308
+ "link": "https://open.workast.app/ca19601b6bb816ca95386698b3385d49/search/5ddfeab45ff6d925d23c929e",
3309
+ "isPrimary": false,
3310
+ "users": [],
3311
+ "createdBy": {
3312
+ "user": {
3313
+ "id": "4214932441cb21eebdb396bfe34a8340",
3314
+ "name": "Grace Hopper",
3315
+ "userName": "grace",
3316
+ "email": "grace@example.com",
3317
+ "platformDetails": {
3318
+ "name": "slack",
3319
+ "imChannel": "D3EEXS3J6",
3320
+ "selfChannel": "D1HN843U3",
3321
+ "userId": "U0HBQESA1",
3322
+ "teamId": "T0HBUA0TC"
3323
+ },
3324
+ "confirmed": true,
3325
+ "avatar": "https://cdn.workast.io/avatar.png",
3326
+ "costCenter": "5c1b92b0a57d2b342c1a610e"
3327
+ }
3328
+ },
3329
+ "createdAt": "2019-11-28T15:41:40.245Z",
3330
+ "updatedAt": "2021-01-14T18:44:34.151Z",
3331
+ "values": {
3332
+ "list": {
3333
+ "5a176b5aa67ba147e5057516": {
3334
+ "id": "5a176b5aa67ba147e5057516",
3335
+ "type": "group",
3336
+ "status": "archived",
3337
+ "privacy": "team",
3338
+ "link": "https://app.workast.com/list/5a176b5aa67ba147e5057516",
3339
+ "name": "Engineering"
3340
+ },
3341
+ "5d7be323c662860f7c97ba12": {
3342
+ "id": "5d7be323c662860f7c97ba12",
3343
+ "type": "group",
3344
+ "status": "archived",
3345
+ "privacy": "team",
3346
+ "link": "https://app.workast.com/list/5d7be323c662860f7c97ba12",
3347
+ "name": "Product"
3348
+ },
3349
+ "5dc40cff038a590f79c403c0": {
3350
+ "id": "5dc40cff038a590f79c403c0",
3351
+ "type": "group",
3352
+ "status": "active",
3353
+ "privacy": "team",
3354
+ "link": "https://app.workast.com/list/5dc40cff038a590f79c403c0",
3355
+ "name": "Product"
3356
+ },
3357
+ "5de5818df2cec034545231a2": {
3358
+ "id": "5de5818df2cec034545231a2",
3359
+ "type": "group",
3360
+ "status": "archived",
3361
+ "privacy": "team",
3362
+ "link": "https://app.workast.com/list/5de5818df2cec034545231a2",
3363
+ "name": "Product"
3364
+ },
3365
+ "5de581bdf2cec034545231fb": {
3366
+ "id": "5de581bdf2cec034545231fb",
3367
+ "type": "group",
3368
+ "status": "archived",
3369
+ "privacy": "team",
3370
+ "link": "https://app.workast.com/list/5de581bdf2cec034545231fb",
3371
+ "name": "Product"
3372
+ },
3373
+ "5e3d61b624e278106e8f6cf1": {
3374
+ "id": "5e3d61b624e278106e8f6cf1",
3375
+ "type": "group",
3376
+ "status": "archived",
3377
+ "privacy": "team",
3378
+ "link": "https://app.workast.com/list/5e3d61b624e278106e8f6cf1",
3379
+ "name": "Product"
3380
+ },
3381
+ "5f230805bf972326deafab16": {
3382
+ "id": "5f230805bf972326deafab16",
3383
+ "type": "group",
3384
+ "status": "active",
3385
+ "privacy": "team",
3386
+ "link": "https://app.workast.com/list/5f230805bf972326deafab16",
3387
+ "name": "Product"
3388
+ },
3389
+ "5fc58f3d15ff9110b64ca426": {
3390
+ "id": "5fc58f3d15ff9110b64ca426",
3391
+ "type": "group",
3392
+ "status": "active",
3393
+ "privacy": "team",
3394
+ "link": "https://app.workast.com/list/5fc58f3d15ff9110b64ca426",
3395
+ "name": "Product"
3396
+ }
3397
+ },
3398
+ "user": {
3399
+ "4214932441cb21eebdb396bfe34a8340": {
3400
+ "id": "4214932441cb21eebdb396bfe34a8340",
3401
+ "name": "Grace Hopper",
3402
+ "userName": "grace",
3403
+ "email": "grace@example.com",
3404
+ "platformDetails": {
3405
+ "name": "slack",
3406
+ "imChannel": "D3EEXS3J6",
3407
+ "selfChannel": "D1HN843U3",
3408
+ "userId": "U0HBQESA1",
3409
+ "teamId": "T0HBUA0TC"
3410
+ },
3411
+ "confirmed": true,
3412
+ "avatar": "https://cdn.workast.io/avatar.png",
3413
+ "costCenter": "5c1b92b0a57d2b342c1a610e"
3414
+ }
3415
+ }
3416
+ },
3417
+ "results": {
3418
+ "tasks": [
3419
+ {
3420
+ "status": "pending",
3421
+ "text": "Ship v3",
3422
+ "shortId": "TGNT8",
3423
+ "createdAt": "2026-07-30T11:06:01.976Z",
3424
+ "updatedAt": "2026-08-03T04:47:29.070Z",
3425
+ "listPosition": -400001,
3426
+ "link": "https://open.workast.app/ca19601b6bb816ca95386698b3385d49/task/11c933fd54aab8cfe9957ab46ccb401f",
3427
+ "calendars": [
3428
+ "4214932441cb21eebdb396bfe34a8340"
3429
+ ],
3430
+ "id": "11c933fd54aab8cfe9957ab46ccb401f",
3431
+ "list": {
3432
+ "id": "5dc40cff038a590f79c403c0",
3433
+ "name": "Development Product",
3434
+ "type": "group",
3435
+ "privacy": "team",
3436
+ "link": "https://open.workast.app/ca19601b6bb816ca95386698b3385d49/space/5dc40cff038a590f79c403c0",
3437
+ "subLists": [
3438
+ {
3439
+ "id": "5dc40d3f7e802c0f93f20232",
3440
+ "name": "Live testing",
3441
+ "listPosition": 1e5,
3442
+ "createdBy": "4214932441cb21eebdb396bfe34a8340"
3443
+ }
3444
+ ]
3445
+ },
3446
+ "listId": "5dc40cff038a590f79c403c0",
3447
+ "subListId": "5dc40d3f7e802c0f93f20232",
3448
+ "subList": {
3449
+ "id": "5dc40d3f7e802c0f93f20232",
3450
+ "name": "Live testing"
3451
+ },
3452
+ "assignedTo": [
3453
+ {
3454
+ "id": "4214932441cb21eebdb396bfe34a8340",
3455
+ "name": "Grace Hopper",
3456
+ "userName": "grace",
3457
+ "email": "grace@example.com",
3458
+ "platformDetails": {
3459
+ "name": "slack",
3460
+ "imChannel": "D3EEXS3J6",
3461
+ "selfChannel": "D1HN843U3",
3462
+ "userId": "U0HBQESA1",
3463
+ "teamId": "T0HBUA0TC"
3464
+ },
3465
+ "confirmed": true,
3466
+ "avatar": "https://cdn.workast.io/avatar.png",
3467
+ "costCenter": "5c1b92b0a57d2b342c1a610e"
3468
+ }
3469
+ ],
3470
+ "subscribers": [
3471
+ {
3472
+ "id": "4214932441cb21eebdb396bfe34a8340",
3473
+ "name": "Grace Hopper",
3474
+ "userName": "grace",
3475
+ "email": "grace@example.com",
3476
+ "platformDetails": {
3477
+ "name": "slack",
3478
+ "imChannel": "D3EEXS3J6",
3479
+ "selfChannel": "D1HN843U3",
3480
+ "userId": "U0HBQESA1",
3481
+ "teamId": "T0HBUA0TC"
3482
+ },
3483
+ "confirmed": true,
3484
+ "avatar": "https://cdn.workast.io/avatar.png",
3485
+ "costCenter": "5c1b92b0a57d2b342c1a610e"
3486
+ }
3487
+ ],
3488
+ "allDay": false,
3489
+ "createdBy": {
3490
+ "id": "4214932441cb21eebdb396bfe34a8340",
3491
+ "name": "Grace Hopper",
3492
+ "userName": "grace",
3493
+ "email": "grace@example.com",
3494
+ "platformDetails": {
3495
+ "name": "slack",
3496
+ "imChannel": "D3EEXS3J6",
3497
+ "selfChannel": "D1HN843U3",
3498
+ "userId": "U0HBQESA1",
3499
+ "teamId": "T0HBUA0TC"
3500
+ },
3501
+ "confirmed": true,
3502
+ "avatar": "https://cdn.workast.io/avatar.png",
3503
+ "costCenter": "5c1b92b0a57d2b342c1a610e"
3504
+ },
3505
+ "hasDescription": true,
3506
+ "numberOfComments": 0,
3507
+ "numberOfAttachments": 0,
3508
+ "totalSubTasks": 2,
3509
+ "completedSubTasks": 2,
3510
+ "isSubscribed": true,
3511
+ "taskStatus": {
3512
+ "id": "5c7184fa40721e2ed4175a6e",
3513
+ "label": "Open",
3514
+ "color": "#808080",
3515
+ "createdAt": "2019-02-23T17:38:02.928Z",
3516
+ "updatedAt": "2019-02-23T17:38:02.928Z"
3517
+ },
3518
+ "milestones": [],
3519
+ "inHome": false,
3520
+ "fields": []
3521
+ }
3522
+ ],
3523
+ "total": 12,
3524
+ "hiddenTasks": 0
3525
+ }
3526
+ };
3527
+ var searchResults = {
3528
+ "tasks": [
3529
+ {
3530
+ "status": "pending",
3531
+ "text": "Ship v3",
3532
+ "shortId": "T4GNY",
3533
+ "createdAt": "2022-01-10T12:12:46.308Z",
3534
+ "updatedAt": "2025-07-10T08:25:54.460Z",
3535
+ "listPosition": 99999,
3536
+ "link": "https://open.workast.app/ca19601b6bb816ca95386698b3385d49/task/3634dc043f0d415ec2d307284a3cfe69",
3537
+ "calendars": [
3538
+ "b2956627fe26a2c1e4b6d5202413f779"
3539
+ ],
3540
+ "id": "3634dc043f0d415ec2d307284a3cfe69",
3541
+ "list": {
3542
+ "id": "603449f6f107b67c63e8cee9",
3543
+ "name": "Product",
3544
+ "type": "group",
3545
+ "privacy": "private",
3546
+ "link": "https://app.workast.com/list/603449f6f107b67c63e8cee9",
3547
+ "subLists": [
3548
+ {
3549
+ "id": "603449f6f107b67c63e8cee8",
3550
+ "name": "To-do",
3551
+ "listPosition": 1e5,
3552
+ "createdBy": "4214932441cb21eebdb396bfe34a8340"
3553
+ },
3554
+ {
3555
+ "id": "610ffd8c7374d6331a4178d8",
3556
+ "name": "In Progress",
3557
+ "listPosition": 7e5,
3558
+ "createdBy": "4214932441cb21eebdb396bfe34a8340"
3559
+ }
3560
+ ]
3561
+ },
3562
+ "listId": "603449f6f107b67c63e8cee9",
3563
+ "subListId": "610ffd8c7374d6331a4178d8",
3564
+ "subList": {
3565
+ "id": "610ffd8c7374d6331a4178d8",
3566
+ "name": "To-do"
3567
+ },
3568
+ "assignedTo": [
3569
+ {
3570
+ "id": "b2956627fe26a2c1e4b6d5202413f779",
3571
+ "name": "Ada Lovelace",
3572
+ "userName": "ada",
3573
+ "email": "ada@example.com",
3574
+ "platformDetails": {
3575
+ "name": "slack",
3576
+ "imChannel": "D3F5RQA6B",
3577
+ "selfChannel": "D1LGYBCFQ",
3578
+ "userId": "U0JU26WRG",
3579
+ "teamId": "T0HBUA0TC"
3580
+ },
3581
+ "confirmed": true,
3582
+ "avatar": "https://cdn.workast.io/avatar.png",
3583
+ "costCenter": "5c1b92b0a57d2b342c1a610e"
3584
+ }
3585
+ ],
3586
+ "subscribers": [
3587
+ {
3588
+ "id": "b2956627fe26a2c1e4b6d5202413f779",
3589
+ "name": "Ada Lovelace",
3590
+ "userName": "ada",
3591
+ "email": "ada@example.com",
3592
+ "platformDetails": {
3593
+ "name": "slack",
3594
+ "imChannel": "D3F5RQA6B",
3595
+ "selfChannel": "D1LGYBCFQ",
3596
+ "userId": "U0JU26WRG",
3597
+ "teamId": "T0HBUA0TC"
3598
+ },
3599
+ "confirmed": true,
3600
+ "avatar": "https://cdn.workast.io/avatar.png",
3601
+ "costCenter": "5c1b92b0a57d2b342c1a610e"
3602
+ }
3603
+ ],
3604
+ "allDay": false,
3605
+ "createdBy": {
3606
+ "id": "b2956627fe26a2c1e4b6d5202413f779",
3607
+ "name": "Ada Lovelace",
3608
+ "userName": "ada",
3609
+ "email": "ada@example.com",
3610
+ "platformDetails": {
3611
+ "name": "slack",
3612
+ "imChannel": "D3F5RQA6B",
3613
+ "selfChannel": "D1LGYBCFQ",
3614
+ "userId": "U0JU26WRG",
3615
+ "teamId": "T0HBUA0TC"
3616
+ },
3617
+ "confirmed": true,
3618
+ "avatar": "https://cdn.workast.io/avatar.png",
3619
+ "costCenter": "5c1b92b0a57d2b342c1a610e"
3620
+ },
3621
+ "hasDescription": true,
3622
+ "numberOfComments": 1,
3623
+ "numberOfAttachments": 0,
3624
+ "totalSubTasks": 1,
3625
+ "completedSubTasks": 0,
3626
+ "isSubscribed": true,
3627
+ "lastComment": {
3628
+ "id": "686f7912fc2fef09733c6f58",
3629
+ "type": "comment",
3630
+ "value": "Standup",
3631
+ "status": "active",
3632
+ "createdAt": "2025-07-10T08:25:54.274Z",
3633
+ "updatedAt": "2025-07-10T08:25:54.274Z",
3634
+ "mentions": [
3635
+ {
3636
+ "id": "b2956627fe26a2c1e4b6d5202413f779",
3637
+ "name": "Ada Lovelace",
3638
+ "userName": "ada",
3639
+ "email": "ada@example.com",
3640
+ "platformDetails": {
3641
+ "name": "slack",
3642
+ "imChannel": "D3F5RQA6B",
3643
+ "selfChannel": "D1LGYBCFQ",
3644
+ "userId": "U0JU26WRG",
3645
+ "teamId": "T0HBUA0TC"
3646
+ },
3647
+ "confirmed": true,
3648
+ "avatar": "https://cdn.workast.io/avatar.png",
3649
+ "costCenter": "5c1b92b0a57d2b342c1a610e"
3650
+ }
3651
+ ],
3652
+ "reactions": [],
3653
+ "actor": {
3654
+ "type": "User",
3655
+ "data": {
3656
+ "id": "4214932441cb21eebdb396bfe34a8340",
3657
+ "name": "Grace Hopper",
3658
+ "userName": "grace",
3659
+ "email": "grace@example.com",
3660
+ "platformDetails": {
3661
+ "name": "slack",
3662
+ "imChannel": "D3EEXS3J6",
3663
+ "selfChannel": "D1HN843U3",
3664
+ "userId": "U0HBQESA1",
3665
+ "teamId": "T0HBUA0TC"
3666
+ },
3667
+ "confirmed": true,
3668
+ "avatar": "https://cdn.workast.io/avatar.png",
3669
+ "costCenter": "5c1b92b0a57d2b342c1a610e"
3670
+ }
3671
+ }
3672
+ },
3673
+ "taskStatus": {
3674
+ "id": "5c7184fa40721e2ed4175a6e",
3675
+ "label": "Open",
3676
+ "color": "#808080",
3677
+ "createdAt": "2019-02-23T17:38:02.928Z",
3678
+ "updatedAt": "2019-02-23T17:38:02.928Z"
3679
+ },
3680
+ "milestones": [],
3681
+ "inHome": false,
3682
+ "fields": []
3683
+ }
3684
+ ],
3685
+ "total": 441,
3686
+ "hiddenTasks": 0
3687
+ };
3688
+ var searches = {
3689
+ "searches": [
3690
+ {
3691
+ "id": "5ddfeab45ff6d925d23c929e",
3692
+ "name": "Ship v3",
3693
+ "custom": true,
3694
+ "link": "https://open.workast.app/ca19601b6bb816ca95386698b3385d49/search/5ddfeab45ff6d925d23c929e",
3695
+ "usersCount": 0,
3696
+ "createdBy": {
3697
+ "user": "4214932441cb21eebdb396bfe34a8340"
3698
+ },
3699
+ "createdAt": "2019-11-28T15:41:40.245Z",
3700
+ "updatedAt": "2021-01-14T18:44:34.151Z"
3701
+ }
3702
+ ],
3703
+ "total": 3
3704
+ };
3705
+ var subList = {
3706
+ "id": "5a6ebde81519395731f90e30",
3707
+ "name": "To-do",
3708
+ "listPosition": 1e5,
3709
+ "createdBy": "b2956627fe26a2c1e4b6d5202413f779"
3710
+ };
3711
+ var tag = {
3712
+ "id": "5a6227d69f0cec2676083529",
3713
+ "name": "Feature",
3714
+ "color": "#61bd4f"
3715
+ };
3716
+ var task = {
3717
+ "id": "3634dc043f0d415ec2d307284a3cfe69",
3718
+ "createdAt": "2022-01-10T12:12:46.308Z",
3719
+ "createdBy": {
3720
+ "id": "b2956627fe26a2c1e4b6d5202413f779",
3721
+ "createdAt": "2016-12-28T22:19:45.715Z",
3722
+ "name": "Ada Lovelace",
3723
+ "userName": "ada",
3724
+ "platformDetails": {
3725
+ "name": "slack",
3726
+ "imChannel": "D3F5RQA6B",
3727
+ "selfChannel": "D1LGYBCFQ",
3728
+ "userId": "U0JU26WRG",
3729
+ "teamId": "T0HBUA0TC"
3730
+ },
3731
+ "timezone": "Australia/Canberra",
3732
+ "email": "ada@example.com",
3733
+ "lastActive": "2025-07-10T01:22:15.814Z",
3734
+ "role": "admin",
3735
+ "status": "active",
3736
+ "confirmed": true,
3737
+ "profile": {},
3738
+ "avatar": "https://cdn.workast.io/avatar.png",
3739
+ "costCenter": "5c1b92b0a57d2b342c1a610e"
3740
+ },
3741
+ "shortId": "T4GNY",
3742
+ "text": "Ship v3",
3743
+ "assignedTo": [
3744
+ {
3745
+ "id": "b2956627fe26a2c1e4b6d5202413f779",
3746
+ "createdAt": "2016-12-28T22:19:45.715Z",
3747
+ "name": "Ada Lovelace",
3748
+ "userName": "ada",
3749
+ "platformDetails": {
3750
+ "name": "slack",
3751
+ "imChannel": "D3F5RQA6B",
3752
+ "selfChannel": "D1LGYBCFQ",
3753
+ "userId": "U0JU26WRG",
3754
+ "teamId": "T0HBUA0TC"
3755
+ },
3756
+ "timezone": "Australia/Canberra",
3757
+ "email": "ada@example.com",
3758
+ "lastActive": "2025-07-10T01:22:15.814Z",
3759
+ "role": "admin",
3760
+ "status": "active",
3761
+ "confirmed": true,
3762
+ "profile": {},
3763
+ "avatar": "https://cdn.workast.io/avatar.png",
3764
+ "costCenter": "5c1b92b0a57d2b342c1a610e"
3765
+ }
3766
+ ],
3767
+ "subscribers": [
3768
+ {
3769
+ "id": "b2956627fe26a2c1e4b6d5202413f779",
3770
+ "createdAt": "2016-12-28T22:19:45.715Z",
3771
+ "name": "Ada Lovelace",
3772
+ "userName": "ada",
3773
+ "platformDetails": {
3774
+ "name": "slack",
3775
+ "imChannel": "D3F5RQA6B",
3776
+ "selfChannel": "D1LGYBCFQ",
3777
+ "userId": "U0JU26WRG",
3778
+ "teamId": "T0HBUA0TC"
3779
+ },
3780
+ "timezone": "Australia/Canberra",
3781
+ "email": "ada@example.com",
3782
+ "lastActive": "2025-07-10T01:22:15.814Z",
3783
+ "role": "admin",
3784
+ "status": "active",
3785
+ "confirmed": true,
3786
+ "profile": {},
3787
+ "avatar": "https://cdn.workast.io/avatar.png",
3788
+ "costCenter": "5c1b92b0a57d2b342c1a610e"
3789
+ },
3790
+ {
3791
+ "id": "4214932441cb21eebdb396bfe34a8340",
3792
+ "createdAt": "2017-04-14T02:14:44.247Z",
3793
+ "name": "Grace Hopper",
3794
+ "userName": "grace",
3795
+ "platformDetails": {
3796
+ "name": "slack",
3797
+ "imChannel": "D3EEXS3J6",
3798
+ "selfChannel": "D1HN843U3",
3799
+ "userId": "U0HBQESA1",
3800
+ "teamId": "T0HBUA0TC"
3801
+ },
3802
+ "timezone": "Australia/Canberra",
3803
+ "email": "grace@example.com",
3804
+ "lastActive": "2026-08-18T11:29:00.207Z",
3805
+ "role": "admin",
3806
+ "status": "active",
3807
+ "confirmed": true,
3808
+ "profile": {},
3809
+ "avatar": "https://cdn.workast.io/avatar.png",
3810
+ "costCenter": "5c1b92b0a57d2b342c1a610e"
3811
+ }
3812
+ ],
3813
+ "status": "pending",
3814
+ "allDay": false,
3815
+ "priority": 0,
3816
+ "description": "Ship v3",
3817
+ "listId": "603449f6f107b67c63e8cee9",
3818
+ "list": {
3819
+ "id": "603449f6f107b67c63e8cee9",
3820
+ "hash": "fabc9069cda279d762400d53e2854266",
3821
+ "name": "Product",
3822
+ "avatar": "https://cdn.workast.io/list-avatar.png",
3823
+ "numberOfParticipants": 2,
3824
+ "type": "group",
3825
+ "privacy": "private",
3826
+ "isArchived": false,
3827
+ "platformDetails": {
3828
+ "name": "slack",
3829
+ "channelId": "G01NLRJ053L",
3830
+ "channelName": "engineering",
3831
+ "type": "group",
3832
+ "teamId": "T0HBUA0TC"
3833
+ },
3834
+ "platformNotifications": {
3835
+ "taskCreated": true,
3836
+ "taskCompleted": true
3837
+ },
3838
+ "subLists": [
3839
+ {
3840
+ "id": "603449f6f107b67c63e8cee8",
3841
+ "name": "To-do",
3842
+ "listPosition": 1e5,
3843
+ "createdBy": "4214932441cb21eebdb396bfe34a8340"
3844
+ },
3845
+ {
3846
+ "id": "610ffd8c7374d6331a4178d8",
3847
+ "name": "In Progress",
3848
+ "listPosition": 7e5,
3849
+ "createdBy": "4214932441cb21eebdb396bfe34a8340"
3850
+ }
3851
+ ],
3852
+ "defaultSubList": "603449f6f107b67c63e8cee8",
3853
+ "isParticipant": true,
3854
+ "link": "https://app.workast.com/list/603449f6f107b67c63e8cee9"
3855
+ },
3856
+ "listPosition": 99999,
3857
+ "subList": {
3858
+ "id": "610ffd8c7374d6331a4178d8",
3859
+ "name": "To-do",
3860
+ "listPosition": 7e5,
3861
+ "createdBy": "4214932441cb21eebdb396bfe34a8340"
3862
+ },
3863
+ "subListId": "610ffd8c7374d6331a4178d8",
3864
+ "subTasks": [
3865
+ {
3866
+ "status": "pending",
3867
+ "text": "Ship v3",
3868
+ "shortId": "T4QMF",
3869
+ "createdAt": "2022-01-10T12:15:13.627Z",
3870
+ "updatedAt": "2022-01-10T12:19:50.379Z",
3871
+ "listPosition": 1e5,
3872
+ "link": "https://open.workast.app/ca19601b6bb816ca95386698b3385d49/task/7cec8c8604790b391221049f28d5ba40",
3873
+ "calendars": [
3874
+ "b2956627fe26a2c1e4b6d5202413f779"
3875
+ ],
3876
+ "id": "7cec8c8604790b391221049f28d5ba40",
3877
+ "list": {
3878
+ "id": "603449f6f107b67c63e8cee9",
3879
+ "name": "Product",
3880
+ "type": "group",
3881
+ "privacy": "private",
3882
+ "link": "https://app.workast.com/list/603449f6f107b67c63e8cee9",
3883
+ "subLists": [
3884
+ {
3885
+ "id": "603449f6f107b67c63e8cee8",
3886
+ "name": "To-do",
3887
+ "listPosition": 1e5,
3888
+ "createdBy": "4214932441cb21eebdb396bfe34a8340"
3889
+ },
3890
+ {
3891
+ "id": "610ffd8c7374d6331a4178d8",
3892
+ "name": "In Progress",
3893
+ "listPosition": 7e5,
3894
+ "createdBy": "4214932441cb21eebdb396bfe34a8340"
3895
+ }
3896
+ ]
3897
+ },
3898
+ "listId": "603449f6f107b67c63e8cee9",
3899
+ "parent": {
3900
+ "id": "3634dc043f0d415ec2d307284a3cfe69",
3901
+ "text": "Ship v3",
3902
+ "shortId": "T4GNY",
3903
+ "link": "https://open.workast.app/ca19601b6bb816ca95386698b3385d49/task/3634dc043f0d415ec2d307284a3cfe69"
3904
+ },
3905
+ "assignedTo": [],
3906
+ "subscribers": [
3907
+ {
3908
+ "id": "b2956627fe26a2c1e4b6d5202413f779",
3909
+ "name": "Ada Lovelace",
3910
+ "userName": "ada",
3911
+ "email": "ada@example.com",
3912
+ "platformDetails": {
3913
+ "name": "slack",
3914
+ "imChannel": "D3F5RQA6B",
3915
+ "selfChannel": "D1LGYBCFQ",
3916
+ "userId": "U0JU26WRG",
3917
+ "teamId": "T0HBUA0TC"
3918
+ },
3919
+ "confirmed": true,
3920
+ "avatar": "https://cdn.workast.io/avatar.png",
3921
+ "costCenter": "5c1b92b0a57d2b342c1a610e"
3922
+ }
3923
+ ],
3924
+ "allDay": false,
3925
+ "createdBy": {
3926
+ "id": "b2956627fe26a2c1e4b6d5202413f779",
3927
+ "name": "Ada Lovelace",
3928
+ "userName": "ada",
3929
+ "email": "ada@example.com",
3930
+ "platformDetails": {
3931
+ "name": "slack",
3932
+ "imChannel": "D3F5RQA6B",
3933
+ "selfChannel": "D1LGYBCFQ",
3934
+ "userId": "U0JU26WRG",
3935
+ "teamId": "T0HBUA0TC"
3936
+ },
3937
+ "confirmed": true,
3938
+ "avatar": "https://cdn.workast.io/avatar.png",
3939
+ "costCenter": "5c1b92b0a57d2b342c1a610e"
3940
+ },
3941
+ "hasDescription": true,
3942
+ "numberOfComments": 0,
3943
+ "numberOfAttachments": 0,
3944
+ "subTasks": [],
3945
+ "isSubscribed": false,
3946
+ "taskStatus": {
3947
+ "id": "5c7184fa40721e2ed4175a6e",
3948
+ "label": "Open",
3949
+ "color": "#808080",
3950
+ "createdAt": "2019-02-23T17:38:02.928Z",
3951
+ "updatedAt": "2019-02-23T17:38:02.928Z"
3952
+ },
3953
+ "inHome": false,
3954
+ "fields": []
3955
+ }
3956
+ ],
3957
+ "attachments": [],
3958
+ "totalSubTasks": 1,
3959
+ "completedSubTasks": 0,
3960
+ "numberOfComments": 1,
3961
+ "lastComment": {
3962
+ "id": "686f7912fc2fef09733c6f58",
3963
+ "type": "comment",
3964
+ "value": "Ship v3",
3965
+ "status": "active",
3966
+ "createdAt": "2025-07-10T08:25:54.274Z",
3967
+ "updatedAt": "2025-07-10T08:25:54.274Z",
3968
+ "mentions": [
3969
+ {
3970
+ "id": "b2956627fe26a2c1e4b6d5202413f779",
3971
+ "name": "Ada Lovelace",
3972
+ "userName": "ada",
3973
+ "email": "ada@example.com",
3974
+ "platformDetails": {
3975
+ "name": "slack",
3976
+ "imChannel": "D3F5RQA6B",
3977
+ "selfChannel": "D1LGYBCFQ",
3978
+ "userId": "U0JU26WRG",
3979
+ "teamId": "T0HBUA0TC"
3980
+ },
3981
+ "confirmed": true,
3982
+ "avatar": "https://cdn.workast.io/avatar.png",
3983
+ "costCenter": "5c1b92b0a57d2b342c1a610e"
3984
+ }
3985
+ ],
3986
+ "reactions": [],
3987
+ "actor": {
3988
+ "type": "User",
3989
+ "data": {
3990
+ "id": "4214932441cb21eebdb396bfe34a8340",
3991
+ "name": "Grace Hopper",
3992
+ "userName": "grace",
3993
+ "email": "grace@example.com",
3994
+ "platformDetails": {
3995
+ "name": "slack",
3996
+ "imChannel": "D3EEXS3J6",
3997
+ "selfChannel": "D1HN843U3",
3998
+ "userId": "U0HBQESA1",
3999
+ "teamId": "T0HBUA0TC"
4000
+ },
4001
+ "confirmed": true,
4002
+ "avatar": "https://cdn.workast.io/avatar.png",
4003
+ "costCenter": "5c1b92b0a57d2b342c1a610e"
4004
+ }
4005
+ }
4006
+ },
4007
+ "link": "https://open.workast.app/ca19601b6bb816ca95386698b3385d49/task/3634dc043f0d415ec2d307284a3cfe69",
4008
+ "dependencies": [],
4009
+ "milestones": [],
4010
+ "inHome": false,
4011
+ "fields": [
4012
+ {
4013
+ "id": "620120d5106d941d2ac206c7",
4014
+ "name": "Priority",
4015
+ "description": "Ship v3",
4016
+ "type": "options",
4017
+ "useAsTaskColor": false,
4018
+ "options": [
4019
+ {
4020
+ "id": "620120d5106d941d2ac206c8",
4021
+ "name": "Yes",
4022
+ "color": "#2ef00d"
4023
+ },
4024
+ {
4025
+ "id": "620120d5106d941d2ac206c9",
4026
+ "name": "No",
4027
+ "color": "#ee0551"
4028
+ }
4029
+ ],
4030
+ "value": ""
4031
+ }
4032
+ ],
4033
+ "calendars": [
4034
+ "b2956627fe26a2c1e4b6d5202413f779"
4035
+ ]
4036
+ };
4037
+ var taskActivities = {
4038
+ "activities": [
4039
+ {
4040
+ "id": "61dc22bee45fbc0e26ca342d",
4041
+ "type": "task_created",
4042
+ "createdAt": "2022-01-10T12:12:46.500Z",
4043
+ "updatedAt": "2022-01-10T12:12:46.500Z",
4044
+ "mentions": [],
4045
+ "actor": {
4046
+ "type": "User",
4047
+ "data": {
4048
+ "id": "b2956627fe26a2c1e4b6d5202413f779",
4049
+ "name": "Ada Lovelace",
4050
+ "userName": "ada",
4051
+ "email": "ada@example.com",
4052
+ "platformDetails": {
4053
+ "name": "slack",
4054
+ "imChannel": "D3F5RQA6B",
4055
+ "selfChannel": "D1LGYBCFQ",
4056
+ "userId": "U0JU26WRG",
4057
+ "teamId": "T0HBUA0TC"
4058
+ },
4059
+ "confirmed": true,
4060
+ "avatar": "https://cdn.workast.io/avatar.png",
4061
+ "costCenter": "5c1b92b0a57d2b342c1a610e"
4062
+ }
4063
+ },
4064
+ "userFriendlyContent": {
4065
+ "task": {
4066
+ "id": "3634dc043f0d415ec2d307284a3cfe69",
4067
+ "shortId": "T4GNY",
4068
+ "status": "pending",
4069
+ "subscribers": [
4070
+ "b2956627fe26a2c1e4b6d5202413f779",
4071
+ "4214932441cb21eebdb396bfe34a8340"
4072
+ ],
4073
+ "calendars": [
4074
+ "b2956627fe26a2c1e4b6d5202413f779"
4075
+ ],
4076
+ "text": "Ship v3",
4077
+ "description": "Ship v3",
4078
+ "subListId": "610ffd8c7374d6331a4178d8",
4079
+ "listId": "603449f6f107b67c63e8cee9",
4080
+ "link": "https://open.workast.app/ca19601b6bb816ca95386698b3385d49/task/3634dc043f0d415ec2d307284a3cfe69",
4081
+ "allDay": false,
4082
+ "createdBy": {
4083
+ "id": "b2956627fe26a2c1e4b6d5202413f779",
4084
+ "createdAt": "2016-12-28T22:19:45.715Z",
4085
+ "name": "Ada Lovelace",
4086
+ "userName": "ada",
4087
+ "platformDetails": {
4088
+ "name": "slack",
4089
+ "imChannel": "D3F5RQA6B",
4090
+ "selfChannel": "D1LGYBCFQ",
4091
+ "userId": "U0JU26WRG",
4092
+ "teamId": "T0HBUA0TC"
4093
+ },
4094
+ "timezone": "Australia/Canberra",
4095
+ "email": "ada@example.com",
4096
+ "lastActive": "2025-07-10T01:22:15.814Z",
4097
+ "role": "admin",
4098
+ "status": "active",
4099
+ "confirmed": true,
4100
+ "profile": {},
4101
+ "avatar": "https://cdn.workast.io/avatar.png",
4102
+ "costCenter": "5c1b92b0a57d2b342c1a610e"
4103
+ },
4104
+ "assignedTo": [
4105
+ {
4106
+ "id": "b2956627fe26a2c1e4b6d5202413f779",
4107
+ "createdAt": "2016-12-28T22:19:45.715Z",
4108
+ "name": "Ada Lovelace",
4109
+ "userName": "ada",
4110
+ "platformDetails": {
4111
+ "name": "slack",
4112
+ "imChannel": "D3F5RQA6B",
4113
+ "selfChannel": "D1LGYBCFQ",
4114
+ "userId": "U0JU26WRG",
4115
+ "teamId": "T0HBUA0TC"
4116
+ },
4117
+ "timezone": "Australia/Canberra",
4118
+ "email": "ada@example.com",
4119
+ "lastActive": "2025-07-10T01:22:15.814Z",
4120
+ "role": "admin",
4121
+ "status": "active",
4122
+ "confirmed": true,
4123
+ "profile": {},
4124
+ "avatar": "https://cdn.workast.io/avatar.png",
4125
+ "costCenter": "5c1b92b0a57d2b342c1a610e"
4126
+ }
4127
+ ]
4128
+ },
4129
+ "list": {
4130
+ "id": "603449f6f107b67c63e8cee9",
4131
+ "name": "Product",
4132
+ "link": "https://app.workast.com/list/603449f6f107b67c63e8cee9",
4133
+ "subLists": [
4134
+ {
4135
+ "id": "603449f6f107b67c63e8cee8",
4136
+ "name": "To-do",
4137
+ "listPosition": 1e5,
4138
+ "createdBy": "4214932441cb21eebdb396bfe34a8340"
4139
+ },
4140
+ {
4141
+ "id": "610ffd8c7374d6331a4178d8",
4142
+ "name": "In Progress",
4143
+ "listPosition": 7e5,
4144
+ "createdBy": "4214932441cb21eebdb396bfe34a8340"
4145
+ }
4146
+ ],
4147
+ "platformDetails": {
4148
+ "name": "slack",
4149
+ "channelId": "G01NLRJ053L",
4150
+ "channelName": "engineering",
4151
+ "type": "group",
4152
+ "teamId": "T0HBUA0TC"
4153
+ }
4154
+ },
4155
+ "actor": {
4156
+ "type": "User",
4157
+ "id": {
4158
+ "id": "b2956627fe26a2c1e4b6d5202413f779",
4159
+ "name": "Ada Lovelace",
4160
+ "userName": "ada",
4161
+ "email": "ada@example.com",
4162
+ "platformDetails": {
4163
+ "name": "slack",
4164
+ "imChannel": "D3F5RQA6B",
4165
+ "selfChannel": "D1LGYBCFQ",
4166
+ "userId": "U0JU26WRG",
4167
+ "teamId": "T0HBUA0TC"
4168
+ },
4169
+ "confirmed": true,
4170
+ "avatar": "https://cdn.workast.io/avatar.png",
4171
+ "costCenter": "5c1b92b0a57d2b342c1a610e"
4172
+ }
4173
+ },
4174
+ "message": "{{actor}} created the task {{task}}"
4175
+ }
4176
+ }
4177
+ ],
4178
+ "total": 17
4179
+ };
4180
+ var taskBulkUpdateResult = {
4181
+ "modified": [
4182
+ "3634dc043f0d415ec2d307284a3cfe69"
4183
+ ],
4184
+ "error": []
4185
+ };
4186
+ var tokenDetails = {
4187
+ "app": {
4188
+ "id": "5d9a6b09269e415d36380d23",
4189
+ "name": "Example App"
4190
+ },
4191
+ "user": {
4192
+ "id": "4214932441cb21eebdb396bfe34a8340",
4193
+ "name": "Grace Hopper"
4194
+ },
4195
+ "team": {
4196
+ "id": "ca19601b6bb816ca95386698b3385d49",
4197
+ "name": "Example Team"
4198
+ }
4199
+ };
4200
+ var user = {
4201
+ "id": "4214932441cb21eebdb396bfe34a8340",
4202
+ "virtualId": "c2xhY2svL1QwSEJVQTBUQzpVMEhCUUVTQTE=",
4203
+ "name": "Grace Hopper",
4204
+ "userName": "grace",
4205
+ "avatar": "https://cdn.workast.io/avatar.png"
4206
+ };
4207
+ var userDetail = {
4208
+ "id": "4214932441cb21eebdb396bfe34a8340",
4209
+ "createdAt": "2017-04-14T02:14:44.247Z",
4210
+ "name": "Grace Hopper",
4211
+ "userName": "grace",
4212
+ "platformDetails": {
4213
+ "name": "slack",
4214
+ "imChannel": "D3EEXS3J6",
4215
+ "selfChannel": "D1HN843U3",
4216
+ "userId": "U0HBQESA1",
4217
+ "teamId": "T0HBUA0TC"
4218
+ },
4219
+ "timezone": "Australia/Canberra",
4220
+ "email": "grace@example.com",
4221
+ "lastActive": "2026-08-18T11:29:00.207Z",
4222
+ "role": "admin",
4223
+ "status": "active",
4224
+ "confirmed": true,
4225
+ "profile": {},
4226
+ "avatar": "https://cdn.workast.io/avatar.png",
4227
+ "costCenter": "5c1b92b0a57d2b342c1a610e"
4228
+ };
4229
+ var userDetailWithTeam = {
4230
+ "id": "4214932441cb21eebdb396bfe34a8340",
4231
+ "createdAt": "2017-04-14T02:14:44.247Z",
4232
+ "name": "Grace Hopper",
4233
+ "userName": "grace",
4234
+ "platformDetails": {
4235
+ "name": "slack",
4236
+ "imChannel": "D3EEXS3J6",
4237
+ "selfChannel": "D1HN843U3",
4238
+ "userId": "U0HBQESA1",
4239
+ "teamId": "T0HBUA0TC"
4240
+ },
4241
+ "timezone": "Australia/Canberra",
4242
+ "email": "grace@example.com",
4243
+ "lastActive": "2026-08-18T11:29:00.207Z",
4244
+ "role": "admin",
4245
+ "status": "active",
4246
+ "confirmed": true,
4247
+ "profile": {},
4248
+ "avatar": "https://cdn.workast.io/avatar.png",
4249
+ "costCenter": "5c1b92b0a57d2b342c1a610e",
4250
+ "team": {
4251
+ "id": "ca19601b6bb816ca95386698b3385d49",
4252
+ "name": "Example Team",
4253
+ "url": "https://app.workast.com",
4254
+ "link": "https://open.workast.app/ca19601b6bb816ca95386698b3385d49",
4255
+ "domain": "example",
4256
+ "totalTasks": 54822,
4257
+ "status": "active",
4258
+ "createdAt": "2018-05-22T14:04:01.652Z",
4259
+ "betaTester": true,
4260
+ "platformDetails": {
4261
+ "name": "slack",
4262
+ "teamId": "T0HBUA0TC",
4263
+ "url": "https://example.slack.com/",
4264
+ "emailDomain": "example.com",
4265
+ "teamSize": 76
4266
+ },
4267
+ "icon": "https://cdn.workast.io/list-avatar.png"
4268
+ }
4269
+ };
4270
+ var userResource = {
4271
+ "id": "4214932441cb21eebdb396bfe34a8340",
4272
+ "name": "Grace Hopper",
4273
+ "email": "grace@example.com",
4274
+ "userName": "grace",
4275
+ "platformDetails": {
4276
+ "name": "slack",
4277
+ "imChannel": "D3EEXS3J6",
4278
+ "selfChannel": "D1HN843U3",
4279
+ "userId": "U0HBQESA1",
4280
+ "teamId": "T0HBUA0TC"
4281
+ },
4282
+ "role": "admin",
4283
+ "confirmed": true,
4284
+ "avatar": "https://cdn.workast.io/avatar.png",
4285
+ "personalListId": "5937861aa2470108bbf72e1d",
4286
+ "team": {
4287
+ "id": "ca19601b6bb816ca95386698b3385d49",
4288
+ "name": "Example Team",
4289
+ "url": "https://app.workast.com",
4290
+ "link": "https://open.workast.app/ca19601b6bb816ca95386698b3385d49",
4291
+ "domain": "example",
4292
+ "totalTasks": 54822,
4293
+ "status": "active",
4294
+ "createdAt": "2018-05-22T14:04:01.652Z",
4295
+ "betaTester": true,
4296
+ "platformDetails": {
4297
+ "name": "slack",
4298
+ "teamId": "T0HBUA0TC",
4299
+ "url": "https://example.slack.com/",
4300
+ "emailDomain": "example.com",
4301
+ "teamSize": 76
4302
+ },
4303
+ "icon": "https://cdn.workast.io/list-avatar.png",
4304
+ "activeUsers": 7
4305
+ },
4306
+ "organization": {
4307
+ "id": "5c1b92b0a57d2b342c1a610d",
4308
+ "name": "Example Organization",
4309
+ "defaultCostCenter": "5c1b92b0a57d2b342c1a610e"
4310
+ },
4311
+ "costCenter": {
4312
+ "id": "5c1b92b0a57d2b342c1a610e",
4313
+ "createdAt": "2018-12-20T13:01:36.566Z",
4314
+ "updatedAt": "2019-01-10T14:56:47.968Z",
4315
+ "name": "Default",
4316
+ "account": "premium",
4317
+ "createdBy": "c51a9c1a2ddfbcefa7abf74036e0c616",
4318
+ "product": {
4319
+ "id": "5ddfe4b458ddf740a5393ae9",
4320
+ "createdAt": "2019-11-28T15:16:04.653Z",
4321
+ "updatedAt": "2020-07-30T14:55:46.510Z",
4322
+ "name": "Professional",
4323
+ "default": false,
4324
+ "isPaid": true,
4325
+ "features": {
4326
+ "createSubtasks": true,
4327
+ "createPrivateSpaces": true,
4328
+ "createLists": true,
4329
+ "createTags": true,
4330
+ "importTemplates": true,
4331
+ "createTemplates": true,
4332
+ "createSearches": true,
4333
+ "createTaskStatus": true,
4334
+ "createGuestAccounts": true,
4335
+ "createTaskDependencies": true,
4336
+ "storageLimit": 5368709120,
4337
+ "createMilestones": true,
4338
+ "accessMeetings": true,
4339
+ "calendarSync": true,
4340
+ "downloadSearch": true,
4341
+ "createSpaces": true,
4342
+ "appLogin": true,
4343
+ "createFields": true,
4344
+ "timelineView": true,
4345
+ "aiWorkflows": true,
4346
+ "notetakerMinutesPerMonth": 600
4347
+ },
4348
+ "trialling": false,
4349
+ "currentPlan": {
4350
+ "id": "5ddfe4b458ddf740a5393aea",
4351
+ "term": "annual",
4352
+ "price": 9.95,
4353
+ "flatFee": false
4354
+ }
4355
+ },
4356
+ "storage": {
4357
+ "used": 2315908683,
4358
+ "total": 37580963840,
4359
+ "usedPercentage": 6.16,
4360
+ "freePercentage": 93.84
4361
+ },
4362
+ "isDefault": true,
4363
+ "activeUsers": 7
4364
+ },
4365
+ "calendars": [],
4366
+ "timezone": "Australia/Canberra",
4367
+ "reminders": {
4368
+ "channels": {
4369
+ "slack": true,
4370
+ "email": false
4371
+ },
4372
+ "days": [
4373
+ 1,
4374
+ 2,
4375
+ 3,
4376
+ 4,
4377
+ 5
4378
+ ],
4379
+ "hour": 9,
4380
+ "hourUTC": 23,
4381
+ "taskAssignedToOthers": false,
4382
+ "taskDueInTheFutureDays": 0
4383
+ },
4384
+ "notifications": {
4385
+ "assignedToTasks": true,
4386
+ "completedTasks": true,
4387
+ "appAnnouncements": true,
4388
+ "taskReminderMinutes": 30
4389
+ },
4390
+ "dateSettings": {
4391
+ "startOfWeek": "monday",
4392
+ "timeFormat": "HH",
4393
+ "dateFormat": "M/D/Y"
4394
+ },
4395
+ "myTasksSearchSettings": {
4396
+ "excludeAssignToOthers": true,
4397
+ "excludedLists": [
4398
+ {
4399
+ "id": "5937861aa2470108bbf72e1d",
4400
+ "name": "Personal tasks",
4401
+ "type": "personal",
4402
+ "privacy": "private"
4403
+ },
4404
+ {
4405
+ "id": "59daaf15c7d6260e7f470356",
4406
+ "name": "Product",
4407
+ "type": "group",
4408
+ "privacy": "team"
4409
+ }
4410
+ ]
4411
+ },
4412
+ "profile": {},
4413
+ "storage": {
4414
+ "used": 627473089,
4415
+ "total": 5368709120,
4416
+ "usedPercentage": 11.69,
4417
+ "freePercentage": 88.31
4418
+ }
4419
+ };
4420
+ var workflow = {
4421
+ "id": "673b14ef1231f8099d5c96a4",
4422
+ "trigger": {
4423
+ "name": "event",
4424
+ "value": "task_created"
4425
+ },
4426
+ "prompt": "Ship v3",
4427
+ "lists": [
4428
+ {
4429
+ "id": "673b0b7b1231f8099d5ba067",
4430
+ "type": "group",
4431
+ "status": "archived",
4432
+ "privacy": "team",
4433
+ "link": "https://app.workast.com/list/673b0b7b1231f8099d5ba067",
4434
+ "name": "Engineering"
4435
+ }
4436
+ ],
4437
+ "status": "active"
4438
+ };
4439
+ var workflowDetail = {
4440
+ "id": "673b14ef1231f8099d5c96a4",
4441
+ "trigger": {
4442
+ "name": "event",
4443
+ "value": "task_created"
4444
+ },
4445
+ "prompt": "Ship v3",
4446
+ "lists": [
4447
+ {
4448
+ "id": "673b0b7b1231f8099d5ba067",
4449
+ "type": "group",
4450
+ "status": "archived",
4451
+ "privacy": "team",
4452
+ "link": "https://app.workast.com/list/673b0b7b1231f8099d5ba067",
4453
+ "name": "Engineering"
4454
+ }
4455
+ ],
4456
+ "status": "active",
4457
+ "runs": [
4458
+ {
4459
+ "id": "673bffe012f608759e4bebca",
4460
+ "result": "Ship v3",
4461
+ "activity": {
4462
+ "id": "673bffdc77ac5a0996dc537d",
4463
+ "task": {
4464
+ "id": "e1bb3fcad526680b6e7387e988fea1d9",
4465
+ "text": "Ship v3",
4466
+ "shortId": "T31UJ",
4467
+ "link": "https://app.workast.com/task/e1bb3fcad526680b6e7387e988fea1d9"
4468
+ }
4469
+ },
4470
+ "createdAt": "2024-11-19T03:02:56.261Z"
4471
+ }
4472
+ ],
4473
+ "totalRuns": 4
4474
+ };
4475
+ var workflows = {
4476
+ "workflows": [
4477
+ {
4478
+ "id": "673b14ef1231f8099d5c96a4",
4479
+ "trigger": {
4480
+ "name": "event",
4481
+ "value": "task_created"
4482
+ },
4483
+ "prompt": "Ship v3",
4484
+ "lists": [
4485
+ {
4486
+ "id": "673b0b7b1231f8099d5ba067",
4487
+ "type": "group",
4488
+ "status": "archived",
4489
+ "privacy": "team",
4490
+ "link": "https://app.workast.com/list/673b0b7b1231f8099d5ba067",
4491
+ "name": "Engineering"
4492
+ }
4493
+ ],
4494
+ "status": "active"
4495
+ }
4496
+ ],
4497
+ "total": 11
4498
+ };
4499
+
4500
+ // src/mock.ts
4501
+ var errors = {
4502
+ unauthorized: new AuthenticationError("Unauthorized"),
4503
+ forbidden: new PermissionError("Forbidden"),
4504
+ notFound: new NotFoundError("Not found"),
4505
+ validation: new ValidationError("Validation failed")
4506
+ };
4507
+ var ROOT_KEYS = /* @__PURE__ */ new Set(["calls", "pending", "reset", "restore"]);
4508
+ var active = null;
4509
+ var patches = [];
4510
+ function canonicalize(value) {
4511
+ if (Array.isArray(value)) {
4512
+ return value.map(canonicalize);
4513
+ }
4514
+ if (value !== null && typeof value === "object") {
4515
+ const result = {};
4516
+ for (const key of Object.keys(value).sort()) {
4517
+ result[key] = canonicalize(value[key]);
4518
+ }
4519
+ return result;
4520
+ }
4521
+ return value;
4522
+ }
4523
+ function valuesEqual(left, right) {
4524
+ return JSON.stringify(canonicalize(left)) === JSON.stringify(canonicalize(right));
4525
+ }
4526
+ function argsMatch(expected, actual) {
4527
+ if (expected.length === 1 && typeof expected[0] === "function") {
4528
+ return expected[0](...actual) === true;
4529
+ }
4530
+ if (expected.length > actual.length) {
4531
+ return false;
4532
+ }
4533
+ for (let i = 0; i < expected.length; i += 1) {
4534
+ const slot = expected[i];
4535
+ if (typeof slot === "function") {
4536
+ if (slot(actual[i]) !== true) {
4537
+ return false;
4538
+ }
4539
+ } else if (!valuesEqual(slot, actual[i])) {
4540
+ return false;
4541
+ }
4542
+ }
4543
+ return true;
4544
+ }
4545
+ function findInterceptor(session, method, actual) {
4546
+ return session.interceptors.find(
4547
+ (interceptor) => !interceptor.used && interceptor.method === method && argsMatch(interceptor.expectedArgs, actual)
4548
+ );
4549
+ }
4550
+ function pendingMethods(session) {
4551
+ return session.interceptors.filter((interceptor) => !interceptor.used).map((interceptor) => interceptor.method);
4552
+ }
4553
+ function wrapMethod(proto, key, method) {
4554
+ const record = proto;
4555
+ const original = record[key];
4556
+ if (typeof original !== "function") {
4557
+ return;
4558
+ }
4559
+ if (patches.some((patch) => patch.proto === record && patch.key === key)) {
4560
+ return;
4561
+ }
4562
+ record[key] = async function patched(...args) {
4563
+ if (!active) {
4564
+ return original.apply(this, args);
4565
+ }
4566
+ active.calls.push({ method, args });
4567
+ const interceptor = findInterceptor(active, method, args);
4568
+ if (!interceptor) {
4569
+ const pending = pendingMethods(active).join(", ") || "(none)";
4570
+ throw new Error(`No pending interceptor for ${method}. Pending: ${pending}`);
4571
+ }
4572
+ interceptor.used = true;
4573
+ if (interceptor.error) {
4574
+ throw interceptor.error;
4575
+ }
4576
+ return interceptor.value;
4577
+ };
4578
+ patches.push({ proto: record, key, original });
4579
+ }
4580
+ function isNestedResource(value) {
4581
+ if (value === null || typeof value !== "object") {
4582
+ return false;
4583
+ }
4584
+ const proto = Object.getPrototypeOf(value);
4585
+ return proto !== Object.prototype && proto !== null;
4586
+ }
4587
+ function walkResource(obj, path) {
4588
+ const proto = Object.getPrototypeOf(obj);
4589
+ if (proto && proto !== Object.prototype) {
4590
+ for (const key of Object.getOwnPropertyNames(proto)) {
4591
+ if (key === "constructor") {
4592
+ continue;
4593
+ }
4594
+ const descriptor = Object.getOwnPropertyDescriptor(proto, key);
4595
+ if (descriptor && typeof descriptor.value === "function") {
4596
+ wrapMethod(proto, key, [...path, key].join("."));
4597
+ }
4598
+ }
4599
+ }
4600
+ for (const key of Object.keys(obj)) {
4601
+ const value = obj[key];
4602
+ if (typeof value === "function" || value instanceof Workast) {
4603
+ continue;
4604
+ }
4605
+ if (isNestedResource(value)) {
4606
+ walkResource(value, [...path, key]);
4607
+ }
4608
+ }
4609
+ }
4610
+ function patchPrototypes() {
4611
+ if (patches.length > 0) {
4612
+ return;
4613
+ }
4614
+ const probe = new Workast({
4615
+ apiKey: "test-api-key",
4616
+ fetch: () => Promise.resolve(new Response(null, { status: 204 }))
4617
+ });
4618
+ for (const key of Object.keys(probe)) {
4619
+ const value = probe[key];
4620
+ if (typeof value === "function" || value instanceof Workast) {
4621
+ continue;
4622
+ }
4623
+ if (isNestedResource(value)) {
4624
+ walkResource(value, [key]);
4625
+ }
4626
+ }
4627
+ }
4628
+ function unpatchPrototypes() {
4629
+ for (const { proto, key, original } of patches) {
4630
+ proto[key] = original;
4631
+ }
4632
+ patches.length = 0;
4633
+ }
4634
+ function addInterceptor(session, method, expectedArgs, error, value) {
4635
+ const interceptor = {
4636
+ method,
4637
+ expectedArgs,
4638
+ used: false,
4639
+ error,
4640
+ value,
4641
+ wasCalled() {
4642
+ return interceptor.used;
4643
+ }
4644
+ };
4645
+ session.interceptors.push(interceptor);
4646
+ return interceptor;
4647
+ }
4648
+ function registrar(session, path) {
4649
+ const method = path.join(".");
4650
+ return {
4651
+ on(...expectedArgs) {
4652
+ return {
4653
+ resolves(value) {
4654
+ return addInterceptor(session, method, expectedArgs, void 0, value);
4655
+ },
4656
+ rejects(error) {
4657
+ return addInterceptor(session, method, expectedArgs, error, void 0);
4658
+ }
4659
+ };
4660
+ }
4661
+ };
4662
+ }
4663
+ function resourceTree(session, path) {
4664
+ return new Proxy(registrar(session, path), {
4665
+ get(target, prop) {
4666
+ if (prop === "on") {
4667
+ return target.on;
4668
+ }
4669
+ if (typeof prop !== "string") {
4670
+ return void 0;
4671
+ }
4672
+ return resourceTree(session, [...path, prop]);
4673
+ }
4674
+ });
4675
+ }
4676
+ function mockWorkast() {
4677
+ patchPrototypes();
4678
+ const session = {
4679
+ calls: [],
4680
+ interceptors: []
4681
+ };
4682
+ active = session;
4683
+ const api = {
4684
+ calls() {
4685
+ return session.calls;
4686
+ },
4687
+ pending() {
4688
+ return session.interceptors.filter((interceptor) => !interceptor.used);
4689
+ },
4690
+ reset() {
4691
+ for (const interceptor of session.interceptors) {
4692
+ interceptor.used = false;
4693
+ }
4694
+ session.interceptors.length = 0;
4695
+ session.calls.length = 0;
4696
+ },
4697
+ restore() {
4698
+ api.reset();
4699
+ unpatchPrototypes();
4700
+ active = null;
4701
+ }
4702
+ };
4703
+ return new Proxy(api, {
4704
+ get(target, prop) {
4705
+ if (typeof prop === "string" && ROOT_KEYS.has(prop)) {
4706
+ return target[prop];
4707
+ }
4708
+ if (typeof prop !== "string") {
4709
+ return void 0;
4710
+ }
4711
+ return resourceTree(session, [prop]);
4712
+ }
4713
+ });
4714
+ }
4715
+ // Annotate the CommonJS export names for ESM import in node:
4716
+ 0 && (module.exports = {
4717
+ errors,
4718
+ examples,
4719
+ mockWorkast
4720
+ });
4721
+ //# sourceMappingURL=mock.cjs.map