@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.
- package/README.md +2 -0
- package/dist/cjs/authentication.js +50 -6
- package/dist/cjs/consts/endpoints.js +63 -1
- package/dist/cjs/test-utils/test-defaults.js +33 -1
- package/dist/cjs/todoist-api.js +1130 -168
- package/dist/cjs/{utils → transport}/fetch-with-retry.js +23 -71
- package/dist/cjs/{rest-client.js → transport/http-client.js} +5 -5
- package/dist/cjs/transport/http-dispatcher.js +72 -0
- package/dist/cjs/types/entities.js +124 -1
- package/dist/cjs/types/errors.js +9 -1
- package/dist/cjs/types/http.js +3 -1
- package/dist/cjs/types/requests.js +24 -0
- package/dist/cjs/types/sync/commands/shared.js +2 -8
- package/dist/cjs/types/sync/resources/reminders.js +2 -0
- package/dist/cjs/utils/multipart-upload.js +1 -1
- package/dist/cjs/utils/validators.js +19 -2
- package/dist/esm/authentication.js +47 -4
- package/dist/esm/consts/endpoints.js +52 -0
- package/dist/esm/test-utils/test-defaults.js +32 -0
- package/dist/esm/todoist-api.js +1061 -99
- package/dist/esm/{utils → transport}/fetch-with-retry.js +23 -38
- package/dist/esm/{rest-client.js → transport/http-client.js} +5 -5
- package/dist/esm/transport/http-dispatcher.js +35 -0
- package/dist/esm/types/entities.js +122 -0
- package/dist/esm/types/errors.js +7 -0
- package/dist/esm/types/http.js +3 -1
- package/dist/esm/types/requests.js +23 -1
- package/dist/esm/types/sync/commands/shared.js +1 -8
- package/dist/esm/types/sync/resources/reminders.js +2 -0
- package/dist/esm/utils/multipart-upload.js +1 -1
- package/dist/esm/utils/validators.js +19 -2
- package/dist/types/authentication.d.ts +51 -6
- package/dist/types/consts/endpoints.d.ts +31 -0
- package/dist/types/test-utils/test-defaults.d.ts +5 -1
- package/dist/types/todoist-api.d.ts +338 -6
- package/dist/types/{utils → transport}/fetch-with-retry.d.ts +1 -1
- package/dist/types/{rest-client.d.ts → transport/http-client.d.ts} +1 -1
- package/dist/types/transport/http-dispatcher.d.ts +3 -0
- package/dist/types/types/entities.d.ts +258 -14
- package/dist/types/types/errors.d.ts +4 -0
- package/dist/types/types/requests.d.ts +537 -43
- package/dist/types/types/sync/commands/projects.d.ts +2 -2
- package/dist/types/types/sync/commands/shared.d.ts +1 -4
- package/dist/types/types/sync/resources/reminders.d.ts +4 -0
- package/dist/types/types/sync/resources/user.d.ts +2 -2
- package/dist/types/types/sync/resources/view-options.d.ts +5 -5
- package/dist/types/types/sync/user-preferences.d.ts +1 -1
- package/dist/types/utils/validators.d.ts +202 -6
- package/package.json +4 -4
|
@@ -25,6 +25,8 @@ export const ENDPOINT_REST_LABELS_SHARED = ENDPOINT_REST_LABELS + '/shared';
|
|
|
25
25
|
export const ENDPOINT_REST_LABELS_SHARED_RENAME = ENDPOINT_REST_LABELS_SHARED + '/rename';
|
|
26
26
|
export const ENDPOINT_REST_LABELS_SHARED_REMOVE = ENDPOINT_REST_LABELS_SHARED + '/remove';
|
|
27
27
|
export const ENDPOINT_REST_COMMENTS = 'comments';
|
|
28
|
+
export const ENDPOINT_REST_REMINDERS = 'reminders';
|
|
29
|
+
export const ENDPOINT_REST_LOCATION_REMINDERS = 'location_reminders';
|
|
28
30
|
export const ENDPOINT_REST_TASK_CLOSE = 'close';
|
|
29
31
|
export const ENDPOINT_REST_TASK_REOPEN = 'reopen';
|
|
30
32
|
export const ENDPOINT_REST_TASK_MOVE = 'move';
|
|
@@ -38,14 +40,33 @@ export const ENDPOINT_REST_ACTIVITIES = 'activities';
|
|
|
38
40
|
export const ENDPOINT_REST_UPLOADS = 'uploads';
|
|
39
41
|
export const PROJECT_ARCHIVE = 'archive';
|
|
40
42
|
export const PROJECT_UNARCHIVE = 'unarchive';
|
|
43
|
+
export const ENDPOINT_REST_PROJECTS_ARCHIVED_COUNT = ENDPOINT_REST_PROJECTS + '/archived/count';
|
|
44
|
+
export const ENDPOINT_REST_PROJECTS_PERMISSIONS = ENDPOINT_REST_PROJECTS + '/permissions';
|
|
45
|
+
export const ENDPOINT_REST_PROJECT_FULL = 'full';
|
|
46
|
+
export const ENDPOINT_REST_PROJECT_JOIN = 'join';
|
|
47
|
+
export const SECTION_ARCHIVE = 'archive';
|
|
48
|
+
export const SECTION_UNARCHIVE = 'unarchive';
|
|
41
49
|
export const ENDPOINT_REST_PROJECTS_MOVE_TO_WORKSPACE = ENDPOINT_REST_PROJECTS + '/move_to_workspace';
|
|
42
50
|
export const ENDPOINT_REST_PROJECTS_MOVE_TO_PERSONAL = ENDPOINT_REST_PROJECTS + '/move_to_personal';
|
|
51
|
+
export const ENDPOINT_REST_TASKS_COMPLETED = ENDPOINT_REST_TASKS + '/completed';
|
|
52
|
+
export const ENDPOINT_REST_TEMPLATES_FILE = 'templates/file';
|
|
53
|
+
export const ENDPOINT_REST_TEMPLATES_URL = 'templates/url';
|
|
54
|
+
export const ENDPOINT_REST_TEMPLATES_CREATE_FROM_FILE = 'templates/create_project_from_file';
|
|
55
|
+
export const ENDPOINT_REST_TEMPLATES_IMPORT_FROM_FILE = 'templates/import_into_project_from_file';
|
|
56
|
+
export const ENDPOINT_REST_TEMPLATES_IMPORT_FROM_ID = 'templates/import_into_project_from_template_id';
|
|
57
|
+
export const ENDPOINT_REST_ACCESS_TOKENS_MIGRATE = 'access_tokens/migrate_personal_token';
|
|
58
|
+
export const ENDPOINT_REST_BACKUPS = 'backups';
|
|
59
|
+
export const ENDPOINT_REST_BACKUPS_DOWNLOAD = 'backups/download';
|
|
60
|
+
export const ENDPOINT_REST_EMAILS = 'emails';
|
|
61
|
+
export const ENDPOINT_REST_ID_MAPPINGS = 'id_mappings';
|
|
62
|
+
export const ENDPOINT_REST_MOVED_IDS = 'moved_ids';
|
|
43
63
|
export const ENDPOINT_SYNC_QUICK_ADD = ENDPOINT_REST_TASKS + '/quick';
|
|
44
64
|
export const ENDPOINT_SYNC = 'sync';
|
|
45
65
|
export const ENDPOINT_AUTHORIZATION = 'authorize';
|
|
46
66
|
export const ENDPOINT_GET_TOKEN = 'access_token';
|
|
47
67
|
export const ENDPOINT_REVOKE = 'revoke';
|
|
48
68
|
// Workspace endpoints
|
|
69
|
+
export const ENDPOINT_REST_WORKSPACES = 'workspaces';
|
|
49
70
|
export const ENDPOINT_WORKSPACE_INVITATIONS = 'workspaces/invitations';
|
|
50
71
|
export const ENDPOINT_WORKSPACE_INVITATIONS_ALL = 'workspaces/invitations/all';
|
|
51
72
|
export const ENDPOINT_WORKSPACE_INVITATIONS_DELETE = 'workspaces/invitations/delete';
|
|
@@ -60,6 +81,37 @@ export function getWorkspaceInvitationAcceptEndpoint(inviteCode) {
|
|
|
60
81
|
export function getWorkspaceInvitationRejectEndpoint(inviteCode) {
|
|
61
82
|
return `workspaces/invitations/${inviteCode}/reject`;
|
|
62
83
|
}
|
|
84
|
+
// Insights endpoints
|
|
85
|
+
export function getProjectInsightsActivityStatsEndpoint(projectId) {
|
|
86
|
+
return `projects/${projectId}/insights/activity_stats`;
|
|
87
|
+
}
|
|
88
|
+
export function getProjectInsightsHealthEndpoint(projectId) {
|
|
89
|
+
return `projects/${projectId}/insights/health`;
|
|
90
|
+
}
|
|
91
|
+
export function getProjectInsightsHealthContextEndpoint(projectId) {
|
|
92
|
+
return `projects/${projectId}/insights/health/context`;
|
|
93
|
+
}
|
|
94
|
+
export function getProjectInsightsProgressEndpoint(projectId) {
|
|
95
|
+
return `projects/${projectId}/insights/progress`;
|
|
96
|
+
}
|
|
97
|
+
export function getProjectInsightsHealthAnalyzeEndpoint(projectId) {
|
|
98
|
+
return `projects/${projectId}/insights/health/analyze`;
|
|
99
|
+
}
|
|
100
|
+
export function getWorkspaceInsightsEndpoint(workspaceId) {
|
|
101
|
+
return `workspaces/${workspaceId}/insights`;
|
|
102
|
+
}
|
|
103
|
+
// Workspace members
|
|
104
|
+
export const ENDPOINT_WORKSPACE_MEMBERS = 'workspaces/members';
|
|
105
|
+
// Workspace user management (require workspace_id and/or user_id parameters)
|
|
106
|
+
export function getWorkspaceUserTasksEndpoint(workspaceId, userId) {
|
|
107
|
+
return `workspaces/${workspaceId}/users/${userId}/tasks`;
|
|
108
|
+
}
|
|
109
|
+
export function getWorkspaceInviteUsersEndpoint(workspaceId) {
|
|
110
|
+
return `workspaces/${workspaceId}/users/invite`;
|
|
111
|
+
}
|
|
112
|
+
export function getWorkspaceUserEndpoint(workspaceId, userId) {
|
|
113
|
+
return `workspaces/${workspaceId}/users/${userId}`;
|
|
114
|
+
}
|
|
63
115
|
// Workspace projects (require workspace_id parameter)
|
|
64
116
|
export function getWorkspaceActiveProjectsEndpoint(workspaceId) {
|
|
65
117
|
return `workspaces/${workspaceId}/projects/active`;
|
|
@@ -176,6 +176,38 @@ export const DEFAULT_RAW_COMMENT = {
|
|
|
176
176
|
itemId: DEFAULT_TASK_ID,
|
|
177
177
|
};
|
|
178
178
|
export const DEFAULT_COMMENT = Object.assign(Object.assign({}, DEFAULT_RAW_COMMENT), { taskId: DEFAULT_RAW_COMMENT.itemId, itemId: undefined });
|
|
179
|
+
export const DEFAULT_REMINDER_ID = '6XGgmFQrx44wfGHr';
|
|
180
|
+
export const DEFAULT_RELATIVE_REMINDER = {
|
|
181
|
+
id: DEFAULT_REMINDER_ID,
|
|
182
|
+
itemId: DEFAULT_TASK_ID,
|
|
183
|
+
notifyUid: DEFAULT_USER_ID,
|
|
184
|
+
isDeleted: false,
|
|
185
|
+
type: 'relative',
|
|
186
|
+
minuteOffset: 30,
|
|
187
|
+
due: DEFAULT_DUE_DATE,
|
|
188
|
+
isUrgent: false,
|
|
189
|
+
};
|
|
190
|
+
export const DEFAULT_ABSOLUTE_REMINDER = {
|
|
191
|
+
id: DEFAULT_REMINDER_ID,
|
|
192
|
+
itemId: DEFAULT_TASK_ID,
|
|
193
|
+
notifyUid: DEFAULT_USER_ID,
|
|
194
|
+
isDeleted: false,
|
|
195
|
+
type: 'absolute',
|
|
196
|
+
due: DEFAULT_DUE_DATE,
|
|
197
|
+
isUrgent: true,
|
|
198
|
+
};
|
|
199
|
+
export const DEFAULT_LOCATION_REMINDER = {
|
|
200
|
+
id: DEFAULT_REMINDER_ID,
|
|
201
|
+
itemId: DEFAULT_TASK_ID,
|
|
202
|
+
notifyUid: DEFAULT_USER_ID,
|
|
203
|
+
isDeleted: false,
|
|
204
|
+
type: 'location',
|
|
205
|
+
name: 'Aliados',
|
|
206
|
+
locLat: '41.148581',
|
|
207
|
+
locLong: '-8.610945000000015',
|
|
208
|
+
locTrigger: 'on_enter',
|
|
209
|
+
radius: 100,
|
|
210
|
+
};
|
|
179
211
|
export const INVALID_COMMENT = Object.assign(Object.assign({}, DEFAULT_RAW_COMMENT), { isDeleted: 'true' });
|
|
180
212
|
export const RAW_COMMENT_WITH_OPTIONALS_AS_NULL_TASK = Object.assign(Object.assign({}, DEFAULT_RAW_COMMENT), { fileAttachment: null, uidsToNotify: null, reactions: null });
|
|
181
213
|
export const COMMENT_WITH_OPTIONALS_AS_NULL_TASK = Object.assign(Object.assign({}, RAW_COMMENT_WITH_OPTIONALS_AS_NULL_TASK), { taskId: RAW_COMMENT_WITH_OPTIONALS_AS_NULL_TASK.itemId, itemId: undefined });
|