Skip to main content

Class: default

Constructors#

constructor#

+ new default(options: Options): default

Parameters#

NameType
optionsOptions

Returns: default

Defined in: WebHooks.ts:23

Properties#

db#

• db: DB

Defined in: WebHooks.ts:21


emitter#

• emitter: EventEmitter

Defined in: WebHooks.ts:22


requestFunctions#

• requestFunctions: Record<string, RequestFunction>= {}

Defined in: WebHooks.ts:23

Methods#

add#

â–¸ add(key: string, url: string): Promise<void>

Add WebHook to key.

Parameters#

NameType
keystring
urlstring

Returns: Promise<void>

Defined in: WebHooks.ts:90


getDB#

â–¸ getDB(): Promise<Hook[]>

Return all keys, and URL arrays.

Returns: Promise<Hook[]>

Promise

Defined in: WebHooks.ts:139


getRequestFunction#

â–¸ getRequestFunction(url: string): RequestFunction

Parameters#

NameType
urlstring

Returns: RequestFunction

Defined in: WebHooks.ts:51


getWebHook#

â–¸ getWebHook(key: string): Promise<string[]>

Return array of URLs for specified key.

Parameters#

NameType
keystring

Returns: Promise<string[]>

Promise

Defined in: WebHooks.ts:149


remove#

â–¸ remove(key: string, url?: string): Promise<void>

Remove URL from specified key. If no URL is specified, then remove key from Database.

Parameters#

NameType
keystring
url?string

Returns: Promise<void>

Defined in: WebHooks.ts:107


setListeners#

â–¸ setListeners(): Promise<void>

Returns: Promise<void>

Defined in: WebHooks.ts:36


trigger#

â–¸ trigger(__namedParameters: TriggerOptions): void

Parameters#

NameType
__namedParametersTriggerOptions

Returns: void

Defined in: WebHooks.ts:77