Commit 758391f6 authored by Caleb C. Sander's avatar Caleb C. Sander
Browse files

Fix #7

parent 81927b21
Showing with 10 additions and 7 deletions
+10 -7
...@@ -163,13 +163,13 @@ It is an error if a repository with this name already exists. ...@@ -163,13 +163,13 @@ It is an error if a repository with this name already exists.
The request JSON has the following form: The request JSON has the following form:
```ts ```ts
interface NewRepositoryRequest { {
name: string name: string
} }
``` ```
If successful, the response JSON has the following form: If successful, the response JSON has the following form:
```ts ```ts
interface NewRepositoryResponse { {
success: true success: true
} }
``` ```
...@@ -182,7 +182,7 @@ It is an error if the repository doesn't exist or the commit does not exist in t ...@@ -182,7 +182,7 @@ It is an error if the repository doesn't exist or the commit does not exist in t
The request JSON has the following form: The request JSON has the following form:
```ts ```ts
interface FetchRequest { {
// Repository name // Repository name
name: string name: string
// Last known commit ID. // Last known commit ID.
...@@ -192,18 +192,21 @@ interface FetchRequest { ...@@ -192,18 +192,21 @@ interface FetchRequest {
``` ```
If successful, the response JSON has the following form: If successful, the response JSON has the following form:
```ts ```ts
interface FetchResponse { {
success: true success: true
// Commits after parentID up to HEAD. // Commits after parentID up to HEAD.
// They must be ordered from oldest to newest. // They must be ordered from oldest to newest.
commits: Commit[] commits: Commit[]
} }
interface Commit { ```
where
```ts
type Commit = {
id: string id: string
message: string message: string
diffs: FileDiffs diffs: FileDiffs
} }
interface FileDiffs { type FileDiffs = {
// Map each filename to a diff for that file // Map each filename to a diff for that file
[file: string]: Diff [file: string]: Diff
} }
...@@ -226,7 +229,7 @@ If there is a merge conflict, `mergeFileDiffs()` will throw an error, which you ...@@ -226,7 +229,7 @@ If there is a merge conflict, `mergeFileDiffs()` will throw an error, which you
The request JSON has the following form: The request JSON has the following form:
```ts ```ts
interface CommitRequest { {
// Repository name // Repository name
name: string name: string
// Parent commit. // Parent commit.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment