@@ -5,7 +5,7 @@ import * as HackMDErrors from './error'
55export class API {
66 private axios : AxiosInstance
77
8- constructor ( readonly accessToken : string , public hackmdAPIEndpointURL : string = "https://api.hackmd.io/v1" ) {
8+ constructor ( readonly accessToken : string , public hackmdAPIEndpointURL : string = "https://api.hackmd.io/v1" ) {
99 if ( ! accessToken ) {
1010 throw new HackMDErrors . MissingRequiredArgument ( 'Missing access token when creating HackMD client' )
1111 }
@@ -53,62 +53,62 @@ export class API {
5353 )
5454 }
5555
56- getMe = async ( ) => {
56+ async getMe ( ) {
5757 const { data } = await this . axios . get < User > ( "me" )
5858 return data
5959 }
6060
61- getHistory = async ( ) => {
61+ async getHistory ( ) {
6262 const { data } = await this . axios . get < Note [ ] > ( "history" )
6363 return data
6464 }
6565
66- getNoteList = async ( ) => {
66+ async getNoteList ( ) {
6767 const { data } = await this . axios . get < Note [ ] > ( "notes" )
6868 return data
6969 }
7070
71- getNote = async ( noteId : string ) => {
71+ async getNote ( noteId : string ) {
7272 const { data } = await this . axios . get < Note > ( `notes/${ noteId } ` )
7373 return data
7474 }
7575
76- createNote = async ( options : CreateNoteOptions ) => {
76+ async createNote ( options : CreateNoteOptions ) {
7777 const { data } = await this . axios . post < Note > ( "notes" , options )
7878 return data
7979 }
8080
81- updateNoteContent = async ( noteId : string , content ?: string ) => {
81+ async updateNoteContent ( noteId : string , content ?: string ) {
8282 const { data } = await this . axios . patch < string > ( `notes/${ noteId } ` , { content } )
8383 return data
8484 }
8585
86- deleteNote = async ( noteId : string ) => {
86+ async deleteNote ( noteId : string ) {
8787 const { data } = await this . axios . delete < void > ( `notes/${ noteId } ` )
8888 return data
8989 }
9090
91- getTeams = async ( ) => {
91+ async getTeams ( ) {
9292 const { data } = await this . axios . get < Team [ ] > ( "teams" )
9393 return data
9494 }
9595
96- getTeamNotes = async ( teamPath : string ) => {
96+ async getTeamNotes ( teamPath : string ) {
9797 const { data} = await this . axios . get < Note [ ] > ( `teams/${ teamPath } /notes` )
9898 return data
9999 }
100100
101- createTeamNote = async ( teamPath : string , options : CreateNoteOptions ) => {
101+ async createTeamNote ( teamPath : string , options : CreateNoteOptions ) {
102102 const { data } = await this . axios . post < Note > ( `teams/${ teamPath } /notes` , options )
103103 return data
104104 }
105105
106- updateTeamNoteContent = async ( teamPath : string , noteId : string , content ?: string ) => {
106+ async updateTeamNoteContent ( teamPath : string , noteId : string , content ?: string ) {
107107 const { data } = await this . axios . patch < string > ( `teams/${ teamPath } /notes/${ noteId } ` , { content } )
108108 return data
109109 }
110110
111- deleteTeamNote = async ( teamPath : string , noteId : string ) => {
111+ async deleteTeamNote ( teamPath : string , noteId : string ) {
112112 const { data } = await this . axios . delete < void > ( `teams/${ teamPath } /notes/${ noteId } ` )
113113 return data
114114 }
0 commit comments