@ethicdevs/fastify-git-server
Advanced tools
Comparing version 1.4.3 to 1.5.0
@@ -15,2 +15,3 @@ "use strict"; | ||
var sendStatelessRpc_1 = require("./helpers/sendStatelessRpc"); | ||
var spawnGit_1 = require("./helpers/spawnGit"); | ||
var logInfo = (0, debug_1.default)("fastifyGitServer:info"); | ||
@@ -21,4 +22,9 @@ var logTrace = (0, debug_1.default)("fastifyGitServer:trace"); | ||
var gitServerPluginAsync = function (server, opts) { return tslib_1.__awaiter(void 0, void 0, void 0, function () { | ||
var spawnGitCommand; | ||
return tslib_1.__generator(this, function (_a) { | ||
try { | ||
spawnGitCommand = function (args, gitRepositoryDir) { | ||
return (0, spawnGit_1.spawnGit)(opts, args, gitRepositoryDir); | ||
}; | ||
server.decorateRequest("spawnGitCommand", spawnGitCommand); | ||
server.addHook("onRequest", function (request, reply) { return tslib_1.__awaiter(void 0, void 0, void 0, function () { | ||
@@ -25,0 +31,0 @@ var service, requestMethod, packType, pathname, pathMatches, _a, _, org, repo, requestType, repoSlug, repoResult, authCredentials, authorization, _b, username, password, authorizationResult, gitStream, err_1, error, err_2, error; |
/// <reference types="node" /> | ||
import type { PathLike } from "node:fs"; | ||
import { FastifyRequest, HTTPMethods } from "fastify"; | ||
import type { ChildProcessWithoutNullStreams } from "node:child_process"; | ||
import type { FastifyRequest } from "fastify"; | ||
import type { HTTPMethods } from "fastify/types/utils"; | ||
import { GitServerMessage } from "./helpers/GitServerMessage"; | ||
@@ -71,2 +73,3 @@ export declare namespace GitServer { | ||
} | ||
type SpawnGitCommandDecorator = (args: string[], gitRepositoryDir: PathLike) => ChildProcessWithoutNullStreams; | ||
} |
{ | ||
"name": "@ethicdevs/fastify-git-server", | ||
"version": "1.4.3", | ||
"version": "1.5.0", | ||
"description": "A Fastify plugin to easily make one/many Git repositories available for clone/fetch/push.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -20,2 +20,3 @@ // std | ||
import { sendStatelessRpc } from "./helpers/sendStatelessRpc"; | ||
import { spawnGit } from "./helpers/spawnGit"; | ||
@@ -30,2 +31,11 @@ const logInfo = debug("fastifyGitServer:info"); | ||
try { | ||
const spawnGitCommand: GitServer.SpawnGitCommandDecorator = ( | ||
args, | ||
gitRepositoryDir, | ||
) => { | ||
return spawnGit(opts, args, gitRepositoryDir); | ||
}; | ||
server.decorateRequest("spawnGitCommand", spawnGitCommand); | ||
server.addHook("onRequest", async (request, reply) => { | ||
@@ -32,0 +42,0 @@ try { |
// std | ||
import type { PathLike } from "node:fs"; | ||
import type { ChildProcessWithoutNullStreams } from "node:child_process"; | ||
// 3rd-party | ||
import { FastifyRequest, HTTPMethods } from "fastify"; | ||
import type { FastifyRequest } from "fastify"; | ||
import type { HTTPMethods } from "fastify/types/utils"; | ||
// lib | ||
@@ -90,2 +92,7 @@ import { GitServerMessage } from "./helpers/GitServerMessage"; | ||
} | ||
export type SpawnGitCommandDecorator = ( | ||
args: string[], | ||
gitRepositoryDir: PathLike, | ||
) => ChildProcessWithoutNullStreams; | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
53633
40
1071