@doist/todoist-api-typescript 6.5.1 → 6.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/todoist-api.js +32 -4
- package/dist/cjs/types/index.js +1 -0
- package/dist/cjs/types/sync/commands/calendars.js +2 -0
- package/dist/cjs/types/sync/commands/filters.js +2 -0
- package/dist/cjs/types/sync/commands/folders.js +2 -0
- package/dist/cjs/types/sync/commands/index.js +35 -0
- package/dist/cjs/types/sync/commands/labels.js +2 -0
- package/dist/cjs/types/sync/commands/notes.js +2 -0
- package/dist/cjs/types/sync/commands/notifications.js +2 -0
- package/dist/cjs/types/sync/commands/others.js +2 -0
- package/dist/cjs/types/sync/commands/project-view-options.js +2 -0
- package/dist/cjs/types/sync/commands/projects.js +2 -0
- package/dist/cjs/types/sync/commands/reminders.js +2 -0
- package/dist/cjs/types/sync/commands/sections.js +2 -0
- package/dist/cjs/types/sync/commands/shared.js +5 -0
- package/dist/cjs/types/sync/commands/sharing.js +2 -0
- package/dist/cjs/types/sync/commands/tasks.js +2 -0
- package/dist/cjs/types/sync/commands/view-options.js +2 -0
- package/dist/cjs/types/sync/commands/workspace-filters.js +2 -0
- package/dist/cjs/types/sync/commands/workspace-goals.js +2 -0
- package/dist/cjs/types/sync/commands/workspaces.js +2 -0
- package/dist/cjs/types/sync/index.js +21 -0
- package/dist/cjs/types/sync/request.js +2 -0
- package/dist/cjs/types/{sync.js → sync/resource-types.js} +9 -0
- package/dist/cjs/types/sync/resources/calendars.js +27 -0
- package/dist/cjs/types/sync/resources/collaborators.js +23 -0
- package/dist/cjs/types/sync/resources/completed-info.js +30 -0
- package/dist/cjs/types/sync/resources/filters.js +16 -0
- package/dist/cjs/types/sync/resources/folders.js +14 -0
- package/dist/cjs/types/sync/resources/index.js +33 -0
- package/dist/cjs/types/sync/resources/live-notifications.js +28 -0
- package/dist/cjs/types/sync/resources/notes.js +23 -0
- package/dist/cjs/types/sync/resources/reminders.js +34 -0
- package/dist/cjs/types/sync/resources/suggestions.js +38 -0
- package/dist/cjs/types/sync/resources/tooltips.js +10 -0
- package/dist/cjs/types/sync/resources/user-plan-limits.js +24 -0
- package/dist/cjs/types/sync/resources/user-settings.js +42 -0
- package/dist/cjs/types/sync/resources/user.js +123 -0
- package/dist/cjs/types/sync/resources/view-options.js +75 -0
- package/dist/cjs/types/sync/resources/workspace-filters.js +21 -0
- package/dist/cjs/types/sync/resources/workspace-goals.js +32 -0
- package/dist/cjs/types/sync/resources/workspaces.js +49 -0
- package/dist/cjs/types/sync/response.js +2 -0
- package/dist/cjs/utils/index.js +3 -1
- package/dist/cjs/utils/sync-helpers.js +22 -0
- package/dist/cjs/utils/validators.js +69 -88
- package/dist/esm/todoist-api.js +32 -4
- package/dist/esm/types/index.js +1 -0
- package/dist/esm/types/sync/commands/calendars.js +1 -0
- package/dist/esm/types/sync/commands/filters.js +1 -0
- package/dist/esm/types/sync/commands/folders.js +1 -0
- package/dist/esm/types/sync/commands/index.js +19 -0
- package/dist/esm/types/sync/commands/labels.js +1 -0
- package/dist/esm/types/sync/commands/notes.js +1 -0
- package/dist/esm/types/sync/commands/notifications.js +1 -0
- package/dist/esm/types/sync/commands/others.js +1 -0
- package/dist/esm/types/sync/commands/project-view-options.js +1 -0
- package/dist/esm/types/sync/commands/projects.js +1 -0
- package/dist/esm/types/sync/commands/reminders.js +1 -0
- package/dist/esm/types/sync/commands/sections.js +1 -0
- package/dist/esm/types/sync/commands/shared.js +4 -0
- package/dist/esm/types/sync/commands/sharing.js +1 -0
- package/dist/esm/types/sync/commands/tasks.js +1 -0
- package/dist/esm/types/sync/commands/view-options.js +1 -0
- package/dist/esm/types/sync/commands/workspace-filters.js +1 -0
- package/dist/esm/types/sync/commands/workspace-goals.js +1 -0
- package/dist/esm/types/sync/commands/workspaces.js +1 -0
- package/dist/esm/types/sync/index.js +5 -0
- package/dist/esm/types/sync/request.js +1 -0
- package/dist/esm/types/{sync.js → sync/resource-types.js} +9 -0
- package/dist/esm/types/sync/resources/calendars.js +24 -0
- package/dist/esm/types/sync/resources/collaborators.js +20 -0
- package/dist/esm/types/sync/resources/completed-info.js +27 -0
- package/dist/esm/types/sync/resources/filters.js +13 -0
- package/dist/esm/types/sync/resources/folders.js +11 -0
- package/dist/esm/types/sync/resources/index.js +17 -0
- package/dist/esm/types/sync/resources/live-notifications.js +25 -0
- package/dist/esm/types/sync/resources/notes.js +20 -0
- package/dist/esm/types/sync/resources/reminders.js +31 -0
- package/dist/esm/types/sync/resources/suggestions.js +35 -0
- package/dist/esm/types/sync/resources/tooltips.js +7 -0
- package/dist/esm/types/sync/resources/user-plan-limits.js +21 -0
- package/dist/esm/types/sync/resources/user-settings.js +39 -0
- package/dist/esm/types/sync/resources/user.js +120 -0
- package/dist/esm/types/sync/resources/view-options.js +72 -0
- package/dist/esm/types/sync/resources/workspace-filters.js +18 -0
- package/dist/esm/types/sync/resources/workspace-goals.js +29 -0
- package/dist/esm/types/sync/resources/workspaces.js +46 -0
- package/dist/esm/types/sync/response.js +1 -0
- package/dist/esm/utils/index.js +1 -0
- package/dist/esm/utils/sync-helpers.js +19 -0
- package/dist/esm/utils/validators.js +65 -64
- package/dist/types/todoist-api.d.ts +26 -0
- package/dist/types/types/index.d.ts +1 -0
- package/dist/types/types/sync/commands/calendars.d.ts +14 -0
- package/dist/types/types/sync/commands/filters.d.ts +21 -0
- package/dist/types/types/sync/commands/folders.d.ts +18 -0
- package/dist/types/types/sync/commands/index.d.ts +172 -0
- package/dist/types/types/sync/commands/labels.d.ts +27 -0
- package/dist/types/types/sync/commands/notes.d.ts +27 -0
- package/dist/types/types/sync/commands/notifications.d.ts +10 -0
- package/dist/types/types/sync/commands/others.d.ts +14 -0
- package/dist/types/types/sync/commands/project-view-options.d.ts +14 -0
- package/dist/types/types/sync/commands/projects.d.ts +88 -0
- package/dist/types/types/sync/commands/reminders.d.ts +27 -0
- package/dist/types/types/sync/commands/sections.d.ts +31 -0
- package/dist/types/types/sync/commands/shared.d.ts +46 -0
- package/dist/types/types/sync/commands/sharing.d.ts +16 -0
- package/dist/types/types/sync/commands/tasks.d.ts +78 -0
- package/dist/types/types/sync/commands/view-options.d.ts +19 -0
- package/dist/types/types/sync/commands/workspace-filters.d.ts +22 -0
- package/dist/types/types/sync/commands/workspace-goals.d.ts +24 -0
- package/dist/types/types/sync/commands/workspaces.d.ts +79 -0
- package/dist/types/types/sync/index.d.ts +5 -0
- package/dist/types/types/sync/request.d.ts +7 -0
- package/dist/types/types/sync/resource-types.d.ts +5 -0
- package/dist/types/types/sync/resources/calendars.d.ts +30 -0
- package/dist/types/types/sync/resources/collaborators.d.ts +24 -0
- package/dist/types/types/sync/resources/completed-info.d.ts +33 -0
- package/dist/types/types/sync/resources/filters.d.ts +12 -0
- package/dist/types/types/sync/resources/folders.d.ts +10 -0
- package/dist/types/types/sync/resources/index.d.ts +17 -0
- package/dist/types/types/sync/resources/live-notifications.d.ts +23 -0
- package/dist/types/types/sync/resources/notes.d.ts +34 -0
- package/dist/types/types/sync/resources/reminders.d.ts +101 -0
- package/dist/types/types/sync/resources/suggestions.d.ts +54 -0
- package/dist/types/types/sync/resources/tooltips.d.ts +6 -0
- package/dist/types/types/sync/resources/user-plan-limits.d.ts +41 -0
- package/dist/types/types/sync/resources/user-settings.d.ts +32 -0
- package/dist/types/types/sync/resources/user.d.ts +104 -0
- package/dist/types/types/sync/resources/view-options.d.ts +94 -0
- package/dist/types/types/sync/resources/workspace-filters.d.ts +17 -0
- package/dist/types/types/sync/resources/workspace-goals.d.ts +29 -0
- package/dist/types/types/sync/resources/workspaces.d.ts +52 -0
- package/dist/types/types/sync/response.d.ts +47 -0
- package/dist/types/utils/index.d.ts +1 -0
- package/dist/types/utils/sync-helpers.d.ts +17 -0
- package/dist/types/utils/validators.d.ts +1163 -23
- package/package.json +1 -1
- package/dist/types/types/sync.d.ts +0 -30
package/dist/cjs/todoist-api.js
CHANGED
|
@@ -76,6 +76,34 @@ class TodoistApi {
|
|
|
76
76
|
}
|
|
77
77
|
return response.data;
|
|
78
78
|
}
|
|
79
|
+
/**
|
|
80
|
+
* Executes a raw Sync API request.
|
|
81
|
+
*
|
|
82
|
+
* This method provides direct access to the Sync API, allowing you to send
|
|
83
|
+
* strongly-typed commands and request specific resource types.
|
|
84
|
+
*
|
|
85
|
+
* @param request - The sync request payload containing commands and/or resource types.
|
|
86
|
+
* @param requestId - Optional custom identifier for the request.
|
|
87
|
+
* @returns A promise that resolves to the sync response.
|
|
88
|
+
* @throws TodoistRequestError if the sync status contains errors.
|
|
89
|
+
*
|
|
90
|
+
* @example
|
|
91
|
+
* ```typescript
|
|
92
|
+
* import { createCommand } from '@doist/todoist-api-typescript'
|
|
93
|
+
*
|
|
94
|
+
* const response = await api.sync({
|
|
95
|
+
* commands: [
|
|
96
|
+
* createCommand('item_add', { content: 'Buy milk' }),
|
|
97
|
+
* ],
|
|
98
|
+
* resourceTypes: ['items'],
|
|
99
|
+
* syncToken: '*',
|
|
100
|
+
* })
|
|
101
|
+
* ```
|
|
102
|
+
*/
|
|
103
|
+
async sync(syncRequest, requestId) {
|
|
104
|
+
var _a;
|
|
105
|
+
return this.requestSync(syncRequest, requestId, Boolean((_a = syncRequest.commands) === null || _a === void 0 ? void 0 : _a.length));
|
|
106
|
+
}
|
|
79
107
|
/**
|
|
80
108
|
* Retrieves information about the authenticated user.
|
|
81
109
|
*
|
|
@@ -289,11 +317,11 @@ class TodoistApi {
|
|
|
289
317
|
const commands = ids.map((id) => ({
|
|
290
318
|
type: 'item_move',
|
|
291
319
|
uuid: (0, uuid_1.v4)(),
|
|
292
|
-
args: Object.assign(Object.assign(Object.assign({ id }, (args.projectId
|
|
320
|
+
args: Object.assign(Object.assign(Object.assign({ id }, (args.projectId ? { projectId: args.projectId } : {})), (args.sectionId ? { sectionId: args.sectionId } : {})), (args.parentId ? { parentId: args.parentId } : {})),
|
|
293
321
|
}));
|
|
294
322
|
const syncRequest = {
|
|
295
323
|
commands,
|
|
296
|
-
|
|
324
|
+
resourceTypes: ['items'],
|
|
297
325
|
};
|
|
298
326
|
const syncResponse = await this.requestSync(syncRequest, requestId, true);
|
|
299
327
|
if (!((_a = syncResponse.items) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
@@ -1358,8 +1386,8 @@ class TodoistApi {
|
|
|
1358
1386
|
*/
|
|
1359
1387
|
async getWorkspaces(requestId) {
|
|
1360
1388
|
const syncRequest = {
|
|
1361
|
-
|
|
1362
|
-
|
|
1389
|
+
syncToken: '*',
|
|
1390
|
+
resourceTypes: ['workspaces'],
|
|
1363
1391
|
};
|
|
1364
1392
|
const syncResponse = await this.requestSync(syncRequest, requestId, false);
|
|
1365
1393
|
const workspacesData = syncResponse.workspaces;
|
package/dist/cjs/types/index.js
CHANGED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
// Re-export all domain types
|
|
18
|
+
__exportStar(require("./shared"), exports);
|
|
19
|
+
__exportStar(require("./tasks"), exports);
|
|
20
|
+
__exportStar(require("./projects"), exports);
|
|
21
|
+
__exportStar(require("./sections"), exports);
|
|
22
|
+
__exportStar(require("./labels"), exports);
|
|
23
|
+
__exportStar(require("./filters"), exports);
|
|
24
|
+
__exportStar(require("./notes"), exports);
|
|
25
|
+
__exportStar(require("./reminders"), exports);
|
|
26
|
+
__exportStar(require("./workspaces"), exports);
|
|
27
|
+
__exportStar(require("./folders"), exports);
|
|
28
|
+
__exportStar(require("./workspace-filters"), exports);
|
|
29
|
+
__exportStar(require("./workspace-goals"), exports);
|
|
30
|
+
__exportStar(require("./notifications"), exports);
|
|
31
|
+
__exportStar(require("./sharing"), exports);
|
|
32
|
+
__exportStar(require("./view-options"), exports);
|
|
33
|
+
__exportStar(require("./project-view-options"), exports);
|
|
34
|
+
__exportStar(require("./calendars"), exports);
|
|
35
|
+
__exportStar(require("./others"), exports);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./commands"), exports);
|
|
18
|
+
__exportStar(require("./resources"), exports);
|
|
19
|
+
__exportStar(require("./resource-types"), exports);
|
|
20
|
+
__exportStar(require("./request"), exports);
|
|
21
|
+
__exportStar(require("./response"), exports);
|
|
@@ -9,6 +9,7 @@ exports.SYNC_RESOURCE_TYPES = [
|
|
|
9
9
|
'projects',
|
|
10
10
|
'items',
|
|
11
11
|
'notes',
|
|
12
|
+
'project_notes',
|
|
12
13
|
'sections',
|
|
13
14
|
'filters',
|
|
14
15
|
'reminders',
|
|
@@ -17,6 +18,7 @@ exports.SYNC_RESOURCE_TYPES = [
|
|
|
17
18
|
'user',
|
|
18
19
|
'live_notifications',
|
|
19
20
|
'collaborators',
|
|
21
|
+
'collaborator_states',
|
|
20
22
|
'user_settings',
|
|
21
23
|
'notification_settings',
|
|
22
24
|
'user_plan_limits',
|
|
@@ -28,4 +30,11 @@ exports.SYNC_RESOURCE_TYPES = [
|
|
|
28
30
|
'view_options',
|
|
29
31
|
'project_view_options_defaults',
|
|
30
32
|
'role_actions',
|
|
33
|
+
'folders',
|
|
34
|
+
'workspace_goals',
|
|
35
|
+
'day_orders',
|
|
36
|
+
'calendars',
|
|
37
|
+
'calendar_accounts',
|
|
38
|
+
'suggestions',
|
|
39
|
+
'tooltips',
|
|
31
40
|
];
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CalendarAccountSchema = exports.CalendarSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.CalendarSchema = zod_1.z
|
|
6
|
+
.object({
|
|
7
|
+
id: zod_1.z.string(),
|
|
8
|
+
summary: zod_1.z.string(),
|
|
9
|
+
color: zod_1.z.string().nullable(),
|
|
10
|
+
accountId: zod_1.z.string(),
|
|
11
|
+
isVisible: zod_1.z.boolean(),
|
|
12
|
+
isTaskCalendar: zod_1.z.boolean().optional(),
|
|
13
|
+
})
|
|
14
|
+
.passthrough();
|
|
15
|
+
exports.CalendarAccountSchema = zod_1.z
|
|
16
|
+
.object({
|
|
17
|
+
id: zod_1.z.string(),
|
|
18
|
+
name: zod_1.z.string(),
|
|
19
|
+
type: zod_1.z.enum(['google', 'microsoft', 'apple']),
|
|
20
|
+
isDeleted: zod_1.z.boolean().optional(),
|
|
21
|
+
isEventsEnabled: zod_1.z.boolean().optional(),
|
|
22
|
+
isTasksEnabled: zod_1.z.boolean().optional(),
|
|
23
|
+
isAllDayTasksEnabled: zod_1.z.boolean().optional(),
|
|
24
|
+
pendingOperationUntil: zod_1.z.string().nullable().optional(),
|
|
25
|
+
calendarsSyncState: zod_1.z.enum(['synced', 'syncing', 'error']).optional(),
|
|
26
|
+
})
|
|
27
|
+
.passthrough();
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CollaboratorStateSchema = exports.CollaboratorSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const entities_1 = require("../../entities");
|
|
6
|
+
exports.CollaboratorSchema = zod_1.z
|
|
7
|
+
.object({
|
|
8
|
+
id: zod_1.z.string(),
|
|
9
|
+
email: zod_1.z.string(),
|
|
10
|
+
fullName: zod_1.z.string(),
|
|
11
|
+
timezone: zod_1.z.string(),
|
|
12
|
+
imageId: zod_1.z.string().nullable(),
|
|
13
|
+
})
|
|
14
|
+
.passthrough();
|
|
15
|
+
exports.CollaboratorStateSchema = zod_1.z
|
|
16
|
+
.object({
|
|
17
|
+
userId: zod_1.z.string(),
|
|
18
|
+
projectId: zod_1.z.string(),
|
|
19
|
+
state: zod_1.z.enum(['active', 'invited']),
|
|
20
|
+
isDeleted: zod_1.z.boolean(),
|
|
21
|
+
workspaceRole: entities_1.WorkspaceRoleSchema.optional(),
|
|
22
|
+
})
|
|
23
|
+
.passthrough();
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CompletedInfoSchema = exports.CompletedTaskMetadataSchema = exports.CompletedSectionMetadataSchema = exports.CompletedProjectMetadataSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.CompletedProjectMetadataSchema = zod_1.z
|
|
6
|
+
.object({
|
|
7
|
+
projectId: zod_1.z.string(),
|
|
8
|
+
archivedSections: zod_1.z.number().int(),
|
|
9
|
+
completedItems: zod_1.z.number().int(),
|
|
10
|
+
})
|
|
11
|
+
.passthrough();
|
|
12
|
+
exports.CompletedSectionMetadataSchema = zod_1.z
|
|
13
|
+
.object({
|
|
14
|
+
sectionId: zod_1.z.string(),
|
|
15
|
+
id: zod_1.z.string(),
|
|
16
|
+
completedItems: zod_1.z.number().int(),
|
|
17
|
+
})
|
|
18
|
+
.passthrough();
|
|
19
|
+
exports.CompletedTaskMetadataSchema = zod_1.z
|
|
20
|
+
.object({
|
|
21
|
+
itemId: zod_1.z.string(),
|
|
22
|
+
id: zod_1.z.string().optional(),
|
|
23
|
+
completedItems: zod_1.z.number().int(),
|
|
24
|
+
})
|
|
25
|
+
.passthrough();
|
|
26
|
+
exports.CompletedInfoSchema = zod_1.z.union([
|
|
27
|
+
exports.CompletedProjectMetadataSchema,
|
|
28
|
+
exports.CompletedSectionMetadataSchema,
|
|
29
|
+
exports.CompletedTaskMetadataSchema,
|
|
30
|
+
]);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FilterSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.FilterSchema = zod_1.z
|
|
6
|
+
.object({
|
|
7
|
+
id: zod_1.z.string(),
|
|
8
|
+
name: zod_1.z.string(),
|
|
9
|
+
query: zod_1.z.string(),
|
|
10
|
+
color: zod_1.z.string(),
|
|
11
|
+
isDeleted: zod_1.z.boolean(),
|
|
12
|
+
isFavorite: zod_1.z.boolean(),
|
|
13
|
+
isFrozen: zod_1.z.boolean(),
|
|
14
|
+
itemOrder: zod_1.z.number().int(),
|
|
15
|
+
})
|
|
16
|
+
.passthrough();
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FolderSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.FolderSchema = zod_1.z
|
|
6
|
+
.object({
|
|
7
|
+
id: zod_1.z.string(),
|
|
8
|
+
name: zod_1.z.string(),
|
|
9
|
+
workspaceId: zod_1.z.string(),
|
|
10
|
+
isDeleted: zod_1.z.boolean(),
|
|
11
|
+
defaultOrder: zod_1.z.number().int(),
|
|
12
|
+
childOrder: zod_1.z.number().int(),
|
|
13
|
+
})
|
|
14
|
+
.passthrough();
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./filters"), exports);
|
|
18
|
+
__exportStar(require("./collaborators"), exports);
|
|
19
|
+
__exportStar(require("./folders"), exports);
|
|
20
|
+
__exportStar(require("./tooltips"), exports);
|
|
21
|
+
__exportStar(require("./notes"), exports);
|
|
22
|
+
__exportStar(require("./workspace-filters"), exports);
|
|
23
|
+
__exportStar(require("./workspace-goals"), exports);
|
|
24
|
+
__exportStar(require("./calendars"), exports);
|
|
25
|
+
__exportStar(require("./reminders"), exports);
|
|
26
|
+
__exportStar(require("./completed-info"), exports);
|
|
27
|
+
__exportStar(require("./view-options"), exports);
|
|
28
|
+
__exportStar(require("./user-plan-limits"), exports);
|
|
29
|
+
__exportStar(require("./live-notifications"), exports);
|
|
30
|
+
__exportStar(require("./workspaces"), exports);
|
|
31
|
+
__exportStar(require("./user"), exports);
|
|
32
|
+
__exportStar(require("./user-settings"), exports);
|
|
33
|
+
__exportStar(require("./suggestions"), exports);
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LiveNotificationSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
/**
|
|
6
|
+
* Live notification resource from the Sync API.
|
|
7
|
+
*
|
|
8
|
+
* Uses a base schema with commonly-present fields plus `.passthrough()` for
|
|
9
|
+
* forward compatibility. The Sync API returns 20+ notification variants;
|
|
10
|
+
* fully typing each is too fragile for a library, so we validate the common
|
|
11
|
+
* shape and preserve all extra fields.
|
|
12
|
+
*/
|
|
13
|
+
exports.LiveNotificationSchema = zod_1.z
|
|
14
|
+
.object({
|
|
15
|
+
id: zod_1.z.string(),
|
|
16
|
+
createdAt: zod_1.z.string(),
|
|
17
|
+
fromUid: zod_1.z.string(),
|
|
18
|
+
notificationType: zod_1.z.string(),
|
|
19
|
+
isUnread: zod_1.z.boolean(),
|
|
20
|
+
// Commonly present optional fields
|
|
21
|
+
projectId: zod_1.z.string().optional(),
|
|
22
|
+
invitationId: zod_1.z.string().optional(),
|
|
23
|
+
itemId: zod_1.z.string().optional(),
|
|
24
|
+
itemContent: zod_1.z.string().optional(),
|
|
25
|
+
responsibleUid: zod_1.z.string().optional(),
|
|
26
|
+
assignedByUid: zod_1.z.string().optional(),
|
|
27
|
+
})
|
|
28
|
+
.passthrough();
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NoteSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const entities_1 = require("../../entities");
|
|
6
|
+
/**
|
|
7
|
+
* Sync API note (comment) resource.
|
|
8
|
+
* Separate from the REST `CommentSchema` which transforms `itemId` to `taskId`.
|
|
9
|
+
*/
|
|
10
|
+
exports.NoteSchema = zod_1.z
|
|
11
|
+
.object({
|
|
12
|
+
id: zod_1.z.string(),
|
|
13
|
+
itemId: zod_1.z.string().optional(),
|
|
14
|
+
projectId: zod_1.z.string().optional(),
|
|
15
|
+
content: zod_1.z.string(),
|
|
16
|
+
postedAt: zod_1.z.string(),
|
|
17
|
+
fileAttachment: entities_1.AttachmentSchema.nullable(),
|
|
18
|
+
postedUid: zod_1.z.string(),
|
|
19
|
+
uidsToNotify: zod_1.z.array(zod_1.z.string()).nullable(),
|
|
20
|
+
reactions: zod_1.z.record(zod_1.z.string(), zod_1.z.array(zod_1.z.string())).nullable(),
|
|
21
|
+
isDeleted: zod_1.z.boolean(),
|
|
22
|
+
})
|
|
23
|
+
.passthrough();
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ReminderSchema = exports.RelativeReminderSchema = exports.AbsoluteReminderSchema = exports.LocationReminderSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const entities_1 = require("../../entities");
|
|
6
|
+
const ReminderBaseSchema = zod_1.z.object({
|
|
7
|
+
id: zod_1.z.string(),
|
|
8
|
+
notifyUid: zod_1.z.string(),
|
|
9
|
+
itemId: zod_1.z.string(),
|
|
10
|
+
projectId: zod_1.z.string().optional(),
|
|
11
|
+
isDeleted: zod_1.z.boolean(),
|
|
12
|
+
});
|
|
13
|
+
exports.LocationReminderSchema = ReminderBaseSchema.extend({
|
|
14
|
+
type: zod_1.z.literal('location'),
|
|
15
|
+
name: zod_1.z.string(),
|
|
16
|
+
locLat: zod_1.z.string(),
|
|
17
|
+
locLong: zod_1.z.string(),
|
|
18
|
+
locTrigger: zod_1.z.enum(['on_enter', 'on_leave']),
|
|
19
|
+
radius: zod_1.z.number().int(),
|
|
20
|
+
}).passthrough();
|
|
21
|
+
exports.AbsoluteReminderSchema = ReminderBaseSchema.extend({
|
|
22
|
+
type: zod_1.z.literal('absolute'),
|
|
23
|
+
due: entities_1.DueDateSchema,
|
|
24
|
+
}).passthrough();
|
|
25
|
+
exports.RelativeReminderSchema = ReminderBaseSchema.extend({
|
|
26
|
+
type: zod_1.z.literal('relative'),
|
|
27
|
+
minuteOffset: zod_1.z.number().int(),
|
|
28
|
+
due: entities_1.DueDateSchema.optional(),
|
|
29
|
+
}).passthrough();
|
|
30
|
+
exports.ReminderSchema = zod_1.z.discriminatedUnion('type', [
|
|
31
|
+
exports.LocationReminderSchema,
|
|
32
|
+
exports.AbsoluteReminderSchema,
|
|
33
|
+
exports.RelativeReminderSchema,
|
|
34
|
+
]);
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SuggestionSchema = exports.WorkspaceTemplateSuggestionSchema = exports.TemplateSuggestionSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.TemplateSuggestionSchema = zod_1.z
|
|
6
|
+
.object({
|
|
7
|
+
id: zod_1.z.string(),
|
|
8
|
+
name: zod_1.z.string(),
|
|
9
|
+
templateType: zod_1.z.enum(['project', 'setup']),
|
|
10
|
+
})
|
|
11
|
+
.passthrough();
|
|
12
|
+
exports.WorkspaceTemplateSuggestionSchema = exports.TemplateSuggestionSchema.extend({
|
|
13
|
+
workspaceId: zod_1.z.string().nullable(),
|
|
14
|
+
});
|
|
15
|
+
const SyncTemplateSuggestionsSchema = zod_1.z
|
|
16
|
+
.object({
|
|
17
|
+
type: zod_1.z.enum(['templates', 'most_used_user_templates']),
|
|
18
|
+
content: zod_1.z.object({
|
|
19
|
+
templates: zod_1.z.array(exports.TemplateSuggestionSchema),
|
|
20
|
+
locale: zod_1.z.string(),
|
|
21
|
+
}),
|
|
22
|
+
isDeleted: zod_1.z.boolean(),
|
|
23
|
+
})
|
|
24
|
+
.passthrough();
|
|
25
|
+
const SyncWorkspaceTemplateSuggestionsSchema = zod_1.z
|
|
26
|
+
.object({
|
|
27
|
+
type: zod_1.z.literal('most_used_workspace_templates'),
|
|
28
|
+
content: zod_1.z.object({
|
|
29
|
+
templates: zod_1.z.array(exports.WorkspaceTemplateSuggestionSchema),
|
|
30
|
+
locale: zod_1.z.string(),
|
|
31
|
+
}),
|
|
32
|
+
isDeleted: zod_1.z.boolean(),
|
|
33
|
+
})
|
|
34
|
+
.passthrough();
|
|
35
|
+
exports.SuggestionSchema = zod_1.z.union([
|
|
36
|
+
SyncWorkspaceTemplateSuggestionsSchema,
|
|
37
|
+
SyncTemplateSuggestionsSchema,
|
|
38
|
+
]);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TooltipsSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.TooltipsSchema = zod_1.z
|
|
6
|
+
.object({
|
|
7
|
+
seen: zod_1.z.array(zod_1.z.string()).optional(),
|
|
8
|
+
scheduled: zod_1.z.array(zod_1.z.string()).optional(),
|
|
9
|
+
})
|
|
10
|
+
.passthrough();
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UserPlanLimitsSchema = exports.PlanLimitsSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.PlanLimitsSchema = zod_1.z
|
|
6
|
+
.object({
|
|
7
|
+
activeProjects: zod_1.z.number().int().optional(),
|
|
8
|
+
activityLog: zod_1.z.number().int().optional(),
|
|
9
|
+
collaboratorsPerProject: zod_1.z.number().int().optional(),
|
|
10
|
+
commentsPerTask: zod_1.z.number().int().optional(),
|
|
11
|
+
fileUploadsPerComment: zod_1.z.number().int().optional(),
|
|
12
|
+
filtersPerUser: zod_1.z.number().int().optional(),
|
|
13
|
+
labelsPerTask: zod_1.z.number().int().optional(),
|
|
14
|
+
remindersPerUser: zod_1.z.number().int().optional(),
|
|
15
|
+
sectionsPerProject: zod_1.z.number().int().optional(),
|
|
16
|
+
tasksPerProject: zod_1.z.number().int().optional(),
|
|
17
|
+
})
|
|
18
|
+
.passthrough();
|
|
19
|
+
exports.UserPlanLimitsSchema = zod_1.z
|
|
20
|
+
.object({
|
|
21
|
+
current: exports.PlanLimitsSchema,
|
|
22
|
+
next: exports.PlanLimitsSchema.nullable(),
|
|
23
|
+
})
|
|
24
|
+
.passthrough();
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UserSettingsSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const NavigationFeatureSchema = zod_1.z.object({
|
|
6
|
+
name: zod_1.z.string(),
|
|
7
|
+
shown: zod_1.z.boolean(),
|
|
8
|
+
});
|
|
9
|
+
const QuickAddFeatureSchema = zod_1.z.object({
|
|
10
|
+
name: zod_1.z.string(),
|
|
11
|
+
shown: zod_1.z.boolean(),
|
|
12
|
+
});
|
|
13
|
+
/**
|
|
14
|
+
* Sync API user settings resource.
|
|
15
|
+
*/
|
|
16
|
+
exports.UserSettingsSchema = zod_1.z
|
|
17
|
+
.object({
|
|
18
|
+
completedSoundDesktop: zod_1.z.boolean(),
|
|
19
|
+
completedSoundMobile: zod_1.z.boolean(),
|
|
20
|
+
debugLogSendingEnabledUntil: zod_1.z.string().nullable(),
|
|
21
|
+
legacyPricing: zod_1.z.boolean(),
|
|
22
|
+
navigation: zod_1.z
|
|
23
|
+
.object({
|
|
24
|
+
countsShown: zod_1.z.boolean(),
|
|
25
|
+
features: zod_1.z.array(NavigationFeatureSchema),
|
|
26
|
+
})
|
|
27
|
+
.passthrough(),
|
|
28
|
+
reminderDesktop: zod_1.z.boolean(),
|
|
29
|
+
reminderEmail: zod_1.z.boolean(),
|
|
30
|
+
reminderPush: zod_1.z.boolean(),
|
|
31
|
+
resetRecurringSubtasks: zod_1.z.boolean(),
|
|
32
|
+
aiEmailAssist: zod_1.z.boolean(),
|
|
33
|
+
theme: zod_1.z.string().nullable().optional(),
|
|
34
|
+
syncTheme: zod_1.z.boolean().optional(),
|
|
35
|
+
quickAdd: zod_1.z
|
|
36
|
+
.object({
|
|
37
|
+
labelsShown: zod_1.z.boolean(),
|
|
38
|
+
features: zod_1.z.array(QuickAddFeatureSchema),
|
|
39
|
+
})
|
|
40
|
+
.passthrough(),
|
|
41
|
+
})
|
|
42
|
+
.passthrough();
|