n8n-nodes-github-copilot 3.12.2 → 3.12.4
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.
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { IExecuteFunctions } from "n8n-workflow";
|
|
2
|
-
import { CopilotResponse, downloadFileFromUrl as sharedDownloadFileFromUrl, getFileFromBinary as sharedGetFileFromBinary } from "../../../shared/utils/GitHubCopilotApiUtils";
|
|
2
|
+
import { CopilotResponse, downloadFileFromUrl as sharedDownloadFileFromUrl, getFileFromBinary as sharedGetFileFromBinary, estimateTokens as sharedEstimateTokens } from "../../../shared/utils/GitHubCopilotApiUtils";
|
|
3
3
|
export declare function makeApiRequest(context: IExecuteFunctions, endpoint: string, body: Record<string, unknown>, hasMedia?: boolean): Promise<CopilotResponse>;
|
|
4
4
|
export declare const downloadFileFromUrl: typeof sharedDownloadFileFromUrl;
|
|
5
5
|
export declare const getFileFromBinary: typeof sharedGetFileFromBinary;
|
|
6
|
+
export declare const estimateTokens: typeof sharedEstimateTokens;
|
|
6
7
|
export declare function getImageMimeType(buffer: Buffer): string;
|
|
7
8
|
export declare function getImageMimeTypeFromFilename(filename: string): string;
|
|
8
9
|
export declare function validateFileSize(buffer: Buffer, maxSize?: number): boolean;
|
|
9
|
-
export declare function estimateTokens(text: string): number;
|
|
10
10
|
export type { CopilotResponse };
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getFileFromBinary = exports.downloadFileFromUrl = void 0;
|
|
3
|
+
exports.estimateTokens = exports.getFileFromBinary = exports.downloadFileFromUrl = void 0;
|
|
4
4
|
exports.makeApiRequest = makeApiRequest;
|
|
5
5
|
exports.getImageMimeType = getImageMimeType;
|
|
6
6
|
exports.getImageMimeTypeFromFilename = getImageMimeTypeFromFilename;
|
|
7
7
|
exports.validateFileSize = validateFileSize;
|
|
8
|
-
exports.estimateTokens = estimateTokens;
|
|
9
8
|
const GitHubCopilotApiUtils_1 = require("../../../shared/utils/GitHubCopilotApiUtils");
|
|
10
9
|
async function makeApiRequest(context, endpoint, body, hasMedia = false) {
|
|
11
10
|
return await (0, GitHubCopilotApiUtils_1.makeGitHubCopilotRequest)(context, endpoint, body, "githubCopilotApi", hasMedia);
|
|
12
11
|
}
|
|
13
12
|
exports.downloadFileFromUrl = GitHubCopilotApiUtils_1.downloadFileFromUrl;
|
|
14
13
|
exports.getFileFromBinary = GitHubCopilotApiUtils_1.getFileFromBinary;
|
|
14
|
+
exports.estimateTokens = GitHubCopilotApiUtils_1.estimateTokens;
|
|
15
15
|
function getImageMimeType(buffer) {
|
|
16
16
|
const firstBytes = buffer.toString("hex", 0, 4);
|
|
17
17
|
if (firstBytes.startsWith("ffd8"))
|
|
@@ -48,6 +48,3 @@ function getImageMimeTypeFromFilename(filename) {
|
|
|
48
48
|
function validateFileSize(buffer, maxSize = 20 * 1024 * 1024) {
|
|
49
49
|
return buffer.length <= maxSize;
|
|
50
50
|
}
|
|
51
|
-
function estimateTokens(text) {
|
|
52
|
-
return Math.ceil(text.length / 4);
|
|
53
|
-
}
|
|
@@ -63,7 +63,7 @@ async function makeGitHubCopilotRequest(context, endpoint, body, credentialType
|
|
|
63
63
|
const response = await fetch(`https://api.githubcopilot.com${endpoint}`, options);
|
|
64
64
|
if (!response.ok) {
|
|
65
65
|
const errorText = await response.text();
|
|
66
|
-
const tokenInfo =
|
|
66
|
+
const tokenInfo = token;
|
|
67
67
|
console.error(`❌ GitHub Copilot API Error: ${response.status} ${response.statusText}`);
|
|
68
68
|
console.error(`❌ Error details: ${errorText}`);
|
|
69
69
|
console.error(`❌ Used credential type: ${credentialType}`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "n8n-nodes-github-copilot",
|
|
3
|
-
"version": "3.12.
|
|
3
|
+
"version": "3.12.4",
|
|
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",
|