n8n-nodes-github-copilot 3.27.0 → 3.27.2
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,11 @@ 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: 'notice',
|
|
14
|
-
type: 'notice',
|
|
15
|
-
default: '',
|
|
16
|
-
description: 'Choose between manual token input or guided Device Flow OAuth. For automated setup, use the provided authentication script.',
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
displayName: 'Authentication Method',
|
|
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',
|
|
12
|
+
displayName: 'GitHub Copilot Token',
|
|
38
13
|
name: 'token',
|
|
39
14
|
type: 'string',
|
|
40
15
|
typeOptions: {
|
|
@@ -42,56 +17,38 @@ class GitHubCopilotOAuth2Api {
|
|
|
42
17
|
},
|
|
43
18
|
default: '',
|
|
44
19
|
required: true,
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
20
|
+
description: `🔑 <strong>COPIE SEU TOKEN AQUI (formato: gho_*)</strong><br/><br/>
|
|
21
|
+
<strong>🚀 MÉTODO FÁCIL (Automático):</strong><br/>
|
|
22
|
+
1. Abra terminal no projeto<br/>
|
|
23
|
+
2. Execute: <code>node get-copilot-token.js</code><br/>
|
|
24
|
+
3. Siga o fluxo OAuth no navegador<br/>
|
|
25
|
+
4. Cole o token gerado aqui<br/><br/>
|
|
26
|
+
<strong>🔧 MÉTODO MANUAL:</strong><br/>
|
|
27
|
+
1. Acesse: <a href="https://github.com/login/device" target="_blank">https://github.com/login/device</a><br/>
|
|
28
|
+
2. Client ID: <code>01ab8ac9400c4e429b23</code><br/>
|
|
29
|
+
3. Digite o código de 8 caracteres que será gerado<br/>
|
|
30
|
+
4. Autorize a aplicação<br/>
|
|
31
|
+
5. Copie o token final aqui<br/><br/>
|
|
32
|
+
<em>💡 O script automatizado é muito mais fácil!</em>`,
|
|
51
33
|
placeholder: 'gho_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
|
|
52
34
|
},
|
|
53
35
|
{
|
|
54
|
-
displayName: 'Device Flow
|
|
55
|
-
name: '
|
|
36
|
+
displayName: 'Gerar Código Device Flow',
|
|
37
|
+
name: 'deviceFlowHelp',
|
|
56
38
|
type: 'notice',
|
|
57
39
|
default: '',
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
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'],
|
|
80
|
-
},
|
|
81
|
-
},
|
|
82
|
-
description: 'GitHub OAuth App Client ID (VS Code default)',
|
|
83
|
-
},
|
|
84
|
-
{
|
|
85
|
-
displayName: 'Scopes',
|
|
86
|
-
name: 'scopes',
|
|
87
|
-
type: 'string',
|
|
88
|
-
default: 'repo user:email',
|
|
89
|
-
displayOptions: {
|
|
90
|
-
show: {
|
|
91
|
-
authMethod: ['deviceFlow'],
|
|
92
|
-
},
|
|
93
|
-
},
|
|
94
|
-
description: 'OAuth scopes required for GitHub Copilot access',
|
|
40
|
+
description: `<strong>🎯 PARA OAUTH MANUAL:</strong><br/><br/>
|
|
41
|
+
<strong>1. URL do Device Flow:</strong><br/>
|
|
42
|
+
🌐 <a href="https://github.com/login/device" target="_blank" style="font-size: 16px; color: #0066cc; text-decoration: underline;">CLIQUE AQUI PARA GERAR CÓDIGO</a><br/><br/>
|
|
43
|
+
<strong>2. Client ID para usar:</strong><br/>
|
|
44
|
+
📋 <code style="background: #f5f5f5; padding: 4px; border: 1px solid #ddd;">01ab8ac9400c4e429b23</code><br/><br/>
|
|
45
|
+
<strong>3. Scopes necessários:</strong><br/>
|
|
46
|
+
🔐 <code>repo user:email</code><br/><br/>
|
|
47
|
+
<strong>4. O que vai acontecer:</strong><br/>
|
|
48
|
+
• GitHub vai gerar um código de 8 caracteres<br/>
|
|
49
|
+
• Você autoriza no navegador<br/>
|
|
50
|
+
• Copia o token final no campo acima<br/><br/>
|
|
51
|
+
<em>💡 Dica: Use o script <code>get-copilot-token.js</code> que faz tudo isso automaticamente!</em>`,
|
|
95
52
|
},
|
|
96
53
|
];
|
|
97
54
|
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.2",
|
|
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",
|