@sitecore-content-sdk/events 2.0.0-canary.12
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/LICENSE.MD +202 -0
- package/README.md +91 -0
- package/browser.d.ts +2 -0
- package/dist/cjs/package.json +80 -0
- package/dist/cjs/src/browser.js +9 -0
- package/dist/cjs/src/consts.js +21 -0
- package/dist/cjs/src/debug.js +12 -0
- package/dist/cjs/src/eventStorage/addToEventQueue.js +25 -0
- package/dist/cjs/src/eventStorage/clearEventQueue.js +15 -0
- package/dist/cjs/src/eventStorage/eventStorage.js +67 -0
- package/dist/cjs/src/eventStorage/processEventQueue.js +16 -0
- package/dist/cjs/src/events/base-event.js +35 -0
- package/dist/cjs/src/events/common-interfaces.js +2 -0
- package/dist/cjs/src/events/consts.js +5 -0
- package/dist/cjs/src/events/custom-event/custom-event.js +62 -0
- package/dist/cjs/src/events/custom-event/event.js +27 -0
- package/dist/cjs/src/events/custom-event/form.js +38 -0
- package/dist/cjs/src/events/identity/identity-event.js +93 -0
- package/dist/cjs/src/events/identity/identity.js +27 -0
- package/dist/cjs/src/events/index.js +11 -0
- package/dist/cjs/src/events/page-view/page-view-event.js +131 -0
- package/dist/cjs/src/events/page-view/page-view.js +30 -0
- package/dist/cjs/src/events/send-event/sendEvent.js +36 -0
- package/dist/cjs/src/index.js +13 -0
- package/dist/cjs/src/initialization/const.js +8 -0
- package/dist/cjs/src/initialization/plugin.js +56 -0
- package/dist/cjs/src/initialization/types.js +2 -0
- package/dist/cjs/src/internal.js +8 -0
- package/dist/esm/package.json +80 -0
- package/dist/esm/src/browser.js +3 -0
- package/dist/esm/src/consts.js +15 -0
- package/dist/esm/src/debug.js +9 -0
- package/dist/esm/src/eventStorage/addToEventQueue.js +22 -0
- package/dist/esm/src/eventStorage/clearEventQueue.js +12 -0
- package/dist/esm/src/eventStorage/eventStorage.js +64 -0
- package/dist/esm/src/eventStorage/processEventQueue.js +13 -0
- package/dist/esm/src/events/base-event.js +31 -0
- package/dist/esm/src/events/common-interfaces.js +1 -0
- package/dist/esm/src/events/consts.js +2 -0
- package/dist/esm/src/events/custom-event/custom-event.js +58 -0
- package/dist/esm/src/events/custom-event/event.js +24 -0
- package/dist/esm/src/events/custom-event/form.js +35 -0
- package/dist/esm/src/events/identity/identity-event.js +89 -0
- package/dist/esm/src/events/identity/identity.js +24 -0
- package/dist/esm/src/events/index.js +4 -0
- package/dist/esm/src/events/page-view/page-view-event.js +127 -0
- package/dist/esm/src/events/page-view/page-view.js +27 -0
- package/dist/esm/src/events/send-event/sendEvent.js +33 -0
- package/dist/esm/src/index.js +5 -0
- package/dist/esm/src/initialization/const.js +5 -0
- package/dist/esm/src/initialization/plugin.js +52 -0
- package/dist/esm/src/initialization/types.js +1 -0
- package/dist/esm/src/internal.js +2 -0
- package/internal.d.ts +2 -0
- package/package.json +80 -0
- package/types/src/browser.d.ts +4 -0
- package/types/src/browser.d.ts.map +1 -0
- package/types/src/consts.d.ts +15 -0
- package/types/src/consts.d.ts.map +1 -0
- package/types/src/debug.d.ts +9 -0
- package/types/src/debug.d.ts.map +1 -0
- package/types/src/eventStorage/addToEventQueue.d.ts +8 -0
- package/types/src/eventStorage/addToEventQueue.d.ts.map +1 -0
- package/types/src/eventStorage/clearEventQueue.d.ts +6 -0
- package/types/src/eventStorage/clearEventQueue.d.ts.map +1 -0
- package/types/src/eventStorage/eventStorage.d.ts +31 -0
- package/types/src/eventStorage/eventStorage.d.ts.map +1 -0
- package/types/src/eventStorage/processEventQueue.d.ts +7 -0
- package/types/src/eventStorage/processEventQueue.d.ts.map +1 -0
- package/types/src/events/base-event.d.ts +35 -0
- package/types/src/events/base-event.d.ts.map +1 -0
- package/types/src/events/common-interfaces.d.ts +53 -0
- package/types/src/events/common-interfaces.d.ts.map +1 -0
- package/types/src/events/consts.d.ts +3 -0
- package/types/src/events/consts.d.ts.map +1 -0
- package/types/src/events/custom-event/custom-event.d.ts +79 -0
- package/types/src/events/custom-event/custom-event.d.ts.map +1 -0
- package/types/src/events/custom-event/event.d.ts +10 -0
- package/types/src/events/custom-event/event.d.ts.map +1 -0
- package/types/src/events/custom-event/form.d.ts +11 -0
- package/types/src/events/custom-event/form.d.ts.map +1 -0
- package/types/src/events/identity/identity-event.d.ts +184 -0
- package/types/src/events/identity/identity-event.d.ts.map +1 -0
- package/types/src/events/identity/identity.d.ts +10 -0
- package/types/src/events/identity/identity.d.ts.map +1 -0
- package/types/src/events/index.d.ts +10 -0
- package/types/src/events/index.d.ts.map +1 -0
- package/types/src/events/page-view/page-view-event.d.ts +125 -0
- package/types/src/events/page-view/page-view-event.d.ts.map +1 -0
- package/types/src/events/page-view/page-view.d.ts +11 -0
- package/types/src/events/page-view/page-view.d.ts.map +1 -0
- package/types/src/events/send-event/sendEvent.d.ts +22 -0
- package/types/src/events/send-event/sendEvent.d.ts.map +1 -0
- package/types/src/index.d.ts +10 -0
- package/types/src/index.d.ts.map +1 -0
- package/types/src/initialization/const.d.ts +6 -0
- package/types/src/initialization/const.d.ts.map +1 -0
- package/types/src/initialization/plugin.d.ts +35 -0
- package/types/src/initialization/plugin.d.ts.map +1 -0
- package/types/src/initialization/types.d.ts +22 -0
- package/types/src/initialization/types.d.ts.map +1 -0
- package/types/src/internal.d.ts +3 -0
- package/types/src/internal.d.ts.map +1 -0
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import type { EPResponse, Infer } from '@sitecore-content-sdk/analytics-core/internal';
|
|
2
|
+
import type { EventAttributesInput, ExtensionData } from '../common-interfaces';
|
|
3
|
+
import type { FlattenedObject, NestedObject } from '@sitecore-content-sdk/analytics-core/utils';
|
|
4
|
+
import { BaseEvent } from '../base-event';
|
|
5
|
+
import type { SendEvent } from '../send-event/sendEvent';
|
|
6
|
+
import { CoreContext } from '@sitecore-content-sdk/core';
|
|
7
|
+
/**
|
|
8
|
+
* A class that extends from {@link BaseEvent} and has all the required functionality to send a VIEW event
|
|
9
|
+
*/
|
|
10
|
+
export declare class PageViewEvent extends BaseEvent {
|
|
11
|
+
static isFirstPageView: boolean;
|
|
12
|
+
config: CoreContext['config'];
|
|
13
|
+
private sendEvent;
|
|
14
|
+
private pageViewData?;
|
|
15
|
+
private extensionData;
|
|
16
|
+
private urlSearchParams;
|
|
17
|
+
private includeUTMParameters;
|
|
18
|
+
/**
|
|
19
|
+
* A class that extends from {@link BaseEvent} and has all the required functionality to send a VIEW event
|
|
20
|
+
* @param {PageViewEventArguments} args - Unified object containing the required properties
|
|
21
|
+
*/
|
|
22
|
+
constructor(args: PageViewEventArguments);
|
|
23
|
+
/**
|
|
24
|
+
* Sends the event to Sitecore Edge Proxy
|
|
25
|
+
* @returns - A promise that resolves with either the Sitecore Edge Proxy response object or null
|
|
26
|
+
*/
|
|
27
|
+
send(): Promise<EPResponse | null>;
|
|
28
|
+
/**
|
|
29
|
+
* Gets the variant ID from the url if not passed by the developer
|
|
30
|
+
* Gets the variant ID from the extension data if not found from the url
|
|
31
|
+
* @param {string} [pageVariantIdFromPageViewData] - The variant ID from the page view data
|
|
32
|
+
* @param {string} [pageVariantIdFromExt] - The variant ID from extension data
|
|
33
|
+
* @returns - variant ID or null
|
|
34
|
+
*/
|
|
35
|
+
private getPageVariantId;
|
|
36
|
+
/**
|
|
37
|
+
* Returns the referrer if exists on page view event else null if on server and no referrer is on event, else
|
|
38
|
+
* returns the href if on client side and the document referrer is different from the window location hostname
|
|
39
|
+
* @returns - the referrer
|
|
40
|
+
*/
|
|
41
|
+
private getReferrer;
|
|
42
|
+
/**
|
|
43
|
+
* Maps parameters given as input to corresponding attributes send to the API
|
|
44
|
+
* @returns the mapped object to be sent as payload
|
|
45
|
+
*/
|
|
46
|
+
private mapAttributes;
|
|
47
|
+
/**
|
|
48
|
+
* Retrieves UTM parameters from the url query string
|
|
49
|
+
* @returns - an object containing the UTM parameters if they exist
|
|
50
|
+
*/
|
|
51
|
+
private getUTMParameters;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Interface of the unified arguments object for page view event
|
|
55
|
+
* @internal
|
|
56
|
+
*/
|
|
57
|
+
export interface PageViewEventArguments {
|
|
58
|
+
sendEvent: SendEvent;
|
|
59
|
+
pageViewData?: PageViewData;
|
|
60
|
+
id: string;
|
|
61
|
+
config: CoreContext['config'];
|
|
62
|
+
infer?: Infer;
|
|
63
|
+
extensionData?: NestedObject;
|
|
64
|
+
searchParams: string;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Type with the required/optional attributes in order to send a view event to the SitecoreCloud API
|
|
68
|
+
* @public
|
|
69
|
+
*/
|
|
70
|
+
export interface PageViewData extends EventAttributesInput {
|
|
71
|
+
/**
|
|
72
|
+
* The ID of a personalized page variant.
|
|
73
|
+
*/
|
|
74
|
+
pageVariantId?: string;
|
|
75
|
+
/**
|
|
76
|
+
* The URI of the webpage that linked to the webpage where the event was captured.
|
|
77
|
+
*
|
|
78
|
+
* Default for browser-side events: inferred from document.referrer. If document.referrer is an empty string, the value will be set to null.
|
|
79
|
+
*
|
|
80
|
+
* Default for server-side events: null.
|
|
81
|
+
*/
|
|
82
|
+
referrer?: string;
|
|
83
|
+
/**
|
|
84
|
+
* Whether to add every UTM parameter from the URL of the current webpage to the event object.
|
|
85
|
+
*
|
|
86
|
+
* Default: `true`.
|
|
87
|
+
*/
|
|
88
|
+
includeUTMParameters?: boolean;
|
|
89
|
+
/**
|
|
90
|
+
* Any custom data to collect about an event in addition to the other attributes provided for the event data.
|
|
91
|
+
*/
|
|
92
|
+
extensionData?: ExtensionData;
|
|
93
|
+
/**
|
|
94
|
+
* Sitecore Search data about the event.
|
|
95
|
+
* If set, the event and all its data will be available in Sitecore Search.
|
|
96
|
+
* Construct according to the Sitecore Search Events API reference and data model.
|
|
97
|
+
*/
|
|
98
|
+
searchData?: NestedObject;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Interface with the utm_ parameters
|
|
102
|
+
* @internal
|
|
103
|
+
*/
|
|
104
|
+
interface UtmParameters {
|
|
105
|
+
[key: `utm_${string}`]: string;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* An interface describing the page view event specific payload to be sent to the API
|
|
109
|
+
* @internal
|
|
110
|
+
*/
|
|
111
|
+
export interface PageViewEventPayload extends UtmParameters {
|
|
112
|
+
type: 'VIEW';
|
|
113
|
+
referrer?: string;
|
|
114
|
+
ext?: {
|
|
115
|
+
pageVariantId?: string;
|
|
116
|
+
} & FlattenedObject;
|
|
117
|
+
sc_search?: {
|
|
118
|
+
data: NestedObject;
|
|
119
|
+
metadata: {
|
|
120
|
+
ut_api_version: string;
|
|
121
|
+
};
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
export {};
|
|
125
|
+
//# sourceMappingURL=page-view-event.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page-view-event.d.ts","sourceRoot":"","sources":["../../../../src/events/page-view/page-view-event.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,+CAA+C,CAAC;AACvF,OAAO,KAAK,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAChF,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,4CAA4C,CAAC;AAEhG,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEzD,OAAO,EAAE,WAAW,EAAa,MAAM,4BAA4B,CAAC;AAIpE;;GAEG;AACH,qBAAa,aAAc,SAAQ,SAAS;IAC1C,MAAM,CAAC,eAAe,UAAQ;IAC9B,MAAM,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAC;IAC9B,OAAO,CAAC,SAAS,CAAY;IAC7B,OAAO,CAAC,YAAY,CAAC,CAAe;IACpC,OAAO,CAAC,aAAa,CAAuB;IAC5C,OAAO,CAAC,eAAe,CAAkB;IACzC,OAAO,CAAC,oBAAoB,CAAU;IAEtC;;;OAGG;gBACS,IAAI,EAAE,sBAAsB;IA2BxC;;;OAGG;IACG,IAAI,IAAI,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC;IASxC;;;;;;OAMG;IACH,OAAO,CAAC,gBAAgB;IAWxB;;;;OAIG;IACH,OAAO,CAAC,WAAW;IAWnB;;;OAGG;IACH,OAAO,CAAC,aAAa;IAyCrB;;;OAGG;IACH,OAAO,CAAC,gBAAgB;CAWzB;AAED;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,SAAS,EAAE,SAAS,CAAC;IACrB,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAC;IAC9B,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,aAAa,CAAC,EAAE,YAAY,CAAC;IAC7B,YAAY,EAAE,MAAM,CAAC;CACtB;AAED;;;GAGG;AACH,MAAM,WAAW,YAAa,SAAQ,oBAAoB;IACxD;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B;;OAEG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B;;;;OAIG;IACH,UAAU,CAAC,EAAE,YAAY,CAAC;CAC3B;AAED;;;GAGG;AACH,UAAU,aAAa;IACrB,CAAC,GAAG,EAAE,OAAO,MAAM,EAAE,GAAG,MAAM,CAAC;CAChC;AAED;;;GAGG;AACH,MAAM,WAAW,oBAAqB,SAAQ,aAAa;IACzD,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,GAAG,CAAC,EAAE;QAAE,aAAa,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,eAAe,CAAC;IACnD,SAAS,CAAC,EAAE;QACV,IAAI,EAAE,YAAY,CAAC;QACnB,QAAQ,EAAE;YAAE,cAAc,EAAE,MAAM,CAAA;SAAE,CAAC;KACtC,CAAC;CACH"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { EPResponse } from '@sitecore-content-sdk/analytics-core/internal';
|
|
2
|
+
import type { PageViewData } from './page-view-event';
|
|
3
|
+
/**
|
|
4
|
+
* A function that sends a VIEW event to the SitecoreCloud API
|
|
5
|
+
* @param {PageViewData} [pageViewData] - The optional attributes to be sent to the SitecoreCloud API
|
|
6
|
+
* This object will be flattened and sent in the ext object of the payload
|
|
7
|
+
* @returns The response object that Sitecore Edge Proxy returns
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
10
|
+
export declare function pageView(pageViewData?: PageViewData): Promise<EPResponse | null>;
|
|
11
|
+
//# sourceMappingURL=page-view.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page-view.d.ts","sourceRoot":"","sources":["../../../../src/events/page-view/page-view.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+CAA+C,CAAC;AAGhF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAKtD;;;;;;GAMG;AACH,wBAAsB,QAAQ,CAAC,YAAY,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAgBtF"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { BasePayload, CustomEventPayload, IdentityEventPayload, PageViewEventPayload } from '..';
|
|
2
|
+
import type { EPResponse } from '@sitecore-content-sdk/analytics-core/internal';
|
|
3
|
+
import { CoreContext } from '@sitecore-content-sdk/core';
|
|
4
|
+
/**
|
|
5
|
+
* This function sends an event to Sitecore Edge Proxy
|
|
6
|
+
* @param {EPFetchBody & BasePayload} body - The event data to send
|
|
7
|
+
* @param {CoreContext['config']} config - The global configuration
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
10
|
+
export declare function sendEvent(body: EPFetchBody & BasePayload, config: CoreContext['config']): Promise<EPResponse | null>;
|
|
11
|
+
/**
|
|
12
|
+
* The type of sendEvent function
|
|
13
|
+
* @internal
|
|
14
|
+
*/
|
|
15
|
+
export type SendEvent = (body: EPFetchBody & BasePayload, config: CoreContext['config']) => Promise<EPResponse | null>;
|
|
16
|
+
/**
|
|
17
|
+
* The type describing all possible event payloads
|
|
18
|
+
* @internal
|
|
19
|
+
*/
|
|
20
|
+
type EPFetchBody = PageViewEventPayload | IdentityEventPayload | CustomEventPayload;
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=sendEvent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sendEvent.d.ts","sourceRoot":"","sources":["../../../../src/events/send-event/sendEvent.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,WAAW,EACX,kBAAkB,EAClB,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,IAAI,CAAC;AACZ,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+CAA+C,CAAC;AAEhF,OAAO,EAAE,WAAW,EAAqB,MAAM,4BAA4B,CAAC;AAG5E;;;;;GAKG;AACH,wBAAsB,SAAS,CAC7B,IAAI,EAAE,WAAW,GAAG,WAAW,EAC/B,MAAM,EAAE,WAAW,CAAC,QAAQ,CAAC,GAC5B,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAyB5B;AAED;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG,CACtB,IAAI,EAAE,WAAW,GAAG,WAAW,EAC/B,MAAM,EAAE,WAAW,CAAC,QAAQ,CAAC,KAC1B,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAAC;AAEhC;;;GAGG;AACH,KAAK,WAAW,GAAG,oBAAoB,GAAG,oBAAoB,GAAG,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type { PageViewData, EventData, IdentityData } from './events';
|
|
2
|
+
export type { Identifier } from './events/identity/identity-event';
|
|
3
|
+
export type { EventAttributesInput, ExtensionData } from './events/common-interfaces';
|
|
4
|
+
export { form } from './events/custom-event/form';
|
|
5
|
+
export { event } from './events/custom-event/event';
|
|
6
|
+
export { identity } from './events/identity/identity';
|
|
7
|
+
export { pageView } from './events/page-view/page-view';
|
|
8
|
+
export type { EventsPlugin } from './initialization/types';
|
|
9
|
+
export { eventsPlugin } from './initialization/plugin';
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,YAAY,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACtE,YAAY,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AACnE,YAAY,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AACtF,OAAO,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAClD,OAAO,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,YAAY,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"const.d.ts","sourceRoot":"","sources":["../../../src/initialization/const.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,kBAAkB,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { event } from '../events/custom-event/event';
|
|
2
|
+
import { form } from '../events/custom-event/form';
|
|
3
|
+
import { identity } from '../events/identity/identity';
|
|
4
|
+
import { pageView } from '../events/page-view/page-view';
|
|
5
|
+
import { addToEventQueue } from '../eventStorage/addToEventQueue';
|
|
6
|
+
import { clearEventQueue } from '../eventStorage/clearEventQueue';
|
|
7
|
+
import { processEventQueue } from '../eventStorage/processEventQueue';
|
|
8
|
+
import { EventsPlugin } from './types';
|
|
9
|
+
/**
|
|
10
|
+
* Creates an events plugin with the provided options.
|
|
11
|
+
* @returns {EventsPlugin} The events plugin instance.
|
|
12
|
+
* @public
|
|
13
|
+
*/
|
|
14
|
+
export declare function eventsPlugin(): EventsPlugin;
|
|
15
|
+
/**
|
|
16
|
+
* Retrieves the events plugin instance from the core context.
|
|
17
|
+
* @returns {EventsPlugin} The events plugin instance.
|
|
18
|
+
* @internal
|
|
19
|
+
*/
|
|
20
|
+
export declare function getEventsPlugin(): EventsPlugin;
|
|
21
|
+
declare global {
|
|
22
|
+
interface ScContentSDK {
|
|
23
|
+
events: {
|
|
24
|
+
addToEventQueue: typeof addToEventQueue;
|
|
25
|
+
clearEventQueue: typeof clearEventQueue;
|
|
26
|
+
event: typeof event;
|
|
27
|
+
form: typeof form;
|
|
28
|
+
identity: typeof identity;
|
|
29
|
+
pageView: typeof pageView;
|
|
30
|
+
processEventQueue: typeof processEventQueue;
|
|
31
|
+
version: string;
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../src/initialization/plugin.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAEtE,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAyBvC;;;;GAIG;AACH,wBAAgB,YAAY,IAAI,YAAY,CAM3C;AAED;;;;GAIG;AACH,wBAAgB,eAAe,IAAI,YAAY,CAQ9C;AAED,OAAO,CAAC,MAAM,CAAC;IAEb,UAAU,YAAY;QACpB,MAAM,EAAE;YACN,eAAe,EAAE,OAAO,eAAe,CAAC;YACxC,eAAe,EAAE,OAAO,eAAe,CAAC;YACxC,KAAK,EAAE,OAAO,KAAK,CAAC;YACpB,IAAI,EAAE,OAAO,IAAI,CAAC;YAClB,QAAQ,EAAE,OAAO,QAAQ,CAAC;YAC1B,QAAQ,EAAE,OAAO,QAAQ,CAAC;YAC1B,iBAAiB,EAAE,OAAO,iBAAiB,CAAC;YAC5C,OAAO,EAAE,MAAM,CAAC;SACjB,CAAC;KACH;CACF"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Plugin } from '@sitecore-content-sdk/core';
|
|
2
|
+
import { EVENTS_PLUGIN_NAME } from './const';
|
|
3
|
+
/**
|
|
4
|
+
* Defines the structure of the events plugin, including its initialization method, name, and dependencies.
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
7
|
+
export interface EventsPlugin extends Plugin {
|
|
8
|
+
/**
|
|
9
|
+
* Initializes the events plugin, which may involve setting up necessary configurations or performing any asynchronous operations required for the plugin to function properly.
|
|
10
|
+
* @returns A promise that resolves when the initialization is complete.
|
|
11
|
+
*/
|
|
12
|
+
init: () => Promise<void>;
|
|
13
|
+
/**
|
|
14
|
+
* The name of the events plugin.
|
|
15
|
+
*/
|
|
16
|
+
name: typeof EVENTS_PLUGIN_NAME;
|
|
17
|
+
/**
|
|
18
|
+
* An array of plugin names that the events plugin depends on. This ensures that the required plugins are initialized before the events plugin is initialized.
|
|
19
|
+
*/
|
|
20
|
+
dependencies: string[];
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/initialization/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAE7C;;;GAGG;AACH,MAAM,WAAW,YAAa,SAAQ,MAAM;IAC1C;;;OAGG;IACH,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1B;;OAEG;IACH,IAAI,EAAE,OAAO,kBAAkB,CAAC;IAChC;;OAEG;IACH,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../src/internal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC"}
|