@doist/todoist-ai 8.8.7 → 8.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 +32 -21
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +37 -34
- package/dist/main-http.js +30 -25
- package/dist/main.js +1 -1
- package/dist/{mcp-server-B_Ow4xUS.js → mcp-server-BxCkcyeL.js} +1845 -1783
- package/dist/mcp-server.d.ts.map +1 -1
- package/dist/middleware/require-valid-todoist-token.d.ts +38 -0
- package/dist/middleware/require-valid-todoist-token.d.ts.map +1 -0
- package/dist/require-valid-todoist-token-BDvWaAk7.js +73 -0
- package/dist/tools/add-sections.d.ts +3 -3
- package/dist/tools/add-tasks.d.ts +9 -9
- package/dist/tools/add-tasks.d.ts.map +1 -1
- package/dist/tools/find-project-collaborators.d.ts +16 -6
- package/dist/tools/find-project-collaborators.d.ts.map +1 -1
- package/dist/tools/update-sections.d.ts +3 -3
- package/dist/utils/schema-helpers.d.ts +10 -0
- package/dist/utils/schema-helpers.d.ts.map +1 -0
- package/dist/utils/user-resolver.d.ts +2 -2
- package/dist/utils/user-resolver.d.ts.map +1 -1
- package/dist/utils/validate-todoist-token.d.ts +9 -0
- package/dist/utils/validate-todoist-token.d.ts.map +1 -0
- package/package.json +4 -4
package/dist/mcp-server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-server.d.ts","sourceRoot":"","sources":["../src/mcp-server.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAGnE,OAAO,EACH,aAAa,EACb,KAAK,OAAO,EACZ,KAAK,WAAW,EAChB,KAAK,QAAQ,EAEhB,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"mcp-server.d.ts","sourceRoot":"","sources":["../src/mcp-server.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAGnE,OAAO,EACH,aAAa,EACb,KAAK,OAAO,EACZ,KAAK,WAAW,EAChB,KAAK,QAAQ,EAEhB,MAAM,kBAAkB,CAAA;AAkJzB;;;;;;GAMG;AACH,iBAAS,YAAY,CAAC,EAClB,aAAa,EACb,OAAO,EACP,QAAa,GAChB,EAAE;IACC,aAAa,EAAE,MAAM,CAAA;IACrB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,QAAQ,CAAC,EAAE,QAAQ,CAAA;CACtB,aAuHA;AAED,OAAO,EAAE,aAAa,EAAE,KAAK,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,QAAQ,EAAE,YAAY,EAAE,CAAA"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Request, RequestHandler } from 'express';
|
|
2
|
+
type StaticTokenSource = {
|
|
3
|
+
type: 'static';
|
|
4
|
+
apiKey: string;
|
|
5
|
+
baseUrl?: string;
|
|
6
|
+
};
|
|
7
|
+
type DynamicTokenSource = {
|
|
8
|
+
type: 'dynamic';
|
|
9
|
+
getApiKey: (req: Request) => string | undefined;
|
|
10
|
+
baseUrl?: string;
|
|
11
|
+
};
|
|
12
|
+
type TokenSource = StaticTokenSource | DynamicTokenSource;
|
|
13
|
+
type RequireValidTodoistTokenOptions = TokenSource & {
|
|
14
|
+
/**
|
|
15
|
+
* Cache TTL in milliseconds. Defaults to 300_000 (5 minutes) for static,
|
|
16
|
+
* 120_000 (2 minutes) for dynamic.
|
|
17
|
+
*/
|
|
18
|
+
cacheTtlMs?: number;
|
|
19
|
+
/**
|
|
20
|
+
* URL for the Protected Resource Metadata document (RFC 9728).
|
|
21
|
+
* Included in the WWW-Authenticate header when returning 401.
|
|
22
|
+
* If omitted, the header is sent without resource_metadata.
|
|
23
|
+
*/
|
|
24
|
+
resourceMetadataUrl?: string;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Express middleware that validates the Todoist API token before MCP processing.
|
|
28
|
+
*
|
|
29
|
+
* Returns HTTP 401 with a spec-compliant WWW-Authenticate header if the token
|
|
30
|
+
* is invalid, allowing MCP clients to trigger OAuth token refresh.
|
|
31
|
+
*/
|
|
32
|
+
declare function requireValidTodoistToken(options: RequireValidTodoistTokenOptions): RequestHandler;
|
|
33
|
+
/**
|
|
34
|
+
* Clear the token validation cache. Useful for testing.
|
|
35
|
+
*/
|
|
36
|
+
declare function clearTokenValidationCache(): void;
|
|
37
|
+
export { clearTokenValidationCache, requireValidTodoistToken, type RequireValidTodoistTokenOptions };
|
|
38
|
+
//# sourceMappingURL=require-valid-todoist-token.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"require-valid-todoist-token.d.ts","sourceRoot":"","sources":["../../src/middleware/require-valid-todoist-token.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAgB,OAAO,EAAE,cAAc,EAAY,MAAM,SAAS,CAAA;AAI9E,KAAK,iBAAiB,GAAG;IACrB,IAAI,EAAE,QAAQ,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,KAAK,kBAAkB,GAAG;IACtB,IAAI,EAAE,SAAS,CAAA;IACf,SAAS,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,MAAM,GAAG,SAAS,CAAA;IAC/C,OAAO,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,KAAK,WAAW,GAAG,iBAAiB,GAAG,kBAAkB,CAAA;AAEzD,KAAK,+BAA+B,GAAG,WAAW,GAAG;IACjD;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IAEnB;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAA;CAC/B,CAAA;AA8DD;;;;;GAKG;AACH,iBAAS,wBAAwB,CAAC,OAAO,EAAE,+BAA+B,GAAG,cAAc,CAwC1F;AAED;;GAEG;AACH,iBAAS,yBAAyB,IAAI,IAAI,CAEzC;AAED,OAAO,EAAE,yBAAyB,EAAE,wBAAwB,EAAE,KAAK,+BAA+B,EAAE,CAAA"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { TodoistApi as h } from "@doist/todoist-sdk";
|
|
2
|
+
import { O as T } from "./mcp-server-BxCkcyeL.js";
|
|
3
|
+
const p = /* @__PURE__ */ new Set([401, 403]);
|
|
4
|
+
function w(e) {
|
|
5
|
+
const t = T(e);
|
|
6
|
+
if (t !== void 0)
|
|
7
|
+
return t;
|
|
8
|
+
if (e !== null && typeof e == "object" && "response" in e)
|
|
9
|
+
return T(e.response);
|
|
10
|
+
}
|
|
11
|
+
async function y(e, t) {
|
|
12
|
+
const r = new h(e, { baseUrl: t });
|
|
13
|
+
try {
|
|
14
|
+
return await r.getUser(), !0;
|
|
15
|
+
} catch (i) {
|
|
16
|
+
const o = w(i);
|
|
17
|
+
if (o !== void 0 && p.has(o))
|
|
18
|
+
return !1;
|
|
19
|
+
throw i;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
const _ = 3e5, v = 12e4, A = 1e4, n = /* @__PURE__ */ new Map();
|
|
23
|
+
function C(e, t) {
|
|
24
|
+
return t ? `${e}::${t}` : e;
|
|
25
|
+
}
|
|
26
|
+
function E() {
|
|
27
|
+
const e = Date.now();
|
|
28
|
+
for (const [t, r] of n)
|
|
29
|
+
e >= r.expiresAt && n.delete(t);
|
|
30
|
+
}
|
|
31
|
+
function S(e) {
|
|
32
|
+
const t = n.get(e);
|
|
33
|
+
if (t && Date.now() < t.expiresAt)
|
|
34
|
+
return t.valid;
|
|
35
|
+
t && n.delete(e);
|
|
36
|
+
}
|
|
37
|
+
function k(e, t, r) {
|
|
38
|
+
n.size >= A && E(), n.size >= A && n.clear(), n.set(e, { valid: t, expiresAt: Date.now() + r });
|
|
39
|
+
}
|
|
40
|
+
function D(e) {
|
|
41
|
+
return e ? `Bearer resource_metadata="${e}"` : "Bearer";
|
|
42
|
+
}
|
|
43
|
+
function d(e, t) {
|
|
44
|
+
e.status(401).set("WWW-Authenticate", D(t)).json({
|
|
45
|
+
error: "invalid_token",
|
|
46
|
+
error_description: "Todoist API token is invalid or expired"
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
function x(e) {
|
|
50
|
+
const t = e.type === "static" ? _ : v, r = e.cacheTtlMs ?? t, { resourceMetadataUrl: i } = e;
|
|
51
|
+
return async (o, c, s) => {
|
|
52
|
+
const u = e.type === "static" ? e.apiKey : e.getApiKey(o);
|
|
53
|
+
if (!u) {
|
|
54
|
+
d(c, i);
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
const f = C(u, e.baseUrl), l = S(f);
|
|
58
|
+
if (l !== void 0) {
|
|
59
|
+
l ? s() : d(c, i);
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
try {
|
|
63
|
+
const a = await y(u, e.baseUrl);
|
|
64
|
+
k(f, a, r), a ? s() : d(c, i);
|
|
65
|
+
} catch (a) {
|
|
66
|
+
console.warn("[Token validation] Transient error, proceeding:", a), s();
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
export {
|
|
71
|
+
x as r,
|
|
72
|
+
y as v
|
|
73
|
+
};
|
|
@@ -33,9 +33,9 @@ declare const addSections: {
|
|
|
33
33
|
id: string;
|
|
34
34
|
userId: string;
|
|
35
35
|
projectId: string;
|
|
36
|
-
addedAt:
|
|
37
|
-
updatedAt:
|
|
38
|
-
archivedAt:
|
|
36
|
+
addedAt: Date;
|
|
37
|
+
updatedAt: Date;
|
|
38
|
+
archivedAt: Date | null;
|
|
39
39
|
name: string;
|
|
40
40
|
sectionOrder: number;
|
|
41
41
|
isArchived: boolean;
|
|
@@ -7,22 +7,22 @@ declare const addTasks: {
|
|
|
7
7
|
parameters: {
|
|
8
8
|
tasks: z.ZodArray<z.ZodObject<{
|
|
9
9
|
content: z.ZodString;
|
|
10
|
-
description: z.ZodOptional<z.ZodString
|
|
10
|
+
description: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string | undefined, string>>>;
|
|
11
11
|
priority: z.ZodOptional<z.ZodEnum<{
|
|
12
12
|
p1: "p1";
|
|
13
13
|
p2: "p2";
|
|
14
14
|
p3: "p3";
|
|
15
15
|
p4: "p4";
|
|
16
16
|
}>>;
|
|
17
|
-
dueString: z.ZodOptional<z.ZodString
|
|
18
|
-
deadlineDate: z.ZodOptional<z.ZodString
|
|
19
|
-
duration: z.ZodOptional<z.ZodString
|
|
17
|
+
dueString: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string | undefined, string>>>;
|
|
18
|
+
deadlineDate: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string | undefined, string>>>;
|
|
19
|
+
duration: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string | undefined, string>>>;
|
|
20
20
|
labels: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
21
|
-
projectId: z.ZodOptional<z.ZodString
|
|
22
|
-
sectionId: z.ZodOptional<z.ZodString
|
|
23
|
-
parentId: z.ZodOptional<z.ZodString
|
|
21
|
+
projectId: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string | undefined, string>>>;
|
|
22
|
+
sectionId: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string | undefined, string>>>;
|
|
23
|
+
parentId: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string | undefined, string>>>;
|
|
24
24
|
order: z.ZodOptional<z.ZodNumber>;
|
|
25
|
-
responsibleUser: z.ZodOptional<z.ZodString
|
|
25
|
+
responsibleUser: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string | undefined, string>>>;
|
|
26
26
|
isUncompletable: z.ZodOptional<z.ZodBoolean>;
|
|
27
27
|
}, z.core.$strip>>;
|
|
28
28
|
};
|
|
@@ -66,7 +66,7 @@ declare const addTasks: {
|
|
|
66
66
|
destructiveHint: false;
|
|
67
67
|
idempotentHint: false;
|
|
68
68
|
};
|
|
69
|
-
execute(
|
|
69
|
+
execute(args: {
|
|
70
70
|
tasks: {
|
|
71
71
|
content: string;
|
|
72
72
|
description?: string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-tasks.d.ts","sourceRoot":"","sources":["../../src/tools/add-tasks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAqB,UAAU,EAAE,MAAM,oBAAoB,CAAA;AACvE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;
|
|
1
|
+
{"version":3,"file":"add-tasks.d.ts","sourceRoot":"","sources":["../../src/tools/add-tasks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAqB,UAAU,EAAE,MAAM,oBAAoB,CAAA;AACvE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAgBvB,QAAA,MAAM,uBAAuB,KAAK,CAAA;AA0DlC,QAAA,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAgDwB,MAAM;uBAAS,MAAM;;;;;;;CA0CI,CAAA;AAwK/D,OAAO,EAAE,QAAQ,EAAE,uBAAuB,EAAE,CAAA"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import { TodoistApi } from '@doist/todoist-sdk';
|
|
1
2
|
import { z } from 'zod';
|
|
2
3
|
import { ProjectCollaborator } from '../utils/user-resolver.js';
|
|
3
4
|
declare const findProjectCollaborators: {
|
|
4
5
|
name: "find-project-collaborators";
|
|
5
6
|
description: string;
|
|
6
7
|
parameters: {
|
|
7
|
-
projectId: z.ZodString
|
|
8
|
+
projectId: z.ZodOptional<z.ZodString>;
|
|
8
9
|
searchTerm: z.ZodOptional<z.ZodString>;
|
|
9
10
|
};
|
|
10
11
|
outputSchema: {
|
|
@@ -28,9 +29,18 @@ declare const findProjectCollaborators: {
|
|
|
28
29
|
idempotentHint: true;
|
|
29
30
|
};
|
|
30
31
|
execute(args: {
|
|
31
|
-
projectId
|
|
32
|
+
projectId?: string | undefined;
|
|
32
33
|
searchTerm?: string | undefined;
|
|
33
|
-
}, client:
|
|
34
|
+
}, client: TodoistApi): Promise<{
|
|
35
|
+
textContent: string;
|
|
36
|
+
structuredContent: {
|
|
37
|
+
collaborators: ProjectCollaborator[];
|
|
38
|
+
projectInfo: undefined;
|
|
39
|
+
totalCount: number;
|
|
40
|
+
totalAvailable: number;
|
|
41
|
+
appliedFilters: Record<string, unknown>;
|
|
42
|
+
};
|
|
43
|
+
} | {
|
|
34
44
|
textContent: string;
|
|
35
45
|
structuredContent: {
|
|
36
46
|
collaborators: never[];
|
|
@@ -41,7 +51,7 @@ declare const findProjectCollaborators: {
|
|
|
41
51
|
};
|
|
42
52
|
totalCount: number;
|
|
43
53
|
appliedFilters: {
|
|
44
|
-
projectId
|
|
54
|
+
projectId?: string | undefined;
|
|
45
55
|
searchTerm?: string | undefined;
|
|
46
56
|
};
|
|
47
57
|
totalAvailable?: undefined;
|
|
@@ -57,7 +67,7 @@ declare const findProjectCollaborators: {
|
|
|
57
67
|
};
|
|
58
68
|
totalCount: number;
|
|
59
69
|
appliedFilters: {
|
|
60
|
-
projectId
|
|
70
|
+
projectId?: string | undefined;
|
|
61
71
|
searchTerm?: string | undefined;
|
|
62
72
|
};
|
|
63
73
|
totalAvailable?: undefined;
|
|
@@ -74,7 +84,7 @@ declare const findProjectCollaborators: {
|
|
|
74
84
|
totalCount: number;
|
|
75
85
|
totalAvailable: number;
|
|
76
86
|
appliedFilters: {
|
|
77
|
-
projectId
|
|
87
|
+
projectId?: string | undefined;
|
|
78
88
|
searchTerm?: string | undefined;
|
|
79
89
|
};
|
|
80
90
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"find-project-collaborators.d.ts","sourceRoot":"","sources":["../../src/tools/find-project-collaborators.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAMvB,OAAO,EAAE,KAAK,mBAAmB,EAAgB,MAAM,2BAA2B,CAAA;
|
|
1
|
+
{"version":3,"file":"find-project-collaborators.d.ts","sourceRoot":"","sources":["../../src/tools/find-project-collaborators.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAMvB,OAAO,EAAE,KAAK,mBAAmB,EAAgB,MAAM,2BAA2B,CAAA;AAwClF,QAAA,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6FiC,CAAA;AA2J/D,OAAO,EAAE,wBAAwB,EAAE,CAAA"}
|
|
@@ -34,9 +34,9 @@ declare const updateSections: {
|
|
|
34
34
|
id: string;
|
|
35
35
|
userId: string;
|
|
36
36
|
projectId: string;
|
|
37
|
-
addedAt:
|
|
38
|
-
updatedAt:
|
|
39
|
-
archivedAt:
|
|
37
|
+
addedAt: Date;
|
|
38
|
+
updatedAt: Date;
|
|
39
|
+
archivedAt: Date | null;
|
|
40
40
|
name: string;
|
|
41
41
|
sectionOrder: number;
|
|
42
42
|
isArchived: boolean;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* An optional string schema that converts empty strings to `undefined`.
|
|
4
|
+
* LLMs often send `""` for optional fields instead of omitting them,
|
|
5
|
+
* which causes the Todoist API to reject the request.
|
|
6
|
+
*
|
|
7
|
+
* `.optional()` must be outermost so the field stays optional in `z.infer` output types.
|
|
8
|
+
*/
|
|
9
|
+
export declare function optionalString(description: string): z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string | undefined, string>>>;
|
|
10
|
+
//# sourceMappingURL=schema-helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-helpers.d.ts","sourceRoot":"","sources":["../../src/utils/schema-helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,WAAW,EAAE,MAAM,qFAMjD"}
|
|
@@ -26,9 +26,9 @@ export declare class UserResolver {
|
|
|
26
26
|
*/
|
|
27
27
|
getProjectCollaborators(client: TodoistApi, projectId: string): Promise<ProjectCollaborator[]>;
|
|
28
28
|
/**
|
|
29
|
-
* Get all collaborators from all shared projects
|
|
29
|
+
* Get all collaborators from all shared projects, deduplicated by user ID.
|
|
30
30
|
*/
|
|
31
|
-
|
|
31
|
+
getAllCollaborators(client: TodoistApi): Promise<ProjectCollaborator[]>;
|
|
32
32
|
/**
|
|
33
33
|
* Clear all caches - useful for testing
|
|
34
34
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user-resolver.d.ts","sourceRoot":"","sources":["../../src/utils/user-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"user-resolver.d.ts","sourceRoot":"","sources":["../../src/utils/user-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAmB,UAAU,EAAoB,MAAM,oBAAoB,CAAA;AAGvF,MAAM,MAAM,YAAY,GAAG;IACvB,MAAM,EAAE,MAAM,CAAA;IACd,WAAW,EAAE,MAAM,CAAA;IACnB,KAAK,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,MAAM,MAAM,mBAAmB,GAAG;IAC9B,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;CAChB,CAAA;AAsBD,+DAA+D;AAC/D,eAAO,MAAM,iBAAiB,EAAG,IAAa,CAAA;AAE9C,qBAAa,YAAY;IACrB;;;OAGG;IACG,WAAW,CAAC,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC;IA+HrF;;OAEG;IACG,2BAA2B,CAC7B,MAAM,EAAE,UAAU,EAClB,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,GACf,OAAO,CAAC,OAAO,CAAC;IASnB;;OAEG;IACG,uBAAuB,CACzB,MAAM,EAAE,UAAU,EAClB,SAAS,EAAE,MAAM,GAClB,OAAO,CAAC,mBAAmB,EAAE,CAAC;IA2BjC;;OAEG;IACG,mBAAmB,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,mBAAmB,EAAE,CAAC;IA0D7E;;OAEG;IACH,UAAU,IAAI,IAAI;CAIrB;AAGD,eAAO,MAAM,YAAY,cAAqB,CAAA;AAG9C,wBAAsB,mBAAmB,CACrC,MAAM,EAAE,UAAU,EAClB,QAAQ,EAAE,MAAM,GACjB,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CAE9B"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validates a Todoist API token by making a lightweight API call.
|
|
3
|
+
*
|
|
4
|
+
* @returns `true` if the token is valid, `false` if it's an auth error (401/403).
|
|
5
|
+
* @throws On transient errors (network failures, 5xx) so the caller can decide.
|
|
6
|
+
*/
|
|
7
|
+
declare function validateTodoistToken(apiKey: string, baseUrl?: string): Promise<boolean>;
|
|
8
|
+
export { validateTodoistToken };
|
|
9
|
+
//# sourceMappingURL=validate-todoist-token.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate-todoist-token.d.ts","sourceRoot":"","sources":["../../src/utils/validate-todoist-token.ts"],"names":[],"mappings":"AAwBA;;;;;GAKG;AACH,iBAAe,oBAAoB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAYtF;AAED,OAAO,EAAE,oBAAoB,EAAE,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@doist/todoist-ai",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.9.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"prepare": "husky"
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
|
-
"@doist/todoist-sdk": "
|
|
62
|
+
"@doist/todoist-sdk": "9.0.0",
|
|
63
63
|
"@modelcontextprotocol/ext-apps": "1.2.2",
|
|
64
64
|
"date-fns": "4.1.0",
|
|
65
65
|
"dompurify": "3.3.3",
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"@types/dompurify": "3.2.0",
|
|
78
78
|
"@types/express": "5.0.6",
|
|
79
79
|
"@types/morgan": "1.9.10",
|
|
80
|
-
"@types/node": "22.19.
|
|
80
|
+
"@types/node": "22.19.17",
|
|
81
81
|
"@types/react": "19.2.14",
|
|
82
82
|
"@types/react-dom": "19.2.3",
|
|
83
83
|
"@vitejs/plugin-react": "5.2.0",
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
"snarkdown": "2.0.0",
|
|
97
97
|
"tsx": "4.21.0",
|
|
98
98
|
"typescript": "6.0.2",
|
|
99
|
-
"vite": "7.3.
|
|
99
|
+
"vite": "7.3.2",
|
|
100
100
|
"vite-plugin-dts": "4.5.4",
|
|
101
101
|
"vite-plugin-singlefile": "2.3.2",
|
|
102
102
|
"vitest": "4.1.1"
|