@auxiora/connector-github 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.
- package/LICENSE +191 -0
- package/dist/connector.d.ts +2 -0
- package/dist/connector.d.ts.map +1 -0
- package/dist/connector.js +426 -0
- package/dist/connector.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/package.json +25 -0
- package/src/connector.ts +482 -0
- package/src/index.ts +1 -0
- package/tests/connector.test.ts +111 -0
- package/tsconfig.json +11 -0
- package/tsconfig.tsbuildinfo +1 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to the Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by the Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding any notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
Copyright 2026 Auxiora Contributors
|
|
180
|
+
|
|
181
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
182
|
+
you may not use this file except in compliance with the License.
|
|
183
|
+
You may obtain a copy of the License at
|
|
184
|
+
|
|
185
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
186
|
+
|
|
187
|
+
Unless required by applicable law or agreed to in writing, software
|
|
188
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
189
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
190
|
+
See the License for the specific language governing permissions and
|
|
191
|
+
limitations under the License.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connector.d.ts","sourceRoot":"","sources":["../src/connector.ts"],"names":[],"mappings":"AA6BA,eAAO,MAAM,eAAe,yCAoc1B,CAAC"}
|
|
@@ -0,0 +1,426 @@
|
|
|
1
|
+
import { defineConnector } from '@auxiora/connectors';
|
|
2
|
+
const GITHUB_API = 'https://api.github.com';
|
|
3
|
+
async function ghFetch(path, token, options = {}) {
|
|
4
|
+
const res = await fetch(`${GITHUB_API}${path}`, {
|
|
5
|
+
...options,
|
|
6
|
+
headers: {
|
|
7
|
+
'Accept': 'application/vnd.github+json',
|
|
8
|
+
'Authorization': `Bearer ${token}`,
|
|
9
|
+
'X-GitHub-Api-Version': '2022-11-28',
|
|
10
|
+
...options.headers,
|
|
11
|
+
},
|
|
12
|
+
});
|
|
13
|
+
if (!res.ok) {
|
|
14
|
+
const body = await res.text();
|
|
15
|
+
throw new Error(`GitHub API error ${res.status}: ${body}`);
|
|
16
|
+
}
|
|
17
|
+
return res;
|
|
18
|
+
}
|
|
19
|
+
async function ghJson(path, token, options = {}) {
|
|
20
|
+
const res = await ghFetch(path, token, options);
|
|
21
|
+
// 204 No Content (e.g. workflow dispatch) returns no body
|
|
22
|
+
if (res.status === 204)
|
|
23
|
+
return {};
|
|
24
|
+
return res.json();
|
|
25
|
+
}
|
|
26
|
+
export const githubConnector = defineConnector({
|
|
27
|
+
id: 'github',
|
|
28
|
+
name: 'GitHub',
|
|
29
|
+
description: 'Integration with GitHub Issues, PRs, Actions, and Repos',
|
|
30
|
+
version: '1.0.0',
|
|
31
|
+
category: 'devtools',
|
|
32
|
+
icon: 'github',
|
|
33
|
+
auth: {
|
|
34
|
+
type: 'oauth2',
|
|
35
|
+
oauth2: {
|
|
36
|
+
authUrl: 'https://github.com/login/oauth/authorize',
|
|
37
|
+
tokenUrl: 'https://github.com/login/oauth/access_token',
|
|
38
|
+
scopes: ['repo', 'workflow', 'read:org'],
|
|
39
|
+
},
|
|
40
|
+
instructions: 'You can also use a Personal Access Token (PAT) with token auth type.',
|
|
41
|
+
},
|
|
42
|
+
actions: [
|
|
43
|
+
// --- Issues ---
|
|
44
|
+
{
|
|
45
|
+
id: 'issues-list',
|
|
46
|
+
name: 'List Issues',
|
|
47
|
+
description: 'List issues in a repository',
|
|
48
|
+
trustMinimum: 1,
|
|
49
|
+
trustDomain: 'integrations',
|
|
50
|
+
reversible: false,
|
|
51
|
+
sideEffects: false,
|
|
52
|
+
params: {
|
|
53
|
+
owner: { type: 'string', description: 'Repository owner', required: true },
|
|
54
|
+
repo: { type: 'string', description: 'Repository name', required: true },
|
|
55
|
+
state: { type: 'string', description: 'Issue state (open, closed, all)', default: 'open' },
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
id: 'issues-create',
|
|
60
|
+
name: 'Create Issue',
|
|
61
|
+
description: 'Create a new issue',
|
|
62
|
+
trustMinimum: 2,
|
|
63
|
+
trustDomain: 'integrations',
|
|
64
|
+
reversible: true,
|
|
65
|
+
sideEffects: true,
|
|
66
|
+
params: {
|
|
67
|
+
owner: { type: 'string', description: 'Repository owner', required: true },
|
|
68
|
+
repo: { type: 'string', description: 'Repository name', required: true },
|
|
69
|
+
title: { type: 'string', description: 'Issue title', required: true },
|
|
70
|
+
body: { type: 'string', description: 'Issue body' },
|
|
71
|
+
labels: { type: 'array', description: 'Issue labels' },
|
|
72
|
+
assignees: { type: 'array', description: 'Assignees' },
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
id: 'issues-update',
|
|
77
|
+
name: 'Update Issue',
|
|
78
|
+
description: 'Update an existing issue',
|
|
79
|
+
trustMinimum: 2,
|
|
80
|
+
trustDomain: 'integrations',
|
|
81
|
+
reversible: true,
|
|
82
|
+
sideEffects: true,
|
|
83
|
+
params: {
|
|
84
|
+
owner: { type: 'string', description: 'Repository owner', required: true },
|
|
85
|
+
repo: { type: 'string', description: 'Repository name', required: true },
|
|
86
|
+
issueNumber: { type: 'number', description: 'Issue number', required: true },
|
|
87
|
+
title: { type: 'string', description: 'Updated title' },
|
|
88
|
+
body: { type: 'string', description: 'Updated body' },
|
|
89
|
+
state: { type: 'string', description: 'State (open, closed)' },
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
id: 'issues-comment',
|
|
94
|
+
name: 'Comment on Issue',
|
|
95
|
+
description: 'Add a comment to an issue',
|
|
96
|
+
trustMinimum: 2,
|
|
97
|
+
trustDomain: 'integrations',
|
|
98
|
+
reversible: true,
|
|
99
|
+
sideEffects: true,
|
|
100
|
+
params: {
|
|
101
|
+
owner: { type: 'string', description: 'Repository owner', required: true },
|
|
102
|
+
repo: { type: 'string', description: 'Repository name', required: true },
|
|
103
|
+
issueNumber: { type: 'number', description: 'Issue number', required: true },
|
|
104
|
+
body: { type: 'string', description: 'Comment body', required: true },
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
// --- PRs ---
|
|
108
|
+
{
|
|
109
|
+
id: 'prs-list',
|
|
110
|
+
name: 'List Pull Requests',
|
|
111
|
+
description: 'List pull requests in a repository',
|
|
112
|
+
trustMinimum: 1,
|
|
113
|
+
trustDomain: 'integrations',
|
|
114
|
+
reversible: false,
|
|
115
|
+
sideEffects: false,
|
|
116
|
+
params: {
|
|
117
|
+
owner: { type: 'string', description: 'Repository owner', required: true },
|
|
118
|
+
repo: { type: 'string', description: 'Repository name', required: true },
|
|
119
|
+
state: { type: 'string', description: 'PR state', default: 'open' },
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
id: 'prs-create',
|
|
124
|
+
name: 'Create Pull Request',
|
|
125
|
+
description: 'Create a new pull request',
|
|
126
|
+
trustMinimum: 3,
|
|
127
|
+
trustDomain: 'integrations',
|
|
128
|
+
reversible: true,
|
|
129
|
+
sideEffects: true,
|
|
130
|
+
params: {
|
|
131
|
+
owner: { type: 'string', description: 'Repository owner', required: true },
|
|
132
|
+
repo: { type: 'string', description: 'Repository name', required: true },
|
|
133
|
+
title: { type: 'string', description: 'PR title', required: true },
|
|
134
|
+
head: { type: 'string', description: 'Head branch', required: true },
|
|
135
|
+
base: { type: 'string', description: 'Base branch', required: true },
|
|
136
|
+
body: { type: 'string', description: 'PR description' },
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
id: 'prs-merge',
|
|
141
|
+
name: 'Merge Pull Request',
|
|
142
|
+
description: 'Merge a pull request',
|
|
143
|
+
trustMinimum: 4,
|
|
144
|
+
trustDomain: 'integrations',
|
|
145
|
+
reversible: false,
|
|
146
|
+
sideEffects: true,
|
|
147
|
+
params: {
|
|
148
|
+
owner: { type: 'string', description: 'Repository owner', required: true },
|
|
149
|
+
repo: { type: 'string', description: 'Repository name', required: true },
|
|
150
|
+
pullNumber: { type: 'number', description: 'PR number', required: true },
|
|
151
|
+
mergeMethod: { type: 'string', description: 'Merge method (merge, squash, rebase)', default: 'merge' },
|
|
152
|
+
},
|
|
153
|
+
},
|
|
154
|
+
// --- Actions ---
|
|
155
|
+
{
|
|
156
|
+
id: 'actions-list-runs',
|
|
157
|
+
name: 'List Workflow Runs',
|
|
158
|
+
description: 'List recent workflow runs',
|
|
159
|
+
trustMinimum: 1,
|
|
160
|
+
trustDomain: 'integrations',
|
|
161
|
+
reversible: false,
|
|
162
|
+
sideEffects: false,
|
|
163
|
+
params: {
|
|
164
|
+
owner: { type: 'string', description: 'Repository owner', required: true },
|
|
165
|
+
repo: { type: 'string', description: 'Repository name', required: true },
|
|
166
|
+
},
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
id: 'actions-trigger',
|
|
170
|
+
name: 'Trigger Workflow',
|
|
171
|
+
description: 'Trigger a workflow dispatch',
|
|
172
|
+
trustMinimum: 3,
|
|
173
|
+
trustDomain: 'integrations',
|
|
174
|
+
reversible: false,
|
|
175
|
+
sideEffects: true,
|
|
176
|
+
params: {
|
|
177
|
+
owner: { type: 'string', description: 'Repository owner', required: true },
|
|
178
|
+
repo: { type: 'string', description: 'Repository name', required: true },
|
|
179
|
+
workflowId: { type: 'string', description: 'Workflow ID or filename', required: true },
|
|
180
|
+
ref: { type: 'string', description: 'Git ref', default: 'main' },
|
|
181
|
+
},
|
|
182
|
+
},
|
|
183
|
+
// --- Repos ---
|
|
184
|
+
{
|
|
185
|
+
id: 'repos-list',
|
|
186
|
+
name: 'List Repositories',
|
|
187
|
+
description: 'List repositories for the authenticated user',
|
|
188
|
+
trustMinimum: 1,
|
|
189
|
+
trustDomain: 'integrations',
|
|
190
|
+
reversible: false,
|
|
191
|
+
sideEffects: false,
|
|
192
|
+
params: {
|
|
193
|
+
type: { type: 'string', description: 'Type (all, owner, member)', default: 'all' },
|
|
194
|
+
},
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
id: 'repos-get',
|
|
198
|
+
name: 'Get Repository',
|
|
199
|
+
description: 'Get details of a repository',
|
|
200
|
+
trustMinimum: 1,
|
|
201
|
+
trustDomain: 'integrations',
|
|
202
|
+
reversible: false,
|
|
203
|
+
sideEffects: false,
|
|
204
|
+
params: {
|
|
205
|
+
owner: { type: 'string', description: 'Repository owner', required: true },
|
|
206
|
+
repo: { type: 'string', description: 'Repository name', required: true },
|
|
207
|
+
},
|
|
208
|
+
},
|
|
209
|
+
],
|
|
210
|
+
triggers: [
|
|
211
|
+
{
|
|
212
|
+
id: 'pr-opened',
|
|
213
|
+
name: 'PR Opened',
|
|
214
|
+
description: 'Triggered when a new pull request is opened',
|
|
215
|
+
type: 'poll',
|
|
216
|
+
pollIntervalMs: 120_000,
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
id: 'issue-created',
|
|
220
|
+
name: 'Issue Created',
|
|
221
|
+
description: 'Triggered when a new issue is created',
|
|
222
|
+
type: 'poll',
|
|
223
|
+
pollIntervalMs: 120_000,
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
id: 'workflow-failed',
|
|
227
|
+
name: 'Workflow Failed',
|
|
228
|
+
description: 'Triggered when a workflow run fails',
|
|
229
|
+
type: 'poll',
|
|
230
|
+
pollIntervalMs: 120_000,
|
|
231
|
+
},
|
|
232
|
+
],
|
|
233
|
+
entities: [
|
|
234
|
+
{
|
|
235
|
+
id: 'issue',
|
|
236
|
+
name: 'Issue',
|
|
237
|
+
description: 'A GitHub issue',
|
|
238
|
+
fields: { number: 'number', title: 'string', state: 'string', body: 'string', labels: 'array' },
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
id: 'pull-request',
|
|
242
|
+
name: 'Pull Request',
|
|
243
|
+
description: 'A GitHub pull request',
|
|
244
|
+
fields: { number: 'number', title: 'string', state: 'string', head: 'string', base: 'string' },
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
id: 'repository',
|
|
248
|
+
name: 'Repository',
|
|
249
|
+
description: 'A GitHub repository',
|
|
250
|
+
fields: { name: 'string', fullName: 'string', private: 'boolean', defaultBranch: 'string' },
|
|
251
|
+
},
|
|
252
|
+
],
|
|
253
|
+
async executeAction(actionId, params, token) {
|
|
254
|
+
switch (actionId) {
|
|
255
|
+
// --- Issues ---
|
|
256
|
+
case 'issues-list': {
|
|
257
|
+
const owner = params.owner;
|
|
258
|
+
const repo = params.repo;
|
|
259
|
+
const state = params.state ?? 'open';
|
|
260
|
+
const items = await ghJson(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}/issues?state=${encodeURIComponent(state)}`, token);
|
|
261
|
+
return {
|
|
262
|
+
issues: items.map(i => ({
|
|
263
|
+
number: i.number,
|
|
264
|
+
title: i.title,
|
|
265
|
+
state: i.state,
|
|
266
|
+
body: i.body ?? '',
|
|
267
|
+
labels: i.labels.map(l => l.name),
|
|
268
|
+
})),
|
|
269
|
+
};
|
|
270
|
+
}
|
|
271
|
+
case 'issues-create': {
|
|
272
|
+
const owner = params.owner;
|
|
273
|
+
const repo = params.repo;
|
|
274
|
+
const issue = await ghJson(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}/issues`, token, {
|
|
275
|
+
method: 'POST',
|
|
276
|
+
headers: { 'Content-Type': 'application/json' },
|
|
277
|
+
body: JSON.stringify({
|
|
278
|
+
title: params.title,
|
|
279
|
+
body: params.body,
|
|
280
|
+
labels: params.labels,
|
|
281
|
+
assignees: params.assignees,
|
|
282
|
+
}),
|
|
283
|
+
});
|
|
284
|
+
return { issueNumber: issue.number, status: 'created', title: issue.title, url: issue.html_url };
|
|
285
|
+
}
|
|
286
|
+
case 'issues-update': {
|
|
287
|
+
const owner = params.owner;
|
|
288
|
+
const repo = params.repo;
|
|
289
|
+
const issueNumber = params.issueNumber;
|
|
290
|
+
const body = {};
|
|
291
|
+
if (params.title !== undefined)
|
|
292
|
+
body.title = params.title;
|
|
293
|
+
if (params.body !== undefined)
|
|
294
|
+
body.body = params.body;
|
|
295
|
+
if (params.state !== undefined)
|
|
296
|
+
body.state = params.state;
|
|
297
|
+
const issue = await ghJson(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}/issues/${issueNumber}`, token, {
|
|
298
|
+
method: 'PATCH',
|
|
299
|
+
headers: { 'Content-Type': 'application/json' },
|
|
300
|
+
body: JSON.stringify(body),
|
|
301
|
+
});
|
|
302
|
+
return { issueNumber: issue.number, status: 'updated', title: issue.title, state: issue.state };
|
|
303
|
+
}
|
|
304
|
+
case 'issues-comment': {
|
|
305
|
+
const owner = params.owner;
|
|
306
|
+
const repo = params.repo;
|
|
307
|
+
const issueNumber = params.issueNumber;
|
|
308
|
+
const comment = await ghJson(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}/issues/${issueNumber}/comments`, token, {
|
|
309
|
+
method: 'POST',
|
|
310
|
+
headers: { 'Content-Type': 'application/json' },
|
|
311
|
+
body: JSON.stringify({ body: params.body }),
|
|
312
|
+
});
|
|
313
|
+
return { commentId: comment.id, status: 'created', url: comment.html_url };
|
|
314
|
+
}
|
|
315
|
+
// --- Pull Requests ---
|
|
316
|
+
case 'prs-list': {
|
|
317
|
+
const owner = params.owner;
|
|
318
|
+
const repo = params.repo;
|
|
319
|
+
const state = params.state ?? 'open';
|
|
320
|
+
const items = await ghJson(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}/pulls?state=${encodeURIComponent(state)}`, token);
|
|
321
|
+
return {
|
|
322
|
+
pullRequests: items.map(pr => ({
|
|
323
|
+
number: pr.number,
|
|
324
|
+
title: pr.title,
|
|
325
|
+
state: pr.state,
|
|
326
|
+
head: pr.head.ref,
|
|
327
|
+
base: pr.base.ref,
|
|
328
|
+
})),
|
|
329
|
+
};
|
|
330
|
+
}
|
|
331
|
+
case 'prs-create': {
|
|
332
|
+
const owner = params.owner;
|
|
333
|
+
const repo = params.repo;
|
|
334
|
+
const pr = await ghJson(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}/pulls`, token, {
|
|
335
|
+
method: 'POST',
|
|
336
|
+
headers: { 'Content-Type': 'application/json' },
|
|
337
|
+
body: JSON.stringify({
|
|
338
|
+
title: params.title,
|
|
339
|
+
head: params.head,
|
|
340
|
+
base: params.base,
|
|
341
|
+
body: params.body,
|
|
342
|
+
}),
|
|
343
|
+
});
|
|
344
|
+
return { pullNumber: pr.number, status: 'created', title: pr.title, url: pr.html_url };
|
|
345
|
+
}
|
|
346
|
+
case 'prs-merge': {
|
|
347
|
+
const owner = params.owner;
|
|
348
|
+
const repo = params.repo;
|
|
349
|
+
const pullNumber = params.pullNumber;
|
|
350
|
+
const result = await ghJson(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}/pulls/${pullNumber}/merge`, token, {
|
|
351
|
+
method: 'PUT',
|
|
352
|
+
headers: { 'Content-Type': 'application/json' },
|
|
353
|
+
body: JSON.stringify({
|
|
354
|
+
merge_method: params.mergeMethod ?? 'merge',
|
|
355
|
+
}),
|
|
356
|
+
});
|
|
357
|
+
return { pullNumber, status: result.merged ? 'merged' : 'failed', message: result.message };
|
|
358
|
+
}
|
|
359
|
+
// --- Actions ---
|
|
360
|
+
case 'actions-list-runs': {
|
|
361
|
+
const owner = params.owner;
|
|
362
|
+
const repo = params.repo;
|
|
363
|
+
const data = await ghJson(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}/actions/runs`, token);
|
|
364
|
+
return {
|
|
365
|
+
runs: data.workflow_runs.map(r => ({
|
|
366
|
+
id: r.id,
|
|
367
|
+
name: r.name,
|
|
368
|
+
status: r.status,
|
|
369
|
+
conclusion: r.conclusion,
|
|
370
|
+
url: r.html_url,
|
|
371
|
+
createdAt: r.created_at,
|
|
372
|
+
})),
|
|
373
|
+
};
|
|
374
|
+
}
|
|
375
|
+
case 'actions-trigger': {
|
|
376
|
+
const owner = params.owner;
|
|
377
|
+
const repo = params.repo;
|
|
378
|
+
const workflowId = params.workflowId;
|
|
379
|
+
const ref = params.ref ?? 'main';
|
|
380
|
+
await ghJson(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}/actions/workflows/${encodeURIComponent(workflowId)}/dispatches`, token, {
|
|
381
|
+
method: 'POST',
|
|
382
|
+
headers: { 'Content-Type': 'application/json' },
|
|
383
|
+
body: JSON.stringify({ ref }),
|
|
384
|
+
});
|
|
385
|
+
return { status: 'triggered', workflowId, ref };
|
|
386
|
+
}
|
|
387
|
+
// --- Repos ---
|
|
388
|
+
case 'repos-list': {
|
|
389
|
+
const type = params.type ?? 'all';
|
|
390
|
+
const items = await ghJson(`/user/repos?type=${encodeURIComponent(type)}`, token);
|
|
391
|
+
return {
|
|
392
|
+
repositories: items.map(r => ({
|
|
393
|
+
name: r.name,
|
|
394
|
+
fullName: r.full_name,
|
|
395
|
+
private: r.private,
|
|
396
|
+
defaultBranch: r.default_branch,
|
|
397
|
+
})),
|
|
398
|
+
};
|
|
399
|
+
}
|
|
400
|
+
case 'repos-get': {
|
|
401
|
+
const owner = params.owner;
|
|
402
|
+
const repo = params.repo;
|
|
403
|
+
const r = await ghJson(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}`, token);
|
|
404
|
+
return {
|
|
405
|
+
name: r.name,
|
|
406
|
+
fullName: r.full_name,
|
|
407
|
+
private: r.private,
|
|
408
|
+
defaultBranch: r.default_branch,
|
|
409
|
+
description: r.description,
|
|
410
|
+
stars: r.stargazers_count,
|
|
411
|
+
forks: r.forks_count,
|
|
412
|
+
url: r.html_url,
|
|
413
|
+
};
|
|
414
|
+
}
|
|
415
|
+
default:
|
|
416
|
+
throw new Error(`Unknown action: ${actionId}`);
|
|
417
|
+
}
|
|
418
|
+
},
|
|
419
|
+
async pollTrigger(_triggerId, _token, _lastPollAt) {
|
|
420
|
+
// Triggers require repository configuration (owner/repo) which is not available
|
|
421
|
+
// in the pollTrigger signature. A future version could store monitored repos in
|
|
422
|
+
// connector config. For now, return empty to avoid errors.
|
|
423
|
+
return [];
|
|
424
|
+
},
|
|
425
|
+
});
|
|
426
|
+
//# sourceMappingURL=connector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connector.js","sourceRoot":"","sources":["../src/connector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAGtD,MAAM,UAAU,GAAG,wBAAwB,CAAC;AAE5C,KAAK,UAAU,OAAO,CAAC,IAAY,EAAE,KAAa,EAAE,UAAuB,EAAE;IAC3E,MAAM,GAA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