@doist/todoist-api-typescript 7.4.0 → 7.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/README.md +2 -0
  2. package/dist/cjs/authentication.js +50 -6
  3. package/dist/cjs/consts/endpoints.js +63 -1
  4. package/dist/cjs/test-utils/test-defaults.js +33 -1
  5. package/dist/cjs/todoist-api.js +1130 -168
  6. package/dist/cjs/{utils → transport}/fetch-with-retry.js +23 -71
  7. package/dist/cjs/{rest-client.js → transport/http-client.js} +5 -5
  8. package/dist/cjs/transport/http-dispatcher.js +72 -0
  9. package/dist/cjs/types/entities.js +124 -1
  10. package/dist/cjs/types/errors.js +9 -1
  11. package/dist/cjs/types/http.js +3 -1
  12. package/dist/cjs/types/requests.js +24 -0
  13. package/dist/cjs/types/sync/commands/shared.js +2 -8
  14. package/dist/cjs/types/sync/resources/reminders.js +2 -0
  15. package/dist/cjs/utils/multipart-upload.js +1 -1
  16. package/dist/cjs/utils/validators.js +19 -2
  17. package/dist/esm/authentication.js +47 -4
  18. package/dist/esm/consts/endpoints.js +52 -0
  19. package/dist/esm/test-utils/test-defaults.js +32 -0
  20. package/dist/esm/todoist-api.js +1061 -99
  21. package/dist/esm/{utils → transport}/fetch-with-retry.js +23 -38
  22. package/dist/esm/{rest-client.js → transport/http-client.js} +5 -5
  23. package/dist/esm/transport/http-dispatcher.js +35 -0
  24. package/dist/esm/types/entities.js +122 -0
  25. package/dist/esm/types/errors.js +7 -0
  26. package/dist/esm/types/http.js +3 -1
  27. package/dist/esm/types/requests.js +23 -1
  28. package/dist/esm/types/sync/commands/shared.js +1 -8
  29. package/dist/esm/types/sync/resources/reminders.js +2 -0
  30. package/dist/esm/utils/multipart-upload.js +1 -1
  31. package/dist/esm/utils/validators.js +19 -2
  32. package/dist/types/authentication.d.ts +51 -6
  33. package/dist/types/consts/endpoints.d.ts +31 -0
  34. package/dist/types/test-utils/test-defaults.d.ts +5 -1
  35. package/dist/types/todoist-api.d.ts +338 -6
  36. package/dist/types/{utils → transport}/fetch-with-retry.d.ts +1 -1
  37. package/dist/types/{rest-client.d.ts → transport/http-client.d.ts} +1 -1
  38. package/dist/types/transport/http-dispatcher.d.ts +3 -0
  39. package/dist/types/types/entities.d.ts +258 -14
  40. package/dist/types/types/errors.d.ts +4 -0
  41. package/dist/types/types/requests.d.ts +537 -43
  42. package/dist/types/types/sync/commands/projects.d.ts +2 -2
  43. package/dist/types/types/sync/commands/shared.d.ts +1 -4
  44. package/dist/types/types/sync/resources/reminders.d.ts +4 -0
  45. package/dist/types/types/sync/resources/user.d.ts +2 -2
  46. package/dist/types/types/sync/resources/view-options.d.ts +5 -5
  47. package/dist/types/types/sync/user-preferences.d.ts +1 -1
  48. package/dist/types/utils/validators.d.ts +202 -6
  49. package/package.json +4 -4
