From f3bf99433bc042e99b37e2f8fb28fd3c93a77745 Mon Sep 17 00:00:00 2001 From: Oleg Date: Fri, 15 May 2020 12:18:14 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#44723=20@types/dog?= =?UTF-8?q?api=20Add=20optional=20api=5Fhost=20by=20@omakoleg?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add optional api_host Use case: ``` dogapi.initialize({ api_host: 'api.datadoghq.eu', api_key, app_key }) ``` * Modify tests --- types/dogapi/dogapi-tests.ts | 7 ++++++- types/dogapi/index.d.ts | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/types/dogapi/dogapi-tests.ts b/types/dogapi/dogapi-tests.ts index 4556ca09f5..4a29a98469 100644 --- a/types/dogapi/dogapi-tests.ts +++ b/types/dogapi/dogapi-tests.ts @@ -5,10 +5,15 @@ dogapi.initialize({ app_key: '', }); +dogapi.initialize({ + api_host: 'a', + api_key: 'b', + app_key: 'c', +}); dogapi.event.create('', '', (err: Error | null, res: dogapi.EventCreateResponse) => {}); dogapi.event.create( '', '', { date_happened: Math.floor(Date.now() / 1000) }, - (err: Error | null, res: dogapi.EventCreateResponse) => {} + (err: Error | null, res: dogapi.EventCreateResponse) => {}, ); diff --git a/types/dogapi/index.d.ts b/types/dogapi/index.d.ts index 981f4935bb..d90261bd10 100644 --- a/types/dogapi/index.d.ts +++ b/types/dogapi/index.d.ts @@ -7,6 +7,7 @@ export function initialize(opts: { api_key: string, app_key: string, + api_host?: string }): void; interface event {