ngx-vector-components 6.27.0 → 6.28.0
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,77 @@
|
|
|
1
|
+
import { Environment } from '../injections';
|
|
2
|
+
import { AppName, MenuItem } from '../models';
|
|
3
|
+
import { StorageService } from './storage.service';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
/** Nome dos eventos enviados ao dataLayer. Todo o detalhe vai nos parametros. */
|
|
6
|
+
export type AnalyticsEvent = 'page_view' | 'user_action' | 'app_event';
|
|
7
|
+
/** Identificacao da tela corrente, anexada a todos os eventos. */
|
|
8
|
+
export interface AnalyticsPage {
|
|
9
|
+
page_path: string;
|
|
10
|
+
page_name: string;
|
|
11
|
+
page_module: string;
|
|
12
|
+
}
|
|
13
|
+
/** Identificacao do usuario corrente, anexada a todos os eventos. */
|
|
14
|
+
export interface AnalyticsUser {
|
|
15
|
+
user_id?: number;
|
|
16
|
+
profile_name?: string;
|
|
17
|
+
profile_type_id?: number;
|
|
18
|
+
shipper_id?: number;
|
|
19
|
+
carrier_id?: number;
|
|
20
|
+
is_etcd: boolean;
|
|
21
|
+
}
|
|
22
|
+
type AnalyticsPayload = Record<string, unknown>;
|
|
23
|
+
export declare class AnalyticsService {
|
|
24
|
+
private storageService;
|
|
25
|
+
private appName;
|
|
26
|
+
private menuOptions;
|
|
27
|
+
private environment;
|
|
28
|
+
private static readonly ID_SEGMENT;
|
|
29
|
+
private static readonly MAX_LABEL_LENGTH;
|
|
30
|
+
private currentPage;
|
|
31
|
+
private menuIndex?;
|
|
32
|
+
constructor(storageService: StorageService, appName?: AppName | null, menuOptions?: MenuItem[] | null, environment?: Environment | null);
|
|
33
|
+
/**
|
|
34
|
+
* Registra a troca de tela. Chamado apenas pelo AppComponent, no NavigationEnd.
|
|
35
|
+
* Alem do `page_view`, sincroniza a identificacao do usuario no Clarity --
|
|
36
|
+
* que precisa ser reenviada a cada rota por se tratar de uma SPA.
|
|
37
|
+
*/
|
|
38
|
+
pageView(url: string): void;
|
|
39
|
+
/**
|
|
40
|
+
* INTERATIVO -- o usuario fez algo deliberado: clicou, buscou, exportou, salvou.
|
|
41
|
+
* Chamado a mao pelo componente, no inicio do handler.
|
|
42
|
+
*
|
|
43
|
+
* @param action nome no formato `objeto_verbo`, sem repetir a tela (`page_name` ja vai junto)
|
|
44
|
+
* @param extra `label` para o identificador do alvo, `context` para detalhe livre
|
|
45
|
+
*
|
|
46
|
+
* @example this.analyticsService.userAction('heat_map_search', { context: { uf: 'SP' } });
|
|
47
|
+
*/
|
|
48
|
+
userAction(action: string, extra?: AnalyticsPayload): void;
|
|
49
|
+
/**
|
|
50
|
+
* NAO INTERATIVO -- o sistema respondeu ou exibiu algo: resultado carregado,
|
|
51
|
+
* lista vazia, erro de negocio, modal automatico.
|
|
52
|
+
*
|
|
53
|
+
* @example this.analyticsService.appEvent('heat_map_empty', { context: { points: 0 } });
|
|
54
|
+
*/
|
|
55
|
+
appEvent(action: string, extra?: AnalyticsPayload): void;
|
|
56
|
+
private push;
|
|
57
|
+
private get dataLayer();
|
|
58
|
+
private get isProduction();
|
|
59
|
+
private get env();
|
|
60
|
+
private getUser;
|
|
61
|
+
private realId;
|
|
62
|
+
private get clarity();
|
|
63
|
+
private sendClarityEvent;
|
|
64
|
+
private slug;
|
|
65
|
+
private syncClarity;
|
|
66
|
+
private setClarityTag;
|
|
67
|
+
private resolvePage;
|
|
68
|
+
private normalizePath;
|
|
69
|
+
private findMenu;
|
|
70
|
+
private getMenuIndex;
|
|
71
|
+
/** Achata o menuOptions em `rota -> { nome da tela, modulo }`. */
|
|
72
|
+
private indexMenu;
|
|
73
|
+
private safely;
|
|
74
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AnalyticsService, [null, { optional: true; }, { optional: true; }, { optional: true; }]>;
|
|
75
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<AnalyticsService>;
|
|
76
|
+
}
|
|
77
|
+
export {};
|
package/lib/services/index.d.ts
CHANGED