GitHub workflows (#428)

Fixes #348 
Fixes #274 
Fixes #149 

- Connect to existing repos
- Push to other branches on GitHub besides main
- Allows force push (with confirmation) dialog

---------

Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
This commit is contained in:
Will Chen
2025-06-17 16:59:26 -07:00
committed by GitHub
parent 9694e4a2e8
commit bd809a010d
24 changed files with 2686 additions and 237 deletions

View File

@@ -0,0 +1,417 @@
import { Request, Response } from "express";
import * as path from "path";
import * as fs from "fs";
import * as os from "os";
const gitHttpMiddlewareFactory = require("git-http-mock-server/middleware");
// Push event tracking for tests
interface PushEvent {
timestamp: Date;
repo: string;
branch: string;
operation: "push" | "create" | "delete";
commitSha?: string;
}
const pushEvents: PushEvent[] = [];
// Mock data for testing
const mockAccessToken = "fake_access_token_12345";
const mockDeviceCode = "fake_device_code_12345";
const mockUserCode = "FAKE-CODE";
const mockUser = {
login: "testuser",
id: 12345,
email: "testuser@example.com",
};
const mockRepos = [
{
id: 1,
name: "test-repo-1",
full_name: "testuser/test-repo-1",
private: false,
owner: { login: "testuser" },
default_branch: "main",
},
{
id: 2,
name: "test-repo-2",
full_name: "testuser/test-repo-2",
private: true,
owner: { login: "testuser" },
default_branch: "main",
},
{
id: 3,
name: "existing-app",
full_name: "testuser/existing-app",
private: false,
owner: { login: "testuser" },
default_branch: "main",
},
];
const mockBranches = [
{ name: "main", commit: { sha: "abc123" } },
{ name: "develop", commit: { sha: "def456" } },
{ name: "feature/test", commit: { sha: "ghi789" } },
];
// Store device flow state
let deviceFlowState = {
deviceCode: mockDeviceCode,
userCode: mockUserCode,
authorized: false,
pollCount: 0,
};
// GitHub Device Flow - Step 1: Get device code
export function handleDeviceCode(req: Request, res: Response) {
console.log("* GitHub Device Code requested");
// Reset state for new flow
deviceFlowState = {
deviceCode: mockDeviceCode,
userCode: mockUserCode,
authorized: false,
pollCount: 0,
};
res.json({
device_code: mockDeviceCode,
user_code: mockUserCode,
verification_uri: "https://github.com/login/device",
verification_uri_complete: `https://github.com/login/device?user_code=${mockUserCode}`,
expires_in: 900,
interval: 1, // Short interval for testing
});
}
// GitHub Device Flow - Step 2: Poll for access token
export function handleAccessToken(req: Request, res: Response) {
console.log("* GitHub Access Token polling", {
pollCount: deviceFlowState.pollCount,
});
const { device_code } = req.body;
if (device_code !== mockDeviceCode) {
return res.status(400).json({
error: "invalid_request",
error_description: "Invalid device code",
});
}
deviceFlowState.pollCount++;
// Simulate authorization after 3 polls (for testing)
if (deviceFlowState.pollCount >= 3) {
deviceFlowState.authorized = true;
return res.json({
access_token: mockAccessToken,
token_type: "bearer",
scope: "repo,user,workflow",
});
}
// Return pending status
res.status(400).json({
error: "authorization_pending",
error_description: "The authorization request is still pending",
});
}
// Get authenticated user info
export function handleUser(req: Request, res: Response) {
console.log("* GitHub User info requested");
const authHeader = req.headers.authorization;
if (!authHeader || !authHeader.includes(mockAccessToken)) {
return res.status(401).json({
message: "Bad credentials",
});
}
res.json(mockUser);
}
// Get user emails
export function handleUserEmails(req: Request, res: Response) {
console.log("* GitHub User emails requested");
const authHeader = req.headers.authorization;
if (!authHeader || !authHeader.includes(mockAccessToken)) {
return res.status(401).json({
message: "Bad credentials",
});
}
res.json([
{
email: "testuser@example.com",
primary: true,
verified: true,
visibility: "public",
},
]);
}
// List user repositories
export function handleUserRepos(req: Request, res: Response) {
console.log("* GitHub User repos requested");
const authHeader = req.headers.authorization;
if (!authHeader || !authHeader.includes(mockAccessToken)) {
return res.status(401).json({
message: "Bad credentials",
});
}
if (req.method === "GET") {
// List repos
res.json(mockRepos);
} else if (req.method === "POST") {
// Create repo
const { name, private: isPrivate } = req.body;
console.log("* Creating repository:", name);
// Check if repo already exists
const existingRepo = mockRepos.find((repo) => repo.name === name);
if (existingRepo) {
return res.status(422).json({
message: "Repository creation failed.",
errors: [
{
resource: "Repository",
code: "already_exists",
field: "name",
},
],
});
}
// Create new repo
const newRepo = {
id: mockRepos.length + 1,
name,
full_name: `${mockUser.login}/${name}`,
private: !!isPrivate,
owner: { login: mockUser.login },
default_branch: "main",
};
res.status(201).json(newRepo);
}
}
// Get repository info
export function handleRepo(req: Request, res: Response) {
console.log("* GitHub Repo info requested");
const { owner, repo } = req.params;
const authHeader = req.headers.authorization;
if (!authHeader || !authHeader.includes(mockAccessToken)) {
return res.status(401).json({
message: "Bad credentials",
});
}
const foundRepo = mockRepos.find((r) => r.full_name === `${owner}/${repo}`);
if (!foundRepo) {
return res.status(404).json({
message: "Not Found",
});
}
res.json(foundRepo);
}
// Get repository branches
export function handleRepoBranches(req: Request, res: Response) {
console.log("* GitHub Repo branches requested");
const { owner, repo } = req.params;
const authHeader = req.headers.authorization;
if (!authHeader || !authHeader.includes(mockAccessToken)) {
return res.status(401).json({
message: "Bad credentials",
});
}
const foundRepo = mockRepos.find((r) => r.full_name === `${owner}/${repo}`);
if (!foundRepo) {
return res.status(404).json({
message: "Not Found",
});
}
res.json(mockBranches);
}
// Create repository for organization (not implemented in mock)
export function handleOrgRepos(req: Request, res: Response) {
console.log("* GitHub Org repos requested");
const authHeader = req.headers.authorization;
if (!authHeader || !authHeader.includes(mockAccessToken)) {
return res.status(401).json({
message: "Bad credentials",
});
}
// For simplicity, just redirect to user repos for mock
handleUserRepos(req, res);
}
// Push event management functions for testing
export function handleGetPushEvents(req: Request, res: Response) {
console.log("* Getting push events");
const { repo } = req.query;
const events = repo ? pushEvents.filter((e) => e.repo === repo) : pushEvents;
res.json(events);
}
export function handleClearPushEvents(req: Request, res: Response) {
console.log("* Clearing push events");
pushEvents.length = 0;
res.json({ cleared: true, timestamp: new Date() });
}
// Handle Git operations (push, pull, clone, etc.) using git-http-mock-server
export function handleGitPush(req: Request, res: Response, next?: Function) {
console.log("* GitHub Git operation requested:", req.method, req.url);
// Log request headers to see git operation details
console.log("* Git Headers:", {
"git-protocol": req.headers["git-protocol"],
"content-type": req.headers["content-type"],
"user-agent": req.headers["user-agent"],
});
// Create a unique temporary directory for this request
const mockReposRoot = fs.mkdtempSync(
path.join(
os.tmpdir(),
"dyad-git-mock-" + Math.random().toString(36).substring(2, 15),
),
);
console.error(`* Created temporary git repos directory: ${mockReposRoot}`);
// Create git middleware instance for this request
const gitHttpMiddleware = gitHttpMiddlewareFactory({
root: mockReposRoot,
route: "/github/git",
glob: "*.git",
});
// Extract repo name from URL path like /github/git/testuser/test-repo.git
// The middleware expects the repo name as the basename after the route
const urlPath = req.url;
const match = urlPath.match(/\/github\/git\/[^/]+\/([^/.]+)\.git/);
const repoName = match?.[1];
if (repoName) {
console.log(`* Git operation for repo: ${repoName}`);
// Track push events if this is a git-receive-pack (push) operation
if (req.url.includes("/git-receive-pack") && req.method === "POST") {
console.log("* Git PUSH operation detected for repo:", repoName);
// Collect request body to parse git protocol
let body = "";
req.on("data", (chunk) => {
body += chunk.toString();
});
req.on("end", () => {
try {
// Parse git pack protocol for branch refs
// Git protocol sends refs in format: "old-sha new-sha refs/heads/branch-name"
const lines = body.split("\n");
lines.forEach((line) => {
// Look for lines containing refs/heads/
const refMatch = line.match(
/([0-9a-f]{40})\s+([0-9a-f]{40})\s+refs\/heads\/([^\s\u0000]+)/,
);
if (refMatch) {
const [, oldSha, newSha, branchName] = refMatch;
const isDelete = newSha === "0".repeat(40);
const isCreate = oldSha === "0".repeat(40);
let operation: "push" | "create" | "delete" = "push";
if (isDelete) operation = "delete";
else if (isCreate) operation = "create";
pushEvents.push({
timestamp: new Date(),
repo: repoName,
branch: branchName,
operation,
commitSha: isDelete ? oldSha : newSha,
});
console.log(
`* Recorded ${operation} to ${repoName}/${branchName}, commit: ${isDelete ? oldSha : newSha}`,
);
}
});
} catch (error) {
console.error("* Error parsing git protocol:", error);
}
});
}
// Ensure the bare git repository exists for this repo
const bareRepoPath = path.join(mockReposRoot, `${repoName}.git`);
console.log(`* Creating bare git repository at: ${bareRepoPath}`);
try {
fs.mkdirSync(bareRepoPath, { recursive: true });
// Initialize as bare repository
const { execSync } = require("child_process");
execSync(`git init --bare`, { cwd: bareRepoPath });
console.log(
`* Successfully created bare git repository: ${repoName}.git`,
);
} catch (error) {
console.error(`* Failed to create bare git repository:`, error);
return res.status(500).json({
message: "Failed to initialize git repository",
error: error instanceof Error ? error.message : String(error),
});
}
// Rewrite the URL to match what the middleware expects
// Change /github/git/testuser/test-repo.git/... to /github/git/test-repo.git/...
const rewrittenUrl = req.url.replace(
/\/github\/git\/[^/]+\//,
"/github/git/",
);
req.url = rewrittenUrl;
console.log(`* Rewritten URL from ${urlPath} to ${rewrittenUrl}`);
}
// Use git-http-mock-server middleware to handle the actual git operations
gitHttpMiddleware(
req,
res,
next ||
(() => {
// Fallback if middleware doesn't handle the request
console.log(
`* Git middleware did not handle request: ${req.method} ${req.url}`,
);
res.status(404).json({
message: "Git operation not supported",
url: req.url,
method: req.method,
});
}),
);
}

View File

@@ -2,6 +2,19 @@ import express from "express";
import { createServer } from "http";
import cors from "cors";
import { createChatCompletionHandler } from "./chatCompletionHandler";
import {
handleDeviceCode,
handleAccessToken,
handleUser,
handleUserEmails,
handleUserRepos,
handleRepo,
handleRepoBranches,
handleOrgRepos,
handleGitPush,
handleGetPushEvents,
handleClearPushEvents,
} from "./githubHandler";
// Create Express app
const app = express();
@@ -179,6 +192,29 @@ app.get("/lmstudio/api/v0/models", (req, res) => {
// Default test provider handler:
app.post("/v1/chat/completions", createChatCompletionHandler("."));
// GitHub API Mock Endpoints
console.log("Setting up GitHub mock endpoints");
// GitHub OAuth Device Flow
app.post("/github/login/device/code", handleDeviceCode);
app.post("/github/login/oauth/access_token", handleAccessToken);
// GitHub API endpoints
app.get("/github/api/user", handleUser);
app.get("/github/api/user/emails", handleUserEmails);
app.get("/github/api/user/repos", handleUserRepos);
app.post("/github/api/user/repos", handleUserRepos);
app.get("/github/api/repos/:owner/:repo", handleRepo);
app.get("/github/api/repos/:owner/:repo/branches", handleRepoBranches);
app.post("/github/api/orgs/:org/repos", handleOrgRepos);
// GitHub test endpoints for verifying push operations
app.get("/github/api/test/push-events", handleGetPushEvents);
app.post("/github/api/test/clear-push-events", handleClearPushEvents);
// GitHub Git endpoints - intercept all paths with /github/git prefix
app.all("/github/git/*", handleGitPush);
// Start the server
const server = createServer(app);
server.listen(PORT, () => {

View File

@@ -17,6 +17,7 @@
"@types/cors": "^2.8.18",
"@types/express": "^4.17.21",
"@types/node": "^20.17.46",
"git-http-mock-server": "^2.0.0",
"ts-node": "^10.9.2",
"typescript": "^5.8.3"
}
@@ -201,6 +202,42 @@
"node": ">=0.4.0"
}
},
"node_modules/ansi-styles": {
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
"integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
"dev": true,
"license": "MIT",
"dependencies": {
"color-convert": "^1.9.0"
},
"engines": {
"node": ">=4"
}
},
"node_modules/apache-crypt": {
"version": "1.2.6",
"resolved": "https://registry.npmjs.org/apache-crypt/-/apache-crypt-1.2.6.tgz",
"integrity": "sha512-072WetlM4blL8PREJVeY+WHiUh1R5VNt2HfceGS8aKqttPHcmqE5pkKuXPz/ULmJOFkc8Hw3kfKl6vy7Qka6DA==",
"dev": true,
"license": "MIT",
"dependencies": {
"unix-crypt-td-js": "^1.1.4"
},
"engines": {
"node": ">=8"
}
},
"node_modules/apache-md5": {
"version": "1.1.8",
"resolved": "https://registry.npmjs.org/apache-md5/-/apache-md5-1.1.8.tgz",
"integrity": "sha512-FCAJojipPn0bXjuEpjOOOMN8FZDkxfWWp4JGN9mifU2IhxvKyXZYqpzPHdnTSUpmPDy+tsslB6Z1g+Vg6nVbYA==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=8"
}
},
"node_modules/arg": {
"version": "4.1.3",
"dev": true,
@@ -210,6 +247,73 @@
"version": "1.1.1",
"license": "MIT"
},
"node_modules/array-union": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz",
"integrity": "sha512-Dxr6QJj/RdU/hCaBjOfxW+q6lyuVE6JFWIrAUpuOOhoJJoQ99cUn3igRaHVB5P9WrgFVN0FfArM3x0cueOU8ng==",
"dev": true,
"license": "MIT",
"dependencies": {
"array-uniq": "^1.0.1"
},
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/array-uniq": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz",
"integrity": "sha512-MNha4BWQ6JbwhFhj03YK552f7cb3AzoE8SzeljgChvL1dl3IcvggXVz1DilzySZkCja+CXuZbdW7yATchWn8/Q==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/asn1": {
"version": "0.2.6",
"resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.6.tgz",
"integrity": "sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"safer-buffer": "~2.1.0"
}
},
"node_modules/balanced-match": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
"integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==",
"dev": true,
"license": "MIT"
},
"node_modules/basic-auth": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/basic-auth/-/basic-auth-2.0.1.tgz",
"integrity": "sha512-NF+epuEdnUYVlGuhaxbbq+dvJttwLnGY+YixlXlME5KpQ5W3CnXA5cVTneY3SPbPDRkcjMbifrwmFYcClgOZeg==",
"dev": true,
"license": "MIT",
"dependencies": {
"safe-buffer": "5.1.2"
},
"engines": {
"node": ">= 0.8"
}
},
"node_modules/basic-auth/node_modules/safe-buffer": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==",
"dev": true,
"license": "MIT"
},
"node_modules/bcryptjs": {
"version": "2.4.3",
"resolved": "https://registry.npmjs.org/bcryptjs/-/bcryptjs-2.4.3.tgz",
"integrity": "sha512-V/Hy/X9Vt7f3BbPJEi8BdVFMByHi+jNXrYkW3huaybV/kQ0KJg0Y6PkEMbn+zeT+i+SiKZ/HMqJGIIt4LZDqNQ==",
"dev": true,
"license": "MIT"
},
"node_modules/body-parser": {
"version": "1.20.3",
"license": "MIT",
@@ -232,6 +336,24 @@
"npm": "1.2.8000 || >= 1.4.16"
}
},
"node_modules/brace-expansion": {
"version": "1.1.12",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz",
"integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==",
"dev": true,
"license": "MIT",
"dependencies": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
}
},
"node_modules/buffer-equal-constant-time": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz",
"integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==",
"dev": true,
"license": "BSD-3-Clause"
},
"node_modules/bytes": {
"version": "3.1.2",
"license": "MIT",
@@ -264,6 +386,45 @@
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/chalk": {
"version": "2.4.2",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
"integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"ansi-styles": "^3.2.1",
"escape-string-regexp": "^1.0.5",
"supports-color": "^5.3.0"
},
"engines": {
"node": ">=4"
}
},
"node_modules/color-convert": {
"version": "1.9.3",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
"integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
"dev": true,
"license": "MIT",
"dependencies": {
"color-name": "1.1.3"
}
},
"node_modules/color-name": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
"integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==",
"dev": true,
"license": "MIT"
},
"node_modules/concat-map": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
"integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==",
"dev": true,
"license": "MIT"
},
"node_modules/content-disposition": {
"version": "0.5.4",
"license": "MIT",
@@ -308,6 +469,26 @@
"dev": true,
"license": "MIT"
},
"node_modules/crypto-random-string": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-1.0.0.tgz",
"integrity": "sha512-GsVpkFPlycH7/fRR7Dhcmnoii54gV1nz7y4CWyeFS14N+JVBBhY+r8amRHE4BwSYal7BPTDp8isvAlCxyFt3Hg==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=4"
}
},
"node_modules/daemonize-process": {
"version": "1.0.9",
"resolved": "https://registry.npmjs.org/daemonize-process/-/daemonize-process-1.0.9.tgz",
"integrity": "sha512-YoB+AmcgHIBDVeyfVWSCV90FNk799zX8Uvn7RJTDCD8Y0EMNbSfIKLG961VgchJme2GHmqpXUuV8Rxe2j2L+bw==",
"dev": true,
"license": "BSD-2-Clause",
"engines": {
"node": ">=4"
}
},
"node_modules/debug": {
"version": "2.6.9",
"license": "MIT",
@@ -338,6 +519,19 @@
"node": ">=0.3.1"
}
},
"node_modules/dir-glob": {
"version": "2.2.2",
"resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-2.2.2.tgz",
"integrity": "sha512-f9LBi5QWzIW3I6e//uxZoLBlUt9kcp66qo0sSCxL6YZKc75R1c4MFCoe/LaZiBGmgujvQdxc5Bn3QhfyvK5Hsw==",
"dev": true,
"license": "MIT",
"dependencies": {
"path-type": "^3.0.0"
},
"engines": {
"node": ">=4"
}
},
"node_modules/dunder-proto": {
"version": "1.0.1",
"license": "MIT",
@@ -395,6 +589,16 @@
"version": "1.0.3",
"license": "MIT"
},
"node_modules/escape-string-regexp": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
"integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=0.8.0"
}
},
"node_modules/etag": {
"version": "1.8.1",
"license": "MIT",
@@ -462,6 +666,19 @@
"node": ">= 0.8"
}
},
"node_modules/fixturez": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/fixturez/-/fixturez-1.1.0.tgz",
"integrity": "sha512-c4q9eZsAmCzj9gkrEO/YwIRlrHWt/TXQiX9jR9WeLFOqeeV6EyzdiiV28CpSzF6Ip+gyYrSv5UeOHqyzfcNTVA==",
"dev": true,
"license": "MIT",
"dependencies": {
"fs-extra": "^5.0.0",
"globby": "^7.1.1",
"signal-exit": "^3.0.2",
"tempy": "^0.2.1"
}
},
"node_modules/forwarded": {
"version": "0.2.0",
"license": "MIT",
@@ -476,6 +693,25 @@
"node": ">= 0.6"
}
},
"node_modules/fs-extra": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-5.0.0.tgz",
"integrity": "sha512-66Pm4RYbjzdyeuqudYqhFiNBbCIuI9kgRqLPSHIlXHidW8NIQtVdkM1yeZ4lXwuhbTETv3EUGMNHAAw6hiundQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"graceful-fs": "^4.1.2",
"jsonfile": "^4.0.0",
"universalify": "^0.1.0"
}
},
"node_modules/fs.realpath": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
"integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==",
"dev": true,
"license": "ISC"
},
"node_modules/function-bind": {
"version": "1.1.2",
"license": "MIT",
@@ -516,6 +752,70 @@
"node": ">= 0.4"
}
},
"node_modules/git-http-mock-server": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/git-http-mock-server/-/git-http-mock-server-2.0.0.tgz",
"integrity": "sha512-LOCls7jjuzwfKmUbcFsqj2yIEqExBzv0rA1tL7j1ULhRLAax4U1Bd/rbU9ebtri1ldzgcPD1VAyuhS1pvDC2pA==",
"dev": true,
"license": "MIT",
"dependencies": {
"basic-auth": "^2.0.0",
"buffer-equal-constant-time": "^1.0.1",
"chalk": "^2.4.1",
"daemonize-process": "^1.0.9",
"fixturez": "^1.1.0",
"htpasswd-js": "^1.0.2",
"micro-cors": "^0.1.1",
"minimisted": "^2.0.0",
"ssh-keygen": "^0.4.2",
"ssh2": "^0.6.1",
"tree-kill": "^1.2.0"
},
"bin": {
"git-http-mock-server": "http-daemon.js",
"git-ssh-mock-server": "ssh-daemon.js"
}
},
"node_modules/glob": {
"version": "7.2.3",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz",
"integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==",
"deprecated": "Glob versions prior to v9 are no longer supported",
"dev": true,
"license": "ISC",
"dependencies": {
"fs.realpath": "^1.0.0",
"inflight": "^1.0.4",
"inherits": "2",
"minimatch": "^3.1.1",
"once": "^1.3.0",
"path-is-absolute": "^1.0.0"
},
"engines": {
"node": "*"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/globby": {
"version": "7.1.1",
"resolved": "https://registry.npmjs.org/globby/-/globby-7.1.1.tgz",
"integrity": "sha512-yANWAN2DUcBtuus5Cpd+SKROzXHs2iVXFZt/Ykrfz6SAXqacLX25NZpltE+39ceMexYF4TtEadjuSTw8+3wX4g==",
"dev": true,
"license": "MIT",
"dependencies": {
"array-union": "^1.0.1",
"dir-glob": "^2.0.0",
"glob": "^7.1.2",
"ignore": "^3.3.5",
"pify": "^3.0.0",
"slash": "^1.0.0"
},
"engines": {
"node": ">=4"
}
},
"node_modules/gopd": {
"version": "1.2.0",
"license": "MIT",
@@ -526,6 +826,23 @@
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/graceful-fs": {
"version": "4.2.11",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz",
"integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==",
"dev": true,
"license": "ISC"
},
"node_modules/has-flag": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
"integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=4"
}
},
"node_modules/has-symbols": {
"version": "1.1.0",
"license": "MIT",
@@ -546,6 +863,32 @@
"node": ">= 0.4"
}
},
"node_modules/htpasswd-js": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/htpasswd-js/-/htpasswd-js-1.0.2.tgz",
"integrity": "sha512-KON5L4YKYXk647tmVclKgmHHG5nApjy9K+WiRoScnoWhS63lMoTca1ommUW2XQ3FDW8TtNDIQA7J0WYXICbMAA==",
"dev": true,
"license": "Apache-2.0",
"dependencies": {
"apache-crypt": "^1.2.1",
"apache-md5": "^1.1.2",
"bcryptjs": "^2.4.3",
"fs-extra": "^4.0.2",
"xerror": "^1.1.2"
}
},
"node_modules/htpasswd-js/node_modules/fs-extra": {
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-4.0.3.tgz",
"integrity": "sha512-q6rbdDd1o2mAnQreO7YADIxf/Whx4AHBiRf6d+/cVT8h44ss+lHgxf1FemcqDnQt9X3ct4McHr+JMGlYSsK7Cg==",
"dev": true,
"license": "MIT",
"dependencies": {
"graceful-fs": "^4.1.2",
"jsonfile": "^4.0.0",
"universalify": "^0.1.0"
}
},
"node_modules/http-errors": {
"version": "2.0.0",
"license": "MIT",
@@ -570,6 +913,25 @@
"node": ">=0.10.0"
}
},
"node_modules/ignore": {
"version": "3.3.10",
"resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.10.tgz",
"integrity": "sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug==",
"dev": true,
"license": "MIT"
},
"node_modules/inflight": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
"integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==",
"deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.",
"dev": true,
"license": "ISC",
"dependencies": {
"once": "^1.3.0",
"wrappy": "1"
}
},
"node_modules/inherits": {
"version": "2.0.4",
"license": "ISC"
@@ -581,6 +943,16 @@
"node": ">= 0.10"
}
},
"node_modules/jsonfile": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz",
"integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==",
"dev": true,
"license": "MIT",
"optionalDependencies": {
"graceful-fs": "^4.1.6"
}
},
"node_modules/make-error": {
"version": "1.3.6",
"dev": true,
@@ -614,6 +986,16 @@
"node": ">= 0.6"
}
},
"node_modules/micro-cors": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/micro-cors/-/micro-cors-0.1.1.tgz",
"integrity": "sha512-6WqIahA5sbQR1Gjexp1VuWGFDKbZZleJb/gy1khNGk18a6iN1FdTcr3Q8twaxkV5H94RjxIBjirYbWCehpMBFw==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=6"
}
},
"node_modules/mime": {
"version": "1.6.0",
"license": "MIT",
@@ -641,6 +1023,39 @@
"node": ">= 0.6"
}
},
"node_modules/minimatch": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
"integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
"dev": true,
"license": "ISC",
"dependencies": {
"brace-expansion": "^1.1.7"
},
"engines": {
"node": "*"
}
},
"node_modules/minimist": {
"version": "1.2.8",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz",
"integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==",
"dev": true,
"license": "MIT",
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/minimisted": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/minimisted/-/minimisted-2.0.1.tgz",
"integrity": "sha512-1oPjfuLQa2caorJUM8HV8lGgWCc0qqAO1MNv/k05G4qslmsndV/5WdNZrqCiyqiz3wohia2Ij2B7w2Dr7/IyrA==",
"dev": true,
"license": "MIT",
"dependencies": {
"minimist": "^1.2.5"
}
},
"node_modules/ms": {
"version": "2.0.0",
"license": "MIT"
@@ -679,6 +1094,16 @@
"node": ">= 0.8"
}
},
"node_modules/once": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
"integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==",
"dev": true,
"license": "ISC",
"dependencies": {
"wrappy": "1"
}
},
"node_modules/parseurl": {
"version": "1.3.3",
"license": "MIT",
@@ -686,10 +1111,43 @@
"node": ">= 0.8"
}
},
"node_modules/path-is-absolute": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
"integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/path-to-regexp": {
"version": "0.1.12",
"license": "MIT"
},
"node_modules/path-type": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz",
"integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==",
"dev": true,
"license": "MIT",
"dependencies": {
"pify": "^3.0.0"
},
"engines": {
"node": ">=4"
}
},
"node_modules/pify": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz",
"integrity": "sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=4"
}
},
"node_modules/proxy-addr": {
"version": "2.0.7",
"license": "MIT",
@@ -756,6 +1214,16 @@
"version": "2.1.2",
"license": "MIT"
},
"node_modules/semver": {
"version": "5.7.2",
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz",
"integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==",
"dev": true,
"license": "ISC",
"bin": {
"semver": "bin/semver"
}
},
"node_modules/send": {
"version": "0.19.0",
"license": "MIT",
@@ -870,6 +1338,61 @@
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/signal-exit": {
"version": "3.0.7",
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz",
"integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==",
"dev": true,
"license": "ISC"
},
"node_modules/slash": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/slash/-/slash-1.0.0.tgz",
"integrity": "sha512-3TYDR7xWt4dIqV2JauJr+EJeW356RXijHeUlO+8djJ+uBXPn8/2dpzBc8yQhh583sVvc9CvFAeQVgijsH+PNNg==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/ssh-keygen": {
"version": "0.4.2",
"resolved": "https://registry.npmjs.org/ssh-keygen/-/ssh-keygen-0.4.2.tgz",
"integrity": "sha512-SlEWW3cCtz87jwtCTfxo+tR+SQd4jJXWaBI/D9JVd74b2/N9ZvrWcd9lMFwFv0iMYb4aVAeMderH4AK5ZyW+Nw==",
"dev": true,
"dependencies": {
"underscore": "1.4.x"
},
"engines": {
"node": ">= 0.6.0"
}
},
"node_modules/ssh2": {
"version": "0.6.2",
"resolved": "https://registry.npmjs.org/ssh2/-/ssh2-0.6.2.tgz",
"integrity": "sha512-DJ+dOhXEEsmNpcQTI0x69FS++JH6qqL/ltEHf01pI1SSLMAcmD+hL4jRwvHjPwynPsmSUbHJ/WIZYzROfqZWjA==",
"dev": true,
"dependencies": {
"ssh2-streams": "~0.2.0"
},
"engines": {
"node": ">=4.5.0"
}
},
"node_modules/ssh2-streams": {
"version": "0.2.1",
"resolved": "https://registry.npmjs.org/ssh2-streams/-/ssh2-streams-0.2.1.tgz",
"integrity": "sha512-3zCOsmunh1JWgPshfhKmBCL3lUtHPoh+a/cyQ49Ft0Q0aF7xgN06b76L+oKtFi0fgO57FLjFztb1GlJcEZ4a3Q==",
"dev": true,
"dependencies": {
"asn1": "~0.2.0",
"semver": "^5.1.0",
"streamsearch": "~0.1.2"
},
"engines": {
"node": ">=4.5.0"
}
},
"node_modules/statuses": {
"version": "2.0.1",
"license": "MIT",
@@ -884,6 +1407,52 @@
"emitter-component": "^1.1.1"
}
},
"node_modules/streamsearch": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-0.1.2.tgz",
"integrity": "sha512-jos8u++JKm0ARcSUTAZXOVC0mSox7Bhn6sBgty73P1f3JGf7yG2clTbBNHUdde/kdvP2FESam+vM6l8jBrNxHA==",
"dev": true,
"engines": {
"node": ">=0.8.0"
}
},
"node_modules/supports-color": {
"version": "5.5.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
"integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
"dev": true,
"license": "MIT",
"dependencies": {
"has-flag": "^3.0.0"
},
"engines": {
"node": ">=4"
}
},
"node_modules/temp-dir": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/temp-dir/-/temp-dir-1.0.0.tgz",
"integrity": "sha512-xZFXEGbG7SNC3itwBzI3RYjq/cEhBkx2hJuKGIUOcEULmkQExXiHat2z/qkISYsuR+IKumhEfKKbV5qXmhICFQ==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=4"
}
},
"node_modules/tempy": {
"version": "0.2.1",
"resolved": "https://registry.npmjs.org/tempy/-/tempy-0.2.1.tgz",
"integrity": "sha512-LB83o9bfZGrntdqPuRdanIVCPReam9SOZKW0fOy5I9X3A854GGWi0tjCqoXEk84XIEYBc/x9Hq3EFop/H5wJaw==",
"dev": true,
"license": "MIT",
"dependencies": {
"temp-dir": "^1.0.0",
"unique-string": "^1.0.0"
},
"engines": {
"node": ">=4"
}
},
"node_modules/toidentifier": {
"version": "1.0.1",
"license": "MIT",
@@ -891,6 +1460,16 @@
"node": ">=0.6"
}
},
"node_modules/tree-kill": {
"version": "1.2.2",
"resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz",
"integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==",
"dev": true,
"license": "MIT",
"bin": {
"tree-kill": "cli.js"
}
},
"node_modules/ts-node": {
"version": "10.9.2",
"dev": true,
@@ -956,11 +1535,47 @@
"node": ">=14.17"
}
},
"node_modules/underscore": {
"version": "1.4.4",
"resolved": "https://registry.npmjs.org/underscore/-/underscore-1.4.4.tgz",
"integrity": "sha512-ZqGrAgaqqZM7LGRzNjLnw5elevWb5M8LEoDMadxIW3OWbcv72wMMgKdwOKpd5Fqxe8choLD8HN3iSj3TUh/giQ==",
"dev": true
},
"node_modules/undici-types": {
"version": "6.19.8",
"dev": true,
"license": "MIT"
},
"node_modules/unique-string": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/unique-string/-/unique-string-1.0.0.tgz",
"integrity": "sha512-ODgiYu03y5g76A1I9Gt0/chLCzQjvzDy7DsZGsLOE/1MrF6wriEskSncj1+/C58Xk/kPZDppSctDybCwOSaGAg==",
"dev": true,
"license": "MIT",
"dependencies": {
"crypto-random-string": "^1.0.0"
},
"engines": {
"node": ">=4"
}
},
"node_modules/universalify": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz",
"integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">= 4.0.0"
}
},
"node_modules/unix-crypt-td-js": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/unix-crypt-td-js/-/unix-crypt-td-js-1.1.4.tgz",
"integrity": "sha512-8rMeVYWSIyccIJscb9NdCfZKSRBKYTeVnwmiRYT2ulE3qd1RaDQ0xQDP+rI3ccIWbhu/zuo5cgN8z73belNZgw==",
"dev": true,
"license": "BSD-3-Clause"
},
"node_modules/unpipe": {
"version": "1.0.0",
"license": "MIT",
@@ -987,6 +1602,20 @@
"node": ">= 0.8"
}
},
"node_modules/wrappy": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
"integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==",
"dev": true,
"license": "ISC"
},
"node_modules/xerror": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/xerror/-/xerror-1.1.3.tgz",
"integrity": "sha512-2l5hmDymDUIuKT53v/nYxofTMUDQuu5P/Y3qHOjQiih6QUHBCgWpbpL3I8BoE5TVfUVTMmUQ0jdUAimTGc9UIg==",
"dev": true,
"license": "Apache-2.0"
},
"node_modules/yn": {
"version": "3.1.1",
"dev": true,

View File

@@ -21,6 +21,7 @@
"@types/cors": "^2.8.18",
"@types/express": "^4.17.21",
"@types/node": "^20.17.46",
"git-http-mock-server": "^2.0.0",
"ts-node": "^10.9.2",
"typescript": "^5.8.3"
}