@snowplow/browser-plugin-debugger 3.3.0 → 3.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.module.js +20 -14
- package/dist/index.module.js.map +1 -1
- package/dist/index.umd.js +160 -135
- package/dist/index.umd.js.map +1 -1
- package/dist/index.umd.min.js +2 -2
- package/dist/index.umd.min.js.map +1 -1
- package/package.json +27 -23
package/dist/index.module.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Debugger for Snowplow v3.
|
|
2
|
+
* Debugger for Snowplow v3.5.0 (http://bit.ly/sp-js)
|
|
3
3
|
* Copyright 2022 Snowplow Analytics Ltd, 2010 Anthon Pang
|
|
4
4
|
* Licensed under BSD-3-Clause
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import { __spreadArray } from 'tslib';
|
|
8
|
-
import {
|
|
8
|
+
import { payloadJsonProcessor, LOG_LEVEL, version, getSchemaParts } from '@snowplow/tracker-core';
|
|
9
9
|
import randomcolor from 'randomcolor';
|
|
10
10
|
|
|
11
11
|
/*
|
|
@@ -46,7 +46,7 @@ function DebuggerPlugin(logLevel) {
|
|
|
46
46
|
var tracker;
|
|
47
47
|
var eventColour;
|
|
48
48
|
var colours = {
|
|
49
|
-
event: function () { return "color: White; background: "
|
|
49
|
+
event: function () { return "color: White; background: ".concat(eventColour, "; font-weight: bold; padding: 1px 4px; border-radius: 2px;"); },
|
|
50
50
|
snowplowPurple: 'color: White; background: #6638B8; font-weight: bold; padding: 1px 4px; border-radius: 2px;',
|
|
51
51
|
activated: 'color: White; background: #9E62DD; font-weight: bold; padding: 1px 4px; border-radius: 2px;',
|
|
52
52
|
payload: 'color: White; background: #3748B8; font-weight: bold; padding: 1px 4px; border-radius: 2px;',
|
|
@@ -56,37 +56,37 @@ function DebuggerPlugin(logLevel) {
|
|
|
56
56
|
};
|
|
57
57
|
var debug = function (style, message, extra) {
|
|
58
58
|
var _a = extra !== null && extra !== void 0 ? extra : [''], extraMessage = _a[0], rest = _a.slice(1);
|
|
59
|
-
LOG.debug.apply(LOG, __spreadArray(["v"
|
|
59
|
+
LOG.debug.apply(LOG, __spreadArray(["v".concat(version, " %c").concat(tracker.namespace, "%c %c%s") + extraMessage,
|
|
60
60
|
colours.snowplowPurple,
|
|
61
61
|
'',
|
|
62
62
|
style,
|
|
63
|
-
message], rest));
|
|
63
|
+
message], rest, false));
|
|
64
64
|
};
|
|
65
65
|
function jsonInterceptor(encodeBase64) {
|
|
66
|
-
var log = function (
|
|
66
|
+
var log = function (jsonType, data) {
|
|
67
67
|
var schemaParts = getSchemaParts(data['schema']);
|
|
68
68
|
debug(colours.event(), 'Event', [
|
|
69
69
|
'%c%s%c%s%c%s\n%o',
|
|
70
70
|
colours.json,
|
|
71
|
-
|
|
71
|
+
"".concat(jsonType, ": ").concat(schemaParts ? schemaParts[1] : 'Unknown Schema'),
|
|
72
72
|
colours.schemaVersion,
|
|
73
|
-
schemaParts ? "Version: "
|
|
73
|
+
schemaParts ? "Version: ".concat(schemaParts[2], "-").concat(schemaParts[3], "-").concat(schemaParts[4]) : 'Unknown Schema Version',
|
|
74
74
|
colours.schema,
|
|
75
|
-
schemaParts ? "Vendor: "
|
|
75
|
+
schemaParts ? "Vendor: ".concat(schemaParts[0]) : 'Unknown Vendor',
|
|
76
76
|
data['data'],
|
|
77
77
|
]);
|
|
78
78
|
};
|
|
79
|
-
return function (payloadBuilder, jsonForProcessing) {
|
|
79
|
+
return function (payloadBuilder, jsonForProcessing, contextEntitiesForProcessing) {
|
|
80
80
|
if (jsonForProcessing.length) {
|
|
81
81
|
var _loop_1 = function (json) {
|
|
82
82
|
var data = json.json['data'];
|
|
83
83
|
if (Array.isArray(data)) {
|
|
84
84
|
data.forEach(function (d) {
|
|
85
|
-
log(json, d);
|
|
85
|
+
log(getJsonType(json), d);
|
|
86
86
|
});
|
|
87
87
|
}
|
|
88
88
|
else {
|
|
89
|
-
log(json, data);
|
|
89
|
+
log(getJsonType(json), data);
|
|
90
90
|
}
|
|
91
91
|
};
|
|
92
92
|
for (var _i = 0, jsonForProcessing_1 = jsonForProcessing; _i < jsonForProcessing_1.length; _i++) {
|
|
@@ -94,7 +94,13 @@ function DebuggerPlugin(logLevel) {
|
|
|
94
94
|
_loop_1(json);
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
|
-
|
|
97
|
+
if (contextEntitiesForProcessing.length) {
|
|
98
|
+
for (var _a = 0, contextEntitiesForProcessing_1 = contextEntitiesForProcessing; _a < contextEntitiesForProcessing_1.length; _a++) {
|
|
99
|
+
var entity = contextEntitiesForProcessing_1[_a];
|
|
100
|
+
log('Context', entity);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
return payloadJsonProcessor(encodeBase64)(payloadBuilder, jsonForProcessing, contextEntitiesForProcessing);
|
|
98
104
|
};
|
|
99
105
|
}
|
|
100
106
|
return {
|
|
@@ -124,7 +130,7 @@ function getJsonType(json) {
|
|
|
124
130
|
case 'ue_px':
|
|
125
131
|
return 'Self Describing';
|
|
126
132
|
default:
|
|
127
|
-
return json.keyIfEncoded
|
|
133
|
+
return "".concat(json.keyIfEncoded, ", ").concat(json.keyIfNotEncoded);
|
|
128
134
|
}
|
|
129
135
|
}
|
|
130
136
|
function getEventType(payloadBuilder) {
|
package/dist/index.module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.module.js","sources":["../src/index.ts"],"sourcesContent":["/*\n * Copyright (c) 2022 Snowplow Analytics Ltd, 2010 Anthon Pang\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * 3. Neither the name of the copyright holder nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nimport { BrowserPlugin, BrowserTracker } from '@snowplow/browser-tracker-core';\nimport {\n EventJson,\n EventJsonWithKeys,\n JsonProcessor,\n Logger,\n LOG_LEVEL,\n Payload,\n PayloadBuilder,\n payloadJsonProcessor,\n version,\n getSchemaParts,\n SelfDescribingJson,\n} from '@snowplow/tracker-core';\nimport randomcolor from 'randomcolor';\n\n/**\n * Adds advertisement tracking functions\n */\nexport function DebuggerPlugin(logLevel: LOG_LEVEL = LOG_LEVEL.debug): BrowserPlugin {\n let LOG: Logger;\n let tracker: BrowserTracker;\n let eventColour: string;\n\n const colours = {\n event: () => `color: White; background: ${eventColour}; font-weight: bold; padding: 1px 4px; border-radius: 2px;`,\n snowplowPurple: 'color: White; background: #6638B8; font-weight: bold; padding: 1px 4px; border-radius: 2px;',\n activated: 'color: White; background: #9E62DD; font-weight: bold; padding: 1px 4px; border-radius: 2px;',\n payload: 'color: White; background: #3748B8; font-weight: bold; padding: 1px 4px; border-radius: 2px;',\n json: 'color: White; background: #388AB8; font-weight: bold; padding: 1px 4px; border-radius: 2px;',\n schema: 'color: White; background: #268047; font-weight: bold; padding: 1px 4px; border-radius: 2px;',\n schemaVersion: 'color: White; background: #80265F; font-weight: bold; padding: 1px 4px; border-radius: 2px;',\n };\n\n const debug = (style: string, message: string, extra?: [string, ...unknown[]]) => {\n const [extraMessage, ...rest] = extra ?? [''];\n LOG.debug(\n `v${version} %c${tracker.namespace}%c %c%s` + extraMessage,\n colours.snowplowPurple,\n '',\n style,\n message,\n ...rest\n );\n };\n\n function jsonInterceptor(encodeBase64: boolean): JsonProcessor {\n const log = (json: EventJsonWithKeys, data: SelfDescribingJson) => {\n const schemaParts = getSchemaParts(data['schema']);\n debug(colours.event(), 'Event', [\n '%c%s%c%s%c%s\\n%o',\n colours.json,\n `${getJsonType(json)}: ${schemaParts ? schemaParts[1] : 'Unknown Schema'}`,\n colours.schemaVersion,\n schemaParts ? `Version: ${schemaParts[2]}-${schemaParts[3]}-${schemaParts[4]}` : 'Unknown Schema Version',\n colours.schema,\n schemaParts ? `Vendor: ${schemaParts[0]}` : 'Unknown Vendor',\n data['data'],\n ]);\n };\n\n return (payloadBuilder: PayloadBuilder, jsonForProcessing: EventJson) => {\n if (jsonForProcessing.length) {\n for (const json of jsonForProcessing) {\n const data = json.json['data'] as SelfDescribingJson;\n if (Array.isArray(data)) {\n data.forEach((d) => {\n log(json, d);\n });\n } else {\n log(json, data);\n }\n }\n }\n return payloadJsonProcessor(encodeBase64)(payloadBuilder, jsonForProcessing);\n };\n }\n\n return {\n logger: (logger) => {\n LOG = logger;\n logger.setLogLevel(logLevel);\n },\n activateBrowserPlugin: (t) => {\n tracker = t;\n debug(colours.activated, 'Tracker Activated');\n },\n beforeTrack: (payloadBuilder: PayloadBuilder) => {\n eventColour = randomcolor({ luminosity: 'dark' });\n payloadBuilder.withJsonProcessor(jsonInterceptor(tracker.core.getBase64Encoding()));\n debug(colours.event(), 'Event', ['%c%s', colours.snowplowPurple, getEventType(payloadBuilder)]);\n payloadBuilder.build();\n },\n afterTrack: (payload: Payload) => {\n debug(colours.event(), 'Event', ['%c%s\\n%o', colours.payload, 'Payload', payload]);\n },\n };\n}\n\nfunction getJsonType(json: EventJsonWithKeys) {\n switch (json.keyIfEncoded) {\n case 'cx':\n return 'Context';\n case 'ue_px':\n return 'Self Describing';\n default:\n return `${json.keyIfEncoded}, ${json.keyIfNotEncoded}`;\n }\n}\n\nfunction getEventType(payloadBuilder: PayloadBuilder) {\n const payload = payloadBuilder.getPayload();\n switch (payload['e']) {\n case 'pv':\n return 'Page View';\n case 'pp':\n return 'Page Ping';\n case 'tr':\n return 'Ecommerce Transaction';\n case 'ti':\n return 'Ecommerce Transaction Item';\n case 'se':\n return 'Structured Event';\n case 'ue':\n return 'Self Describing';\n default:\n return typeof payload['e'] === 'string' ? payload['e'] : 'Invalid';\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8CA;;;SAGgB,cAAc,CAAC,QAAqC;IAArC,yBAAA,EAAA,WAAsB,SAAS,CAAC,KAAK;IAClE,IAAI,GAAW,CAAC;IAChB,IAAI,OAAuB,CAAC;IAC5B,IAAI,WAAmB,CAAC;IAExB,IAAM,OAAO,GAAG;QACd,KAAK,EAAE,cAAM,OAAA,+BAA6B,WAAW,+DAA4D,GAAA;QACjH,cAAc,EAAE,6FAA6F;QAC7G,SAAS,EAAE,6FAA6F;QACxG,OAAO,EAAE,6FAA6F;QACtG,IAAI,EAAE,6FAA6F;QACnG,MAAM,EAAE,6FAA6F;QACrG,aAAa,EAAE,6FAA6F;KAC7G,CAAC;IAEF,IAAM,KAAK,GAAG,UAAC,KAAa,EAAE,OAAe,EAAE,KAA8B;QACrE,IAAA,KAA0B,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,CAAC,EAAE,CAA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AO,iBAAiB,CAAC;QAC3B;YACE,OAAU,IAAI,CAAC,YAAY,UAAK,IAAI,CAAC,eAAiB,CAAC;KAC1D;AACH,CAAC;AAED,SAAS,YAAY,CAAC,cAA8B;IAClD,IAAM,OAAO,GAAG,cAAc,CAAC,UAAU,EAAE,CAAC;IAC5C,QAAQ,OAAO,CAAC,GAAG,CAAC;QAClB,KAAK,IAAI;YACP,OAAO,WAAW,CAAC;QACrB,KAAK,IAAI;YACP,OAAO,WAAW,CAAC;QACrB,KAAK,IAAI;YACP,OAAO,uBAAuB,CAAC;QACjC,KAAK,IAAI;YACP,OAAO,4BAA4B,CAAC;QACtC,KAAK,IAAI;YACP,OAAO,kBAAkB,CAAC;QAC5B,KAAK,IAAI;YACP,OAAO,iBAAiB,CAAC;QAC3B;YACE,OAAO,OAAO,OAAO,CAAC,GAAG,CAAC,KAAK,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC;KACtE;AACH;;"}
|
|
1
|
+
{"version":3,"file":"index.module.js","sources":["../src/index.ts"],"sourcesContent":["/*\n * Copyright (c) 2022 Snowplow Analytics Ltd, 2010 Anthon Pang\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * 3. Neither the name of the copyright holder nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nimport { BrowserPlugin, BrowserTracker } from '@snowplow/browser-tracker-core';\nimport {\n EventJson,\n EventJsonWithKeys,\n JsonProcessor,\n Logger,\n LOG_LEVEL,\n Payload,\n PayloadBuilder,\n payloadJsonProcessor,\n version,\n getSchemaParts,\n SelfDescribingJson,\n} from '@snowplow/tracker-core';\nimport randomcolor from 'randomcolor';\n\n/**\n * Adds advertisement tracking functions\n */\nexport function DebuggerPlugin(logLevel: LOG_LEVEL = LOG_LEVEL.debug): BrowserPlugin {\n let LOG: Logger;\n let tracker: BrowserTracker;\n let eventColour: string;\n\n const colours = {\n event: () => `color: White; background: ${eventColour}; font-weight: bold; padding: 1px 4px; border-radius: 2px;`,\n snowplowPurple: 'color: White; background: #6638B8; font-weight: bold; padding: 1px 4px; border-radius: 2px;',\n activated: 'color: White; background: #9E62DD; font-weight: bold; padding: 1px 4px; border-radius: 2px;',\n payload: 'color: White; background: #3748B8; font-weight: bold; padding: 1px 4px; border-radius: 2px;',\n json: 'color: White; background: #388AB8; font-weight: bold; padding: 1px 4px; border-radius: 2px;',\n schema: 'color: White; background: #268047; font-weight: bold; padding: 1px 4px; border-radius: 2px;',\n schemaVersion: 'color: White; background: #80265F; font-weight: bold; padding: 1px 4px; border-radius: 2px;',\n };\n\n const debug = (style: string, message: string, extra?: [string, ...unknown[]]) => {\n const [extraMessage, ...rest] = extra ?? [''];\n LOG.debug(\n `v${version} %c${tracker.namespace}%c %c%s` + extraMessage,\n colours.snowplowPurple,\n '',\n style,\n message,\n ...rest\n );\n };\n\n function jsonInterceptor(encodeBase64: boolean): JsonProcessor {\n const log = (jsonType: string, data: SelfDescribingJson) => {\n const schemaParts = getSchemaParts(data['schema']);\n debug(colours.event(), 'Event', [\n '%c%s%c%s%c%s\\n%o',\n colours.json,\n `${jsonType}: ${schemaParts ? schemaParts[1] : 'Unknown Schema'}`,\n colours.schemaVersion,\n schemaParts ? `Version: ${schemaParts[2]}-${schemaParts[3]}-${schemaParts[4]}` : 'Unknown Schema Version',\n colours.schema,\n schemaParts ? `Vendor: ${schemaParts[0]}` : 'Unknown Vendor',\n data['data'],\n ]);\n };\n\n return (\n payloadBuilder: PayloadBuilder,\n jsonForProcessing: EventJson,\n contextEntitiesForProcessing: SelfDescribingJson[]\n ) => {\n if (jsonForProcessing.length) {\n for (const json of jsonForProcessing) {\n const data = json.json['data'] as SelfDescribingJson;\n if (Array.isArray(data)) {\n data.forEach((d) => {\n log(getJsonType(json), d);\n });\n } else {\n log(getJsonType(json), data);\n }\n }\n }\n if (contextEntitiesForProcessing.length) {\n for (const entity of contextEntitiesForProcessing) {\n log('Context', entity);\n }\n }\n return payloadJsonProcessor(encodeBase64)(payloadBuilder, jsonForProcessing, contextEntitiesForProcessing);\n };\n }\n\n return {\n logger: (logger) => {\n LOG = logger;\n logger.setLogLevel(logLevel);\n },\n activateBrowserPlugin: (t) => {\n tracker = t;\n debug(colours.activated, 'Tracker Activated');\n },\n beforeTrack: (payloadBuilder: PayloadBuilder) => {\n eventColour = randomcolor({ luminosity: 'dark' });\n payloadBuilder.withJsonProcessor(jsonInterceptor(tracker.core.getBase64Encoding()));\n debug(colours.event(), 'Event', ['%c%s', colours.snowplowPurple, getEventType(payloadBuilder)]);\n payloadBuilder.build();\n },\n afterTrack: (payload: Payload) => {\n debug(colours.event(), 'Event', ['%c%s\\n%o', colours.payload, 'Payload', payload]);\n },\n };\n}\n\nfunction getJsonType(json: EventJsonWithKeys) {\n switch (json.keyIfEncoded) {\n case 'cx':\n return 'Context';\n case 'ue_px':\n return 'Self Describing';\n default:\n return `${json.keyIfEncoded}, ${json.keyIfNotEncoded}`;\n }\n}\n\nfunction getEventType(payloadBuilder: PayloadBuilder) {\n const payload = payloadBuilder.getPayload();\n switch (payload['e']) {\n case 'pv':\n return 'Page View';\n case 'pp':\n return 'Page Ping';\n case 'tr':\n return 'Ecommerce Transaction';\n case 'ti':\n return 'Ecommerce Transaction Item';\n case 'se':\n return 'Structured Event';\n case 'ue':\n return 'Self Describing';\n default:\n return typeof payload['e'] === 'string' ? payload['e'] : 'Invalid';\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;AAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BG,CAAA,CAAA,CAAA;AAkBH,CAAA,CAAA,CAAA;;AAEG,CAAA,CAAA,CAAA;AACG,CAAU,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAc,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAqC,CAAA,CAAA,CAAA;AAArC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAsB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAS,CAAC,CAAA,CAAA,CAAA,CAAA,CAAK,CAAA,CAAA,CAAA;AAClE,CAAA,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,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,kBAAkB,CAAC;AAC5B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,KAAK,CAAI,CAAA,CAAA,CAAA,CAAA;AACP,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,iBAAiB,CAAC;AAC3B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,CAAO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAC,GAAG,CAAC,CAAA,CAAA,CAAA,CAAA,CAAK,CAAQ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,OAAO,CAAC,CAAA,CAAA,CAAG,CAAC,CAAA,CAAA,CAAG,SAAS,CAAC;AACtE,CAAA,CAAA,CAAA,CAAA,CAAA;AACH,CAAA;;"}
|
package/dist/index.umd.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Debugger for Snowplow v3.
|
|
2
|
+
* Debugger for Snowplow v3.5.0 (http://bit.ly/sp-js)
|
|
3
3
|
* Copyright 2022 Snowplow Analytics Ltd, 2010 Anthon Pang
|
|
4
4
|
* Licensed under BSD-3-Clause
|
|
5
5
|
*/
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
|
9
9
|
typeof define === 'function' && define.amd ? define(['exports'], factory) :
|
|
10
10
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.snowplowDebugger = {}));
|
|
11
|
-
}(this, (function (exports) { 'use strict';
|
|
11
|
+
})(this, (function (exports) { 'use strict';
|
|
12
12
|
|
|
13
13
|
/*! *****************************************************************************
|
|
14
14
|
Copyright (c) Microsoft Corporation.
|
|
@@ -32,23 +32,18 @@
|
|
|
32
32
|
ar[i] = from[i];
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
-
return to.concat(ar || from);
|
|
35
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
39
39
|
|
|
40
|
-
function createCommonjsModule(fn) {
|
|
41
|
-
var module = { exports: {} };
|
|
42
|
-
return fn(module, module.exports), module.exports;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
40
|
/*!
|
|
46
|
-
* Core functionality for Snowplow JavaScript trackers v3.
|
|
41
|
+
* Core functionality for Snowplow JavaScript trackers v3.5.0 (http://bit.ly/sp-js)
|
|
47
42
|
* Copyright 2022 Snowplow Analytics Ltd, 2010 Anthon Pang
|
|
48
43
|
* Licensed under BSD-3-Clause
|
|
49
44
|
*/
|
|
50
45
|
|
|
51
|
-
var version$1 = "3.
|
|
46
|
+
var version$1 = "3.5.0";
|
|
52
47
|
|
|
53
48
|
/*
|
|
54
49
|
* Copyright (c) 2013 Kevin van Zonneveld (http://kvz.io)
|
|
@@ -72,6 +67,28 @@
|
|
|
72
67
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
73
68
|
* SOFTWARE.
|
|
74
69
|
*/
|
|
70
|
+
/**
|
|
71
|
+
* Decodes a url safe Base 64 encoded string
|
|
72
|
+
* @remarks See: {@link http://tools.ietf.org/html/rfc4648#page-7}
|
|
73
|
+
* @param data - String to decode
|
|
74
|
+
* @returns The decoded string
|
|
75
|
+
*/
|
|
76
|
+
function base64urldecode(data) {
|
|
77
|
+
if (!data) {
|
|
78
|
+
return data;
|
|
79
|
+
}
|
|
80
|
+
var padding = 4 - (data.length % 4);
|
|
81
|
+
switch (padding) {
|
|
82
|
+
case 2:
|
|
83
|
+
data += '==';
|
|
84
|
+
break;
|
|
85
|
+
case 3:
|
|
86
|
+
data += '=';
|
|
87
|
+
break;
|
|
88
|
+
}
|
|
89
|
+
var b64Data = data.replace(/-/g, '+').replace(/_/g, '/');
|
|
90
|
+
return base64decode(b64Data);
|
|
91
|
+
}
|
|
75
92
|
/**
|
|
76
93
|
* Encodes a string into a url safe Base 64 encoded string
|
|
77
94
|
* @remarks See: {@link http://tools.ietf.org/html/rfc4648#page-7}
|
|
@@ -131,6 +148,71 @@
|
|
|
131
148
|
var r = data.length % 3;
|
|
132
149
|
return (r ? enc.slice(0, r - 3) : enc) + '==='.slice(r || 3);
|
|
133
150
|
}
|
|
151
|
+
/**
|
|
152
|
+
* Decode base64 to string
|
|
153
|
+
*
|
|
154
|
+
* @param data - base64 to string
|
|
155
|
+
* @returns decoded string
|
|
156
|
+
*/
|
|
157
|
+
function base64decode(encodedData) {
|
|
158
|
+
// discuss at: http://locutus.io/php/base64_decode/
|
|
159
|
+
// original by: Tyler Akins (http://rumkin.com)
|
|
160
|
+
// improved by: Thunder.m
|
|
161
|
+
// improved by: Kevin van Zonneveld (http://kvz.io)
|
|
162
|
+
// improved by: Kevin van Zonneveld (http://kvz.io)
|
|
163
|
+
// input by: Aman Gupta
|
|
164
|
+
// input by: Brett Zamir (http://brett-zamir.me)
|
|
165
|
+
// bugfixed by: Onno Marsman (https://twitter.com/onnomarsman)
|
|
166
|
+
// bugfixed by: Pellentesque Malesuada
|
|
167
|
+
// bugfixed by: Kevin van Zonneveld (http://kvz.io)
|
|
168
|
+
// improved by: Indigo744
|
|
169
|
+
// example 1: base64_decode('S2V2aW4gdmFuIFpvbm5ldmVsZA==')
|
|
170
|
+
// returns 1: 'Kevin van Zonneveld'
|
|
171
|
+
// example 2: base64_decode('YQ==')
|
|
172
|
+
// returns 2: 'a'
|
|
173
|
+
// example 3: base64_decode('4pyTIMOgIGxhIG1vZGU=')
|
|
174
|
+
// returns 3: '✓ à la mode'
|
|
175
|
+
// decodeUTF8string()
|
|
176
|
+
// Internal function to decode properly UTF8 string
|
|
177
|
+
// Adapted from Solution #1 at https://developer.mozilla.org/en-US/docs/Web/API/WindowBase64/Base64_encoding_and_decoding
|
|
178
|
+
var decodeUTF8string = function (str) {
|
|
179
|
+
// Going backwards: from bytestream, to percent-encoding, to original string.
|
|
180
|
+
return decodeURIComponent(str
|
|
181
|
+
.split('')
|
|
182
|
+
.map(function (c) {
|
|
183
|
+
return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
|
|
184
|
+
})
|
|
185
|
+
.join(''));
|
|
186
|
+
};
|
|
187
|
+
var o1, o2, o3, h1, h2, h3, h4, bits, i = 0, ac = 0, dec = '';
|
|
188
|
+
var tmpArr = [];
|
|
189
|
+
if (!encodedData) {
|
|
190
|
+
return encodedData;
|
|
191
|
+
}
|
|
192
|
+
encodedData += '';
|
|
193
|
+
do {
|
|
194
|
+
// unpack four hexets into three octets using index points in b64
|
|
195
|
+
h1 = b64.indexOf(encodedData.charAt(i++));
|
|
196
|
+
h2 = b64.indexOf(encodedData.charAt(i++));
|
|
197
|
+
h3 = b64.indexOf(encodedData.charAt(i++));
|
|
198
|
+
h4 = b64.indexOf(encodedData.charAt(i++));
|
|
199
|
+
bits = (h1 << 18) | (h2 << 12) | (h3 << 6) | h4;
|
|
200
|
+
o1 = (bits >> 16) & 0xff;
|
|
201
|
+
o2 = (bits >> 8) & 0xff;
|
|
202
|
+
o3 = bits & 0xff;
|
|
203
|
+
if (h3 === 64) {
|
|
204
|
+
tmpArr[ac++] = String.fromCharCode(o1);
|
|
205
|
+
}
|
|
206
|
+
else if (h4 === 64) {
|
|
207
|
+
tmpArr[ac++] = String.fromCharCode(o1, o2);
|
|
208
|
+
}
|
|
209
|
+
else {
|
|
210
|
+
tmpArr[ac++] = String.fromCharCode(o1, o2, o3);
|
|
211
|
+
}
|
|
212
|
+
} while (i < encodedData.length);
|
|
213
|
+
dec = tmpArr.join('');
|
|
214
|
+
return decodeUTF8string(dec.replace(/\0+$/, ''));
|
|
215
|
+
}
|
|
134
216
|
/**
|
|
135
217
|
* A helper to build a Snowplow request from a set of name-value pairs, provided using the add methods.
|
|
136
218
|
* Will base64 encode JSON, if desired, on build
|
|
@@ -138,51 +220,57 @@
|
|
|
138
220
|
* @returns The request builder, with add and build methods
|
|
139
221
|
*/
|
|
140
222
|
function payloadJsonProcessor(encodeBase64) {
|
|
141
|
-
return function (payloadBuilder, jsonForProcessing) {
|
|
223
|
+
return function (payloadBuilder, jsonForProcessing, contextEntitiesForProcessing) {
|
|
224
|
+
var add = function (json, keyIfEncoded, keyIfNotEncoded) {
|
|
225
|
+
var str = JSON.stringify(json);
|
|
226
|
+
if (encodeBase64) {
|
|
227
|
+
payloadBuilder.add(keyIfEncoded, base64urlencode(str));
|
|
228
|
+
}
|
|
229
|
+
else {
|
|
230
|
+
payloadBuilder.add(keyIfNotEncoded, str);
|
|
231
|
+
}
|
|
232
|
+
};
|
|
233
|
+
var getContextFromPayload = function () {
|
|
234
|
+
var payload = payloadBuilder.getPayload();
|
|
235
|
+
if (encodeBase64 ? payload.cx : payload.co) {
|
|
236
|
+
return JSON.parse(encodeBase64 ? base64urldecode(payload.cx) : payload.co);
|
|
237
|
+
}
|
|
238
|
+
return undefined;
|
|
239
|
+
};
|
|
240
|
+
var combineContexts = function (originalContext, newContext) {
|
|
241
|
+
var context = originalContext || getContextFromPayload();
|
|
242
|
+
if (context) {
|
|
243
|
+
context.data = context.data.concat(newContext.data);
|
|
244
|
+
}
|
|
245
|
+
else {
|
|
246
|
+
context = newContext;
|
|
247
|
+
}
|
|
248
|
+
return context;
|
|
249
|
+
};
|
|
250
|
+
var context = undefined;
|
|
142
251
|
for (var _i = 0, jsonForProcessing_1 = jsonForProcessing; _i < jsonForProcessing_1.length; _i++) {
|
|
143
252
|
var json = jsonForProcessing_1[_i];
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
payloadBuilder.add(json.keyIfEncoded, base64urlencode(str));
|
|
253
|
+
if (json.keyIfEncoded === 'cx') {
|
|
254
|
+
context = combineContexts(context, json.json);
|
|
147
255
|
}
|
|
148
256
|
else {
|
|
149
|
-
|
|
257
|
+
add(json.json, json.keyIfEncoded, json.keyIfNotEncoded);
|
|
150
258
|
}
|
|
151
259
|
}
|
|
152
260
|
jsonForProcessing.length = 0;
|
|
261
|
+
if (contextEntitiesForProcessing.length) {
|
|
262
|
+
var newContext = {
|
|
263
|
+
schema: 'iglu:com.snowplowanalytics.snowplow/contexts/jsonschema/1-0-0',
|
|
264
|
+
data: __spreadArray([], contextEntitiesForProcessing, true)
|
|
265
|
+
};
|
|
266
|
+
context = combineContexts(context, newContext);
|
|
267
|
+
contextEntitiesForProcessing.length = 0;
|
|
268
|
+
}
|
|
269
|
+
if (context) {
|
|
270
|
+
add(context, 'cx', 'co');
|
|
271
|
+
}
|
|
153
272
|
};
|
|
154
273
|
}
|
|
155
|
-
|
|
156
|
-
/*
|
|
157
|
-
* Copyright (c) 2022 Snowplow Analytics Ltd, 2010 Anthon Pang
|
|
158
|
-
* All rights reserved.
|
|
159
|
-
*
|
|
160
|
-
* Redistribution and use in source and binary forms, with or without
|
|
161
|
-
* modification, are permitted provided that the following conditions are met:
|
|
162
|
-
*
|
|
163
|
-
* 1. Redistributions of source code must retain the above copyright notice, this
|
|
164
|
-
* list of conditions and the following disclaimer.
|
|
165
|
-
*
|
|
166
|
-
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
167
|
-
* this list of conditions and the following disclaimer in the documentation
|
|
168
|
-
* and/or other materials provided with the distribution.
|
|
169
|
-
*
|
|
170
|
-
* 3. Neither the name of the copyright holder nor the names of its
|
|
171
|
-
* contributors may be used to endorse or promote products derived from
|
|
172
|
-
* this software without specific prior written permission.
|
|
173
|
-
*
|
|
174
|
-
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
175
|
-
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
176
|
-
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
177
|
-
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
178
|
-
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
179
|
-
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
180
|
-
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
181
|
-
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
182
|
-
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
183
|
-
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
184
|
-
*/
|
|
185
|
-
var label = 'Snowplow: ';
|
|
186
274
|
var LOG_LEVEL;
|
|
187
275
|
(function (LOG_LEVEL) {
|
|
188
276
|
LOG_LEVEL[LOG_LEVEL["none"] = 0] = "none";
|
|
@@ -191,79 +279,6 @@
|
|
|
191
279
|
LOG_LEVEL[LOG_LEVEL["debug"] = 3] = "debug";
|
|
192
280
|
LOG_LEVEL[LOG_LEVEL["info"] = 4] = "info";
|
|
193
281
|
})(LOG_LEVEL || (LOG_LEVEL = {}));
|
|
194
|
-
logger();
|
|
195
|
-
function logger(logLevel) {
|
|
196
|
-
if (logLevel === void 0) { logLevel = LOG_LEVEL.warn; }
|
|
197
|
-
function setLogLevel(level) {
|
|
198
|
-
if (LOG_LEVEL[level]) {
|
|
199
|
-
logLevel = level;
|
|
200
|
-
}
|
|
201
|
-
else {
|
|
202
|
-
logLevel = LOG_LEVEL.warn;
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
/**
|
|
206
|
-
* Log errors, with or without error object
|
|
207
|
-
*/
|
|
208
|
-
function error(message, error) {
|
|
209
|
-
var extraParams = [];
|
|
210
|
-
for (var _i = 2; _i < arguments.length; _i++) {
|
|
211
|
-
extraParams[_i - 2] = arguments[_i];
|
|
212
|
-
}
|
|
213
|
-
if (logLevel >= LOG_LEVEL.error && typeof console !== 'undefined') {
|
|
214
|
-
var logMsg = label + message + '\n';
|
|
215
|
-
if (error) {
|
|
216
|
-
console.error.apply(console, __spreadArray([logMsg + '\n', error], extraParams));
|
|
217
|
-
}
|
|
218
|
-
else {
|
|
219
|
-
console.error.apply(console, __spreadArray([logMsg], extraParams));
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
/**
|
|
224
|
-
* Log warnings, with or without error object
|
|
225
|
-
*/
|
|
226
|
-
function warn(message, error) {
|
|
227
|
-
var extraParams = [];
|
|
228
|
-
for (var _i = 2; _i < arguments.length; _i++) {
|
|
229
|
-
extraParams[_i - 2] = arguments[_i];
|
|
230
|
-
}
|
|
231
|
-
if (logLevel >= LOG_LEVEL.warn && typeof console !== 'undefined') {
|
|
232
|
-
var logMsg = label + message;
|
|
233
|
-
if (error) {
|
|
234
|
-
console.warn.apply(console, __spreadArray([logMsg + '\n', error], extraParams));
|
|
235
|
-
}
|
|
236
|
-
else {
|
|
237
|
-
console.warn.apply(console, __spreadArray([logMsg], extraParams));
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
/**
|
|
242
|
-
* Log debug messages
|
|
243
|
-
*/
|
|
244
|
-
function debug(message) {
|
|
245
|
-
var extraParams = [];
|
|
246
|
-
for (var _i = 1; _i < arguments.length; _i++) {
|
|
247
|
-
extraParams[_i - 1] = arguments[_i];
|
|
248
|
-
}
|
|
249
|
-
if (logLevel >= LOG_LEVEL.debug && typeof console !== 'undefined') {
|
|
250
|
-
console.debug.apply(console, __spreadArray([label + message], extraParams));
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
/**
|
|
254
|
-
* Log info messages
|
|
255
|
-
*/
|
|
256
|
-
function info(message) {
|
|
257
|
-
var extraParams = [];
|
|
258
|
-
for (var _i = 1; _i < arguments.length; _i++) {
|
|
259
|
-
extraParams[_i - 1] = arguments[_i];
|
|
260
|
-
}
|
|
261
|
-
if (logLevel >= LOG_LEVEL.info && typeof console !== 'undefined') {
|
|
262
|
-
console.info.apply(console, __spreadArray([label + message], extraParams));
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
return { setLogLevel: setLogLevel, warn: warn, error: error, debug: debug, info: info };
|
|
266
|
-
}
|
|
267
282
|
/**
|
|
268
283
|
* Slices a schema into its composite parts. Useful for ruleset filtering.
|
|
269
284
|
* @param input - A schema string
|
|
@@ -308,7 +323,9 @@
|
|
|
308
323
|
*/
|
|
309
324
|
var version = version$1;
|
|
310
325
|
|
|
311
|
-
var randomColor =
|
|
326
|
+
var randomColor = {exports: {}};
|
|
327
|
+
|
|
328
|
+
(function (module, exports) {
|
|
312
329
|
(function(root, factory) {
|
|
313
330
|
|
|
314
331
|
// Support CommonJS
|
|
@@ -820,7 +837,9 @@
|
|
|
820
837
|
}
|
|
821
838
|
return randomColor;
|
|
822
839
|
}));
|
|
823
|
-
});
|
|
840
|
+
}(randomColor, randomColor.exports));
|
|
841
|
+
|
|
842
|
+
var randomcolor = randomColor.exports;
|
|
824
843
|
|
|
825
844
|
/*
|
|
826
845
|
* Copyright (c) 2022 Snowplow Analytics Ltd, 2010 Anthon Pang
|
|
@@ -860,7 +879,7 @@
|
|
|
860
879
|
var tracker;
|
|
861
880
|
var eventColour;
|
|
862
881
|
var colours = {
|
|
863
|
-
event: function () { return "color: White; background: "
|
|
882
|
+
event: function () { return "color: White; background: ".concat(eventColour, "; font-weight: bold; padding: 1px 4px; border-radius: 2px;"); },
|
|
864
883
|
snowplowPurple: 'color: White; background: #6638B8; font-weight: bold; padding: 1px 4px; border-radius: 2px;',
|
|
865
884
|
activated: 'color: White; background: #9E62DD; font-weight: bold; padding: 1px 4px; border-radius: 2px;',
|
|
866
885
|
payload: 'color: White; background: #3748B8; font-weight: bold; padding: 1px 4px; border-radius: 2px;',
|
|
@@ -870,37 +889,37 @@
|
|
|
870
889
|
};
|
|
871
890
|
var debug = function (style, message, extra) {
|
|
872
891
|
var _a = extra !== null && extra !== void 0 ? extra : [''], extraMessage = _a[0], rest = _a.slice(1);
|
|
873
|
-
LOG.debug.apply(LOG, __spreadArray(["v"
|
|
892
|
+
LOG.debug.apply(LOG, __spreadArray(["v".concat(version, " %c").concat(tracker.namespace, "%c %c%s") + extraMessage,
|
|
874
893
|
colours.snowplowPurple,
|
|
875
894
|
'',
|
|
876
895
|
style,
|
|
877
|
-
message], rest));
|
|
896
|
+
message], rest, false));
|
|
878
897
|
};
|
|
879
898
|
function jsonInterceptor(encodeBase64) {
|
|
880
|
-
var log = function (
|
|
899
|
+
var log = function (jsonType, data) {
|
|
881
900
|
var schemaParts = getSchemaParts(data['schema']);
|
|
882
901
|
debug(colours.event(), 'Event', [
|
|
883
902
|
'%c%s%c%s%c%s\n%o',
|
|
884
903
|
colours.json,
|
|
885
|
-
|
|
904
|
+
"".concat(jsonType, ": ").concat(schemaParts ? schemaParts[1] : 'Unknown Schema'),
|
|
886
905
|
colours.schemaVersion,
|
|
887
|
-
schemaParts ? "Version: "
|
|
906
|
+
schemaParts ? "Version: ".concat(schemaParts[2], "-").concat(schemaParts[3], "-").concat(schemaParts[4]) : 'Unknown Schema Version',
|
|
888
907
|
colours.schema,
|
|
889
|
-
schemaParts ? "Vendor: "
|
|
908
|
+
schemaParts ? "Vendor: ".concat(schemaParts[0]) : 'Unknown Vendor',
|
|
890
909
|
data['data'],
|
|
891
910
|
]);
|
|
892
911
|
};
|
|
893
|
-
return function (payloadBuilder, jsonForProcessing) {
|
|
912
|
+
return function (payloadBuilder, jsonForProcessing, contextEntitiesForProcessing) {
|
|
894
913
|
if (jsonForProcessing.length) {
|
|
895
914
|
var _loop_1 = function (json) {
|
|
896
915
|
var data = json.json['data'];
|
|
897
916
|
if (Array.isArray(data)) {
|
|
898
917
|
data.forEach(function (d) {
|
|
899
|
-
log(json, d);
|
|
918
|
+
log(getJsonType(json), d);
|
|
900
919
|
});
|
|
901
920
|
}
|
|
902
921
|
else {
|
|
903
|
-
log(json, data);
|
|
922
|
+
log(getJsonType(json), data);
|
|
904
923
|
}
|
|
905
924
|
};
|
|
906
925
|
for (var _i = 0, jsonForProcessing_1 = jsonForProcessing; _i < jsonForProcessing_1.length; _i++) {
|
|
@@ -908,7 +927,13 @@
|
|
|
908
927
|
_loop_1(json);
|
|
909
928
|
}
|
|
910
929
|
}
|
|
911
|
-
|
|
930
|
+
if (contextEntitiesForProcessing.length) {
|
|
931
|
+
for (var _a = 0, contextEntitiesForProcessing_1 = contextEntitiesForProcessing; _a < contextEntitiesForProcessing_1.length; _a++) {
|
|
932
|
+
var entity = contextEntitiesForProcessing_1[_a];
|
|
933
|
+
log('Context', entity);
|
|
934
|
+
}
|
|
935
|
+
}
|
|
936
|
+
return payloadJsonProcessor(encodeBase64)(payloadBuilder, jsonForProcessing, contextEntitiesForProcessing);
|
|
912
937
|
};
|
|
913
938
|
}
|
|
914
939
|
return {
|
|
@@ -921,7 +946,7 @@
|
|
|
921
946
|
debug(colours.activated, 'Tracker Activated');
|
|
922
947
|
},
|
|
923
948
|
beforeTrack: function (payloadBuilder) {
|
|
924
|
-
eventColour =
|
|
949
|
+
eventColour = randomcolor({ luminosity: 'dark' });
|
|
925
950
|
payloadBuilder.withJsonProcessor(jsonInterceptor(tracker.core.getBase64Encoding()));
|
|
926
951
|
debug(colours.event(), 'Event', ['%c%s', colours.snowplowPurple, getEventType(payloadBuilder)]);
|
|
927
952
|
payloadBuilder.build();
|
|
@@ -938,7 +963,7 @@
|
|
|
938
963
|
case 'ue_px':
|
|
939
964
|
return 'Self Describing';
|
|
940
965
|
default:
|
|
941
|
-
return json.keyIfEncoded
|
|
966
|
+
return "".concat(json.keyIfEncoded, ", ").concat(json.keyIfNotEncoded);
|
|
942
967
|
}
|
|
943
968
|
}
|
|
944
969
|
function getEventType(payloadBuilder) {
|
|
@@ -965,5 +990,5 @@
|
|
|
965
990
|
|
|
966
991
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
967
992
|
|
|
968
|
-
}))
|
|
993
|
+
}));
|
|
969
994
|
//# sourceMappingURL=index.umd.js.map
|