@doist/todoist-sdk 10.1.0 → 10.2.0-next.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/clients/goals-client.js +145 -0
- package/dist/cjs/consts/endpoints.js +6 -1
- package/dist/cjs/test-utils/test-defaults.js +26 -2
- package/dist/cjs/todoist-api.js +33 -0
- package/dist/cjs/types/goals/index.js +18 -0
- package/dist/cjs/types/goals/requests.js +2 -0
- package/dist/cjs/types/goals/types.js +56 -0
- package/dist/cjs/types/index.js +1 -0
- package/dist/cjs/types/sync/commands/goals.js +2 -0
- package/dist/cjs/types/sync/commands/index.js +1 -0
- package/dist/cjs/types/sync/resource-types.js +1 -0
- package/dist/cjs/types/sync/resources/user-settings.js +2 -2
- package/dist/cjs/types/sync/resources/user.js +4 -4
- package/dist/cjs/types/sync/response.js +12 -10
- package/dist/cjs/utils/validators.js +53 -51
- package/dist/esm/clients/goals-client.js +141 -0
- package/dist/esm/consts/endpoints.js +5 -0
- package/dist/esm/test-utils/test-defaults.js +24 -0
- package/dist/esm/todoist-api.js +33 -0
- package/dist/esm/types/goals/index.js +2 -0
- package/dist/esm/types/goals/requests.js +1 -0
- package/dist/esm/types/goals/types.js +53 -0
- package/dist/esm/types/index.js +1 -0
- package/dist/esm/types/sync/commands/goals.js +1 -0
- package/dist/esm/types/sync/commands/index.js +1 -0
- package/dist/esm/types/sync/resource-types.js +1 -0
- package/dist/esm/types/sync/resources/user-settings.js +2 -2
- package/dist/esm/types/sync/resources/user.js +4 -4
- package/dist/esm/types/sync/response.js +2 -0
- package/dist/esm/utils/validators.js +2 -0
- package/dist/types/clients/goals-client.d.ts +20 -0
- package/dist/types/consts/endpoints.d.ts +5 -0
- package/dist/types/test-utils/test-defaults.d.ts +4 -1
- package/dist/types/todoist-api.d.ts +12 -0
- package/dist/types/types/goals/index.d.ts +2 -0
- package/dist/types/types/goals/requests.d.ts +33 -0
- package/dist/types/types/goals/types.d.ts +51 -0
- package/dist/types/types/index.d.ts +1 -0
- package/dist/types/types/sync/commands/goals.d.ts +33 -0
- package/dist/types/types/sync/commands/index.d.ts +9 -0
- package/dist/types/types/sync/resource-types.d.ts +1 -1
- package/dist/types/types/sync/resources/user-settings.d.ts +2 -2
- package/dist/types/types/sync/resources/user.d.ts +4 -4
- package/dist/types/types/sync/resources/view-options.d.ts +6 -6
- package/dist/types/types/sync/response.d.ts +35 -10
- package/dist/types/types/tasks/requests.d.ts +1 -0
- package/dist/types/utils/validators.d.ts +60 -13
- package/package.json +1 -1
|
@@ -1,25 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12;
|
|
2
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.validateFolder = exports.validateCollaboratorStateArray = exports.validateCollaboratorState = exports.validateCollaboratorArray = exports.validateCollaborator = exports.validateFilterArray = exports.validateFilter = exports.validateMovedIdArray = exports.validateMovedId = exports.validateIdMappingArray = exports.validateIdMapping = exports.validateBackupArray = exports.validateBackup = exports.validateWorkspaceInsights = exports.validateProjectProgress = exports.validateProjectHealthContext = exports.validateProjectHealth = exports.validateProjectActivityStats = exports.validateWorkspaceUserTaskArray = exports.validateWorkspaceUserTask = exports.validateMemberActivityInfoArray = exports.validateMemberActivityInfo = exports.validateWorkspaceArray = exports.validateWorkspace = exports.validateJoinWorkspaceResult = exports.validateWorkspacePlanDetails = exports.validateWorkspaceInvitationArray = exports.validateWorkspaceInvitation = exports.validateWorkspaceUserArray = exports.validateWorkspaceUser = exports.validateAttachment = exports.validateActivityEventArray = exports.validateActivityEvent = exports.validateCurrentUser = exports.validateProductivityStats = exports.validateUserArray = exports.validateUser = exports.validateCommentArray = exports.validateComment = exports.validateLabelArray = exports.validateLabel = exports.validateSectionArray = exports.validateSection = exports.validateWorkspaceProjectArray = exports.validateWorkspaceProject = exports.validateProjectArray = exports.validateProject = exports.validateTaskArray = exports.validateTask = exports.IdSchema = void 0;
|
|
5
|
-
exports.validateUiExtensionArray = exports.validateUiExtension = exports.validateUserAuthorizationArray = exports.validateUserAuthorization = exports.validateAppInstallationArray = exports.validateAppInstallation = exports.validateAppWebhook = exports.validateAppByDistributionToken = exports.validateAppDistributionToken = exports.validateAppTestToken = exports.validateAppVerificationToken = exports.validateAppSecrets = exports.validateAppWithUserCount = exports.validateAppArray = exports.validateApp = exports.validateSuggestionArray = exports.validateSuggestion = exports.validateUserSettings = exports.validateSyncUser = exports.validateSyncWorkspaceArray = exports.validateSyncWorkspace = exports.validateLiveNotificationArray = exports.validateLiveNotification = exports.validateUserPlanLimits = exports.validateProjectViewOptionsDefaultsArray = exports.validateProjectViewOptionsDefaults = exports.validateViewOptionsArray = exports.validateViewOptions = exports.validateCompletedInfoArray = exports.validateCompletedInfo = exports.validateLocationReminderArray = exports.validateLocationReminder = exports.validateReminderArray = exports.validateReminder = exports.validateCalendarAccountArray = exports.validateCalendarAccount = exports.validateCalendarArray = exports.validateCalendar = exports.validateWorkspaceGoalArray = exports.validateWorkspaceGoal = exports.validateWorkspaceFilterArray = exports.validateWorkspaceFilter = exports.validateTooltips = exports.validateNoteArray = exports.validateNote = exports.validateFolderArray = void 0;
|
|
5
|
+
exports.validateUiExtensionArray = exports.validateUiExtension = exports.validateUserAuthorizationArray = exports.validateUserAuthorization = exports.validateAppInstallationArray = exports.validateAppInstallation = exports.validateAppWebhook = exports.validateAppByDistributionToken = exports.validateAppDistributionToken = exports.validateAppTestToken = exports.validateAppVerificationToken = exports.validateAppSecrets = exports.validateAppWithUserCount = exports.validateAppArray = exports.validateApp = exports.validateSuggestionArray = exports.validateSuggestion = exports.validateUserSettings = exports.validateSyncUser = exports.validateSyncWorkspaceArray = exports.validateSyncWorkspace = exports.validateLiveNotificationArray = exports.validateLiveNotification = exports.validateUserPlanLimits = exports.validateProjectViewOptionsDefaultsArray = exports.validateProjectViewOptionsDefaults = exports.validateViewOptionsArray = exports.validateViewOptions = exports.validateCompletedInfoArray = exports.validateCompletedInfo = exports.validateLocationReminderArray = exports.validateLocationReminder = exports.validateReminderArray = exports.validateReminder = exports.validateCalendarAccountArray = exports.validateCalendarAccount = exports.validateCalendarArray = exports.validateCalendar = exports.validateWorkspaceGoalArray = exports.validateWorkspaceGoal = exports.validateWorkspaceFilterArray = exports.validateWorkspaceFilter = exports.validateTooltips = exports.validateNoteArray = exports.validateNote = exports.validateGoalArray = exports.validateGoal = exports.validateFolderArray = void 0;
|
|
6
6
|
exports.parseSyncResponse = parseSyncResponse;
|
|
7
7
|
const zod_1 = require("zod");
|
|
8
8
|
const types_1 = require("../types/activity/types");
|
|
9
9
|
const types_2 = require("../types/apps/types");
|
|
10
10
|
const types_3 = require("../types/backups/types");
|
|
11
11
|
const types_4 = require("../types/comments/types");
|
|
12
|
-
const types_5 = require("../types/
|
|
13
|
-
const types_6 = require("../types/
|
|
14
|
-
const types_7 = require("../types/
|
|
15
|
-
const types_8 = require("../types/
|
|
16
|
-
const types_9 = require("../types/
|
|
17
|
-
const types_10 = require("../types/
|
|
12
|
+
const types_5 = require("../types/goals/types");
|
|
13
|
+
const types_6 = require("../types/id-mappings/types");
|
|
14
|
+
const types_7 = require("../types/insights/types");
|
|
15
|
+
const types_8 = require("../types/labels/types");
|
|
16
|
+
const types_9 = require("../types/productivity/types");
|
|
17
|
+
const types_10 = require("../types/projects/types");
|
|
18
|
+
const types_11 = require("../types/sections/types");
|
|
18
19
|
const response_1 = require("../types/sync/response");
|
|
19
|
-
const
|
|
20
|
-
const
|
|
21
|
-
const
|
|
22
|
-
const
|
|
20
|
+
const types_12 = require("../types/tasks/types");
|
|
21
|
+
const types_13 = require("../types/ui-extensions/types");
|
|
22
|
+
const types_14 = require("../types/users/types");
|
|
23
|
+
const types_15 = require("../types/workspaces/types");
|
|
23
24
|
const resources_1 = require("../types/sync/resources");
|
|
24
25
|
function createValidator(schema) {
|
|
25
26
|
return {
|
|
@@ -33,64 +34,65 @@ exports.IdSchema = zod_1.z
|
|
|
33
34
|
.min(1)
|
|
34
35
|
.refine((id) => !id.startsWith('tmp-'), { message: TMP_ID_MESSAGE });
|
|
35
36
|
// Entity validators
|
|
36
|
-
_a = createValidator(
|
|
37
|
+
_a = createValidator(types_12.TaskSchema), exports.validateTask = _a.validate, exports.validateTaskArray = _a.validateArray;
|
|
37
38
|
/**
|
|
38
39
|
* Validates and parses a project input.
|
|
39
40
|
* @param input The input to validate
|
|
40
41
|
* @returns A validated project (either PersonalProject or WorkspaceProject)
|
|
41
42
|
*/
|
|
42
|
-
_b = createValidator(
|
|
43
|
-
_c = createValidator(
|
|
44
|
-
_d = createValidator(
|
|
45
|
-
_e = createValidator(
|
|
43
|
+
_b = createValidator(types_10.ProjectSchema), exports.validateProject = _b.validate, exports.validateProjectArray = _b.validateArray;
|
|
44
|
+
_c = createValidator(types_10.WorkspaceProjectSchema), exports.validateWorkspaceProject = _c.validate, exports.validateWorkspaceProjectArray = _c.validateArray;
|
|
45
|
+
_d = createValidator(types_11.SectionSchema), exports.validateSection = _d.validate, exports.validateSectionArray = _d.validateArray;
|
|
46
|
+
_e = createValidator(types_8.LabelSchema), exports.validateLabel = _e.validate, exports.validateLabelArray = _e.validateArray;
|
|
46
47
|
_f = createValidator(types_4.CommentSchema), exports.validateComment = _f.validate, exports.validateCommentArray = _f.validateArray;
|
|
47
|
-
_g = createValidator(
|
|
48
|
-
exports.validateProductivityStats = createValidator(
|
|
49
|
-
exports.validateCurrentUser = createValidator(
|
|
48
|
+
_g = createValidator(types_14.UserSchema), exports.validateUser = _g.validate, exports.validateUserArray = _g.validateArray;
|
|
49
|
+
exports.validateProductivityStats = createValidator(types_9.ProductivityStatsSchema).validate;
|
|
50
|
+
exports.validateCurrentUser = createValidator(types_14.CurrentUserSchema).validate;
|
|
50
51
|
_h = createValidator(types_1.ActivityEventSchema), exports.validateActivityEvent = _h.validate, exports.validateActivityEventArray = _h.validateArray;
|
|
51
52
|
exports.validateAttachment = createValidator(types_4.AttachmentSchema).validate;
|
|
52
|
-
_j = createValidator(
|
|
53
|
-
_k = createValidator(
|
|
54
|
-
exports.validateWorkspacePlanDetails = createValidator(
|
|
55
|
-
exports.validateJoinWorkspaceResult = createValidator(
|
|
56
|
-
_l = createValidator(
|
|
57
|
-
_m = createValidator(
|
|
58
|
-
_o = createValidator(
|
|
59
|
-
exports.validateProjectActivityStats = createValidator(
|
|
60
|
-
exports.validateProjectHealth = createValidator(
|
|
61
|
-
exports.validateProjectHealthContext = createValidator(
|
|
62
|
-
exports.validateProjectProgress = createValidator(
|
|
63
|
-
exports.validateWorkspaceInsights = createValidator(
|
|
53
|
+
_j = createValidator(types_15.WorkspaceUserSchema), exports.validateWorkspaceUser = _j.validate, exports.validateWorkspaceUserArray = _j.validateArray;
|
|
54
|
+
_k = createValidator(types_15.WorkspaceInvitationSchema), exports.validateWorkspaceInvitation = _k.validate, exports.validateWorkspaceInvitationArray = _k.validateArray;
|
|
55
|
+
exports.validateWorkspacePlanDetails = createValidator(types_15.WorkspacePlanDetailsSchema).validate;
|
|
56
|
+
exports.validateJoinWorkspaceResult = createValidator(types_15.JoinWorkspaceResultSchema).validate;
|
|
57
|
+
_l = createValidator(types_15.WorkspaceSchema), exports.validateWorkspace = _l.validate, exports.validateWorkspaceArray = _l.validateArray;
|
|
58
|
+
_m = createValidator(types_15.MemberActivityInfoSchema), exports.validateMemberActivityInfo = _m.validate, exports.validateMemberActivityInfoArray = _m.validateArray;
|
|
59
|
+
_o = createValidator(types_15.WorkspaceUserTaskSchema), exports.validateWorkspaceUserTask = _o.validate, exports.validateWorkspaceUserTaskArray = _o.validateArray;
|
|
60
|
+
exports.validateProjectActivityStats = createValidator(types_7.ProjectActivityStatsSchema).validate;
|
|
61
|
+
exports.validateProjectHealth = createValidator(types_7.ProjectHealthSchema).validate;
|
|
62
|
+
exports.validateProjectHealthContext = createValidator(types_7.ProjectHealthContextSchema).validate;
|
|
63
|
+
exports.validateProjectProgress = createValidator(types_7.ProjectProgressSchema).validate;
|
|
64
|
+
exports.validateWorkspaceInsights = createValidator(types_7.WorkspaceInsightsSchema).validate;
|
|
64
65
|
_p = createValidator(types_3.BackupSchema), exports.validateBackup = _p.validate, exports.validateBackupArray = _p.validateArray;
|
|
65
|
-
_q = createValidator(
|
|
66
|
-
_r = createValidator(
|
|
66
|
+
_q = createValidator(types_6.IdMappingSchema), exports.validateIdMapping = _q.validate, exports.validateIdMappingArray = _q.validateArray;
|
|
67
|
+
_r = createValidator(types_6.MovedIdSchema), exports.validateMovedId = _r.validate, exports.validateMovedIdArray = _r.validateArray;
|
|
67
68
|
// Sync resource validators
|
|
68
69
|
_s = createValidator(resources_1.FilterSchema), exports.validateFilter = _s.validate, exports.validateFilterArray = _s.validateArray;
|
|
69
70
|
_t = createValidator(resources_1.CollaboratorSchema), exports.validateCollaborator = _t.validate, exports.validateCollaboratorArray = _t.validateArray;
|
|
70
71
|
_u = createValidator(resources_1.CollaboratorStateSchema), exports.validateCollaboratorState = _u.validate, exports.validateCollaboratorStateArray = _u.validateArray;
|
|
71
72
|
_v = createValidator(resources_1.FolderSchema), exports.validateFolder = _v.validate, exports.validateFolderArray = _v.validateArray;
|
|
72
|
-
_w = createValidator(
|
|
73
|
+
_w = createValidator(types_5.GoalSchema), exports.validateGoal = _w.validate, exports.validateGoalArray = _w.validateArray;
|
|
74
|
+
_x = createValidator(resources_1.NoteSchema), exports.validateNote = _x.validate, exports.validateNoteArray = _x.validateArray;
|
|
73
75
|
exports.validateTooltips = createValidator(resources_1.TooltipsSchema).validate;
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
76
|
+
_y = createValidator(resources_1.WorkspaceFilterSchema), exports.validateWorkspaceFilter = _y.validate, exports.validateWorkspaceFilterArray = _y.validateArray;
|
|
77
|
+
_z = createValidator(resources_1.WorkspaceGoalSchema), exports.validateWorkspaceGoal = _z.validate, exports.validateWorkspaceGoalArray = _z.validateArray;
|
|
78
|
+
_0 = createValidator(resources_1.CalendarSchema), exports.validateCalendar = _0.validate, exports.validateCalendarArray = _0.validateArray;
|
|
79
|
+
_1 = createValidator(resources_1.CalendarAccountSchema), exports.validateCalendarAccount = _1.validate, exports.validateCalendarAccountArray = _1.validateArray;
|
|
80
|
+
_2 = createValidator(resources_1.ReminderSchema), exports.validateReminder = _2.validate, exports.validateReminderArray = _2.validateArray;
|
|
81
|
+
_3 = createValidator(resources_1.LocationReminderSchema), exports.validateLocationReminder = _3.validate, exports.validateLocationReminderArray = _3.validateArray;
|
|
82
|
+
_4 = createValidator(resources_1.CompletedInfoSchema), exports.validateCompletedInfo = _4.validate, exports.validateCompletedInfoArray = _4.validateArray;
|
|
83
|
+
_5 = createValidator(resources_1.ViewOptionsSchema), exports.validateViewOptions = _5.validate, exports.validateViewOptionsArray = _5.validateArray;
|
|
84
|
+
_6 = createValidator(resources_1.ProjectViewOptionsDefaultsSchema), exports.validateProjectViewOptionsDefaults = _6.validate, exports.validateProjectViewOptionsDefaultsArray = _6.validateArray;
|
|
83
85
|
exports.validateUserPlanLimits = createValidator(resources_1.UserPlanLimitsSchema).validate;
|
|
84
|
-
|
|
85
|
-
|
|
86
|
+
_7 = createValidator(resources_1.LiveNotificationSchema), exports.validateLiveNotification = _7.validate, exports.validateLiveNotificationArray = _7.validateArray;
|
|
87
|
+
_8 = createValidator(resources_1.SyncWorkspaceSchema), exports.validateSyncWorkspace = _8.validate, exports.validateSyncWorkspaceArray = _8.validateArray;
|
|
86
88
|
exports.validateSyncUser = createValidator(resources_1.SyncUserSchema).validate;
|
|
87
89
|
exports.validateUserSettings = createValidator(resources_1.UserSettingsSchema).validate;
|
|
88
|
-
|
|
90
|
+
_9 = createValidator(resources_1.SuggestionSchema), exports.validateSuggestion = _9.validate, exports.validateSuggestionArray = _9.validateArray;
|
|
89
91
|
function parseSyncResponse(raw) {
|
|
90
92
|
return response_1.SyncResponseSchema.parse(raw);
|
|
91
93
|
}
|
|
92
94
|
// App management validators
|
|
93
|
-
|
|
95
|
+
_10 = createValidator(types_2.AppSchema), exports.validateApp = _10.validate, exports.validateAppArray = _10.validateArray;
|
|
94
96
|
exports.validateAppWithUserCount = createValidator(types_2.AppWithUserCountSchema).validate;
|
|
95
97
|
exports.validateAppSecrets = createValidator(types_2.AppSecretsSchema).validate;
|
|
96
98
|
exports.validateAppVerificationToken = createValidator(types_2.AppVerificationTokenSchema).validate;
|
|
@@ -98,6 +100,6 @@ exports.validateAppTestToken = createValidator(types_2.AppTestTokenSchema).valid
|
|
|
98
100
|
exports.validateAppDistributionToken = createValidator(types_2.AppDistributionTokenSchema).validate;
|
|
99
101
|
exports.validateAppByDistributionToken = createValidator(types_2.AppByDistributionTokenSchema).validate;
|
|
100
102
|
exports.validateAppWebhook = createValidator(types_2.AppWebhookSchema).validate;
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
103
|
+
_11 = createValidator(types_2.AppInstallationSchema), exports.validateAppInstallation = _11.validate, exports.validateAppInstallationArray = _11.validateArray;
|
|
104
|
+
_12 = createValidator(types_2.UserAuthorizationSchema), exports.validateUserAuthorization = _12.validate, exports.validateUserAuthorizationArray = _12.validateArray;
|
|
105
|
+
_13 = createValidator(types_13.UiExtensionSchema), exports.validateUiExtension = _13.validate, exports.validateUiExtensionArray = _13.validateArray;
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ENDPOINT_REST_GOALS, ENDPOINT_REST_GOALS_SEARCH, GOAL_COMPLETE, GOAL_TASKS, GOAL_UNCOMPLETE, } from '../consts/endpoints.js';
|
|
3
|
+
import { isSuccess, request } from '../transport/http-client.js';
|
|
4
|
+
import { generatePath } from '../utils/request-helpers.js';
|
|
5
|
+
import { validateGoal, validateGoalArray } from '../utils/validators.js';
|
|
6
|
+
import { BaseClient } from './base-client.js';
|
|
7
|
+
/**
|
|
8
|
+
* Internal sub-client handling all goal-domain endpoints.
|
|
9
|
+
*
|
|
10
|
+
* Instantiated by `TodoistApi`; every public goal method on `TodoistApi`
|
|
11
|
+
* delegates here. See `todoist-api.ts` for the user-facing JSDoc.
|
|
12
|
+
*/
|
|
13
|
+
export class GoalsClient extends BaseClient {
|
|
14
|
+
async getGoals(args) {
|
|
15
|
+
const { data: { results, nextCursor }, } = await request({
|
|
16
|
+
httpMethod: 'GET',
|
|
17
|
+
baseUri: this.syncApiBase,
|
|
18
|
+
relativePath: ENDPOINT_REST_GOALS,
|
|
19
|
+
apiToken: this.authToken,
|
|
20
|
+
customFetch: this.customFetch,
|
|
21
|
+
payload: args,
|
|
22
|
+
});
|
|
23
|
+
return {
|
|
24
|
+
results: validateGoalArray(results),
|
|
25
|
+
nextCursor,
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
async searchGoals(args) {
|
|
29
|
+
const { data: { results, nextCursor }, } = await request({
|
|
30
|
+
httpMethod: 'GET',
|
|
31
|
+
baseUri: this.syncApiBase,
|
|
32
|
+
relativePath: ENDPOINT_REST_GOALS_SEARCH,
|
|
33
|
+
apiToken: this.authToken,
|
|
34
|
+
customFetch: this.customFetch,
|
|
35
|
+
payload: args,
|
|
36
|
+
});
|
|
37
|
+
return {
|
|
38
|
+
results: validateGoalArray(results),
|
|
39
|
+
nextCursor,
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
async getGoal(id) {
|
|
43
|
+
z.string().parse(id);
|
|
44
|
+
const response = await request({
|
|
45
|
+
httpMethod: 'GET',
|
|
46
|
+
baseUri: this.syncApiBase,
|
|
47
|
+
relativePath: generatePath(ENDPOINT_REST_GOALS, id),
|
|
48
|
+
apiToken: this.authToken,
|
|
49
|
+
customFetch: this.customFetch,
|
|
50
|
+
});
|
|
51
|
+
return validateGoal(response.data);
|
|
52
|
+
}
|
|
53
|
+
async addGoal(args, requestId) {
|
|
54
|
+
const response = await request({
|
|
55
|
+
httpMethod: 'POST',
|
|
56
|
+
baseUri: this.syncApiBase,
|
|
57
|
+
relativePath: ENDPOINT_REST_GOALS,
|
|
58
|
+
apiToken: this.authToken,
|
|
59
|
+
customFetch: this.customFetch,
|
|
60
|
+
payload: args,
|
|
61
|
+
requestId: requestId,
|
|
62
|
+
});
|
|
63
|
+
return validateGoal(response.data);
|
|
64
|
+
}
|
|
65
|
+
async updateGoal(id, args, requestId) {
|
|
66
|
+
z.string().parse(id);
|
|
67
|
+
const response = await request({
|
|
68
|
+
httpMethod: 'POST',
|
|
69
|
+
baseUri: this.syncApiBase,
|
|
70
|
+
relativePath: generatePath(ENDPOINT_REST_GOALS, id),
|
|
71
|
+
apiToken: this.authToken,
|
|
72
|
+
customFetch: this.customFetch,
|
|
73
|
+
payload: args,
|
|
74
|
+
requestId: requestId,
|
|
75
|
+
});
|
|
76
|
+
return validateGoal(response.data);
|
|
77
|
+
}
|
|
78
|
+
async deleteGoal(id, requestId) {
|
|
79
|
+
z.string().parse(id);
|
|
80
|
+
const response = await request({
|
|
81
|
+
httpMethod: 'DELETE',
|
|
82
|
+
baseUri: this.syncApiBase,
|
|
83
|
+
relativePath: generatePath(ENDPOINT_REST_GOALS, id),
|
|
84
|
+
apiToken: this.authToken,
|
|
85
|
+
customFetch: this.customFetch,
|
|
86
|
+
requestId: requestId,
|
|
87
|
+
});
|
|
88
|
+
return isSuccess(response);
|
|
89
|
+
}
|
|
90
|
+
async completeGoal(id, requestId) {
|
|
91
|
+
z.string().parse(id);
|
|
92
|
+
const response = await request({
|
|
93
|
+
httpMethod: 'POST',
|
|
94
|
+
baseUri: this.syncApiBase,
|
|
95
|
+
relativePath: generatePath(ENDPOINT_REST_GOALS, id, GOAL_COMPLETE),
|
|
96
|
+
apiToken: this.authToken,
|
|
97
|
+
customFetch: this.customFetch,
|
|
98
|
+
requestId: requestId,
|
|
99
|
+
});
|
|
100
|
+
return validateGoal(response.data);
|
|
101
|
+
}
|
|
102
|
+
async uncompleteGoal(id, requestId) {
|
|
103
|
+
z.string().parse(id);
|
|
104
|
+
const response = await request({
|
|
105
|
+
httpMethod: 'POST',
|
|
106
|
+
baseUri: this.syncApiBase,
|
|
107
|
+
relativePath: generatePath(ENDPOINT_REST_GOALS, id, GOAL_UNCOMPLETE),
|
|
108
|
+
apiToken: this.authToken,
|
|
109
|
+
customFetch: this.customFetch,
|
|
110
|
+
requestId: requestId,
|
|
111
|
+
});
|
|
112
|
+
return validateGoal(response.data);
|
|
113
|
+
}
|
|
114
|
+
async linkTaskToGoal({ goalId, taskId }, requestId) {
|
|
115
|
+
z.string().parse(goalId);
|
|
116
|
+
z.string().parse(taskId);
|
|
117
|
+
const response = await request({
|
|
118
|
+
httpMethod: 'POST',
|
|
119
|
+
baseUri: this.syncApiBase,
|
|
120
|
+
relativePath: generatePath(ENDPOINT_REST_GOALS, goalId, GOAL_TASKS),
|
|
121
|
+
apiToken: this.authToken,
|
|
122
|
+
customFetch: this.customFetch,
|
|
123
|
+
payload: { itemId: taskId },
|
|
124
|
+
requestId: requestId,
|
|
125
|
+
});
|
|
126
|
+
return validateGoal(response.data);
|
|
127
|
+
}
|
|
128
|
+
async unlinkTaskFromGoal({ goalId, taskId }, requestId) {
|
|
129
|
+
z.string().parse(goalId);
|
|
130
|
+
z.string().parse(taskId);
|
|
131
|
+
const response = await request({
|
|
132
|
+
httpMethod: 'DELETE',
|
|
133
|
+
baseUri: this.syncApiBase,
|
|
134
|
+
relativePath: generatePath(ENDPOINT_REST_GOALS, goalId, GOAL_TASKS, taskId),
|
|
135
|
+
apiToken: this.authToken,
|
|
136
|
+
customFetch: this.customFetch,
|
|
137
|
+
requestId: requestId,
|
|
138
|
+
});
|
|
139
|
+
return isSuccess(response);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
@@ -70,6 +70,11 @@ export const ENDPOINT_GET_TOKEN = 'access_token';
|
|
|
70
70
|
export const ENDPOINT_REVOKE = 'revoke';
|
|
71
71
|
export const ENDPOINT_REGISTER = 'register';
|
|
72
72
|
export const ENDPOINT_REST_FOLDERS = 'folders';
|
|
73
|
+
export const ENDPOINT_REST_GOALS = 'goals';
|
|
74
|
+
export const ENDPOINT_REST_GOALS_SEARCH = ENDPOINT_REST_GOALS + '/search';
|
|
75
|
+
export const GOAL_COMPLETE = 'complete';
|
|
76
|
+
export const GOAL_UNCOMPLETE = 'uncomplete';
|
|
77
|
+
export const GOAL_TASKS = 'items';
|
|
73
78
|
// Workspace endpoints
|
|
74
79
|
export const ENDPOINT_REST_WORKSPACES = 'workspaces';
|
|
75
80
|
export const ENDPOINT_WORKSPACE_INVITATIONS = 'workspaces/invitations';
|
|
@@ -277,6 +277,30 @@ export const DEFAULT_COLLABORATOR_STATE = {
|
|
|
277
277
|
state: 'active',
|
|
278
278
|
isDeleted: false,
|
|
279
279
|
};
|
|
280
|
+
export const DEFAULT_GOAL_ID = '550e8400-e29b-41d4-a716-446655440000';
|
|
281
|
+
export const DEFAULT_GOAL = {
|
|
282
|
+
id: DEFAULT_GOAL_ID,
|
|
283
|
+
ownerType: 'USER',
|
|
284
|
+
ownerId: DEFAULT_USER_ID,
|
|
285
|
+
name: 'Ship v2',
|
|
286
|
+
description: 'Launch the new version',
|
|
287
|
+
deadline: '2026-04-03',
|
|
288
|
+
parentGoalId: null,
|
|
289
|
+
childOrder: 0,
|
|
290
|
+
isCompleted: false,
|
|
291
|
+
completedAt: null,
|
|
292
|
+
responsibleUid: null,
|
|
293
|
+
isDeleted: false,
|
|
294
|
+
progress: {
|
|
295
|
+
totalTaskCount: 5,
|
|
296
|
+
completedTaskCount: 2,
|
|
297
|
+
percentage: 40,
|
|
298
|
+
},
|
|
299
|
+
creatorUid: DEFAULT_USER_ID,
|
|
300
|
+
createdAt: defaultDate(),
|
|
301
|
+
updatedAt: defaultDate(),
|
|
302
|
+
};
|
|
303
|
+
export const DEFAULT_GOAL_NO_PROGRESS = Object.assign(Object.assign({}, DEFAULT_GOAL), { id: 'e5f6g7h8-e29b-41d4-a716-446655440001', progress: undefined });
|
|
280
304
|
export const DEFAULT_APP_ID = '42';
|
|
281
305
|
export const DEFAULT_INSTALLATION_ID = '1001';
|
|
282
306
|
export const DEFAULT_UI_EXTENSION_ID = '2002';
|
package/dist/esm/todoist-api.js
CHANGED
|
@@ -4,6 +4,7 @@ import { BackupClient } from './clients/backup-client.js';
|
|
|
4
4
|
import { CommentClient } from './clients/comment-client.js';
|
|
5
5
|
import { EmailClient } from './clients/email-client.js';
|
|
6
6
|
import { FolderClient } from './clients/folder-client.js';
|
|
7
|
+
import { GoalsClient } from './clients/goals-client.js';
|
|
7
8
|
import { IdMappingClient } from './clients/id-mapping-client.js';
|
|
8
9
|
import { InsightsClient } from './clients/insights-client.js';
|
|
9
10
|
import { LabelClient } from './clients/label-client.js';
|
|
@@ -58,6 +59,7 @@ export class TodoistApi {
|
|
|
58
59
|
this.activityClient = new ActivityClient(clientDeps);
|
|
59
60
|
this.productivityClient = new ProductivityClient(clientDeps);
|
|
60
61
|
this.workspaceClient = new WorkspaceClient(clientDeps);
|
|
62
|
+
this.goalsClient = new GoalsClient(clientDeps);
|
|
61
63
|
this.appClient = new AppClient(clientDeps);
|
|
62
64
|
this.uiExtensionClient = new UiExtensionClient(clientDeps);
|
|
63
65
|
}
|
|
@@ -939,6 +941,37 @@ export class TodoistApi {
|
|
|
939
941
|
async deleteFolder(id, requestId) {
|
|
940
942
|
return this.folderClient.deleteFolder(id, requestId);
|
|
941
943
|
}
|
|
944
|
+
// ── Goals ──
|
|
945
|
+
async getGoals(args) {
|
|
946
|
+
return this.goalsClient.getGoals(args);
|
|
947
|
+
}
|
|
948
|
+
async searchGoals(args) {
|
|
949
|
+
return this.goalsClient.searchGoals(args);
|
|
950
|
+
}
|
|
951
|
+
async getGoal(id) {
|
|
952
|
+
return this.goalsClient.getGoal(id);
|
|
953
|
+
}
|
|
954
|
+
async addGoal(args, requestId) {
|
|
955
|
+
return this.goalsClient.addGoal(args, requestId);
|
|
956
|
+
}
|
|
957
|
+
async updateGoal(id, args, requestId) {
|
|
958
|
+
return this.goalsClient.updateGoal(id, args, requestId);
|
|
959
|
+
}
|
|
960
|
+
async deleteGoal(id, requestId) {
|
|
961
|
+
return this.goalsClient.deleteGoal(id, requestId);
|
|
962
|
+
}
|
|
963
|
+
async completeGoal(id, requestId) {
|
|
964
|
+
return this.goalsClient.completeGoal(id, requestId);
|
|
965
|
+
}
|
|
966
|
+
async uncompleteGoal(id, requestId) {
|
|
967
|
+
return this.goalsClient.uncompleteGoal(id, requestId);
|
|
968
|
+
}
|
|
969
|
+
async linkTaskToGoal(args, requestId) {
|
|
970
|
+
return this.goalsClient.linkTaskToGoal(args, requestId);
|
|
971
|
+
}
|
|
972
|
+
async unlinkTaskFromGoal(args, requestId) {
|
|
973
|
+
return this.goalsClient.unlinkTaskFromGoal(args, requestId);
|
|
974
|
+
}
|
|
942
975
|
// ── Backups ──
|
|
943
976
|
/**
|
|
944
977
|
* Retrieves a list of available backups.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { z } from 'zod';
|
|
13
|
+
/** Available goal owner types. */
|
|
14
|
+
export const GOAL_OWNER_TYPES = ['USER', 'WORKSPACE'];
|
|
15
|
+
/**
|
|
16
|
+
* Progress of a {@link Goal}.
|
|
17
|
+
*
|
|
18
|
+
* The REST API returns these counts under `total_item_count` / `completed_item_count`,
|
|
19
|
+
* reflecting the backend's generic "item" terminology. The SDK normalizes them to
|
|
20
|
+
* `totalTaskCount` / `completedTaskCount` so the public surface consistently speaks
|
|
21
|
+
* in "tasks" (matching the rest of the SDK). The `preprocess` step below performs
|
|
22
|
+
* that rename after the transport layer's snake_case → camelCase conversion — do not
|
|
23
|
+
* remove it without also changing the downstream field names.
|
|
24
|
+
*/
|
|
25
|
+
export const GoalProgressSchema = z.preprocess((raw) => {
|
|
26
|
+
if (raw === null || raw === undefined || typeof raw !== 'object' || Array.isArray(raw)) {
|
|
27
|
+
return raw;
|
|
28
|
+
}
|
|
29
|
+
const _a = raw, { totalItemCount, completedItemCount, totalTaskCount, completedTaskCount } = _a, rest = __rest(_a, ["totalItemCount", "completedItemCount", "totalTaskCount", "completedTaskCount"]);
|
|
30
|
+
return Object.assign(Object.assign({}, rest), { totalTaskCount: totalTaskCount !== null && totalTaskCount !== void 0 ? totalTaskCount : totalItemCount, completedTaskCount: completedTaskCount !== null && completedTaskCount !== void 0 ? completedTaskCount : completedItemCount });
|
|
31
|
+
}, z.looseObject({
|
|
32
|
+
totalTaskCount: z.number().int(),
|
|
33
|
+
completedTaskCount: z.number().int(),
|
|
34
|
+
percentage: z.number(),
|
|
35
|
+
}));
|
|
36
|
+
export const GoalSchema = z.looseObject({
|
|
37
|
+
id: z.string(),
|
|
38
|
+
ownerType: z.enum(GOAL_OWNER_TYPES),
|
|
39
|
+
ownerId: z.string(),
|
|
40
|
+
name: z.string(),
|
|
41
|
+
description: z.string().nullable(),
|
|
42
|
+
deadline: z.string().nullable(),
|
|
43
|
+
parentGoalId: z.string().nullable(),
|
|
44
|
+
childOrder: z.number().int(),
|
|
45
|
+
isCompleted: z.boolean(),
|
|
46
|
+
completedAt: z.coerce.date().nullable(),
|
|
47
|
+
responsibleUid: z.string().nullable(),
|
|
48
|
+
isDeleted: z.boolean(),
|
|
49
|
+
progress: GoalProgressSchema.optional(),
|
|
50
|
+
creatorUid: z.string(),
|
|
51
|
+
createdAt: z.coerce.date(),
|
|
52
|
+
updatedAt: z.coerce.date(),
|
|
53
|
+
});
|
package/dist/esm/types/index.js
CHANGED
|
@@ -9,6 +9,7 @@ export * from './productivity/index.js';
|
|
|
9
9
|
export * from './activity/index.js';
|
|
10
10
|
export * from './workspaces/index.js';
|
|
11
11
|
export * from './folders/index.js';
|
|
12
|
+
export * from './goals/index.js';
|
|
12
13
|
export * from './insights/index.js';
|
|
13
14
|
export * from './backups/index.js';
|
|
14
15
|
export * from './id-mappings/index.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -11,6 +11,7 @@ export * from './workspaces.js';
|
|
|
11
11
|
export * from './folders.js';
|
|
12
12
|
export * from './workspace-filters.js';
|
|
13
13
|
export * from './workspace-goals.js';
|
|
14
|
+
export * from './goals.js';
|
|
14
15
|
export * from './notifications.js';
|
|
15
16
|
export * from './sharing.js';
|
|
16
17
|
export * from './view-options.js';
|
|
@@ -13,8 +13,8 @@ export const QuickAddFeatureSchema = z.object({
|
|
|
13
13
|
export const UserSettingsSchema = z.looseObject({
|
|
14
14
|
completedSoundDesktop: z.boolean(),
|
|
15
15
|
completedSoundMobile: z.boolean(),
|
|
16
|
-
debugLogSendingEnabledUntil: z.string().
|
|
17
|
-
legacyPricing: z.boolean(),
|
|
16
|
+
debugLogSendingEnabledUntil: z.string().nullish(),
|
|
17
|
+
legacyPricing: z.union([z.boolean(), z.literal(0), z.literal(1)]).transform(Boolean),
|
|
18
18
|
navigation: z
|
|
19
19
|
.object({
|
|
20
20
|
countsShown: z.boolean(),
|
|
@@ -50,7 +50,7 @@ export const SyncUserSchema = z.looseObject({
|
|
|
50
50
|
businessAccountId: z.string().nullable(),
|
|
51
51
|
dailyGoal: z.number().int(),
|
|
52
52
|
dateFormat: DateFormatSchema,
|
|
53
|
-
dateistLang: z.string().
|
|
53
|
+
dateistLang: z.string().nullish(),
|
|
54
54
|
daysOff: z.array(z.number().int()),
|
|
55
55
|
featureIdentifier: z.string(),
|
|
56
56
|
features: FeaturesSchema,
|
|
@@ -69,8 +69,8 @@ export const SyncUserSchema = z.looseObject({
|
|
|
69
69
|
karmaTrend: z.string(),
|
|
70
70
|
lang: z.string(),
|
|
71
71
|
mfaEnabled: z.boolean().optional(),
|
|
72
|
-
mobileHost: z.string().
|
|
73
|
-
mobileNumber: z.string().
|
|
72
|
+
mobileHost: z.string().nullish(),
|
|
73
|
+
mobileNumber: z.string().nullish(),
|
|
74
74
|
nextWeek: DayOfWeekSchema,
|
|
75
75
|
onboardingLevel: z.string().nullable().optional(),
|
|
76
76
|
onboardingRole: z.string().nullable().optional(),
|
|
@@ -97,7 +97,7 @@ export const SyncUserSchema = z.looseObject({
|
|
|
97
97
|
startPage: z.string(),
|
|
98
98
|
themeId: z.string(),
|
|
99
99
|
timeFormat: TimeFormatSchema,
|
|
100
|
-
token: z.string(),
|
|
100
|
+
token: z.string().optional(),
|
|
101
101
|
tzInfo: TzInfoSchema,
|
|
102
102
|
uniquePrefix: z.number().int(),
|
|
103
103
|
verificationStatus: z.string(),
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { GoalSchema } from '../goals/types.js';
|
|
2
3
|
import { LabelSchema } from '../labels/types.js';
|
|
3
4
|
import { ProjectSchema } from '../projects/types.js';
|
|
4
5
|
import { SectionSchema } from '../sections/types.js';
|
|
@@ -43,6 +44,7 @@ export const SyncResponseSchema = z.looseObject({
|
|
|
43
44
|
projectViewOptionsDefaults: z.array(ProjectViewOptionsDefaultsSchema).optional(),
|
|
44
45
|
roleActions: z.array(z.record(z.string(), z.unknown())).optional(),
|
|
45
46
|
folders: z.array(FolderSchema).optional(),
|
|
47
|
+
goals: z.array(GoalSchema).optional(),
|
|
46
48
|
workspaceGoals: z.array(WorkspaceGoalSchema).optional(),
|
|
47
49
|
dayOrders: z.record(z.string(), z.number()).optional(),
|
|
48
50
|
calendars: z.array(CalendarSchema).optional(),
|
|
@@ -3,6 +3,7 @@ import { ActivityEventSchema } from '../types/activity/types.js';
|
|
|
3
3
|
import { AppSchema, AppWithUserCountSchema, AppSecretsSchema, AppVerificationTokenSchema, AppTestTokenSchema, AppDistributionTokenSchema, AppByDistributionTokenSchema, AppWebhookSchema, AppInstallationSchema, UserAuthorizationSchema, } from '../types/apps/types.js';
|
|
4
4
|
import { BackupSchema } from '../types/backups/types.js';
|
|
5
5
|
import { AttachmentSchema, CommentSchema } from '../types/comments/types.js';
|
|
6
|
+
import { GoalSchema } from '../types/goals/types.js';
|
|
6
7
|
import { IdMappingSchema, MovedIdSchema } from '../types/id-mappings/types.js';
|
|
7
8
|
import { ProjectActivityStatsSchema, ProjectHealthSchema, ProjectHealthContextSchema, ProjectProgressSchema, WorkspaceInsightsSchema, } from '../types/insights/types.js';
|
|
8
9
|
import { LabelSchema } from '../types/labels/types.js';
|
|
@@ -63,6 +64,7 @@ export const { validate: validateFilter, validateArray: validateFilterArray } =
|
|
|
63
64
|
export const { validate: validateCollaborator, validateArray: validateCollaboratorArray } = createValidator(CollaboratorSchema);
|
|
64
65
|
export const { validate: validateCollaboratorState, validateArray: validateCollaboratorStateArray, } = createValidator(CollaboratorStateSchema);
|
|
65
66
|
export const { validate: validateFolder, validateArray: validateFolderArray } = createValidator(FolderSchema);
|
|
67
|
+
export const { validate: validateGoal, validateArray: validateGoalArray } = createValidator(GoalSchema);
|
|
66
68
|
export const { validate: validateNote, validateArray: validateNoteArray } = createValidator(NoteSchema);
|
|
67
69
|
export const { validate: validateTooltips } = createValidator(TooltipsSchema);
|
|
68
70
|
export const { validate: validateWorkspaceFilter, validateArray: validateWorkspaceFilterArray } = createValidator(WorkspaceFilterSchema);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { AddGoalArgs, GetGoalsArgs, GetGoalsResponse, Goal, SearchGoalsArgs, TaskLinkingArgs, UpdateGoalArgs } from '../types/goals/index.js';
|
|
2
|
+
import { BaseClient } from './base-client.js';
|
|
3
|
+
/**
|
|
4
|
+
* Internal sub-client handling all goal-domain endpoints.
|
|
5
|
+
*
|
|
6
|
+
* Instantiated by `TodoistApi`; every public goal method on `TodoistApi`
|
|
7
|
+
* delegates here. See `todoist-api.ts` for the user-facing JSDoc.
|
|
8
|
+
*/
|
|
9
|
+
export declare class GoalsClient extends BaseClient {
|
|
10
|
+
getGoals(args?: GetGoalsArgs): Promise<GetGoalsResponse>;
|
|
11
|
+
searchGoals(args: SearchGoalsArgs): Promise<GetGoalsResponse>;
|
|
12
|
+
getGoal(id: string): Promise<Goal>;
|
|
13
|
+
addGoal(args: AddGoalArgs, requestId?: string): Promise<Goal>;
|
|
14
|
+
updateGoal(id: string, args: UpdateGoalArgs, requestId?: string): Promise<Goal>;
|
|
15
|
+
deleteGoal(id: string, requestId?: string): Promise<boolean>;
|
|
16
|
+
completeGoal(id: string, requestId?: string): Promise<Goal>;
|
|
17
|
+
uncompleteGoal(id: string, requestId?: string): Promise<Goal>;
|
|
18
|
+
linkTaskToGoal({ goalId, taskId }: TaskLinkingArgs, requestId?: string): Promise<Goal>;
|
|
19
|
+
unlinkTaskFromGoal({ goalId, taskId }: TaskLinkingArgs, requestId?: string): Promise<boolean>;
|
|
20
|
+
}
|
|
@@ -59,6 +59,11 @@ export declare const ENDPOINT_GET_TOKEN = "access_token";
|
|
|
59
59
|
export declare const ENDPOINT_REVOKE = "revoke";
|
|
60
60
|
export declare const ENDPOINT_REGISTER = "register";
|
|
61
61
|
export declare const ENDPOINT_REST_FOLDERS = "folders";
|
|
62
|
+
export declare const ENDPOINT_REST_GOALS = "goals";
|
|
63
|
+
export declare const ENDPOINT_REST_GOALS_SEARCH: string;
|
|
64
|
+
export declare const GOAL_COMPLETE = "complete";
|
|
65
|
+
export declare const GOAL_UNCOMPLETE = "uncomplete";
|
|
66
|
+
export declare const GOAL_TASKS = "items";
|
|
62
67
|
export declare const ENDPOINT_REST_WORKSPACES = "workspaces";
|
|
63
68
|
export declare const ENDPOINT_WORKSPACE_INVITATIONS = "workspaces/invitations";
|
|
64
69
|
export declare const ENDPOINT_WORKSPACE_INVITATIONS_ALL = "workspaces/invitations/all";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Label, Section, Task, User, Attachment, Duration, Deadline, RawComment, PersonalProject, WorkspaceProject, Reminder, Folder, App, AppWithUserCount, AppSecrets, AppVerificationToken, AppTestToken, AppDistributionToken, AppWebhook, AppInstallation, UserAuthorization, UiExtension } from '../types/index.js';
|
|
1
|
+
import { Label, Section, Task, User, Attachment, Duration, Deadline, RawComment, PersonalProject, WorkspaceProject, Reminder, Folder, Goal, App, AppWithUserCount, AppSecrets, AppVerificationToken, AppTestToken, AppDistributionToken, AppWebhook, AppInstallation, UserAuthorization, UiExtension } from '../types/index.js';
|
|
2
2
|
import type { Collaborator, CollaboratorState } from '../types/sync/resources/collaborators.js';
|
|
3
3
|
import type { Note } from '../types/sync/resources/notes.js';
|
|
4
4
|
export declare const DEFAULT_TASK_ID = "1234";
|
|
@@ -264,6 +264,9 @@ export declare const COMMENT_WITH_OPTIONALS_AS_NULL_PROJECT: {
|
|
|
264
264
|
export declare const DEFAULT_FOLDER: Folder;
|
|
265
265
|
export declare const DEFAULT_COLLABORATOR: Collaborator;
|
|
266
266
|
export declare const DEFAULT_COLLABORATOR_STATE: CollaboratorState;
|
|
267
|
+
export declare const DEFAULT_GOAL_ID = "550e8400-e29b-41d4-a716-446655440000";
|
|
268
|
+
export declare const DEFAULT_GOAL: Goal;
|
|
269
|
+
export declare const DEFAULT_GOAL_NO_PROGRESS: Goal;
|
|
267
270
|
export declare const DEFAULT_APP_ID = "42";
|
|
268
271
|
export declare const DEFAULT_INSTALLATION_ID = "1001";
|
|
269
272
|
export declare const DEFAULT_UI_EXTENSION_ID = "2002";
|