From c48bfdf9c696598621c9e7fe39f8b7001c2b3b83 Mon Sep 17 00:00:00 2001 From: yijie4188 Date: Thu, 16 Dec 2021 14:30:47 +0800 Subject: [PATCH] feat(core): schedule api --- packages/core/src/api.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/core/src/api.ts b/packages/core/src/api.ts index 68901c9..48d4355 100644 --- a/packages/core/src/api.ts +++ b/packages/core/src/api.ts @@ -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' @@ -87,6 +87,13 @@ export interface Api { announce(msgId: string): { del(): Promise } + get schedules(): Promise & { + add(d: Omit): Promise + } + schedule(id: string): Promise & { + upd(d: Omit): Promise + del(): Promise + } } }