@doist/todoist-sdk 8.1.0 → 8.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -24
- package/dist/cjs/authentication.js +2 -2
- package/dist/cjs/test-utils/msw-setup.js +2 -2
- package/dist/cjs/todoist-api.js +14 -9
- package/dist/cjs/types/reminders/requests.js +1 -1
- 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/goals.js +33 -0
- package/dist/cjs/types/sync/resources/index.js +1 -0
- package/dist/cjs/types/tasks/types.js +1 -1
- package/dist/cjs/utils/validators.js +36 -36
- package/dist/esm/authentication.js +2 -2
- package/dist/esm/test-utils/msw-setup.js +2 -2
- package/dist/esm/todoist-api.js +14 -9
- package/dist/esm/types/reminders/requests.js +1 -1
- 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/goals.js +30 -0
- package/dist/esm/types/sync/resources/index.js +1 -0
- package/dist/esm/types/tasks/types.js +1 -1
- package/dist/esm/utils/validators.js +8 -8
- package/dist/types/todoist-api.d.ts +16 -16
- package/dist/types/types/projects/requests.d.ts +1 -1
- package/dist/types/types/sync/commands/goals.d.ts +33 -0
- package/dist/types/types/sync/commands/index.d.ts +21 -12
- package/dist/types/types/sync/commands/projects.d.ts +1 -1
- package/dist/types/types/sync/commands/reminders.d.ts +1 -1
- package/dist/types/types/sync/resource-types.d.ts +1 -1
- package/dist/types/types/sync/resources/goals.d.ts +37 -0
- package/dist/types/types/sync/resources/index.d.ts +1 -0
- package/dist/types/types/sync/resources/view-options.d.ts +9 -9
- package/dist/types/types/sync/response.d.ts +4 -3
- package/dist/types/utils/validators.d.ts +8 -8
- package/package.json +6 -11
package/README.md
CHANGED
|
@@ -34,21 +34,21 @@ If you're migrating from an older version of the Todoist API (v9), please refer
|
|
|
34
34
|
|
|
35
35
|
Key changes in v1 include:
|
|
36
36
|
|
|
37
|
-
-
|
|
38
|
-
-
|
|
39
|
-
-
|
|
40
|
-
-
|
|
41
|
-
-
|
|
37
|
+
- Updated endpoint structure
|
|
38
|
+
- New pagination system
|
|
39
|
+
- Unified error response format
|
|
40
|
+
- Object renames (e.g., items → tasks, notes → comments)
|
|
41
|
+
- URL renames and endpoint signature changes
|
|
42
42
|
|
|
43
43
|
## Custom HTTP Clients
|
|
44
44
|
|
|
45
45
|
The Todoist API client supports custom HTTP implementations to enable usage in environments with specific networking requirements, such as:
|
|
46
46
|
|
|
47
|
-
-
|
|
48
|
-
-
|
|
49
|
-
-
|
|
50
|
-
-
|
|
51
|
-
-
|
|
47
|
+
- **Obsidian plugins** - Desktop app with strict CORS policies
|
|
48
|
+
- **Browser extensions** - Custom HTTP APIs with different security models
|
|
49
|
+
- **Electron apps** - Requests routed through IPC layer
|
|
50
|
+
- **React Native** - Different networking stack
|
|
51
|
+
- **Enterprise environments** - Proxy configuration, custom headers, or certificate handling
|
|
52
52
|
|
|
53
53
|
### Basic Usage
|
|
54
54
|
|
|
@@ -106,20 +106,20 @@ const { accessToken } = await getAuthToken(args, baseUrl)
|
|
|
106
106
|
|
|
107
107
|
### Important Notes
|
|
108
108
|
|
|
109
|
-
-
|
|
110
|
-
-
|
|
111
|
-
-
|
|
112
|
-
-
|
|
113
|
-
-
|
|
109
|
+
- All existing transforms (snake_case ↔ camelCase) work automatically with custom fetch
|
|
110
|
+
- Retry logic and error handling are preserved
|
|
111
|
+
- File uploads work with custom fetch implementations
|
|
112
|
+
- The custom fetch function should handle FormData for multipart uploads
|
|
113
|
+
- Timeout parameter is optional and up to your custom implementation
|
|
114
114
|
|
|
115
115
|
## Development and Testing
|
|
116
116
|
|
|
117
117
|
Instead of having an example app in the repository to assist development and testing, we have included [ts-node](https://github.com/TypeStrong/ts-node) as a dev dependency. This allows us to have a scratch file locally that can import and utilize the API while developing or reviewing pull requests without having to manage a separate app project.
|
|
118
118
|
|
|
119
|
-
-
|
|
120
|
-
-
|
|
121
|
-
-
|
|
122
|
-
-
|
|
119
|
+
- `npm install`
|
|
120
|
+
- Add a file named `scratch.ts` in the `src` folder.
|
|
121
|
+
- Configure your IDE to run the scratch file with `ts-node` (instructions for [VSCode](https://medium.com/@dupski/debug-typescript-in-vs-code-without-compiling-using-ts-node-9d1f4f9a94a), [WebStorm](https://www.jetbrains.com/help/webstorm/running-and-debugging-typescript.html#ws_ts_run_debug_server_side_ts_node)), or you can optionally run ts-node in a terminal using instructions [here](https://github.com/TypeStrong/ts-node) (`npx ts-node ./src/scratch.ts` should be enough).
|
|
122
|
+
- Import and call the relevant modules and run the scratch file.
|
|
123
123
|
|
|
124
124
|
Example scratch.ts file:
|
|
125
125
|
|
|
@@ -169,10 +169,10 @@ This project uses [Release Please](https://github.com/googleapis/release-please)
|
|
|
169
169
|
|
|
170
170
|
When making changes, use conventional commit messages:
|
|
171
171
|
|
|
172
|
-
-
|
|
173
|
-
-
|
|
174
|
-
-
|
|
175
|
-
-
|
|
172
|
+
- `feat:` - New features (triggers a minor version bump)
|
|
173
|
+
- `fix:` - Bug fixes (triggers a patch version bump)
|
|
174
|
+
- `feat!:` or `BREAKING CHANGE:` - Breaking changes (triggers a major version bump)
|
|
175
|
+
- `chore:`, `docs:`, `refactor:`, `perf:` - Other changes (included in changelog)
|
|
176
176
|
|
|
177
177
|
Example:
|
|
178
178
|
|
|
@@ -187,7 +187,6 @@ feat!: remove deprecated getTask method
|
|
|
187
187
|
The release process is fully automated:
|
|
188
188
|
|
|
189
189
|
1. **Automatic PR Creation**: When commits are merged to `main`, Release Please automatically creates or updates a release PR with:
|
|
190
|
-
|
|
191
190
|
- Updated version in `package.json`
|
|
192
191
|
- Updated `CHANGELOG.md`
|
|
193
192
|
- Aggregated changes since the last release
|
|
@@ -18,10 +18,10 @@ exports.getAuthToken = getAuthToken;
|
|
|
18
18
|
exports.revokeToken = revokeToken;
|
|
19
19
|
exports.migratePersonalToken = migratePersonalToken;
|
|
20
20
|
exports.registerClient = registerClient;
|
|
21
|
-
const http_client_1 = require("./transport/http-client");
|
|
22
21
|
const uuid_1 = require("uuid");
|
|
23
|
-
const types_1 = require("./types");
|
|
24
22
|
const endpoints_1 = require("./consts/endpoints");
|
|
23
|
+
const http_client_1 = require("./transport/http-client");
|
|
24
|
+
const types_1 = require("./types");
|
|
25
25
|
/** Available OAuth2 permission scopes. */
|
|
26
26
|
exports.PERMISSIONS = [
|
|
27
27
|
'task:add',
|
|
@@ -7,11 +7,11 @@ exports.getAllRequests = getAllRequests;
|
|
|
7
7
|
exports.clearCapturedRequests = clearCapturedRequests;
|
|
8
8
|
exports.mockApiResponse = mockApiResponse;
|
|
9
9
|
exports.mockApiError = mockApiError;
|
|
10
|
-
const vitest_1 = require("vitest");
|
|
11
|
-
const node_1 = require("msw/node");
|
|
12
10
|
const msw_1 = require("msw");
|
|
13
11
|
Object.defineProperty(exports, "http", { enumerable: true, get: function () { return msw_1.http; } });
|
|
14
12
|
Object.defineProperty(exports, "HttpResponse", { enumerable: true, get: function () { return msw_1.HttpResponse; } });
|
|
13
|
+
const node_1 = require("msw/node");
|
|
14
|
+
const vitest_1 = require("vitest");
|
|
15
15
|
// Request capture storage
|
|
16
16
|
const capturedRequests = [];
|
|
17
17
|
// Helper function to capture requests
|
package/dist/cjs/todoist-api.js
CHANGED
|
@@ -12,20 +12,21 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
12
12
|
};
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
14
|
exports.TodoistApi = void 0;
|
|
15
|
+
const zod_1 = require("zod");
|
|
16
|
+
const endpoints_1 = require("./consts/endpoints");
|
|
17
|
+
const http_client_1 = require("./transport/http-client");
|
|
15
18
|
const projects_1 = require("./types/projects");
|
|
16
19
|
const reminders_1 = require("./types/reminders");
|
|
17
|
-
const
|
|
18
|
-
const endpoints_1 = require("./consts/endpoints");
|
|
19
|
-
const validators_1 = require("./utils/validators");
|
|
20
|
-
const url_helpers_1 = require("./utils/url-helpers");
|
|
21
|
-
const multipart_upload_1 = require("./utils/multipart-upload");
|
|
22
|
-
const case_conversion_1 = require("./utils/case-conversion");
|
|
20
|
+
const goals_1 = require("./types/sync/resources/goals");
|
|
23
21
|
const activity_helpers_1 = require("./utils/activity-helpers");
|
|
22
|
+
const case_conversion_1 = require("./utils/case-conversion");
|
|
23
|
+
const multipart_upload_1 = require("./utils/multipart-upload");
|
|
24
24
|
const uncompletable_helpers_1 = require("./utils/uncompletable-helpers");
|
|
25
|
-
const
|
|
25
|
+
const url_helpers_1 = require("./utils/url-helpers");
|
|
26
|
+
const validators_1 = require("./utils/validators");
|
|
26
27
|
const uuid_1 = require("uuid");
|
|
27
|
-
const sync_1 = require("./types/sync");
|
|
28
28
|
const types_1 = require("./types");
|
|
29
|
+
const sync_1 = require("./types/sync");
|
|
29
30
|
const MAX_COMMAND_COUNT = 100;
|
|
30
31
|
/**
|
|
31
32
|
* Joins path segments using `/` separator.
|
|
@@ -135,7 +136,11 @@ class TodoistApi {
|
|
|
135
136
|
throw new types_1.TodoistRequestError(value.error, value.httpCode, value.errorExtra);
|
|
136
137
|
});
|
|
137
138
|
}
|
|
138
|
-
|
|
139
|
+
const data = response.data;
|
|
140
|
+
if (data.goals) {
|
|
141
|
+
data.goals = data.goals.map((goal) => goals_1.GoalSchema.parse(goal));
|
|
142
|
+
}
|
|
143
|
+
return data;
|
|
139
144
|
}
|
|
140
145
|
/**
|
|
141
146
|
* Executes a raw Sync API request.
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.UpdateLocationReminderArgsSchema = exports.UpdateReminderArgsSchema = exports.UpdateAbsoluteReminderArgsSchema = exports.UpdateRelativeReminderArgsSchema = exports.AddLocationReminderArgsSchema = exports.AddReminderArgsSchema = exports.AddAbsoluteReminderArgsSchema = exports.AddRelativeReminderArgsSchema = exports.ReminderDueDateSchema = exports.ReminderIdSchema = exports.ReminderDeliveryServiceSchema = exports.REMINDER_DELIVERY_SERVICES = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
-
const types_1 = require("../tasks/types");
|
|
6
5
|
const reminders_1 = require("../sync/resources/reminders");
|
|
6
|
+
const types_1 = require("../tasks/types");
|
|
7
7
|
/** Available reminder delivery services. */
|
|
8
8
|
exports.REMINDER_DELIVERY_SERVICES = ['email', 'push'];
|
|
9
9
|
exports.ReminderDeliveryServiceSchema = zod_1.z.enum(exports.REMINDER_DELIVERY_SERVICES);
|
|
@@ -27,6 +27,7 @@ __exportStar(require("./workspaces"), exports);
|
|
|
27
27
|
__exportStar(require("./folders"), exports);
|
|
28
28
|
__exportStar(require("./workspace-filters"), exports);
|
|
29
29
|
__exportStar(require("./workspace-goals"), exports);
|
|
30
|
+
__exportStar(require("./goals"), exports);
|
|
30
31
|
__exportStar(require("./notifications"), exports);
|
|
31
32
|
__exportStar(require("./sharing"), exports);
|
|
32
33
|
__exportStar(require("./view-options"), exports);
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GoalSchema = exports.GoalProgressSchema = exports.GOAL_OWNER_TYPES = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
/** Available goal owner types. */
|
|
6
|
+
exports.GOAL_OWNER_TYPES = ['USER', 'WORKSPACE'];
|
|
7
|
+
exports.GoalProgressSchema = zod_1.z
|
|
8
|
+
.object({
|
|
9
|
+
totalItemCount: zod_1.z.number().int(),
|
|
10
|
+
completedItemCount: zod_1.z.number().int(),
|
|
11
|
+
percentage: zod_1.z.number(),
|
|
12
|
+
})
|
|
13
|
+
.passthrough();
|
|
14
|
+
exports.GoalSchema = zod_1.z
|
|
15
|
+
.object({
|
|
16
|
+
id: zod_1.z.string(),
|
|
17
|
+
ownerType: zod_1.z.enum(exports.GOAL_OWNER_TYPES),
|
|
18
|
+
ownerId: zod_1.z.string(),
|
|
19
|
+
name: zod_1.z.string(),
|
|
20
|
+
description: zod_1.z.string().nullable(),
|
|
21
|
+
deadline: zod_1.z.string().nullable(),
|
|
22
|
+
parentGoalId: zod_1.z.string().nullable(),
|
|
23
|
+
childOrder: zod_1.z.number().int(),
|
|
24
|
+
isCompleted: zod_1.z.boolean(),
|
|
25
|
+
completedAt: zod_1.z.coerce.date().nullable(),
|
|
26
|
+
responsibleUid: zod_1.z.string().nullable(),
|
|
27
|
+
isDeleted: zod_1.z.boolean(),
|
|
28
|
+
progress: exports.GoalProgressSchema.optional(),
|
|
29
|
+
creatorUid: zod_1.z.string(),
|
|
30
|
+
createdAt: zod_1.z.coerce.date(),
|
|
31
|
+
updatedAt: zod_1.z.coerce.date(),
|
|
32
|
+
})
|
|
33
|
+
.passthrough();
|
|
@@ -21,6 +21,7 @@ __exportStar(require("./tooltips"), exports);
|
|
|
21
21
|
__exportStar(require("./notes"), exports);
|
|
22
22
|
__exportStar(require("./workspace-filters"), exports);
|
|
23
23
|
__exportStar(require("./workspace-goals"), exports);
|
|
24
|
+
__exportStar(require("./goals"), exports);
|
|
24
25
|
__exportStar(require("./calendars"), exports);
|
|
25
26
|
__exportStar(require("./reminders"), exports);
|
|
26
27
|
__exportStar(require("./completed-info"), exports);
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TaskSchema = exports.DeadlineSchema = exports.DurationSchema = exports.DURATION_UNITS = exports.DueDateSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
-
const url_helpers_1 = require("../../utils/url-helpers");
|
|
6
5
|
const uncompletable_helpers_1 = require("../../utils/uncompletable-helpers");
|
|
6
|
+
const url_helpers_1 = require("../../utils/url-helpers");
|
|
7
7
|
exports.DueDateSchema = zod_1.z
|
|
8
8
|
.object({
|
|
9
9
|
isRecurring: zod_1.z.boolean(),
|
|
@@ -7,18 +7,18 @@ exports.isPersonalProject = isPersonalProject;
|
|
|
7
7
|
exports.validateProject = validateProject;
|
|
8
8
|
exports.validateProjectArray = validateProjectArray;
|
|
9
9
|
exports.validateWorkspaceUserArray = validateWorkspaceUserArray;
|
|
10
|
-
const types_1 = require("../types/
|
|
11
|
-
const types_2 = require("../types/
|
|
12
|
-
const types_3 = require("../types/
|
|
13
|
-
const types_4 = require("../types/
|
|
14
|
-
const types_5 = require("../types/
|
|
15
|
-
const types_6 = require("../types/
|
|
10
|
+
const types_1 = require("../types/activity/types");
|
|
11
|
+
const types_2 = require("../types/backups/types");
|
|
12
|
+
const types_3 = require("../types/comments/types");
|
|
13
|
+
const types_4 = require("../types/id-mappings/types");
|
|
14
|
+
const types_5 = require("../types/insights/types");
|
|
15
|
+
const types_6 = require("../types/labels/types");
|
|
16
16
|
const types_7 = require("../types/productivity/types");
|
|
17
|
-
const types_8 = require("../types/
|
|
18
|
-
const types_9 = require("../types/
|
|
19
|
-
const types_10 = require("../types/
|
|
20
|
-
const types_11 = require("../types/
|
|
21
|
-
const types_12 = require("../types/
|
|
17
|
+
const types_8 = require("../types/projects/types");
|
|
18
|
+
const types_9 = require("../types/sections/types");
|
|
19
|
+
const types_10 = require("../types/tasks/types");
|
|
20
|
+
const types_11 = require("../types/users/types");
|
|
21
|
+
const types_12 = require("../types/workspaces/types");
|
|
22
22
|
const resources_1 = require("../types/sync/resources");
|
|
23
23
|
function createValidator(schema) {
|
|
24
24
|
return (input) => schema.parse(input);
|
|
@@ -27,7 +27,7 @@ function createArrayValidator(validateItem) {
|
|
|
27
27
|
return (input) => input.map(validateItem);
|
|
28
28
|
}
|
|
29
29
|
// Entity validators
|
|
30
|
-
exports.validateTask = createValidator(
|
|
30
|
+
exports.validateTask = createValidator(types_10.TaskSchema);
|
|
31
31
|
exports.validateTaskArray = createArrayValidator(exports.validateTask);
|
|
32
32
|
/**
|
|
33
33
|
* Type guard to check if a project is a workspace project.
|
|
@@ -52,53 +52,53 @@ function isPersonalProject(project) {
|
|
|
52
52
|
*/
|
|
53
53
|
function validateProject(input) {
|
|
54
54
|
if ('workspaceId' in input) {
|
|
55
|
-
return
|
|
55
|
+
return types_8.WorkspaceProjectSchema.parse(input);
|
|
56
56
|
}
|
|
57
|
-
return
|
|
57
|
+
return types_8.PersonalProjectSchema.parse(input);
|
|
58
58
|
}
|
|
59
59
|
function validateProjectArray(input) {
|
|
60
60
|
return input.map(validateProject);
|
|
61
61
|
}
|
|
62
|
-
exports.validateSection = createValidator(
|
|
62
|
+
exports.validateSection = createValidator(types_9.SectionSchema);
|
|
63
63
|
exports.validateSectionArray = createArrayValidator(exports.validateSection);
|
|
64
|
-
exports.validateLabel = createValidator(
|
|
64
|
+
exports.validateLabel = createValidator(types_6.LabelSchema);
|
|
65
65
|
exports.validateLabelArray = createArrayValidator(exports.validateLabel);
|
|
66
|
-
exports.validateComment = createValidator(
|
|
66
|
+
exports.validateComment = createValidator(types_3.CommentSchema);
|
|
67
67
|
exports.validateCommentArray = createArrayValidator(exports.validateComment);
|
|
68
|
-
exports.validateUser = createValidator(
|
|
68
|
+
exports.validateUser = createValidator(types_11.UserSchema);
|
|
69
69
|
exports.validateUserArray = createArrayValidator(exports.validateUser);
|
|
70
70
|
exports.validateProductivityStats = createValidator(types_7.ProductivityStatsSchema);
|
|
71
|
-
exports.validateCurrentUser = createValidator(
|
|
72
|
-
exports.validateActivityEvent = createValidator(
|
|
71
|
+
exports.validateCurrentUser = createValidator(types_11.CurrentUserSchema);
|
|
72
|
+
exports.validateActivityEvent = createValidator(types_1.ActivityEventSchema);
|
|
73
73
|
exports.validateActivityEventArray = createArrayValidator(exports.validateActivityEvent);
|
|
74
|
-
exports.validateAttachment = createValidator(
|
|
75
|
-
exports.validateWorkspaceUser = createValidator(
|
|
74
|
+
exports.validateAttachment = createValidator(types_3.AttachmentSchema);
|
|
75
|
+
exports.validateWorkspaceUser = createValidator(types_12.WorkspaceUserSchema);
|
|
76
76
|
function validateWorkspaceUserArray(input) {
|
|
77
77
|
if (!Array.isArray(input)) {
|
|
78
78
|
throw new Error(`Expected array for workspace users, got ${typeof input}`);
|
|
79
79
|
}
|
|
80
80
|
return input.map(exports.validateWorkspaceUser);
|
|
81
81
|
}
|
|
82
|
-
exports.validateWorkspaceInvitation = createValidator(
|
|
82
|
+
exports.validateWorkspaceInvitation = createValidator(types_12.WorkspaceInvitationSchema);
|
|
83
83
|
exports.validateWorkspaceInvitationArray = createArrayValidator(exports.validateWorkspaceInvitation);
|
|
84
|
-
exports.validateWorkspacePlanDetails = createValidator(
|
|
85
|
-
exports.validateJoinWorkspaceResult = createValidator(
|
|
86
|
-
exports.validateWorkspace = createValidator(
|
|
84
|
+
exports.validateWorkspacePlanDetails = createValidator(types_12.WorkspacePlanDetailsSchema);
|
|
85
|
+
exports.validateJoinWorkspaceResult = createValidator(types_12.JoinWorkspaceResultSchema);
|
|
86
|
+
exports.validateWorkspace = createValidator(types_12.WorkspaceSchema);
|
|
87
87
|
exports.validateWorkspaceArray = createArrayValidator(exports.validateWorkspace);
|
|
88
|
-
exports.validateMemberActivityInfo = createValidator(
|
|
88
|
+
exports.validateMemberActivityInfo = createValidator(types_12.MemberActivityInfoSchema);
|
|
89
89
|
exports.validateMemberActivityInfoArray = createArrayValidator(exports.validateMemberActivityInfo);
|
|
90
|
-
exports.validateWorkspaceUserTask = createValidator(
|
|
90
|
+
exports.validateWorkspaceUserTask = createValidator(types_12.WorkspaceUserTaskSchema);
|
|
91
91
|
exports.validateWorkspaceUserTaskArray = createArrayValidator(exports.validateWorkspaceUserTask);
|
|
92
|
-
exports.validateProjectActivityStats = createValidator(
|
|
93
|
-
exports.validateProjectHealth = createValidator(
|
|
94
|
-
exports.validateProjectHealthContext = createValidator(
|
|
95
|
-
exports.validateProjectProgress = createValidator(
|
|
96
|
-
exports.validateWorkspaceInsights = createValidator(
|
|
97
|
-
exports.validateBackup = createValidator(
|
|
92
|
+
exports.validateProjectActivityStats = createValidator(types_5.ProjectActivityStatsSchema);
|
|
93
|
+
exports.validateProjectHealth = createValidator(types_5.ProjectHealthSchema);
|
|
94
|
+
exports.validateProjectHealthContext = createValidator(types_5.ProjectHealthContextSchema);
|
|
95
|
+
exports.validateProjectProgress = createValidator(types_5.ProjectProgressSchema);
|
|
96
|
+
exports.validateWorkspaceInsights = createValidator(types_5.WorkspaceInsightsSchema);
|
|
97
|
+
exports.validateBackup = createValidator(types_2.BackupSchema);
|
|
98
98
|
exports.validateBackupArray = createArrayValidator(exports.validateBackup);
|
|
99
|
-
exports.validateIdMapping = createValidator(
|
|
99
|
+
exports.validateIdMapping = createValidator(types_4.IdMappingSchema);
|
|
100
100
|
exports.validateIdMappingArray = createArrayValidator(exports.validateIdMapping);
|
|
101
|
-
exports.validateMovedId = createValidator(
|
|
101
|
+
exports.validateMovedId = createValidator(types_4.MovedIdSchema);
|
|
102
102
|
exports.validateMovedIdArray = createArrayValidator(exports.validateMovedId);
|
|
103
103
|
// Sync resource validators
|
|
104
104
|
exports.validateFilter = createValidator(resources_1.FilterSchema);
|
|
@@ -9,10 +9,10 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
9
9
|
}
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
|
-
import { request, isSuccess } from './transport/http-client.js';
|
|
13
12
|
import { v4 as uuid } from 'uuid';
|
|
14
|
-
import { TodoistRequestError } from './types/index.js';
|
|
15
13
|
import { getAuthBaseUri, getSyncBaseUri, ENDPOINT_AUTHORIZATION, ENDPOINT_GET_TOKEN, ENDPOINT_REVOKE, ENDPOINT_REGISTER, ENDPOINT_REST_ACCESS_TOKENS_MIGRATE, } from './consts/endpoints.js';
|
|
14
|
+
import { request, isSuccess } from './transport/http-client.js';
|
|
15
|
+
import { TodoistRequestError } from './types/index.js';
|
|
16
16
|
/** Available OAuth2 permission scopes. */
|
|
17
17
|
export const PERMISSIONS = [
|
|
18
18
|
'task:add',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { beforeAll, afterEach, afterAll } from 'vitest';
|
|
2
|
-
import { setupServer } from 'msw/node';
|
|
3
1
|
import { http, HttpResponse } from 'msw';
|
|
2
|
+
import { setupServer } from 'msw/node';
|
|
3
|
+
import { beforeAll, afterEach, afterAll } from 'vitest';
|
|
4
4
|
// Request capture storage
|
|
5
5
|
const capturedRequests = [];
|
|
6
6
|
// Helper function to capture requests
|
package/dist/esm/todoist-api.js
CHANGED
|
@@ -9,20 +9,21 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
9
9
|
}
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
|
+
import { z } from 'zod';
|
|
13
|
+
import { getSyncBaseUri, ENDPOINT_REST_TASKS, ENDPOINT_REST_TASKS_FILTER, ENDPOINT_REST_TASKS_COMPLETED_BY_COMPLETION_DATE, ENDPOINT_REST_TASKS_COMPLETED_BY_DUE_DATE, ENDPOINT_REST_TASKS_COMPLETED_SEARCH, ENDPOINT_REST_TASKS_COMPLETED, ENDPOINT_REST_TEMPLATES_FILE, ENDPOINT_REST_TEMPLATES_URL, ENDPOINT_REST_TEMPLATES_CREATE_FROM_FILE, ENDPOINT_REST_TEMPLATES_IMPORT_FROM_FILE, ENDPOINT_REST_TEMPLATES_IMPORT_FROM_ID, ENDPOINT_REST_PROJECTS, ENDPOINT_REST_PROJECTS_SEARCH, ENDPOINT_SYNC_QUICK_ADD, ENDPOINT_REST_TASK_CLOSE, ENDPOINT_REST_TASK_REOPEN, ENDPOINT_REST_TASK_MOVE, ENDPOINT_REST_LABELS, ENDPOINT_REST_LABELS_SEARCH, ENDPOINT_REST_PROJECT_COLLABORATORS, ENDPOINT_REST_SECTIONS, ENDPOINT_REST_SECTIONS_SEARCH, ENDPOINT_REST_COMMENTS, ENDPOINT_REST_LOCATION_REMINDERS, ENDPOINT_REST_REMINDERS, ENDPOINT_REST_LABELS_SHARED, ENDPOINT_REST_LABELS_SHARED_RENAME, ENDPOINT_REST_LABELS_SHARED_REMOVE, ENDPOINT_SYNC, PROJECT_ARCHIVE, PROJECT_UNARCHIVE, ENDPOINT_REST_PROJECTS_MOVE_TO_WORKSPACE, ENDPOINT_REST_PROJECTS_MOVE_TO_PERSONAL, ENDPOINT_REST_PROJECTS_ARCHIVED, ENDPOINT_REST_PROJECTS_ARCHIVED_COUNT, ENDPOINT_REST_PROJECTS_PERMISSIONS, ENDPOINT_REST_PROJECT_FULL, ENDPOINT_REST_PROJECT_JOIN, SECTION_ARCHIVE, SECTION_UNARCHIVE, ENDPOINT_REST_USER, ENDPOINT_REST_PRODUCTIVITY, ENDPOINT_REST_ACTIVITIES, ENDPOINT_REST_UPLOADS, getProjectInsightsActivityStatsEndpoint, getProjectInsightsHealthEndpoint, getProjectInsightsHealthContextEndpoint, getProjectInsightsProgressEndpoint, getProjectInsightsHealthAnalyzeEndpoint, getWorkspaceInsightsEndpoint, ENDPOINT_REST_BACKUPS, ENDPOINT_REST_BACKUPS_DOWNLOAD, ENDPOINT_REST_EMAILS, ENDPOINT_REST_ID_MAPPINGS, ENDPOINT_REST_MOVED_IDS, ENDPOINT_REST_WORKSPACES, ENDPOINT_WORKSPACE_MEMBERS, getWorkspaceUserTasksEndpoint, getWorkspaceInviteUsersEndpoint, getWorkspaceUserEndpoint, ENDPOINT_WORKSPACE_INVITATIONS, ENDPOINT_WORKSPACE_INVITATIONS_ALL, ENDPOINT_WORKSPACE_INVITATIONS_DELETE, getWorkspaceInvitationAcceptEndpoint, getWorkspaceInvitationRejectEndpoint, ENDPOINT_WORKSPACE_JOIN, ENDPOINT_WORKSPACE_LOGO, ENDPOINT_WORKSPACE_PLAN_DETAILS, ENDPOINT_WORKSPACE_USERS, getWorkspaceActiveProjectsEndpoint, getWorkspaceArchivedProjectsEndpoint, ENDPOINT_REST_FOLDERS, } from './consts/endpoints.js';
|
|
14
|
+
import { request, isSuccess } from './transport/http-client.js';
|
|
12
15
|
import { WorkspaceProjectSchema, } from './types/projects/index.js';
|
|
13
16
|
import { UpdateReminderArgsSchema, UpdateLocationReminderArgsSchema, ReminderIdSchema, } from './types/reminders/index.js';
|
|
14
|
-
import {
|
|
15
|
-
import { getSyncBaseUri, ENDPOINT_REST_TASKS, ENDPOINT_REST_TASKS_FILTER, ENDPOINT_REST_TASKS_COMPLETED_BY_COMPLETION_DATE, ENDPOINT_REST_TASKS_COMPLETED_BY_DUE_DATE, ENDPOINT_REST_TASKS_COMPLETED_SEARCH, ENDPOINT_REST_TASKS_COMPLETED, ENDPOINT_REST_TEMPLATES_FILE, ENDPOINT_REST_TEMPLATES_URL, ENDPOINT_REST_TEMPLATES_CREATE_FROM_FILE, ENDPOINT_REST_TEMPLATES_IMPORT_FROM_FILE, ENDPOINT_REST_TEMPLATES_IMPORT_FROM_ID, ENDPOINT_REST_PROJECTS, ENDPOINT_REST_PROJECTS_SEARCH, ENDPOINT_SYNC_QUICK_ADD, ENDPOINT_REST_TASK_CLOSE, ENDPOINT_REST_TASK_REOPEN, ENDPOINT_REST_TASK_MOVE, ENDPOINT_REST_LABELS, ENDPOINT_REST_LABELS_SEARCH, ENDPOINT_REST_PROJECT_COLLABORATORS, ENDPOINT_REST_SECTIONS, ENDPOINT_REST_SECTIONS_SEARCH, ENDPOINT_REST_COMMENTS, ENDPOINT_REST_LOCATION_REMINDERS, ENDPOINT_REST_REMINDERS, ENDPOINT_REST_LABELS_SHARED, ENDPOINT_REST_LABELS_SHARED_RENAME, ENDPOINT_REST_LABELS_SHARED_REMOVE, ENDPOINT_SYNC, PROJECT_ARCHIVE, PROJECT_UNARCHIVE, ENDPOINT_REST_PROJECTS_MOVE_TO_WORKSPACE, ENDPOINT_REST_PROJECTS_MOVE_TO_PERSONAL, ENDPOINT_REST_PROJECTS_ARCHIVED, ENDPOINT_REST_PROJECTS_ARCHIVED_COUNT, ENDPOINT_REST_PROJECTS_PERMISSIONS, ENDPOINT_REST_PROJECT_FULL, ENDPOINT_REST_PROJECT_JOIN, SECTION_ARCHIVE, SECTION_UNARCHIVE, ENDPOINT_REST_USER, ENDPOINT_REST_PRODUCTIVITY, ENDPOINT_REST_ACTIVITIES, ENDPOINT_REST_UPLOADS, getProjectInsightsActivityStatsEndpoint, getProjectInsightsHealthEndpoint, getProjectInsightsHealthContextEndpoint, getProjectInsightsProgressEndpoint, getProjectInsightsHealthAnalyzeEndpoint, getWorkspaceInsightsEndpoint, ENDPOINT_REST_BACKUPS, ENDPOINT_REST_BACKUPS_DOWNLOAD, ENDPOINT_REST_EMAILS, ENDPOINT_REST_ID_MAPPINGS, ENDPOINT_REST_MOVED_IDS, ENDPOINT_REST_WORKSPACES, ENDPOINT_WORKSPACE_MEMBERS, getWorkspaceUserTasksEndpoint, getWorkspaceInviteUsersEndpoint, getWorkspaceUserEndpoint, ENDPOINT_WORKSPACE_INVITATIONS, ENDPOINT_WORKSPACE_INVITATIONS_ALL, ENDPOINT_WORKSPACE_INVITATIONS_DELETE, getWorkspaceInvitationAcceptEndpoint, getWorkspaceInvitationRejectEndpoint, ENDPOINT_WORKSPACE_JOIN, ENDPOINT_WORKSPACE_LOGO, ENDPOINT_WORKSPACE_PLAN_DETAILS, ENDPOINT_WORKSPACE_USERS, getWorkspaceActiveProjectsEndpoint, getWorkspaceArchivedProjectsEndpoint, ENDPOINT_REST_FOLDERS, } from './consts/endpoints.js';
|
|
16
|
-
import { validateAttachment, validateComment, validateCommentArray, validateCurrentUser, validateLabel, validateLabelArray, validateProject, validateProjectArray, validateSection, validateSectionArray, validateTask, validateTaskArray, validateUserArray, validateProductivityStats, validateReminder, validateReminderArray, validateLocationReminderArray, validateActivityEventArray, validateWorkspaceUserArray, validateWorkspaceInvitation, validateWorkspaceInvitationArray, validateWorkspacePlanDetails, validateJoinWorkspaceResult, validateWorkspace, validateWorkspaceArray, validateMemberActivityInfoArray, validateWorkspaceUserTaskArray, validateProjectActivityStats, validateProjectHealth, validateProjectHealthContext, validateProjectProgress, validateWorkspaceInsights, validateBackupArray, validateIdMappingArray, validateMovedIdArray, validateFolder, validateFolderArray, validateCollaboratorArray, validateCollaboratorStateArray, validateNoteArray, } from './utils/validators.js';
|
|
17
|
-
import { formatDateToYYYYMMDD } from './utils/url-helpers.js';
|
|
18
|
-
import { uploadMultipartFile } from './utils/multipart-upload.js';
|
|
19
|
-
import { camelCaseKeys } from './utils/case-conversion.js';
|
|
17
|
+
import { GoalSchema } from './types/sync/resources/goals.js';
|
|
20
18
|
import { normalizeObjectEventTypeForApi, denormalizeObjectTypeFromApi, } from './utils/activity-helpers.js';
|
|
19
|
+
import { camelCaseKeys } from './utils/case-conversion.js';
|
|
20
|
+
import { uploadMultipartFile } from './utils/multipart-upload.js';
|
|
21
21
|
import { processTaskContent } from './utils/uncompletable-helpers.js';
|
|
22
|
-
import {
|
|
22
|
+
import { formatDateToYYYYMMDD } from './utils/url-helpers.js';
|
|
23
|
+
import { validateAttachment, validateComment, validateCommentArray, validateCurrentUser, validateLabel, validateLabelArray, validateProject, validateProjectArray, validateSection, validateSectionArray, validateTask, validateTaskArray, validateUserArray, validateProductivityStats, validateReminder, validateReminderArray, validateLocationReminderArray, validateActivityEventArray, validateWorkspaceUserArray, validateWorkspaceInvitation, validateWorkspaceInvitationArray, validateWorkspacePlanDetails, validateJoinWorkspaceResult, validateWorkspace, validateWorkspaceArray, validateMemberActivityInfoArray, validateWorkspaceUserTaskArray, validateProjectActivityStats, validateProjectHealth, validateProjectHealthContext, validateProjectProgress, validateWorkspaceInsights, validateBackupArray, validateIdMappingArray, validateMovedIdArray, validateFolder, validateFolderArray, validateCollaboratorArray, validateCollaboratorStateArray, validateNoteArray, } from './utils/validators.js';
|
|
23
24
|
import { v4 as uuidv4 } from 'uuid';
|
|
24
|
-
import { DATE_FORMAT_TO_API, TIME_FORMAT_TO_API, DAY_OF_WEEK_TO_API, } from './types/sync/index.js';
|
|
25
25
|
import { TodoistArgumentError, TodoistRequestError } from './types/index.js';
|
|
26
|
+
import { DATE_FORMAT_TO_API, TIME_FORMAT_TO_API, DAY_OF_WEEK_TO_API, } from './types/sync/index.js';
|
|
26
27
|
const MAX_COMMAND_COUNT = 100;
|
|
27
28
|
/**
|
|
28
29
|
* Joins path segments using `/` separator.
|
|
@@ -132,7 +133,11 @@ export class TodoistApi {
|
|
|
132
133
|
throw new TodoistRequestError(value.error, value.httpCode, value.errorExtra);
|
|
133
134
|
});
|
|
134
135
|
}
|
|
135
|
-
|
|
136
|
+
const data = response.data;
|
|
137
|
+
if (data.goals) {
|
|
138
|
+
data.goals = data.goals.map((goal) => GoalSchema.parse(goal));
|
|
139
|
+
}
|
|
140
|
+
return data;
|
|
136
141
|
}
|
|
137
142
|
/**
|
|
138
143
|
* Executes a raw Sync API request.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { DueDateSchema } from '../tasks/types.js';
|
|
3
2
|
import { LOCATION_TRIGGERS, ReminderTypeEnum } from '../sync/resources/reminders.js';
|
|
3
|
+
import { DueDateSchema } from '../tasks/types.js';
|
|
4
4
|
/** Available reminder delivery services. */
|
|
5
5
|
export const REMINDER_DELIVERY_SERVICES = ['email', 'push'];
|
|
6
6
|
export const ReminderDeliveryServiceSchema = z.enum(REMINDER_DELIVERY_SERVICES);
|
|
@@ -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';
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/** Available goal owner types. */
|
|
3
|
+
export const GOAL_OWNER_TYPES = ['USER', 'WORKSPACE'];
|
|
4
|
+
export const GoalProgressSchema = z
|
|
5
|
+
.object({
|
|
6
|
+
totalItemCount: z.number().int(),
|
|
7
|
+
completedItemCount: z.number().int(),
|
|
8
|
+
percentage: z.number(),
|
|
9
|
+
})
|
|
10
|
+
.passthrough();
|
|
11
|
+
export const GoalSchema = z
|
|
12
|
+
.object({
|
|
13
|
+
id: z.string(),
|
|
14
|
+
ownerType: z.enum(GOAL_OWNER_TYPES),
|
|
15
|
+
ownerId: z.string(),
|
|
16
|
+
name: z.string(),
|
|
17
|
+
description: z.string().nullable(),
|
|
18
|
+
deadline: z.string().nullable(),
|
|
19
|
+
parentGoalId: z.string().nullable(),
|
|
20
|
+
childOrder: z.number().int(),
|
|
21
|
+
isCompleted: z.boolean(),
|
|
22
|
+
completedAt: z.coerce.date().nullable(),
|
|
23
|
+
responsibleUid: z.string().nullable(),
|
|
24
|
+
isDeleted: z.boolean(),
|
|
25
|
+
progress: GoalProgressSchema.optional(),
|
|
26
|
+
creatorUid: z.string(),
|
|
27
|
+
createdAt: z.coerce.date(),
|
|
28
|
+
updatedAt: z.coerce.date(),
|
|
29
|
+
})
|
|
30
|
+
.passthrough();
|
|
@@ -5,6 +5,7 @@ export * from './tooltips.js';
|
|
|
5
5
|
export * from './notes.js';
|
|
6
6
|
export * from './workspace-filters.js';
|
|
7
7
|
export * from './workspace-goals.js';
|
|
8
|
+
export * from './goals.js';
|
|
8
9
|
export * from './calendars.js';
|
|
9
10
|
export * from './reminders.js';
|
|
10
11
|
export * from './completed-info.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { getTaskUrl } from '../../utils/url-helpers.js';
|
|
3
2
|
import { hasUncompletablePrefix } from '../../utils/uncompletable-helpers.js';
|
|
3
|
+
import { getTaskUrl } from '../../utils/url-helpers.js';
|
|
4
4
|
export const DueDateSchema = z
|
|
5
5
|
.object({
|
|
6
6
|
isRecurring: z.boolean(),
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ActivityEventSchema } from '../types/activity/types.js';
|
|
2
|
+
import { BackupSchema } from '../types/backups/types.js';
|
|
3
|
+
import { AttachmentSchema, CommentSchema } from '../types/comments/types.js';
|
|
4
|
+
import { IdMappingSchema, MovedIdSchema } from '../types/id-mappings/types.js';
|
|
5
|
+
import { ProjectActivityStatsSchema, ProjectHealthSchema, ProjectHealthContextSchema, ProjectProgressSchema, WorkspaceInsightsSchema, } from '../types/insights/types.js';
|
|
6
|
+
import { LabelSchema } from '../types/labels/types.js';
|
|
7
|
+
import { ProductivityStatsSchema } from '../types/productivity/types.js';
|
|
2
8
|
import { PersonalProjectSchema, WorkspaceProjectSchema, } from '../types/projects/types.js';
|
|
3
9
|
import { SectionSchema } from '../types/sections/types.js';
|
|
4
|
-
import {
|
|
5
|
-
import { AttachmentSchema, CommentSchema } from '../types/comments/types.js';
|
|
10
|
+
import { TaskSchema } from '../types/tasks/types.js';
|
|
6
11
|
import { UserSchema, CurrentUserSchema } from '../types/users/types.js';
|
|
7
|
-
import { ProductivityStatsSchema } from '../types/productivity/types.js';
|
|
8
|
-
import { ActivityEventSchema } from '../types/activity/types.js';
|
|
9
12
|
import { WorkspaceUserSchema, WorkspaceInvitationSchema, WorkspacePlanDetailsSchema, JoinWorkspaceResultSchema, WorkspaceSchema, MemberActivityInfoSchema, WorkspaceUserTaskSchema, } from '../types/workspaces/types.js';
|
|
10
|
-
import { ProjectActivityStatsSchema, ProjectHealthSchema, ProjectHealthContextSchema, ProjectProgressSchema, WorkspaceInsightsSchema, } from '../types/insights/types.js';
|
|
11
|
-
import { BackupSchema } from '../types/backups/types.js';
|
|
12
|
-
import { IdMappingSchema, MovedIdSchema } from '../types/id-mappings/types.js';
|
|
13
13
|
import { FilterSchema, CollaboratorSchema, CollaboratorStateSchema, FolderSchema, NoteSchema, TooltipsSchema, WorkspaceFilterSchema, WorkspaceGoalSchema, CalendarSchema, CalendarAccountSchema, ReminderSchema, LocationReminderSchema, CompletedInfoSchema, ViewOptionsSchema, ProjectViewOptionsDefaultsSchema, UserPlanLimitsSchema, LiveNotificationSchema, SyncWorkspaceSchema, SyncUserSchema, UserSettingsSchema, SuggestionSchema, } from '../types/sync/resources/index.js';
|
|
14
14
|
function createValidator(schema) {
|
|
15
15
|
return (input) => schema.parse(input);
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { PersonalProject, WorkspaceProject, AddProjectArgs, UpdateProjectArgs, GetProjectsArgs, SearchProjectsArgs, GetProjectCollaboratorsArgs, GetProjectsResponse, GetProjectCollaboratorsResponse, GetArchivedProjectsArgs, GetArchivedProjectsResponse, MoveProjectToWorkspaceArgs, MoveProjectToPersonalArgs, GetArchivedProjectsCountArgs, GetArchivedProjectsCountResponse, GetProjectPermissionsResponse, GetFullProjectArgs, GetFullProjectResponse, JoinProjectResponse } from './types/projects/index.js';
|
|
3
|
-
import { Section, AddSectionArgs, UpdateSectionArgs, GetSectionsArgs, SearchSectionsArgs, GetSectionsResponse } from './types/sections/index.js';
|
|
4
|
-
import { Label, AddLabelArgs, UpdateLabelArgs, GetLabelsArgs, SearchLabelsArgs, GetLabelsResponse, GetSharedLabelsArgs, GetSharedLabelsResponse, RenameSharedLabelArgs, RemoveSharedLabelArgs } from './types/labels/index.js';
|
|
5
|
-
import { Attachment, Comment, AddCommentArgs, UpdateCommentArgs, GetProjectCommentsArgs, GetTaskCommentsArgs, GetCommentsResponse } from './types/comments/index.js';
|
|
6
|
-
import { AddReminderArgs, UpdateReminderArgs, AddLocationReminderArgs, UpdateLocationReminderArgs, GetRemindersArgs, GetRemindersResponse, GetLocationRemindersArgs, GetLocationRemindersResponse } from './types/reminders/index.js';
|
|
7
|
-
import { CurrentUser } from './types/users/index.js';
|
|
8
|
-
import { ProductivityStats } from './types/productivity/index.js';
|
|
1
|
+
import type { Reminder } from './types/index.js';
|
|
9
2
|
import { GetActivityLogsArgs, GetActivityLogsResponse } from './types/activity/index.js';
|
|
10
|
-
import { WorkspaceInvitation, WorkspacePlanDetails, JoinWorkspaceResult, Workspace, AddWorkspaceArgs, UpdateWorkspaceArgs, GetWorkspaceMembersActivityArgs, GetWorkspaceMembersActivityResponse, GetWorkspaceUserTasksArgs, GetWorkspaceUserTasksResponse, InviteWorkspaceUsersArgs, InviteWorkspaceUsersResponse, UpdateWorkspaceUserArgs, RemoveWorkspaceUserArgs, GetWorkspaceInvitationsArgs, DeleteWorkspaceInvitationArgs, WorkspaceInvitationActionArgs, JoinWorkspaceArgs, WorkspaceLogoArgs, GetWorkspacePlanDetailsArgs, GetWorkspaceUsersArgs, GetWorkspaceUsersResponse, GetWorkspaceProjectsArgs, WorkspaceInvitationsResponse, AllWorkspaceInvitationsResponse, WorkspaceLogoResponse } from './types/workspaces/index.js';
|
|
11
|
-
import { GetFoldersArgs, GetFoldersResponse, AddFolderArgs, UpdateFolderArgs } from './types/folders/index.js';
|
|
12
|
-
import type { Folder } from './types/sync/resources/folders.js';
|
|
13
|
-
import { ProjectActivityStats, ProjectHealth, ProjectHealthContext, ProjectProgress, WorkspaceInsights, GetProjectActivityStatsArgs, GetWorkspaceInsightsArgs } from './types/insights/index.js';
|
|
14
3
|
import { Backup, GetBackupsArgs, DownloadBackupArgs } from './types/backups/index.js';
|
|
15
|
-
import {
|
|
4
|
+
import { Attachment, Comment, AddCommentArgs, UpdateCommentArgs, GetProjectCommentsArgs, GetTaskCommentsArgs, GetCommentsResponse } from './types/comments/index.js';
|
|
16
5
|
import { GetOrCreateEmailArgs, GetOrCreateEmailResponse, DisableEmailArgs } from './types/emails/index.js';
|
|
17
|
-
import {
|
|
18
|
-
import { ExportTemplateFileArgs, ExportTemplateUrlArgs, ExportTemplateUrlResponse, CreateProjectFromTemplateArgs, CreateProjectFromTemplateResponse, ImportTemplateIntoProjectArgs, ImportTemplateFromIdArgs, ImportTemplateResponse } from './types/templates/index.js';
|
|
6
|
+
import { GetFoldersArgs, GetFoldersResponse, AddFolderArgs, UpdateFolderArgs } from './types/folders/index.js';
|
|
19
7
|
import { CustomFetch, CustomFetchResponse } from './types/http.js';
|
|
20
|
-
import
|
|
8
|
+
import { IdMapping, MovedId, GetIdMappingsArgs, GetMovedIdsArgs } from './types/id-mappings/index.js';
|
|
9
|
+
import { ProjectActivityStats, ProjectHealth, ProjectHealthContext, ProjectProgress, WorkspaceInsights, GetProjectActivityStatsArgs, GetWorkspaceInsightsArgs } from './types/insights/index.js';
|
|
10
|
+
import { Label, AddLabelArgs, UpdateLabelArgs, GetLabelsArgs, SearchLabelsArgs, GetLabelsResponse, GetSharedLabelsArgs, GetSharedLabelsResponse, RenameSharedLabelArgs, RemoveSharedLabelArgs } from './types/labels/index.js';
|
|
11
|
+
import { ProductivityStats } from './types/productivity/index.js';
|
|
12
|
+
import { PersonalProject, WorkspaceProject, AddProjectArgs, UpdateProjectArgs, GetProjectsArgs, SearchProjectsArgs, GetProjectCollaboratorsArgs, GetProjectsResponse, GetProjectCollaboratorsResponse, GetArchivedProjectsArgs, GetArchivedProjectsResponse, MoveProjectToWorkspaceArgs, MoveProjectToPersonalArgs, GetArchivedProjectsCountArgs, GetArchivedProjectsCountResponse, GetProjectPermissionsResponse, GetFullProjectArgs, GetFullProjectResponse, JoinProjectResponse } from './types/projects/index.js';
|
|
13
|
+
import { AddReminderArgs, UpdateReminderArgs, AddLocationReminderArgs, UpdateLocationReminderArgs, GetRemindersArgs, GetRemindersResponse, GetLocationRemindersArgs, GetLocationRemindersResponse } from './types/reminders/index.js';
|
|
14
|
+
import { Section, AddSectionArgs, UpdateSectionArgs, GetSectionsArgs, SearchSectionsArgs, GetSectionsResponse } from './types/sections/index.js';
|
|
15
|
+
import type { Folder } from './types/sync/resources/folders.js';
|
|
16
|
+
import { Task, AddTaskArgs, GetTasksArgs, GetTasksByFilterArgs, UpdateTaskArgs, QuickAddTaskArgs, type MoveTaskArgs, GetCompletedTasksByCompletionDateArgs, GetCompletedTasksByDueDateArgs, GetCompletedTasksResponse, SearchCompletedTasksArgs, GetTasksResponse, GetAllCompletedTasksArgs, GetAllCompletedTasksResponse } from './types/tasks/index.js';
|
|
17
|
+
import { ExportTemplateFileArgs, ExportTemplateUrlArgs, ExportTemplateUrlResponse, CreateProjectFromTemplateArgs, CreateProjectFromTemplateResponse, ImportTemplateIntoProjectArgs, ImportTemplateFromIdArgs, ImportTemplateResponse } from './types/templates/index.js';
|
|
18
|
+
import { UploadFileArgs, DeleteUploadArgs } from './types/uploads/index.js';
|
|
19
|
+
import { CurrentUser } from './types/users/index.js';
|
|
20
|
+
import { WorkspaceInvitation, WorkspacePlanDetails, JoinWorkspaceResult, Workspace, AddWorkspaceArgs, UpdateWorkspaceArgs, GetWorkspaceMembersActivityArgs, GetWorkspaceMembersActivityResponse, GetWorkspaceUserTasksArgs, GetWorkspaceUserTasksResponse, InviteWorkspaceUsersArgs, InviteWorkspaceUsersResponse, UpdateWorkspaceUserArgs, RemoveWorkspaceUserArgs, GetWorkspaceInvitationsArgs, DeleteWorkspaceInvitationArgs, WorkspaceInvitationActionArgs, JoinWorkspaceArgs, WorkspaceLogoArgs, GetWorkspacePlanDetailsArgs, GetWorkspaceUsersArgs, GetWorkspaceUsersResponse, GetWorkspaceProjectsArgs, WorkspaceInvitationsResponse, AllWorkspaceInvitationsResponse, WorkspaceLogoResponse } from './types/workspaces/index.js';
|
|
21
21
|
import { type SyncResponse, type SyncRequest } from './types/sync/index.js';
|
|
22
22
|
/**
|
|
23
23
|
* Response from viewAttachment, extending CustomFetchResponse with
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ColorKey } from '../../utils/colors.js';
|
|
2
|
-
import type { SearchArgs } from '../common.js';
|
|
3
2
|
import type { Comment } from '../comments/types.js';
|
|
3
|
+
import type { SearchArgs } from '../common.js';
|
|
4
4
|
import type { Section } from '../sections/types.js';
|
|
5
5
|
import type { Collaborator, CollaboratorState } from '../sync/resources/collaborators.js';
|
|
6
6
|
import type { Folder } from '../sync/resources/folders.js';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { GoalOwnerType } from '../resources/goals.js';
|
|
2
|
+
export type GoalAddArgs = {
|
|
3
|
+
ownerType: GoalOwnerType;
|
|
4
|
+
ownerId: string;
|
|
5
|
+
name: string;
|
|
6
|
+
description?: string | null;
|
|
7
|
+
deadline?: string | null;
|
|
8
|
+
responsibleUid?: string | null;
|
|
9
|
+
};
|
|
10
|
+
export type GoalUpdateArgs = {
|
|
11
|
+
id: string;
|
|
12
|
+
name?: string;
|
|
13
|
+
description?: string | null;
|
|
14
|
+
deadline?: string | null;
|
|
15
|
+
responsibleUid?: string | null;
|
|
16
|
+
};
|
|
17
|
+
export type GoalCompleteArgs = {
|
|
18
|
+
id: string;
|
|
19
|
+
};
|
|
20
|
+
export type GoalUncompleteArgs = {
|
|
21
|
+
id: string;
|
|
22
|
+
};
|
|
23
|
+
export type GoalDeleteArgs = {
|
|
24
|
+
id: string;
|
|
25
|
+
};
|
|
26
|
+
export type GoalLinkItemArgs = {
|
|
27
|
+
goalId: string;
|
|
28
|
+
itemId: string;
|
|
29
|
+
};
|
|
30
|
+
export type GoalUnlinkItemArgs = {
|
|
31
|
+
goalId: string;
|
|
32
|
+
itemId: string;
|
|
33
|
+
};
|
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { ProjectAddArgs, ProjectUpdateArgs, ProjectMoveArgs, ProjectReorderArgs, ShareProjectArgs, ProjectLeaveArgs, ProjectArchiveArgs, ProjectUnarchiveArgs, ProjectDeleteArgs, ProjectMoveToWorkspaceArgs, ProjectMoveToPersonalArgs } from './projects.js';
|
|
3
|
-
import type { SectionAddArgs, SectionUpdateArgs, SectionMoveArgs, SectionReorderArgs, SectionArchiveArgs, SectionUnarchiveArgs, SectionDeleteArgs } from './sections.js';
|
|
4
|
-
import type { LabelAddArgs, LabelRenameArgs, LabelUpdateArgs, LabelUpdateOrdersArgs, LabelDeleteArgs, LabelDeleteOccurrencesArgs } from './labels.js';
|
|
1
|
+
import type { CalendarUpdateArgs, CalendarAccountUpdateArgs, CalendarAccountRestoreTaskCalendarArgs } from './calendars.js';
|
|
5
2
|
import type { FilterAddArgs, FilterUpdateArgs, FilterUpdateOrdersArgs, FilterDeleteArgs } from './filters.js';
|
|
6
|
-
import type { NoteAddArgs, NoteUpdateArgs, NoteDeleteArgs, NoteReactionAddArgs, NoteReactionRemoveArgs } from './notes.js';
|
|
7
|
-
import type { ReminderAddArgs, ReminderUpdateArgs, ReminderDeleteArgs } from './reminders.js';
|
|
8
|
-
import type { WorkspaceAddArgs, WorkspaceUpdateArgs, WorkspaceDeleteArgs, WorkspaceUpdateUserArgs, WorkspaceDeleteUserArgs, WorkspaceLeaveArgs, WorkspaceInviteArgs, WorkspaceSetDefaultOrderArgs, WorkspaceUpdateUserProjectSortPreferenceArgs } from './workspaces.js';
|
|
9
3
|
import type { FolderAddArgs, FolderUpdateArgs, FolderDeleteArgs } from './folders.js';
|
|
10
|
-
import type {
|
|
11
|
-
import type {
|
|
4
|
+
import type { GoalAddArgs, GoalUpdateArgs, GoalCompleteArgs, GoalUncompleteArgs, GoalDeleteArgs, GoalLinkItemArgs, GoalUnlinkItemArgs } from './goals.js';
|
|
5
|
+
import type { LabelAddArgs, LabelRenameArgs, LabelUpdateArgs, LabelUpdateOrdersArgs, LabelDeleteArgs, LabelDeleteOccurrencesArgs } from './labels.js';
|
|
6
|
+
import type { NoteAddArgs, NoteUpdateArgs, NoteDeleteArgs, NoteReactionAddArgs, NoteReactionRemoveArgs } from './notes.js';
|
|
12
7
|
import type { LiveNotificationsMarkUnreadArgs, LiveNotificationsMarkReadArgs, LiveNotificationsMarkReadAllArgs, LiveNotificationsSetLastReadArgs } from './notifications.js';
|
|
8
|
+
import type { UserUpdateArgs, DeleteCollaboratorArgs, IdMappingArgs, SuggestionDeleteArgs, UserSettingsUpdateArgs, UpdateGoalsArgs } from './others.js';
|
|
9
|
+
import type { ProjectViewOptionsDefaultsSetArgs } from './project-view-options.js';
|
|
10
|
+
import type { ProjectAddArgs, ProjectUpdateArgs, ProjectMoveArgs, ProjectReorderArgs, ShareProjectArgs, ProjectLeaveArgs, ProjectArchiveArgs, ProjectUnarchiveArgs, ProjectDeleteArgs, ProjectMoveToWorkspaceArgs, ProjectMoveToPersonalArgs } from './projects.js';
|
|
11
|
+
import type { ReminderAddArgs, ReminderUpdateArgs, ReminderDeleteArgs } from './reminders.js';
|
|
12
|
+
import type { SectionAddArgs, SectionUpdateArgs, SectionMoveArgs, SectionReorderArgs, SectionArchiveArgs, SectionUnarchiveArgs, SectionDeleteArgs } from './sections.js';
|
|
13
13
|
import type { AcceptInvitationArgs, RejectInvitationArgs, BizAcceptInvitationArgs, BizRejectInvitationArgs } from './sharing.js';
|
|
14
|
+
import type { TaskAddArgs, TaskUpdateArgs, TaskCompleteArgs, TaskCompleteUndoArgs, TaskMoveArgs, TaskReorderArgs, TaskUncompleteArgs, TaskUpdateDateCompleteArgs, TaskDeleteArgs, TaskUpdateDayOrderArgs } from './tasks.js';
|
|
14
15
|
import type { ViewOptionsSetArgs, ViewOptionsDeleteArgs } from './view-options.js';
|
|
15
|
-
import type {
|
|
16
|
-
import type {
|
|
17
|
-
import type {
|
|
16
|
+
import type { WorkspaceFilterAddArgs, WorkspaceFilterUpdateArgs, WorkspaceFilterUpdateOrdersArgs, WorkspaceFilterDeleteArgs } from './workspace-filters.js';
|
|
17
|
+
import type { WorkspaceGoalAddArgs, WorkspaceGoalUpdateArgs, WorkspaceGoalDeleteArgs, WorkspaceGoalProjectAddArgs, WorkspaceGoalProjectRemoveArgs } from './workspace-goals.js';
|
|
18
|
+
import type { WorkspaceAddArgs, WorkspaceUpdateArgs, WorkspaceDeleteArgs, WorkspaceUpdateUserArgs, WorkspaceDeleteUserArgs, WorkspaceLeaveArgs, WorkspaceInviteArgs, WorkspaceSetDefaultOrderArgs, WorkspaceUpdateUserProjectSortPreferenceArgs } from './workspaces.js';
|
|
18
19
|
/**
|
|
19
20
|
* Maps each Sync API command type string to its corresponding argument type.
|
|
20
21
|
*
|
|
@@ -96,6 +97,13 @@ export type SyncCommandsMap = {
|
|
|
96
97
|
workspace_goal_delete: WorkspaceGoalDeleteArgs;
|
|
97
98
|
workspace_goal_project_add: WorkspaceGoalProjectAddArgs;
|
|
98
99
|
workspace_goal_project_remove: WorkspaceGoalProjectRemoveArgs;
|
|
100
|
+
goal_add: GoalAddArgs;
|
|
101
|
+
goal_update: GoalUpdateArgs;
|
|
102
|
+
goal_complete: GoalCompleteArgs;
|
|
103
|
+
goal_uncomplete: GoalUncompleteArgs;
|
|
104
|
+
goal_delete: GoalDeleteArgs;
|
|
105
|
+
goal_link_item: GoalLinkItemArgs;
|
|
106
|
+
goal_unlink_item: GoalUnlinkItemArgs;
|
|
99
107
|
live_notifications_mark_unread: LiveNotificationsMarkUnreadArgs;
|
|
100
108
|
live_notifications_mark_read: LiveNotificationsMarkReadArgs;
|
|
101
109
|
live_notifications_mark_read_all: LiveNotificationsMarkReadAllArgs;
|
|
@@ -163,6 +171,7 @@ export * from './workspaces.js';
|
|
|
163
171
|
export * from './folders.js';
|
|
164
172
|
export * from './workspace-filters.js';
|
|
165
173
|
export * from './workspace-goals.js';
|
|
174
|
+
export * from './goals.js';
|
|
166
175
|
export * from './notifications.js';
|
|
167
176
|
export * from './sharing.js';
|
|
168
177
|
export * from './view-options.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import type { ColorKey } from '../../../utils/colors.js';
|
|
1
2
|
import type { ProjectViewStyle, ProjectVisibility } from '../../projects/types.js';
|
|
2
3
|
import type { WorkspaceRole, CollaboratorRole } from '../../workspaces/types.js';
|
|
3
4
|
import type { ProjectStatus } from './shared.js';
|
|
4
|
-
import type { ColorKey } from '../../../utils/colors.js';
|
|
5
5
|
export type ProjectAccessConfig = {
|
|
6
6
|
visibility: ProjectVisibility;
|
|
7
7
|
configuration?: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { SyncDueDate, ReminderService } from './shared.js';
|
|
2
1
|
import type { LocationTrigger, ReminderType } from '../resources/reminders.js';
|
|
2
|
+
import type { SyncDueDate, ReminderService } from './shared.js';
|
|
3
3
|
export type ReminderAddArgs = {
|
|
4
4
|
type: Extract<ReminderType, 'absolute'>;
|
|
5
5
|
itemId: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* All available Sync API resource types.
|
|
3
3
|
*/
|
|
4
|
-
export declare const SYNC_RESOURCE_TYPES: readonly ["labels", "projects", "items", "notes", "project_notes", "sections", "filters", "reminders", "reminders_location", "locations", "user", "live_notifications", "collaborators", "collaborator_states", "user_settings", "notification_settings", "user_plan_limits", "completed_info", "stats", "workspaces", "workspace_users", "workspace_filters", "view_options", "project_view_options_defaults", "role_actions", "folders", "workspace_goals", "day_orders", "calendars", "calendar_accounts", "suggestions", "tooltips"];
|
|
4
|
+
export declare const SYNC_RESOURCE_TYPES: readonly ["labels", "projects", "items", "notes", "project_notes", "sections", "filters", "reminders", "reminders_location", "locations", "user", "live_notifications", "collaborators", "collaborator_states", "user_settings", "notification_settings", "user_plan_limits", "completed_info", "stats", "workspaces", "workspace_users", "workspace_filters", "view_options", "project_view_options_defaults", "role_actions", "folders", "workspace_goals", "goals", "day_orders", "calendars", "calendar_accounts", "suggestions", "tooltips"];
|
|
5
5
|
export type SyncResourceType = (typeof SYNC_RESOURCE_TYPES)[number];
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/** Available goal owner types. */
|
|
3
|
+
export declare const GOAL_OWNER_TYPES: readonly ["USER", "WORKSPACE"];
|
|
4
|
+
/** Goal owner type. */
|
|
5
|
+
export type GoalOwnerType = (typeof GOAL_OWNER_TYPES)[number];
|
|
6
|
+
export declare const GoalProgressSchema: z.ZodObject<{
|
|
7
|
+
totalItemCount: z.ZodNumber;
|
|
8
|
+
completedItemCount: z.ZodNumber;
|
|
9
|
+
percentage: z.ZodNumber;
|
|
10
|
+
}, z.core.$loose>;
|
|
11
|
+
export type GoalProgress = z.infer<typeof GoalProgressSchema>;
|
|
12
|
+
export declare const GoalSchema: z.ZodObject<{
|
|
13
|
+
id: z.ZodString;
|
|
14
|
+
ownerType: z.ZodEnum<{
|
|
15
|
+
USER: "USER";
|
|
16
|
+
WORKSPACE: "WORKSPACE";
|
|
17
|
+
}>;
|
|
18
|
+
ownerId: z.ZodString;
|
|
19
|
+
name: z.ZodString;
|
|
20
|
+
description: z.ZodNullable<z.ZodString>;
|
|
21
|
+
deadline: z.ZodNullable<z.ZodString>;
|
|
22
|
+
parentGoalId: z.ZodNullable<z.ZodString>;
|
|
23
|
+
childOrder: z.ZodNumber;
|
|
24
|
+
isCompleted: z.ZodBoolean;
|
|
25
|
+
completedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
26
|
+
responsibleUid: z.ZodNullable<z.ZodString>;
|
|
27
|
+
isDeleted: z.ZodBoolean;
|
|
28
|
+
progress: z.ZodOptional<z.ZodObject<{
|
|
29
|
+
totalItemCount: z.ZodNumber;
|
|
30
|
+
completedItemCount: z.ZodNumber;
|
|
31
|
+
percentage: z.ZodNumber;
|
|
32
|
+
}, z.core.$loose>>;
|
|
33
|
+
creatorUid: z.ZodString;
|
|
34
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
35
|
+
updatedAt: z.ZodCoercedDate<unknown>;
|
|
36
|
+
}, z.core.$loose>;
|
|
37
|
+
export type Goal = z.infer<typeof GoalSchema>;
|
|
@@ -5,6 +5,7 @@ export * from './tooltips.js';
|
|
|
5
5
|
export * from './notes.js';
|
|
6
6
|
export * from './workspace-filters.js';
|
|
7
7
|
export * from './workspace-goals.js';
|
|
8
|
+
export * from './goals.js';
|
|
8
9
|
export * from './calendars.js';
|
|
9
10
|
export * from './reminders.js';
|
|
10
11
|
export * from './completed-info.js';
|
|
@@ -33,13 +33,13 @@ export declare const GROUPED_BY_OPTIONS: readonly ["ASSIGNEE", "ADDED_DATE", "DU
|
|
|
33
33
|
export type GroupedBy = (typeof GROUPED_BY_OPTIONS)[number];
|
|
34
34
|
export declare const GroupedBySchema: z.ZodNullable<z.ZodEnum<{
|
|
35
35
|
PROJECT: "PROJECT";
|
|
36
|
+
WORKSPACE: "WORKSPACE";
|
|
36
37
|
LABEL: "LABEL";
|
|
37
38
|
ASSIGNEE: "ASSIGNEE";
|
|
38
39
|
ADDED_DATE: "ADDED_DATE";
|
|
39
40
|
DUE_DATE: "DUE_DATE";
|
|
40
41
|
DEADLINE: "DEADLINE";
|
|
41
42
|
PRIORITY: "PRIORITY";
|
|
42
|
-
WORKSPACE: "WORKSPACE";
|
|
43
43
|
}>>;
|
|
44
44
|
/** Available sorting options. */
|
|
45
45
|
export declare const SORTED_BY_OPTIONS: readonly ["MANUAL", "ALPHABETICALLY", "ASSIGNEE", "DUE_DATE", "DEADLINE", "ADDED_DATE", "PRIORITY", "PROJECT", "WORKSPACE"];
|
|
@@ -47,13 +47,13 @@ export declare const SORTED_BY_OPTIONS: readonly ["MANUAL", "ALPHABETICALLY", "A
|
|
|
47
47
|
export type SortedBy = (typeof SORTED_BY_OPTIONS)[number];
|
|
48
48
|
export declare const SortedBySchema: z.ZodNullable<z.ZodEnum<{
|
|
49
49
|
PROJECT: "PROJECT";
|
|
50
|
-
|
|
50
|
+
WORKSPACE: "WORKSPACE";
|
|
51
51
|
ASSIGNEE: "ASSIGNEE";
|
|
52
52
|
ADDED_DATE: "ADDED_DATE";
|
|
53
53
|
DUE_DATE: "DUE_DATE";
|
|
54
54
|
DEADLINE: "DEADLINE";
|
|
55
55
|
PRIORITY: "PRIORITY";
|
|
56
|
-
|
|
56
|
+
MANUAL: "MANUAL";
|
|
57
57
|
ALPHABETICALLY: "ALPHABETICALLY";
|
|
58
58
|
}>>;
|
|
59
59
|
/** Available sort directions. */
|
|
@@ -93,13 +93,13 @@ export declare const ViewOptionsSchema: z.ZodObject<{
|
|
|
93
93
|
objectId: z.ZodOptional<z.ZodString>;
|
|
94
94
|
groupedBy: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
95
95
|
PROJECT: "PROJECT";
|
|
96
|
+
WORKSPACE: "WORKSPACE";
|
|
96
97
|
LABEL: "LABEL";
|
|
97
98
|
ASSIGNEE: "ASSIGNEE";
|
|
98
99
|
ADDED_DATE: "ADDED_DATE";
|
|
99
100
|
DUE_DATE: "DUE_DATE";
|
|
100
101
|
DEADLINE: "DEADLINE";
|
|
101
102
|
PRIORITY: "PRIORITY";
|
|
102
|
-
WORKSPACE: "WORKSPACE";
|
|
103
103
|
}>>>;
|
|
104
104
|
filteredBy: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
105
105
|
viewMode: z.ZodOptional<z.ZodEnum<{
|
|
@@ -110,13 +110,13 @@ export declare const ViewOptionsSchema: z.ZodObject<{
|
|
|
110
110
|
showCompletedTasks: z.ZodOptional<z.ZodBoolean>;
|
|
111
111
|
sortedBy: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
112
112
|
PROJECT: "PROJECT";
|
|
113
|
-
|
|
113
|
+
WORKSPACE: "WORKSPACE";
|
|
114
114
|
ASSIGNEE: "ASSIGNEE";
|
|
115
115
|
ADDED_DATE: "ADDED_DATE";
|
|
116
116
|
DUE_DATE: "DUE_DATE";
|
|
117
117
|
DEADLINE: "DEADLINE";
|
|
118
118
|
PRIORITY: "PRIORITY";
|
|
119
|
-
|
|
119
|
+
MANUAL: "MANUAL";
|
|
120
120
|
ALPHABETICALLY: "ALPHABETICALLY";
|
|
121
121
|
}>>>;
|
|
122
122
|
sortOrder: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
@@ -134,23 +134,23 @@ export declare const ProjectViewOptionsDefaultsSchema: z.ZodObject<{
|
|
|
134
134
|
}>>>;
|
|
135
135
|
groupedBy: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
136
136
|
PROJECT: "PROJECT";
|
|
137
|
+
WORKSPACE: "WORKSPACE";
|
|
137
138
|
LABEL: "LABEL";
|
|
138
139
|
ASSIGNEE: "ASSIGNEE";
|
|
139
140
|
ADDED_DATE: "ADDED_DATE";
|
|
140
141
|
DUE_DATE: "DUE_DATE";
|
|
141
142
|
DEADLINE: "DEADLINE";
|
|
142
143
|
PRIORITY: "PRIORITY";
|
|
143
|
-
WORKSPACE: "WORKSPACE";
|
|
144
144
|
}>>>;
|
|
145
145
|
sortedBy: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
146
146
|
PROJECT: "PROJECT";
|
|
147
|
-
|
|
147
|
+
WORKSPACE: "WORKSPACE";
|
|
148
148
|
ASSIGNEE: "ASSIGNEE";
|
|
149
149
|
ADDED_DATE: "ADDED_DATE";
|
|
150
150
|
DUE_DATE: "DUE_DATE";
|
|
151
151
|
DEADLINE: "DEADLINE";
|
|
152
152
|
PRIORITY: "PRIORITY";
|
|
153
|
-
|
|
153
|
+
MANUAL: "MANUAL";
|
|
154
154
|
ALPHABETICALLY: "ALPHABETICALLY";
|
|
155
155
|
}>>>;
|
|
156
156
|
sortOrder: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Label } from '../labels/types.js';
|
|
2
2
|
import type { PersonalProject, WorkspaceProject } from '../projects/types.js';
|
|
3
3
|
import type { Section } from '../sections/types.js';
|
|
4
|
-
import type {
|
|
4
|
+
import type { Task } from '../tasks/types.js';
|
|
5
5
|
import type { WorkspaceUser } from '../workspaces/types.js';
|
|
6
|
-
import type { Filter, Collaborator, CollaboratorState, Folder, Note, Tooltips, WorkspaceFilter, WorkspaceGoal, Calendar, CalendarAccount, Reminder, CompletedInfo, ViewOptions, ProjectViewOptionsDefaults, UserPlanLimits, LiveNotification, SyncWorkspace, SyncUser, UserSettings, LocationReminder, Suggestion } from './resources/index.js';
|
|
6
|
+
import type { Filter, Collaborator, CollaboratorState, Folder, Note, Tooltips, WorkspaceFilter, WorkspaceGoal, Goal, Calendar, CalendarAccount, Reminder, CompletedInfo, ViewOptions, ProjectViewOptionsDefaults, UserPlanLimits, LiveNotification, SyncWorkspace, SyncUser, UserSettings, LocationReminder, Suggestion } from './resources/index.js';
|
|
7
7
|
export type SyncError = {
|
|
8
8
|
error: string;
|
|
9
9
|
errorCode: number;
|
|
@@ -43,6 +43,7 @@ export type SyncResponse = {
|
|
|
43
43
|
roleActions?: Record<string, unknown>[];
|
|
44
44
|
folders?: Folder[];
|
|
45
45
|
workspaceGoals?: WorkspaceGoal[];
|
|
46
|
+
goals?: Goal[];
|
|
46
47
|
dayOrders?: Record<string, number>;
|
|
47
48
|
calendars?: Calendar[];
|
|
48
49
|
calendarAccounts?: CalendarAccount[];
|
|
@@ -1015,30 +1015,30 @@ export declare const validateViewOptions: (input: unknown) => {
|
|
|
1015
1015
|
[x: string]: unknown;
|
|
1016
1016
|
viewType: "PROJECT" | "TODAY" | "UPCOMING" | "LABEL" | "FILTER" | "WORKSPACE_FILTER" | "SEARCH" | "TEMPLATE_PREVIEW" | "TASK_DETAIL" | "AUTOMATION" | "ASSIGNED" | "OVERDUE" | "WORKSPACE_OVERVIEW";
|
|
1017
1017
|
objectId?: string | undefined;
|
|
1018
|
-
groupedBy?: "PROJECT" | "LABEL" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" |
|
|
1018
|
+
groupedBy?: "PROJECT" | "WORKSPACE" | "LABEL" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" | null | undefined;
|
|
1019
1019
|
filteredBy?: string | null | undefined;
|
|
1020
1020
|
viewMode?: "LIST" | "BOARD" | "CALENDAR" | undefined;
|
|
1021
1021
|
showCompletedTasks?: boolean | undefined;
|
|
1022
|
-
sortedBy?: "PROJECT" | "
|
|
1022
|
+
sortedBy?: "PROJECT" | "WORKSPACE" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" | "MANUAL" | "ALPHABETICALLY" | null | undefined;
|
|
1023
1023
|
sortOrder?: "ASC" | "DESC" | null | undefined;
|
|
1024
1024
|
};
|
|
1025
1025
|
export declare const validateViewOptionsArray: (input: unknown[]) => {
|
|
1026
1026
|
[x: string]: unknown;
|
|
1027
1027
|
viewType: "PROJECT" | "TODAY" | "UPCOMING" | "LABEL" | "FILTER" | "WORKSPACE_FILTER" | "SEARCH" | "TEMPLATE_PREVIEW" | "TASK_DETAIL" | "AUTOMATION" | "ASSIGNED" | "OVERDUE" | "WORKSPACE_OVERVIEW";
|
|
1028
1028
|
objectId?: string | undefined;
|
|
1029
|
-
groupedBy?: "PROJECT" | "LABEL" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" |
|
|
1029
|
+
groupedBy?: "PROJECT" | "WORKSPACE" | "LABEL" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" | null | undefined;
|
|
1030
1030
|
filteredBy?: string | null | undefined;
|
|
1031
1031
|
viewMode?: "LIST" | "BOARD" | "CALENDAR" | undefined;
|
|
1032
1032
|
showCompletedTasks?: boolean | undefined;
|
|
1033
|
-
sortedBy?: "PROJECT" | "
|
|
1033
|
+
sortedBy?: "PROJECT" | "WORKSPACE" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" | "MANUAL" | "ALPHABETICALLY" | null | undefined;
|
|
1034
1034
|
sortOrder?: "ASC" | "DESC" | null | undefined;
|
|
1035
1035
|
}[];
|
|
1036
1036
|
export declare const validateProjectViewOptionsDefaults: (input: unknown) => {
|
|
1037
1037
|
[x: string]: unknown;
|
|
1038
1038
|
projectId: string;
|
|
1039
1039
|
viewMode?: "LIST" | "BOARD" | "CALENDAR" | null | undefined;
|
|
1040
|
-
groupedBy?: "PROJECT" | "LABEL" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" |
|
|
1041
|
-
sortedBy?: "PROJECT" | "
|
|
1040
|
+
groupedBy?: "PROJECT" | "WORKSPACE" | "LABEL" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" | null | undefined;
|
|
1041
|
+
sortedBy?: "PROJECT" | "WORKSPACE" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" | "MANUAL" | "ALPHABETICALLY" | null | undefined;
|
|
1042
1042
|
sortOrder?: "ASC" | "DESC" | null | undefined;
|
|
1043
1043
|
showCompletedTasks?: boolean | undefined;
|
|
1044
1044
|
filteredBy?: string | null | undefined;
|
|
@@ -1051,8 +1051,8 @@ export declare const validateProjectViewOptionsDefaultsArray: (input: unknown[])
|
|
|
1051
1051
|
[x: string]: unknown;
|
|
1052
1052
|
projectId: string;
|
|
1053
1053
|
viewMode?: "LIST" | "BOARD" | "CALENDAR" | null | undefined;
|
|
1054
|
-
groupedBy?: "PROJECT" | "LABEL" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" |
|
|
1055
|
-
sortedBy?: "PROJECT" | "
|
|
1054
|
+
groupedBy?: "PROJECT" | "WORKSPACE" | "LABEL" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" | null | undefined;
|
|
1055
|
+
sortedBy?: "PROJECT" | "WORKSPACE" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" | "MANUAL" | "ALPHABETICALLY" | null | undefined;
|
|
1056
1056
|
sortOrder?: "ASC" | "DESC" | null | undefined;
|
|
1057
1057
|
showCompletedTasks?: boolean | undefined;
|
|
1058
1058
|
filteredBy?: string | null | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@doist/todoist-sdk",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.2.0",
|
|
4
4
|
"description": "The official TypeScript SDK for the Todoist REST API.",
|
|
5
5
|
"author": "Doist developers",
|
|
6
6
|
"repository": "https://github.com/Doist/todoist-sdk-typescript",
|
|
@@ -27,10 +27,8 @@
|
|
|
27
27
|
},
|
|
28
28
|
"scripts": {
|
|
29
29
|
"clean": "rimraf dist",
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"lint": "oxlint src --fix",
|
|
33
|
-
"lint-check": "oxlint src",
|
|
30
|
+
"check": "oxlint src && oxfmt --check",
|
|
31
|
+
"check:fix": "oxlint src --fix && oxfmt",
|
|
34
32
|
"ts-compile-check": "npx tsc -p tsconfig.typecheck.json",
|
|
35
33
|
"audit": "npm audit --audit-level=moderate",
|
|
36
34
|
"test": "vitest run",
|
|
@@ -44,7 +42,7 @@
|
|
|
44
42
|
"build:post": "echo '{\"type\":\"commonjs\"}' > dist/cjs/package.json",
|
|
45
43
|
"build": "npm-run-all clean build:cjs build:esm build:fix-esm build:fix-dts build:post",
|
|
46
44
|
"attw": "npx @arethetypeswrong/cli --pack --ignore-rules fallback-condition false-esm",
|
|
47
|
-
"integrity-checks": "npm-run-all clean
|
|
45
|
+
"integrity-checks": "npm-run-all clean check test build attw",
|
|
48
46
|
"prepublishOnly": "npm run integrity-checks",
|
|
49
47
|
"prepare": "npm run build"
|
|
50
48
|
},
|
|
@@ -58,9 +56,7 @@
|
|
|
58
56
|
"zod": "4.3.6"
|
|
59
57
|
},
|
|
60
58
|
"devDependencies": {
|
|
61
|
-
"@doist/prettier-config": "4.0.0",
|
|
62
59
|
"@semantic-release/changelog": "6.0.3",
|
|
63
|
-
"@semantic-release/exec": "7.1.0",
|
|
64
60
|
"@semantic-release/git": "10.0.1",
|
|
65
61
|
"conventional-changelog-conventionalcommits": "9.3.0",
|
|
66
62
|
"dotenv": "17.3.1",
|
|
@@ -69,8 +65,8 @@
|
|
|
69
65
|
"msw": "2.12.13",
|
|
70
66
|
"npm-run-all2": "8.0.4",
|
|
71
67
|
"obsidian": "^1.10.2-1",
|
|
68
|
+
"oxfmt": "0.43.0",
|
|
72
69
|
"oxlint": "1.57.0",
|
|
73
|
-
"prettier": "3.3.2",
|
|
74
70
|
"rimraf": "6.1.3",
|
|
75
71
|
"semantic-release": "25.0.3",
|
|
76
72
|
"ts-node": "10.9.2",
|
|
@@ -81,7 +77,6 @@
|
|
|
81
77
|
"peerDependencies": {
|
|
82
78
|
"type-fest": "^4.12.0"
|
|
83
79
|
},
|
|
84
|
-
"prettier": "@doist/prettier-config",
|
|
85
80
|
"husky": {
|
|
86
81
|
"hooks": {
|
|
87
82
|
"pre-commit": "npx lint-staged && npm run build"
|
|
@@ -89,7 +84,7 @@
|
|
|
89
84
|
},
|
|
90
85
|
"lint-staged": {
|
|
91
86
|
"*.{ts,tsx}": "oxlint --fix",
|
|
92
|
-
"*.{ts,tsx,json,
|
|
87
|
+
"*.{ts,tsx,json,md,yml,yaml}": "oxfmt --no-error-on-unmatched-pattern"
|
|
93
88
|
},
|
|
94
89
|
"files": [
|
|
95
90
|
"dist/cjs/**/*",
|