@@ -1,12 +1,13 @@
1
- import { Attachment, PersonalProject, WorkspaceProject, Label, Section, Comment, Task, CurrentUser, ProductivityStats, WorkspaceInvitation, WorkspacePlanDetails, JoinWorkspaceResult, Workspace } from './types/entities.js';
2
- import { AddCommentArgs, AddLabelArgs, AddProjectArgs, AddSectionArgs, AddTaskArgs, GetProjectCommentsArgs, GetTaskCommentsArgs, GetTasksArgs, GetTasksByFilterArgs, UpdateCommentArgs, UpdateLabelArgs, UpdateProjectArgs, UpdateSectionArgs, UpdateTaskArgs, QuickAddTaskArgs, GetSharedLabelsArgs, RenameSharedLabelArgs, RemoveSharedLabelArgs, GetProjectsArgs, SearchProjectsArgs, GetProjectCollaboratorsArgs, GetLabelsArgs, SearchLabelsArgs, GetLabelsResponse, GetTasksResponse, GetProjectsResponse, GetProjectCollaboratorsResponse, GetSectionsArgs, SearchSectionsArgs, GetSectionsResponse, GetSharedLabelsResponse, GetCommentsResponse, type MoveTaskArgs, GetCompletedTasksByCompletionDateArgs, GetCompletedTasksByDueDateArgs, GetCompletedTasksResponse, GetArchivedProjectsArgs, GetArchivedProjectsResponse, SearchCompletedTasksArgs, GetActivityLogsArgs, GetActivityLogsResponse, UploadFileArgs, DeleteUploadArgs, GetWorkspaceInvitationsArgs, DeleteWorkspaceInvitationArgs, WorkspaceInvitationActionArgs, JoinWorkspaceArgs, WorkspaceLogoArgs, GetWorkspacePlanDetailsArgs, GetWorkspaceUsersArgs, GetWorkspaceUsersResponse, GetWorkspaceProjectsArgs, WorkspaceInvitationsResponse, AllWorkspaceInvitationsResponse, WorkspaceLogoResponse, MoveProjectToWorkspaceArgs, MoveProjectToPersonalArgs } from './types/requests.js';
1
+ import { Attachment, PersonalProject, WorkspaceProject, Label, Section, Comment, Task, CurrentUser, ProductivityStats, WorkspaceInvitation, WorkspacePlanDetails, JoinWorkspaceResult, Workspace, Backup, IdMapping, MovedId, ProjectActivityStats, ProjectHealth, ProjectHealthContext, ProjectProgress, WorkspaceInsights } from './types/entities.js';
2
+ import { AddCommentArgs, AddLabelArgs, AddLocationReminderArgs, AddProjectArgs, AddReminderArgs, AddSectionArgs, AddTaskArgs, GetProjectCommentsArgs, GetTaskCommentsArgs, GetTasksArgs, GetTasksByFilterArgs, UpdateCommentArgs, UpdateLabelArgs, UpdateLocationReminderArgs, UpdateProjectArgs, UpdateReminderArgs, UpdateSectionArgs, UpdateTaskArgs, QuickAddTaskArgs, GetSharedLabelsArgs, RenameSharedLabelArgs, RemoveSharedLabelArgs, GetProjectsArgs, SearchProjectsArgs, GetProjectCollaboratorsArgs, GetLabelsArgs, SearchLabelsArgs, GetLabelsResponse, GetTasksResponse, GetProjectsResponse, GetProjectCollaboratorsResponse, GetSectionsArgs, SearchSectionsArgs, GetSectionsResponse, GetSharedLabelsResponse, GetCommentsResponse, type MoveTaskArgs, GetCompletedTasksByCompletionDateArgs, GetCompletedTasksByDueDateArgs, GetCompletedTasksResponse, GetArchivedProjectsArgs, GetArchivedProjectsResponse, SearchCompletedTasksArgs, GetActivityLogsArgs, GetActivityLogsResponse, UploadFileArgs, DeleteUploadArgs, GetWorkspaceInvitationsArgs, DeleteWorkspaceInvitationArgs, WorkspaceInvitationActionArgs, JoinWorkspaceArgs, WorkspaceLogoArgs, GetWorkspacePlanDetailsArgs, GetWorkspaceUsersArgs, GetWorkspaceUsersResponse, GetWorkspaceProjectsArgs, WorkspaceInvitationsResponse, AllWorkspaceInvitationsResponse, WorkspaceLogoResponse, MoveProjectToWorkspaceArgs, MoveProjectToPersonalArgs, GetArchivedProjectsCountArgs, GetArchivedProjectsCountResponse, GetProjectPermissionsResponse, GetFullProjectArgs, GetFullProjectResponse, AddWorkspaceArgs, UpdateWorkspaceArgs, GetWorkspaceMembersActivityArgs, GetWorkspaceMembersActivityResponse, GetWorkspaceUserTasksArgs, GetWorkspaceUserTasksResponse, InviteWorkspaceUsersArgs, InviteWorkspaceUsersResponse, UpdateWorkspaceUserArgs, RemoveWorkspaceUserArgs, GetProjectActivityStatsArgs, GetWorkspaceInsightsArgs, GetRemindersArgs, GetRemindersResponse, GetLocationRemindersArgs, GetLocationRemindersResponse, GetAllCompletedTasksArgs, GetAllCompletedTasksResponse, ExportTemplateFileArgs, ExportTemplateUrlArgs, ExportTemplateUrlResponse, CreateProjectFromTemplateArgs, CreateProjectFromTemplateResponse, ImportTemplateIntoProjectArgs, ImportTemplateFromIdArgs, ImportTemplateResponse, GetBackupsArgs, DownloadBackupArgs, GetOrCreateEmailArgs, GetOrCreateEmailResponse, DisableEmailArgs, GetIdMappingsArgs, GetMovedIdsArgs } from './types/requests.js';
3
3
  import { CustomFetch, CustomFetchResponse } from './types/http.js';
