diff --git a/notNeededPackages.json b/notNeededPackages.json index 33ac19b762..7dc10aa2d5 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -570,6 +570,12 @@ "sourceRepoURL": "https://github.com/eggjs/egg", "asOfVersion": "1.5.0" }, + { + "libraryName": "elastic-apm-node", + "typingsPackageName": "elastic-apm-node", + "sourceRepoURL": "https://github.com/elastic/apm-agent-nodejs", + "asOfVersion": "2.7.0" + }, { "libraryName": "electron", "typingsPackageName": "electron", diff --git a/types/elastic-apm-node/elastic-apm-node-tests.ts b/types/elastic-apm-node/elastic-apm-node-tests.ts deleted file mode 100644 index 2e98e84300..0000000000 --- a/types/elastic-apm-node/elastic-apm-node-tests.ts +++ /dev/null @@ -1,50 +0,0 @@ -import { - Agent, - start -} from 'elastic-apm-node'; - -const agent: Agent = start({ - serviceName: '', - secretToken: '', - serverUrl: '' -}); -const started: boolean = agent.isStarted(); - -function testCallbacks() { - const testError: Error = new Error("Test Error"); - agent.captureError(testError, {error: "test"}, (err: Error) => err = testError); - agent.captureError(testError, {error: "test"}); - agent.captureError(testError); - - agent.addFilter((payload: any) => { - return payload; - }); - - agent.handleUncaughtExceptions((err: Error) => err = testError); - - agent.flush((test: any) => test); -} - -const customContext: boolean = agent.setCustomContext({ - id: "test id", - username: "test user", - email: "testEmail@test.com" -}); - -const userContext: boolean = agent.setUserContext({ - id: "test id", - username: "test user", - email: "testEmail@test.com" -}); - -const transactionName: any = agent.setTransactionName("new name"); - -const tags: any = agent.setTag("name", "value"); - -const addedTags: any = agent.addTags({name: "value"}); - -const startSpan: any = agent.startSpan(); - -const secondStartSpan: any = agent.startSpan("name", 13); - -const transaction = agent.startTransaction(); diff --git a/types/elastic-apm-node/index.d.ts b/types/elastic-apm-node/index.d.ts deleted file mode 100644 index 182a56782e..0000000000 --- a/types/elastic-apm-node/index.d.ts +++ /dev/null @@ -1,75 +0,0 @@ -// Type definitions for Elastic APM Node.js Agent 1.x -// Project: https://www.elastic.co/solutions/apm, https://github.com/elastic/apm-agent-nodejs -// Definitions by: Shahaed Hasan -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.7 - -export = a; - -declare const a: a.Agent; - -declare namespace a { - interface Agent { - currentTransaction: any; - logger: any; - - start(opts?: AgentOptions): Agent; - isStarted(): boolean; - addFilter(filter: (payload: any) => any): void; - setUserContext(context: Context): boolean; - setCustomContext(context: any): boolean; - setTag(name: string, value: string): any; - addTags(tags: any): any; - captureError(error: Error | string | object, options?: object, callback?: (err?: any) => any): void; - startTransaction(name?: string, type?: string): any; - endTransaction(result?: any): any; - setTransactionName(name: string): any; - startSpan(name?: string, type?: any): any; - handleUncaughtExceptions(callback?: (err: Error) => any): any; - flush(callback?: any): any; - lambda(type: any, handler?: any): any; - } - - interface AgentOptions { - serviceName?: string; - secretToken?: string; - serverUrl?: string; - verifyServerCert?: boolean; - serviceVersion?: string; - active?: boolean; - instrument?: boolean; - asyncHooks?: boolean; - ignoreUrls?: Array; - ignoreUserAgents?: Array; - captureBody?: string; - errorOnAbortedRequests?: boolean; - abortedErrorThreshold?: number; - transactionSampleRate?: number; - hostname?: string; - frameworkName?: string; - frameworkVersion?: string; - logLevel?: string; - logger?: any; - captureExceptions?: boolean; - captureErrorLogStackTraces?: string; - captureSpanStackTraces?: boolean; - sourceLinesErrorAppFrames?: number; - sourceLinesErrorLibraryFrames?: number; - sourceLinesSpanAppFrames?: number; - sourceLinesSpanLibraryFrames?: number; - errorMessageMaxLength?: number; - stackTraceLimit?: number; - transactionMaxSpans?: number; - flushInterval?: number; - serverTimeout?: number; - maxQueueSize?: number; - filterHttpHeaders?: boolean; - disableInstrumentations?: string; - } - - interface Context { - id?: string; - username?: string; - email?: string; - } -} diff --git a/types/elastic-apm-node/start.d.ts b/types/elastic-apm-node/start.d.ts deleted file mode 100644 index 83cf99b4d5..0000000000 --- a/types/elastic-apm-node/start.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import * as agent from './'; -export = agent; diff --git a/types/elastic-apm-node/tsconfig.json b/types/elastic-apm-node/tsconfig.json deleted file mode 100644 index 336364b281..0000000000 --- a/types/elastic-apm-node/tsconfig.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictFunctionTypes": true, - "strictNullChecks": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "elastic-apm-node-tests.ts", - "start.d.ts" - ] -} \ No newline at end of file diff --git a/types/elastic-apm-node/tslint.json b/types/elastic-apm-node/tslint.json deleted file mode 100644 index f93cf8562a..0000000000 --- a/types/elastic-apm-node/tslint.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "dtslint/dt.json" -}