n8n-nodes-github-copilot 1.1.0 → 1.1.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.
|
@@ -64,11 +64,21 @@ class GitHubCopilot {
|
|
|
64
64
|
name: 'gitHubApi',
|
|
65
65
|
displayName: 'GitHub API (OAuth2)',
|
|
66
66
|
required: false,
|
|
67
|
+
displayOptions: {
|
|
68
|
+
show: {
|
|
69
|
+
authType: ['oauth2'],
|
|
70
|
+
},
|
|
71
|
+
},
|
|
67
72
|
},
|
|
68
73
|
{
|
|
69
74
|
name: 'gitHubApiManual',
|
|
70
75
|
displayName: 'GitHub API (Manual Token)',
|
|
71
76
|
required: false,
|
|
77
|
+
displayOptions: {
|
|
78
|
+
show: {
|
|
79
|
+
authType: ['manual'],
|
|
80
|
+
},
|
|
81
|
+
},
|
|
72
82
|
},
|
|
73
83
|
],
|
|
74
84
|
properties: [
|
|
@@ -198,6 +208,7 @@ class GitHubCopilot {
|
|
|
198
208
|
};
|
|
199
209
|
}
|
|
200
210
|
async execute() {
|
|
211
|
+
var _a;
|
|
201
212
|
const items = this.getInputData();
|
|
202
213
|
const returnData = [];
|
|
203
214
|
for (let i = 0; i < items.length; i++) {
|
|
@@ -210,12 +221,17 @@ class GitHubCopilot {
|
|
|
210
221
|
let credentialType = '';
|
|
211
222
|
if (authType === 'oauth2') {
|
|
212
223
|
const oauthCredentials = await this.getCredentials('gitHubApi');
|
|
213
|
-
|
|
214
|
-
|
|
224
|
+
console.log('OAuth2 credentials object:', JSON.stringify(oauthCredentials, null, 2));
|
|
225
|
+
const creds = oauthCredentials;
|
|
226
|
+
accessToken = (creds === null || creds === void 0 ? void 0 : creds.accessToken) ||
|
|
227
|
+
(creds === null || creds === void 0 ? void 0 : creds.access_token) ||
|
|
228
|
+
(creds === null || creds === void 0 ? void 0 : creds.token) ||
|
|
229
|
+
((_a = creds === null || creds === void 0 ? void 0 : creds.oauthTokenData) === null || _a === void 0 ? void 0 : _a.access_token);
|
|
230
|
+
if (accessToken && typeof accessToken === 'string') {
|
|
215
231
|
credentialType = 'OAuth2';
|
|
216
232
|
}
|
|
217
233
|
else {
|
|
218
|
-
throw new n8n_workflow_1.NodeOperationError(this.getNode(),
|
|
234
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `OAuth2 token not found. Available fields: ${Object.keys(oauthCredentials || {}).join(', ')}. Please switch to Manual Token.`);
|
|
219
235
|
}
|
|
220
236
|
}
|
|
221
237
|
else {
|
package/package.json
CHANGED