@addtodoist/twitter-autohook
Version:
Automatically setup and serve webhooks for the Twitter Account Activity API
46 lines • 1.85 kB
TypeScript
/// <reference types="node" />
/// <reference types="node" />
import { TooManySubscriptionsError, UserSubscriptionError, WebhookURIError } from './errors/index.js';
import EventEmitter from 'events';
import http from 'http';
declare const validateWebhook: (token: any, auth: any) => {
response_token: string;
};
declare const validateSignature: (header: any, auth: any, body: any) => boolean;
declare class Autohook extends EventEmitter {
auth: {
token: string;
token_secret: string;
consumer_key: string;
consumer_secret: string;
};
ngrokSecret: string;
env: string;
port: number;
headers: Array<unknown>;
server: http.Server | undefined;
constructor({ token, token_secret, consumer_key, consumer_secret, ngrok_secret, env, port, headers, }?: {
token?: string | undefined;
token_secret?: string | undefined;
consumer_key?: string | undefined;
consumer_secret?: string | undefined;
ngrok_secret?: string | undefined;
env?: string | undefined;
port?: number | undefined;
headers?: never[] | undefined;
});
startServer(): Promise<void>;
setWebhook(webhookUrl: string): Promise<any>;
getWebhooks(): Promise<any>;
removeWebhook(webhook: string): Promise<void>;
removeWebhooks(): Promise<void>;
start(webhookUrl?: string | null): Promise<void>;
subscribe({ oauth_token, oauth_token_secret, screen_name }: {
oauth_token: any;
oauth_token_secret: any;
screen_name?: null | undefined;
}): Promise<boolean>;
unsubscribe(userId: any): Promise<boolean>;
}
export { Autohook, WebhookURIError, UserSubscriptionError, TooManySubscriptionsError, validateWebhook, validateSignature, };
//# sourceMappingURL=index.d.ts.map