@doist/todoist-ai 4.8.0 → 4.9.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/index.d.ts
CHANGED
|
@@ -468,14 +468,17 @@ declare const tools: {
|
|
|
468
468
|
parameters: {
|
|
469
469
|
projects: import("zod").ZodArray<import("zod").ZodObject<{
|
|
470
470
|
name: import("zod").ZodString;
|
|
471
|
+
parentId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
471
472
|
isFavorite: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
472
473
|
viewStyle: import("zod").ZodOptional<import("zod").ZodEnum<["list", "board", "calendar"]>>;
|
|
473
474
|
}, "strip", import("zod").ZodTypeAny, {
|
|
474
475
|
name: string;
|
|
476
|
+
parentId?: string | undefined;
|
|
475
477
|
isFavorite?: boolean | undefined;
|
|
476
478
|
viewStyle?: "list" | "board" | "calendar" | undefined;
|
|
477
479
|
}, {
|
|
478
480
|
name: string;
|
|
481
|
+
parentId?: string | undefined;
|
|
479
482
|
isFavorite?: boolean | undefined;
|
|
480
483
|
viewStyle?: "list" | "board" | "calendar" | undefined;
|
|
481
484
|
}>, "many">;
|
|
@@ -483,6 +486,7 @@ declare const tools: {
|
|
|
483
486
|
execute({ projects }: {
|
|
484
487
|
projects: {
|
|
485
488
|
name: string;
|
|
489
|
+
parentId?: string | undefined;
|
|
486
490
|
isFavorite?: boolean | undefined;
|
|
487
491
|
viewStyle?: "list" | "board" | "calendar" | undefined;
|
|
488
492
|
}[];
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAE9C,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAErD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAErD,O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AAC;mCAAgD,CAAC;6BAA2D,CAAC;kCAA+C,CAAC;mCAAgD,CAAC;2BAAwC,CAAC;6BAA0C,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAhCv8Y,CAAA;AAED,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,CAAA;AAE9B,OAAO,EAEH,QAAQ,EACR,aAAa,EACb,WAAW,EACX,SAAS,EACT,eAAe,EACf,kBAAkB,EAElB,WAAW,EACX,cAAc,EACd,YAAY,EAEZ,WAAW,EACX,cAAc,EACd,YAAY,EAEZ,WAAW,EACX,cAAc,EACd,YAAY,EAEZ,WAAW,EACX,YAAY,EACZ,QAAQ,EAER,wBAAwB,EACxB,iBAAiB,GACpB,CAAA"}
|
|
@@ -90,6 +90,24 @@ describe(`${ADD_PROJECTS} tool`, () => {
|
|
|
90
90
|
expect(textContent).toContain('Board Project');
|
|
91
91
|
expect(textContent).toContain('id=project-789');
|
|
92
92
|
});
|
|
93
|
+
it('should create project with parentId to create a sub-project', async () => {
|
|
94
|
+
const mockApiResponse = createMockProject({
|
|
95
|
+
id: 'project-child',
|
|
96
|
+
name: 'Child Project',
|
|
97
|
+
parentId: 'project-parent',
|
|
98
|
+
});
|
|
99
|
+
mockTodoistApi.addProject.mockResolvedValue(mockApiResponse);
|
|
100
|
+
const result = await addProjects.execute({ projects: [{ name: 'Child Project', parentId: 'project-parent' }] }, mockTodoistApi);
|
|
101
|
+
expect(mockTodoistApi.addProject).toHaveBeenCalledWith({
|
|
102
|
+
name: 'Child Project',
|
|
103
|
+
parentId: 'project-parent',
|
|
104
|
+
});
|
|
105
|
+
const textContent = extractTextContent(result);
|
|
106
|
+
expect(textContent).toMatchSnapshot();
|
|
107
|
+
expect(textContent).toContain('Added 1 project:');
|
|
108
|
+
expect(textContent).toContain('Child Project');
|
|
109
|
+
expect(textContent).toContain('id=project-child');
|
|
110
|
+
});
|
|
93
111
|
});
|
|
94
112
|
describe('creating multiple projects', () => {
|
|
95
113
|
it('should create multiple projects and return mapped results', async () => {
|
|
@@ -5,14 +5,17 @@ declare const addProjects: {
|
|
|
5
5
|
parameters: {
|
|
6
6
|
projects: z.ZodArray<z.ZodObject<{
|
|
7
7
|
name: z.ZodString;
|
|
8
|
+
parentId: z.ZodOptional<z.ZodString>;
|
|
8
9
|
isFavorite: z.ZodOptional<z.ZodBoolean>;
|
|
9
10
|
viewStyle: z.ZodOptional<z.ZodEnum<["list", "board", "calendar"]>>;
|
|
10
11
|
}, "strip", z.ZodTypeAny, {
|
|
11
12
|
name: string;
|
|
13
|
+
parentId?: string | undefined;
|
|
12
14
|
isFavorite?: boolean | undefined;
|
|
13
15
|
viewStyle?: "list" | "board" | "calendar" | undefined;
|
|
14
16
|
}, {
|
|
15
17
|
name: string;
|
|
18
|
+
parentId?: string | undefined;
|
|
16
19
|
isFavorite?: boolean | undefined;
|
|
17
20
|
viewStyle?: "list" | "board" | "calendar" | undefined;
|
|
18
21
|
}>, "many">;
|
|
@@ -20,6 +23,7 @@ declare const addProjects: {
|
|
|
20
23
|
execute({ projects }: {
|
|
21
24
|
projects: {
|
|
22
25
|
name: string;
|
|
26
|
+
parentId?: string | undefined;
|
|
23
27
|
isFavorite?: boolean | undefined;
|
|
24
28
|
viewStyle?: "list" | "board" | "calendar" | undefined;
|
|
25
29
|
}[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-projects.d.ts","sourceRoot":"","sources":["../../src/tools/add-projects.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;
|
|
1
|
+
{"version":3,"file":"add-projects.d.ts","sourceRoot":"","sources":["../../src/tools/add-projects.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AA4BvB,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgByB,CAAA;AA+B1C,OAAO,EAAE,WAAW,EAAE,CAAA"}
|
|
@@ -5,6 +5,10 @@ import { ToolNames } from '../utils/tool-names.js';
|
|
|
5
5
|
const { ADD_SECTIONS, ADD_TASKS, FIND_PROJECTS, GET_OVERVIEW } = ToolNames;
|
|
6
6
|
const ProjectSchema = z.object({
|
|
7
7
|
name: z.string().min(1).describe('The name of the project.'),
|
|
8
|
+
parentId: z
|
|
9
|
+
.string()
|
|
10
|
+
.optional()
|
|
11
|
+
.describe('The ID of the parent project. If provided, creates this as a sub-project.'),
|
|
8
12
|
isFavorite: z
|
|
9
13
|
.boolean()
|
|
10
14
|
.optional()
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@doist/todoist-ai",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.9.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"concurrently": "^9.0.0",
|
|
61
61
|
"express": "^5.0.0",
|
|
62
62
|
"husky": "^9.1.7",
|
|
63
|
-
"jest": "30.
|
|
63
|
+
"jest": "30.2.0",
|
|
64
64
|
"lint-staged": "^16.0.0",
|
|
65
65
|
"morgan": "^1.10.0",
|
|
66
66
|
"nodemon": "^3.1.10",
|