n8n-nodes-github-copilot 3.38.25 → 3.38.26
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 +25 -25
- package/dist/nodes/GitHubCopilot/GitHubCopilot.node.d.ts +1 -1
- package/dist/nodes/GitHubCopilot/GitHubCopilot.node.js +166 -166
- package/dist/nodes/GitHubCopilotAuthHelper/GitHubCopilotAuthHelper.node.d.ts +1 -1
- package/dist/nodes/GitHubCopilotAuthHelper/GitHubCopilotAuthHelper.node.js +539 -539
- package/dist/nodes/GitHubCopilotChatAPI/GitHubCopilotChatAPI.node.d.ts +1 -1
- package/dist/nodes/GitHubCopilotChatAPI/GitHubCopilotChatAPI.node.js +46 -44
- package/dist/nodes/GitHubCopilotChatAPI/nodeProperties.d.ts +1 -1
- package/dist/nodes/GitHubCopilotChatAPI/nodeProperties.js +82 -82
- package/dist/nodes/GitHubCopilotChatAPI/utils/helpers.d.ts +2 -2
- package/dist/nodes/GitHubCopilotChatAPI/utils/helpers.js +26 -26
- package/dist/nodes/GitHubCopilotChatAPI/utils/imageProcessor.d.ts +2 -2
- package/dist/nodes/GitHubCopilotChatAPI/utils/imageProcessor.js +12 -12
- package/dist/nodes/GitHubCopilotChatAPI/utils/index.d.ts +4 -4
- package/dist/nodes/GitHubCopilotChatAPI/utils/mediaDetection.d.ts +3 -3
- package/dist/nodes/GitHubCopilotChatAPI/utils/mediaDetection.js +19 -19
- package/dist/nodes/GitHubCopilotChatAPI/utils/modelCapabilities.d.ts +1 -1
- package/dist/nodes/GitHubCopilotChatAPI/utils/modelCapabilities.js +23 -23
- package/dist/nodes/GitHubCopilotChatAPI/utils/types.d.ts +5 -5
- package/dist/nodes/GitHubCopilotChatModel/GitHubCopilotChatModel.node.d.ts +1 -1
- package/dist/nodes/GitHubCopilotChatModel/GitHubCopilotChatModel.node.js +115 -106
- package/dist/nodes/GitHubCopilotEmbeddings/GitHubCopilotEmbeddings.node.d.ts +1 -1
- package/dist/nodes/GitHubCopilotEmbeddings/GitHubCopilotEmbeddings.node.js +114 -114
- package/dist/nodes/GitHubCopilotOpenAI/GitHubCopilotOpenAI.node.d.ts +1 -1
- package/dist/nodes/GitHubCopilotOpenAI/GitHubCopilotOpenAI.node.js +74 -69
- package/dist/nodes/GitHubCopilotOpenAI/nodeProperties.d.ts +1 -1
- package/dist/nodes/GitHubCopilotOpenAI/nodeProperties.js +181 -181
- package/dist/nodes/GitHubCopilotOpenAI/utils/index.d.ts +2 -2
- package/dist/nodes/GitHubCopilotOpenAI/utils/openaiCompat.d.ts +10 -10
- package/dist/nodes/GitHubCopilotOpenAI/utils/openaiCompat.js +53 -53
- package/dist/nodes/GitHubCopilotOpenAI/utils/types.d.ts +12 -12
- package/dist/nodes/GitHubCopilotTest/GitHubCopilotTest.node.d.ts +1 -1
- package/dist/nodes/GitHubCopilotTest/GitHubCopilotTest.node.js +120 -116
- package/dist/package.json +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ICredentialType, INodeProperties, ICredentialTestRequest, IHttpRequestOptions, ICredentialDataDecryptedObject } from
|
|
1
|
+
import { ICredentialType, INodeProperties, ICredentialTestRequest, IHttpRequestOptions, ICredentialDataDecryptedObject } from 'n8n-workflow';
|
|
2
2
|
export declare class GitHubCopilotApi implements ICredentialType {
|
|
3
3
|
name: string;
|
|
4
4
|
displayName: string;
|
|
@@ -5,48 +5,48 @@ const GitHubCopilotEndpoints_1 = require("../shared/utils/GitHubCopilotEndpoints
|
|
|
5
5
|
const OAuthTokenManager_1 = require("../shared/utils/OAuthTokenManager");
|
|
6
6
|
class GitHubCopilotApi {
|
|
7
7
|
constructor() {
|
|
8
|
-
this.name =
|
|
9
|
-
this.displayName =
|
|
10
|
-
this.documentationUrl =
|
|
8
|
+
this.name = 'githubCopilotApi';
|
|
9
|
+
this.displayName = 'GitHub Copilot API (GitHub CLI Token)';
|
|
10
|
+
this.documentationUrl = 'https://docs.github.com/en/copilot/github-copilot-chat/copilot-chat-in-ides/using-github-copilot-chat-in-your-ide';
|
|
11
11
|
this.properties = [
|
|
12
12
|
{
|
|
13
|
-
displayName:
|
|
14
|
-
name:
|
|
15
|
-
type:
|
|
16
|
-
default:
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
displayName: 'Setup Instructions',
|
|
14
|
+
name: 'setupNotice',
|
|
15
|
+
type: 'notice',
|
|
16
|
+
default: '<strong>ℹ️ Auto OAuth Token Generation</strong><br>' +
|
|
17
|
+
'Your GitHub CLI token will be used to automatically generate OAuth tokens. Tokens are cached and refreshed automatically before expiration (every ~20 minutes). No manual intervention needed!<br><br>' +
|
|
18
|
+
'<strong>⚠️ IMPORTANT: GitHub CLI Token Required</strong><br><br>' +
|
|
19
19
|
"<strong>🚀 Don't have GitHub CLI installed?</strong><br>" +
|
|
20
20
|
"Use the visual 'GitHub Copilot Auth Helper' node to generate your token without touching the terminal!<br><br>" +
|
|
21
|
-
|
|
21
|
+
'<strong>📝 Step 1: Create Helper Workflow</strong><br>' +
|
|
22
22
|
"Add a new workflow and insert the 'GitHub Copilot Auth Helper' trigger node.<br><br>" +
|
|
23
|
-
|
|
23
|
+
'<strong>▶️ Step 2: Activate & Access</strong><br>' +
|
|
24
24
|
"Activate the workflow, then click 'Test workflow' to open the visual token generator in your browser.<br><br>" +
|
|
25
|
-
|
|
25
|
+
'<strong>📋 Step 3: Copy Token</strong><br>' +
|
|
26
26
|
"Follow the on-screen instructions to authenticate with GitHub and copy the generated 'gho_' token back here.",
|
|
27
27
|
},
|
|
28
28
|
{
|
|
29
|
-
displayName:
|
|
30
|
-
name:
|
|
31
|
-
type:
|
|
29
|
+
displayName: 'GitHub CLI Token',
|
|
30
|
+
name: 'token',
|
|
31
|
+
type: 'string',
|
|
32
32
|
typeOptions: {
|
|
33
33
|
password: true,
|
|
34
34
|
},
|
|
35
|
-
default:
|
|
35
|
+
default: '',
|
|
36
36
|
required: true,
|
|
37
37
|
description: "Token generated by GitHub CLI (starts with 'gho_'). OAuth tokens will be auto-generated and refreshed from this token.",
|
|
38
|
-
placeholder:
|
|
38
|
+
placeholder: 'gho_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
|
|
39
39
|
},
|
|
40
40
|
];
|
|
41
41
|
this.test = {
|
|
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
|
headers: {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
'User-Agent': 'GitHub-Copilot/1.0 (n8n-node)',
|
|
48
|
+
'Editor-Version': 'vscode/1.95.0',
|
|
49
|
+
'Editor-Plugin-Version': 'copilot/1.0.0',
|
|
50
50
|
},
|
|
51
51
|
},
|
|
52
52
|
};
|
|
@@ -54,9 +54,9 @@ class GitHubCopilotApi {
|
|
|
54
54
|
async authenticate(credentials, requestOptions) {
|
|
55
55
|
const githubToken = credentials.token;
|
|
56
56
|
if (!githubToken) {
|
|
57
|
-
throw new Error(
|
|
57
|
+
throw new Error('GitHub CLI token is required');
|
|
58
58
|
}
|
|
59
|
-
if (!githubToken.startsWith(
|
|
59
|
+
if (!githubToken.startsWith('gho_')) {
|
|
60
60
|
throw new Error("Invalid token format. GitHub CLI token must start with 'gho_'");
|
|
61
61
|
}
|
|
62
62
|
let authToken;
|
|
@@ -70,8 +70,8 @@ class GitHubCopilotApi {
|
|
|
70
70
|
requestOptions.headers = {};
|
|
71
71
|
}
|
|
72
72
|
requestOptions.headers.Authorization = `Bearer ${authToken}`;
|
|
73
|
-
requestOptions.headers.Accept =
|
|
74
|
-
requestOptions.headers[
|
|
73
|
+
requestOptions.headers.Accept = 'application/json';
|
|
74
|
+
requestOptions.headers['Content-Type'] = 'application/json';
|
|
75
75
|
return requestOptions;
|
|
76
76
|
}
|
|
77
77
|
}
|
|
@@ -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[][]>;
|