4
+ import type { Reminder } from './types/index.js';
4
5
  import { type SyncResponse, type SyncRequest } from './types/sync/index.js';
5
6
  /**
6
7
  * Response from viewAttachment, extending CustomFetchResponse with
7
8
  * arrayBuffer() support for binary file content.
8
9
  */
9
- export type ViewAttachmentResponse = CustomFetchResponse & {
10
+ export type FileResponse = CustomFetchResponse & {
10
11
  arrayBuffer(): Promise<ArrayBuffer>;
11
12
  };
12
13
  /**
@@ -118,6 +119,15 @@ export declare class TodoistApi {
118
119
  * @returns A promise that resolves to a paginated response of completed tasks.
119
120
  */
120
121
  searchCompletedTasks(args: SearchCompletedTasksArgs): Promise<GetCompletedTasksResponse>;
122
+ /**
123
+ * Retrieves all completed tasks with optional filters.
124
+ *
125
+ * Uses offset-based pagination rather than cursor-based.
126
+ *
127
+ * @param args - Optional parameters including project ID, label, date range, and pagination.
128
+ * @returns A promise that resolves to completed tasks with associated project and section data.
129
+ */
130
+ getAllCompletedTasks(args?: GetAllCompletedTasksArgs): Promise<GetAllCompletedTasksResponse>;
121
131
  /**
122
132
  * Creates a new task with the provided parameters.
123
133
  *
@@ -270,6 +280,35 @@ export declare class TodoistApi {
270
280
  * @returns A promise that resolves to the moved project.
271
281
  */
272
282
  moveProjectToPersonal(args: MoveProjectToPersonalArgs, requestId?: string): Promise<PersonalProject | WorkspaceProject>;
283
+ /**
284
+ * Counts the number of archived projects.
285
+ *
286
+ * @param args - Optional parameters to filter the count.
287
+ * @returns A promise that resolves to the count of archived projects.
288
+ */
289
+ getArchivedProjectsCount(args?: GetArchivedProjectsCountArgs): Promise<GetArchivedProjectsCountResponse>;
290
+ /**
291
+ * Retrieves the role-to-action permission mappings for projects.
292
+ *
293
+ * @returns A promise that resolves to the permission mappings.
294
+ */
295
+ getProjectPermissions(): Promise<GetProjectPermissionsResponse>;
296
+ /**
297
+ * Retrieves full project data including tasks, sections, collaborators, and notes.
298
+ *
299
+ * @param id - The unique identifier of the project.
300
+ * @param args - Optional parameters.
301
+ * @returns A promise that resolves to the full project data.
302
+ */
303
+ getFullProject(id: string, args?: GetFullProjectArgs): Promise<GetFullProjectResponse>;
304
+ /**
305
+ * Joins a shared project by its ID.
306
+ *
307
+ * @param id - The unique identifier of the project to join.
308
+ * @param requestId - Optional custom identifier for the request.
309
+ * @returns A promise that resolves to the joined project.
310
+ */
311
+ joinProject(id: string, requestId?: string): Promise<PersonalProject | WorkspaceProject>;
273
312
  /**
274
313
  * Retrieves a list of collaborators for a specific project.
275
314
  *
@@ -278,6 +317,51 @@ export declare class TodoistApi {
278
317
  * @returns A promise that resolves to an array of collaborators for the project.
279
318
  */
280
319
  getProjectCollaborators(projectId: string, args?: GetProjectCollaboratorsArgs): Promise<GetProjectCollaboratorsResponse>;
320
+ /**
321
+ * Retrieves activity statistics for a project.
322
+ *
323
+ * @param projectId - The unique identifier of the project.
324
+ * @param args - Optional parameters including weeks and weekly counts flag.
325
+ * @returns A promise that resolves to the project activity stats.
326
+ */
327
+ getProjectActivityStats(projectId: string, args?: GetProjectActivityStatsArgs): Promise<ProjectActivityStats>;
328
+ /**
329
+ * Retrieves the health status of a project.
330
+ *
331
+ * @param projectId - The unique identifier of the project.
332
+ * @returns A promise that resolves to the project health data.
333
+ */
334
+ getProjectHealth(projectId: string): Promise<ProjectHealth>;
335
+ /**
336
+ * Retrieves the health context for a project, including metrics and task details.
337
+ *
338
+ * @param projectId - The unique identifier of the project.
339
+ * @returns A promise that resolves to the project health context.
340
+ */
341
+ getProjectHealthContext(projectId: string): Promise<ProjectHealthContext>;
342
+ /**
343
+ * Retrieves progress information for a project.
344
+ *
345
+ * @param projectId - The unique identifier of the project.
346
+ * @returns A promise that resolves to the project progress data.
347
+ */
348
+ getProjectProgress(projectId: string): Promise<ProjectProgress>;
349
+ /**
350
+ * Retrieves insights for all projects in a workspace.
351
+ *
352
+ * @param workspaceId - The unique identifier of the workspace.
353
+ * @param args - Optional parameters including project IDs filter.
354
+ * @returns A promise that resolves to workspace insights data.
355
+ */
356
+ getWorkspaceInsights(workspaceId: string, args?: GetWorkspaceInsightsArgs): Promise<WorkspaceInsights>;
357
+ /**
358
+ * Triggers a health analysis for a project.
359
+ *
360
+ * @param projectId - The unique identifier of the project.
361
+ * @param requestId - Optional custom identifier for the request.
362
+ * @returns A promise that resolves to the updated project health data.
363
+ */
364
+ analyzeProjectHealth(projectId: string, requestId?: string): Promise<ProjectHealth>;
281
365
  /**
282
366
  * Retrieves all sections within a specific project or matching criteria.
283
367
  *
@@ -325,6 +409,22 @@ export declare class TodoistApi {
325
409
  * @returns A promise that resolves to `true` if successful.
326
410
  */
327
411
  deleteSection(id: string, requestId?: string): Promise<boolean>;
412
+ /**
413
+ * Archives a section by its ID.
414
+ *
415
+ * @param id - The unique identifier of the section to archive.
416
+ * @param requestId - Optional custom identifier for the request.
417
+ * @returns A promise that resolves to the updated section.
418
+ */
419
+ archiveSection(id: string, requestId?: string): Promise<Section>;
420
+ /**
421
+ * Unarchives a section by its ID.
422
+ *
423
+ * @param id - The unique identifier of the section to unarchive.
424
+ * @param requestId - Optional custom identifier for the request.
425
+ * @returns A promise that resolves to the updated section.
426
+ */
427
+ unarchiveSection(id: string, requestId?: string): Promise<Section>;
328
428
  /**
329
429
  * Retrieves a label by its ID.
330
430
  *
@@ -431,6 +531,84 @@ export declare class TodoistApi {
431
531
  * @returns A promise that resolves to `true` if successful.
432
532
  */
433
533
  deleteComment(id: string, requestId?: string): Promise<boolean>;
534
+ /**
535
+ * Retrieves a paginated list of time-based reminders.
536
+ *
537
+ * @param args - Optional parameters including task ID filter and pagination.
538
+ * @returns A promise that resolves to a paginated list of reminders.
539
+ */
540
+ getReminders(args?: GetRemindersArgs): Promise<GetRemindersResponse>;
541
+ /**
542
+ * Retrieves a paginated list of location-based reminders.
543
+ *
544
+ * @param args - Optional parameters including task ID filter and pagination.
545
+ * @returns A promise that resolves to a paginated list of location reminders.
546
+ */
547
+ getLocationReminders(args?: GetLocationRemindersArgs): Promise<GetLocationRemindersResponse>;
548
+ /**
549
+ * Retrieves a time-based reminder by its ID.
550
+ *
551
+ * @param id - The unique identifier of the reminder to retrieve.
552
+ * @returns A promise that resolves to the requested reminder.
553
+ */
554
+ getReminder(id: string): Promise<Reminder>;
555
+ /**
556
+ * Retrieves a location reminder by its ID.
557
+ *
558
+ * @param id - The unique identifier of the location reminder to retrieve.
559
+ * @returns A promise that resolves to the requested reminder.
560
+ */
561
+ getLocationReminder(id: string): Promise<Reminder>;
562
+ /**
563
+ * Creates a time-based reminder for a task.
564
+ *
565
+ * @param args - Reminder creation parameters for relative or absolute reminders.
566
+ * @param requestId - Optional custom identifier for the request.
567
+ * @returns A promise that resolves to the created reminder.
568
+ */
569
+ addReminder(args: AddReminderArgs, requestId?: string): Promise<Reminder>;
570
+ /**
571
+ * Creates a location reminder for a task.
572
+ *
573
+ * @param args - Location reminder creation parameters.
574
+ * @param requestId - Optional custom identifier for the request.
575
+ * @returns A promise that resolves to the created reminder.
576
+ */
577
+ addLocationReminder(args: AddLocationReminderArgs, requestId?: string): Promise<Reminder>;
578
+ /**
579
+ * Updates an existing time-based reminder.
580
+ *
581
+ * @param id - The unique identifier of the reminder to update.
582
+ * @param args - Reminder update parameters.
583
+ * @param requestId - Optional custom identifier for the request.
584
+ * @returns A promise that resolves to the updated reminder.
585
+ */
586
+ updateReminder(id: string, args: UpdateReminderArgs, requestId?: string): Promise<Reminder>;
587
+ /**
588
+ * Updates an existing location reminder.
589
+ *
590
+ * @param id - The unique identifier of the location reminder to update.
591
+ * @param args - Location reminder update parameters.
592
+ * @param requestId - Optional custom identifier for the request.
593
+ * @returns A promise that resolves to the updated reminder.
594
+ */
595
+ updateLocationReminder(id: string, args: UpdateLocationReminderArgs, requestId?: string): Promise<Reminder>;
596
+ /**
597
+ * Deletes a time-based reminder by its ID.
598
+ *
599
+ * @param id - The unique identifier of the reminder to delete.
600
+ * @param requestId - Optional custom identifier for the request.
601
+ * @returns A promise that resolves to `true` if successful.
602
+ */
603
+ deleteReminder(id: string, requestId?: string): Promise<boolean>;
604
+ /**
605
+ * Deletes a location reminder by its ID.
606
+ *
607
+ * @param id - The unique identifier of the location reminder to delete.
608
+ * @param requestId - Optional custom identifier for the request.
609
+ * @returns A promise that resolves to `true` if successful.
610
+ */
611
+ deleteLocationReminder(id: string, requestId?: string): Promise<boolean>;
434
612
  /**
435
613
  * Retrieves productivity stats for the authenticated user.
436
614
  *
@@ -521,7 +699,90 @@ export declare class TodoistApi {
521
699
  * const text = await response.text()
522
700
  * ```
523
701
  */
524
- viewAttachment(commentOrUrl: Comment | string): Promise<ViewAttachmentResponse>;
702
+ viewAttachment(commentOrUrl: Comment | string): Promise<FileResponse>;
703
+ /**
704
+ * Retrieves a list of available backups.
705
+ *
706
+ * @param args - Optional parameters including MFA token.
707
+ * @returns A promise that resolves to an array of backups.
708
+ */
709
+ getBackups(args?: GetBackupsArgs): Promise<Backup[]>;
710
+ /**
711
+ * Downloads a backup file as binary data.
712
+ *
713
+ * @param args - Arguments including the backup file URL (from getBackups).
714
+ * @returns A promise that resolves to a response with binary data accessible via arrayBuffer().
715
+ */
716
+ downloadBackup(args: DownloadBackupArgs): Promise<FileResponse>;
717
+ /**
718
+ * Gets or creates an email forwarding address for an object.
719
+ *
720
+ * @param args - Arguments including object type and ID.
721
+ * @param requestId - Optional custom identifier for the request.
722
+ * @returns A promise that resolves to the email address.
723
+ */
724
+ getOrCreateEmailForwarding(args: GetOrCreateEmailArgs, requestId?: string): Promise<GetOrCreateEmailResponse>;
725
+ /**
726
+ * Disables email forwarding for an object.
727
+ *
728
+ * @param args - Arguments including object type and ID.
729
+ * @param requestId - Optional custom identifier for the request.
730
+ * @returns A promise that resolves to `true` if successful.
731
+ */
732
+ disableEmailForwarding(args: DisableEmailArgs, requestId?: string): Promise<boolean>;
733
+ /**
734
+ * Retrieves ID mappings between old and new IDs.
735
+ *
736
+ * @param args - Arguments including object type and IDs to look up.
737
+ * @returns A promise that resolves to an array of ID mappings.
738
+ */
739
+ getIdMappings(args: GetIdMappingsArgs): Promise<IdMapping[]>;
740
+ /**
741
+ * Retrieves moved IDs for objects that have been migrated.
742
+ *
743
+ * @param args - Arguments including object type and optional old IDs to look up.
744
+ * @returns A promise that resolves to an array of moved ID pairs.
745
+ */
746
+ getMovedIds(args: GetMovedIdsArgs): Promise<MovedId[]>;
747
+ /**
748
+ * Exports a project as a template file (CSV format).
749
+ *
750
+ * @param args - Arguments including project ID and optional date format preference.
751
+ * @returns A promise that resolves to the template file content as a string.
752
+ */
753
+ exportTemplateAsFile(args: ExportTemplateFileArgs): Promise<string>;
754
+ /**
755
+ * Exports a project as a template URL.
756
+ *
757
+ * @param args - Arguments including project ID and optional date format preference.
758
+ * @returns A promise that resolves to the file name and URL.
759
+ */
760
+ exportTemplateAsUrl(args: ExportTemplateUrlArgs): Promise<ExportTemplateUrlResponse>;
761
+ /**
762
+ * Creates a new project from a template file.
763
+ *
764
+ * @param args - Arguments including project name, template file, and optional workspace ID.
765
+ * @param requestId - Optional custom identifier for the request.
766
+ * @returns A promise that resolves to the created project data.
767
+ */
768
+ createProjectFromTemplate(args: CreateProjectFromTemplateArgs, requestId?: string): Promise<CreateProjectFromTemplateResponse>;
769
+ /**
770
+ * Imports a template file into an existing project.
771
+ *
772
+ * @param args - Arguments including project ID and template file.
773
+ * @param requestId - Optional custom identifier for the request.
774
+ * @returns A promise that resolves to the import result.
775
+ */
776
+ importTemplateIntoProject(args: ImportTemplateIntoProjectArgs, requestId?: string): Promise<ImportTemplateResponse>;
777
+ /**
778
+ * Imports a template by ID into an existing project.
779
+ *
780
+ * @param args - Arguments including project ID, template ID, and optional locale.
781
+ * @param requestId - Optional custom identifier for the request.
782
+ * @returns A promise that resolves to the import result.
783
+ */
784
+ importTemplateFromId(args: ImportTemplateFromIdArgs, requestId?: string): Promise<ImportTemplateResponse>;
785
+ private validateTemplateResponse;
525
786
  /**
526
787
  * Gets pending invitations for a workspace.
527
788
  *
@@ -598,8 +859,6 @@ export declare class TodoistApi {
598
859
  /**
599
860
  * Retrieves all workspaces for the authenticated user.
600
861
  *
601
- * Uses the Sync API internally to fetch workspace data.
602
- *
603
862
  * @param requestId - Optional custom identifier for the request.
604
863
  * @returns A promise that resolves to an array of workspaces.
605
864
  *
@@ -612,6 +871,79 @@ export declare class TodoistApi {
612
871
  * ```
613
872
  */
614
873
  getWorkspaces(requestId?: string): Promise<Workspace[]>;
874
+ /**
875
+ * Retrieves a workspace by its ID.
876
+ *
877
+ * @param id - The unique identifier of the workspace.
878
+ * @param requestId - Optional custom identifier for the request.
879
+ * @returns A promise that resolves to the requested workspace.
880
+ */
881
+ getWorkspace(id: string, requestId?: string): Promise<Workspace>;
882
+ /**
883
+ * Creates a new workspace.
884
+ *
885
+ * @param args - The arguments for creating the workspace.
886
+ * @param requestId - Optional custom identifier for the request.
887
+ * @returns A promise that resolves to the created workspace.
888
+ */
889
+ addWorkspace(args: AddWorkspaceArgs, requestId?: string): Promise<Workspace>;
890
+ /**
891
+ * Updates an existing workspace.
892
+ *
893
+ * @param id - The unique identifier of the workspace to update.
894
+ * @param args - The arguments for updating the workspace.
895
+ * @param requestId - Optional custom identifier for the request.
896
+ * @returns A promise that resolves to the updated workspace.
897
+ */
898
+ updateWorkspace(id: string, args: UpdateWorkspaceArgs, requestId?: string): Promise<Workspace>;
899
+ /**
900
+ * Deletes a workspace by its ID.
901
+ *
902
+ * @param id - The unique identifier of the workspace to delete.
903
+ * @param requestId - Optional custom identifier for the request.
904
+ * @returns A promise that resolves to `true` if successful.
905
+ */
906
+ deleteWorkspace(id: string, requestId?: string): Promise<boolean>;
907
+ /**
908
+ * Retrieves activity information for workspace members.
909
+ *
910
+ * @param args - Arguments including workspace ID and optional user/project filters.
911
+ * @param requestId - Optional custom identifier for the request.
912
+ * @returns A promise that resolves to workspace members activity data.
913
+ */
914
+ getWorkspaceMembersActivity(args: GetWorkspaceMembersActivityArgs, requestId?: string): Promise<GetWorkspaceMembersActivityResponse>;
915
+ /**
916
+ * Retrieves tasks assigned to a specific user in a workspace.
917
+ *
918
+ * @param args - Arguments including workspace ID, user ID, and optional project filter.
919
+ * @param requestId - Optional custom identifier for the request.
920
+ * @returns A promise that resolves to workspace user tasks.
921
+ */
922
+ getWorkspaceUserTasks(args: GetWorkspaceUserTasksArgs, requestId?: string): Promise<GetWorkspaceUserTasksResponse>;
923
+ /**
924
+ * Invites users to a workspace by email.
925
+ *
926
+ * @param args - Arguments including workspace ID, email list, and optional role.
927
+ * @param requestId - Optional custom identifier for the request.
928
+ * @returns A promise that resolves to the list of invited emails.
929
+ */
930
+ inviteWorkspaceUsers(args: InviteWorkspaceUsersArgs, requestId?: string): Promise<InviteWorkspaceUsersResponse>;
931
+ /**
932
+ * Updates a workspace user's role.
933
+ *
934
+ * @param args - Arguments including workspace ID, user ID, and new role.
935
+ * @param requestId - Optional custom identifier for the request.
936
+ * @returns A promise that resolves to the updated workspace user view.
937
+ */
938
+ updateWorkspaceUser(args: UpdateWorkspaceUserArgs, requestId?: string): Promise<JoinWorkspaceResult>;
939
+ /**
940
+ * Removes a user from a workspace.
941
+ *
942
+ * @param args - Arguments including workspace ID and user ID.
943
+ * @param requestId - Optional custom identifier for the request.
944
+ * @returns A promise that resolves to `true` if successful.
945
+ */
946
+ removeWorkspaceUser(args: RemoveWorkspaceUserArgs, requestId?: string): Promise<boolean>;
615
947
  /**
616
948
  * Gets active projects in a workspace with pagination.
617
949
  *
@@ -1,4 +1,4 @@
1
- import type { HttpResponse, RetryConfig, CustomFetch } from '../types/http.js';
1
+ import type { CustomFetch, HttpResponse, RetryConfig } from '../types/http.js';
2
2
  /**
3
3
  * Performs a fetch request with retry logic and timeout support
4
4
  */
@@ -1,4 +1,4 @@
1
- import { HttpMethod, HttpResponse, CustomFetch } from './types/http.js';
1
+ import type { CustomFetch, HttpMethod, HttpResponse } from '../types/http.js';
2
2
  type RequestArgs = {
3
3
  httpMethod: HttpMethod;
4
4
  baseUri: string;
@@ -0,0 +1,3 @@
1
+ import type { Dispatcher } from 'undici';
2
+ export declare function getDefaultDispatcher(): Promise<Dispatcher | undefined>;
3
+ export declare function resetDefaultDispatcherForTests(): Promise<void>;