backlog-mcp-server 0.17.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 +20 -15
- package/build/lib.d.ts +1 -1
- package/build/reportUnknownOverrideKeys.js +0 -1
- 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 +1 -2
- 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
|
@@ -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 {};
|
package/build/tools/getIssue.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
|
import { resolveIdOrKey } from '../utils/resolveIdOrKey.js';
|
|
5
5
|
const getIssueSchema = buildToolSchema((t) => ({
|
|
6
6
|
issueId: z
|
|
@@ -16,7 +16,37 @@ export const getIssueTool = (backlog, { t }) => {
|
|
|
16
16
|
return {
|
|
17
17
|
name: 'get_issue',
|
|
18
18
|
description: t('TOOL_GET_ISSUE_DESCRIPTION', 'Returns information about a specific issue'),
|
|
19
|
-
|
|
19
|
+
returnsList: false,
|
|
20
|
+
outputFields: outputFields()([
|
|
21
|
+
'id',
|
|
22
|
+
'projectId',
|
|
23
|
+
'issueKey',
|
|
24
|
+
'keyId',
|
|
25
|
+
'issueType',
|
|
26
|
+
'summary',
|
|
27
|
+
'description',
|
|
28
|
+
'resolution',
|
|
29
|
+
'priority',
|
|
30
|
+
'status',
|
|
31
|
+
'assignee',
|
|
32
|
+
'category',
|
|
33
|
+
'versions',
|
|
34
|
+
'milestone',
|
|
35
|
+
'startDate',
|
|
36
|
+
'dueDate',
|
|
37
|
+
'estimatedHours',
|
|
38
|
+
'actualHours',
|
|
39
|
+
'parentIssueId',
|
|
40
|
+
'createdUser',
|
|
41
|
+
'created',
|
|
42
|
+
'updatedUser',
|
|
43
|
+
'updated',
|
|
44
|
+
'customFields',
|
|
45
|
+
'attachments',
|
|
46
|
+
'sharedFiles',
|
|
47
|
+
'stars',
|
|
48
|
+
'childIssueSummary',
|
|
49
|
+
]),
|
|
20
50
|
schema: z.object(getIssueSchema(t)),
|
|
21
51
|
handler: async ({ issueId, issueKey }) => {
|
|
22
52
|
const result = resolveIdOrKey('issue', { id: issueId, key: issueKey }, t);
|
|
@@ -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 { IssueCommentSchema } from '../types/zod/backlogOutputDefinition.js';
|
|
6
6
|
declare const getIssueCommentsSchema: (t: DescriptionHelper["t"]) => {
|
|
7
7
|
issueId: z.ZodOptional<z.ZodNumber>;
|
|
8
8
|
issueKey: z.ZodOptional<z.ZodString>;
|
|
@@ -14,5 +14,5 @@ declare const getIssueCommentsSchema: (t: DescriptionHelper["t"]) => {
|
|
|
14
14
|
desc: "desc";
|
|
15
15
|
}>>;
|
|
16
16
|
};
|
|
17
|
-
export declare const getIssueCommentsTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getIssueCommentsSchema>,
|
|
17
|
+
export declare const getIssueCommentsTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getIssueCommentsSchema>, Entity.Issue.Comment>;
|
|
18
18
|
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 getIssueCommentsSchema = buildToolSchema((t) => ({
|
|
6
6
|
issueId: z
|
|
@@ -33,7 +33,19 @@ export const getIssueCommentsTool = (backlog, { t }) => {
|
|
|
33
33
|
name: 'get_issue_comments',
|
|
34
34
|
description: t('TOOL_GET_ISSUE_COMMENTS_DESCRIPTION', 'Returns list of comments for an issue'),
|
|
35
35
|
schema: z.object(getIssueCommentsSchema(t)),
|
|
36
|
-
|
|
36
|
+
returnsList: true,
|
|
37
|
+
outputFields: outputFields()([
|
|
38
|
+
'id',
|
|
39
|
+
'projectId',
|
|
40
|
+
'issueId',
|
|
41
|
+
'content',
|
|
42
|
+
'changeLog',
|
|
43
|
+
'createdUser',
|
|
44
|
+
'created',
|
|
45
|
+
'updated',
|
|
46
|
+
'stars',
|
|
47
|
+
'notifications',
|
|
48
|
+
]),
|
|
37
49
|
handler: async ({ issueId, issueKey, ...params }) => {
|
|
38
50
|
const result = resolveIdOrKey('issue', { id: issueId, key: issueKey }, t);
|
|
39
51
|
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 { IssueTypeSchema } from '../types/zod/backlogOutputDefinition.js';
|
|
6
6
|
declare const getIssueTypesSchema: (t: DescriptionHelper["t"]) => {
|
|
7
7
|
projectId: z.ZodOptional<z.ZodNumber>;
|
|
8
8
|
projectKey: z.ZodOptional<z.ZodString>;
|
|
9
9
|
};
|
|
10
|
-
export declare const getIssueTypesTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getIssueTypesSchema>,
|
|
10
|
+
export declare const getIssueTypesTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getIssueTypesSchema>, Entity.Issue.IssueType>;
|
|
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 getIssueTypesSchema = buildToolSchema((t) => ({
|
|
6
6
|
projectId: z
|
|
@@ -17,7 +17,16 @@ export const getIssueTypesTool = (backlog, { t }) => {
|
|
|
17
17
|
name: 'get_issue_types',
|
|
18
18
|
description: t('TOOL_GET_ISSUE_TYPES_DESCRIPTION', 'Returns list of issue types for a project'),
|
|
19
19
|
schema: z.object(getIssueTypesSchema(t)),
|
|
20
|
-
|
|
20
|
+
returnsList: true,
|
|
21
|
+
outputFields: outputFields()([
|
|
22
|
+
'id',
|
|
23
|
+
'projectId',
|
|
24
|
+
'name',
|
|
25
|
+
'color',
|
|
26
|
+
'displayOrder',
|
|
27
|
+
'templateSummary',
|
|
28
|
+
'templateDescription',
|
|
29
|
+
]),
|
|
21
30
|
importantFields: ['id', 'name'],
|
|
22
31
|
handler: async ({ projectId, projectKey }) => {
|
|
23
32
|
const result = resolveIdOrKey('project', { id: projectId, key: projectKey }, t);
|
|
@@ -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 { IssueSchema } from '../types/zod/backlogOutputDefinition.js';
|
|
6
6
|
declare const getIssuesSchema: (t: DescriptionHelper["t"]) => {
|
|
7
7
|
projectId: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
8
8
|
issueTypeId: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
@@ -27,20 +27,20 @@ declare const getIssuesSchema: (t: DescriptionHelper["t"]) => {
|
|
|
27
27
|
sort: z.ZodOptional<z.ZodEnum<{
|
|
28
28
|
version: "version";
|
|
29
29
|
priority: "priority";
|
|
30
|
-
|
|
31
|
-
created: "created";
|
|
30
|
+
summary: "summary";
|
|
32
31
|
startDate: "startDate";
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
dueDate: "dueDate";
|
|
33
|
+
estimatedHours: "estimatedHours";
|
|
34
|
+
actualHours: "actualHours";
|
|
35
35
|
issueType: "issueType";
|
|
36
36
|
status: "status";
|
|
37
|
-
summary: "summary";
|
|
38
37
|
assignee: "assignee";
|
|
39
38
|
category: "category";
|
|
40
39
|
milestone: "milestone";
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
40
|
+
createdUser: "createdUser";
|
|
41
|
+
created: "created";
|
|
42
|
+
updatedUser: "updatedUser";
|
|
43
|
+
updated: "updated";
|
|
44
44
|
attachment: "attachment";
|
|
45
45
|
sharedFile: "sharedFile";
|
|
46
46
|
childIssue: "childIssue";
|
|
@@ -71,5 +71,5 @@ declare const getIssuesSchema: (t: DescriptionHelper["t"]) => {
|
|
|
71
71
|
value: z.ZodUnion<readonly [z.ZodNumber, z.ZodArray<z.ZodNumber>]>;
|
|
72
72
|
}, z.core.$strip>], "type">>>;
|
|
73
73
|
};
|
|
74
|
-
export declare const getIssuesTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getIssuesSchema>,
|
|
74
|
+
export declare const getIssuesTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getIssuesSchema>, Entity.Issue.Issue>;
|
|
75
75
|
export {};
|