n8n-nodes-github-copilot 3.27.0 → 3.27.1
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.
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ICredentialType, INodeProperties, ICredentialTestRequest, IAuthenticateGeneric } from 'n8n-workflow';
|
|
2
|
+
export declare class GitHubCopilotOAuth2Api implements ICredentialType {
|
|
3
|
+
name: string;
|
|
4
|
+
displayName: string;
|
|
5
|
+
documentationUrl: string;
|
|
6
|
+
properties: INodeProperties[];
|
|
7
|
+
authenticate: IAuthenticateGeneric;
|
|
8
|
+
test: ICredentialTestRequest;
|
|
9
|
+
}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GitHubCopilotOAuth2Api = void 0;
|
|
4
|
+
const GitHubCopilotEndpoints_1 = require("../shared/utils/GitHubCopilotEndpoints");
|
|
5
|
+
class GitHubCopilotOAuth2Api {
|
|
6
|
+
constructor() {
|
|
7
|
+
this.name = 'githubCopilotOAuth2Api';
|
|
8
|
+
this.displayName = 'GitHub Copilot OAuth2 (with Helper)';
|
|
9
|
+
this.documentationUrl = 'https://docs.github.com/en/copilot/github-copilot-chat/copilot-chat-in-ides/using-github-copilot-chat-in-your-ide';
|
|
10
|
+
this.properties = [
|
|
11
|
+
{
|
|
12
|
+
displayName: '🎯 GitHub Copilot OAuth Helper',
|
|
13
|
+
name: 'authNotice',
|
|
14
|
+
type: 'notice',
|
|
15
|
+
default: '',
|
|
16
|
+
description: `<strong>🚀 Easy Token Generation:</strong><br/>
|
|
17
|
+
1. Run the helper script: <code>node get-copilot-token.js</code><br/>
|
|
18
|
+
2. Follow the Device Flow OAuth in your browser<br/>
|
|
19
|
+
3. Copy the generated token below<br/><br/>
|
|
20
|
+
<em>The script handles all OAuth complexity automatically!</em>`,
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
displayName: 'Authentication Method',
|
|
24
|
+
name: 'authMethod',
|
|
25
|
+
type: 'options',
|
|
26
|
+
options: [
|
|
27
|
+
{
|
|
28
|
+
name: 'Manual Token (Paste from Script)',
|
|
29
|
+
value: 'manual',
|
|
30
|
+
description: 'Paste token generated by get-copilot-token.js script',
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: 'Device Flow OAuth (Interactive)',
|
|
34
|
+
value: 'deviceFlow',
|
|
35
|
+
description: 'Generate Device Flow code for manual authorization',
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
default: 'manual',
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
displayName: 'GitHub Copilot Token',
|
|
42
|
+
name: 'token',
|
|
43
|
+
type: 'string',
|
|
44
|
+
typeOptions: {
|
|
45
|
+
password: true,
|
|
46
|
+
},
|
|
47
|
+
default: '',
|
|
48
|
+
required: true,
|
|
49
|
+
displayOptions: {
|
|
50
|
+
show: {
|
|
51
|
+
authMethod: ['manual'],
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
description: '🔑 Paste the token generated by <code>get-copilot-token.js</code> script (format: gho_*)',
|
|
55
|
+
placeholder: 'gho_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
displayName: '🔧 Device Flow Setup',
|
|
59
|
+
name: 'deviceFlowSetup',
|
|
60
|
+
type: 'notice',
|
|
61
|
+
default: '',
|
|
62
|
+
displayOptions: {
|
|
63
|
+
show: {
|
|
64
|
+
authMethod: ['deviceFlow'],
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
description: `<strong>� Device Flow Configuration:</strong><br/>
|
|
68
|
+
Client ID: <code>01ab8ac9400c4e429b23</code><br/>
|
|
69
|
+
Scopes: <code>repo user:email</code><br/><br/>
|
|
70
|
+
<strong>🌐 Manual Steps:</strong><br/>
|
|
71
|
+
1. Go to: <a href="https://github.com/login/device" target="_blank">https://github.com/login/device</a><br/>
|
|
72
|
+
2. Use Client ID: 01ab8ac9400c4e429b23<br/>
|
|
73
|
+
3. Enter the 8-character code generated below<br/>
|
|
74
|
+
4. Authorize the application<br/>
|
|
75
|
+
5. Get your token and paste it in Manual Token field`,
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
displayName: 'Generate Device Code',
|
|
79
|
+
name: 'generateCode',
|
|
80
|
+
type: 'button',
|
|
81
|
+
typeOptions: {
|
|
82
|
+
action: {
|
|
83
|
+
type: 'generateDeviceCode',
|
|
84
|
+
displayName: '🎲 Generate 8-Character Code',
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
default: '',
|
|
88
|
+
displayOptions: {
|
|
89
|
+
show: {
|
|
90
|
+
authMethod: ['deviceFlow'],
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
description: 'Click to generate an 8-character code for Device Flow OAuth',
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
displayName: 'Device Code',
|
|
97
|
+
name: 'deviceCode',
|
|
98
|
+
type: 'string',
|
|
99
|
+
default: '',
|
|
100
|
+
displayOptions: {
|
|
101
|
+
show: {
|
|
102
|
+
authMethod: ['deviceFlow'],
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
description: '🔤 8-character code for GitHub Device Flow (generated automatically)',
|
|
106
|
+
placeholder: 'ABCD-EFGH',
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
displayName: 'Verification URL',
|
|
110
|
+
name: 'verificationUrl',
|
|
111
|
+
type: 'string',
|
|
112
|
+
default: 'https://github.com/login/device',
|
|
113
|
+
displayOptions: {
|
|
114
|
+
show: {
|
|
115
|
+
authMethod: ['deviceFlow'],
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
description: '🌐 URL to authorize the application',
|
|
119
|
+
},
|
|
120
|
+
];
|
|
121
|
+
this.authenticate = {
|
|
122
|
+
type: 'generic',
|
|
123
|
+
properties: {
|
|
124
|
+
headers: {
|
|
125
|
+
'Authorization': '=Bearer {{$credentials.token}}',
|
|
126
|
+
'Accept': 'application/json',
|
|
127
|
+
'Content-Type': 'application/json',
|
|
128
|
+
'User-Agent': 'GitHub-Copilot-Chat/1.0.0 VSCode/1.85.0',
|
|
129
|
+
'Editor-Version': 'vscode/1.85.0',
|
|
130
|
+
'Editor-Plugin-Version': 'copilot-chat/0.12.0',
|
|
131
|
+
'X-GitHub-Api-Version': '2025-04-01',
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
|
+
};
|
|
135
|
+
this.test = {
|
|
136
|
+
request: {
|
|
137
|
+
baseURL: GitHubCopilotEndpoints_1.GITHUB_COPILOT_API.BASE_URL,
|
|
138
|
+
url: GitHubCopilotEndpoints_1.GITHUB_COPILOT_API.ENDPOINTS.MODELS,
|
|
139
|
+
method: 'GET',
|
|
140
|
+
},
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
exports.GitHubCopilotOAuth2Api = GitHubCopilotOAuth2Api;
|
|
@@ -5,36 +5,22 @@ const GitHubCopilotEndpoints_1 = require("../shared/utils/GitHubCopilotEndpoints
|
|
|
5
5
|
class GitHubCopilotOAuth2Api {
|
|
6
6
|
constructor() {
|
|
7
7
|
this.name = 'githubCopilotOAuth2Api';
|
|
8
|
-
this.displayName = 'GitHub Copilot
|
|
8
|
+
this.displayName = 'GitHub Copilot OAuth2 (with Helper)';
|
|
9
9
|
this.documentationUrl = 'https://docs.github.com/en/copilot/github-copilot-chat/copilot-chat-in-ides/using-github-copilot-chat-in-your-ide';
|
|
10
10
|
this.properties = [
|
|
11
11
|
{
|
|
12
|
-
displayName: '
|
|
13
|
-
name: '
|
|
12
|
+
displayName: '🚀 Automated Token Generation (Recommended)',
|
|
13
|
+
name: 'scriptHelper',
|
|
14
14
|
type: 'notice',
|
|
15
15
|
default: '',
|
|
16
|
-
description:
|
|
16
|
+
description: `<strong>Easy 3-Step Process:</strong><br/>
|
|
17
|
+
1. Run: <code>node get-copilot-token.js</code><br/>
|
|
18
|
+
2. Follow OAuth flow in browser<br/>
|
|
19
|
+
3. Paste generated token below<br/><br/>
|
|
20
|
+
<em>Script handles all OAuth complexity automatically!</em>`,
|
|
17
21
|
},
|
|
18
22
|
{
|
|
19
|
-
displayName: '
|
|
20
|
-
name: 'authMethod',
|
|
21
|
-
type: 'options',
|
|
22
|
-
options: [
|
|
23
|
-
{
|
|
24
|
-
name: 'Manual Token (Recommended)',
|
|
25
|
-
value: 'manual',
|
|
26
|
-
description: 'Enter your GitHub CLI token manually',
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
name: 'Device Flow OAuth (Experimental)',
|
|
30
|
-
value: 'deviceFlow',
|
|
31
|
-
description: 'Use Device Flow OAuth to obtain token automatically',
|
|
32
|
-
},
|
|
33
|
-
],
|
|
34
|
-
default: 'manual',
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
displayName: 'GitHub CLI Token',
|
|
23
|
+
displayName: 'GitHub Copilot Token',
|
|
38
24
|
name: 'token',
|
|
39
25
|
type: 'string',
|
|
40
26
|
typeOptions: {
|
|
@@ -42,56 +28,49 @@ class GitHubCopilotOAuth2Api {
|
|
|
42
28
|
},
|
|
43
29
|
default: '',
|
|
44
30
|
required: true,
|
|
45
|
-
|
|
46
|
-
show: {
|
|
47
|
-
authMethod: ['manual'],
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
description: '⚠️ REQUIRED: Token generated by GitHub CLI that starts with "gho_". Get it by running the authenticate.js script or: gh auth login && gh auth token',
|
|
31
|
+
description: '🔑 Your GitHub Copilot token (format: gho_*)',
|
|
51
32
|
placeholder: 'gho_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
|
|
52
33
|
},
|
|
53
34
|
{
|
|
54
|
-
displayName: '
|
|
55
|
-
name: '
|
|
56
|
-
type: '
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
35
|
+
displayName: '🔧 Manual OAuth Steps (Alternative)',
|
|
36
|
+
name: 'manualSteps',
|
|
37
|
+
type: 'collection',
|
|
38
|
+
placeholder: 'Expand for Manual Setup',
|
|
39
|
+
default: {},
|
|
40
|
+
options: [
|
|
41
|
+
{
|
|
42
|
+
displayName: 'Step-by-Step Instructions',
|
|
43
|
+
name: 'instructions',
|
|
44
|
+
type: 'notice',
|
|
45
|
+
default: '',
|
|
46
|
+
description: `<strong>Manual Device Flow Process:</strong><br/><br/>
|
|
47
|
+
<strong>1. Generate Device Code:</strong><br/>
|
|
48
|
+
🌐 Visit: <a href="https://github.com/login/device" target="_blank">https://github.com/login/device</a><br/><br/>
|
|
49
|
+
<strong>2. Enter Client ID:</strong><br/>
|
|
50
|
+
🔑 Use: <code>01ab8ac9400c4e429b23</code><br/><br/>
|
|
51
|
+
<strong>3. Get 8-Character Code:</strong><br/>
|
|
52
|
+
📱 GitHub will provide code like: ABCD-1234<br/><br/>
|
|
53
|
+
<strong>4. Complete Authorization:</strong><br/>
|
|
54
|
+
✅ Enter code and authorize application<br/><br/>
|
|
55
|
+
<strong>5. Obtain Token:</strong><br/>
|
|
56
|
+
🎯 Copy final token and paste above`,
|
|
61
57
|
},
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
3. Switch Authentication Method to "Manual Token"
|
|
69
|
-
|
|
70
|
-
The script will guide you through GitHub Device Flow OAuth and generate the correct token format.`,
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
displayName: 'Client ID',
|
|
74
|
-
name: 'clientId',
|
|
75
|
-
type: 'string',
|
|
76
|
-
default: '01ab8ac9400c4e429b23',
|
|
77
|
-
displayOptions: {
|
|
78
|
-
show: {
|
|
79
|
-
authMethod: ['deviceFlow'],
|
|
58
|
+
{
|
|
59
|
+
displayName: 'Client ID (Fixed)',
|
|
60
|
+
name: 'clientId',
|
|
61
|
+
type: 'string',
|
|
62
|
+
default: '01ab8ac9400c4e429b23',
|
|
63
|
+
description: 'GitHub OAuth Client ID - VS Code application',
|
|
80
64
|
},
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
type: 'string',
|
|
88
|
-
default: 'repo user:email',
|
|
89
|
-
displayOptions: {
|
|
90
|
-
show: {
|
|
91
|
-
authMethod: ['deviceFlow'],
|
|
65
|
+
{
|
|
66
|
+
displayName: 'Required Scopes',
|
|
67
|
+
name: 'scopes',
|
|
68
|
+
type: 'string',
|
|
69
|
+
default: 'repo user:email',
|
|
70
|
+
description: 'OAuth permissions needed for Copilot access',
|
|
92
71
|
},
|
|
93
|
-
|
|
94
|
-
description: '
|
|
72
|
+
],
|
|
73
|
+
description: 'Manual configuration for advanced users',
|
|
95
74
|
},
|
|
96
75
|
];
|
|
97
76
|
this.authenticate = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "n8n-nodes-github-copilot",
|
|
3
|
-
"version": "3.27.
|
|
3
|
+
"version": "3.27.1",
|
|
4
4
|
"description": "n8n community node for GitHub Copilot with CLI integration, Chat API access, and AI Chat Model for workflows - access GPT-5, Claude, Gemini and more using your Copilot subscription",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://github.com/sufficit/n8n-nodes-github-copilot",
|