n8n-nodes-github-copilot 3.11.1 → 3.12.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.
|
@@ -33,45 +33,12 @@ class GitHubCopilotChatModel {
|
|
|
33
33
|
outputs: ["ai_languageModel"],
|
|
34
34
|
outputNames: ['Model'],
|
|
35
35
|
credentials: [
|
|
36
|
-
{
|
|
37
|
-
name: 'githubApiManual',
|
|
38
|
-
required: true,
|
|
39
|
-
displayOptions: {
|
|
40
|
-
show: {
|
|
41
|
-
credentialType: ['manual'],
|
|
42
|
-
},
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
36
|
{
|
|
46
37
|
name: 'githubOAuth2Api',
|
|
47
38
|
required: true,
|
|
48
|
-
displayOptions: {
|
|
49
|
-
show: {
|
|
50
|
-
credentialType: ['oauth2'],
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
39
|
},
|
|
54
40
|
],
|
|
55
41
|
properties: [
|
|
56
|
-
{
|
|
57
|
-
displayName: 'Credential Type',
|
|
58
|
-
name: 'credentialType',
|
|
59
|
-
type: 'options',
|
|
60
|
-
options: [
|
|
61
|
-
{
|
|
62
|
-
name: 'OAuth2 (Recommended)',
|
|
63
|
-
value: 'oauth2',
|
|
64
|
-
description: 'Use OAuth2 authentication for enterprise/organization accounts',
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
name: 'Manual Token',
|
|
68
|
-
value: 'manual',
|
|
69
|
-
description: 'Use manual token for development/personal accounts',
|
|
70
|
-
},
|
|
71
|
-
],
|
|
72
|
-
default: 'oauth2',
|
|
73
|
-
description: 'Choose the authentication method',
|
|
74
|
-
},
|
|
75
42
|
{
|
|
76
43
|
displayName: 'Model',
|
|
77
44
|
name: 'model',
|
|
@@ -139,31 +106,20 @@ class GitHubCopilotChatModel {
|
|
|
139
106
|
async supplyData(itemIndex) {
|
|
140
107
|
var _a;
|
|
141
108
|
const model = this.getNodeParameter('model', itemIndex);
|
|
142
|
-
const credentialType = this.getNodeParameter('credentialType', itemIndex, 'oauth2');
|
|
143
109
|
const options = this.getNodeParameter('options', itemIndex, {});
|
|
144
110
|
const modelInfo = GitHubCopilotModels_1.GitHubCopilotModelsManager.getModelByValue(model);
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
console.error('❌ Available OAuth2 credential properties:', Object.keys(credentials));
|
|
154
|
-
throw new Error('GitHub Copilot: No access token found in OAuth2 credentials. Available properties: ' + Object.keys(credentials).join(', '));
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
else {
|
|
158
|
-
const credentials = await this.getCredentials('githubApiManual');
|
|
159
|
-
token = credentials.accessToken;
|
|
160
|
-
if (!token) {
|
|
161
|
-
throw new Error('GitHub Copilot: No access token found in manual credentials');
|
|
162
|
-
}
|
|
111
|
+
const credentials = await this.getCredentials('githubOAuth2Api');
|
|
112
|
+
const token = (credentials.accessToken ||
|
|
113
|
+
credentials.access_token ||
|
|
114
|
+
((_a = credentials.oauthTokenData) === null || _a === void 0 ? void 0 : _a.access_token) ||
|
|
115
|
+
credentials.token);
|
|
116
|
+
if (!token) {
|
|
117
|
+
console.error('❌ Available OAuth2 credential properties:', Object.keys(credentials));
|
|
118
|
+
throw new Error('GitHub Copilot: No access token found in OAuth2 credentials. Available properties: ' + Object.keys(credentials).join(', '));
|
|
163
119
|
}
|
|
164
120
|
const tokenPrefix = token.substring(0, Math.min(4, token.indexOf('_') + 1)) || token.substring(0, 4);
|
|
165
121
|
const tokenSuffix = token.substring(Math.max(0, token.length - 5));
|
|
166
|
-
console.log(`🔍 GitHub Copilot ChatModel
|
|
122
|
+
console.log(`🔍 GitHub Copilot ChatModel OAuth2 Debug: Using token ${tokenPrefix}...${tokenSuffix}`);
|
|
167
123
|
if (!token.startsWith('gho_') && !token.startsWith('ghu_') && !token.startsWith('github_pat_')) {
|
|
168
124
|
console.warn(`⚠️ Unexpected token format: ${tokenPrefix}...${tokenSuffix}. Trying API call anyway.`);
|
|
169
125
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "n8n-nodes-github-copilot",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.12.0",
|
|
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",
|