Skip to content

Commit

Permalink
feat(core): schedule api
Browse files Browse the repository at this point in the history
  • Loading branch information
NWYLZW committed Dec 16, 2021
1 parent dc4db2e commit c48bfdf
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/core/src/api.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import axios, { AxiosError, AxiosInstance, AxiosRequestConfig, AxiosResponse } from 'axios'
import { camelCaseObjKeys, snakeCaseObjKeys, pluralize } from './utils'
import { Announce, Channel, Guild, Member, Role, User } from './common'
import { Announce, Channel, Guild, Member, Role, Schedule, User } from './common'

type TwoParamsMethod = 'get' | 'delete' | 'head' | 'options'
type ThreeParamsMethod = 'post' | 'put' | 'patch'
Expand Down Expand Up @@ -87,6 +87,13 @@ export interface Api {
announce(msgId: string): {
del(): Promise<void>
}
get schedules(): Promise<Schedule[]> & {
add(d: Omit<Schedule, 'id'>): Promise<Schedule>
}
schedule(id: string): Promise<Schedule> & {
upd(d: Omit<Schedule, 'id'>): Promise<Schedule>
del(): Promise<void>
}
}
}

Expand Down

0 comments on commit c48bfdf

Please sign in to comment.