-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP: remove tsconfig paths and build
- Loading branch information
1 parent
2cafa37
commit ea79a5d
Showing
173 changed files
with
4,461 additions
and
1,192 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,24 @@ | ||
/// <reference types="node" /> | ||
import net from 'net'; | ||
import { Address } from '@polykey/peers/PeerInfo'; | ||
import { Address } from './peers/PeerInfo'; | ||
declare class HttpRequest { | ||
address: Address; | ||
getSocket: (address: Address) => net.Socket; | ||
constructor(address: Address, getSocket: (address: Address) => net.Socket); | ||
/** | ||
* The custom http request method to feed into isomorphic-git's [custom http object](https://isomorphic-git.org/docs/en/http) | ||
*/ | ||
request({ url, method, headers, body, onProgress }: { | ||
url: any; | ||
method: any; | ||
headers: any; | ||
body: any; | ||
onProgress: any; | ||
}): Promise<any>; | ||
private fromNodeStream; | ||
/** | ||
* Converts http incoming message into a iterator that can be used by [isomorphic-git](https://isomorphic-git.org) | ||
* @param message Http IncomingMessage | ||
*/ | ||
private httpMessageToIter; | ||
} | ||
export default HttpRequest; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/// <reference types="node" /> | ||
import fs from 'fs'; | ||
import KeyManager from './keys/KeyManager'; | ||
import PeerManager from './peers/PeerManager'; | ||
import VaultManager from './vaults/VaultManager'; | ||
declare class Polykey { | ||
polykeyPath: string; | ||
vaultManager: VaultManager; | ||
keyManager: KeyManager; | ||
peerManager: PeerManager; | ||
private gitServer; | ||
constructor(polykeyPath: string | undefined, fileSystem: typeof fs, keyManager?: KeyManager, vaultManager?: VaultManager, peerManager?: PeerManager); | ||
} | ||
export default Polykey; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
import { Address } from '../peers/PeerInfo'; | ||
import VaultManager from '../vaults/VaultManager'; | ||
declare class GitServer { | ||
private polykeyPath; | ||
private vaultManager; | ||
private server; | ||
address: Address; | ||
constructor(polykeyPath: string, vaultManager: VaultManager, port?: number); | ||
/** | ||
* Find out whether vault exists. | ||
* @param vaultName Name of vault to check | ||
* @param publicKey Public key of peer trying to access vault | ||
*/ | ||
private exists; | ||
/** | ||
* Handle incoming info or pack requests and delegates to respective functions | ||
* @param req Incoming http message | ||
* @param res Outgoing server response | ||
*/ | ||
private handle; | ||
/** | ||
* Returns a not found response | ||
* @param res Outgoing server response | ||
*/ | ||
private notFoundResponse; | ||
/** | ||
* Handles a request for remote info | ||
* @param req Incoming http message | ||
* @param res Outgoing server response | ||
*/ | ||
private handleInfoRequest; | ||
/** | ||
* Handles a requests for packfiles | ||
* @param req Incoming http message | ||
* @param res Outgoing server response | ||
*/ | ||
private handlePackRequest; | ||
/** | ||
* Sends http response containing git info about the particular vault | ||
* @param vaultName Name of the requested vault | ||
* @param service The type of service requested, either upload-pack or recieve-pack | ||
* @param res Outgoing server response | ||
*/ | ||
private infoResponse; | ||
/** | ||
* Adds headers to the response object to add cache control | ||
* @param res Outgoing server response | ||
*/ | ||
private noCache; | ||
/** | ||
* Encodes a string into a git packet line by prefixing the hexadecimal length of the line | ||
* @param line The line to be encoded | ||
*/ | ||
private createGitPacketLine; | ||
/** | ||
* Handles the response to a git packfile request | ||
* @param vaultName Name of the requested vault | ||
* @param vaultPath Path to the target vault | ||
* @param service The type of service requested, either upload-pack or recieve-pack | ||
* @param res Outgoing server response | ||
*/ | ||
private uploadPackRespond; | ||
} | ||
export default GitServer; |
Oops, something went wrong.