@doist/todoist-api-typescript 7.5.0 → 7.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/authentication.js +46 -2
- package/dist/cjs/consts/endpoints.js +54 -2
- package/dist/cjs/todoist-api.js +524 -6
- package/dist/cjs/types/activity/index.js +18 -0
- package/dist/cjs/types/activity/requests.js +2 -0
- package/dist/cjs/types/activity/types.js +28 -0
- package/dist/cjs/types/backups/index.js +18 -0
- package/dist/cjs/types/backups/requests.js +2 -0
- package/dist/cjs/types/backups/types.js +8 -0
- package/dist/cjs/types/comments/index.js +18 -0
- package/dist/cjs/types/comments/requests.js +2 -0
- package/dist/cjs/types/comments/types.js +60 -0
- package/dist/cjs/types/common.js +2 -0
- package/dist/cjs/types/emails/index.js +17 -0
- package/dist/cjs/types/emails/requests.js +5 -0
- package/dist/cjs/types/id-mappings/index.js +18 -0
- package/dist/cjs/types/id-mappings/requests.js +20 -0
- package/dist/cjs/types/id-mappings/types.js +12 -0
- package/dist/cjs/types/index.js +16 -2
- package/dist/cjs/types/insights/index.js +18 -0
- package/dist/cjs/types/insights/requests.js +2 -0
- package/dist/cjs/types/insights/types.js +84 -0
- package/dist/cjs/types/labels/index.js +18 -0
- package/dist/cjs/types/labels/requests.js +2 -0
- package/dist/cjs/types/labels/types.js +11 -0
- package/dist/cjs/types/productivity/index.js +17 -0
- package/dist/cjs/types/productivity/types.js +67 -0
- package/dist/cjs/types/projects/index.js +18 -0
- package/dist/cjs/types/projects/requests.js +2 -0
- package/dist/cjs/types/projects/types.js +56 -0
- package/dist/cjs/types/reminders/index.js +17 -0
- package/dist/cjs/types/sections/index.js +18 -0
- package/dist/cjs/types/sections/requests.js +2 -0
- package/dist/cjs/types/sections/types.js +22 -0
- package/dist/cjs/types/sync/commands/shared.js +2 -2
- package/dist/cjs/types/sync/resources/collaborators.js +2 -2
- package/dist/cjs/types/sync/resources/notes.js +2 -2
- package/dist/cjs/types/sync/resources/reminders.js +3 -3
- package/dist/cjs/types/sync/resources/user.js +2 -2
- package/dist/cjs/types/sync/resources/workspaces.js +5 -5
- package/dist/cjs/types/tasks/index.js +18 -0
- package/dist/cjs/types/tasks/requests.js +2 -0
- package/dist/cjs/types/tasks/types.js +59 -0
- package/dist/cjs/types/templates/index.js +17 -0
- package/dist/cjs/types/templates/requests.js +2 -0
- package/dist/cjs/types/uploads/index.js +17 -0
- package/dist/cjs/types/uploads/requests.js +2 -0
- package/dist/cjs/types/users/index.js +17 -0
- package/dist/cjs/types/users/types.js +51 -0
- package/dist/cjs/types/workspaces/index.js +18 -0
- package/dist/cjs/types/workspaces/requests.js +2 -0
- package/dist/cjs/types/workspaces/types.js +137 -0
- package/dist/cjs/utils/validators.js +47 -19
- package/dist/esm/authentication.js +46 -3
- package/dist/esm/consts/endpoints.js +43 -0
- package/dist/esm/todoist-api.js +522 -4
- package/dist/esm/types/activity/index.js +2 -0
- package/dist/esm/types/activity/requests.js +1 -0
- package/dist/esm/types/activity/types.js +25 -0
- package/dist/esm/types/backups/index.js +2 -0
- package/dist/esm/types/backups/requests.js +1 -0
- package/dist/esm/types/backups/types.js +5 -0
- package/dist/esm/types/comments/index.js +2 -0
- package/dist/esm/types/comments/requests.js +1 -0
- package/dist/esm/types/comments/types.js +57 -0
- package/dist/esm/types/common.js +1 -0
- package/dist/esm/types/emails/index.js +1 -0
- package/dist/esm/types/emails/requests.js +2 -0
- package/dist/esm/types/id-mappings/index.js +2 -0
- package/dist/esm/types/id-mappings/requests.js +17 -0
- package/dist/esm/types/id-mappings/types.js +9 -0
- package/dist/esm/types/index.js +16 -2
- package/dist/esm/types/insights/index.js +2 -0
- package/dist/esm/types/insights/requests.js +1 -0
- package/dist/esm/types/insights/types.js +81 -0
- package/dist/esm/types/labels/index.js +2 -0
- package/dist/esm/types/labels/requests.js +1 -0
- package/dist/esm/types/labels/types.js +8 -0
- package/dist/esm/types/productivity/index.js +1 -0
- package/dist/esm/types/productivity/types.js +64 -0
- package/dist/esm/types/projects/index.js +2 -0
- package/dist/esm/types/projects/requests.js +1 -0
- package/dist/esm/types/projects/types.js +53 -0
- package/dist/esm/types/reminders/index.js +1 -0
- package/dist/esm/types/sections/index.js +2 -0
- package/dist/esm/types/sections/requests.js +1 -0
- package/dist/esm/types/sections/types.js +19 -0
- package/dist/esm/types/sync/commands/shared.js +1 -1
- package/dist/esm/types/sync/resources/collaborators.js +1 -1
- package/dist/esm/types/sync/resources/notes.js +1 -1
- package/dist/esm/types/sync/resources/reminders.js +1 -1
- package/dist/esm/types/sync/resources/user.js +1 -1
- package/dist/esm/types/sync/resources/workspaces.js +1 -1
- package/dist/esm/types/tasks/index.js +2 -0
- package/dist/esm/types/tasks/requests.js +1 -0
- package/dist/esm/types/tasks/types.js +56 -0
- package/dist/esm/types/templates/index.js +1 -0
- package/dist/esm/types/templates/requests.js +1 -0
- package/dist/esm/types/uploads/index.js +1 -0
- package/dist/esm/types/uploads/requests.js +1 -0
- package/dist/esm/types/users/index.js +1 -0
- package/dist/esm/types/users/types.js +48 -0
- package/dist/esm/types/workspaces/index.js +2 -0
- package/dist/esm/types/workspaces/requests.js +1 -0
- package/dist/esm/types/workspaces/types.js +134 -0
- package/dist/esm/utils/validators.js +30 -2
- package/dist/types/authentication.d.ts +51 -6
- package/dist/types/consts/endpoints.d.ts +22 -0
- package/dist/types/test-utils/test-defaults.d.ts +5 -5
- package/dist/types/todoist-api.d.ts +209 -4
- package/dist/types/types/activity/index.d.ts +2 -0
- package/dist/types/types/activity/requests.d.ts +85 -0
- package/dist/types/types/activity/types.d.ts +49 -0
- package/dist/types/types/backups/index.d.ts +2 -0
- package/dist/types/types/backups/requests.d.ts +16 -0
- package/dist/types/types/backups/types.d.ts +7 -0
- package/dist/types/types/comments/index.d.ts +2 -0
- package/dist/types/types/comments/requests.d.ts +63 -0
- package/dist/types/types/comments/types.d.ts +141 -0
- package/dist/types/types/common.d.ts +6 -0
- package/dist/types/types/emails/index.d.ts +1 -0
- package/dist/types/types/emails/requests.d.ts +30 -0
- package/dist/types/types/id-mappings/index.d.ts +2 -0
- package/dist/types/types/id-mappings/requests.d.ts +28 -0
- package/dist/types/types/id-mappings/types.d.ts +13 -0
- package/dist/types/types/index.d.ts +16 -2
- package/dist/types/types/insights/index.d.ts +2 -0
- package/dist/types/types/insights/requests.d.ts +26 -0
- package/dist/types/types/insights/types.d.ts +186 -0
- package/dist/types/types/labels/index.d.ts +2 -0
- package/dist/types/types/labels/requests.d.ts +75 -0
- package/dist/types/types/labels/types.d.ts +13 -0
- package/dist/types/types/productivity/index.d.ts +1 -0
- package/dist/types/types/productivity/types.d.ts +115 -0
- package/dist/types/types/projects/index.d.ts +2 -0
- package/dist/types/types/projects/requests.d.ts +169 -0
- package/dist/types/types/projects/types.d.ts +201 -0
- package/dist/types/types/reminders/index.d.ts +1 -0
- package/dist/types/types/reminders/requests.d.ts +91 -0
- package/dist/types/types/sections/index.d.ts +2 -0
- package/dist/types/types/sections/requests.d.ts +41 -0
- package/dist/types/types/sections/types.d.ts +44 -0
- package/dist/types/types/sync/commands/projects.d.ts +2 -1
- package/dist/types/types/sync/commands/shared.d.ts +2 -2
- package/dist/types/types/sync/commands/workspaces.d.ts +1 -1
- package/dist/types/types/sync/resources/notes.d.ts +1 -1
- 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/response.d.ts +5 -1
- package/dist/types/types/sync/user-preferences.d.ts +1 -1
- package/dist/types/types/tasks/index.d.ts +2 -0
- package/dist/types/types/tasks/requests.d.ts +197 -0
- package/dist/types/types/tasks/types.d.ts +162 -0
- package/dist/types/types/templates/index.d.ts +1 -0
- package/dist/types/types/templates/requests.d.ts +92 -0
- package/dist/types/types/uploads/index.d.ts +1 -0
- package/dist/types/types/uploads/requests.d.ts +32 -0
- package/dist/types/types/users/index.d.ts +1 -0
- package/dist/types/types/users/types.d.ts +66 -0
- package/dist/types/types/workspaces/index.d.ts +2 -0
- package/dist/types/types/workspaces/requests.d.ts +260 -0
- package/dist/types/types/workspaces/types.d.ts +225 -0
- package/dist/types/utils/colors.d.ts +1 -1
- package/dist/types/utils/validators.d.ts +205 -12
- package/package.json +1 -1
- package/dist/cjs/types/entities.js +0 -437
- package/dist/esm/types/entities.js +0 -434
- package/dist/types/types/entities.d.ts +0 -971
- package/dist/types/types/requests.d.ts +0 -856
- /package/dist/cjs/types/{requests.js → reminders/requests.js} +0 -0
- /package/dist/esm/types/{requests.js → reminders/requests.js} +0 -0
|
@@ -5,6 +5,7 @@ exports.getAuthStateParameter = getAuthStateParameter;
|
|
|
5
5
|
exports.getAuthorizationUrl = getAuthorizationUrl;
|
|
6
6
|
exports.getAuthToken = getAuthToken;
|
|
7
7
|
exports.revokeToken = revokeToken;
|
|
8
|
+
exports.migratePersonalToken = migratePersonalToken;
|
|
8
9
|
const http_client_1 = require("./transport/http-client");
|
|
9
10
|
const uuid_1 = require("uuid");
|
|
10
11
|
const types_1 = require("./types");
|
|
@@ -58,7 +59,7 @@ function getAuthStateParameter() {
|
|
|
58
59
|
* ```
|
|
59
60
|
*
|
|
60
61
|
* @returns The full authorization URL to redirect users to
|
|
61
|
-
* @see https://todoist.com/api/v1
|
|
62
|
+
* @see https://developer.todoist.com/api/v1/#tag/Authorization/OAuth
|
|
62
63
|
*/
|
|
63
64
|
function getAuthorizationUrl({ clientId, permissions, state, baseUrl, }) {
|
|
64
65
|
if (!(permissions === null || permissions === void 0 ? void 0 : permissions.length)) {
|
|
@@ -126,7 +127,7 @@ async function getAuthToken(args, options) {
|
|
|
126
127
|
*
|
|
127
128
|
* @returns True if revocation was successful
|
|
128
129
|
* @see https://datatracker.ietf.org/doc/html/rfc7009
|
|
129
|
-
* @see https://todoist.com/api/v1
|
|
130
|
+
* @see https://developer.todoist.com/api/v1/#tag/Authorization
|
|
130
131
|
*/
|
|
131
132
|
async function revokeToken(args, options) {
|
|
132
133
|
if (typeof options === 'string') {
|
|
@@ -158,3 +159,46 @@ async function revokeToken(args, options) {
|
|
|
158
159
|
});
|
|
159
160
|
return (0, http_client_1.isSuccess)(response);
|
|
160
161
|
}
|
|
162
|
+
/**
|
|
163
|
+
* Migrates a personal API token to an OAuth access token.
|
|
164
|
+
*
|
|
165
|
+
* This allows applications to transition users from personal API tokens
|
|
166
|
+
* to proper OAuth tokens without requiring the user to go through the
|
|
167
|
+
* full OAuth authorization flow.
|
|
168
|
+
*
|
|
169
|
+
* @example
|
|
170
|
+
* ```typescript
|
|
171
|
+
* const { accessToken } = await migratePersonalToken({
|
|
172
|
+
* clientId: 'your-client-id',
|
|
173
|
+
* clientSecret: 'your-client-secret',
|
|
174
|
+
* personalToken: 'user-personal-token',
|
|
175
|
+
* scope: 'data:read_write,data:delete'
|
|
176
|
+
* })
|
|
177
|
+
* ```
|
|
178
|
+
*
|
|
179
|
+
* @returns The new OAuth token response
|
|
180
|
+
* @throws {@link TodoistRequestError} If the migration fails
|
|
181
|
+
*/
|
|
182
|
+
async function migratePersonalToken(args, options) {
|
|
183
|
+
var _a;
|
|
184
|
+
const baseUrl = options === null || options === void 0 ? void 0 : options.baseUrl;
|
|
185
|
+
const customFetch = options === null || options === void 0 ? void 0 : options.customFetch;
|
|
186
|
+
try {
|
|
187
|
+
const response = await (0, http_client_1.request)({
|
|
188
|
+
httpMethod: 'POST',
|
|
189
|
+
baseUri: (0, endpoints_1.getSyncBaseUri)(baseUrl),
|
|
190
|
+
relativePath: endpoints_1.ENDPOINT_REST_ACCESS_TOKENS_MIGRATE,
|
|
191
|
+
apiToken: undefined,
|
|
192
|
+
payload: Object.assign(Object.assign({}, args), { scope: args.scope.join(',') }),
|
|
193
|
+
customFetch,
|
|
194
|
+
});
|
|
195
|
+
if (response.status !== 200 || !((_a = response.data) === null || _a === void 0 ? void 0 : _a.accessToken)) {
|
|
196
|
+
throw new types_1.TodoistRequestError('Personal token migration failed.', response.status, response.data);
|
|
197
|
+
}
|
|
198
|
+
return response.data;
|
|
199
|
+
}
|
|
200
|
+
catch (error) {
|
|
201
|
+
const err = error;
|
|
202
|
+
throw new types_1.TodoistRequestError('Personal token migration failed.', err.httpStatusCode, err.responseData);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
@@ -1,11 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.ENDPOINT_WORKSPACE_USERS = exports.ENDPOINT_WORKSPACE_PLAN_DETAILS = void 0;
|
|
3
|
+
exports.ENDPOINT_REST_ID_MAPPINGS = exports.ENDPOINT_REST_EMAILS = exports.ENDPOINT_REST_BACKUPS_DOWNLOAD = exports.ENDPOINT_REST_BACKUPS = exports.ENDPOINT_REST_ACCESS_TOKENS_MIGRATE = exports.ENDPOINT_REST_TEMPLATES_IMPORT_FROM_ID = exports.ENDPOINT_REST_TEMPLATES_IMPORT_FROM_FILE = exports.ENDPOINT_REST_TEMPLATES_CREATE_FROM_FILE = exports.ENDPOINT_REST_TEMPLATES_URL = exports.ENDPOINT_REST_TEMPLATES_FILE = exports.ENDPOINT_REST_TASKS_COMPLETED = exports.ENDPOINT_REST_PROJECTS_MOVE_TO_PERSONAL = exports.ENDPOINT_REST_PROJECTS_MOVE_TO_WORKSPACE = exports.SECTION_UNARCHIVE = exports.SECTION_ARCHIVE = exports.ENDPOINT_REST_PROJECT_JOIN = exports.ENDPOINT_REST_PROJECT_FULL = exports.ENDPOINT_REST_PROJECTS_PERMISSIONS = exports.ENDPOINT_REST_PROJECTS_ARCHIVED_COUNT = exports.PROJECT_UNARCHIVE = exports.PROJECT_ARCHIVE = exports.ENDPOINT_REST_UPLOADS = exports.ENDPOINT_REST_ACTIVITIES = exports.ENDPOINT_REST_PRODUCTIVITY = exports.ENDPOINT_REST_USER = exports.ENDPOINT_REST_PROJECT_COLLABORATORS = exports.ENDPOINT_REST_PROJECTS_ARCHIVED = exports.ENDPOINT_REST_PROJECTS_SEARCH = exports.ENDPOINT_REST_PROJECTS = exports.ENDPOINT_REST_TASK_MOVE = exports.ENDPOINT_REST_TASK_REOPEN = exports.ENDPOINT_REST_TASK_CLOSE = exports.ENDPOINT_REST_LOCATION_REMINDERS = exports.ENDPOINT_REST_REMINDERS = exports.ENDPOINT_REST_COMMENTS = exports.ENDPOINT_REST_LABELS_SHARED_REMOVE = exports.ENDPOINT_REST_LABELS_SHARED_RENAME = exports.ENDPOINT_REST_LABELS_SHARED = exports.ENDPOINT_REST_LABELS_SEARCH = exports.ENDPOINT_REST_LABELS = exports.ENDPOINT_REST_SECTIONS_SEARCH = exports.ENDPOINT_REST_SECTIONS = exports.ENDPOINT_REST_TASKS_COMPLETED_SEARCH = exports.ENDPOINT_REST_TASKS_COMPLETED_BY_DUE_DATE = exports.ENDPOINT_REST_TASKS_COMPLETED_BY_COMPLETION_DATE = exports.ENDPOINT_REST_TASKS_FILTER = exports.ENDPOINT_REST_TASKS = exports.API_BASE_URI = exports.API_VERSION = exports.TODOIST_WEB_URI = void 0;
|
|
4
|
+
exports.ENDPOINT_WORKSPACE_MEMBERS = exports.ENDPOINT_WORKSPACE_USERS = exports.ENDPOINT_WORKSPACE_PLAN_DETAILS = exports.ENDPOINT_WORKSPACE_LOGO = exports.ENDPOINT_WORKSPACE_JOIN = exports.ENDPOINT_WORKSPACE_INVITATIONS_DELETE = exports.ENDPOINT_WORKSPACE_INVITATIONS_ALL = exports.ENDPOINT_WORKSPACE_INVITATIONS = exports.ENDPOINT_REST_WORKSPACES = exports.ENDPOINT_REVOKE = exports.ENDPOINT_GET_TOKEN = exports.ENDPOINT_AUTHORIZATION = exports.ENDPOINT_SYNC = exports.ENDPOINT_SYNC_QUICK_ADD = exports.ENDPOINT_REST_MOVED_IDS = void 0;
|
|
5
5
|
exports.getSyncBaseUri = getSyncBaseUri;
|
|
6
6
|
exports.getAuthBaseUri = getAuthBaseUri;
|
|
7
7
|
exports.getWorkspaceInvitationAcceptEndpoint = getWorkspaceInvitationAcceptEndpoint;
|
|
8
8
|
exports.getWorkspaceInvitationRejectEndpoint = getWorkspaceInvitationRejectEndpoint;
|
|
9
|
+
exports.getProjectInsightsActivityStatsEndpoint = getProjectInsightsActivityStatsEndpoint;
|
|
10
|
+
exports.getProjectInsightsHealthEndpoint = getProjectInsightsHealthEndpoint;
|
|
11
|
+
exports.getProjectInsightsHealthContextEndpoint = getProjectInsightsHealthContextEndpoint;
|
|
12
|
+
exports.getProjectInsightsProgressEndpoint = getProjectInsightsProgressEndpoint;
|
|
13
|
+
exports.getProjectInsightsHealthAnalyzeEndpoint = getProjectInsightsHealthAnalyzeEndpoint;
|
|
14
|
+
exports.getWorkspaceInsightsEndpoint = getWorkspaceInsightsEndpoint;
|
|
15
|
+
exports.getWorkspaceUserTasksEndpoint = getWorkspaceUserTasksEndpoint;
|
|
16
|
+
exports.getWorkspaceInviteUsersEndpoint = getWorkspaceInviteUsersEndpoint;
|
|
17
|
+
exports.getWorkspaceUserEndpoint = getWorkspaceUserEndpoint;
|
|
9
18
|
exports.getWorkspaceActiveProjectsEndpoint = getWorkspaceActiveProjectsEndpoint;
|
|
10
19
|
exports.getWorkspaceArchivedProjectsEndpoint = getWorkspaceArchivedProjectsEndpoint;
|
|
11
20
|
const BASE_URI = 'https://api.todoist.com';
|
|
@@ -58,6 +67,18 @@ exports.SECTION_ARCHIVE = 'archive';
|
|
|
58
67
|
exports.SECTION_UNARCHIVE = 'unarchive';
|
|
59
68
|
exports.ENDPOINT_REST_PROJECTS_MOVE_TO_WORKSPACE = exports.ENDPOINT_REST_PROJECTS + '/move_to_workspace';
|
|
60
69
|
exports.ENDPOINT_REST_PROJECTS_MOVE_TO_PERSONAL = exports.ENDPOINT_REST_PROJECTS + '/move_to_personal';
|
|
70
|
+
exports.ENDPOINT_REST_TASKS_COMPLETED = exports.ENDPOINT_REST_TASKS + '/completed';
|
|
71
|
+
exports.ENDPOINT_REST_TEMPLATES_FILE = 'templates/file';
|
|
72
|
+
exports.ENDPOINT_REST_TEMPLATES_URL = 'templates/url';
|
|
73
|
+
exports.ENDPOINT_REST_TEMPLATES_CREATE_FROM_FILE = 'templates/create_project_from_file';
|
|
74
|
+
exports.ENDPOINT_REST_TEMPLATES_IMPORT_FROM_FILE = 'templates/import_into_project_from_file';
|
|
75
|
+
exports.ENDPOINT_REST_TEMPLATES_IMPORT_FROM_ID = 'templates/import_into_project_from_template_id';
|
|
76
|
+
exports.ENDPOINT_REST_ACCESS_TOKENS_MIGRATE = 'access_tokens/migrate_personal_token';
|
|
77
|
+
exports.ENDPOINT_REST_BACKUPS = 'backups';
|
|
78
|
+
exports.ENDPOINT_REST_BACKUPS_DOWNLOAD = 'backups/download';
|
|
79
|
+
exports.ENDPOINT_REST_EMAILS = 'emails';
|
|
80
|
+
exports.ENDPOINT_REST_ID_MAPPINGS = 'id_mappings';
|
|
81
|
+
exports.ENDPOINT_REST_MOVED_IDS = 'moved_ids';
|
|
61
82
|
exports.ENDPOINT_SYNC_QUICK_ADD = exports.ENDPOINT_REST_TASKS + '/quick';
|
|
62
83
|
exports.ENDPOINT_SYNC = 'sync';
|
|
63
84
|
exports.ENDPOINT_AUTHORIZATION = 'authorize';
|
|
@@ -79,6 +100,37 @@ function getWorkspaceInvitationAcceptEndpoint(inviteCode) {
|
|
|
79
100
|
function getWorkspaceInvitationRejectEndpoint(inviteCode) {
|
|
80
101
|
return `workspaces/invitations/${inviteCode}/reject`;
|
|
81
102
|
}
|
|
103
|
+
// Insights endpoints
|
|
104
|
+
function getProjectInsightsActivityStatsEndpoint(projectId) {
|
|
105
|
+
return `projects/${projectId}/insights/activity_stats`;
|
|
106
|
+
}
|
|
107
|
+
function getProjectInsightsHealthEndpoint(projectId) {
|
|
108
|
+
return `projects/${projectId}/insights/health`;
|
|
109
|
+
}
|
|
110
|
+
function getProjectInsightsHealthContextEndpoint(projectId) {
|
|
111
|
+
return `projects/${projectId}/insights/health/context`;
|
|
112
|
+
}
|
|
113
|
+
function getProjectInsightsProgressEndpoint(projectId) {
|
|
114
|
+
return `projects/${projectId}/insights/progress`;
|
|
115
|
+
}
|
|
116
|
+
function getProjectInsightsHealthAnalyzeEndpoint(projectId) {
|
|
117
|
+
return `projects/${projectId}/insights/health/analyze`;
|
|
118
|
+
}
|
|
119
|
+
function getWorkspaceInsightsEndpoint(workspaceId) {
|
|
120
|
+
return `workspaces/${workspaceId}/insights`;
|
|
121
|
+
}
|
|
122
|
+
// Workspace members
|
|
123
|
+
exports.ENDPOINT_WORKSPACE_MEMBERS = 'workspaces/members';
|
|
124
|
+
// Workspace user management (require workspace_id and/or user_id parameters)
|
|
125
|
+
function getWorkspaceUserTasksEndpoint(workspaceId, userId) {
|
|
126
|
+
return `workspaces/${workspaceId}/users/${userId}/tasks`;
|
|
127
|
+
}
|
|
128
|
+
function getWorkspaceInviteUsersEndpoint(workspaceId) {
|
|
129
|
+
return `workspaces/${workspaceId}/users/invite`;
|
|
130
|
+
}
|
|
131
|
+
function getWorkspaceUserEndpoint(workspaceId, userId) {
|
|
132
|
+
return `workspaces/${workspaceId}/users/${userId}`;
|
|
133
|
+
}
|
|
82
134
|
// Workspace projects (require workspace_id parameter)
|
|
83
135
|
function getWorkspaceActiveProjectsEndpoint(workspaceId) {
|
|
84
136
|
return `workspaces/${workspaceId}/projects/active`;
|