coveo.analytics 2.26.7 → 2.27.2
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.
- package/README.md +6 -9
- package/dist/coveoua.browser.js +1 -1
- package/dist/coveoua.browser.js.map +1 -1
- package/dist/coveoua.debug.js +4035 -4022
- package/dist/coveoua.debug.js.map +1 -1
- package/dist/coveoua.js +1 -1
- package/dist/coveoua.js.map +1 -1
- package/dist/definitions/bundle/browser-fetch.d.ts +1 -1
- package/dist/definitions/caseAssist/caseAssistActions.d.ts +76 -76
- package/dist/definitions/caseAssist/caseAssistClient.d.ts +28 -28
- package/dist/definitions/client/analytics.d.ts +116 -116
- package/dist/definitions/client/analyticsBeaconClient.d.ts +14 -14
- package/dist/definitions/client/analyticsFetchClient.d.ts +11 -11
- package/dist/definitions/client/analyticsRequestClient.d.ts +24 -24
- package/dist/definitions/client/location.d.ts +1 -1
- package/dist/definitions/client/measurementProtocolMapper.d.ts +7 -7
- package/dist/definitions/client/measurementProtocolMapping/baseMeasurementProtocolMapper.d.ts +3 -3
- package/dist/definitions/client/measurementProtocolMapping/commerceMeasurementProtocolMapper.d.ts +10 -10
- package/dist/definitions/client/measurementProtocolMapping/serviceMeasurementProtocolMapper.d.ts +6 -6
- package/dist/definitions/client/noopAnalytics.d.ts +25 -25
- package/dist/definitions/client/runtimeEnvironment.d.ts +23 -23
- package/dist/definitions/client/token.d.ts +1 -1
- package/dist/definitions/client/utils.d.ts +3 -3
- package/dist/definitions/cookieutils.d.ts +5 -5
- package/dist/definitions/coveoua/browser.d.ts +6 -6
- package/dist/definitions/coveoua/headless.d.ts +6 -6
- package/dist/definitions/coveoua/library.d.ts +17 -13
- package/dist/definitions/coveoua/plugins.d.ts +10 -10
- package/dist/definitions/coveoua/simpleanalytics.d.ts +31 -31
- package/dist/definitions/detector.d.ts +9 -9
- package/dist/definitions/donottrack.d.ts +2 -2
- package/dist/definitions/events.d.ts +113 -113
- package/dist/definitions/formatting/format-array-for-coveo-custom-data.d.ts +1 -1
- package/dist/definitions/formatting/format-omnibox-metadata.d.ts +2 -2
- package/dist/definitions/history.d.ts +33 -33
- package/dist/definitions/hook/addDefaultValues.d.ts +2 -2
- package/dist/definitions/hook/enhanceViewEvent.d.ts +2 -2
- package/dist/definitions/insight/insightClient.d.ts +81 -81
- package/dist/definitions/insight/insightEvents.d.ts +50 -50
- package/dist/definitions/plugins/BasePlugin.d.ts +58 -58
- package/dist/definitions/plugins/ec.d.ts +67 -67
- package/dist/definitions/plugins/link.d.ts +21 -21
- package/dist/definitions/plugins/svc.d.ts +32 -32
- package/dist/definitions/react-native/index.d.ts +3 -3
- package/dist/definitions/react-native/react-native-runtime.d.ts +18 -18
- package/dist/definitions/react-native/react-native-utils.d.ts +2 -2
- package/dist/definitions/searchPage/searchPageClient.d.ts +188 -188
- package/dist/definitions/searchPage/searchPageEvents.d.ts +181 -181
- package/dist/definitions/src/coveoua/browser.d.ts +6 -6
- package/dist/definitions/src/coveoua/headless.d.ts +6 -6
- package/dist/definitions/src/coveoua/library.d.ts +17 -13
- package/dist/definitions/src/coveoua/plugins.d.ts +10 -10
- package/dist/definitions/src/coveoua/simpleanalytics.d.ts +31 -31
- package/dist/definitions/src/react-native/index.d.ts +3 -3
- package/dist/definitions/src/react-native/react-native-runtime.d.ts +18 -18
- package/dist/definitions/storage.d.ts +24 -24
- package/dist/definitions/version.d.ts +1 -1
- package/dist/library.es.js +2629 -2629
- package/dist/library.js +6739 -6735
- package/dist/react-native.es.js +2644 -2644
- package/package.json +24 -25
- package/src/client/analyticsBeaconClient.spec.ts +3 -3
- package/src/coveoua/library.ts +5 -0
- package/src/coveoua/simpleanalytics.ts +3 -0
- package/src/plugins/ec.spec.ts +8 -18
- package/src/react-native/react-native.spec.ts +2 -2
- package/dist/definitions/src/plugins/ec.d.ts +0 -67
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const fetch: ((input: RequestInfo, init?: RequestInit | undefined) => Promise<Response>) & typeof globalThis.fetch;
|
|
1
|
+
export declare const fetch: ((input: RequestInfo | URL, init?: RequestInit | undefined) => Promise<Response>) & typeof globalThis.fetch;
|
|
@@ -1,76 +1,76 @@
|
|
|
1
|
-
import { TicketProperties } from '../plugins/svc';
|
|
2
|
-
export declare enum CaseAssistEvents {
|
|
3
|
-
click = "click",
|
|
4
|
-
flowStart = "flowStart"
|
|
5
|
-
}
|
|
6
|
-
export declare enum CaseAssistActions {
|
|
7
|
-
enterInterface = "ticket_create_start",
|
|
8
|
-
fieldUpdate = "ticket_field_update",
|
|
9
|
-
fieldSuggestionClick = "ticket_classification_click",
|
|
10
|
-
suggestionClick = "suggestion_click",
|
|
11
|
-
suggestionRate = "suggestion_rate",
|
|
12
|
-
nextCaseStep = "ticket_next_stage",
|
|
13
|
-
caseCancelled = "ticket_cancel",
|
|
14
|
-
caseSolved = "ticket_cancel",
|
|
15
|
-
caseCreated = "ticket_create"
|
|
16
|
-
}
|
|
17
|
-
export declare enum CaseCancelledReasons {
|
|
18
|
-
quit = "Quit",
|
|
19
|
-
solved = "Solved"
|
|
20
|
-
}
|
|
21
|
-
export interface EnterInterfaceMetadata {
|
|
22
|
-
ticket: TicketProperties;
|
|
23
|
-
}
|
|
24
|
-
export interface UpdateCaseFieldMetadata {
|
|
25
|
-
fieldName: string;
|
|
26
|
-
ticket: TicketProperties;
|
|
27
|
-
}
|
|
28
|
-
export interface SelectFieldSuggestionMetadata {
|
|
29
|
-
suggestion: FieldSuggestion;
|
|
30
|
-
ticket: TicketProperties;
|
|
31
|
-
}
|
|
32
|
-
export interface SelectDocumentSuggestionMetadata {
|
|
33
|
-
suggestion: DocumentSuggestion;
|
|
34
|
-
ticket: TicketProperties;
|
|
35
|
-
}
|
|
36
|
-
export interface RateDocumentSuggestionMetadata {
|
|
37
|
-
rating: number;
|
|
38
|
-
suggestion: DocumentSuggestion;
|
|
39
|
-
ticket: TicketProperties;
|
|
40
|
-
}
|
|
41
|
-
export interface MoveToNextCaseStepMetadata {
|
|
42
|
-
ticket: TicketProperties;
|
|
43
|
-
stage?: string;
|
|
44
|
-
}
|
|
45
|
-
export interface CaseCancelledMetadata {
|
|
46
|
-
ticket: TicketProperties;
|
|
47
|
-
}
|
|
48
|
-
export interface CaseSolvedMetadata {
|
|
49
|
-
ticket: TicketProperties;
|
|
50
|
-
}
|
|
51
|
-
export interface CaseCreatedMetadata {
|
|
52
|
-
ticket: TicketProperties;
|
|
53
|
-
}
|
|
54
|
-
export interface FieldSuggestion {
|
|
55
|
-
classificationId: string;
|
|
56
|
-
responseId: string;
|
|
57
|
-
fieldName: string;
|
|
58
|
-
classification: {
|
|
59
|
-
value: string;
|
|
60
|
-
confidence: number;
|
|
61
|
-
};
|
|
62
|
-
autoSelection?: boolean;
|
|
63
|
-
}
|
|
64
|
-
export interface DocumentSuggestion {
|
|
65
|
-
suggestionId: string;
|
|
66
|
-
responseId: string;
|
|
67
|
-
suggestion: {
|
|
68
|
-
documentUri: string;
|
|
69
|
-
documentUriHash: string;
|
|
70
|
-
documentTitle: string;
|
|
71
|
-
documentUrl: string;
|
|
72
|
-
documentPosition: number;
|
|
73
|
-
};
|
|
74
|
-
fromQuickview?: boolean;
|
|
75
|
-
openDocument?: boolean;
|
|
76
|
-
}
|
|
1
|
+
import { TicketProperties } from '../plugins/svc';
|
|
2
|
+
export declare enum CaseAssistEvents {
|
|
3
|
+
click = "click",
|
|
4
|
+
flowStart = "flowStart"
|
|
5
|
+
}
|
|
6
|
+
export declare enum CaseAssistActions {
|
|
7
|
+
enterInterface = "ticket_create_start",
|
|
8
|
+
fieldUpdate = "ticket_field_update",
|
|
9
|
+
fieldSuggestionClick = "ticket_classification_click",
|
|
10
|
+
suggestionClick = "suggestion_click",
|
|
11
|
+
suggestionRate = "suggestion_rate",
|
|
12
|
+
nextCaseStep = "ticket_next_stage",
|
|
13
|
+
caseCancelled = "ticket_cancel",
|
|
14
|
+
caseSolved = "ticket_cancel",
|
|
15
|
+
caseCreated = "ticket_create"
|
|
16
|
+
}
|
|
17
|
+
export declare enum CaseCancelledReasons {
|
|
18
|
+
quit = "Quit",
|
|
19
|
+
solved = "Solved"
|
|
20
|
+
}
|
|
21
|
+
export interface EnterInterfaceMetadata {
|
|
22
|
+
ticket: TicketProperties;
|
|
23
|
+
}
|
|
24
|
+
export interface UpdateCaseFieldMetadata {
|
|
25
|
+
fieldName: string;
|
|
26
|
+
ticket: TicketProperties;
|
|
27
|
+
}
|
|
28
|
+
export interface SelectFieldSuggestionMetadata {
|
|
29
|
+
suggestion: FieldSuggestion;
|
|
30
|
+
ticket: TicketProperties;
|
|
31
|
+
}
|
|
32
|
+
export interface SelectDocumentSuggestionMetadata {
|
|
33
|
+
suggestion: DocumentSuggestion;
|
|
34
|
+
ticket: TicketProperties;
|
|
35
|
+
}
|
|
36
|
+
export interface RateDocumentSuggestionMetadata {
|
|
37
|
+
rating: number;
|
|
38
|
+
suggestion: DocumentSuggestion;
|
|
39
|
+
ticket: TicketProperties;
|
|
40
|
+
}
|
|
41
|
+
export interface MoveToNextCaseStepMetadata {
|
|
42
|
+
ticket: TicketProperties;
|
|
43
|
+
stage?: string;
|
|
44
|
+
}
|
|
45
|
+
export interface CaseCancelledMetadata {
|
|
46
|
+
ticket: TicketProperties;
|
|
47
|
+
}
|
|
48
|
+
export interface CaseSolvedMetadata {
|
|
49
|
+
ticket: TicketProperties;
|
|
50
|
+
}
|
|
51
|
+
export interface CaseCreatedMetadata {
|
|
52
|
+
ticket: TicketProperties;
|
|
53
|
+
}
|
|
54
|
+
export interface FieldSuggestion {
|
|
55
|
+
classificationId: string;
|
|
56
|
+
responseId: string;
|
|
57
|
+
fieldName: string;
|
|
58
|
+
classification: {
|
|
59
|
+
value: string;
|
|
60
|
+
confidence: number;
|
|
61
|
+
};
|
|
62
|
+
autoSelection?: boolean;
|
|
63
|
+
}
|
|
64
|
+
export interface DocumentSuggestion {
|
|
65
|
+
suggestionId: string;
|
|
66
|
+
responseId: string;
|
|
67
|
+
suggestion: {
|
|
68
|
+
documentUri: string;
|
|
69
|
+
documentUriHash: string;
|
|
70
|
+
documentTitle: string;
|
|
71
|
+
documentUrl: string;
|
|
72
|
+
documentPosition: number;
|
|
73
|
+
};
|
|
74
|
+
fromQuickview?: boolean;
|
|
75
|
+
openDocument?: boolean;
|
|
76
|
+
}
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import { AnalyticsClient, ClientOptions } from '../client/analytics';
|
|
2
|
-
import { CaseCancelledMetadata, CaseCreatedMetadata, CaseSolvedMetadata, EnterInterfaceMetadata, MoveToNextCaseStepMetadata, RateDocumentSuggestionMetadata, SelectDocumentSuggestionMetadata, SelectFieldSuggestionMetadata, UpdateCaseFieldMetadata } from './caseAssistActions';
|
|
3
|
-
export interface CaseAssistClientProvider {
|
|
4
|
-
getOriginLevel1: () => string;
|
|
5
|
-
}
|
|
6
|
-
export interface CaseAssistClientOptions extends ClientOptions {
|
|
7
|
-
enableAnalytics?: boolean;
|
|
8
|
-
}
|
|
9
|
-
export declare class CaseAssistClient {
|
|
10
|
-
private options;
|
|
11
|
-
private provider?;
|
|
12
|
-
coveoAnalyticsClient: AnalyticsClient;
|
|
13
|
-
private svc;
|
|
14
|
-
constructor(options: Partial<CaseAssistClientOptions>, provider?: CaseAssistClientProvider | undefined);
|
|
15
|
-
disable(): void;
|
|
16
|
-
enable(): void;
|
|
17
|
-
logEnterInterface(meta: EnterInterfaceMetadata): Promise<void | import("../events").
|
|
18
|
-
logUpdateCaseField(meta: UpdateCaseFieldMetadata): Promise<void | import("../events").
|
|
19
|
-
logSelectFieldSuggestion(meta: SelectFieldSuggestionMetadata): Promise<void | import("../events").
|
|
20
|
-
logSelectDocumentSuggestion(meta: SelectDocumentSuggestionMetadata): Promise<void | import("../events").
|
|
21
|
-
logRateDocumentSuggestion(meta: RateDocumentSuggestionMetadata): Promise<void | import("../events").
|
|
22
|
-
logMoveToNextCaseStep(meta: MoveToNextCaseStepMetadata): Promise<void | import("../events").
|
|
23
|
-
logCaseCancelled(meta: CaseCancelledMetadata): Promise<void | import("../events").
|
|
24
|
-
logCaseSolved(meta: CaseSolvedMetadata): Promise<void | import("../events").
|
|
25
|
-
logCaseCreated(meta: CaseCreatedMetadata): Promise<void | import("../events").
|
|
26
|
-
private sendFlowStartEvent;
|
|
27
|
-
private sendClickEvent;
|
|
28
|
-
}
|
|
1
|
+
import { AnalyticsClient, ClientOptions } from '../client/analytics';
|
|
2
|
+
import { CaseCancelledMetadata, CaseCreatedMetadata, CaseSolvedMetadata, EnterInterfaceMetadata, MoveToNextCaseStepMetadata, RateDocumentSuggestionMetadata, SelectDocumentSuggestionMetadata, SelectFieldSuggestionMetadata, UpdateCaseFieldMetadata } from './caseAssistActions';
|
|
3
|
+
export interface CaseAssistClientProvider {
|
|
4
|
+
getOriginLevel1: () => string;
|
|
5
|
+
}
|
|
6
|
+
export interface CaseAssistClientOptions extends ClientOptions {
|
|
7
|
+
enableAnalytics?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare class CaseAssistClient {
|
|
10
|
+
private options;
|
|
11
|
+
private provider?;
|
|
12
|
+
coveoAnalyticsClient: AnalyticsClient;
|
|
13
|
+
private svc;
|
|
14
|
+
constructor(options: Partial<CaseAssistClientOptions>, provider?: CaseAssistClientProvider | undefined);
|
|
15
|
+
disable(): void;
|
|
16
|
+
enable(): void;
|
|
17
|
+
logEnterInterface(meta: EnterInterfaceMetadata): Promise<void | import("../events").AnyEventResponse>;
|
|
18
|
+
logUpdateCaseField(meta: UpdateCaseFieldMetadata): Promise<void | import("../events").AnyEventResponse>;
|
|
19
|
+
logSelectFieldSuggestion(meta: SelectFieldSuggestionMetadata): Promise<void | import("../events").AnyEventResponse>;
|
|
20
|
+
logSelectDocumentSuggestion(meta: SelectDocumentSuggestionMetadata): Promise<void | import("../events").AnyEventResponse>;
|
|
21
|
+
logRateDocumentSuggestion(meta: RateDocumentSuggestionMetadata): Promise<void | import("../events").AnyEventResponse>;
|
|
22
|
+
logMoveToNextCaseStep(meta: MoveToNextCaseStepMetadata): Promise<void | import("../events").AnyEventResponse>;
|
|
23
|
+
logCaseCancelled(meta: CaseCancelledMetadata): Promise<void | import("../events").AnyEventResponse>;
|
|
24
|
+
logCaseSolved(meta: CaseSolvedMetadata): Promise<void | import("../events").AnyEventResponse>;
|
|
25
|
+
logCaseCreated(meta: CaseCreatedMetadata): Promise<void | import("../events").AnyEventResponse>;
|
|
26
|
+
private sendFlowStartEvent;
|
|
27
|
+
private sendClickEvent;
|
|
28
|
+
}
|
|
@@ -1,116 +1,116 @@
|
|
|
1
|
-
import { AnyEventResponse, ClickEventRequest, ClickEventResponse, CustomEventRequest, CustomEventResponse, EventType, HealthResponse, SearchEventRequest, SearchEventResponse, ViewEventRequest, ViewEventResponse, VisitResponse, VariableArgumentsPayload, PreparedClickEventRequest, PreparedCustomEventRequest, PreparedViewEventRequest, PreparedSearchEventRequest } from '../events';
|
|
2
|
-
import { PreprocessAnalyticsRequest, VisitorIdProvider } from './analyticsRequestClient';
|
|
3
|
-
import { IRuntimeEnvironment } from './runtimeEnvironment';
|
|
4
|
-
export declare const Version = "v15";
|
|
5
|
-
export declare const Endpoints: {
|
|
6
|
-
default: string;
|
|
7
|
-
production: string;
|
|
8
|
-
hipaa: string;
|
|
9
|
-
};
|
|
10
|
-
export interface ClientOptions {
|
|
11
|
-
token?: string;
|
|
12
|
-
endpoint: string;
|
|
13
|
-
version: string;
|
|
14
|
-
runtimeEnvironment?: IRuntimeEnvironment;
|
|
15
|
-
beforeSendHooks: AnalyticsClientSendEventHook[];
|
|
16
|
-
afterSendHooks: AnalyticsClientSendEventHook[];
|
|
17
|
-
preprocessRequest?: PreprocessAnalyticsRequest;
|
|
18
|
-
}
|
|
19
|
-
export
|
|
20
|
-
export
|
|
21
|
-
newEventType: EventType;
|
|
22
|
-
variableLengthArgumentsNames?: string[];
|
|
23
|
-
addVisitorIdParameter?: boolean;
|
|
24
|
-
addClientIdParameter?: boolean;
|
|
25
|
-
usesMeasurementProtocol?: boolean;
|
|
26
|
-
};
|
|
27
|
-
export interface PreparedEvent<TPreparedRequest, TCompleteRequest, TResponse extends AnyEventResponse> extends BufferedRequest {
|
|
28
|
-
log(remainingPayload: Omit<TCompleteRequest, keyof TPreparedRequest>): Promise<TResponse | void>;
|
|
29
|
-
}
|
|
30
|
-
export interface AnalyticsClient {
|
|
31
|
-
getPayload(eventType: string, ...payload: VariableArgumentsPayload): Promise<any>;
|
|
32
|
-
getParameters(eventType: string, ...payload: VariableArgumentsPayload): Promise<any>;
|
|
33
|
-
makeEvent<TPreparedRequest, TCompleteRequest, TResponse extends AnyEventResponse>(eventType: string, ...payload: VariableArgumentsPayload): Promise<PreparedEvent<TPreparedRequest, TCompleteRequest, TResponse>>;
|
|
34
|
-
sendEvent(eventType: string, ...payload: VariableArgumentsPayload): Promise<AnyEventResponse | void>;
|
|
35
|
-
makeSearchEvent(request: PreparedSearchEventRequest): Promise<PreparedEvent<PreparedSearchEventRequest, SearchEventRequest, SearchEventResponse>>;
|
|
36
|
-
sendSearchEvent(request: SearchEventRequest): Promise<SearchEventResponse | void>;
|
|
37
|
-
makeClickEvent(request: PreparedClickEventRequest): Promise<PreparedEvent<PreparedClickEventRequest, ClickEventRequest, ClickEventResponse>>;
|
|
38
|
-
sendClickEvent(request: ClickEventRequest): Promise<ClickEventResponse | void>;
|
|
39
|
-
makeCustomEvent(request: PreparedCustomEventRequest): Promise<PreparedEvent<PreparedCustomEventRequest, CustomEventRequest, CustomEventResponse>>;
|
|
40
|
-
sendCustomEvent(request: CustomEventRequest): Promise<CustomEventResponse | void>;
|
|
41
|
-
makeViewEvent(request: PreparedViewEventRequest): Promise<PreparedEvent<PreparedViewEventRequest, ViewEventRequest, ViewEventResponse>>;
|
|
42
|
-
sendViewEvent(request: ViewEventRequest): Promise<ViewEventResponse | void>;
|
|
43
|
-
getVisit(): Promise<VisitResponse>;
|
|
44
|
-
getHealth(): Promise<HealthResponse>;
|
|
45
|
-
registerBeforeSendEventHook(hook: AnalyticsClientSendEventHook): void;
|
|
46
|
-
registerAfterSendEventHook(hook: AnalyticsClientSendEventHook): void;
|
|
47
|
-
addEventTypeMapping(eventType: string, eventConfig: EventTypeConfig): void;
|
|
48
|
-
runtime: IRuntimeEnvironment;
|
|
49
|
-
version: string;
|
|
50
|
-
readonly currentVisitorId: string;
|
|
51
|
-
getCurrentVisitorId?(): Promise<string>;
|
|
52
|
-
setAcceptedLinkReferrers?(hosts: string[]): void;
|
|
53
|
-
}
|
|
54
|
-
export interface BufferedRequest {
|
|
55
|
-
eventType: EventType;
|
|
56
|
-
payload: any;
|
|
57
|
-
}
|
|
58
|
-
export declare function buildBaseUrl(endpoint?: string, apiVersion?: string): string;
|
|
59
|
-
export declare class CoveoAnalyticsClient implements AnalyticsClient, VisitorIdProvider {
|
|
60
|
-
private get defaultOptions();
|
|
61
|
-
runtime: IRuntimeEnvironment;
|
|
62
|
-
get version(): string;
|
|
63
|
-
private visitorId;
|
|
64
|
-
private bufferedRequests;
|
|
65
|
-
private beforeSendHooks;
|
|
66
|
-
private afterSendHooks;
|
|
67
|
-
private eventTypeMapping;
|
|
68
|
-
private options;
|
|
69
|
-
private acceptedLinkReferrers;
|
|
70
|
-
constructor(opts: Partial<ClientOptions>);
|
|
71
|
-
private initRuntime;
|
|
72
|
-
private get storage();
|
|
73
|
-
private determineVisitorId;
|
|
74
|
-
getCurrentVisitorId(): Promise<string>;
|
|
75
|
-
setCurrentVisitorId(visitorId: string): Promise<void>;
|
|
76
|
-
setClientId(value: string, namespace?: string): Promise<void>;
|
|
77
|
-
getParameters(eventType: EventType | string, ...payload: VariableArgumentsPayload): Promise<VariableArgumentsPayload>;
|
|
78
|
-
getPayload(eventType: EventType | string, ...payload: VariableArgumentsPayload): Promise<any>;
|
|
79
|
-
get currentVisitorId(): string;
|
|
80
|
-
set currentVisitorId(visitorId: string);
|
|
81
|
-
private extractClientIdFromLink;
|
|
82
|
-
resolveParameters(eventType: EventType | string, ...payload: VariableArgumentsPayload): Promise<VariableArgumentsPayload>;
|
|
83
|
-
resolvePayloadForParameters(eventType: EventType | string, parameters: any): Promise<any>;
|
|
84
|
-
makeEvent<TPreparedRequest, TCompleteRequest, TResponse extends AnyEventResponse>(eventType: EventType | string, ...payload: VariableArgumentsPayload): Promise<PreparedEvent<TPreparedRequest, TCompleteRequest, TResponse>>;
|
|
85
|
-
sendEvent(eventType: EventType | string, ...payload: VariableArgumentsPayload): Promise<void |
|
|
86
|
-
private deferExecution;
|
|
87
|
-
private sendFromBufferWithFetch;
|
|
88
|
-
clear(): void;
|
|
89
|
-
deleteHttpOnlyVisitorId(): void;
|
|
90
|
-
makeSearchEvent(request: PreparedSearchEventRequest): Promise<PreparedEvent<PreparedSearchEventRequest, SearchEventRequest, SearchEventResponse>>;
|
|
91
|
-
sendSearchEvent({ searchQueryUid, ...preparedRequest }: SearchEventRequest): Promise<void | SearchEventResponse>;
|
|
92
|
-
makeClickEvent(request: PreparedClickEventRequest): Promise<PreparedEvent<PreparedClickEventRequest, ClickEventRequest, ClickEventResponse>>;
|
|
93
|
-
sendClickEvent({ searchQueryUid, ...preparedRequest }: ClickEventRequest): Promise<void | ClickEventResponse>;
|
|
94
|
-
makeCustomEvent(request: PreparedCustomEventRequest): Promise<PreparedEvent<PreparedCustomEventRequest, CustomEventRequest, CustomEventResponse>>;
|
|
95
|
-
sendCustomEvent({ lastSearchQueryUid, ...preparedRequest }: CustomEventRequest): Promise<void | CustomEventResponse>;
|
|
96
|
-
makeViewEvent(request: PreparedViewEventRequest): Promise<PreparedEvent<PreparedViewEventRequest, ViewEventRequest, ViewEventResponse>>;
|
|
97
|
-
sendViewEvent(request: ViewEventRequest): Promise<ViewEventResponse | void>;
|
|
98
|
-
getVisit(): Promise<VisitResponse>;
|
|
99
|
-
getHealth(): Promise<HealthResponse>;
|
|
100
|
-
registerBeforeSendEventHook(hook: AnalyticsClientSendEventHook): void;
|
|
101
|
-
registerAfterSendEventHook(hook: AnalyticsClientSendEventHook): void;
|
|
102
|
-
addEventTypeMapping(eventType: string, eventConfig: EventTypeConfig): void;
|
|
103
|
-
setAcceptedLinkReferrers(hosts: string[]): void;
|
|
104
|
-
private parseVariableArgumentsPayload;
|
|
105
|
-
private isKeyAllowedEmpty;
|
|
106
|
-
private removeEmptyPayloadValues;
|
|
107
|
-
private removeUnknownParameters;
|
|
108
|
-
private processCustomParameters;
|
|
109
|
-
private mapCustomParametersToCustomData;
|
|
110
|
-
private lowercaseKeys;
|
|
111
|
-
private validateParams;
|
|
112
|
-
private ensureAnonymousUserWhenUsingApiKey;
|
|
113
|
-
private limit;
|
|
114
|
-
private get baseUrl();
|
|
115
|
-
}
|
|
116
|
-
export default CoveoAnalyticsClient;
|
|
1
|
+
import { AnyEventResponse, ClickEventRequest, ClickEventResponse, CustomEventRequest, CustomEventResponse, EventType, HealthResponse, SearchEventRequest, SearchEventResponse, ViewEventRequest, ViewEventResponse, VisitResponse, VariableArgumentsPayload, PreparedClickEventRequest, PreparedCustomEventRequest, PreparedViewEventRequest, PreparedSearchEventRequest } from '../events';
|
|
2
|
+
import { PreprocessAnalyticsRequest, VisitorIdProvider } from './analyticsRequestClient';
|
|
3
|
+
import { IRuntimeEnvironment } from './runtimeEnvironment';
|
|
4
|
+
export declare const Version = "v15";
|
|
5
|
+
export declare const Endpoints: {
|
|
6
|
+
default: string;
|
|
7
|
+
production: string;
|
|
8
|
+
hipaa: string;
|
|
9
|
+
};
|
|
10
|
+
export interface ClientOptions {
|
|
11
|
+
token?: string;
|
|
12
|
+
endpoint: string;
|
|
13
|
+
version: string;
|
|
14
|
+
runtimeEnvironment?: IRuntimeEnvironment;
|
|
15
|
+
beforeSendHooks: AnalyticsClientSendEventHook[];
|
|
16
|
+
afterSendHooks: AnalyticsClientSendEventHook[];
|
|
17
|
+
preprocessRequest?: PreprocessAnalyticsRequest;
|
|
18
|
+
}
|
|
19
|
+
export type AnalyticsClientSendEventHook = <TResult>(eventType: string, payload: any) => TResult | Promise<TResult>;
|
|
20
|
+
export type EventTypeConfig = {
|
|
21
|
+
newEventType: EventType;
|
|
22
|
+
variableLengthArgumentsNames?: string[];
|
|
23
|
+
addVisitorIdParameter?: boolean;
|
|
24
|
+
addClientIdParameter?: boolean;
|
|
25
|
+
usesMeasurementProtocol?: boolean;
|
|
26
|
+
};
|
|
27
|
+
export interface PreparedEvent<TPreparedRequest, TCompleteRequest, TResponse extends AnyEventResponse> extends BufferedRequest {
|
|
28
|
+
log(remainingPayload: Omit<TCompleteRequest, keyof TPreparedRequest>): Promise<TResponse | void>;
|
|
29
|
+
}
|
|
30
|
+
export interface AnalyticsClient {
|
|
31
|
+
getPayload(eventType: string, ...payload: VariableArgumentsPayload): Promise<any>;
|
|
32
|
+
getParameters(eventType: string, ...payload: VariableArgumentsPayload): Promise<any>;
|
|
33
|
+
makeEvent<TPreparedRequest, TCompleteRequest, TResponse extends AnyEventResponse>(eventType: string, ...payload: VariableArgumentsPayload): Promise<PreparedEvent<TPreparedRequest, TCompleteRequest, TResponse>>;
|
|
34
|
+
sendEvent(eventType: string, ...payload: VariableArgumentsPayload): Promise<AnyEventResponse | void>;
|
|
35
|
+
makeSearchEvent(request: PreparedSearchEventRequest): Promise<PreparedEvent<PreparedSearchEventRequest, SearchEventRequest, SearchEventResponse>>;
|
|
36
|
+
sendSearchEvent(request: SearchEventRequest): Promise<SearchEventResponse | void>;
|
|
37
|
+
makeClickEvent(request: PreparedClickEventRequest): Promise<PreparedEvent<PreparedClickEventRequest, ClickEventRequest, ClickEventResponse>>;
|
|
38
|
+
sendClickEvent(request: ClickEventRequest): Promise<ClickEventResponse | void>;
|
|
39
|
+
makeCustomEvent(request: PreparedCustomEventRequest): Promise<PreparedEvent<PreparedCustomEventRequest, CustomEventRequest, CustomEventResponse>>;
|
|
40
|
+
sendCustomEvent(request: CustomEventRequest): Promise<CustomEventResponse | void>;
|
|
41
|
+
makeViewEvent(request: PreparedViewEventRequest): Promise<PreparedEvent<PreparedViewEventRequest, ViewEventRequest, ViewEventResponse>>;
|
|
42
|
+
sendViewEvent(request: ViewEventRequest): Promise<ViewEventResponse | void>;
|
|
43
|
+
getVisit(): Promise<VisitResponse>;
|
|
44
|
+
getHealth(): Promise<HealthResponse>;
|
|
45
|
+
registerBeforeSendEventHook(hook: AnalyticsClientSendEventHook): void;
|
|
46
|
+
registerAfterSendEventHook(hook: AnalyticsClientSendEventHook): void;
|
|
47
|
+
addEventTypeMapping(eventType: string, eventConfig: EventTypeConfig): void;
|
|
48
|
+
runtime: IRuntimeEnvironment;
|
|
49
|
+
version: string;
|
|
50
|
+
readonly currentVisitorId: string;
|
|
51
|
+
getCurrentVisitorId?(): Promise<string>;
|
|
52
|
+
setAcceptedLinkReferrers?(hosts: string[]): void;
|
|
53
|
+
}
|
|
54
|
+
export interface BufferedRequest {
|
|
55
|
+
eventType: EventType;
|
|
56
|
+
payload: any;
|
|
57
|
+
}
|
|
58
|
+
export declare function buildBaseUrl(endpoint?: string, apiVersion?: string): string;
|
|
59
|
+
export declare class CoveoAnalyticsClient implements AnalyticsClient, VisitorIdProvider {
|
|
60
|
+
private get defaultOptions();
|
|
61
|
+
runtime: IRuntimeEnvironment;
|
|
62
|
+
get version(): string;
|
|
63
|
+
private visitorId;
|
|
64
|
+
private bufferedRequests;
|
|
65
|
+
private beforeSendHooks;
|
|
66
|
+
private afterSendHooks;
|
|
67
|
+
private eventTypeMapping;
|
|
68
|
+
private options;
|
|
69
|
+
private acceptedLinkReferrers;
|
|
70
|
+
constructor(opts: Partial<ClientOptions>);
|
|
71
|
+
private initRuntime;
|
|
72
|
+
private get storage();
|
|
73
|
+
private determineVisitorId;
|
|
74
|
+
getCurrentVisitorId(): Promise<string>;
|
|
75
|
+
setCurrentVisitorId(visitorId: string): Promise<void>;
|
|
76
|
+
setClientId(value: string, namespace?: string): Promise<void>;
|
|
77
|
+
getParameters(eventType: EventType | string, ...payload: VariableArgumentsPayload): Promise<VariableArgumentsPayload>;
|
|
78
|
+
getPayload(eventType: EventType | string, ...payload: VariableArgumentsPayload): Promise<any>;
|
|
79
|
+
get currentVisitorId(): string;
|
|
80
|
+
set currentVisitorId(visitorId: string);
|
|
81
|
+
private extractClientIdFromLink;
|
|
82
|
+
resolveParameters(eventType: EventType | string, ...payload: VariableArgumentsPayload): Promise<VariableArgumentsPayload>;
|
|
83
|
+
resolvePayloadForParameters(eventType: EventType | string, parameters: any): Promise<any>;
|
|
84
|
+
makeEvent<TPreparedRequest, TCompleteRequest, TResponse extends AnyEventResponse>(eventType: EventType | string, ...payload: VariableArgumentsPayload): Promise<PreparedEvent<TPreparedRequest, TCompleteRequest, TResponse>>;
|
|
85
|
+
sendEvent(eventType: EventType | string, ...payload: VariableArgumentsPayload): Promise<void | AnyEventResponse>;
|
|
86
|
+
private deferExecution;
|
|
87
|
+
private sendFromBufferWithFetch;
|
|
88
|
+
clear(): void;
|
|
89
|
+
deleteHttpOnlyVisitorId(): void;
|
|
90
|
+
makeSearchEvent(request: PreparedSearchEventRequest): Promise<PreparedEvent<PreparedSearchEventRequest, SearchEventRequest, SearchEventResponse>>;
|
|
91
|
+
sendSearchEvent({ searchQueryUid, ...preparedRequest }: SearchEventRequest): Promise<void | SearchEventResponse>;
|
|
92
|
+
makeClickEvent(request: PreparedClickEventRequest): Promise<PreparedEvent<PreparedClickEventRequest, ClickEventRequest, ClickEventResponse>>;
|
|
93
|
+
sendClickEvent({ searchQueryUid, ...preparedRequest }: ClickEventRequest): Promise<void | ClickEventResponse>;
|
|
94
|
+
makeCustomEvent(request: PreparedCustomEventRequest): Promise<PreparedEvent<PreparedCustomEventRequest, CustomEventRequest, CustomEventResponse>>;
|
|
95
|
+
sendCustomEvent({ lastSearchQueryUid, ...preparedRequest }: CustomEventRequest): Promise<void | CustomEventResponse>;
|
|
96
|
+
makeViewEvent(request: PreparedViewEventRequest): Promise<PreparedEvent<PreparedViewEventRequest, ViewEventRequest, ViewEventResponse>>;
|
|
97
|
+
sendViewEvent(request: ViewEventRequest): Promise<ViewEventResponse | void>;
|
|
98
|
+
getVisit(): Promise<VisitResponse>;
|
|
99
|
+
getHealth(): Promise<HealthResponse>;
|
|
100
|
+
registerBeforeSendEventHook(hook: AnalyticsClientSendEventHook): void;
|
|
101
|
+
registerAfterSendEventHook(hook: AnalyticsClientSendEventHook): void;
|
|
102
|
+
addEventTypeMapping(eventType: string, eventConfig: EventTypeConfig): void;
|
|
103
|
+
setAcceptedLinkReferrers(hosts: string[]): void;
|
|
104
|
+
private parseVariableArgumentsPayload;
|
|
105
|
+
private isKeyAllowedEmpty;
|
|
106
|
+
private removeEmptyPayloadValues;
|
|
107
|
+
private removeUnknownParameters;
|
|
108
|
+
private processCustomParameters;
|
|
109
|
+
private mapCustomParametersToCustomData;
|
|
110
|
+
private lowercaseKeys;
|
|
111
|
+
private validateParams;
|
|
112
|
+
private ensureAnonymousUserWhenUsingApiKey;
|
|
113
|
+
private limit;
|
|
114
|
+
private get baseUrl();
|
|
115
|
+
}
|
|
116
|
+
export default CoveoAnalyticsClient;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { AnalyticsRequestClient, IAnalyticsClientOptions } from './analyticsRequestClient';
|
|
2
|
-
import { EventType, IRequestPayload } from '../events';
|
|
3
|
-
export declare class AnalyticsBeaconClient implements AnalyticsRequestClient {
|
|
4
|
-
private opts;
|
|
5
|
-
constructor(opts: IAnalyticsClientOptions);
|
|
6
|
-
sendEvent(eventType: EventType, payload: IRequestPayload): Promise<void>;
|
|
7
|
-
deleteHttpCookieVisitorId(): Promise<void>;
|
|
8
|
-
private encodeForEventType;
|
|
9
|
-
private getQueryParamsForEventType;
|
|
10
|
-
private isEventTypeLegacy;
|
|
11
|
-
private encodeForLegacyType;
|
|
12
|
-
private encodeForFormUrlEncoded;
|
|
13
|
-
private encodeValue;
|
|
14
|
-
}
|
|
1
|
+
import { AnalyticsRequestClient, IAnalyticsClientOptions } from './analyticsRequestClient';
|
|
2
|
+
import { EventType, IRequestPayload } from '../events';
|
|
3
|
+
export declare class AnalyticsBeaconClient implements AnalyticsRequestClient {
|
|
4
|
+
private opts;
|
|
5
|
+
constructor(opts: IAnalyticsClientOptions);
|
|
6
|
+
sendEvent(eventType: EventType, payload: IRequestPayload): Promise<void>;
|
|
7
|
+
deleteHttpCookieVisitorId(): Promise<void>;
|
|
8
|
+
private encodeForEventType;
|
|
9
|
+
private getQueryParamsForEventType;
|
|
10
|
+
private isEventTypeLegacy;
|
|
11
|
+
private encodeForLegacyType;
|
|
12
|
+
private encodeForFormUrlEncoded;
|
|
13
|
+
private encodeValue;
|
|
14
|
+
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { AnalyticsRequestClient, IAnalyticsClientOptions } from './analyticsRequestClient';
|
|
2
|
-
import { AnyEventResponse, EventType, IRequestPayload } from '../events';
|
|
3
|
-
export declare class AnalyticsFetchClient implements AnalyticsRequestClient {
|
|
4
|
-
private opts;
|
|
5
|
-
constructor(opts: IAnalyticsClientOptions);
|
|
6
|
-
sendEvent(eventType: EventType, payload: IRequestPayload): Promise<AnyEventResponse>;
|
|
7
|
-
deleteHttpCookieVisitorId(): Promise<void>;
|
|
8
|
-
private shouldAppendVisitorId;
|
|
9
|
-
private getVisitorIdParam;
|
|
10
|
-
private getHeaders;
|
|
11
|
-
}
|
|
1
|
+
import { AnalyticsRequestClient, IAnalyticsClientOptions } from './analyticsRequestClient';
|
|
2
|
+
import { AnyEventResponse, EventType, IRequestPayload } from '../events';
|
|
3
|
+
export declare class AnalyticsFetchClient implements AnalyticsRequestClient {
|
|
4
|
+
private opts;
|
|
5
|
+
constructor(opts: IAnalyticsClientOptions);
|
|
6
|
+
sendEvent(eventType: EventType, payload: IRequestPayload): Promise<AnyEventResponse>;
|
|
7
|
+
deleteHttpCookieVisitorId(): Promise<void>;
|
|
8
|
+
private shouldAppendVisitorId;
|
|
9
|
+
private getVisitorIdParam;
|
|
10
|
+
private getHeaders;
|
|
11
|
+
}
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { AnyEventResponse, EventType, IRequestPayload } from '../events';
|
|
2
|
-
export interface VisitorIdProvider {
|
|
3
|
-
getCurrentVisitorId: () => Promise<string>;
|
|
4
|
-
setCurrentVisitorId: (visitorId: string) => void;
|
|
5
|
-
}
|
|
6
|
-
export interface AnalyticsRequestClient {
|
|
7
|
-
sendEvent(eventType: string, payload: IRequestPayload): Promise<AnyEventResponse | void>;
|
|
8
|
-
deleteHttpCookieVisitorId: () => Promise<void>;
|
|
9
|
-
}
|
|
10
|
-
export interface IAnalyticsClientOptions {
|
|
11
|
-
baseUrl: string;
|
|
12
|
-
token?: string;
|
|
13
|
-
visitorIdProvider: VisitorIdProvider;
|
|
14
|
-
preprocessRequest?: PreprocessAnalyticsRequest;
|
|
15
|
-
}
|
|
16
|
-
export
|
|
17
|
-
export
|
|
18
|
-
export interface IAnalyticsRequestOptions extends RequestInit {
|
|
19
|
-
url: string;
|
|
20
|
-
}
|
|
21
|
-
export declare class NoopAnalyticsClient implements AnalyticsRequestClient {
|
|
22
|
-
sendEvent(_: EventType, __: IRequestPayload): Promise<void>;
|
|
23
|
-
deleteHttpCookieVisitorId(): Promise<void>;
|
|
24
|
-
}
|
|
1
|
+
import { AnyEventResponse, EventType, IRequestPayload } from '../events';
|
|
2
|
+
export interface VisitorIdProvider {
|
|
3
|
+
getCurrentVisitorId: () => Promise<string>;
|
|
4
|
+
setCurrentVisitorId: (visitorId: string) => void;
|
|
5
|
+
}
|
|
6
|
+
export interface AnalyticsRequestClient {
|
|
7
|
+
sendEvent(eventType: string, payload: IRequestPayload): Promise<AnyEventResponse | void>;
|
|
8
|
+
deleteHttpCookieVisitorId: () => Promise<void>;
|
|
9
|
+
}
|
|
10
|
+
export interface IAnalyticsClientOptions {
|
|
11
|
+
baseUrl: string;
|
|
12
|
+
token?: string;
|
|
13
|
+
visitorIdProvider: VisitorIdProvider;
|
|
14
|
+
preprocessRequest?: PreprocessAnalyticsRequest;
|
|
15
|
+
}
|
|
16
|
+
export type AnalyticsClientOrigin = 'analyticsFetch' | 'analyticsBeacon';
|
|
17
|
+
export type PreprocessAnalyticsRequest = (request: IAnalyticsRequestOptions, clientOrigin: AnalyticsClientOrigin) => IAnalyticsRequestOptions | Promise<IAnalyticsRequestOptions>;
|
|
18
|
+
export interface IAnalyticsRequestOptions extends RequestInit {
|
|
19
|
+
url: string;
|
|
20
|
+
}
|
|
21
|
+
export declare class NoopAnalyticsClient implements AnalyticsRequestClient {
|
|
22
|
+
sendEvent(_: EventType, __: IRequestPayload): Promise<void>;
|
|
23
|
+
deleteHttpCookieVisitorId(): Promise<void>;
|
|
24
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const getFormattedLocation: (location: Location) => string;
|
|
1
|
+
export declare const getFormattedLocation: (location: Location) => string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export declare const convertKeysToMeasurementProtocol: (params: any) => {};
|
|
2
|
-
export declare const isMeasurementProtocolKey: (key: string) => boolean;
|
|
3
|
-
export declare const convertCustomMeasurementProtocolKeys: (data: {
|
|
4
|
-
[name: string]: string | {
|
|
5
|
-
[name: string]: string;
|
|
6
|
-
};
|
|
7
|
-
}) => {};
|
|
1
|
+
export declare const convertKeysToMeasurementProtocol: (params: any) => {};
|
|
2
|
+
export declare const isMeasurementProtocolKey: (key: string) => boolean;
|
|
3
|
+
export declare const convertCustomMeasurementProtocolKeys: (data: {
|
|
4
|
+
[name: string]: string | {
|
|
5
|
+
[name: string]: string;
|
|
6
|
+
};
|
|
7
|
+
}) => {};
|
package/dist/definitions/client/measurementProtocolMapping/baseMeasurementProtocolMapper.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const baseMeasurementProtocolKeysMapping: {
|
|
2
|
-
[name: string]: string;
|
|
3
|
-
};
|
|
1
|
+
export declare const baseMeasurementProtocolKeysMapping: {
|
|
2
|
+
[name: string]: string;
|
|
3
|
+
};
|
package/dist/definitions/client/measurementProtocolMapping/commerceMeasurementProtocolMapper.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Product, ImpressionList } from '../../plugins/ec';
|
|
2
|
-
export declare const commerceActionKeysMappingPerAction: Record<string, {
|
|
3
|
-
[name: string]: string;
|
|
4
|
-
}>;
|
|
5
|
-
export declare const convertProductToMeasurementProtocol: (product: Product, index: number) => {};
|
|
6
|
-
export declare const convertImpressionListToMeasurementProtocol: (impressionList: ImpressionList, listIndex: number, prefix: string) => {
|
|
7
|
-
[name: string]: any;
|
|
8
|
-
};
|
|
9
|
-
export declare const isCommerceKey: ((key: string) => boolean)[];
|
|
10
|
-
export declare const isCustomCommerceKey: RegExp[];
|
|
1
|
+
import { Product, ImpressionList } from '../../plugins/ec';
|
|
2
|
+
export declare const commerceActionKeysMappingPerAction: Record<string, {
|
|
3
|
+
[name: string]: string;
|
|
4
|
+
}>;
|
|
5
|
+
export declare const convertProductToMeasurementProtocol: (product: Product, index: number) => {};
|
|
6
|
+
export declare const convertImpressionListToMeasurementProtocol: (impressionList: ImpressionList, listIndex: number, prefix: string) => {
|
|
7
|
+
[name: string]: any;
|
|
8
|
+
};
|
|
9
|
+
export declare const isCommerceKey: ((key: string) => boolean)[];
|
|
10
|
+
export declare const isCustomCommerceKey: RegExp[];
|
package/dist/definitions/client/measurementProtocolMapping/serviceMeasurementProtocolMapper.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Ticket } from '../../plugins/svc';
|
|
2
|
-
export declare const serviceActionsKeysMapping: {
|
|
3
|
-
[name: string]: string;
|
|
4
|
-
};
|
|
5
|
-
export declare const convertTicketToMeasurementProtocol: (ticket: Ticket) => {};
|
|
6
|
-
export declare const isServiceKey: ((key: string) => boolean)[];
|
|
1
|
+
import { Ticket } from '../../plugins/svc';
|
|
2
|
+
export declare const serviceActionsKeysMapping: {
|
|
3
|
+
[name: string]: string;
|
|
4
|
+
};
|
|
5
|
+
export declare const convertTicketToMeasurementProtocol: (ticket: Ticket) => {};
|
|
6
|
+
export declare const isServiceKey: ((key: string) => boolean)[];
|