@ecodev/natural 42.3.0 → 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.
@@ -1,19 +1,37 @@
1
1
  import { HttpClient } from '@angular/common/http';
2
2
  import { ErrorHandler, InjectionToken } from '@angular/core';
3
- import { Literal } from '../../types/types';
3
+ import { Observable } from 'rxjs';
4
4
  import * as i0 from "@angular/core";
5
- export interface LoggerExtra {
6
- getExtras(error: unknown): Literal;
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>>;
7
21
  }
8
22
  export declare const NaturalLoggerConfigUrl: InjectionToken<string>;
9
- export declare const NaturalLoggerConfigExtra: InjectionToken<LoggerExtra>;
23
+ export declare const NaturalLoggerConfigExtra: InjectionToken<NaturalLoggerExtra>;
10
24
  export declare class NaturalErrorHandler extends ErrorHandler {
11
25
  private http;
12
26
  private readonly document;
13
27
  private readonly url;
14
28
  private readonly loggerExtra?;
15
- constructor(http: HttpClient, document: Document, url: string, loggerExtra?: LoggerExtra | undefined);
29
+ constructor(http: HttpClient, document: Document, url: string, loggerExtra?: NaturalLoggerExtra | undefined);
16
30
  handleError(error: any): void;
31
+ /**
32
+ * Send parameters to remote log
33
+ */
34
+ private postLog;
17
35
  static ɵfac: i0.ɵɵFactoryDeclaration<NaturalErrorHandler, [null, null, { optional: true; }, { optional: true; }]>;
18
36
  static ɵprov: i0.ɵɵInjectableDeclaration<NaturalErrorHandler>;
19
37
  }
@@ -1,9 +1,9 @@
1
1
  import { ModuleWithProviders, Type } from '@angular/core';
2
- import { LoggerExtra } from './error-handler';
2
+ import { NaturalLoggerExtra } from './error-handler';
3
3
  import * as i0 from "@angular/core";
4
4
  import * as i1 from "@angular/common/http";
5
5
  export declare class NaturalErrorModule {
6
- static forRoot(url: string | null, extraService?: Type<LoggerExtra>): ModuleWithProviders<NaturalErrorModule>;
6
+ static forRoot(url: string | null, extraService?: Type<NaturalLoggerExtra>): ModuleWithProviders<NaturalErrorModule>;
7
7
  static ɵfac: i0.ɵɵFactoryDeclaration<NaturalErrorModule, never>;
8
8
  static ɵmod: i0.ɵɵNgModuleDeclaration<NaturalErrorModule, never, [typeof i1.HttpClientModule], never>;
9
9
  static ɵinj: i0.ɵɵInjectorDeclaration<NaturalErrorModule>;
@@ -1 +1,2 @@
1
1
  export * from './error.module';
2
+ export * from './error-handler';
@@ -7,7 +7,7 @@ import * as i0 from "@angular/core";
7
7
  *
8
8
  * To complete this list, maybe see https://developer.matomo.org/guides/tracking-javascript-guide
9
9
  */
10
- declare type MatomoFunction = 'setCustomUrl' | 'setCustomVariable' | 'setDocumentTitle' | 'setReferrerUrl' | 'setSiteId' | 'setTrackerUrl' | 'trackPageView';
10
+ declare type MatomoFunction = 'setCustomUrl' | 'setCustomDimension' | 'setDocumentTitle' | 'setReferrerUrl' | 'setSiteId' | 'setTrackerUrl' | 'trackPageView';
11
11
  export declare type PaqItem = [MatomoFunction, ...(number | string | null)[]];
12
12
  /**
13
13
  * Service to track visitors via Matomo.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ecodev/natural",
3
- "version": "42.3.0",
3
+ "version": "42.3.3",
4
4
  "license": "MIT",
5
5
  "repository": "github:Ecodev/natural",
6
6
  "sideEffects": false,