@ecodev/natural 42.3.2 → 42.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,37 @@
1
+ import { HttpClient } from '@angular/common/http';
2
+ import { ErrorHandler, InjectionToken } from '@angular/core';
3
+ import { Observable } from 'rxjs';
4
+ import * as i0 from "@angular/core";
5
+ export interface NaturalLoggerType {
6
+ href?: string;
7
+ host?: string;
8
+ path?: string;
9
+ agent?: string;
10
+ message: string;
11
+ stacktrace: string;
12
+ status?: number;
13
+ referrer?: string;
14
+ url?: string;
15
+ userId?: string;
16
+ user?: string;
17
+ [key: string]: any;
18
+ }
19
+ export interface NaturalLoggerExtra {
20
+ getExtras(error: unknown): Observable<Partial<NaturalLoggerType>>;
21
+ }
22
+ export declare const NaturalLoggerConfigUrl: InjectionToken<string>;
23
+ export declare const NaturalLoggerConfigExtra: InjectionToken<NaturalLoggerExtra>;
24
+ export declare class NaturalErrorHandler extends ErrorHandler {
25
+ private http;
26
+ private readonly document;
27
+ private readonly url;
28
+ private readonly loggerExtra?;
29
+ constructor(http: HttpClient, document: Document, url: string, loggerExtra?: NaturalLoggerExtra | undefined);
30
+ handleError(error: any): void;
31
+ /**
32
+ * Send parameters to remote log
33
+ */
34
+ private postLog;
35
+ static ɵfac: i0.ɵɵFactoryDeclaration<NaturalErrorHandler, [null, null, { optional: true; }, { optional: true; }]>;
36
+ static ɵprov: i0.ɵɵInjectableDeclaration<NaturalErrorHandler>;
37
+ }
@@ -0,0 +1,10 @@
1
+ import { ModuleWithProviders, Type } from '@angular/core';
2
+ import { NaturalLoggerExtra } from './error-handler';
3
+ import * as i0 from "@angular/core";
4
+ import * as i1 from "@angular/common/http";
5
+ export declare class NaturalErrorModule {
6
+ static forRoot(url: string | null, extraService?: Type<NaturalLoggerExtra>): ModuleWithProviders<NaturalErrorModule>;
7
+ static ɵfac: i0.ɵɵFactoryDeclaration<NaturalErrorModule, never>;
8
+ static ɵmod: i0.ɵɵNgModuleDeclaration<NaturalErrorModule, never, [typeof i1.HttpClientModule], never>;
9
+ static ɵinj: i0.ɵɵInjectorDeclaration<NaturalErrorModule>;
10
+ }
@@ -0,0 +1,2 @@
1
+ export * from './error.module';
2
+ export * from './error-handler';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ecodev/natural",
3
- "version": "42.3.2",
3
+ "version": "42.3.3",
4
4
  "license": "MIT",
5
5
  "repository": "github:Ecodev/natural",
6
6
  "sideEffects": false,
package/public-api.d.ts CHANGED
@@ -37,4 +37,5 @@ export * from './lib/modules/table-button/public-api';
37
37
  export * from './lib/modules/dialog-trigger/public-api';
38
38
  export * from './lib/modules/avatar/public-api';
39
39
  export * from './lib/modules/matomo/public-api';
40
+ export * from './lib/modules/logger/public-api';
40
41
  export * from './lib/directives/http-prefix.directive';