backlog-mcp-server 0.16.0 → 0.18.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.ja.md +15 -32
- package/README.md +20 -32
- package/build/auth/oauthRoutes.js +53 -1
- package/build/createBacklogMcpServer.d.ts +4 -6
- package/build/createBacklogMcpServer.js +4 -12
- package/build/handlers/builders/composeToolHandler.d.ts +1 -1
- package/build/handlers/builders/composeToolHandler.js +15 -9
- package/build/handlers/transformers/wrapWithFieldPicking.d.ts +14 -1
- package/build/handlers/transformers/wrapWithFieldPicking.js +30 -36
- package/build/index.js +30 -16
- package/build/lib.d.ts +1 -1
- package/build/loadDescriptionOverrides.d.ts +0 -13
- package/build/loadDescriptionOverrides.js +73 -11
- package/build/reportUnknownOverrideKeys.d.ts +22 -0
- package/build/reportUnknownOverrideKeys.js +42 -0
- package/build/tools/addDocument.d.ts +2 -2
- package/build/tools/addDocument.js +17 -2
- package/build/tools/addIssue.d.ts +2 -2
- package/build/tools/addIssue.js +32 -2
- package/build/tools/addIssueComment.d.ts +2 -2
- package/build/tools/addIssueComment.js +14 -2
- package/build/tools/addProject.d.ts +2 -2
- package/build/tools/addProject.js +22 -2
- package/build/tools/addPullRequest.d.ts +2 -2
- package/build/tools/addPullRequest.js +26 -2
- package/build/tools/addPullRequestComment.d.ts +2 -2
- package/build/tools/addPullRequestComment.js +12 -2
- package/build/tools/addRelatedIssue.d.ts +2 -2
- package/build/tools/addRelatedIssue.js +33 -2
- package/build/tools/addVersionMilestone.d.ts +2 -2
- package/build/tools/addVersionMilestone.js +12 -2
- package/build/tools/addWatching.d.ts +2 -2
- package/build/tools/addWatching.js +12 -2
- package/build/tools/addWiki.d.ts +2 -2
- package/build/tools/addWiki.js +16 -2
- package/build/tools/countIssues.d.ts +2 -2
- package/build/tools/countIssues.js +3 -2
- package/build/tools/deleteIssue.d.ts +2 -2
- package/build/tools/deleteIssue.js +32 -2
- package/build/tools/deleteProject.d.ts +2 -2
- package/build/tools/deleteProject.js +22 -2
- package/build/tools/deleteVersion.d.ts +2 -2
- package/build/tools/deleteVersion.js +12 -2
- package/build/tools/deleteWatching.d.ts +2 -2
- package/build/tools/deleteWatching.js +12 -2
- package/build/tools/getCategories.d.ts +2 -2
- package/build/tools/getCategories.js +8 -2
- package/build/tools/getCustomFields.d.ts +2 -2
- package/build/tools/getCustomFields.js +22 -2
- package/build/tools/getDocument.d.ts +2 -2
- package/build/tools/getDocument.js +17 -2
- package/build/tools/getDocumentTree.d.ts +2 -2
- package/build/tools/getDocumentTree.js +7 -2
- package/build/tools/getDocuments.d.ts +2 -2
- package/build/tools/getDocuments.js +17 -2
- package/build/tools/getGitRepositories.d.ts +2 -2
- package/build/tools/getGitRepositories.js +17 -2
- package/build/tools/getGitRepository.d.ts +2 -2
- package/build/tools/getGitRepository.js +17 -2
- package/build/tools/getIssue.d.ts +2 -2
- package/build/tools/getIssue.js +32 -2
- package/build/tools/getIssueComments.d.ts +2 -2
- package/build/tools/getIssueComments.js +14 -2
- package/build/tools/getIssueTypes.d.ts +2 -2
- package/build/tools/getIssueTypes.js +11 -2
- package/build/tools/getIssues.d.ts +10 -10
- package/build/tools/getIssues.js +32 -2
- package/build/tools/getMyself.d.ts +2 -2
- package/build/tools/getMyself.js +11 -2
- package/build/tools/getNotifications.d.ts +2 -2
- package/build/tools/getNotifications.js +15 -2
- package/build/tools/getNotificationsCount.d.ts +2 -2
- package/build/tools/getNotificationsCount.js +5 -2
- package/build/tools/getPriorities.d.ts +2 -2
- package/build/tools/getPriorities.js +3 -2
- package/build/tools/getProject.d.ts +2 -2
- package/build/tools/getProject.js +22 -2
- package/build/tools/getProjectList.d.ts +2 -2
- package/build/tools/getProjectList.js +22 -2
- package/build/tools/getProjectUsers.d.ts +2 -2
- package/build/tools/getProjectUsers.js +11 -2
- package/build/tools/getPullRequest.d.ts +2 -2
- package/build/tools/getPullRequest.js +26 -2
- package/build/tools/getPullRequestComments.d.ts +2 -2
- package/build/tools/getPullRequestComments.js +12 -2
- package/build/tools/getPullRequests.d.ts +2 -2
- package/build/tools/getPullRequests.js +26 -2
- package/build/tools/getPullRequestsCount.d.ts +2 -2
- package/build/tools/getPullRequestsCount.js +5 -2
- package/build/tools/getRelatedIssues.d.ts +2 -2
- package/build/tools/getRelatedIssues.js +33 -2
- package/build/tools/getResolutions.d.ts +2 -2
- package/build/tools/getResolutions.js +3 -2
- package/build/tools/getSpace.d.ts +2 -2
- package/build/tools/getSpace.js +13 -2
- package/build/tools/getSpaceActivities.d.ts +2 -2
- package/build/tools/getSpaceActivities.js +12 -2
- package/build/tools/getUserRecentUpdates.d.ts +2 -2
- package/build/tools/getUserRecentUpdates.js +12 -2
- package/build/tools/getUserStarsCount.d.ts +2 -2
- package/build/tools/getUserStarsCount.js +3 -2
- package/build/tools/getUsers.d.ts +2 -2
- package/build/tools/getUsers.js +11 -2
- package/build/tools/getVersionMilestoneList.d.ts +2 -2
- package/build/tools/getVersionMilestoneList.js +12 -2
- package/build/tools/getWatchingListCount.d.ts +2 -2
- package/build/tools/getWatchingListCount.js +5 -2
- package/build/tools/getWatchingListItems.d.ts +2 -2
- package/build/tools/getWatchingListItems.js +12 -2
- package/build/tools/getWiki.d.ts +2 -2
- package/build/tools/getWiki.js +16 -2
- package/build/tools/getWikiPages.d.ts +2 -2
- package/build/tools/getWikiPages.js +12 -2
- package/build/tools/getWikisCount.d.ts +2 -2
- package/build/tools/getWikisCount.js +3 -2
- package/build/tools/markNotificationAsRead.d.ts +6 -1
- package/build/tools/markNotificationAsRead.js +6 -1
- package/build/tools/markWatchingAsRead.d.ts +6 -1
- package/build/tools/markWatchingAsRead.js +6 -1
- package/build/tools/removeRelatedIssue.d.ts +2 -2
- package/build/tools/removeRelatedIssue.js +33 -2
- package/build/tools/resetUnreadNotificationCount.d.ts +2 -2
- package/build/tools/resetUnreadNotificationCount.js +5 -2
- package/build/tools/updateIssue.d.ts +2 -2
- package/build/tools/updateIssue.js +32 -2
- package/build/tools/updateIssueComment.d.ts +2 -2
- package/build/tools/updateIssueComment.js +14 -2
- package/build/tools/updateProject.d.ts +2 -2
- package/build/tools/updateProject.js +22 -2
- package/build/tools/updatePullRequest.d.ts +2 -2
- package/build/tools/updatePullRequest.js +26 -2
- package/build/tools/updatePullRequestComment.d.ts +2 -2
- package/build/tools/updatePullRequestComment.js +12 -2
- package/build/tools/updateVersionMilestone.d.ts +2 -2
- package/build/tools/updateVersionMilestone.js +12 -2
- package/build/tools/updateWatching.d.ts +2 -2
- package/build/tools/updateWatching.js +12 -2
- package/build/tools/updateWiki.d.ts +2 -2
- package/build/tools/updateWiki.js +16 -2
- package/build/types/outputFields.d.ts +26 -0
- package/build/types/outputFields.js +3 -0
- package/build/types/tool.d.ts +21 -8
- package/build/types/zod/activityType.d.ts +38 -0
- package/build/types/zod/activityType.js +38 -0
- package/build/utils/fieldSelection.d.ts +22 -0
- package/build/utils/fieldSelection.js +40 -0
- package/build/utils/toolsetUtils.d.ts +1 -3
- package/build/utils/toolsetUtils.js +0 -12
- package/package.json +4 -4
- package/build/tools/dynamicTools/toolsets.d.ts +0 -15
- package/build/tools/dynamicTools/toolsets.js +0 -103
- package/build/types/zod/backlogOutputDefinition.d.ts +0 -3334
- package/build/types/zod/backlogOutputDefinition.js +0 -483
- package/build/utils/generateFieldsDescription.d.ts +0 -5
- package/build/utils/generateFieldsDescription.js +0 -50
- package/build/utils/toolRegistrar.d.ts +0 -5
- package/build/utils/toolRegistrar.js +0 -12
package/build/tools/addWiki.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import type { Entity } from 'backlog-js';
|
|
2
3
|
import { Backlog } from 'backlog-js';
|
|
3
4
|
import { ToolDefinition } from '../types/tool.js';
|
|
4
5
|
import { DescriptionHelper } from '../createDescriptionHelper.js';
|
|
5
|
-
import { WikiSchema } from '../types/zod/backlogOutputDefinition.js';
|
|
6
6
|
declare const addWikiSchema: (t: DescriptionHelper["t"]) => {
|
|
7
7
|
projectId: z.ZodNumber;
|
|
8
8
|
name: z.ZodString;
|
|
9
9
|
content: z.ZodString;
|
|
10
10
|
mailNotify: z.ZodOptional<z.ZodBoolean>;
|
|
11
11
|
};
|
|
12
|
-
export declare const addWikiTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof addWikiSchema>,
|
|
12
|
+
export declare const addWikiTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof addWikiSchema>, Entity.Wiki.Wiki>;
|
|
13
13
|
export {};
|
package/build/tools/addWiki.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { buildToolSchema } from '../types/tool.js';
|
|
3
|
-
import {
|
|
3
|
+
import { outputFields } from '../types/outputFields.js';
|
|
4
4
|
const addWikiSchema = buildToolSchema((t) => ({
|
|
5
5
|
projectId: z.number().describe(t('TOOL_ADD_WIKI_PROJECT_ID', 'Project ID')),
|
|
6
6
|
name: z.string().describe(t('TOOL_ADD_WIKI_NAME', 'Name of the wiki page')),
|
|
@@ -17,7 +17,21 @@ export const addWikiTool = (backlog, { t }) => {
|
|
|
17
17
|
name: 'add_wiki',
|
|
18
18
|
description: t('TOOL_ADD_WIKI_DESCRIPTION', 'Creates a new wiki page'),
|
|
19
19
|
schema: z.object(addWikiSchema(t)),
|
|
20
|
-
|
|
20
|
+
returnsList: false,
|
|
21
|
+
outputFields: outputFields()([
|
|
22
|
+
'id',
|
|
23
|
+
'projectId',
|
|
24
|
+
'name',
|
|
25
|
+
'content',
|
|
26
|
+
'tags',
|
|
27
|
+
'attachments',
|
|
28
|
+
'sharedFiles',
|
|
29
|
+
'stars',
|
|
30
|
+
'createdUser',
|
|
31
|
+
'created',
|
|
32
|
+
'updatedUser',
|
|
33
|
+
'updated',
|
|
34
|
+
]),
|
|
21
35
|
importantFields: ['id', 'name', 'content', 'createdUser'],
|
|
22
36
|
handler: async ({ projectId, name, content, mailNotify }) => backlog.postWiki({
|
|
23
37
|
projectId,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import type { Entity } from 'backlog-js';
|
|
2
3
|
import { Backlog } from 'backlog-js';
|
|
3
4
|
import { ToolDefinition } from '../types/tool.js';
|
|
4
5
|
import { DescriptionHelper } from '../createDescriptionHelper.js';
|
|
5
|
-
import { IssueCountSchema } from '../types/zod/backlogOutputDefinition.js';
|
|
6
6
|
declare const countIssuesSchema: (t: DescriptionHelper["t"]) => {
|
|
7
7
|
projectId: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
8
8
|
issueTypeId: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
@@ -44,5 +44,5 @@ declare const countIssuesSchema: (t: DescriptionHelper["t"]) => {
|
|
|
44
44
|
value: z.ZodUnion<readonly [z.ZodNumber, z.ZodArray<z.ZodNumber>]>;
|
|
45
45
|
}, z.core.$strip>], "type">>>;
|
|
46
46
|
};
|
|
47
|
-
export declare const countIssuesTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof countIssuesSchema>,
|
|
47
|
+
export declare const countIssuesTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof countIssuesSchema>, Entity.Issue.IssueCount>;
|
|
48
48
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { buildToolSchema } from '../types/tool.js';
|
|
3
|
-
import {
|
|
3
|
+
import { outputFields } from '../types/outputFields.js';
|
|
4
4
|
import { customFieldFiltersToPayload } from '../backlog/customFields.js';
|
|
5
5
|
import { buildCustomFieldFilterSchema } from './shared/customFieldFiltersSchema.js';
|
|
6
6
|
const countIssuesSchema = buildToolSchema((t) => ({
|
|
@@ -94,7 +94,8 @@ export const countIssuesTool = (backlog, { t }) => {
|
|
|
94
94
|
name: 'count_issues',
|
|
95
95
|
description: t('TOOL_COUNT_ISSUES_DESCRIPTION', 'Returns count of issues'),
|
|
96
96
|
schema: z.object(countIssuesSchema(t)),
|
|
97
|
-
|
|
97
|
+
returnsList: false,
|
|
98
|
+
outputFields: outputFields()(['count']),
|
|
98
99
|
handler: async ({ customFields, ...rest }) => {
|
|
99
100
|
return backlog.getIssuesCount({
|
|
100
101
|
...rest,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import type { Entity } from 'backlog-js';
|
|
2
3
|
import { Backlog } from 'backlog-js';
|
|
3
4
|
import { ToolDefinition } from '../types/tool.js';
|
|
4
5
|
import { DescriptionHelper } from '../createDescriptionHelper.js';
|
|
5
|
-
import { IssueSchema } from '../types/zod/backlogOutputDefinition.js';
|
|
6
6
|
declare const deleteIssueSchema: (t: DescriptionHelper["t"]) => {
|
|
7
7
|
issueId: z.ZodOptional<z.ZodNumber>;
|
|
8
8
|
issueKey: z.ZodOptional<z.ZodString>;
|
|
9
9
|
};
|
|
10
|
-
export declare const deleteIssueTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof deleteIssueSchema>,
|
|
10
|
+
export declare const deleteIssueTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof deleteIssueSchema>, Entity.Issue.Issue>;
|
|
11
11
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { buildToolSchema } from '../types/tool.js';
|
|
3
|
-
import {
|
|
3
|
+
import { outputFields } from '../types/outputFields.js';
|
|
4
4
|
import { resolveIdOrKey } from '../utils/resolveIdOrKey.js';
|
|
5
5
|
const deleteIssueSchema = buildToolSchema((t) => ({
|
|
6
6
|
issueId: z
|
|
@@ -17,7 +17,37 @@ export const deleteIssueTool = (backlog, { t }) => {
|
|
|
17
17
|
name: 'delete_issue',
|
|
18
18
|
description: t('TOOL_DELETE_ISSUE_DESCRIPTION', 'Deletes an issue'),
|
|
19
19
|
schema: z.object(deleteIssueSchema(t)),
|
|
20
|
-
|
|
20
|
+
returnsList: false,
|
|
21
|
+
outputFields: outputFields()([
|
|
22
|
+
'id',
|
|
23
|
+
'projectId',
|
|
24
|
+
'issueKey',
|
|
25
|
+
'keyId',
|
|
26
|
+
'issueType',
|
|
27
|
+
'summary',
|
|
28
|
+
'description',
|
|
29
|
+
'resolution',
|
|
30
|
+
'priority',
|
|
31
|
+
'status',
|
|
32
|
+
'assignee',
|
|
33
|
+
'category',
|
|
34
|
+
'versions',
|
|
35
|
+
'milestone',
|
|
36
|
+
'startDate',
|
|
37
|
+
'dueDate',
|
|
38
|
+
'estimatedHours',
|
|
39
|
+
'actualHours',
|
|
40
|
+
'parentIssueId',
|
|
41
|
+
'createdUser',
|
|
42
|
+
'created',
|
|
43
|
+
'updatedUser',
|
|
44
|
+
'updated',
|
|
45
|
+
'customFields',
|
|
46
|
+
'attachments',
|
|
47
|
+
'sharedFiles',
|
|
48
|
+
'stars',
|
|
49
|
+
'childIssueSummary',
|
|
50
|
+
]),
|
|
21
51
|
handler: async ({ issueId, issueKey }) => {
|
|
22
52
|
const result = resolveIdOrKey('issue', { id: issueId, key: issueKey }, t);
|
|
23
53
|
if (!result.ok) {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import type { Entity } from 'backlog-js';
|
|
2
3
|
import { Backlog } from 'backlog-js';
|
|
3
4
|
import { ToolDefinition } from '../types/tool.js';
|
|
4
5
|
import { DescriptionHelper } from '../createDescriptionHelper.js';
|
|
5
|
-
import { ProjectSchema } from '../types/zod/backlogOutputDefinition.js';
|
|
6
6
|
declare const deleteProjectSchema: (t: DescriptionHelper["t"]) => {
|
|
7
7
|
projectId: z.ZodOptional<z.ZodNumber>;
|
|
8
8
|
projectKey: z.ZodOptional<z.ZodString>;
|
|
9
9
|
};
|
|
10
|
-
export declare const deleteProjectTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof deleteProjectSchema>,
|
|
10
|
+
export declare const deleteProjectTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof deleteProjectSchema>, Entity.Project.Project>;
|
|
11
11
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { buildToolSchema } from '../types/tool.js';
|
|
3
|
-
import {
|
|
3
|
+
import { outputFields } from '../types/outputFields.js';
|
|
4
4
|
import { resolveIdOrKey } from '../utils/resolveIdOrKey.js';
|
|
5
5
|
const deleteProjectSchema = buildToolSchema((t) => ({
|
|
6
6
|
projectId: z
|
|
@@ -17,7 +17,27 @@ export const deleteProjectTool = (backlog, { t }) => {
|
|
|
17
17
|
name: 'delete_project',
|
|
18
18
|
description: t('TOOL_DELETE_PROJECT_DESCRIPTION', 'Deletes a project'),
|
|
19
19
|
schema: z.object(deleteProjectSchema(t)),
|
|
20
|
-
|
|
20
|
+
returnsList: false,
|
|
21
|
+
outputFields: outputFields()([
|
|
22
|
+
'id',
|
|
23
|
+
'projectKey',
|
|
24
|
+
'name',
|
|
25
|
+
'chartEnabled',
|
|
26
|
+
'useResolvedForChart',
|
|
27
|
+
'subtaskingEnabled',
|
|
28
|
+
'projectLeaderCanEditProjectLeader',
|
|
29
|
+
'useWiki',
|
|
30
|
+
'useFileSharing',
|
|
31
|
+
'useWikiTreeView',
|
|
32
|
+
'useOriginalImageSizeAtWiki',
|
|
33
|
+
'useSubversion',
|
|
34
|
+
'useGit',
|
|
35
|
+
'textFormattingRule',
|
|
36
|
+
'archived',
|
|
37
|
+
'displayOrder',
|
|
38
|
+
'useDevAttributes',
|
|
39
|
+
'grandchildIssueEnabled',
|
|
40
|
+
]),
|
|
21
41
|
handler: async ({ projectId, projectKey }) => {
|
|
22
42
|
const result = resolveIdOrKey('project', { id: projectId, key: projectKey }, t);
|
|
23
43
|
if (!result.ok) {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import type { Entity } from 'backlog-js';
|
|
2
3
|
import { Backlog } from 'backlog-js';
|
|
3
4
|
import { ToolDefinition } from '../types/tool.js';
|
|
4
5
|
import { DescriptionHelper } from '../createDescriptionHelper.js';
|
|
5
|
-
import { VersionSchema } from '../types/zod/backlogOutputDefinition.js';
|
|
6
6
|
declare const deleteVersionSchema: (t: DescriptionHelper["t"]) => {
|
|
7
7
|
projectId: z.ZodOptional<z.ZodNumber>;
|
|
8
8
|
projectKey: z.ZodOptional<z.ZodString>;
|
|
9
9
|
id: z.ZodNumber;
|
|
10
10
|
};
|
|
11
|
-
export declare const deleteVersionTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof deleteVersionSchema>,
|
|
11
|
+
export declare const deleteVersionTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof deleteVersionSchema>, Entity.Project.Version>;
|
|
12
12
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { buildToolSchema } from '../types/tool.js';
|
|
3
|
-
import {
|
|
3
|
+
import { outputFields } from '../types/outputFields.js';
|
|
4
4
|
import { resolveIdOrKey } from '../utils/resolveIdOrKey.js';
|
|
5
5
|
const deleteVersionSchema = buildToolSchema((t) => ({
|
|
6
6
|
projectId: z
|
|
@@ -20,7 +20,17 @@ export const deleteVersionTool = (backlog, { t }) => {
|
|
|
20
20
|
name: 'delete_version',
|
|
21
21
|
description: t('TOOL_DELETE_VERSION_DESCRIPTION', 'Deletes a version from a project'),
|
|
22
22
|
schema: z.object(deleteVersionSchema(t)),
|
|
23
|
-
|
|
23
|
+
returnsList: false,
|
|
24
|
+
outputFields: outputFields()([
|
|
25
|
+
'id',
|
|
26
|
+
'projectId',
|
|
27
|
+
'name',
|
|
28
|
+
'description',
|
|
29
|
+
'startDate',
|
|
30
|
+
'releaseDueDate',
|
|
31
|
+
'archived',
|
|
32
|
+
'displayOrder',
|
|
33
|
+
]),
|
|
24
34
|
handler: async ({ projectId, projectKey, id }) => {
|
|
25
35
|
const result = resolveIdOrKey('project', { id: projectId, key: projectKey }, t);
|
|
26
36
|
if (!result.ok) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import type { Entity } from 'backlog-js';
|
|
2
3
|
import { Backlog } from 'backlog-js';
|
|
3
4
|
import { ToolDefinition } from '../types/tool.js';
|
|
4
5
|
import { DescriptionHelper } from '../createDescriptionHelper.js';
|
|
5
|
-
import { WatchingListItemSchema } from '../types/zod/backlogOutputDefinition.js';
|
|
6
6
|
declare const deleteWatchingSchema: (t: DescriptionHelper["t"]) => {
|
|
7
7
|
watchId: z.ZodNumber;
|
|
8
8
|
};
|
|
9
|
-
export declare const deleteWatchingTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof deleteWatchingSchema>,
|
|
9
|
+
export declare const deleteWatchingTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof deleteWatchingSchema>, Entity.WatchingList.WatchingListItem>;
|
|
10
10
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { buildToolSchema } from '../types/tool.js';
|
|
3
|
-
import {
|
|
3
|
+
import { outputFields } from '../types/outputFields.js';
|
|
4
4
|
const deleteWatchingSchema = buildToolSchema((t) => ({
|
|
5
5
|
watchId: z
|
|
6
6
|
.number()
|
|
@@ -11,7 +11,17 @@ export const deleteWatchingTool = (backlog, { t }) => {
|
|
|
11
11
|
name: 'delete_watching',
|
|
12
12
|
description: t('TOOL_DELETE_WATCHING_DESCRIPTION', 'Deletes a watch from an issue'),
|
|
13
13
|
schema: z.object(deleteWatchingSchema(t)),
|
|
14
|
-
|
|
14
|
+
returnsList: false,
|
|
15
|
+
outputFields: outputFields()([
|
|
16
|
+
'id',
|
|
17
|
+
'resourceAlreadyRead',
|
|
18
|
+
'note',
|
|
19
|
+
'type',
|
|
20
|
+
'issue',
|
|
21
|
+
'lastContentUpdated',
|
|
22
|
+
'created',
|
|
23
|
+
'updated',
|
|
24
|
+
]),
|
|
15
25
|
handler: async ({ watchId }) => backlog.deletehWatchingListItem(watchId),
|
|
16
26
|
};
|
|
17
27
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import type { Entity } from 'backlog-js';
|
|
2
3
|
import { Backlog } from 'backlog-js';
|
|
3
4
|
import { ToolDefinition } from '../types/tool.js';
|
|
4
5
|
import { DescriptionHelper } from '../createDescriptionHelper.js';
|
|
5
|
-
import { CategorySchema } from '../types/zod/backlogOutputDefinition.js';
|
|
6
6
|
declare const getCategoriesSchema: (t: DescriptionHelper["t"]) => {
|
|
7
7
|
projectId: z.ZodOptional<z.ZodNumber>;
|
|
8
8
|
projectKey: z.ZodOptional<z.ZodString>;
|
|
9
9
|
};
|
|
10
|
-
export declare const getCategoriesTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getCategoriesSchema>,
|
|
10
|
+
export declare const getCategoriesTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getCategoriesSchema>, Entity.Project.Category>;
|
|
11
11
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { buildToolSchema } from '../types/tool.js';
|
|
3
|
-
import {
|
|
3
|
+
import { outputFields } from '../types/outputFields.js';
|
|
4
4
|
import { resolveIdOrKey } from '../utils/resolveIdOrKey.js';
|
|
5
5
|
const getCategoriesSchema = buildToolSchema((t) => ({
|
|
6
6
|
projectId: z
|
|
@@ -18,7 +18,13 @@ export const getCategoriesTool = (backlog, { t }) => {
|
|
|
18
18
|
description: t('TOOL_GET_CATEGORIES_DESCRIPTION', 'Returns list of categories for a project'),
|
|
19
19
|
schema: z.object(getCategoriesSchema(t)),
|
|
20
20
|
importantFields: ['id', 'projectId', 'name'],
|
|
21
|
-
|
|
21
|
+
returnsList: true,
|
|
22
|
+
outputFields: outputFields()([
|
|
23
|
+
'id',
|
|
24
|
+
'projectId',
|
|
25
|
+
'name',
|
|
26
|
+
'displayOrder',
|
|
27
|
+
]),
|
|
22
28
|
handler: async ({ projectId, projectKey }) => {
|
|
23
29
|
const result = resolveIdOrKey('project', { id: projectId, key: projectKey }, t);
|
|
24
30
|
if (!result.ok) {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
+
import type { Entity } from 'backlog-js';
|
|
1
2
|
import { Backlog } from 'backlog-js';
|
|
2
3
|
import { z } from 'zod';
|
|
3
4
|
import { ToolDefinition } from '../types/tool.js';
|
|
4
5
|
import { DescriptionHelper } from '../createDescriptionHelper.js';
|
|
5
|
-
import { CustomFieldSchema } from '../types/zod/backlogOutputDefinition.js';
|
|
6
6
|
declare const getCustomFieldsInputSchema: (t: DescriptionHelper["t"]) => {
|
|
7
7
|
projectId: z.ZodOptional<z.ZodNumber>;
|
|
8
8
|
projectKey: z.ZodOptional<z.ZodString>;
|
|
9
9
|
};
|
|
10
10
|
export declare const getCustomFieldsTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getCustomFieldsInputSchema>, // Shape for input schema
|
|
11
|
-
|
|
11
|
+
Entity.Project.CustomField>;
|
|
12
12
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { buildToolSchema } from '../types/tool.js';
|
|
3
|
-
import {
|
|
3
|
+
import { outputFields } from '../types/outputFields.js';
|
|
4
4
|
import { resolveIdOrKey } from '../utils/resolveIdOrKey.js';
|
|
5
5
|
const getCustomFieldsInputSchema = buildToolSchema((t) => ({
|
|
6
6
|
projectId: z
|
|
@@ -18,7 +18,27 @@ export const getCustomFieldsTool = (backlog, { t }) => {
|
|
|
18
18
|
name: 'get_custom_fields',
|
|
19
19
|
description: t('TOOL_GET_CUSTOM_FIELDS_DESCRIPTION', 'Returns list of custom fields for a project'),
|
|
20
20
|
schema: inputSchemaObject,
|
|
21
|
-
|
|
21
|
+
returnsList: true,
|
|
22
|
+
outputFields: outputFields()([
|
|
23
|
+
'id',
|
|
24
|
+
'projectId',
|
|
25
|
+
'typeId',
|
|
26
|
+
'name',
|
|
27
|
+
'description',
|
|
28
|
+
'required',
|
|
29
|
+
'useIssueType',
|
|
30
|
+
'applicableIssueTypes',
|
|
31
|
+
'displayOrder',
|
|
32
|
+
'version',
|
|
33
|
+
'min',
|
|
34
|
+
'max',
|
|
35
|
+
'initialValue',
|
|
36
|
+
'unit',
|
|
37
|
+
'initialDate',
|
|
38
|
+
'items',
|
|
39
|
+
'allowAddItem',
|
|
40
|
+
'allowInput',
|
|
41
|
+
]),
|
|
22
42
|
importantFields: [
|
|
23
43
|
'id',
|
|
24
44
|
'name',
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import type { Entity } from 'backlog-js';
|
|
1
2
|
import { Backlog } from 'backlog-js';
|
|
2
3
|
import { z } from 'zod';
|
|
3
4
|
import { DescriptionHelper } from '../createDescriptionHelper.js';
|
|
4
|
-
import { DocumentItemSchema } from '../types/zod/backlogOutputDefinition.js';
|
|
5
5
|
import { ToolDefinition } from '../types/tool.js';
|
|
6
6
|
declare const getDocumentSchema: (t: DescriptionHelper["t"]) => {
|
|
7
7
|
documentId: z.ZodString;
|
|
8
8
|
};
|
|
9
|
-
export declare const getDocumentTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getDocumentSchema>,
|
|
9
|
+
export declare const getDocumentTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getDocumentSchema>, Entity.Document.Document>;
|
|
10
10
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { DocumentItemSchema } from '../types/zod/backlogOutputDefinition.js';
|
|
3
2
|
import { buildToolSchema } from '../types/tool.js';
|
|
3
|
+
import { outputFields } from '../types/outputFields.js';
|
|
4
4
|
const getDocumentSchema = buildToolSchema((t) => ({
|
|
5
5
|
documentId: z
|
|
6
6
|
.string()
|
|
@@ -11,7 +11,22 @@ export const getDocumentTool = (backlog, { t }) => {
|
|
|
11
11
|
name: 'get_document',
|
|
12
12
|
description: t('TOOL_GET_DOCUMENT_DESCRIPTION', 'Gets information about a document.'),
|
|
13
13
|
schema: z.object(getDocumentSchema(t)),
|
|
14
|
-
|
|
14
|
+
returnsList: false,
|
|
15
|
+
outputFields: outputFields()([
|
|
16
|
+
'id',
|
|
17
|
+
'projectId',
|
|
18
|
+
'title',
|
|
19
|
+
'plain',
|
|
20
|
+
'json',
|
|
21
|
+
'statusId',
|
|
22
|
+
'emoji',
|
|
23
|
+
'attachments',
|
|
24
|
+
'tags',
|
|
25
|
+
'createdUser',
|
|
26
|
+
'created',
|
|
27
|
+
'updatedUser',
|
|
28
|
+
'updated',
|
|
29
|
+
]),
|
|
15
30
|
importantFields: ['id', 'title', 'createdUser'],
|
|
16
31
|
handler: async ({ documentId }) => {
|
|
17
32
|
return backlog.getDocument(documentId);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import type { Entity } from 'backlog-js';
|
|
1
2
|
import { Backlog } from 'backlog-js';
|
|
2
3
|
import { z } from 'zod';
|
|
3
4
|
import { DescriptionHelper } from '../createDescriptionHelper.js';
|
|
4
|
-
import { DocumentTreeFullSchema } from '../types/zod/backlogOutputDefinition.js';
|
|
5
5
|
import { ToolDefinition } from '../types/tool.js';
|
|
6
6
|
declare const getDocumentTreeSchema: (t: DescriptionHelper["t"]) => {
|
|
7
7
|
projectIdOrKey: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
8
8
|
};
|
|
9
|
-
export declare const getDocumentTreeTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getDocumentTreeSchema>,
|
|
9
|
+
export declare const getDocumentTreeTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getDocumentTreeSchema>, Entity.Document.DocumentTree>;
|
|
10
10
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { DocumentTreeFullSchemaZ, } from '../types/zod/backlogOutputDefinition.js';
|
|
3
2
|
import { buildToolSchema } from '../types/tool.js';
|
|
3
|
+
import { outputFields } from '../types/outputFields.js';
|
|
4
4
|
const getDocumentTreeSchema = buildToolSchema((t) => ({
|
|
5
5
|
projectIdOrKey: z
|
|
6
6
|
.union([z.string(), z.number()])
|
|
@@ -11,7 +11,12 @@ export const getDocumentTreeTool = (backlog, { t }) => {
|
|
|
11
11
|
name: 'get_document_tree',
|
|
12
12
|
description: t('TOOL_GET_DOCUMENT_TREE_DESCRIPTION', 'Gets the document tree of a project.'),
|
|
13
13
|
schema: z.object(getDocumentTreeSchema(t)),
|
|
14
|
-
|
|
14
|
+
returnsList: false,
|
|
15
|
+
outputFields: outputFields()([
|
|
16
|
+
'projectId',
|
|
17
|
+
'activeTree',
|
|
18
|
+
'trashTree',
|
|
19
|
+
]),
|
|
15
20
|
importantFields: ['projectId', 'activeTree', 'trashTree'],
|
|
16
21
|
handler: async ({ projectIdOrKey }) => {
|
|
17
22
|
return backlog.getDocumentTree(projectIdOrKey);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
+
import type { Entity } from 'backlog-js';
|
|
1
2
|
import { Backlog } from 'backlog-js';
|
|
2
3
|
import { z } from 'zod';
|
|
3
4
|
import { DescriptionHelper } from '../createDescriptionHelper.js';
|
|
4
|
-
import { DocumentItemSchema } from '../types/zod/backlogOutputDefinition.js';
|
|
5
5
|
import { ToolDefinition } from '../types/tool.js';
|
|
6
6
|
declare const getDocumentsSchema: (t: DescriptionHelper["t"]) => {
|
|
7
7
|
projectIds: z.ZodArray<z.ZodNumber>;
|
|
8
8
|
offset: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
9
9
|
};
|
|
10
|
-
export declare const getDocumentsTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getDocumentsSchema>,
|
|
10
|
+
export declare const getDocumentsTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getDocumentsSchema>, Entity.Document.Document>;
|
|
11
11
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { DocumentItemSchema } from '../types/zod/backlogOutputDefinition.js';
|
|
3
2
|
import { buildToolSchema } from '../types/tool.js';
|
|
3
|
+
import { outputFields } from '../types/outputFields.js';
|
|
4
4
|
const getDocumentsSchema = buildToolSchema((t) => ({
|
|
5
5
|
projectIds: z
|
|
6
6
|
.array(z.number())
|
|
@@ -16,7 +16,22 @@ export const getDocumentsTool = (backlog, { t }) => {
|
|
|
16
16
|
name: 'get_documents',
|
|
17
17
|
description: t('TOOL_GET_DOCUMENTS_DESCRIPTION', 'Gets a list of documents in a project.'),
|
|
18
18
|
schema: z.object(getDocumentsSchema(t)),
|
|
19
|
-
|
|
19
|
+
returnsList: true,
|
|
20
|
+
outputFields: outputFields()([
|
|
21
|
+
'id',
|
|
22
|
+
'projectId',
|
|
23
|
+
'title',
|
|
24
|
+
'plain',
|
|
25
|
+
'json',
|
|
26
|
+
'statusId',
|
|
27
|
+
'emoji',
|
|
28
|
+
'attachments',
|
|
29
|
+
'tags',
|
|
30
|
+
'createdUser',
|
|
31
|
+
'created',
|
|
32
|
+
'updatedUser',
|
|
33
|
+
'updated',
|
|
34
|
+
]),
|
|
20
35
|
importantFields: ['id', 'projectId', 'title', 'plain'],
|
|
21
36
|
handler: async ({ projectIds, offset }) => {
|
|
22
37
|
return backlog.getDocuments({ projectId: projectIds, offset });
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import type { Entity } from 'backlog-js';
|
|
2
3
|
import { Backlog } from 'backlog-js';
|
|
3
4
|
import { ToolDefinition } from '../types/tool.js';
|
|
4
5
|
import { DescriptionHelper } from '../createDescriptionHelper.js';
|
|
5
|
-
import { GitRepositorySchema } from '../types/zod/backlogOutputDefinition.js';
|
|
6
6
|
declare const getGitRepositoriesSchema: (t: DescriptionHelper["t"]) => {
|
|
7
7
|
projectId: z.ZodOptional<z.ZodNumber>;
|
|
8
8
|
projectKey: z.ZodOptional<z.ZodString>;
|
|
9
9
|
};
|
|
10
|
-
export declare const getGitRepositoriesTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getGitRepositoriesSchema>,
|
|
10
|
+
export declare const getGitRepositoriesTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getGitRepositoriesSchema>, Entity.Git.GitRepository>;
|
|
11
11
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { buildToolSchema } from '../types/tool.js';
|
|
3
|
-
import {
|
|
3
|
+
import { outputFields } from '../types/outputFields.js';
|
|
4
4
|
import { resolveIdOrKey } from '../utils/resolveIdOrKey.js';
|
|
5
5
|
const getGitRepositoriesSchema = buildToolSchema((t) => ({
|
|
6
6
|
projectId: z
|
|
@@ -17,7 +17,22 @@ export const getGitRepositoriesTool = (backlog, { t }) => {
|
|
|
17
17
|
name: 'get_git_repositories',
|
|
18
18
|
description: t('TOOL_GET_GIT_REPOSITORIES_DESCRIPTION', 'Returns list of Git repositories for a project'),
|
|
19
19
|
schema: z.object(getGitRepositoriesSchema(t)),
|
|
20
|
-
|
|
20
|
+
returnsList: true,
|
|
21
|
+
outputFields: outputFields()([
|
|
22
|
+
'id',
|
|
23
|
+
'projectId',
|
|
24
|
+
'name',
|
|
25
|
+
'description',
|
|
26
|
+
'hookUrl',
|
|
27
|
+
'httpUrl',
|
|
28
|
+
'sshUrl',
|
|
29
|
+
'displayOrder',
|
|
30
|
+
'pushedAt',
|
|
31
|
+
'createdUser',
|
|
32
|
+
'created',
|
|
33
|
+
'updatedUser',
|
|
34
|
+
'updated',
|
|
35
|
+
]),
|
|
21
36
|
handler: async ({ projectId, projectKey }) => {
|
|
22
37
|
const result = resolveIdOrKey('project', { id: projectId, key: projectKey }, t);
|
|
23
38
|
if (!result.ok) {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import type { Entity } from 'backlog-js';
|
|
2
3
|
import { Backlog } from 'backlog-js';
|
|
3
4
|
import { ToolDefinition } from '../types/tool.js';
|
|
4
5
|
import { DescriptionHelper } from '../createDescriptionHelper.js';
|
|
5
|
-
import { GitRepositorySchema } from '../types/zod/backlogOutputDefinition.js';
|
|
6
6
|
declare const getGitRepositorySchema: (t: DescriptionHelper["t"]) => {
|
|
7
7
|
projectId: z.ZodOptional<z.ZodNumber>;
|
|
8
8
|
projectKey: z.ZodOptional<z.ZodString>;
|
|
9
9
|
repoId: z.ZodOptional<z.ZodNumber>;
|
|
10
10
|
repoName: z.ZodOptional<z.ZodString>;
|
|
11
11
|
};
|
|
12
|
-
export declare const getGitRepositoryTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getGitRepositorySchema>,
|
|
12
|
+
export declare const getGitRepositoryTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getGitRepositorySchema>, Entity.Git.GitRepository>;
|
|
13
13
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { buildToolSchema } from '../types/tool.js';
|
|
3
|
-
import {
|
|
3
|
+
import { outputFields } from '../types/outputFields.js';
|
|
4
4
|
import { resolveIdOrKey, resolveIdOrName } from '../utils/resolveIdOrKey.js';
|
|
5
5
|
const getGitRepositorySchema = buildToolSchema((t) => ({
|
|
6
6
|
projectId: z
|
|
@@ -25,7 +25,22 @@ export const getGitRepositoryTool = (backlog, { t }) => {
|
|
|
25
25
|
name: 'get_git_repository',
|
|
26
26
|
description: t('TOOL_GET_GIT_REPOSITORY_DESCRIPTION', 'Returns information about a specific Git repository'),
|
|
27
27
|
schema: z.object(getGitRepositorySchema(t)),
|
|
28
|
-
|
|
28
|
+
returnsList: false,
|
|
29
|
+
outputFields: outputFields()([
|
|
30
|
+
'id',
|
|
31
|
+
'projectId',
|
|
32
|
+
'name',
|
|
33
|
+
'description',
|
|
34
|
+
'hookUrl',
|
|
35
|
+
'httpUrl',
|
|
36
|
+
'sshUrl',
|
|
37
|
+
'displayOrder',
|
|
38
|
+
'pushedAt',
|
|
39
|
+
'createdUser',
|
|
40
|
+
'created',
|
|
41
|
+
'updatedUser',
|
|
42
|
+
'updated',
|
|
43
|
+
]),
|
|
29
44
|
handler: async ({ projectId, projectKey, repoId, repoName }) => {
|
|
30
45
|
const result = resolveIdOrKey('project', { id: projectId, key: projectKey }, t);
|
|
31
46
|
if (!result.ok) {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import type { Entity } from 'backlog-js';
|
|
2
3
|
import { Backlog } from 'backlog-js';
|
|
3
4
|
import { ToolDefinition } from '../types/tool.js';
|
|
4
5
|
import { DescriptionHelper } from '../createDescriptionHelper.js';
|
|
5
|
-
import { IssueSchema } from '../types/zod/backlogOutputDefinition.js';
|
|
6
6
|
declare const getIssueSchema: (t: DescriptionHelper["t"]) => {
|
|
7
7
|
issueId: z.ZodOptional<z.ZodNumber>;
|
|
8
8
|
issueKey: z.ZodOptional<z.ZodString>;
|
|
9
9
|
};
|
|
10
|
-
export declare const getIssueTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getIssueSchema>,
|
|
10
|
+
export declare const getIssueTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getIssueSchema>, Entity.Issue.Issue>;
|
|
11
11
|
export {};
|