@sitecore-content-sdk/events 2.1.0-canary.1 → 2.1.0-canary.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.
- package/dist/cjs/package.json +4 -4
- package/dist/cjs/src/events/page-view/bot-page-view.js +4 -1
- package/dist/esm/package.json +4 -4
- package/dist/esm/src/events/page-view/bot-page-view.js +10 -7
- package/package.json +4 -4
- package/types/src/events/index.d.ts +1 -0
- package/types/src/events/index.d.ts.map +1 -1
- package/types/src/events/page-view/bot-page-view.d.ts +19 -2
- package/types/src/events/page-view/bot-page-view.d.ts.map +1 -1
- package/types/src/index.d.ts +1 -1
- package/types/src/index.d.ts.map +1 -1
package/dist/cjs/package.json
CHANGED
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
"url": "https://github.com/Sitecore/content-sdk/issues"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@sitecore-content-sdk/analytics-core": "2.1.0-canary.
|
|
11
|
-
"@sitecore-content-sdk/core": "2.1.0-canary.
|
|
10
|
+
"@sitecore-content-sdk/analytics-core": "2.1.0-canary.3",
|
|
11
|
+
"@sitecore-content-sdk/core": "2.1.0-canary.3",
|
|
12
12
|
"debug": "^4.4.3",
|
|
13
13
|
"isbot": "^5.1.36"
|
|
14
14
|
},
|
|
@@ -76,6 +76,6 @@
|
|
|
76
76
|
"api-extractor": "npm run build && api-extractor run --local --verbose",
|
|
77
77
|
"api-extractor:verify": "api-extractor run"
|
|
78
78
|
},
|
|
79
|
-
"version": "2.1.0-canary.
|
|
80
|
-
"gitHead": "
|
|
79
|
+
"version": "2.1.0-canary.3",
|
|
80
|
+
"gitHead": "b48df0b60fd04e0b05a92ea28201617daa622eac"
|
|
81
81
|
}
|
|
@@ -11,10 +11,11 @@ const bot_detection_1 = require("./bot-detection");
|
|
|
11
11
|
* Sends a VIEW event for server-side bot tracking (e.g. Next.js proxy / Edge).
|
|
12
12
|
* Uses a synthetic per-invocation client id and defaults `channel` to `bot`.
|
|
13
13
|
* Returns `null` in browser environments.
|
|
14
|
+
* @param {BotPageView} [pageViewData] - The optional attributes to be sent to the SitecoreCloud API
|
|
14
15
|
* @returns The response from Sitecore Edge Proxy, or `null` if skipped (browser).
|
|
15
16
|
* @public
|
|
16
17
|
*/
|
|
17
|
-
async function botPageView() {
|
|
18
|
+
async function botPageView(pageViewData) {
|
|
18
19
|
if ((0, bot_detection_1.isBrowserEnvironment)()) {
|
|
19
20
|
return null;
|
|
20
21
|
}
|
|
@@ -27,6 +28,8 @@ async function botPageView() {
|
|
|
27
28
|
id,
|
|
28
29
|
pageViewData: {
|
|
29
30
|
channel: bot_detection_1.BOT_CHANNEL,
|
|
31
|
+
page: pageViewData.page,
|
|
32
|
+
language: pageViewData.language,
|
|
30
33
|
},
|
|
31
34
|
searchParams: adapter.location.getSearchParams(),
|
|
32
35
|
sendEvent: sendEvent_1.sendEvent,
|
package/dist/esm/package.json
CHANGED
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
"url": "https://github.com/Sitecore/content-sdk/issues"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@sitecore-content-sdk/analytics-core": "2.1.0-canary.
|
|
11
|
-
"@sitecore-content-sdk/core": "2.1.0-canary.
|
|
10
|
+
"@sitecore-content-sdk/analytics-core": "2.1.0-canary.3",
|
|
11
|
+
"@sitecore-content-sdk/core": "2.1.0-canary.3",
|
|
12
12
|
"debug": "^4.4.3",
|
|
13
13
|
"isbot": "^5.1.36"
|
|
14
14
|
},
|
|
@@ -76,6 +76,6 @@
|
|
|
76
76
|
"api-extractor": "npm run build && api-extractor run --local --verbose",
|
|
77
77
|
"api-extractor:verify": "api-extractor run"
|
|
78
78
|
},
|
|
79
|
-
"version": "2.1.0-canary.
|
|
80
|
-
"gitHead": "
|
|
79
|
+
"version": "2.1.0-canary.3",
|
|
80
|
+
"gitHead": "b48df0b60fd04e0b05a92ea28201617daa622eac"
|
|
81
81
|
}
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import { getAnalyticsPlugin } from
|
|
2
|
-
import { getCoreContext } from
|
|
3
|
-
import { getEventsPlugin } from
|
|
4
|
-
import { sendEvent } from
|
|
5
|
-
import { PageViewEvent } from
|
|
6
|
-
import { BOT_CHANNEL, isBrowserEnvironment } from
|
|
1
|
+
import { getAnalyticsPlugin } from '@sitecore-content-sdk/analytics-core/internal';
|
|
2
|
+
import { getCoreContext } from '@sitecore-content-sdk/core';
|
|
3
|
+
import { getEventsPlugin } from '../../initialization/plugin';
|
|
4
|
+
import { sendEvent } from '../send-event/sendEvent';
|
|
5
|
+
import { PageViewEvent } from './page-view-event';
|
|
6
|
+
import { BOT_CHANNEL, isBrowserEnvironment } from './bot-detection';
|
|
7
7
|
/**
|
|
8
8
|
* Sends a VIEW event for server-side bot tracking (e.g. Next.js proxy / Edge).
|
|
9
9
|
* Uses a synthetic per-invocation client id and defaults `channel` to `bot`.
|
|
10
10
|
* Returns `null` in browser environments.
|
|
11
|
+
* @param {BotPageView} [pageViewData] - The optional attributes to be sent to the SitecoreCloud API
|
|
11
12
|
* @returns The response from Sitecore Edge Proxy, or `null` if skipped (browser).
|
|
12
13
|
* @public
|
|
13
14
|
*/
|
|
14
|
-
export async function botPageView() {
|
|
15
|
+
export async function botPageView(pageViewData) {
|
|
15
16
|
if (isBrowserEnvironment()) {
|
|
16
17
|
return null;
|
|
17
18
|
}
|
|
@@ -24,6 +25,8 @@ export async function botPageView() {
|
|
|
24
25
|
id,
|
|
25
26
|
pageViewData: {
|
|
26
27
|
channel: BOT_CHANNEL,
|
|
28
|
+
page: pageViewData.page,
|
|
29
|
+
language: pageViewData.language,
|
|
27
30
|
},
|
|
28
31
|
searchParams: adapter.location.getSearchParams(),
|
|
29
32
|
sendEvent,
|
package/package.json
CHANGED
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
"url": "https://github.com/Sitecore/content-sdk/issues"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@sitecore-content-sdk/analytics-core": "2.1.0-canary.
|
|
11
|
-
"@sitecore-content-sdk/core": "2.1.0-canary.
|
|
10
|
+
"@sitecore-content-sdk/analytics-core": "2.1.0-canary.3",
|
|
11
|
+
"@sitecore-content-sdk/core": "2.1.0-canary.3",
|
|
12
12
|
"debug": "^4.4.3",
|
|
13
13
|
"isbot": "^5.1.36"
|
|
14
14
|
},
|
|
@@ -76,6 +76,6 @@
|
|
|
76
76
|
"api-extractor": "npm run build && api-extractor run --local --verbose",
|
|
77
77
|
"api-extractor:verify": "api-extractor run"
|
|
78
78
|
},
|
|
79
|
-
"version": "2.1.0-canary.
|
|
80
|
-
"gitHead": "
|
|
79
|
+
"version": "2.1.0-canary.3",
|
|
80
|
+
"gitHead": "b48df0b60fd04e0b05a92ea28201617daa622eac"
|
|
81
81
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { BaseEvent } from './base-event';
|
|
2
2
|
export type { BasePayload } from './base-event';
|
|
3
3
|
export { PageViewEvent } from './page-view/page-view-event';
|
|
4
|
+
export type { BotPageViewData } from './page-view/bot-page-view';
|
|
4
5
|
export type { PageViewData, PageViewEventPayload } from './page-view/page-view-event';
|
|
5
6
|
export { CustomEvent } from './custom-event/custom-event';
|
|
6
7
|
export type { EventData, CustomEventPayload, CustomEventArguments, } from './custom-event/custom-event';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/events/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,YAAY,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,YAAY,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAEtF,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,YAAY,EACV,SAAS,EACT,kBAAkB,EAClB,oBAAoB,GACrB,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,YAAY,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEpF,YAAY,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/events/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,YAAY,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,YAAY,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AACjE,YAAY,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAEtF,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,YAAY,EACV,SAAS,EACT,kBAAkB,EAClB,oBAAoB,GACrB,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,YAAY,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEpF,YAAY,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -1,10 +1,27 @@
|
|
|
1
|
-
import { type EPResponse } from
|
|
1
|
+
import { type EPResponse } from '@sitecore-content-sdk/analytics-core/internal';
|
|
2
|
+
/**
|
|
3
|
+
* The data to be sent for bot tracking.
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
6
|
+
export type BotPageViewData = {
|
|
7
|
+
/**
|
|
8
|
+
* The name of the webpage where the interaction with your brand takes place.
|
|
9
|
+
*/
|
|
10
|
+
page: string;
|
|
11
|
+
/**
|
|
12
|
+
* The language the site visitor interacts with your brand in.
|
|
13
|
+
* For example, if the site visitor selects the Japanese language in your app, the language is "JA".
|
|
14
|
+
* Format: uppercase ISO 639.
|
|
15
|
+
*/
|
|
16
|
+
language: string;
|
|
17
|
+
};
|
|
2
18
|
/**
|
|
3
19
|
* Sends a VIEW event for server-side bot tracking (e.g. Next.js proxy / Edge).
|
|
4
20
|
* Uses a synthetic per-invocation client id and defaults `channel` to `bot`.
|
|
5
21
|
* Returns `null` in browser environments.
|
|
22
|
+
* @param {BotPageView} [pageViewData] - The optional attributes to be sent to the SitecoreCloud API
|
|
6
23
|
* @returns The response from Sitecore Edge Proxy, or `null` if skipped (browser).
|
|
7
24
|
* @public
|
|
8
25
|
*/
|
|
9
|
-
export declare function botPageView(): Promise<EPResponse | null>;
|
|
26
|
+
export declare function botPageView(pageViewData: BotPageViewData): Promise<EPResponse | null>;
|
|
10
27
|
//# sourceMappingURL=bot-page-view.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bot-page-view.d.ts","sourceRoot":"","sources":["../../../../src/events/page-view/bot-page-view.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,UAAU,EAAE,MAAM,+CAA+C,CAAC;AAOpG
|
|
1
|
+
{"version":3,"file":"bot-page-view.d.ts","sourceRoot":"","sources":["../../../../src/events/page-view/bot-page-view.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,UAAU,EAAE,MAAM,+CAA+C,CAAC;AAOpG;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAsB,WAAW,CAAC,YAAY,EAAE,eAAe,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAuB3F"}
|
package/types/src/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type { PageViewData, EventData, IdentityData } from './events';
|
|
1
|
+
export type { PageViewData, BotPageViewData, EventData, IdentityData } from './events';
|
|
2
2
|
export type { Identifier } from './events/identity/identity-event';
|
|
3
3
|
export type { EventAttributesInput, ExtensionData } from './events/common-interfaces';
|
|
4
4
|
export { form } from './events/custom-event/form';
|
package/types/src/index.d.ts.map
CHANGED
|
@@ -1 +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;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,YAAY,EAAE,eAAe,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACvF,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,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAC/D,YAAY,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC"}
|