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
|
@@ -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 { PullRequestSchema } from '../types/zod/backlogOutputDefinition.js';
|
|
6
6
|
declare const getPullRequestsSchema: (t: DescriptionHelper["t"]) => {
|
|
7
7
|
projectId: z.ZodOptional<z.ZodNumber>;
|
|
8
8
|
projectKey: z.ZodOptional<z.ZodString>;
|
|
@@ -15,5 +15,5 @@ declare const getPullRequestsSchema: (t: DescriptionHelper["t"]) => {
|
|
|
15
15
|
offset: z.ZodOptional<z.ZodNumber>;
|
|
16
16
|
count: z.ZodOptional<z.ZodNumber>;
|
|
17
17
|
};
|
|
18
|
-
export declare const getPullRequestsTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getPullRequestsSchema>,
|
|
18
|
+
export declare const getPullRequestsTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getPullRequestsSchema>, Entity.PullRequest.PullRequest>;
|
|
19
19
|
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 getPullRequestsSchema = buildToolSchema((t) => ({
|
|
6
6
|
projectId: z
|
|
@@ -49,7 +49,31 @@ export const getPullRequestsTool = (backlog, { t }) => {
|
|
|
49
49
|
name: 'get_pull_requests',
|
|
50
50
|
description: t('TOOL_GET_PULL_REQUESTS_DESCRIPTION', 'Returns list of pull requests for a repository'),
|
|
51
51
|
schema: z.object(getPullRequestsSchema(t)),
|
|
52
|
-
|
|
52
|
+
returnsList: true,
|
|
53
|
+
outputFields: outputFields()([
|
|
54
|
+
'id',
|
|
55
|
+
'projectId',
|
|
56
|
+
'repositoryId',
|
|
57
|
+
'number',
|
|
58
|
+
'summary',
|
|
59
|
+
'description',
|
|
60
|
+
'base',
|
|
61
|
+
'branch',
|
|
62
|
+
'status',
|
|
63
|
+
'assignee',
|
|
64
|
+
'issue',
|
|
65
|
+
'baseCommit',
|
|
66
|
+
'branchCommit',
|
|
67
|
+
'mergeCommit',
|
|
68
|
+
'closeAt',
|
|
69
|
+
'mergeAt',
|
|
70
|
+
'createdUser',
|
|
71
|
+
'created',
|
|
72
|
+
'updatedUser',
|
|
73
|
+
'updated',
|
|
74
|
+
'attachments',
|
|
75
|
+
'stars',
|
|
76
|
+
]),
|
|
53
77
|
handler: async ({ projectId, projectKey, repoId, repoName, ...params }) => {
|
|
54
78
|
const result = resolveIdOrKey('project', { id: projectId, key: projectKey }, t);
|
|
55
79
|
if (!result.ok) {
|
|
@@ -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 { PullRequestCountSchema } from '../types/zod/backlogOutputDefinition.js';
|
|
6
6
|
declare const getPullRequestsCountSchema: (t: DescriptionHelper["t"]) => {
|
|
7
7
|
projectId: z.ZodOptional<z.ZodNumber>;
|
|
8
8
|
projectKey: z.ZodOptional<z.ZodString>;
|
|
@@ -13,5 +13,5 @@ declare const getPullRequestsCountSchema: (t: DescriptionHelper["t"]) => {
|
|
|
13
13
|
issueId: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
14
14
|
createdUserId: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
15
15
|
};
|
|
16
|
-
export declare const getPullRequestsCountTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getPullRequestsCountSchema>,
|
|
16
|
+
export declare const getPullRequestsCountTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getPullRequestsCountSchema>, Entity.PullRequest.PullRequestCount>;
|
|
17
17
|
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 getPullRequestsCountSchema = buildToolSchema((t) => ({
|
|
6
6
|
projectId: z
|
|
@@ -41,7 +41,10 @@ export const getPullRequestsCountTool = (backlog, { t }) => {
|
|
|
41
41
|
name: 'get_pull_requests_count',
|
|
42
42
|
description: t('TOOL_GET_PULL_REQUESTS_COUNT_DESCRIPTION', 'Returns count of pull requests for a repository'),
|
|
43
43
|
schema: z.object(getPullRequestsCountSchema(t)),
|
|
44
|
-
|
|
44
|
+
returnsList: false,
|
|
45
|
+
outputFields: outputFields()([
|
|
46
|
+
'count',
|
|
47
|
+
]),
|
|
45
48
|
handler: async ({ projectId, projectKey, repoId, repoName, ...params }) => {
|
|
46
49
|
const result = resolveIdOrKey('project', { id: projectId, key: projectKey }, t);
|
|
47
50
|
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 { RelatedIssueSchema } from '../types/zod/backlogOutputDefinition.js';
|
|
6
6
|
declare const getRelatedIssuesSchema: (t: DescriptionHelper["t"]) => {
|
|
7
7
|
issueId: z.ZodOptional<z.ZodNumber>;
|
|
8
8
|
issueKey: z.ZodOptional<z.ZodString>;
|
|
9
9
|
};
|
|
10
|
-
export declare const getRelatedIssuesTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getRelatedIssuesSchema>,
|
|
10
|
+
export declare const getRelatedIssuesTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getRelatedIssuesSchema>, Entity.Issue.RelatedIssue>;
|
|
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 getRelatedIssuesSchema = buildToolSchema((t) => ({
|
|
6
6
|
issueId: z
|
|
@@ -18,7 +18,38 @@ export const getRelatedIssuesTool = (backlog, { t }) => {
|
|
|
18
18
|
description: t('TOOL_GET_RELATED_ISSUES_DESCRIPTION', 'Returns list of issues related to a specific issue'),
|
|
19
19
|
schema: z.object(getRelatedIssuesSchema(t)),
|
|
20
20
|
importantFields: ['issueKey', 'summary', 'status', 'type'],
|
|
21
|
-
|
|
21
|
+
returnsList: true,
|
|
22
|
+
outputFields: outputFields()([
|
|
23
|
+
'id',
|
|
24
|
+
'projectId',
|
|
25
|
+
'issueKey',
|
|
26
|
+
'keyId',
|
|
27
|
+
'issueType',
|
|
28
|
+
'summary',
|
|
29
|
+
'description',
|
|
30
|
+
'resolution',
|
|
31
|
+
'priority',
|
|
32
|
+
'status',
|
|
33
|
+
'assignee',
|
|
34
|
+
'category',
|
|
35
|
+
'versions',
|
|
36
|
+
'milestone',
|
|
37
|
+
'startDate',
|
|
38
|
+
'dueDate',
|
|
39
|
+
'estimatedHours',
|
|
40
|
+
'actualHours',
|
|
41
|
+
'parentIssueId',
|
|
42
|
+
'createdUser',
|
|
43
|
+
'created',
|
|
44
|
+
'updatedUser',
|
|
45
|
+
'updated',
|
|
46
|
+
'customFields',
|
|
47
|
+
'attachments',
|
|
48
|
+
'sharedFiles',
|
|
49
|
+
'stars',
|
|
50
|
+
'childIssueSummary',
|
|
51
|
+
'type',
|
|
52
|
+
]),
|
|
22
53
|
handler: async ({ issueId, issueKey }) => {
|
|
23
54
|
const result = resolveIdOrKey('issue', { id: issueId, key: issueKey }, t);
|
|
24
55
|
if (!result.ok) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import type { Entity } from 'backlog-js';
|
|
1
2
|
import { Backlog } from 'backlog-js';
|
|
2
3
|
import { ToolDefinition } from '../types/tool.js';
|
|
3
4
|
import { DescriptionHelper } from '../createDescriptionHelper.js';
|
|
4
|
-
import { ResolutionSchema } from '../types/zod/backlogOutputDefinition.js';
|
|
5
5
|
declare const getResolutionsSchema: (t: DescriptionHelper["t"]) => {};
|
|
6
|
-
export declare const getResolutionsTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getResolutionsSchema>,
|
|
6
|
+
export declare const getResolutionsTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getResolutionsSchema>, Entity.Issue.Resolution>;
|
|
7
7
|
export {};
|
|
@@ -1,13 +1,14 @@
|
|
|
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 getResolutionsSchema = buildToolSchema((_t) => ({}));
|
|
5
5
|
export const getResolutionsTool = (backlog, { t }) => {
|
|
6
6
|
return {
|
|
7
7
|
name: 'get_resolutions',
|
|
8
8
|
description: t('TOOL_GET_RESOLUTIONS_DESCRIPTION', 'Returns list of issue resolutions'),
|
|
9
9
|
schema: z.object(getResolutionsSchema(t)),
|
|
10
|
-
|
|
10
|
+
returnsList: true,
|
|
11
|
+
outputFields: outputFields()(['id', 'name']),
|
|
11
12
|
handler: async () => backlog.getResolutions(),
|
|
12
13
|
};
|
|
13
14
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import type { Entity } from 'backlog-js';
|
|
1
2
|
import { Backlog } from 'backlog-js';
|
|
2
3
|
import { ToolDefinition } from '../types/tool.js';
|
|
3
4
|
import { DescriptionHelper } from '../createDescriptionHelper.js';
|
|
4
|
-
import { SpaceSchema } from '../types/zod/backlogOutputDefinition.js';
|
|
5
5
|
declare const getSpaceSchema: (t: DescriptionHelper["t"]) => {};
|
|
6
|
-
export declare const getSpaceTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getSpaceSchema>,
|
|
6
|
+
export declare const getSpaceTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getSpaceSchema>, Entity.Space.Space>;
|
|
7
7
|
export {};
|
package/build/tools/getSpace.js
CHANGED
|
@@ -1,13 +1,24 @@
|
|
|
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 getSpaceSchema = buildToolSchema((_t) => ({}));
|
|
5
5
|
export const getSpaceTool = (backlog, { t }) => {
|
|
6
6
|
return {
|
|
7
7
|
name: 'get_space',
|
|
8
8
|
description: t('TOOL_GET_SPACE_DESCRIPTION', 'Returns information about the Backlog space'),
|
|
9
9
|
schema: z.object(getSpaceSchema(t)),
|
|
10
|
-
|
|
10
|
+
returnsList: false,
|
|
11
|
+
outputFields: outputFields()([
|
|
12
|
+
'spaceKey',
|
|
13
|
+
'name',
|
|
14
|
+
'ownerId',
|
|
15
|
+
'lang',
|
|
16
|
+
'timezone',
|
|
17
|
+
'reportSendTime',
|
|
18
|
+
'textFormattingRule',
|
|
19
|
+
'created',
|
|
20
|
+
'updated',
|
|
21
|
+
]),
|
|
11
22
|
importantFields: ['spaceKey', 'name', 'lang', 'timezone'],
|
|
12
23
|
handler: async () => backlog.getSpace(),
|
|
13
24
|
};
|
|
@@ -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 { ActivitySchema } from '../types/zod/backlogOutputDefinition.js';
|
|
6
6
|
declare const getSpaceActivitiesSchema: (t: DescriptionHelper["t"]) => {
|
|
7
7
|
activityTypeId: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
8
8
|
Undefined: number;
|
|
@@ -41,5 +41,5 @@ declare const getSpaceActivitiesSchema: (t: DescriptionHelper["t"]) => {
|
|
|
41
41
|
desc: "desc";
|
|
42
42
|
}>>;
|
|
43
43
|
};
|
|
44
|
-
export declare const getSpaceActivitiesTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getSpaceActivitiesSchema>,
|
|
44
|
+
export declare const getSpaceActivitiesTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getSpaceActivitiesSchema>, Entity.Activity.Activity>;
|
|
45
45
|
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { buildToolSchema } from '../types/tool.js';
|
|
3
|
-
import {
|
|
3
|
+
import { outputFields } from '../types/outputFields.js';
|
|
4
|
+
import { ActivityTypeSchema } from '../types/zod/activityType.js';
|
|
4
5
|
const getSpaceActivitiesSchema = buildToolSchema((t) => ({
|
|
5
6
|
activityTypeId: z
|
|
6
7
|
.array(ActivityTypeSchema)
|
|
@@ -30,7 +31,16 @@ export const getSpaceActivitiesTool = (backlog, { t }) => {
|
|
|
30
31
|
name: 'get_space_activities',
|
|
31
32
|
description: t('TOOL_GET_SPACE_ACTIVITIES_DESCRIPTION', 'Returns list of space activities'),
|
|
32
33
|
schema: z.object(getSpaceActivitiesSchema(t)),
|
|
33
|
-
|
|
34
|
+
returnsList: true,
|
|
35
|
+
outputFields: outputFields()([
|
|
36
|
+
'id',
|
|
37
|
+
'project',
|
|
38
|
+
'type',
|
|
39
|
+
'content',
|
|
40
|
+
'notifications',
|
|
41
|
+
'createdUser',
|
|
42
|
+
'created',
|
|
43
|
+
]),
|
|
34
44
|
handler: async ({ activityTypeId, minId, maxId, count, order }) => backlog.getSpaceActivities({
|
|
35
45
|
activityTypeId,
|
|
36
46
|
minId,
|
|
@@ -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 { ActivitySchema } from '../types/zod/backlogOutputDefinition.js';
|
|
6
6
|
declare const getUserRecentUpdatesSchema: (t: DescriptionHelper["t"]) => {
|
|
7
7
|
userId: z.ZodNumber;
|
|
8
8
|
activityTypeId: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
@@ -42,5 +42,5 @@ declare const getUserRecentUpdatesSchema: (t: DescriptionHelper["t"]) => {
|
|
|
42
42
|
desc: "desc";
|
|
43
43
|
}>>>;
|
|
44
44
|
};
|
|
45
|
-
export declare const getUserRecentUpdatesTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getUserRecentUpdatesSchema>,
|
|
45
|
+
export declare const getUserRecentUpdatesTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getUserRecentUpdatesSchema>, Entity.Activity.Activity>;
|
|
46
46
|
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { buildToolSchema } from '../types/tool.js';
|
|
3
|
-
import {
|
|
3
|
+
import { outputFields } from '../types/outputFields.js';
|
|
4
|
+
import { ActivityTypeSchema } from '../types/zod/activityType.js';
|
|
4
5
|
const getUserRecentUpdatesSchema = buildToolSchema((t) => ({
|
|
5
6
|
userId: z
|
|
6
7
|
.number()
|
|
@@ -35,7 +36,16 @@ export const getUserRecentUpdatesTool = (backlog, { t }) => {
|
|
|
35
36
|
name: 'get_user_recent_updates',
|
|
36
37
|
description: t('TOOL_GET_USER_RECENT_UPDATES_DESCRIPTION', 'Returns recent updates (activities) for a specific user'),
|
|
37
38
|
schema: z.object(getUserRecentUpdatesSchema(t)),
|
|
38
|
-
|
|
39
|
+
returnsList: true,
|
|
40
|
+
outputFields: outputFields()([
|
|
41
|
+
'id',
|
|
42
|
+
'project',
|
|
43
|
+
'type',
|
|
44
|
+
'content',
|
|
45
|
+
'notifications',
|
|
46
|
+
'createdUser',
|
|
47
|
+
'created',
|
|
48
|
+
]),
|
|
39
49
|
importantFields: ['id', 'type', 'content', 'created'],
|
|
40
50
|
handler: async ({ userId, activityTypeId, minId, maxId, count, order }) => backlog.getUserActivities(userId, {
|
|
41
51
|
activityTypeId,
|
|
@@ -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 { StarCountSchema } from '../types/zod/backlogOutputDefinition.js';
|
|
6
6
|
declare const getUserStarsCountSchema: (t: DescriptionHelper["t"]) => {
|
|
7
7
|
userId: z.ZodNumber;
|
|
8
8
|
since: z.ZodOptional<z.ZodString>;
|
|
9
9
|
until: z.ZodOptional<z.ZodString>;
|
|
10
10
|
};
|
|
11
|
-
export declare const getUserStarsCountTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getUserStarsCountSchema>,
|
|
11
|
+
export declare const getUserStarsCountTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getUserStarsCountSchema>, Entity.Star.StarCount>;
|
|
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
|
const getUserStarsCountSchema = buildToolSchema((t) => ({
|
|
5
5
|
userId: z
|
|
6
6
|
.number()
|
|
@@ -19,7 +19,8 @@ export const getUserStarsCountTool = (backlog, { t }) => {
|
|
|
19
19
|
name: 'get_user_stars_count',
|
|
20
20
|
description: t('TOOL_GET_USER_STARS_COUNT_DESCRIPTION', 'Returns the count of stars received by a user'),
|
|
21
21
|
schema: z.object(getUserStarsCountSchema(t)),
|
|
22
|
-
|
|
22
|
+
returnsList: false,
|
|
23
|
+
outputFields: outputFields()(['count']),
|
|
23
24
|
handler: async ({ userId, since, until }) => backlog.getUserStarsCount(userId, { since, until }),
|
|
24
25
|
};
|
|
25
26
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import type { Entity } from 'backlog-js';
|
|
1
2
|
import { Backlog } from 'backlog-js';
|
|
2
3
|
import { ToolDefinition } from '../types/tool.js';
|
|
3
4
|
import { DescriptionHelper } from '../createDescriptionHelper.js';
|
|
4
|
-
import { UserSchema } from '../types/zod/backlogOutputDefinition.js';
|
|
5
5
|
declare const getUsersSchema: (t: DescriptionHelper["t"]) => {};
|
|
6
|
-
export declare const getUsersTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getUsersSchema>,
|
|
6
|
+
export declare const getUsersTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getUsersSchema>, Entity.User.User>;
|
|
7
7
|
export {};
|
package/build/tools/getUsers.js
CHANGED
|
@@ -1,13 +1,22 @@
|
|
|
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 getUsersSchema = buildToolSchema((_t) => ({}));
|
|
5
5
|
export const getUsersTool = (backlog, { t }) => {
|
|
6
6
|
return {
|
|
7
7
|
name: 'get_users',
|
|
8
8
|
description: t('TOOL_GET_USERS_DESCRIPTION', 'Returns list of users in the Backlog space'),
|
|
9
9
|
schema: z.object(getUsersSchema(t)),
|
|
10
|
-
|
|
10
|
+
returnsList: true,
|
|
11
|
+
outputFields: outputFields()([
|
|
12
|
+
'id',
|
|
13
|
+
'userId',
|
|
14
|
+
'name',
|
|
15
|
+
'roleType',
|
|
16
|
+
'lang',
|
|
17
|
+
'mailAddress',
|
|
18
|
+
'lastLoginTime',
|
|
19
|
+
]),
|
|
11
20
|
importantFields: ['userId', 'name', 'roleType', 'lang'],
|
|
12
21
|
handler: async () => backlog.getUsers(),
|
|
13
22
|
};
|
|
@@ -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 { VersionSchema } from '../types/zod/backlogOutputDefinition.js';
|
|
6
6
|
declare const getVersionMilestoneListSchema: (t: DescriptionHelper["t"]) => {
|
|
7
7
|
projectId: z.ZodOptional<z.ZodNumber>;
|
|
8
8
|
projectKey: z.ZodOptional<z.ZodString>;
|
|
9
9
|
};
|
|
10
|
-
export declare const getVersionMilestoneListTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getVersionMilestoneListSchema>,
|
|
10
|
+
export declare const getVersionMilestoneListTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getVersionMilestoneListSchema>, Entity.Project.Version>;
|
|
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 getVersionMilestoneListSchema = buildToolSchema((t) => ({
|
|
6
6
|
projectId: z
|
|
@@ -17,7 +17,17 @@ export const getVersionMilestoneListTool = (backlog, { t }) => {
|
|
|
17
17
|
name: 'get_version_milestone_list',
|
|
18
18
|
description: t('TOOL_GET_VERSION_MILESTONE_LIST_DESCRIPTION', 'Returns list of versions/milestones in the Backlog space'),
|
|
19
19
|
schema: z.object(getVersionMilestoneListSchema(t)),
|
|
20
|
-
|
|
20
|
+
returnsList: true,
|
|
21
|
+
outputFields: outputFields()([
|
|
22
|
+
'id',
|
|
23
|
+
'projectId',
|
|
24
|
+
'name',
|
|
25
|
+
'description',
|
|
26
|
+
'startDate',
|
|
27
|
+
'releaseDueDate',
|
|
28
|
+
'archived',
|
|
29
|
+
'displayOrder',
|
|
30
|
+
]),
|
|
21
31
|
importantFields: [
|
|
22
32
|
'id',
|
|
23
33
|
'name',
|
|
@@ -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 { WatchingListCountSchema } from '../types/zod/backlogOutputDefinition.js';
|
|
6
6
|
declare const getWatchingListCountSchema: (t: DescriptionHelper["t"]) => {
|
|
7
7
|
userId: z.ZodNumber;
|
|
8
8
|
};
|
|
9
|
-
export declare const getWatchingListCountTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getWatchingListCountSchema>,
|
|
9
|
+
export declare const getWatchingListCountTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getWatchingListCountSchema>, Entity.WatchingList.WatchingListCount>;
|
|
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 getWatchingListCountSchema = buildToolSchema((t) => ({
|
|
5
5
|
userId: z
|
|
6
6
|
.number()
|
|
@@ -11,7 +11,10 @@ export const getWatchingListCountTool = (backlog, { t }) => {
|
|
|
11
11
|
name: 'get_watching_list_count',
|
|
12
12
|
description: t('TOOL_GET_WATCHING_LIST_COUNT_DESCRIPTION', 'Returns count of watching items for a user'),
|
|
13
13
|
schema: z.object(getWatchingListCountSchema(t)),
|
|
14
|
-
|
|
14
|
+
returnsList: false,
|
|
15
|
+
outputFields: outputFields()([
|
|
16
|
+
'count',
|
|
17
|
+
]),
|
|
15
18
|
handler: async ({ userId }) => backlog.getWatchingListCount(userId),
|
|
16
19
|
};
|
|
17
20
|
};
|
|
@@ -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 getWatchingListItemsSchema: (t: DescriptionHelper["t"]) => {
|
|
7
7
|
userId: z.ZodNumber;
|
|
8
8
|
};
|
|
9
|
-
export declare const getWatchingListItemsTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getWatchingListItemsSchema>,
|
|
9
|
+
export declare const getWatchingListItemsTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getWatchingListItemsSchema>, 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 getWatchingListItemsSchema = buildToolSchema((t) => ({
|
|
5
5
|
userId: z
|
|
6
6
|
.number()
|
|
@@ -11,7 +11,17 @@ export const getWatchingListItemsTool = (backlog, { t }) => {
|
|
|
11
11
|
name: 'get_watching_list_items',
|
|
12
12
|
description: t('TOOL_GET_WATCHING_LIST_ITEMS_DESCRIPTION', 'Returns list of watching items for a user'),
|
|
13
13
|
schema: z.object(getWatchingListItemsSchema(t)),
|
|
14
|
-
|
|
14
|
+
returnsList: true,
|
|
15
|
+
outputFields: outputFields()([
|
|
16
|
+
'id',
|
|
17
|
+
'resourceAlreadyRead',
|
|
18
|
+
'note',
|
|
19
|
+
'type',
|
|
20
|
+
'issue',
|
|
21
|
+
'lastContentUpdated',
|
|
22
|
+
'created',
|
|
23
|
+
'updated',
|
|
24
|
+
]),
|
|
15
25
|
handler: async ({ userId }) => backlog.getWatchingListItems(userId),
|
|
16
26
|
};
|
|
17
27
|
};
|
package/build/tools/getWiki.d.ts
CHANGED
|
@@ -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 { WikiSchema } from '../types/zod/backlogOutputDefinition.js';
|
|
6
6
|
declare const getWikiSchema: (t: DescriptionHelper["t"]) => {
|
|
7
7
|
wikiId: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
8
8
|
};
|
|
9
|
-
export declare const getWikiTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getWikiSchema>,
|
|
9
|
+
export declare const getWikiTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getWikiSchema>, Entity.Wiki.Wiki>;
|
|
10
10
|
export {};
|
package/build/tools/getWiki.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 getWikiSchema = buildToolSchema((t) => ({
|
|
5
5
|
wikiId: z
|
|
6
6
|
.union([z.string(), z.number()])
|
|
@@ -11,7 +11,21 @@ export const getWikiTool = (backlog, { t }) => {
|
|
|
11
11
|
name: 'get_wiki',
|
|
12
12
|
description: t('TOOL_GET_WIKI_DESCRIPTION', 'Returns information about a specific wiki page'),
|
|
13
13
|
schema: z.object(getWikiSchema(t)),
|
|
14
|
-
|
|
14
|
+
returnsList: false,
|
|
15
|
+
outputFields: outputFields()([
|
|
16
|
+
'id',
|
|
17
|
+
'projectId',
|
|
18
|
+
'name',
|
|
19
|
+
'content',
|
|
20
|
+
'tags',
|
|
21
|
+
'attachments',
|
|
22
|
+
'sharedFiles',
|
|
23
|
+
'stars',
|
|
24
|
+
'createdUser',
|
|
25
|
+
'created',
|
|
26
|
+
'updatedUser',
|
|
27
|
+
'updated',
|
|
28
|
+
]),
|
|
15
29
|
importantFields: ['id', 'projectId', 'name', 'content'],
|
|
16
30
|
handler: async ({ wikiId }) => {
|
|
17
31
|
const wikiIdNumber = typeof wikiId === 'string' ? parseInt(wikiId, 10) : wikiId;
|
|
@@ -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 { WikiListItemSchema } from '../types/zod/backlogOutputDefinition.js';
|
|
6
6
|
declare const getWikiPagesSchema: (t: DescriptionHelper["t"]) => {
|
|
7
7
|
projectId: z.ZodOptional<z.ZodNumber>;
|
|
8
8
|
projectKey: z.ZodOptional<z.ZodString>;
|
|
9
9
|
keyword: z.ZodOptional<z.ZodString>;
|
|
10
10
|
};
|
|
11
|
-
export declare const getWikiPagesTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getWikiPagesSchema>,
|
|
11
|
+
export declare const getWikiPagesTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getWikiPagesSchema>, Entity.Wiki.WikiListItem>;
|
|
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 getWikiPagesSchema = buildToolSchema((t) => ({
|
|
6
6
|
projectId: z
|
|
@@ -21,7 +21,17 @@ export const getWikiPagesTool = (backlog, { t }) => {
|
|
|
21
21
|
name: 'get_wiki_pages',
|
|
22
22
|
description: t('TOOL_GET_WIKI_PAGES_DESCRIPTION', 'Returns list of Wiki pages'),
|
|
23
23
|
schema: z.object(getWikiPagesSchema(t)),
|
|
24
|
-
|
|
24
|
+
returnsList: true,
|
|
25
|
+
outputFields: outputFields()([
|
|
26
|
+
'id',
|
|
27
|
+
'projectId',
|
|
28
|
+
'name',
|
|
29
|
+
'tags',
|
|
30
|
+
'createdUser',
|
|
31
|
+
'created',
|
|
32
|
+
'updatedUser',
|
|
33
|
+
'updated',
|
|
34
|
+
]),
|
|
25
35
|
importantFields: ['projectId', 'name', 'tags'],
|
|
26
36
|
handler: async ({ projectId, projectKey, keyword }) => {
|
|
27
37
|
const result = resolveIdOrKey('project', { id: projectId, key: projectKey }, t);
|
|
@@ -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 { WikiCountSchema } from '../types/zod/backlogOutputDefinition.js';
|
|
6
6
|
declare const getWikisCountSchema: (t: DescriptionHelper["t"]) => {
|
|
7
7
|
projectId: z.ZodOptional<z.ZodNumber>;
|
|
8
8
|
projectKey: z.ZodOptional<z.ZodString>;
|
|
9
9
|
};
|
|
10
|
-
export declare const getWikisCountTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getWikisCountSchema>,
|
|
10
|
+
export declare const getWikisCountTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getWikisCountSchema>, Entity.Wiki.WikiCount>;
|
|
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 getWikisCountSchema = buildToolSchema((t) => ({
|
|
6
6
|
projectId: z
|
|
@@ -17,7 +17,8 @@ export const getWikisCountTool = (backlog, { t }) => {
|
|
|
17
17
|
name: 'get_wikis_count',
|
|
18
18
|
description: t('TOOL_GET_WIKIS_COUNT_DESCRIPTION', 'Returns count of wiki pages in a project'),
|
|
19
19
|
schema: z.object(getWikisCountSchema(t)),
|
|
20
|
-
|
|
20
|
+
returnsList: false,
|
|
21
|
+
outputFields: outputFields()(['count']),
|
|
21
22
|
handler: async ({ projectId, projectKey }) => {
|
|
22
23
|
const result = resolveIdOrKey('project', { id: projectId, key: projectKey }, t);
|
|
23
24
|
if (!result.ok) {
|