@sitecore-content-sdk/analytics-core 2.1.0-canary.1 → 2.1.0-canary.10
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 +5 -4
- package/dist/cjs/src/bot-detection/bot-detection.js +41 -0
- package/dist/cjs/src/initialization/browser-adapter.js +5 -0
- package/dist/cjs/src/initialization/plugin.js +3 -1
- package/dist/cjs/src/initialization/server-adapter.js +5 -0
- package/dist/cjs/src/internal.js +6 -1
- package/dist/esm/package.json +5 -4
- package/dist/esm/src/bot-detection/bot-detection.js +35 -0
- package/dist/esm/src/initialization/browser-adapter.js +5 -0
- package/dist/esm/src/initialization/plugin.js +3 -1
- package/dist/esm/src/initialization/server-adapter.js +5 -0
- package/dist/esm/src/internal.js +1 -0
- package/package.json +5 -4
- package/types/src/bot-detection/bot-detection.d.ts +27 -0
- package/types/src/bot-detection/bot-detection.d.ts.map +1 -0
- package/types/src/initialization/browser-adapter.d.ts.map +1 -1
- package/types/src/initialization/plugin.d.ts.map +1 -1
- package/types/src/initialization/server-adapter.d.ts.map +1 -1
- package/types/src/initialization/types.d.ts +5 -0
- package/types/src/initialization/types.d.ts.map +1 -1
- package/types/src/internal.d.ts +1 -0
- package/types/src/internal.d.ts.map +1 -1
package/dist/cjs/package.json
CHANGED
|
@@ -7,8 +7,9 @@
|
|
|
7
7
|
"url": "https://github.com/sitecore/content-sdk/issues"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@sitecore-content-sdk/core": "2.1.0-canary.
|
|
11
|
-
"debug": "^4.4.3"
|
|
10
|
+
"@sitecore-content-sdk/core": "2.1.0-canary.10",
|
|
11
|
+
"debug": "^4.4.3",
|
|
12
|
+
"isbot": "^5.1.39"
|
|
12
13
|
},
|
|
13
14
|
"description": "Provides shared logic and runtime initialization. Required for the Content SDK 'events' and 'personalize' packages to function.",
|
|
14
15
|
"devDependencies": {
|
|
@@ -73,6 +74,6 @@
|
|
|
73
74
|
"api-extractor": "npm run build && api-extractor run --local --verbose",
|
|
74
75
|
"api-extractor:verify": "api-extractor run"
|
|
75
76
|
},
|
|
76
|
-
"version": "2.1.0-canary.
|
|
77
|
-
"gitHead": "
|
|
77
|
+
"version": "2.1.0-canary.10",
|
|
78
|
+
"gitHead": "f4f6bb8a4ac09e5d721e8a4a361c8ad980997e6c"
|
|
78
79
|
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isBot = exports.BOT_DETECTION_COOKIE = void 0;
|
|
4
|
+
exports.getBotCookieClientSide = getBotCookieClientSide;
|
|
5
|
+
exports.getBotCookieServerSide = getBotCookieServerSide;
|
|
6
|
+
const isbot_1 = require("isbot");
|
|
7
|
+
const utils_1 = require("../utils");
|
|
8
|
+
/**
|
|
9
|
+
* The cookie name for bot detection.
|
|
10
|
+
* @internal
|
|
11
|
+
*/
|
|
12
|
+
exports.BOT_DETECTION_COOKIE = 'sc_bot';
|
|
13
|
+
/**
|
|
14
|
+
* A function that checks if visitor is a bot.
|
|
15
|
+
* @param {string} userAgent - The user agent of the visitor
|
|
16
|
+
* @returns {boolean} True if the visitor is a bot, false otherwise
|
|
17
|
+
* @internal
|
|
18
|
+
*/
|
|
19
|
+
const isBot = (userAgent) => {
|
|
20
|
+
return (0, isbot_1.isbot)(userAgent);
|
|
21
|
+
};
|
|
22
|
+
exports.isBot = isBot;
|
|
23
|
+
/**
|
|
24
|
+
* A function that gets the bot cookie.
|
|
25
|
+
* @returns {string | undefined} The value of the bot cookie, or undefined if the cookie is not found.
|
|
26
|
+
* Only available on the client-side.
|
|
27
|
+
* @internal
|
|
28
|
+
*/
|
|
29
|
+
function getBotCookieClientSide() {
|
|
30
|
+
return (0, utils_1.getCookieValueClientSide)(exports.BOT_DETECTION_COOKIE);
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* A function that gets the bot cookie.
|
|
34
|
+
* @param {string} cookie - The cookie string.
|
|
35
|
+
* @returns {string | undefined} The value of the bot cookie, or undefined if the cookie is not found.
|
|
36
|
+
* @internal
|
|
37
|
+
*/
|
|
38
|
+
function getBotCookieServerSide(cookie) {
|
|
39
|
+
var _a;
|
|
40
|
+
return (_a = (0, utils_1.getCookieServerSide)(cookie, exports.BOT_DETECTION_COOKIE)) === null || _a === void 0 ? void 0 : _a.value;
|
|
41
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.analyticsBrowserAdapter = analyticsBrowserAdapter;
|
|
4
|
+
const bot_detection_1 = require("../bot-detection/bot-detection");
|
|
4
5
|
const internal_1 = require("../internal");
|
|
5
6
|
const utils_1 = require("../utils");
|
|
6
7
|
const delete_cookie_1 = require("../utils/cookies/delete-cookie");
|
|
@@ -16,6 +17,10 @@ const core_1 = require("@sitecore-content-sdk/core");
|
|
|
16
17
|
function analyticsBrowserAdapter() {
|
|
17
18
|
return {
|
|
18
19
|
type: 'browser',
|
|
20
|
+
isBot: () => {
|
|
21
|
+
const botCookie = (0, bot_detection_1.getBotCookieClientSide)();
|
|
22
|
+
return !!botCookie || (0, bot_detection_1.isBot)(navigator.userAgent);
|
|
23
|
+
},
|
|
19
24
|
getClientId: () => {
|
|
20
25
|
return (0, utils_1.getCookieValueClientSide)((0, plugin_1.getAnalyticsPlugin)().options.cookies.name);
|
|
21
26
|
},
|
|
@@ -39,6 +39,7 @@ function analyticsPlugin(params) {
|
|
|
39
39
|
* @internal
|
|
40
40
|
*/
|
|
41
41
|
async function init() {
|
|
42
|
+
var _a;
|
|
42
43
|
debugInit(`Initializing ${const_1.ANALYTICS_PLUGIN_NAME}`);
|
|
43
44
|
const coreContext = (0, core_1.getCoreContext)();
|
|
44
45
|
const analyticsPlugin = getAnalyticsPlugin();
|
|
@@ -47,7 +48,8 @@ async function init() {
|
|
|
47
48
|
return;
|
|
48
49
|
}
|
|
49
50
|
const adapter = analyticsPlugin.adapter;
|
|
50
|
-
|
|
51
|
+
const isBot = (_a = adapter.isBot) === null || _a === void 0 ? void 0 : _a.call(adapter);
|
|
52
|
+
if (!isBot && (!adapter.getClientId() || analyticsPlugin.adapter.type !== 'browser')) {
|
|
51
53
|
await adapter.setClientId();
|
|
52
54
|
debugInit(`Cookie set for ${const_1.ANALYTICS_PLUGIN_NAME}`);
|
|
53
55
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.analyticsServerAdapter = analyticsServerAdapter;
|
|
4
|
+
const bot_detection_1 = require("../bot-detection/bot-detection");
|
|
4
5
|
const internal_1 = require("../internal");
|
|
5
6
|
const utils_1 = require("../utils");
|
|
6
7
|
const plugin_1 = require("./plugin");
|
|
@@ -19,6 +20,10 @@ const core_1 = require("@sitecore-content-sdk/core");
|
|
|
19
20
|
function analyticsServerAdapter(request, response) {
|
|
20
21
|
return {
|
|
21
22
|
type: 'server',
|
|
23
|
+
isBot: () => {
|
|
24
|
+
const botCookie = (0, bot_detection_1.getBotCookieServerSide)(request.headers.cookie);
|
|
25
|
+
return !!botCookie || (0, bot_detection_1.isBot)(request.headers['user-agent']);
|
|
26
|
+
},
|
|
22
27
|
getClientId: () => {
|
|
23
28
|
return getClientId(request);
|
|
24
29
|
},
|
package/dist/cjs/src/internal.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ANALYTICS_PLUGIN_NAME = exports.getAnalyticsPlugin = exports.fetchClientIdFromEdgeProxy = exports.CLIENT_ID_COOKIE_NAME = exports.CORRELATION_ID_HEADER = exports.LIBRARY_VERSION = exports.DEFAULT_COOKIE_EXPIRY_DAYS = exports.DAILY_SECONDS = exports.COOKIE_NAME_PREFIX = exports.API_VERSION = exports.generateCorrelationId = exports.pageName = exports.language = exports.getDefaultCookieAttributes = void 0;
|
|
3
|
+
exports.BOT_DETECTION_COOKIE = exports.getBotCookieClientSide = exports.getBotCookieServerSide = exports.isBot = exports.ANALYTICS_PLUGIN_NAME = exports.getAnalyticsPlugin = exports.fetchClientIdFromEdgeProxy = exports.CLIENT_ID_COOKIE_NAME = exports.CORRELATION_ID_HEADER = exports.LIBRARY_VERSION = exports.DEFAULT_COOKIE_EXPIRY_DAYS = exports.DAILY_SECONDS = exports.COOKIE_NAME_PREFIX = exports.API_VERSION = exports.generateCorrelationId = exports.pageName = exports.language = exports.getDefaultCookieAttributes = void 0;
|
|
4
4
|
var get_default_cookie_attributes_1 = require("./cookie/get-default-cookie-attributes");
|
|
5
5
|
Object.defineProperty(exports, "getDefaultCookieAttributes", { enumerable: true, get: function () { return get_default_cookie_attributes_1.getDefaultCookieAttributes; } });
|
|
6
6
|
var infer_1 = require("./infer/infer");
|
|
@@ -22,3 +22,8 @@ var plugin_1 = require("./initialization/plugin");
|
|
|
22
22
|
Object.defineProperty(exports, "getAnalyticsPlugin", { enumerable: true, get: function () { return plugin_1.getAnalyticsPlugin; } });
|
|
23
23
|
var const_1 = require("./initialization/const");
|
|
24
24
|
Object.defineProperty(exports, "ANALYTICS_PLUGIN_NAME", { enumerable: true, get: function () { return const_1.ANALYTICS_PLUGIN_NAME; } });
|
|
25
|
+
var bot_detection_1 = require("./bot-detection/bot-detection");
|
|
26
|
+
Object.defineProperty(exports, "isBot", { enumerable: true, get: function () { return bot_detection_1.isBot; } });
|
|
27
|
+
Object.defineProperty(exports, "getBotCookieServerSide", { enumerable: true, get: function () { return bot_detection_1.getBotCookieServerSide; } });
|
|
28
|
+
Object.defineProperty(exports, "getBotCookieClientSide", { enumerable: true, get: function () { return bot_detection_1.getBotCookieClientSide; } });
|
|
29
|
+
Object.defineProperty(exports, "BOT_DETECTION_COOKIE", { enumerable: true, get: function () { return bot_detection_1.BOT_DETECTION_COOKIE; } });
|
package/dist/esm/package.json
CHANGED
|
@@ -7,8 +7,9 @@
|
|
|
7
7
|
"url": "https://github.com/sitecore/content-sdk/issues"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@sitecore-content-sdk/core": "2.1.0-canary.
|
|
11
|
-
"debug": "^4.4.3"
|
|
10
|
+
"@sitecore-content-sdk/core": "2.1.0-canary.10",
|
|
11
|
+
"debug": "^4.4.3",
|
|
12
|
+
"isbot": "^5.1.39"
|
|
12
13
|
},
|
|
13
14
|
"description": "Provides shared logic and runtime initialization. Required for the Content SDK 'events' and 'personalize' packages to function.",
|
|
14
15
|
"devDependencies": {
|
|
@@ -73,6 +74,6 @@
|
|
|
73
74
|
"api-extractor": "npm run build && api-extractor run --local --verbose",
|
|
74
75
|
"api-extractor:verify": "api-extractor run"
|
|
75
76
|
},
|
|
76
|
-
"version": "2.1.0-canary.
|
|
77
|
-
"gitHead": "
|
|
77
|
+
"version": "2.1.0-canary.10",
|
|
78
|
+
"gitHead": "f4f6bb8a4ac09e5d721e8a4a361c8ad980997e6c"
|
|
78
79
|
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { isbot } from 'isbot';
|
|
2
|
+
import { getCookieServerSide, getCookieValueClientSide } from '../utils';
|
|
3
|
+
/**
|
|
4
|
+
* The cookie name for bot detection.
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
export const BOT_DETECTION_COOKIE = 'sc_bot';
|
|
8
|
+
/**
|
|
9
|
+
* A function that checks if visitor is a bot.
|
|
10
|
+
* @param {string} userAgent - The user agent of the visitor
|
|
11
|
+
* @returns {boolean} True if the visitor is a bot, false otherwise
|
|
12
|
+
* @internal
|
|
13
|
+
*/
|
|
14
|
+
export const isBot = (userAgent) => {
|
|
15
|
+
return isbot(userAgent);
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* A function that gets the bot cookie.
|
|
19
|
+
* @returns {string | undefined} The value of the bot cookie, or undefined if the cookie is not found.
|
|
20
|
+
* Only available on the client-side.
|
|
21
|
+
* @internal
|
|
22
|
+
*/
|
|
23
|
+
export function getBotCookieClientSide() {
|
|
24
|
+
return getCookieValueClientSide(BOT_DETECTION_COOKIE);
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* A function that gets the bot cookie.
|
|
28
|
+
* @param {string} cookie - The cookie string.
|
|
29
|
+
* @returns {string | undefined} The value of the bot cookie, or undefined if the cookie is not found.
|
|
30
|
+
* @internal
|
|
31
|
+
*/
|
|
32
|
+
export function getBotCookieServerSide(cookie) {
|
|
33
|
+
var _a;
|
|
34
|
+
return (_a = getCookieServerSide(cookie, BOT_DETECTION_COOKIE)) === null || _a === void 0 ? void 0 : _a.value;
|
|
35
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { getBotCookieClientSide, isBot } from '../bot-detection/bot-detection';
|
|
1
2
|
import { COOKIE_NAME_PREFIX, fetchClientIdFromEdgeProxy, getDefaultCookieAttributes, } from '../internal';
|
|
2
3
|
import { createCookieString, getCookieValueClientSide } from '../utils';
|
|
3
4
|
import { deleteCookie } from '../utils/cookies/delete-cookie';
|
|
@@ -13,6 +14,10 @@ import { getCoreContext } from '@sitecore-content-sdk/core';
|
|
|
13
14
|
export function analyticsBrowserAdapter() {
|
|
14
15
|
return {
|
|
15
16
|
type: 'browser',
|
|
17
|
+
isBot: () => {
|
|
18
|
+
const botCookie = getBotCookieClientSide();
|
|
19
|
+
return !!botCookie || isBot(navigator.userAgent);
|
|
20
|
+
},
|
|
16
21
|
getClientId: () => {
|
|
17
22
|
return getCookieValueClientSide(getAnalyticsPlugin().options.cookies.name);
|
|
18
23
|
},
|
|
@@ -35,6 +35,7 @@ export function analyticsPlugin(params) {
|
|
|
35
35
|
* @internal
|
|
36
36
|
*/
|
|
37
37
|
async function init() {
|
|
38
|
+
var _a;
|
|
38
39
|
debugInit(`Initializing ${ANALYTICS_PLUGIN_NAME}`);
|
|
39
40
|
const coreContext = getCoreContext();
|
|
40
41
|
const analyticsPlugin = getAnalyticsPlugin();
|
|
@@ -43,7 +44,8 @@ async function init() {
|
|
|
43
44
|
return;
|
|
44
45
|
}
|
|
45
46
|
const adapter = analyticsPlugin.adapter;
|
|
46
|
-
|
|
47
|
+
const isBot = (_a = adapter.isBot) === null || _a === void 0 ? void 0 : _a.call(adapter);
|
|
48
|
+
if (!isBot && (!adapter.getClientId() || analyticsPlugin.adapter.type !== 'browser')) {
|
|
47
49
|
await adapter.setClientId();
|
|
48
50
|
debugInit(`Cookie set for ${ANALYTICS_PLUGIN_NAME}`);
|
|
49
51
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { getBotCookieServerSide, isBot } from '../bot-detection/bot-detection';
|
|
1
2
|
import { COOKIE_NAME_PREFIX, fetchClientIdFromEdgeProxy, getDefaultCookieAttributes, } from '../internal';
|
|
2
3
|
import { createCookieString, getCookieServerSide } from '../utils';
|
|
3
4
|
import { getAnalyticsPlugin } from './plugin';
|
|
@@ -16,6 +17,10 @@ import { getCoreContext } from '@sitecore-content-sdk/core';
|
|
|
16
17
|
export function analyticsServerAdapter(request, response) {
|
|
17
18
|
return {
|
|
18
19
|
type: 'server',
|
|
20
|
+
isBot: () => {
|
|
21
|
+
const botCookie = getBotCookieServerSide(request.headers.cookie);
|
|
22
|
+
return !!botCookie || isBot(request.headers['user-agent']);
|
|
23
|
+
},
|
|
19
24
|
getClientId: () => {
|
|
20
25
|
return getClientId(request);
|
|
21
26
|
},
|
package/dist/esm/src/internal.js
CHANGED
|
@@ -5,3 +5,4 @@ export { API_VERSION, COOKIE_NAME_PREFIX, DAILY_SECONDS, DEFAULT_COOKIE_EXPIRY_D
|
|
|
5
5
|
export { fetchClientIdFromEdgeProxy } from './client-id/fetch-client-id-from-edge-proxy';
|
|
6
6
|
export { getAnalyticsPlugin } from './initialization/plugin';
|
|
7
7
|
export { ANALYTICS_PLUGIN_NAME } from './initialization/const';
|
|
8
|
+
export { isBot, getBotCookieServerSide, getBotCookieClientSide, BOT_DETECTION_COOKIE } from './bot-detection/bot-detection';
|
package/package.json
CHANGED
|
@@ -7,8 +7,9 @@
|
|
|
7
7
|
"url": "https://github.com/sitecore/content-sdk/issues"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@sitecore-content-sdk/core": "2.1.0-canary.
|
|
11
|
-
"debug": "^4.4.3"
|
|
10
|
+
"@sitecore-content-sdk/core": "2.1.0-canary.10",
|
|
11
|
+
"debug": "^4.4.3",
|
|
12
|
+
"isbot": "^5.1.39"
|
|
12
13
|
},
|
|
13
14
|
"description": "Provides shared logic and runtime initialization. Required for the Content SDK 'events' and 'personalize' packages to function.",
|
|
14
15
|
"devDependencies": {
|
|
@@ -73,6 +74,6 @@
|
|
|
73
74
|
"api-extractor": "npm run build && api-extractor run --local --verbose",
|
|
74
75
|
"api-extractor:verify": "api-extractor run"
|
|
75
76
|
},
|
|
76
|
-
"version": "2.1.0-canary.
|
|
77
|
-
"gitHead": "
|
|
77
|
+
"version": "2.1.0-canary.10",
|
|
78
|
+
"gitHead": "f4f6bb8a4ac09e5d721e8a4a361c8ad980997e6c"
|
|
78
79
|
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The cookie name for bot detection.
|
|
3
|
+
* @internal
|
|
4
|
+
*/
|
|
5
|
+
export declare const BOT_DETECTION_COOKIE = "sc_bot";
|
|
6
|
+
/**
|
|
7
|
+
* A function that checks if visitor is a bot.
|
|
8
|
+
* @param {string} userAgent - The user agent of the visitor
|
|
9
|
+
* @returns {boolean} True if the visitor is a bot, false otherwise
|
|
10
|
+
* @internal
|
|
11
|
+
*/
|
|
12
|
+
export declare const isBot: (userAgent?: string | null) => boolean;
|
|
13
|
+
/**
|
|
14
|
+
* A function that gets the bot cookie.
|
|
15
|
+
* @returns {string | undefined} The value of the bot cookie, or undefined if the cookie is not found.
|
|
16
|
+
* Only available on the client-side.
|
|
17
|
+
* @internal
|
|
18
|
+
*/
|
|
19
|
+
export declare function getBotCookieClientSide(): string | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* A function that gets the bot cookie.
|
|
22
|
+
* @param {string} cookie - The cookie string.
|
|
23
|
+
* @returns {string | undefined} The value of the bot cookie, or undefined if the cookie is not found.
|
|
24
|
+
* @internal
|
|
25
|
+
*/
|
|
26
|
+
export declare function getBotCookieServerSide(cookie?: string): string | undefined;
|
|
27
|
+
//# sourceMappingURL=bot-detection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bot-detection.d.ts","sourceRoot":"","sources":["../../../src/bot-detection/bot-detection.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,eAAO,MAAM,oBAAoB,WAAW,CAAC;AAE7C;;;;;GAKG;AACH,eAAO,MAAM,KAAK,GAAI,YAAY,MAAM,GAAG,IAAI,KAAG,OAEjD,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,sBAAsB,IAAI,MAAM,GAAG,SAAS,CAE3D;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAE1E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser-adapter.d.ts","sourceRoot":"","sources":["../../../src/initialization/browser-adapter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"browser-adapter.d.ts","sourceRoot":"","sources":["../../../src/initialization/browser-adapter.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAG3C;;;GAGG;AACH,MAAM,WAAW,uBAAwB,SAAQ,gBAAgB;IAC/D;;OAEG;IACH,IAAI,EAAE,SAAS,CAAC;CACjB;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,IAAI,uBAAuB,CAkDjE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../src/initialization/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAQ5D,OAAO,EAAyB,WAAW,EAAa,MAAM,4BAA4B,CAAC;AAC3F,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAKzD;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,OAAO,CAAC,EAAE;QACR;;WAEG;QACH,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB;;WAEG;QACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;QAC1B;;WAEG;QACH,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB;;WAEG;QACH,YAAY,CAAC,EAAE,OAAO,CAAC;QACvB;;WAEG;QACH,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;IACF;;OAEG;IACH,OAAO,EAAE,gBAAgB,CAAC;CAC3B;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,qBAAqB,GAAG,eAAe,CAoB9E;
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../src/initialization/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAQ5D,OAAO,EAAyB,WAAW,EAAa,MAAM,4BAA4B,CAAC;AAC3F,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAKzD;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,OAAO,CAAC,EAAE;QACR;;WAEG;QACH,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB;;WAEG;QACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;QAC1B;;WAEG;QACH,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB;;WAEG;QACH,YAAY,CAAC,EAAE,OAAO,CAAC;QACvB;;WAEG;QACH,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;IACF;;OAEG;IACH,OAAO,EAAE,gBAAgB,CAAC;CAC3B;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,qBAAqB,GAAG,eAAe,CAoB9E;AAyCD;;;;GAIG;AACH,wBAAgB,kBAAkB,IAAI,eAAe,CAOpD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,aAAa;QACrB,WAAW,EAAE,OAAO,WAAW,CAAC;QAChC,OAAO,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAC;QAC/B,OAAO,EAAE,MAAM,CAAC;KACjB;IACD,UAAU,YAAY;QACpB,cAAc,EAAE,aAAa,CAAC;KAC/B;IAED,UAAU,MAAM;QACd,YAAY,EAAE,YAAY,CAAC;KAC5B;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server-adapter.d.ts","sourceRoot":"","sources":["../../../src/initialization/server-adapter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"server-adapter.d.ts","sourceRoot":"","sources":["../../../src/initialization/server-adapter.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAE3C,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,MAAM,CAAC;AAE7D;;;GAGG;AACH,MAAM,WAAW,sBAAuB,SAAQ,gBAAgB;IAC9D;;OAEG;IACH,IAAI,EAAE,QAAQ,CAAC;CAChB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,SAAS,eAAe,EAC/B,QAAQ,SAAS,eAAe,EAChC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,GAAG,sBAAsB,CAqF9D"}
|
|
@@ -6,6 +6,11 @@ import { ANALYTICS_PLUGIN_NAME } from './const';
|
|
|
6
6
|
* @public
|
|
7
7
|
*/
|
|
8
8
|
export interface AnalyticsAdapter extends PluginAdapter {
|
|
9
|
+
/**
|
|
10
|
+
* Checks if the current request is a bot.
|
|
11
|
+
* @returns {boolean} True if the current request is a bot, false otherwise.
|
|
12
|
+
*/
|
|
13
|
+
isBot?: () => boolean;
|
|
9
14
|
/**
|
|
10
15
|
* Gets the client ID.
|
|
11
16
|
* @returns {string | null} The client ID, or null if it is not set.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/initialization/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,KAAK,aAAa,EAAE,MAAM,4BAA4B,CAAC;AACxE,OAAO,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAEhD;;;GAGG;AACH,MAAM,WAAW,gBAAiB,SAAQ,aAAa;IACrD;;;OAGG;IACH,WAAW,EAAE,MAAM,MAAM,GAAG,IAAI,CAAC;IACjC;;;OAGG;IACH,WAAW,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACjC;;OAEG;IACH,QAAQ,EAAE;QACR;;;WAGG;QACH,eAAe,EAAE,MAAM,MAAM,CAAC;KAC/B,CAAC;CACH;AAED;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,OAAO,EAAE;QACP;;WAEG;QACH,IAAI,EAAE,MAAM,CAAC;QACb;;WAEG;QACH,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB;;WAEG;QACH,UAAU,EAAE,MAAM,CAAC;QACnB;;WAEG;QACH,IAAI,CAAC,EAAE,MAAM,CAAC;QACd;;WAEG;QACH,OAAO,CAAC,EAAE,OAAO,CAAC;KACnB,CAAC;IACF;;OAEG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;GAGG;AACH,MAAM,WAAW,eAAgB,SAAQ,MAAM;IAC7C;;OAEG;IACH,OAAO,EAAE,gBAAgB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OAEG;IACH,OAAO,EAAE,gBAAgB,CAAC;IAC1B;;OAEG;IACH,OAAO,EAAE,gBAAgB,CAAC;IAC1B;;;OAGG;IACH,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1B;;OAEG;IACH,IAAI,EAAE,OAAO,qBAAqB,CAAC;CACpC"}
|
package/types/src/internal.d.ts
CHANGED
|
@@ -9,4 +9,5 @@ export { ANALYTICS_PLUGIN_NAME } from './initialization/const';
|
|
|
9
9
|
export type { AnalyticsPlugin } from './initialization/types';
|
|
10
10
|
export { AnalyticsAdapter, AnalyticsOptions } from './initialization/types';
|
|
11
11
|
export type { VisitorIds } from './interfaces';
|
|
12
|
+
export { isBot, getBotCookieServerSide, getBotCookieClientSide, BOT_DETECTION_COOKIE } from './bot-detection/bot-detection';
|
|
12
13
|
//# sourceMappingURL=internal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../src/internal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,wCAAwC,CAAC;AAEpF,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AAEjF,OAAO,EACL,WAAW,EACX,kBAAkB,EAClB,aAAa,EACb,0BAA0B,EAC1B,eAAe,EACf,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,UAAU,CAAC;AAGlB,YAAY,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAEtD,OAAO,EAAE,0BAA0B,EAAE,MAAM,6CAA6C,CAAC;AACzF,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,YAAY,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,g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