1
0

remove outdated packages from megalodon

This commit is contained in:
Hazelnoot
2025-04-29 16:07:56 -04:00
parent 9c301fa5aa
commit dc9106dfb3
10 changed files with 9 additions and 683 deletions
+2 -31
View File
@@ -2,28 +2,24 @@ import FormData from 'form-data'
import fs from 'fs';
import MisskeyAPI from './misskey/api_client'
import { DEFAULT_UA } from './default'
import { ProxyConfig } from './proxy_config'
import OAuth from './oauth'
import Response from './response'
import { MegalodonInterface, WebSocketInterface, NoImplementedError, ArgumentError, UnexpectedError } from './megalodon'
import { MegalodonInterface, NoImplementedError, ArgumentError, UnexpectedError } from './megalodon'
import { UnknownNotificationTypeError } from './notification'
export default class Misskey implements MegalodonInterface {
public client: MisskeyAPI.Interface
public baseUrl: string
public proxyConfig: ProxyConfig | false
/**
* @param baseUrl hostname or base URL
* @param accessToken access token from OAuth2 authorization
* @param userAgent UserAgent is specified in header on request.
* @param proxyConfig Proxy setting, or set false if don't use proxy.
*/
constructor(
baseUrl: string,
accessToken: string | null = null,
userAgent: string | null = DEFAULT_UA,
proxyConfig: ProxyConfig | false = false
) {
let token: string = ''
if (accessToken) {
@@ -33,9 +29,8 @@ export default class Misskey implements MegalodonInterface {
if (userAgent) {
agent = userAgent
}
this.client = new MisskeyAPI.Client(baseUrl, token, agent, proxyConfig)
this.client = new MisskeyAPI.Client(baseUrl, token, agent)
this.baseUrl = baseUrl
this.proxyConfig = proxyConfig
}
public cancel(): void {
@@ -2562,28 +2557,4 @@ export default class Misskey implements MegalodonInterface {
reject(err)
})
}
public userSocket(): WebSocketInterface {
return this.client.socket('user')
}
public publicSocket(): WebSocketInterface {
return this.client.socket('globalTimeline')
}
public localSocket(): WebSocketInterface {
return this.client.socket('localTimeline')
}
public tagSocket(_tag: string): WebSocketInterface {
throw new NoImplementedError('TODO: implement')
}
public listSocket(list_id: string): WebSocketInterface {
return this.client.socket('list', list_id)
}
public directSocket(): WebSocketInterface {
return this.client.socket('conversation')
}
}