implement '/v1/apps/verify_credentials'
This commit is contained in:
parent
5ec9be0b8c
commit
b2ea03383c
14 changed files with 183 additions and 9 deletions
|
|
@ -9,6 +9,7 @@ import * as NotificationType from './notification'
|
|||
import FilterContext from './filter_context'
|
||||
import Converter from './converter'
|
||||
import MastodonEntity from './mastodon/entity';
|
||||
import MisskeyEntity from './misskey/entity';
|
||||
|
||||
export {
|
||||
Response,
|
||||
|
|
@ -23,4 +24,5 @@ export {
|
|||
Entity,
|
||||
Converter,
|
||||
MastodonEntity,
|
||||
MisskeyEntity,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,5 +3,8 @@ namespace MastodonEntity {
|
|||
name: string
|
||||
website?: string | null
|
||||
vapid_key?: string | null
|
||||
scopes: string[]
|
||||
redirect_uris: string[]
|
||||
redirect_uri?: string
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ export default class Misskey implements MegalodonInterface {
|
|||
website: null,
|
||||
redirect_uri: res.data.callbackUrl,
|
||||
client_id: '',
|
||||
client_secret: res.data.secret
|
||||
client_secret: res.data.secret!
|
||||
}
|
||||
return OAuth.AppData.from(appData)
|
||||
})
|
||||
|
|
@ -122,11 +122,8 @@ export default class Misskey implements MegalodonInterface {
|
|||
// ======================================
|
||||
// apps
|
||||
// ======================================
|
||||
public async verifyAppCredentials(): Promise<Response<Entity.Application>> {
|
||||
return new Promise((_, reject) => {
|
||||
const err = new NoImplementedError('misskey does not support')
|
||||
reject(err)
|
||||
})
|
||||
public async verifyAppCredentials(): Promise<Response<MisskeyAPI.Entity.App>> {
|
||||
return await this.client.post<MisskeyAPI.Entity.App>('/api/app/current');
|
||||
}
|
||||
|
||||
// ======================================
|
||||
|
|
|
|||
|
|
@ -4,6 +4,6 @@ namespace MisskeyEntity {
|
|||
name: string
|
||||
callbackUrl: string
|
||||
permission: Array<string>
|
||||
secret: string
|
||||
secret?: string
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue