n8n-nodes-github-copilot 3.27.6 → 3.28.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/dist/credentials/GitHubCopilotApi.credentials.d.ts +1 -1
- package/dist/credentials/GitHubCopilotApi.credentials.js +19 -19
- package/dist/credentials/GitHubCopilotOAuth2Api.credentials.backup.d.ts +1 -1
- package/dist/credentials/GitHubCopilotOAuth2Api.credentials.backup.js +71 -71
- package/dist/credentials/GitHubCopilotOAuth2Api.credentials.d.ts +1 -1
- package/dist/credentials/GitHubCopilotOAuth2Api.credentials.js +67 -67
- package/dist/credentials/GitHubCopilotOAuth2Api.credentials.oauth.d.ts +1 -1
- package/dist/credentials/GitHubCopilotOAuth2Api.credentials.oauth.js +38 -38
- package/dist/nodes/GitHubCopilot/GitHubCopilot.node.d.ts +1 -1
- package/dist/nodes/GitHubCopilot/GitHubCopilot.node.js +188 -181
- package/dist/nodes/GitHubCopilotChatAPI/GitHubCopilotChatAPI.node.d.ts +1 -1
- package/dist/nodes/GitHubCopilotChatAPI/GitHubCopilotChatAPI.node.js +38 -38
- package/dist/nodes/GitHubCopilotChatAPI/nodeProperties.d.ts +1 -1
- package/dist/nodes/GitHubCopilotChatAPI/nodeProperties.js +97 -97
- package/dist/nodes/GitHubCopilotChatAPI/utils/imageProcessor.d.ts +2 -2
- package/dist/nodes/GitHubCopilotChatAPI/utils/imageProcessor.js +16 -15
- package/dist/nodes/GitHubCopilotChatAPI/utils/index.d.ts +3 -3
- package/dist/nodes/GitHubCopilotChatAPI/utils/mediaDetection.d.ts +3 -3
- package/dist/nodes/GitHubCopilotChatAPI/utils/mediaDetection.js +20 -26
- package/dist/nodes/GitHubCopilotChatAPI/utils/modelCapabilities.d.ts +1 -1
- package/dist/nodes/GitHubCopilotChatAPI/utils/modelCapabilities.js +24 -24
- package/dist/nodes/GitHubCopilotChatAPI/utils/types.d.ts +4 -4
- package/dist/nodes/GitHubCopilotChatModel/GitHubCopilotChatModel.node.d.ts +1 -1
- package/dist/nodes/GitHubCopilotChatModel/GitHubCopilotChatModel.node.js +86 -82
- package/dist/nodes/GitHubCopilotOpenAI/GitHubCopilotOpenAI.node.d.ts +5 -0
- package/dist/nodes/GitHubCopilotOpenAI/GitHubCopilotOpenAI.node.js +142 -0
- package/dist/nodes/GitHubCopilotOpenAI/nodeProperties.d.ts +2 -0
- package/dist/nodes/GitHubCopilotOpenAI/nodeProperties.js +326 -0
- package/dist/nodes/GitHubCopilotOpenAI/utils/index.d.ts +2 -0
- package/dist/nodes/GitHubCopilotOpenAI/utils/index.js +24 -0
- package/dist/nodes/GitHubCopilotOpenAI/utils/openaiCompat.d.ts +95 -0
- package/dist/nodes/GitHubCopilotOpenAI/utils/openaiCompat.js +175 -0
- package/dist/nodes/GitHubCopilotOpenAI/utils/types.d.ts +101 -0
- package/dist/nodes/GitHubCopilotOpenAI/utils/types.js +2 -0
- package/dist/nodes/GitHubCopilotTest/GitHubCopilotTest.node.d.ts +1 -1
- package/dist/nodes/GitHubCopilotTest/GitHubCopilotTest.node.js +96 -94
- package/package.json +75 -74
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ICredentialType, INodeProperties, ICredentialTestRequest, IAuthenticateGeneric } from
|
|
1
|
+
import { ICredentialType, INodeProperties, ICredentialTestRequest, IAuthenticateGeneric } from "n8n-workflow";
|
|
2
2
|
export declare class GitHubCopilotApi implements ICredentialType {
|
|
3
3
|
name: string;
|
|
4
4
|
displayName: string;
|
|
@@ -4,37 +4,37 @@ exports.GitHubCopilotApi = void 0;
|
|
|
4
4
|
const GitHubCopilotEndpoints_1 = require("../shared/utils/GitHubCopilotEndpoints");
|
|
5
5
|
class GitHubCopilotApi {
|
|
6
6
|
constructor() {
|
|
7
|
-
this.name =
|
|
8
|
-
this.displayName =
|
|
9
|
-
this.documentationUrl =
|
|
7
|
+
this.name = "githubCopilotApi";
|
|
8
|
+
this.displayName = "GitHub Copilot API (GitHub CLI Token)";
|
|
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:
|
|
14
|
-
type:
|
|
15
|
-
default:
|
|
16
|
-
description:
|
|
12
|
+
displayName: "⚠️ IMPORTANT: GitHub CLI Token Required",
|
|
13
|
+
name: "notice",
|
|
14
|
+
type: "notice",
|
|
15
|
+
default: "",
|
|
16
|
+
description: "Only tokens generated by GitHub CLI work with Copilot API. OAuth2 and Personal Access Tokens from GitHub website DO NOT work.",
|
|
17
17
|
},
|
|
18
18
|
{
|
|
19
|
-
displayName:
|
|
20
|
-
name:
|
|
21
|
-
type:
|
|
19
|
+
displayName: "GitHub CLI Token",
|
|
20
|
+
name: "token",
|
|
21
|
+
type: "string",
|
|
22
22
|
typeOptions: {
|
|
23
23
|
password: true,
|
|
24
24
|
},
|
|
25
|
-
default:
|
|
25
|
+
default: "",
|
|
26
26
|
required: true,
|
|
27
|
-
description:
|
|
28
|
-
placeholder:
|
|
27
|
+
description: "⚠️ REQUIRED: Token generated by GitHub CLI that starts with \"gho_\". Get it by running: gh auth login && gh auth token. Other tokens will NOT work!",
|
|
28
|
+
placeholder: "gho_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
|
|
29
29
|
},
|
|
30
30
|
];
|
|
31
31
|
this.authenticate = {
|
|
32
|
-
type:
|
|
32
|
+
type: "generic",
|
|
33
33
|
properties: {
|
|
34
34
|
headers: {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
Authorization: "=Bearer {{$credentials.token}}",
|
|
36
|
+
Accept: "application/json",
|
|
37
|
+
"Content-Type": "application/json",
|
|
38
38
|
},
|
|
39
39
|
},
|
|
40
40
|
};
|
|
@@ -42,7 +42,7 @@ class GitHubCopilotApi {
|
|
|
42
42
|
request: {
|
|
43
43
|
baseURL: GitHubCopilotEndpoints_1.GITHUB_COPILOT_API.BASE_URL,
|
|
44
44
|
url: GitHubCopilotEndpoints_1.GITHUB_COPILOT_API.ENDPOINTS.MODELS,
|
|
45
|
-
method:
|
|
45
|
+
method: "GET",
|
|
46
46
|
},
|
|
47
47
|
};
|
|
48
48
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ICredentialType, INodeProperties, ICredentialTestRequest, IAuthenticateGeneric } from
|
|
1
|
+
import { ICredentialType, INodeProperties, ICredentialTestRequest, IAuthenticateGeneric } from "n8n-workflow";
|
|
2
2
|
export declare class GitHubCopilotOAuth2Api implements ICredentialType {
|
|
3
3
|
name: string;
|
|
4
4
|
displayName: string;
|
|
@@ -4,131 +4,131 @@ exports.GitHubCopilotOAuth2Api = void 0;
|
|
|
4
4
|
const GitHubCopilotEndpoints_1 = require("../shared/utils/GitHubCopilotEndpoints");
|
|
5
5
|
class GitHubCopilotOAuth2Api {
|
|
6
6
|
constructor() {
|
|
7
|
-
this.name =
|
|
8
|
-
this.displayName =
|
|
9
|
-
this.documentationUrl =
|
|
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
10
|
this.properties = [
|
|
11
11
|
{
|
|
12
|
-
displayName:
|
|
13
|
-
name:
|
|
14
|
-
type:
|
|
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/>
|
|
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
20
|
<em>The script handles all OAuth complexity automatically!</em>`,
|
|
21
21
|
},
|
|
22
22
|
{
|
|
23
|
-
displayName:
|
|
24
|
-
name:
|
|
25
|
-
type:
|
|
23
|
+
displayName: "Authentication Method",
|
|
24
|
+
name: "authMethod",
|
|
25
|
+
type: "options",
|
|
26
26
|
options: [
|
|
27
27
|
{
|
|
28
|
-
name:
|
|
29
|
-
value:
|
|
30
|
-
description:
|
|
28
|
+
name: "Manual Token (Paste from Script)",
|
|
29
|
+
value: "manual",
|
|
30
|
+
description: "Paste token generated by get-copilot-token.js script",
|
|
31
31
|
},
|
|
32
32
|
{
|
|
33
|
-
name:
|
|
34
|
-
value:
|
|
35
|
-
description:
|
|
33
|
+
name: "Device Flow OAuth (Interactive)",
|
|
34
|
+
value: "deviceFlow",
|
|
35
|
+
description: "Generate Device Flow code for manual authorization",
|
|
36
36
|
},
|
|
37
37
|
],
|
|
38
|
-
default:
|
|
38
|
+
default: "manual",
|
|
39
39
|
},
|
|
40
40
|
{
|
|
41
|
-
displayName:
|
|
42
|
-
name:
|
|
43
|
-
type:
|
|
41
|
+
displayName: "GitHub Copilot Token",
|
|
42
|
+
name: "token",
|
|
43
|
+
type: "string",
|
|
44
44
|
typeOptions: {
|
|
45
45
|
password: true,
|
|
46
46
|
},
|
|
47
|
-
default:
|
|
47
|
+
default: "",
|
|
48
48
|
required: true,
|
|
49
49
|
displayOptions: {
|
|
50
50
|
show: {
|
|
51
|
-
authMethod: [
|
|
51
|
+
authMethod: ["manual"],
|
|
52
52
|
},
|
|
53
53
|
},
|
|
54
|
-
description:
|
|
55
|
-
placeholder:
|
|
54
|
+
description: "🔑 Paste the token generated by <code>get-copilot-token.js</code> script (format: gho_*)",
|
|
55
|
+
placeholder: "gho_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
|
|
56
56
|
},
|
|
57
57
|
{
|
|
58
|
-
displayName:
|
|
59
|
-
name:
|
|
60
|
-
type:
|
|
61
|
-
default:
|
|
58
|
+
displayName: "🔧 Device Flow Setup",
|
|
59
|
+
name: "deviceFlowSetup",
|
|
60
|
+
type: "notice",
|
|
61
|
+
default: "",
|
|
62
62
|
displayOptions: {
|
|
63
63
|
show: {
|
|
64
|
-
authMethod: [
|
|
64
|
+
authMethod: ["deviceFlow"],
|
|
65
65
|
},
|
|
66
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/>
|
|
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
75
|
5. Get your token and paste it in Manual Token field`,
|
|
76
76
|
},
|
|
77
77
|
{
|
|
78
|
-
displayName:
|
|
79
|
-
name:
|
|
80
|
-
type:
|
|
78
|
+
displayName: "Generate Device Code",
|
|
79
|
+
name: "generateCode",
|
|
80
|
+
type: "button",
|
|
81
81
|
typeOptions: {
|
|
82
82
|
action: {
|
|
83
|
-
type:
|
|
84
|
-
displayName:
|
|
83
|
+
type: "generateDeviceCode",
|
|
84
|
+
displayName: "🎲 Generate 8-Character Code",
|
|
85
85
|
},
|
|
86
86
|
},
|
|
87
|
-
default:
|
|
87
|
+
default: "",
|
|
88
88
|
displayOptions: {
|
|
89
89
|
show: {
|
|
90
|
-
authMethod: [
|
|
90
|
+
authMethod: ["deviceFlow"],
|
|
91
91
|
},
|
|
92
92
|
},
|
|
93
|
-
description:
|
|
93
|
+
description: "Click to generate an 8-character code for Device Flow OAuth",
|
|
94
94
|
},
|
|
95
95
|
{
|
|
96
|
-
displayName:
|
|
97
|
-
name:
|
|
98
|
-
type:
|
|
99
|
-
default:
|
|
96
|
+
displayName: "Device Code",
|
|
97
|
+
name: "deviceCode",
|
|
98
|
+
type: "string",
|
|
99
|
+
default: "",
|
|
100
100
|
displayOptions: {
|
|
101
101
|
show: {
|
|
102
|
-
authMethod: [
|
|
102
|
+
authMethod: ["deviceFlow"],
|
|
103
103
|
},
|
|
104
104
|
},
|
|
105
|
-
description:
|
|
106
|
-
placeholder:
|
|
105
|
+
description: "🔤 8-character code for GitHub Device Flow (generated automatically)",
|
|
106
|
+
placeholder: "ABCD-EFGH",
|
|
107
107
|
},
|
|
108
108
|
{
|
|
109
|
-
displayName:
|
|
110
|
-
name:
|
|
111
|
-
type:
|
|
112
|
-
default:
|
|
109
|
+
displayName: "Verification URL",
|
|
110
|
+
name: "verificationUrl",
|
|
111
|
+
type: "string",
|
|
112
|
+
default: "https://github.com/login/device",
|
|
113
113
|
displayOptions: {
|
|
114
114
|
show: {
|
|
115
|
-
authMethod: [
|
|
115
|
+
authMethod: ["deviceFlow"],
|
|
116
116
|
},
|
|
117
117
|
},
|
|
118
|
-
description:
|
|
118
|
+
description: "🌐 URL to authorize the application",
|
|
119
119
|
},
|
|
120
120
|
];
|
|
121
121
|
this.authenticate = {
|
|
122
|
-
type:
|
|
122
|
+
type: "generic",
|
|
123
123
|
properties: {
|
|
124
124
|
headers: {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
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
132
|
},
|
|
133
133
|
},
|
|
134
134
|
};
|
|
@@ -136,7 +136,7 @@ class GitHubCopilotOAuth2Api {
|
|
|
136
136
|
request: {
|
|
137
137
|
baseURL: GitHubCopilotEndpoints_1.GITHUB_COPILOT_API.BASE_URL,
|
|
138
138
|
url: GitHubCopilotEndpoints_1.GITHUB_COPILOT_API.ENDPOINTS.MODELS,
|
|
139
|
-
method:
|
|
139
|
+
method: "GET",
|
|
140
140
|
},
|
|
141
141
|
};
|
|
142
142
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ICredentialType, INodeProperties, ICredentialTestRequest, IAuthenticateGeneric } from
|
|
1
|
+
import { ICredentialType, INodeProperties, ICredentialTestRequest, IAuthenticateGeneric } from "n8n-workflow";
|
|
2
2
|
export declare class GitHubCopilotOAuth2Api implements ICredentialType {
|
|
3
3
|
name: string;
|
|
4
4
|
displayName: string;
|
|
@@ -4,107 +4,107 @@ exports.GitHubCopilotOAuth2Api = void 0;
|
|
|
4
4
|
const GitHubCopilotEndpoints_1 = require("../shared/utils/GitHubCopilotEndpoints");
|
|
5
5
|
class GitHubCopilotOAuth2Api {
|
|
6
6
|
constructor() {
|
|
7
|
-
this.name =
|
|
8
|
-
this.displayName =
|
|
9
|
-
this.documentationUrl =
|
|
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
10
|
this.properties = [
|
|
11
11
|
{
|
|
12
|
-
displayName:
|
|
13
|
-
name:
|
|
14
|
-
type:
|
|
12
|
+
displayName: "🎯 Como obter seu token",
|
|
13
|
+
name: "authMethod",
|
|
14
|
+
type: "options",
|
|
15
15
|
options: [
|
|
16
16
|
{
|
|
17
|
-
name:
|
|
18
|
-
value:
|
|
19
|
-
description:
|
|
17
|
+
name: "🚀 Script Automático (RECOMENDADO)",
|
|
18
|
+
value: "script",
|
|
19
|
+
description: "Execute: node get-copilot-token.js no terminal",
|
|
20
20
|
},
|
|
21
21
|
{
|
|
22
|
-
name:
|
|
23
|
-
value:
|
|
24
|
-
description:
|
|
22
|
+
name: "🔧 OAuth Manual no GitHub",
|
|
23
|
+
value: "manual",
|
|
24
|
+
description: "Processo manual no site do GitHub",
|
|
25
25
|
},
|
|
26
26
|
{
|
|
27
|
-
name:
|
|
28
|
-
value:
|
|
29
|
-
description:
|
|
27
|
+
name: "📋 Já tenho o token",
|
|
28
|
+
value: "have_token",
|
|
29
|
+
description: "Pular instruções e inserir token",
|
|
30
30
|
},
|
|
31
31
|
],
|
|
32
|
-
default:
|
|
33
|
-
description:
|
|
32
|
+
default: "script",
|
|
33
|
+
description: "Escolha como quer obter seu token GitHub Copilot",
|
|
34
34
|
},
|
|
35
35
|
{
|
|
36
|
-
displayName:
|
|
37
|
-
name:
|
|
38
|
-
type:
|
|
39
|
-
default:
|
|
36
|
+
displayName: "🚀 Execute o Script Automático",
|
|
37
|
+
name: "scriptInstructions",
|
|
38
|
+
type: "notice",
|
|
39
|
+
default: "",
|
|
40
40
|
displayOptions: {
|
|
41
41
|
show: {
|
|
42
|
-
authMethod: [
|
|
42
|
+
authMethod: ["script"],
|
|
43
43
|
},
|
|
44
44
|
},
|
|
45
|
-
description: `<div style="background: #e8f5e8; padding: 15px; border: 2px solid #4CAF50; border-radius: 8px;">
|
|
46
|
-
<strong style="color: #2E7D32; font-size: 16px;">📋 SCRIPT AUTOMÁTICO (MAIS FÁCIL)</strong><br/><br/>
|
|
47
|
-
<strong>1. Abra o terminal:</strong><br/>
|
|
48
|
-
<code style="background: #f0f0f0; padding: 8px; border-radius: 4px; display: block; margin: 8px 0;">cd z:\\Desenvolvimento\\n8n-nodes-copilot</code><br/>
|
|
49
|
-
<strong>2. Execute o script:</strong><br/>
|
|
50
|
-
<code style="background: #f0f0f0; padding: 8px; border-radius: 4px; display: block; margin: 8px 0;">node get-copilot-token.js</code><br/>
|
|
51
|
-
<strong>3. Siga as instruções:</strong><br/>
|
|
52
|
-
• O script abre o navegador automaticamente<br/>
|
|
53
|
-
• Faça login no GitHub se necessário<br/>
|
|
54
|
-
• Autorize a aplicação<br/>
|
|
55
|
-
• O token será exibido no terminal<br/><br/>
|
|
56
|
-
<strong>4. Copie o token e cole no campo abaixo</strong>
|
|
45
|
+
description: `<div style="background: #e8f5e8; padding: 15px; border: 2px solid #4CAF50; border-radius: 8px;">
|
|
46
|
+
<strong style="color: #2E7D32; font-size: 16px;">📋 SCRIPT AUTOMÁTICO (MAIS FÁCIL)</strong><br/><br/>
|
|
47
|
+
<strong>1. Abra o terminal:</strong><br/>
|
|
48
|
+
<code style="background: #f0f0f0; padding: 8px; border-radius: 4px; display: block; margin: 8px 0;">cd z:\\Desenvolvimento\\n8n-nodes-copilot</code><br/>
|
|
49
|
+
<strong>2. Execute o script:</strong><br/>
|
|
50
|
+
<code style="background: #f0f0f0; padding: 8px; border-radius: 4px; display: block; margin: 8px 0;">node get-copilot-token.js</code><br/>
|
|
51
|
+
<strong>3. Siga as instruções:</strong><br/>
|
|
52
|
+
• O script abre o navegador automaticamente<br/>
|
|
53
|
+
• Faça login no GitHub se necessário<br/>
|
|
54
|
+
• Autorize a aplicação<br/>
|
|
55
|
+
• O token será exibido no terminal<br/><br/>
|
|
56
|
+
<strong>4. Copie o token e cole no campo abaixo</strong>
|
|
57
57
|
</div>`,
|
|
58
58
|
},
|
|
59
59
|
{
|
|
60
|
-
displayName:
|
|
61
|
-
name:
|
|
62
|
-
type:
|
|
63
|
-
default:
|
|
60
|
+
displayName: "🔧 OAuth Manual no GitHub",
|
|
61
|
+
name: "manualInstructions",
|
|
62
|
+
type: "notice",
|
|
63
|
+
default: "",
|
|
64
64
|
displayOptions: {
|
|
65
65
|
show: {
|
|
66
|
-
authMethod: [
|
|
66
|
+
authMethod: ["manual"],
|
|
67
67
|
},
|
|
68
68
|
},
|
|
69
|
-
description: `<div style="background: #fff3e0; padding: 15px; border: 2px solid #FF9800; border-radius: 8px;">
|
|
70
|
-
<strong style="color: #E65100; font-size: 16px;">📋 PROCESSO MANUAL</strong><br/><br/>
|
|
71
|
-
<strong>1. Abra esta URL:</strong><br/>
|
|
72
|
-
<a href="https://github.com/login/device" target="_blank" style="background: #2196F3; color: white; padding: 10px 15px; text-decoration: none; border-radius: 5px; display: inline-block; margin: 8px 0;">🌐 CLIQUE AQUI - GitHub Device Flow</a><br/><br/>
|
|
73
|
-
<strong>2. Cole este Client ID:</strong><br/>
|
|
74
|
-
<code style="background: #f0f0f0; padding: 8px; border-radius: 4px; display: block; margin: 8px 0; font-size: 14px;">01ab8ac9400c4e429b23</code><br/>
|
|
75
|
-
<strong>3. Cole estes Scopes:</strong><br/>
|
|
76
|
-
<code style="background: #f0f0f0; padding: 8px; border-radius: 4px; display: block; margin: 8px 0;">repo user:email</code><br/>
|
|
77
|
-
<strong>4. Processo:</strong><br/>
|
|
78
|
-
• GitHub gera código de 8 caracteres<br/>
|
|
79
|
-
• Autorize a aplicação<br/>
|
|
80
|
-
• Copie o token final<br/><br/>
|
|
81
|
-
<strong>5. Cole o token no campo abaixo</strong>
|
|
69
|
+
description: `<div style="background: #fff3e0; padding: 15px; border: 2px solid #FF9800; border-radius: 8px;">
|
|
70
|
+
<strong style="color: #E65100; font-size: 16px;">📋 PROCESSO MANUAL</strong><br/><br/>
|
|
71
|
+
<strong>1. Abra esta URL:</strong><br/>
|
|
72
|
+
<a href="https://github.com/login/device" target="_blank" style="background: #2196F3; color: white; padding: 10px 15px; text-decoration: none; border-radius: 5px; display: inline-block; margin: 8px 0;">🌐 CLIQUE AQUI - GitHub Device Flow</a><br/><br/>
|
|
73
|
+
<strong>2. Cole este Client ID:</strong><br/>
|
|
74
|
+
<code style="background: #f0f0f0; padding: 8px; border-radius: 4px; display: block; margin: 8px 0; font-size: 14px;">01ab8ac9400c4e429b23</code><br/>
|
|
75
|
+
<strong>3. Cole estes Scopes:</strong><br/>
|
|
76
|
+
<code style="background: #f0f0f0; padding: 8px; border-radius: 4px; display: block; margin: 8px 0;">repo user:email</code><br/>
|
|
77
|
+
<strong>4. Processo:</strong><br/>
|
|
78
|
+
• GitHub gera código de 8 caracteres<br/>
|
|
79
|
+
• Autorize a aplicação<br/>
|
|
80
|
+
• Copie o token final<br/><br/>
|
|
81
|
+
<strong>5. Cole o token no campo abaixo</strong>
|
|
82
82
|
</div>`,
|
|
83
83
|
},
|
|
84
84
|
{
|
|
85
|
-
displayName:
|
|
86
|
-
name:
|
|
87
|
-
type:
|
|
85
|
+
displayName: "GitHub Copilot Token",
|
|
86
|
+
name: "token",
|
|
87
|
+
type: "string",
|
|
88
88
|
typeOptions: {
|
|
89
89
|
password: true,
|
|
90
90
|
},
|
|
91
|
-
default:
|
|
91
|
+
default: "",
|
|
92
92
|
required: true,
|
|
93
|
-
description:
|
|
94
|
-
placeholder:
|
|
93
|
+
description: "🔑 Cole aqui seu token GitHub Copilot (formato: gho_*)",
|
|
94
|
+
placeholder: "gho_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
|
|
95
95
|
},
|
|
96
96
|
];
|
|
97
97
|
this.authenticate = {
|
|
98
|
-
type:
|
|
98
|
+
type: "generic",
|
|
99
99
|
properties: {
|
|
100
100
|
headers: {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
101
|
+
Authorization: "=Bearer {{$credentials.token}}",
|
|
102
|
+
Accept: "application/json",
|
|
103
|
+
"Content-Type": "application/json",
|
|
104
|
+
"User-Agent": "GitHub-Copilot-Chat/1.0.0 VSCode/1.85.0",
|
|
105
|
+
"Editor-Version": "vscode/1.85.0",
|
|
106
|
+
"Editor-Plugin-Version": "copilot-chat/0.12.0",
|
|
107
|
+
"X-GitHub-Api-Version": "2025-04-01",
|
|
108
108
|
},
|
|
109
109
|
},
|
|
110
110
|
};
|
|
@@ -112,7 +112,7 @@ class GitHubCopilotOAuth2Api {
|
|
|
112
112
|
request: {
|
|
113
113
|
baseURL: GitHubCopilotEndpoints_1.GITHUB_COPILOT_API.BASE_URL,
|
|
114
114
|
url: GitHubCopilotEndpoints_1.GITHUB_COPILOT_API.ENDPOINTS.MODELS,
|
|
115
|
-
method:
|
|
115
|
+
method: "GET",
|
|
116
116
|
},
|
|
117
117
|
};
|
|
118
118
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ICredentialType, INodeProperties, ICredentialTestRequest } from
|
|
1
|
+
import type { ICredentialType, INodeProperties, ICredentialTestRequest } from "n8n-workflow";
|
|
2
2
|
export declare class GitHubCopilotOAuth2Api implements ICredentialType {
|
|
3
3
|
name: string;
|
|
4
4
|
extends: string[];
|
|
@@ -4,60 +4,60 @@ exports.GitHubCopilotOAuth2Api = void 0;
|
|
|
4
4
|
const GitHubCopilotEndpoints_1 = require("../shared/utils/GitHubCopilotEndpoints");
|
|
5
5
|
class GitHubCopilotOAuth2Api {
|
|
6
6
|
constructor() {
|
|
7
|
-
this.name =
|
|
8
|
-
this.extends = [
|
|
9
|
-
this.displayName =
|
|
10
|
-
this.documentationUrl =
|
|
7
|
+
this.name = "githubCopilotOAuth2Api";
|
|
8
|
+
this.extends = ["oAuth2Api"];
|
|
9
|
+
this.displayName = "GitHub Copilot OAuth2 API";
|
|
10
|
+
this.documentationUrl = "github";
|
|
11
11
|
this.properties = [
|
|
12
12
|
{
|
|
13
|
-
displayName:
|
|
14
|
-
name:
|
|
15
|
-
type:
|
|
16
|
-
default:
|
|
13
|
+
displayName: "Grant Type",
|
|
14
|
+
name: "grantType",
|
|
15
|
+
type: "hidden",
|
|
16
|
+
default: "authorizationCode",
|
|
17
17
|
},
|
|
18
18
|
{
|
|
19
|
-
displayName:
|
|
20
|
-
name:
|
|
21
|
-
type:
|
|
22
|
-
default:
|
|
19
|
+
displayName: "Client ID",
|
|
20
|
+
name: "clientId",
|
|
21
|
+
type: "hidden",
|
|
22
|
+
default: "01ab8ac9400c4e429b23",
|
|
23
23
|
},
|
|
24
24
|
{
|
|
25
|
-
displayName:
|
|
26
|
-
name:
|
|
27
|
-
type:
|
|
28
|
-
default:
|
|
25
|
+
displayName: "Client Secret",
|
|
26
|
+
name: "clientSecret",
|
|
27
|
+
type: "hidden",
|
|
28
|
+
default: "",
|
|
29
29
|
},
|
|
30
30
|
{
|
|
31
|
-
displayName:
|
|
32
|
-
name:
|
|
33
|
-
type:
|
|
34
|
-
default:
|
|
31
|
+
displayName: "Authorization URL",
|
|
32
|
+
name: "authUrl",
|
|
33
|
+
type: "hidden",
|
|
34
|
+
default: "https://github.com/login/oauth/authorize",
|
|
35
35
|
required: true,
|
|
36
36
|
},
|
|
37
37
|
{
|
|
38
|
-
displayName:
|
|
39
|
-
name:
|
|
40
|
-
type:
|
|
41
|
-
default:
|
|
38
|
+
displayName: "Access Token URL",
|
|
39
|
+
name: "accessTokenUrl",
|
|
40
|
+
type: "hidden",
|
|
41
|
+
default: "https://github.com/login/oauth/access_token",
|
|
42
42
|
required: true,
|
|
43
43
|
},
|
|
44
44
|
{
|
|
45
|
-
displayName:
|
|
46
|
-
name:
|
|
47
|
-
type:
|
|
48
|
-
default:
|
|
45
|
+
displayName: "Scope",
|
|
46
|
+
name: "scope",
|
|
47
|
+
type: "hidden",
|
|
48
|
+
default: "repo user:email",
|
|
49
49
|
},
|
|
50
50
|
{
|
|
51
|
-
displayName:
|
|
52
|
-
name:
|
|
53
|
-
type:
|
|
54
|
-
default:
|
|
51
|
+
displayName: "Auth URI Query Parameters",
|
|
52
|
+
name: "authQueryParameters",
|
|
53
|
+
type: "hidden",
|
|
54
|
+
default: "",
|
|
55
55
|
},
|
|
56
56
|
{
|
|
57
|
-
displayName:
|
|
58
|
-
name:
|
|
59
|
-
type:
|
|
60
|
-
default:
|
|
57
|
+
displayName: "Authentication",
|
|
58
|
+
name: "authentication",
|
|
59
|
+
type: "hidden",
|
|
60
|
+
default: "header",
|
|
61
61
|
},
|
|
62
62
|
];
|
|
63
63
|
this.test = {
|
|
@@ -65,8 +65,8 @@ class GitHubCopilotOAuth2Api {
|
|
|
65
65
|
baseURL: GitHubCopilotEndpoints_1.GITHUB_COPILOT_API.GITHUB_BASE_URL,
|
|
66
66
|
url: GitHubCopilotEndpoints_1.GITHUB_COPILOT_API.ENDPOINTS.USER_COPILOT,
|
|
67
67
|
headers: {
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
Accept: "application/vnd.github.v3+json",
|
|
69
|
+
"User-Agent": "n8n-GitHub-Copilot",
|
|
70
70
|
},
|
|
71
71
|
},
|
|
72
72
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from
|
|
1
|
+
import { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from "n8n-workflow";
|
|
2
2
|
export declare class GitHubCopilot implements INodeType {
|
|
3
3
|
description: INodeTypeDescription;
|
|
4
4
|
execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
|