Skip to content

Commit 9d3bf6d

Browse files
committed
update
1 parent 2da9e88 commit 9d3bf6d

File tree

6 files changed

+42
-42
lines changed

6 files changed

+42
-42
lines changed

src/app/src/composables/useGit.ts

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,9 @@
11
import { ofetch } from 'ofetch'
2-
import type { GithubFile } from '../types/github'
32
import { createSharedComposable } from '@vueuse/core'
4-
import type { RawFile } from '../types'
3+
import type { RawFile, GithubFile, GitOptions } from '../types'
54

65
import { joinURL } from 'ufo'
76

8-
interface GitOptions {
9-
owner: string
10-
repo: string
11-
branch: string
12-
rootDir: string
13-
token: string
14-
authorName: string
15-
authorEmail: string
16-
17-
}
18-
197
export const useGit = createSharedComposable(({ owner, repo, token, branch, rootDir, authorName, authorEmail }: GitOptions) => {
208
const gitFiles: Record<string, GithubFile> = {}
219
const $api = ofetch.create({

src/app/src/types/content.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,6 @@
1-
import type { DraftStatus } from '..'
2-
31
export enum ContentFileExtension {
42
Markdown = 'md',
53
YAML = 'yaml',
64
YML = 'yml',
75
JSON = 'json',
86
}
9-
10-
export interface RawFile {
11-
path: string
12-
content: string | null
13-
status: DraftStatus
14-
encoding?: 'utf-8' | 'base64'
15-
}

src/app/src/types/draft.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { GithubFile } from './github'
1+
import type { GithubFile } from './git'
22
import type { DatabaseItem } from './database'
33
import type { MediaItem } from './media'
44

src/app/src/types/git.ts

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import { DraftStatus } from "./draft"
2+
3+
export interface GitOptions {
4+
owner: string
5+
repo: string
6+
branch: string
7+
rootDir: string
8+
token: string
9+
authorName: string
10+
authorEmail: string
11+
}
12+
13+
export interface RawFile {
14+
path: string
15+
content: string | null
16+
status: DraftStatus
17+
encoding?: 'utf-8' | 'base64'
18+
}
19+
20+
21+
// GITHUB
22+
export interface GithubFile {
23+
name: string
24+
path: string
25+
sha: string
26+
size: number
27+
url: string
28+
html_url: string
29+
git_url: string
30+
download_url: string
31+
type: string
32+
content?: string
33+
encoding?: string
34+
_links: {
35+
self: string
36+
git: string
37+
html: string
38+
}
39+
}

src/app/src/types/github.ts

Lines changed: 0 additions & 18 deletions
This file was deleted.

src/app/src/types/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export * from './database'
1010
export * from './media'
1111
export * from './user'
1212
export * from './tree'
13-
export * from './github'
13+
export * from './git'
1414
export * from './context'
1515
export * from './content'
1616
export * from './repository'

0 commit comments

Comments
 (0)