@atercates/bitbucket-mcp 1.0.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.
Files changed (77) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +347 -0
  3. package/dist/client.d.ts +16 -0
  4. package/dist/client.js +35 -0
  5. package/dist/client.js.map +1 -0
  6. package/dist/config.d.ts +11 -0
  7. package/dist/config.js +54 -0
  8. package/dist/config.js.map +1 -0
  9. package/dist/handlers/branching-model.d.ts +2 -0
  10. package/dist/handlers/branching-model.js +324 -0
  11. package/dist/handlers/branching-model.js.map +1 -0
  12. package/dist/handlers/commits.d.ts +2 -0
  13. package/dist/handlers/commits.js +78 -0
  14. package/dist/handlers/commits.js.map +1 -0
  15. package/dist/handlers/index.d.ts +17 -0
  16. package/dist/handlers/index.js +29 -0
  17. package/dist/handlers/index.js.map +1 -0
  18. package/dist/handlers/pipelines.d.ts +2 -0
  19. package/dist/handlers/pipelines.js +538 -0
  20. package/dist/handlers/pipelines.js.map +1 -0
  21. package/dist/handlers/pr-comments.d.ts +2 -0
  22. package/dist/handlers/pr-comments.js +509 -0
  23. package/dist/handlers/pr-comments.js.map +1 -0
  24. package/dist/handlers/pr-content.d.ts +2 -0
  25. package/dist/handlers/pr-content.js +332 -0
  26. package/dist/handlers/pr-content.js.map +1 -0
  27. package/dist/handlers/pr-tasks.d.ts +2 -0
  28. package/dist/handlers/pr-tasks.js +275 -0
  29. package/dist/handlers/pr-tasks.js.map +1 -0
  30. package/dist/handlers/pull-requests.d.ts +2 -0
  31. package/dist/handlers/pull-requests.js +902 -0
  32. package/dist/handlers/pull-requests.js.map +1 -0
  33. package/dist/handlers/refs.d.ts +2 -0
  34. package/dist/handlers/refs.js +225 -0
  35. package/dist/handlers/refs.js.map +1 -0
  36. package/dist/handlers/repositories.d.ts +2 -0
  37. package/dist/handlers/repositories.js +131 -0
  38. package/dist/handlers/repositories.js.map +1 -0
  39. package/dist/handlers/source.d.ts +2 -0
  40. package/dist/handlers/source.js +35 -0
  41. package/dist/handlers/source.js.map +1 -0
  42. package/dist/handlers/types.d.ts +42 -0
  43. package/dist/handlers/types.js +2 -0
  44. package/dist/handlers/types.js.map +1 -0
  45. package/dist/handlers/users.d.ts +2 -0
  46. package/dist/handlers/users.js +38 -0
  47. package/dist/handlers/users.js.map +1 -0
  48. package/dist/index.d.ts +2 -0
  49. package/dist/index.js +4 -0
  50. package/dist/index.js.map +1 -0
  51. package/dist/logger.d.ts +3 -0
  52. package/dist/logger.js +60 -0
  53. package/dist/logger.js.map +1 -0
  54. package/dist/pagination.d.ts +32 -0
  55. package/dist/pagination.js +116 -0
  56. package/dist/pagination.js.map +1 -0
  57. package/dist/schemas.d.ts +21 -0
  58. package/dist/schemas.js +23 -0
  59. package/dist/schemas.js.map +1 -0
  60. package/dist/server.d.ts +33 -0
  61. package/dist/server.js +124 -0
  62. package/dist/server.js.map +1 -0
  63. package/dist/types.d.ts +296 -0
  64. package/dist/types.js +3 -0
  65. package/dist/types.js.map +1 -0
  66. package/dist/utils.d.ts +18 -0
  67. package/dist/utils.js +17 -0
  68. package/dist/utils.js.map +1 -0
  69. package/docs/README.md +216 -0
  70. package/docs/TOOLS.md +464 -0
  71. package/docs/architecture/ARCHITECTURE.md +302 -0
  72. package/docs/guides/ENVIRONMENT_VARIABLES.md +306 -0
  73. package/docs/guides/GETTING_STARTED.md +267 -0
  74. package/docs/guides/GITHUB_ACTIONS_SETUP.md +148 -0
  75. package/docs/guides/NPM_DEPLOYMENT.md +266 -0
  76. package/docs/guides/PROJECT_STRUCTURE.md +317 -0
  77. package/package.json +84 -0
@@ -0,0 +1,324 @@
1
+ import { jsonResponse } from "../utils.js";
2
+ import { logger } from "../logger.js";
3
+ import { ErrorCode, McpError } from "@modelcontextprotocol/sdk/types.js";
4
+ const BRANCH_SETTINGS_SCHEMA = {
5
+ development: {
6
+ type: "object",
7
+ description: "Development branch settings",
8
+ properties: {
9
+ name: { type: "string", description: "Branch name" },
10
+ use_mainbranch: {
11
+ type: "boolean",
12
+ description: "Use main branch",
13
+ },
14
+ },
15
+ },
16
+ production: {
17
+ type: "object",
18
+ description: "Production branch settings",
19
+ properties: {
20
+ name: { type: "string", description: "Branch name" },
21
+ use_mainbranch: {
22
+ type: "boolean",
23
+ description: "Use main branch",
24
+ },
25
+ enabled: {
26
+ type: "boolean",
27
+ description: "Enable production branch",
28
+ },
29
+ },
30
+ },
31
+ branch_types: {
32
+ type: "array",
33
+ description: "Branch types configuration",
34
+ items: {
35
+ type: "object",
36
+ properties: {
37
+ kind: {
38
+ type: "string",
39
+ description: "Branch type kind (e.g., bugfix, feature)",
40
+ },
41
+ prefix: { type: "string", description: "Branch prefix" },
42
+ enabled: {
43
+ type: "boolean",
44
+ description: "Enable this branch type",
45
+ },
46
+ },
47
+ required: ["kind"],
48
+ },
49
+ },
50
+ };
51
+ export const branchingModelModule = {
52
+ tools: [
53
+ {
54
+ name: "getRepositoryBranchingModel",
55
+ description: "Get the branching model for a repository",
56
+ inputSchema: {
57
+ type: "object",
58
+ properties: {
59
+ workspace: {
60
+ type: "string",
61
+ description: "Bitbucket workspace name",
62
+ },
63
+ repo_slug: { type: "string", description: "Repository slug" },
64
+ },
65
+ required: ["workspace", "repo_slug"],
66
+ },
67
+ },
68
+ {
69
+ name: "getRepositoryBranchingModelSettings",
70
+ description: "Get the branching model config for a repository",
71
+ inputSchema: {
72
+ type: "object",
73
+ properties: {
74
+ workspace: {
75
+ type: "string",
76
+ description: "Bitbucket workspace name",
77
+ },
78
+ repo_slug: { type: "string", description: "Repository slug" },
79
+ },
80
+ required: ["workspace", "repo_slug"],
81
+ },
82
+ },
83
+ {
84
+ name: "updateRepositoryBranchingModelSettings",
85
+ description: "Update the branching model config for a repository",
86
+ inputSchema: {
87
+ type: "object",
88
+ properties: {
89
+ workspace: {
90
+ type: "string",
91
+ description: "Bitbucket workspace name",
92
+ },
93
+ repo_slug: { type: "string", description: "Repository slug" },
94
+ ...BRANCH_SETTINGS_SCHEMA,
95
+ },
96
+ required: ["workspace", "repo_slug"],
97
+ },
98
+ },
99
+ {
100
+ name: "getEffectiveRepositoryBranchingModel",
101
+ description: "Get the effective branching model for a repository",
102
+ inputSchema: {
103
+ type: "object",
104
+ properties: {
105
+ workspace: {
106
+ type: "string",
107
+ description: "Bitbucket workspace name",
108
+ },
109
+ repo_slug: { type: "string", description: "Repository slug" },
110
+ },
111
+ required: ["workspace", "repo_slug"],
112
+ },
113
+ },
114
+ {
115
+ name: "getProjectBranchingModel",
116
+ description: "Get the branching model for a project",
117
+ inputSchema: {
118
+ type: "object",
119
+ properties: {
120
+ workspace: {
121
+ type: "string",
122
+ description: "Bitbucket workspace name",
123
+ },
124
+ project_key: { type: "string", description: "Project key" },
125
+ },
126
+ required: ["workspace", "project_key"],
127
+ },
128
+ },
129
+ {
130
+ name: "getProjectBranchingModelSettings",
131
+ description: "Get the branching model config for a project",
132
+ inputSchema: {
133
+ type: "object",
134
+ properties: {
135
+ workspace: {
136
+ type: "string",
137
+ description: "Bitbucket workspace name",
138
+ },
139
+ project_key: { type: "string", description: "Project key" },
140
+ },
141
+ required: ["workspace", "project_key"],
142
+ },
143
+ },
144
+ {
145
+ name: "updateProjectBranchingModelSettings",
146
+ description: "Update the branching model config for a project",
147
+ inputSchema: {
148
+ type: "object",
149
+ properties: {
150
+ workspace: {
151
+ type: "string",
152
+ description: "Bitbucket workspace name",
153
+ },
154
+ project_key: { type: "string", description: "Project key" },
155
+ ...BRANCH_SETTINGS_SCHEMA,
156
+ },
157
+ required: ["workspace", "project_key"],
158
+ },
159
+ },
160
+ ],
161
+ createHandlers: (client) => ({
162
+ getRepositoryBranchingModel: async (args) => {
163
+ const workspace = args.workspace;
164
+ const repo_slug = args.repo_slug;
165
+ try {
166
+ logger.info("Getting repository branching model", {
167
+ workspace,
168
+ repo_slug,
169
+ });
170
+ const response = await client.api.get(`/repositories/${workspace}/${repo_slug}/branching-model`);
171
+ return jsonResponse(response.data);
172
+ }
173
+ catch (error) {
174
+ logger.error("Error getting repository branching model", {
175
+ error,
176
+ workspace,
177
+ repo_slug,
178
+ });
179
+ throw new McpError(ErrorCode.InternalError, `Failed to get repository branching model: ${error instanceof Error ? error.message : String(error)}`);
180
+ }
181
+ },
182
+ getRepositoryBranchingModelSettings: async (args) => {
183
+ const workspace = args.workspace;
184
+ const repo_slug = args.repo_slug;
185
+ try {
186
+ logger.info("Getting repository branching model settings", {
187
+ workspace,
188
+ repo_slug,
189
+ });
190
+ const response = await client.api.get(`/repositories/${workspace}/${repo_slug}/branching-model/settings`);
191
+ return jsonResponse(response.data);
192
+ }
193
+ catch (error) {
194
+ logger.error("Error getting repository branching model settings", {
195
+ error,
196
+ workspace,
197
+ repo_slug,
198
+ });
199
+ throw new McpError(ErrorCode.InternalError, `Failed to get repository branching model settings: ${error instanceof Error ? error.message : String(error)}`);
200
+ }
201
+ },
202
+ updateRepositoryBranchingModelSettings: async (args) => {
203
+ const workspace = args.workspace;
204
+ const repo_slug = args.repo_slug;
205
+ const development = args.development;
206
+ const production = args.production;
207
+ const branch_types = args.branch_types;
208
+ try {
209
+ logger.info("Updating repository branching model settings", {
210
+ workspace,
211
+ repo_slug,
212
+ });
213
+ const payload = {};
214
+ if (development)
215
+ payload.development = development;
216
+ if (production)
217
+ payload.production = production;
218
+ if (branch_types)
219
+ payload.branch_types = branch_types;
220
+ const response = await client.api.put(`/repositories/${workspace}/${repo_slug}/branching-model/settings`, payload);
221
+ return jsonResponse(response.data);
222
+ }
223
+ catch (error) {
224
+ logger.error("Error updating repository branching model settings", {
225
+ error,
226
+ workspace,
227
+ repo_slug,
228
+ });
229
+ throw new McpError(ErrorCode.InternalError, `Failed to update repository branching model settings: ${error instanceof Error ? error.message : String(error)}`);
230
+ }
231
+ },
232
+ getEffectiveRepositoryBranchingModel: async (args) => {
233
+ const workspace = args.workspace;
234
+ const repo_slug = args.repo_slug;
235
+ try {
236
+ logger.info("Getting effective repository branching model", {
237
+ workspace,
238
+ repo_slug,
239
+ });
240
+ const response = await client.api.get(`/repositories/${workspace}/${repo_slug}/effective-branching-model`);
241
+ return jsonResponse(response.data);
242
+ }
243
+ catch (error) {
244
+ logger.error("Error getting effective repository branching model", {
245
+ error,
246
+ workspace,
247
+ repo_slug,
248
+ });
249
+ throw new McpError(ErrorCode.InternalError, `Failed to get effective repository branching model: ${error instanceof Error ? error.message : String(error)}`);
250
+ }
251
+ },
252
+ getProjectBranchingModel: async (args) => {
253
+ const workspace = args.workspace;
254
+ const project_key = args.project_key;
255
+ try {
256
+ logger.info("Getting project branching model", {
257
+ workspace,
258
+ project_key,
259
+ });
260
+ const response = await client.api.get(`/workspaces/${workspace}/projects/${project_key}/branching-model`);
261
+ return jsonResponse(response.data);
262
+ }
263
+ catch (error) {
264
+ logger.error("Error getting project branching model", {
265
+ error,
266
+ workspace,
267
+ project_key,
268
+ });
269
+ throw new McpError(ErrorCode.InternalError, `Failed to get project branching model: ${error instanceof Error ? error.message : String(error)}`);
270
+ }
271
+ },
272
+ getProjectBranchingModelSettings: async (args) => {
273
+ const workspace = args.workspace;
274
+ const project_key = args.project_key;
275
+ try {
276
+ logger.info("Getting project branching model settings", {
277
+ workspace,
278
+ project_key,
279
+ });
280
+ const response = await client.api.get(`/workspaces/${workspace}/projects/${project_key}/branching-model/settings`);
281
+ return jsonResponse(response.data);
282
+ }
283
+ catch (error) {
284
+ logger.error("Error getting project branching model settings", {
285
+ error,
286
+ workspace,
287
+ project_key,
288
+ });
289
+ throw new McpError(ErrorCode.InternalError, `Failed to get project branching model settings: ${error instanceof Error ? error.message : String(error)}`);
290
+ }
291
+ },
292
+ updateProjectBranchingModelSettings: async (args) => {
293
+ const workspace = args.workspace;
294
+ const project_key = args.project_key;
295
+ const development = args.development;
296
+ const production = args.production;
297
+ const branch_types = args.branch_types;
298
+ try {
299
+ logger.info("Updating project branching model settings", {
300
+ workspace,
301
+ project_key,
302
+ });
303
+ const payload = {};
304
+ if (development)
305
+ payload.development = development;
306
+ if (production)
307
+ payload.production = production;
308
+ if (branch_types)
309
+ payload.branch_types = branch_types;
310
+ const response = await client.api.put(`/workspaces/${workspace}/projects/${project_key}/branching-model/settings`, payload);
311
+ return jsonResponse(response.data);
312
+ }
313
+ catch (error) {
314
+ logger.error("Error updating project branching model settings", {
315
+ error,
316
+ workspace,
317
+ project_key,
318
+ });
319
+ throw new McpError(ErrorCode.InternalError, `Failed to update project branching model settings: ${error instanceof Error ? error.message : String(error)}`);
320
+ }
321
+ },
322
+ }),
323
+ };
324
+ //# sourceMappingURL=branching-model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"branching-model.js","sourceRoot":"","sources":["../../src/handlers/branching-model.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AAEzE,MAAM,sBAAsB,GAAG;IAC7B,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,6BAA6B;QAC1C,UAAU,EAAE;YACV,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,aAAa,EAAE;YACpD,cAAc,EAAE;gBACd,IAAI,EAAE,SAAS;gBACf,WAAW,EAAE,iBAAiB;aAC/B;SACF;KACF;IACD,UAAU,EAAE;QACV,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,4BAA4B;QACzC,UAAU,EAAE;YACV,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,aAAa,EAAE;YACpD,cAAc,EAAE;gBACd,IAAI,EAAE,SAAS;gBACf,WAAW,EAAE,iBAAiB;aAC/B;YACD,OAAO,EAAE;gBACP,IAAI,EAAE,SAAS;gBACf,WAAW,EAAE,0BAA0B;aACxC;SACF;KACF;IACD,YAAY,EAAE;QACZ,IAAI,EAAE,OAAO;QACb,WAAW,EAAE,4BAA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AS,aAAa,WAAW,2BAA2B,EAC3E,OAAO,CACR,CAAC;gBAEF,OAAO,YAAY,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YACrC,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,MAAM,CAAC,KAAK,CAAC,iDAAiD,EAAE;oBAC9D,KAAK;oBACL,SAAS;oBACT,WAAW;iBACZ,CAAC,CAAC;gBACH,MAAM,IAAI,QAAQ,CAChB,SAAS,CAAC,aAAa,EACvB,sDACE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CACvD,EAAE,CACH,CAAC;YACJ,CAAC;QACH,CAAC;KACF,CAAC;CACH,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { HandlerModule } from "./types.js";
2
+ export declare const commitsModule: HandlerModule;
@@ -0,0 +1,78 @@
1
+ import { PAGINATION_BASE_SCHEMA, PAGINATION_ALL_SCHEMA } from "../schemas.js";
2
+ import { jsonResponse } from "../utils.js";
3
+ export const commitsModule = {
4
+ tools: [
5
+ {
6
+ name: "listCommits",
7
+ description: "List commits in a repository",
8
+ inputSchema: {
9
+ type: "object",
10
+ properties: {
11
+ workspace: { type: "string", description: "Bitbucket workspace name" },
12
+ repo_slug: { type: "string", description: "Repository slug" },
13
+ branch: {
14
+ type: "string",
15
+ description: "Branch name or commit hash to start from",
16
+ },
17
+ include: {
18
+ type: "array",
19
+ items: { type: "string" },
20
+ description: "Commits to include (merges, etc)",
21
+ },
22
+ exclude: {
23
+ type: "array",
24
+ items: { type: "string" },
25
+ description: "Commits to exclude",
26
+ },
27
+ ...PAGINATION_BASE_SCHEMA,
28
+ all: PAGINATION_ALL_SCHEMA,
29
+ },
30
+ required: ["workspace", "repo_slug"],
31
+ },
32
+ },
33
+ {
34
+ name: "getCommit",
35
+ description: "Get a specific commit from a repository",
36
+ inputSchema: {
37
+ type: "object",
38
+ properties: {
39
+ workspace: { type: "string", description: "Bitbucket workspace name" },
40
+ repo_slug: { type: "string", description: "Repository slug" },
41
+ sha: { type: "string", description: "Commit SHA" },
42
+ },
43
+ required: ["workspace", "repo_slug", "sha"],
44
+ },
45
+ },
46
+ ],
47
+ createHandlers: (client) => ({
48
+ listCommits: async (args) => {
49
+ const workspace = client.resolveWorkspace(args.workspace);
50
+ const repo_slug = args.repo_slug;
51
+ const branch = args.branch;
52
+ const params = {};
53
+ if (args.include)
54
+ params.include = args.include;
55
+ if (args.exclude)
56
+ params.exclude = args.exclude;
57
+ const url = branch
58
+ ? `/repositories/${workspace}/${repo_slug}/commits/${branch}`
59
+ : `/repositories/${workspace}/${repo_slug}/commits`;
60
+ const result = await client.paginator.fetchValues(url, {
61
+ pagelen: args.pagelen,
62
+ page: args.page,
63
+ all: args.all,
64
+ params,
65
+ description: "listCommits",
66
+ });
67
+ return jsonResponse(result.values);
68
+ },
69
+ getCommit: async (args) => {
70
+ const workspace = client.resolveWorkspace(args.workspace);
71
+ const repo_slug = args.repo_slug;
72
+ const sha = args.sha;
73
+ const response = await client.api.get(`/repositories/${workspace}/${repo_slug}/commit/${sha}`);
74
+ return jsonResponse(response.data);
75
+ },
76
+ }),
77
+ };
78
+ //# sourceMappingURL=commits.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commits.js","sourceRoot":"","sources":["../../src/handlers/commits.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAC9E,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,MAAM,CAAC,MAAM,aAAa,GAAkB;IAC1C,KAAK,EAAE;QACL;YACE,IAAI,EAAE,aAAa;YACnB,WAAW,EAAE,8BAA8B;YAC3C,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACV,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,0BAA0B,EAAE;oBACtE,SAAS,E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,MAAM,MAAM,GAA4B,EAAE,CAAC;YAC3C,IAAI,IAAI,CAAC,OAAO;gBAAE,MAAM,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;YAChD,IAAI,IAAI,CAAC,OAAO;gBAAE,MAAM,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;YAEhD,MAAM,GAAG,GAAG,MAAM;gBAChB,CAAC,CAAC,iBAAiB,SAAS,IAAI,SAAS,YAAY,MAAM,EAAE;gBAC7D,CAAC,CAAC,iBAAiB,SAAS,IAAI,SAAS,UAAU,CAAC;YAEtD,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,SAAS,CAAC,WAAW,CAAC,GAAG,EAAE;gBACrD,OAAO,EAAE,IAAI,CAAC,OAAiB;gBAC/B,IAAI,EAAE,IAAI,CAAC,IAAc;gBACzB,GAAG,EAAE,IAAI,CAAC,GAAc;gBACxB,MAAM;gBACN,WAAW,EAAE,aAAa;aAC3B,CAAC,CAAC;YACH,OAAO,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QACrC,CAAC;QACD,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;YACxB,MAAM,SAAS,GAAG,MAAM,CAAC,gBAAgB,CAAC,IAAI,CAAC,SAAmB,CAAC,CAAC;YACpE,MAAM,SAAS,GAAG,IAAI,CAAC,SAAmB,CAAC;YAC3C,MAAM,GAAG,GAAG,IAAI,CAAC,GAAa,CAAC;YAE/B,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,GAAG,CACnC,iBAAiB,SAAS,IAAI,SAAS,WAAW,GAAG,EAAE,CACxD,CAAC;YACF,OAAO,YAAY,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QACrC,CAAC;KACF,CAAC;CACH,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { HandlerModule } from "./types.js";
2
+ import { repositoriesModule } from "./repositories.js";
3
+ import { pullRequestsModule } from "./pull-requests.js";
4
+ import { prCommentsModule } from "./pr-comments.js";
5
+ import { prTasksModule } from "./pr-tasks.js";
6
+ import { prContentModule } from "./pr-content.js";
7
+ import { branchingModelModule } from "./branching-model.js";
8
+ import { pipelinesModule } from "./pipelines.js";
9
+ import { usersModule } from "./users.js";
10
+ import { refsModule } from "./refs.js";
11
+ import { commitsModule } from "./commits.js";
12
+ import { sourceModule } from "./source.js";
13
+ /**
14
+ * All handler modules aggregated for registration
15
+ */
16
+ export declare const allModules: HandlerModule[];
17
+ export { repositoriesModule, pullRequestsModule, prCommentsModule, prTasksModule, prContentModule, branchingModelModule, pipelinesModule, usersModule, refsModule, commitsModule, sourceModule, };
@@ -0,0 +1,29 @@
1
+ import { repositoriesModule } from "./repositories.js";
2
+ import { pullRequestsModule } from "./pull-requests.js";
3
+ import { prCommentsModule } from "./pr-comments.js";
4
+ import { prTasksModule } from "./pr-tasks.js";
5
+ import { prContentModule } from "./pr-content.js";
6
+ import { branchingModelModule } from "./branching-model.js";
7
+ import { pipelinesModule } from "./pipelines.js";
8
+ import { usersModule } from "./users.js";
9
+ import { refsModule } from "./refs.js";
10
+ import { commitsModule } from "./commits.js";
11
+ import { sourceModule } from "./source.js";
12
+ /**
13
+ * All handler modules aggregated for registration
14
+ */
15
+ export const allModules = [
16
+ repositoriesModule,
17
+ pullRequestsModule,
18
+ prCommentsModule,
19
+ prTasksModule,
20
+ prContentModule,
21
+ branchingModelModule,
22
+ pipelinesModule,
23
+ usersModule,
24
+ refsModule,
25
+ commitsModule,
26
+ sourceModule,
27
+ ];
28
+ export { repositoriesModule, pullRequestsModule, prCommentsModule, prTasksModule, prContentModule, branchingModelModule, pipelinesModule, usersModule, refsModule, commitsModule, sourceModule, };
29
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/handlers/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C;;GAEG;AACH,MAAM,CAAC,MAAM,UAAU,GAAoB;IACzC,kBAAkB;IAClB,kBAAkB;IAClB,gBAAgB;IAChB,aAAa;IACb,eAAe;IACf,oBAAoB;IACpB,eAAe;IACf,WAAW;IACX,UAAU;IACV,aAAa;IACb,YAAY;CACb,CAAC;AAEF,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,EAChB,aAAa,EACb,eAAe,EACf,oBAAoB,EACpB,eAAe,EACf,WAAW,EACX,UAAU,EACV,aAAa,EACb,YAAY,GACb,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { HandlerModule } from "./types.js";
2
+ export declare const pipelinesModule: HandlerModule;