@opentabs-dev/opentabs-plugin-linear 0.0.74
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapter.iife.js +15582 -0
- package/dist/adapter.iife.js.map +7 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +60 -0
- package/dist/index.js.map +1 -0
- package/dist/linear-api.d.ts +4 -0
- package/dist/linear-api.d.ts.map +1 -0
- package/dist/linear-api.js +144 -0
- package/dist/linear-api.js.map +1 -0
- package/dist/tools/archive-issue.d.ts +7 -0
- package/dist/tools/archive-issue.d.ts.map +1 -0
- package/dist/tools/archive-issue.js +28 -0
- package/dist/tools/archive-issue.js.map +1 -0
- package/dist/tools/create-comment.d.ts +15 -0
- package/dist/tools/create-comment.d.ts.map +1 -0
- package/dist/tools/create-comment.js +34 -0
- package/dist/tools/create-comment.js.map +1 -0
- package/dist/tools/create-issue.d.ts +38 -0
- package/dist/tools/create-issue.d.ts.map +1 -0
- package/dist/tools/create-issue.js +77 -0
- package/dist/tools/create-issue.js.map +1 -0
- package/dist/tools/create-label.d.ts +17 -0
- package/dist/tools/create-label.d.ts.map +1 -0
- package/dist/tools/create-label.js +47 -0
- package/dist/tools/create-label.js.map +1 -0
- package/dist/tools/create-project.d.ts +22 -0
- package/dist/tools/create-project.d.ts.map +1 -0
- package/dist/tools/create-project.js +52 -0
- package/dist/tools/create-project.js.map +1 -0
- package/dist/tools/delete-issue.d.ts +7 -0
- package/dist/tools/delete-issue.d.ts.map +1 -0
- package/dist/tools/delete-issue.js +28 -0
- package/dist/tools/delete-issue.js.map +1 -0
- package/dist/tools/get-issue.d.ts +27 -0
- package/dist/tools/get-issue.d.ts.map +1 -0
- package/dist/tools/get-issue.js +59 -0
- package/dist/tools/get-issue.js.map +1 -0
- package/dist/tools/get-project.d.ts +18 -0
- package/dist/tools/get-project.d.ts.map +1 -0
- package/dist/tools/get-project.js +30 -0
- package/dist/tools/get-project.js.map +1 -0
- package/dist/tools/get-viewer.d.ts +14 -0
- package/dist/tools/get-viewer.d.ts.map +1 -0
- package/dist/tools/get-viewer.js +32 -0
- package/dist/tools/get-viewer.js.map +1 -0
- package/dist/tools/list-comments.d.ts +20 -0
- package/dist/tools/list-comments.d.ts.map +1 -0
- package/dist/tools/list-comments.js +46 -0
- package/dist/tools/list-comments.js.map +1 -0
- package/dist/tools/list-cycles.d.ts +21 -0
- package/dist/tools/list-cycles.d.ts.map +1 -0
- package/dist/tools/list-cycles.js +45 -0
- package/dist/tools/list-cycles.js.map +1 -0
- package/dist/tools/list-issue-relations.d.ts +16 -0
- package/dist/tools/list-issue-relations.d.ts.map +1 -0
- package/dist/tools/list-issue-relations.js +77 -0
- package/dist/tools/list-issue-relations.js.map +1 -0
- package/dist/tools/list-labels.d.ts +12 -0
- package/dist/tools/list-labels.d.ts.map +1 -0
- package/dist/tools/list-labels.js +30 -0
- package/dist/tools/list-labels.js.map +1 -0
- package/dist/tools/list-projects.d.ts +23 -0
- package/dist/tools/list-projects.d.ts.map +1 -0
- package/dist/tools/list-projects.js +45 -0
- package/dist/tools/list-projects.js.map +1 -0
- package/dist/tools/list-teams.d.ts +10 -0
- package/dist/tools/list-teams.d.ts.map +1 -0
- package/dist/tools/list-teams.js +29 -0
- package/dist/tools/list-teams.js.map +1 -0
- package/dist/tools/list-users.d.ts +19 -0
- package/dist/tools/list-users.d.ts.map +1 -0
- package/dist/tools/list-users.js +42 -0
- package/dist/tools/list-users.js.map +1 -0
- package/dist/tools/list-workflow-states.d.ts +13 -0
- package/dist/tools/list-workflow-states.d.ts.map +1 -0
- package/dist/tools/list-workflow-states.js +36 -0
- package/dist/tools/list-workflow-states.js.map +1 -0
- package/dist/tools/schemas.d.ts +269 -0
- package/dist/tools/schemas.d.ts.map +1 -0
- package/dist/tools/schemas.js +165 -0
- package/dist/tools/schemas.js.map +1 -0
- package/dist/tools/search-issues.d.ts +40 -0
- package/dist/tools/search-issues.d.ts.map +1 -0
- package/dist/tools/search-issues.js +95 -0
- package/dist/tools/search-issues.js.map +1 -0
- package/dist/tools/update-comment.d.ts +15 -0
- package/dist/tools/update-comment.d.ts.map +1 -0
- package/dist/tools/update-comment.js +36 -0
- package/dist/tools/update-comment.js.map +1 -0
- package/dist/tools/update-issue.d.ts +39 -0
- package/dist/tools/update-issue.d.ts.map +1 -0
- package/dist/tools/update-issue.js +76 -0
- package/dist/tools/update-issue.js.map +1 -0
- package/dist/tools/update-project.d.ts +23 -0
- package/dist/tools/update-project.d.ts.map +1 -0
- package/dist/tools/update-project.js +53 -0
- package/dist/tools/update-project.js.map +1 -0
- package/dist/tools.json +2064 -0
- package/package.json +55 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { graphql } from '../linear-api.js';
|
|
2
|
+
import { ToolError, defineTool } from '@opentabs-dev/plugin-sdk';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
import { mapProject, paginationSchema, projectSchema } from './schemas.js';
|
|
5
|
+
export const listProjects = defineTool({
|
|
6
|
+
name: 'list_projects',
|
|
7
|
+
displayName: 'List Projects',
|
|
8
|
+
description: 'List all projects in the Linear workspace. Supports pagination.',
|
|
9
|
+
summary: 'List all projects',
|
|
10
|
+
icon: 'folder',
|
|
11
|
+
group: 'Projects',
|
|
12
|
+
input: z.object({
|
|
13
|
+
limit: z.number().optional().describe('Maximum number of projects to return (default 25, max 50)'),
|
|
14
|
+
after: z.string().optional().describe('Pagination cursor from a previous response'),
|
|
15
|
+
}),
|
|
16
|
+
output: z.object({
|
|
17
|
+
projects: z.array(projectSchema).describe('List of projects'),
|
|
18
|
+
pagination: paginationSchema.describe('Pagination info for fetching more results'),
|
|
19
|
+
}),
|
|
20
|
+
handle: async (params) => {
|
|
21
|
+
const limit = Math.min(params.limit ?? 25, 50);
|
|
22
|
+
const data = await graphql(`query ListProjects($first: Int, $after: String) {
|
|
23
|
+
projects(first: $first, after: $after, orderBy: updatedAt) {
|
|
24
|
+
nodes {
|
|
25
|
+
id name description url createdAt updatedAt
|
|
26
|
+
targetDate startDate
|
|
27
|
+
status { name }
|
|
28
|
+
lead { name displayName }
|
|
29
|
+
}
|
|
30
|
+
pageInfo { hasNextPage endCursor }
|
|
31
|
+
}
|
|
32
|
+
}`, { first: limit, after: params.after });
|
|
33
|
+
if (!data.projects)
|
|
34
|
+
throw ToolError.internal('Projects query returned no results object');
|
|
35
|
+
const result = data.projects;
|
|
36
|
+
return {
|
|
37
|
+
projects: result.nodes.map(n => mapProject(n)),
|
|
38
|
+
pagination: {
|
|
39
|
+
has_next_page: result.pageInfo?.hasNextPage ?? false,
|
|
40
|
+
end_cursor: result.pageInfo?.endCursor ?? '',
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
},
|
|
44
|
+
});
|
|
45
|
+
//# sourceMappingURL=list-projects.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-projects.js","sourceRoot":"","sources":["../../src/tools/list-projects.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE3E,MAAM,CAAC,MAAM,YAAY,GAAG,UAAU,CAAC;IACrC,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE,eAAe;IAC5B,WAAW,EAAE,iEAAiE;IAC9E,OAAO,EAAE,mBAAmB;IAC5B,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,UAAU;IACjB,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,2DAA2D,CAAC;QAClG,KAAK,EAAE,CAAC,CAAC,MAAM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|
|
5
|
+
key: z.ZodString;
|
|
6
|
+
name: z.ZodString;
|
|
7
|
+
description: z.ZodString;
|
|
8
|
+
}, z.core.$strip>>;
|
|
9
|
+
}, z.core.$strip>>;
|
|
10
|
+
//# sourceMappingURL=list-teams.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-teams.d.ts","sourceRoot":"","sources":["../../src/tools/list-teams.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,SAAS;;;;;;;kBA4BpB,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { graphql } from '../linear-api.js';
|
|
2
|
+
import { defineTool } from '@opentabs-dev/plugin-sdk';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
import { mapTeam, teamSchema } from './schemas.js';
|
|
5
|
+
export const listTeams = defineTool({
|
|
6
|
+
name: 'list_teams',
|
|
7
|
+
displayName: 'List Teams',
|
|
8
|
+
description: 'List all teams in the Linear workspace that the current user can access.',
|
|
9
|
+
summary: 'List teams in the workspace',
|
|
10
|
+
icon: 'users',
|
|
11
|
+
group: 'Teams & Users',
|
|
12
|
+
input: z.object({}),
|
|
13
|
+
output: z.object({
|
|
14
|
+
teams: z.array(teamSchema).describe('List of teams'),
|
|
15
|
+
}),
|
|
16
|
+
handle: async () => {
|
|
17
|
+
const data = await graphql(`query ListTeams {
|
|
18
|
+
teams {
|
|
19
|
+
nodes {
|
|
20
|
+
id key name description
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}`);
|
|
24
|
+
return {
|
|
25
|
+
teams: data.teams.nodes.map(n => mapTeam(n)),
|
|
26
|
+
};
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
//# sourceMappingURL=list-teams.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-teams.js","sourceRoot":"","sources":["../../src/tools/list-teams.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAEnD,MAAM,CAAC,MAAM,SAAS,GAAG,UAAU,CAAC;IAClC,IAAI,EAAE,YAAY;IAClB,WAAW,EAAE,YAAY;IACzB,WAAW,EAAE,0EAA0E;IACvF,OAAO,EAAE,6BAA6B;IACtC,IAAI,EAAE,OAAO;IACb,KAAK,EAAE,eAAe;IACtB,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC;IACnB,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,QAAQ,CAAC,eAAe,CAAC;KACrD,CAAC;IACF,MAAM,EAAE,KAAK,IAAI,EAAE;QACjB,MAAM,IAAI,GAAG,MAAM,OAAO,CAGxB;;;;;;QAME,CACH,CAAC;QAEF,OAAO;YACL,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,CAAkC,CAAC,CAAC;SAC9E,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const listUsers: import("@opentabs-dev/plugin-sdk").ToolDefinition<z.ZodObject<{
|
|
3
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
4
|
+
after: z.ZodOptional<z.ZodString>;
|
|
5
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
6
|
+
users: z.ZodArray<z.ZodObject<{
|
|
7
|
+
id: z.ZodString;
|
|
8
|
+
name: z.ZodString;
|
|
9
|
+
email: z.ZodString;
|
|
10
|
+
display_name: z.ZodString;
|
|
11
|
+
active: z.ZodBoolean;
|
|
12
|
+
admin: z.ZodBoolean;
|
|
13
|
+
}, z.core.$strip>>;
|
|
14
|
+
pagination: z.ZodObject<{
|
|
15
|
+
has_next_page: z.ZodBoolean;
|
|
16
|
+
end_cursor: z.ZodString;
|
|
17
|
+
}, z.core.$strip>;
|
|
18
|
+
}, z.core.$strip>>;
|
|
19
|
+
//# sourceMappingURL=list-users.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-users.d.ts","sourceRoot":"","sources":["../../src/tools/list-users.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;kBA6CpB,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { graphql } from '../linear-api.js';
|
|
2
|
+
import { ToolError, defineTool } from '@opentabs-dev/plugin-sdk';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
import { mapUser, paginationSchema, userSchema } from './schemas.js';
|
|
5
|
+
export const listUsers = defineTool({
|
|
6
|
+
name: 'list_users',
|
|
7
|
+
displayName: 'List Users',
|
|
8
|
+
description: 'List all users in the Linear organization. Use this to find user IDs for assigning issues.',
|
|
9
|
+
summary: 'List all users in the organization',
|
|
10
|
+
icon: 'users',
|
|
11
|
+
group: 'Teams & Users',
|
|
12
|
+
input: z.object({
|
|
13
|
+
limit: z.number().optional().describe('Maximum number of users to return (default 50, max 100)'),
|
|
14
|
+
after: z.string().optional().describe('Pagination cursor from a previous response'),
|
|
15
|
+
}),
|
|
16
|
+
output: z.object({
|
|
17
|
+
users: z.array(userSchema).describe('List of users'),
|
|
18
|
+
pagination: paginationSchema.describe('Pagination info for fetching more results'),
|
|
19
|
+
}),
|
|
20
|
+
handle: async (params) => {
|
|
21
|
+
const limit = Math.min(params.limit ?? 50, 100);
|
|
22
|
+
const data = await graphql(`query ListUsers($first: Int, $after: String) {
|
|
23
|
+
users(first: $first, after: $after) {
|
|
24
|
+
nodes {
|
|
25
|
+
id name email displayName active admin
|
|
26
|
+
}
|
|
27
|
+
pageInfo { hasNextPage endCursor }
|
|
28
|
+
}
|
|
29
|
+
}`, { first: limit, after: params.after });
|
|
30
|
+
if (!data.users)
|
|
31
|
+
throw ToolError.internal('Users query returned no results object');
|
|
32
|
+
const result = data.users;
|
|
33
|
+
return {
|
|
34
|
+
users: result.nodes.map(n => mapUser(n)),
|
|
35
|
+
pagination: {
|
|
36
|
+
has_next_page: result.pageInfo?.hasNextPage ?? false,
|
|
37
|
+
end_cursor: result.pageInfo?.endCursor ?? '',
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
//# sourceMappingURL=list-users.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-users.js","sourceRoot":"","sources":["../../src/tools/list-users.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAErE,MAAM,CAAC,MAAM,SAAS,GAAG,UAAU,CAAC;IAClC,IAAI,EAAE,YAAY;IAClB,WAAW,EAAE,YAAY;IACzB,WAAW,EAAE,4FAA4F;IACzG,OAAO,EAAE,oCAAoC;IAC7C,IAAI,EAAE,OAAO;IACb,KAAK,EAAE,eAAe;IACtB,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,yDAAyD,CAAC;QAChG,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,4CAA4C,CAAC;KACpF,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,QAAQ,CAAC,eAAe,CAAC;QACpD,UAAU,EAAE,gBAAgB,CAAC,QAAQ,CAAC,2CAA2C,CAAC;KACnF,CAAC;IACF,MAAM,EAAE,KAAK,EAAC,MAAM,EAAC,EAAE;QACrB,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,IAAI,EAAE,EAAE,GAAG,CAAC,CAAC;QAEhD,MAAM,IAAI,GAAG,MAAM,OAAO,CAMxB;;;;;;;QAOE,EACF,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,CACtC,CAAC;QAEF,IAAI,CAAC,IAAI,CAAC,KAAK;YAAE,MAAM,SAAS,CAAC,QAAQ,CAAC,wCAAwC,CAAC,CAAC;QACpF,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC;QAC1B,OAAO;YACL,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,CAAkC,CAAC,CAAC;YACzE,UAAU,EAAE;gBACV,aAAa,EAAE,MAAM,CAAC,QAAQ,EAAE,WAAW,IAAI,KAAK;gBACpD,UAAU,EAAE,MAAM,CAAC,QAAQ,EAAE,SAAS,IAAI,EAAE;aAC7C;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const listWorkflowStates: import("@opentabs-dev/plugin-sdk").ToolDefinition<z.ZodObject<{
|
|
3
|
+
team_id: z.ZodString;
|
|
4
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
5
|
+
states: z.ZodArray<z.ZodObject<{
|
|
6
|
+
id: z.ZodString;
|
|
7
|
+
name: z.ZodString;
|
|
8
|
+
type: z.ZodString;
|
|
9
|
+
color: z.ZodString;
|
|
10
|
+
position: z.ZodNumber;
|
|
11
|
+
}, z.core.$strip>>;
|
|
12
|
+
}, z.core.$strip>>;
|
|
13
|
+
//# sourceMappingURL=list-workflow-states.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-workflow-states.d.ts","sourceRoot":"","sources":["../../src/tools/list-workflow-states.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,kBAAkB;;;;;;;;;;kBAuC7B,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { graphql } from '../linear-api.js';
|
|
2
|
+
import { ToolError, defineTool } from '@opentabs-dev/plugin-sdk';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
import { mapWorkflowState, workflowStateSchema } from './schemas.js';
|
|
5
|
+
export const listWorkflowStates = defineTool({
|
|
6
|
+
name: 'list_workflow_states',
|
|
7
|
+
displayName: 'List Workflow States',
|
|
8
|
+
description: 'List all workflow states for a team. Use this to find state IDs for filtering issues or updating issue state.',
|
|
9
|
+
summary: 'List workflow states for a team',
|
|
10
|
+
icon: 'git-branch',
|
|
11
|
+
group: 'Workflow',
|
|
12
|
+
input: z.object({
|
|
13
|
+
team_id: z.string().describe('Team UUID to list workflow states for (use list_teams to find IDs)'),
|
|
14
|
+
}),
|
|
15
|
+
output: z.object({
|
|
16
|
+
states: z.array(workflowStateSchema).describe('List of workflow states ordered by position'),
|
|
17
|
+
}),
|
|
18
|
+
handle: async (params) => {
|
|
19
|
+
const data = await graphql(`query ListWorkflowStates($id: String!) {
|
|
20
|
+
team(id: $id) {
|
|
21
|
+
states {
|
|
22
|
+
nodes {
|
|
23
|
+
id name type color position
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}`, { id: params.team_id });
|
|
28
|
+
if (!data.team)
|
|
29
|
+
throw ToolError.notFound('Team not found');
|
|
30
|
+
const nodes = data.team.states.nodes
|
|
31
|
+
.map(n => mapWorkflowState(n))
|
|
32
|
+
.sort((a, b) => a.position - b.position);
|
|
33
|
+
return { states: nodes };
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
//# sourceMappingURL=list-workflow-states.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-workflow-states.js","sourceRoot":"","sources":["../../src/tools/list-workflow-states.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAErE,MAAM,CAAC,MAAM,kBAAkB,GAAG,UAAU,CAAC;IAC3C,IAAI,EAAE,sBAAsB;IAC5B,WAAW,EAAE,sBAAsB;IACnC,WAAW,EACT,+GAA+G;IACjH,OAAO,EAAE,iCAAiC;IAC1C,IAAI,EAAE,YAAY;IAClB,KAAK,EAAE,UAAU;IACjB,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,oEAAoE,CAAC;KACnG,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC,QAAQ,CAAC,6CAA6C,CAAC;KAC7F,CAAC;IACF,MAAM,EAAE,KAAK,EAAC,MAAM,EAAC,EAAE;QACrB,MAAM,IAAI,GAAG,MAAM,OAAO,CAKxB;;;;;;;;QAQE,EACF,EAAE,EAAE,EAAE,MAAM,CAAC,OAAO,EAAE,CACvB,CAAC;QAEF,IAAI,CAAC,IAAI,CAAC,IAAI;YAAE,MAAM,SAAS,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC;QAC3D,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK;aACjC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,gBAAgB,CAAC,CAA2C,CAAC,CAAC;aACvE,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAC;QAE3C,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;IAC3B,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const issueSchema: z.ZodObject<{
|
|
3
|
+
id: z.ZodString;
|
|
4
|
+
identifier: z.ZodString;
|
|
5
|
+
title: z.ZodString;
|
|
6
|
+
description: z.ZodString;
|
|
7
|
+
priority: z.ZodNumber;
|
|
8
|
+
priority_label: z.ZodString;
|
|
9
|
+
state_name: z.ZodString;
|
|
10
|
+
state_type: z.ZodString;
|
|
11
|
+
assignee_name: z.ZodString;
|
|
12
|
+
team_key: z.ZodString;
|
|
13
|
+
team_name: z.ZodString;
|
|
14
|
+
label_names: z.ZodArray<z.ZodString>;
|
|
15
|
+
project_name: z.ZodString;
|
|
16
|
+
cycle_number: z.ZodNumber;
|
|
17
|
+
due_date: z.ZodString;
|
|
18
|
+
estimate: z.ZodNumber;
|
|
19
|
+
url: z.ZodString;
|
|
20
|
+
created_at: z.ZodString;
|
|
21
|
+
updated_at: z.ZodString;
|
|
22
|
+
}, z.core.$strip>;
|
|
23
|
+
export declare const commentSchema: z.ZodObject<{
|
|
24
|
+
id: z.ZodString;
|
|
25
|
+
body: z.ZodString;
|
|
26
|
+
user_name: z.ZodString;
|
|
27
|
+
created_at: z.ZodString;
|
|
28
|
+
updated_at: z.ZodString;
|
|
29
|
+
edited_at: z.ZodString;
|
|
30
|
+
}, z.core.$strip>;
|
|
31
|
+
export declare const projectSchema: z.ZodObject<{
|
|
32
|
+
id: z.ZodString;
|
|
33
|
+
name: z.ZodString;
|
|
34
|
+
description: z.ZodString;
|
|
35
|
+
state: z.ZodString;
|
|
36
|
+
lead_name: z.ZodString;
|
|
37
|
+
target_date: z.ZodString;
|
|
38
|
+
start_date: z.ZodString;
|
|
39
|
+
url: z.ZodString;
|
|
40
|
+
created_at: z.ZodString;
|
|
41
|
+
updated_at: z.ZodString;
|
|
42
|
+
}, z.core.$strip>;
|
|
43
|
+
export declare const teamSchema: z.ZodObject<{
|
|
44
|
+
id: z.ZodString;
|
|
45
|
+
key: z.ZodString;
|
|
46
|
+
name: z.ZodString;
|
|
47
|
+
description: z.ZodString;
|
|
48
|
+
}, z.core.$strip>;
|
|
49
|
+
export declare const workflowStateSchema: z.ZodObject<{
|
|
50
|
+
id: z.ZodString;
|
|
51
|
+
name: z.ZodString;
|
|
52
|
+
type: z.ZodString;
|
|
53
|
+
color: z.ZodString;
|
|
54
|
+
position: z.ZodNumber;
|
|
55
|
+
}, z.core.$strip>;
|
|
56
|
+
export declare const labelSchema: z.ZodObject<{
|
|
57
|
+
id: z.ZodString;
|
|
58
|
+
name: z.ZodString;
|
|
59
|
+
color: z.ZodString;
|
|
60
|
+
description: z.ZodString;
|
|
61
|
+
is_group: z.ZodBoolean;
|
|
62
|
+
parent_name: z.ZodString;
|
|
63
|
+
}, z.core.$strip>;
|
|
64
|
+
export declare const userSchema: z.ZodObject<{
|
|
65
|
+
id: z.ZodString;
|
|
66
|
+
name: z.ZodString;
|
|
67
|
+
email: z.ZodString;
|
|
68
|
+
display_name: z.ZodString;
|
|
69
|
+
active: z.ZodBoolean;
|
|
70
|
+
admin: z.ZodBoolean;
|
|
71
|
+
}, z.core.$strip>;
|
|
72
|
+
export declare const cycleSchema: z.ZodObject<{
|
|
73
|
+
id: z.ZodString;
|
|
74
|
+
number: z.ZodNumber;
|
|
75
|
+
name: z.ZodString;
|
|
76
|
+
starts_at: z.ZodString;
|
|
77
|
+
ends_at: z.ZodString;
|
|
78
|
+
is_active: z.ZodBoolean;
|
|
79
|
+
completed_at: z.ZodString;
|
|
80
|
+
}, z.core.$strip>;
|
|
81
|
+
export declare const paginationSchema: z.ZodObject<{
|
|
82
|
+
has_next_page: z.ZodBoolean;
|
|
83
|
+
end_cursor: z.ZodString;
|
|
84
|
+
}, z.core.$strip>;
|
|
85
|
+
interface RawIssue {
|
|
86
|
+
id?: string;
|
|
87
|
+
identifier?: string;
|
|
88
|
+
title?: string;
|
|
89
|
+
description?: string;
|
|
90
|
+
priority?: number;
|
|
91
|
+
priorityLabel?: string;
|
|
92
|
+
state?: {
|
|
93
|
+
name?: string;
|
|
94
|
+
type?: string;
|
|
95
|
+
};
|
|
96
|
+
assignee?: {
|
|
97
|
+
name?: string;
|
|
98
|
+
displayName?: string;
|
|
99
|
+
};
|
|
100
|
+
team?: {
|
|
101
|
+
key?: string;
|
|
102
|
+
name?: string;
|
|
103
|
+
};
|
|
104
|
+
labels?: {
|
|
105
|
+
nodes?: Array<{
|
|
106
|
+
name?: string;
|
|
107
|
+
}>;
|
|
108
|
+
};
|
|
109
|
+
project?: {
|
|
110
|
+
name?: string;
|
|
111
|
+
};
|
|
112
|
+
cycle?: {
|
|
113
|
+
number?: number;
|
|
114
|
+
};
|
|
115
|
+
dueDate?: string;
|
|
116
|
+
estimate?: number;
|
|
117
|
+
url?: string;
|
|
118
|
+
createdAt?: string;
|
|
119
|
+
updatedAt?: string;
|
|
120
|
+
}
|
|
121
|
+
export declare const mapIssue: (i: RawIssue | undefined) => {
|
|
122
|
+
id: string;
|
|
123
|
+
identifier: string;
|
|
124
|
+
title: string;
|
|
125
|
+
description: string;
|
|
126
|
+
priority: number;
|
|
127
|
+
priority_label: string;
|
|
128
|
+
state_name: string;
|
|
129
|
+
state_type: string;
|
|
130
|
+
assignee_name: string;
|
|
131
|
+
team_key: string;
|
|
132
|
+
team_name: string;
|
|
133
|
+
label_names: string[];
|
|
134
|
+
project_name: string;
|
|
135
|
+
cycle_number: number;
|
|
136
|
+
due_date: string;
|
|
137
|
+
estimate: number;
|
|
138
|
+
url: string;
|
|
139
|
+
created_at: string;
|
|
140
|
+
updated_at: string;
|
|
141
|
+
};
|
|
142
|
+
interface RawComment {
|
|
143
|
+
id?: string;
|
|
144
|
+
body?: string;
|
|
145
|
+
user?: {
|
|
146
|
+
name?: string;
|
|
147
|
+
displayName?: string;
|
|
148
|
+
};
|
|
149
|
+
createdAt?: string;
|
|
150
|
+
updatedAt?: string;
|
|
151
|
+
editedAt?: string;
|
|
152
|
+
}
|
|
153
|
+
export declare const mapComment: (c: RawComment | undefined) => {
|
|
154
|
+
id: string;
|
|
155
|
+
body: string;
|
|
156
|
+
user_name: string;
|
|
157
|
+
created_at: string;
|
|
158
|
+
updated_at: string;
|
|
159
|
+
edited_at: string;
|
|
160
|
+
};
|
|
161
|
+
interface RawProject {
|
|
162
|
+
id?: string;
|
|
163
|
+
name?: string;
|
|
164
|
+
description?: string;
|
|
165
|
+
status?: {
|
|
166
|
+
name?: string;
|
|
167
|
+
};
|
|
168
|
+
lead?: {
|
|
169
|
+
name?: string;
|
|
170
|
+
displayName?: string;
|
|
171
|
+
};
|
|
172
|
+
targetDate?: string;
|
|
173
|
+
startDate?: string;
|
|
174
|
+
url?: string;
|
|
175
|
+
createdAt?: string;
|
|
176
|
+
updatedAt?: string;
|
|
177
|
+
}
|
|
178
|
+
export declare const mapProject: (p: RawProject | undefined) => {
|
|
179
|
+
id: string;
|
|
180
|
+
name: string;
|
|
181
|
+
description: string;
|
|
182
|
+
state: string;
|
|
183
|
+
lead_name: string;
|
|
184
|
+
target_date: string;
|
|
185
|
+
start_date: string;
|
|
186
|
+
url: string;
|
|
187
|
+
created_at: string;
|
|
188
|
+
updated_at: string;
|
|
189
|
+
};
|
|
190
|
+
interface RawTeam {
|
|
191
|
+
id?: string;
|
|
192
|
+
key?: string;
|
|
193
|
+
name?: string;
|
|
194
|
+
description?: string;
|
|
195
|
+
}
|
|
196
|
+
export declare const mapTeam: (t: RawTeam | undefined) => {
|
|
197
|
+
id: string;
|
|
198
|
+
key: string;
|
|
199
|
+
name: string;
|
|
200
|
+
description: string;
|
|
201
|
+
};
|
|
202
|
+
interface RawWorkflowState {
|
|
203
|
+
id?: string;
|
|
204
|
+
name?: string;
|
|
205
|
+
type?: string;
|
|
206
|
+
color?: string;
|
|
207
|
+
position?: number;
|
|
208
|
+
}
|
|
209
|
+
export declare const mapWorkflowState: (s: RawWorkflowState | undefined) => {
|
|
210
|
+
id: string;
|
|
211
|
+
name: string;
|
|
212
|
+
type: string;
|
|
213
|
+
color: string;
|
|
214
|
+
position: number;
|
|
215
|
+
};
|
|
216
|
+
interface RawLabel {
|
|
217
|
+
id?: string;
|
|
218
|
+
name?: string;
|
|
219
|
+
color?: string;
|
|
220
|
+
description?: string;
|
|
221
|
+
isGroup?: boolean;
|
|
222
|
+
parent?: {
|
|
223
|
+
name?: string;
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
export declare const mapLabel: (l: RawLabel | undefined) => {
|
|
227
|
+
id: string;
|
|
228
|
+
name: string;
|
|
229
|
+
color: string;
|
|
230
|
+
description: string;
|
|
231
|
+
is_group: boolean;
|
|
232
|
+
parent_name: string;
|
|
233
|
+
};
|
|
234
|
+
interface RawUser {
|
|
235
|
+
id?: string;
|
|
236
|
+
name?: string;
|
|
237
|
+
email?: string;
|
|
238
|
+
displayName?: string;
|
|
239
|
+
active?: boolean;
|
|
240
|
+
admin?: boolean;
|
|
241
|
+
}
|
|
242
|
+
export declare const mapUser: (u: RawUser | undefined) => {
|
|
243
|
+
id: string;
|
|
244
|
+
name: string;
|
|
245
|
+
email: string;
|
|
246
|
+
display_name: string;
|
|
247
|
+
active: boolean;
|
|
248
|
+
admin: boolean;
|
|
249
|
+
};
|
|
250
|
+
interface RawCycle {
|
|
251
|
+
id?: string;
|
|
252
|
+
number?: number;
|
|
253
|
+
name?: string;
|
|
254
|
+
startsAt?: string;
|
|
255
|
+
endsAt?: string;
|
|
256
|
+
isActive?: boolean;
|
|
257
|
+
completedAt?: string;
|
|
258
|
+
}
|
|
259
|
+
export declare const mapCycle: (c: RawCycle | undefined) => {
|
|
260
|
+
id: string;
|
|
261
|
+
number: number;
|
|
262
|
+
name: string;
|
|
263
|
+
starts_at: string;
|
|
264
|
+
ends_at: string;
|
|
265
|
+
is_active: boolean;
|
|
266
|
+
completed_at: string;
|
|
267
|
+
};
|
|
268
|
+
export {};
|
|
269
|
+
//# sourceMappingURL=schemas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../src/tools/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;iBAoBtB,CAAC;AAEH,eAAO,MAAM,aAAa;;;;;;;iBAOxB,CAAC;AAEH,eAAO,MAAM,aAAa;;;;;;;;;;;iBAWxB,CAAC;AAEH,eAAO,MAAM,UAAU;;;;;iBAKrB,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;;;;iBAM9B,CAAC;AAEH,eAAO,MAAM,WAAW;;;;;;;iBAOtB,CAAC;AAEH,eAAO,MAAM,UAAU;;;;;;;iBAOrB,CAAC;AAEH,eAAO,MAAM,WAAW;;;;;;;;iBAQtB,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;iBAG3B,CAAC;AAIH,UAAU,QAAQ;IAChB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,KAAK,CAAC,EAAE;QAA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,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAC5B;AAED,eAAO,MAAM,QAAQ,GAAI,GAAG,QAAQ,GAAG,SAAS;;;;;;;CAO9C,CAAC;AAEH,UAAU,OAAO;IACf,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,eAAO,MAAM,OAAO,GAAI,GAAG,OAAO,GAAG,SAAS;;;;;;;CAO5C,CAAC;AAEH,UAAU,QAAQ;IAChB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,QAAQ,GAAI,GAAG,QAAQ,GAAG,SAAS;;;;;;;;CAQ9C,CAAC"}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
// --- Shared output schemas ---
|
|
3
|
+
export const issueSchema = z.object({
|
|
4
|
+
id: z.string().describe('Issue UUID'),
|
|
5
|
+
identifier: z.string().describe('Human-readable issue identifier (e.g. ENG-123)'),
|
|
6
|
+
title: z.string().describe('Issue title'),
|
|
7
|
+
description: z.string().describe('Issue description in markdown'),
|
|
8
|
+
priority: z.number().describe('Priority (0=none, 1=urgent, 2=high, 3=medium, 4=low)'),
|
|
9
|
+
priority_label: z.string().describe('Human-readable priority label'),
|
|
10
|
+
state_name: z.string().describe('Current workflow state name'),
|
|
11
|
+
state_type: z.string().describe('Workflow state type (triage, backlog, unstarted, started, completed, canceled)'),
|
|
12
|
+
assignee_name: z.string().describe('Assignee display name, or empty if unassigned'),
|
|
13
|
+
team_key: z.string().describe('Team key/identifier'),
|
|
14
|
+
team_name: z.string().describe('Team name'),
|
|
15
|
+
label_names: z.array(z.string()).describe('List of label names applied to this issue'),
|
|
16
|
+
project_name: z.string().describe('Project name, or empty if not in a project'),
|
|
17
|
+
cycle_number: z.number().describe('Cycle number, or 0 if not in a cycle'),
|
|
18
|
+
due_date: z.string().describe('Due date (YYYY-MM-DD), or empty if none'),
|
|
19
|
+
estimate: z.number().describe('Estimate points, or 0 if none'),
|
|
20
|
+
url: z.string().describe('URL to the issue in Linear'),
|
|
21
|
+
created_at: z.string().describe('ISO 8601 creation timestamp'),
|
|
22
|
+
updated_at: z.string().describe('ISO 8601 last update timestamp'),
|
|
23
|
+
});
|
|
24
|
+
export const commentSchema = z.object({
|
|
25
|
+
id: z.string().describe('Comment UUID'),
|
|
26
|
+
body: z.string().describe('Comment body in markdown'),
|
|
27
|
+
user_name: z.string().describe('Author display name'),
|
|
28
|
+
created_at: z.string().describe('ISO 8601 creation timestamp'),
|
|
29
|
+
updated_at: z.string().describe('ISO 8601 last update timestamp'),
|
|
30
|
+
edited_at: z.string().describe('ISO 8601 edited timestamp, or empty if not edited'),
|
|
31
|
+
});
|
|
32
|
+
export const projectSchema = z.object({
|
|
33
|
+
id: z.string().describe('Project UUID'),
|
|
34
|
+
name: z.string().describe('Project name'),
|
|
35
|
+
description: z.string().describe('Project description'),
|
|
36
|
+
state: z.string().describe('Project status name'),
|
|
37
|
+
lead_name: z.string().describe('Project lead display name, or empty if none'),
|
|
38
|
+
target_date: z.string().describe('Target completion date (YYYY-MM-DD), or empty'),
|
|
39
|
+
start_date: z.string().describe('Start date (YYYY-MM-DD), or empty'),
|
|
40
|
+
url: z.string().describe('URL to the project in Linear'),
|
|
41
|
+
created_at: z.string().describe('ISO 8601 creation timestamp'),
|
|
42
|
+
updated_at: z.string().describe('ISO 8601 last update timestamp'),
|
|
43
|
+
});
|
|
44
|
+
export const teamSchema = z.object({
|
|
45
|
+
id: z.string().describe('Team UUID'),
|
|
46
|
+
key: z.string().describe('Team key used as issue identifier prefix'),
|
|
47
|
+
name: z.string().describe('Team name'),
|
|
48
|
+
description: z.string().describe('Team description'),
|
|
49
|
+
});
|
|
50
|
+
export const workflowStateSchema = z.object({
|
|
51
|
+
id: z.string().describe('Workflow state UUID'),
|
|
52
|
+
name: z.string().describe('State name (e.g. Todo, In Progress, Done)'),
|
|
53
|
+
type: z.string().describe('State type (triage, backlog, unstarted, started, completed, canceled)'),
|
|
54
|
+
color: z.string().describe('State color hex code'),
|
|
55
|
+
position: z.number().describe('Sort position within the workflow'),
|
|
56
|
+
});
|
|
57
|
+
export const labelSchema = z.object({
|
|
58
|
+
id: z.string().describe('Label UUID'),
|
|
59
|
+
name: z.string().describe('Label name'),
|
|
60
|
+
color: z.string().describe('Label color hex code'),
|
|
61
|
+
description: z.string().describe('Label description'),
|
|
62
|
+
is_group: z.boolean().describe('Whether this is a group label (parent)'),
|
|
63
|
+
parent_name: z.string().describe('Parent group label name, or empty if top-level'),
|
|
64
|
+
});
|
|
65
|
+
export const userSchema = z.object({
|
|
66
|
+
id: z.string().describe('User UUID'),
|
|
67
|
+
name: z.string().describe('User display name'),
|
|
68
|
+
email: z.string().describe('User email address'),
|
|
69
|
+
display_name: z.string().describe('User display name'),
|
|
70
|
+
active: z.boolean().describe('Whether the user is active'),
|
|
71
|
+
admin: z.boolean().describe('Whether the user is an admin'),
|
|
72
|
+
});
|
|
73
|
+
export const cycleSchema = z.object({
|
|
74
|
+
id: z.string().describe('Cycle UUID'),
|
|
75
|
+
number: z.number().describe('Cycle number'),
|
|
76
|
+
name: z.string().describe('Cycle name, or empty'),
|
|
77
|
+
starts_at: z.string().describe('ISO 8601 cycle start date'),
|
|
78
|
+
ends_at: z.string().describe('ISO 8601 cycle end date'),
|
|
79
|
+
is_active: z.boolean().describe('Whether this is the currently active cycle'),
|
|
80
|
+
completed_at: z.string().describe('ISO 8601 completion timestamp, or empty'),
|
|
81
|
+
});
|
|
82
|
+
export const paginationSchema = z.object({
|
|
83
|
+
has_next_page: z.boolean().describe('Whether there are more results after this page'),
|
|
84
|
+
end_cursor: z.string().describe('Cursor for fetching the next page, or empty'),
|
|
85
|
+
});
|
|
86
|
+
export const mapIssue = (i) => ({
|
|
87
|
+
id: i?.id ?? '',
|
|
88
|
+
identifier: i?.identifier ?? '',
|
|
89
|
+
title: i?.title ?? '',
|
|
90
|
+
description: i?.description ?? '',
|
|
91
|
+
priority: i?.priority ?? 0,
|
|
92
|
+
priority_label: i?.priorityLabel ?? '',
|
|
93
|
+
state_name: i?.state?.name ?? '',
|
|
94
|
+
state_type: i?.state?.type ?? '',
|
|
95
|
+
assignee_name: i?.assignee?.displayName ?? i?.assignee?.name ?? '',
|
|
96
|
+
team_key: i?.team?.key ?? '',
|
|
97
|
+
team_name: i?.team?.name ?? '',
|
|
98
|
+
label_names: (i?.labels?.nodes ?? []).map(l => l?.name ?? '').filter(Boolean),
|
|
99
|
+
project_name: i?.project?.name ?? '',
|
|
100
|
+
cycle_number: i?.cycle?.number ?? 0,
|
|
101
|
+
due_date: i?.dueDate ?? '',
|
|
102
|
+
estimate: i?.estimate ?? 0,
|
|
103
|
+
url: i?.url ?? '',
|
|
104
|
+
created_at: i?.createdAt ?? '',
|
|
105
|
+
updated_at: i?.updatedAt ?? '',
|
|
106
|
+
});
|
|
107
|
+
export const mapComment = (c) => ({
|
|
108
|
+
id: c?.id ?? '',
|
|
109
|
+
body: c?.body ?? '',
|
|
110
|
+
user_name: c?.user?.displayName ?? c?.user?.name ?? '',
|
|
111
|
+
created_at: c?.createdAt ?? '',
|
|
112
|
+
updated_at: c?.updatedAt ?? '',
|
|
113
|
+
edited_at: c?.editedAt ?? '',
|
|
114
|
+
});
|
|
115
|
+
export const mapProject = (p) => ({
|
|
116
|
+
id: p?.id ?? '',
|
|
117
|
+
name: p?.name ?? '',
|
|
118
|
+
description: p?.description ?? '',
|
|
119
|
+
state: p?.status?.name ?? '',
|
|
120
|
+
lead_name: p?.lead?.displayName ?? p?.lead?.name ?? '',
|
|
121
|
+
target_date: p?.targetDate ?? '',
|
|
122
|
+
start_date: p?.startDate ?? '',
|
|
123
|
+
url: p?.url ?? '',
|
|
124
|
+
created_at: p?.createdAt ?? '',
|
|
125
|
+
updated_at: p?.updatedAt ?? '',
|
|
126
|
+
});
|
|
127
|
+
export const mapTeam = (t) => ({
|
|
128
|
+
id: t?.id ?? '',
|
|
129
|
+
key: t?.key ?? '',
|
|
130
|
+
name: t?.name ?? '',
|
|
131
|
+
description: t?.description ?? '',
|
|
132
|
+
});
|
|
133
|
+
export const mapWorkflowState = (s) => ({
|
|
134
|
+
id: s?.id ?? '',
|
|
135
|
+
name: s?.name ?? '',
|
|
136
|
+
type: s?.type ?? '',
|
|
137
|
+
color: s?.color ?? '',
|
|
138
|
+
position: s?.position ?? 0,
|
|
139
|
+
});
|
|
140
|
+
export const mapLabel = (l) => ({
|
|
141
|
+
id: l?.id ?? '',
|
|
142
|
+
name: l?.name ?? '',
|
|
143
|
+
color: l?.color ?? '',
|
|
144
|
+
description: l?.description ?? '',
|
|
145
|
+
is_group: l?.isGroup ?? false,
|
|
146
|
+
parent_name: l?.parent?.name ?? '',
|
|
147
|
+
});
|
|
148
|
+
export const mapUser = (u) => ({
|
|
149
|
+
id: u?.id ?? '',
|
|
150
|
+
name: u?.name ?? '',
|
|
151
|
+
email: u?.email ?? '',
|
|
152
|
+
display_name: u?.displayName ?? u?.name ?? '',
|
|
153
|
+
active: u?.active ?? false,
|
|
154
|
+
admin: u?.admin ?? false,
|
|
155
|
+
});
|
|
156
|
+
export const mapCycle = (c) => ({
|
|
157
|
+
id: c?.id ?? '',
|
|
158
|
+
number: c?.number ?? 0,
|
|
159
|
+
name: c?.name ?? '',
|
|
160
|
+
starts_at: c?.startsAt ?? '',
|
|
161
|
+
ends_at: c?.endsAt ?? '',
|
|
162
|
+
is_active: c?.isActive ?? false,
|
|
163
|
+
completed_at: c?.completedAt ?? '',
|
|
164
|
+
});
|
|
165
|
+
//# sourceMappingURL=schemas.js.map
|