fix(core): initial
This commit is contained in:
1
ts/index.ts
Normal file
1
ts/index.ts
Normal file
@ -0,0 +1 @@
|
||||
export * from './sentry.classes.sentry';
|
25
ts/sentry.classes.sentry.ts
Normal file
25
ts/sentry.classes.sentry.ts
Normal file
@ -0,0 +1,25 @@
|
||||
import * as plugins from './sentry.plugins';
|
||||
|
||||
/**
|
||||
* the constructor options for Sentry
|
||||
*/
|
||||
export interface ISentryConstructorOptions {
|
||||
appName: string;
|
||||
|
||||
dsn: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* The main class that is used creating instances of sentry
|
||||
*/
|
||||
export class Sentry {
|
||||
constructor(optionsArg: ISentryConstructorOptions) {
|
||||
plugins.sentry.init({
|
||||
dsn: optionsArg.dsn
|
||||
});
|
||||
}
|
||||
|
||||
captureException(exceptionArg: any) {
|
||||
plugins.sentry.captureException(exceptionArg);
|
||||
}
|
||||
}
|
3
ts/sentry.plugins.ts
Normal file
3
ts/sentry.plugins.ts
Normal file
@ -0,0 +1,3 @@
|
||||
import * as sentry from '@sentry/node';
|
||||
|
||||
export { sentry };
|
Reference in New Issue
Block a user