@snowplow/snowtype-core 0.2.5 → 0.2.6
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.js +378 -315
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var sl=Object.create;var U=Object.defineProperty;var ul=Object.getOwnPropertyDescriptor;var cl=Object.getOwnPropertyNames;var ml=Object.getPrototypeOf,fl=Object.prototype.hasOwnProperty;var O=(l,n)=>()=>(n||l((n={exports:{}}).exports,n),n.exports),yl=(l,n)=>{for(var i in n)U(l,i,{get:n[i],enumerable:!0})},sn=(l,n,i,m)=>{if(n&&typeof n=="object"||typeof n=="function")for(let t of cl(n))!fl.call(l,t)&&t!==i&&U(l,t,{get:()=>n[t],enumerable:!(m=ul(n,t))||m.enumerable});return l};var v=(l,n,i)=>(i=l!=null?sl(ml(l)):{},sn(n||!l||!l.__esModule?U(i,"default",{value:l,enumerable:!0}):i,l)),pl=l=>sn(U({},"__esModule",{value:!0}),l);var Ln=O((xe,Tn)=>{"use strict";Tn.exports={id:{language:"javascript",tracker:"@snowplow/browser-tracker"},1:function(l,n,i,m,t){return`import Ajv from "ajv-draft-04";
|
|
2
|
+
import addFormats from "ajv-formats";
|
|
3
|
+
import { schemasObject } from "./validations";
|
|
4
|
+
`},3:function(l,n,i,m,t){return'import * as Ecom from "@snowplow/browser-plugin-snowplow-ecommerce";'},5:function(l,n,i,m,t){return`/**
|
|
2
5
|
* Creates a Snowplow Event Specification entity.
|
|
3
6
|
*/
|
|
4
7
|
export function createEventSpecification(eventSpecification){
|
|
@@ -8,96 +11,122 @@ export function createEventSpecification(eventSpecification){
|
|
|
8
11
|
data: eventSpecification,
|
|
9
12
|
}
|
|
10
13
|
}
|
|
11
|
-
`},
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
`},7:function(l,n,i,m,t){return`const ajv = new Ajv({ allErrors: true, verbose: true, strict: false });
|
|
15
|
+
addFormats(ajv);
|
|
16
|
+
|
|
17
|
+
function defaultValidationErrorHandler(violations){
|
|
18
|
+
const msg = JSON.stringify(
|
|
19
|
+
{
|
|
20
|
+
type: 'Snowtype Schema Validation Error',
|
|
21
|
+
description: 'There was passing of values that does not match the JSON Schema definition.',
|
|
22
|
+
errors: violations,
|
|
23
|
+
},
|
|
24
|
+
undefined,
|
|
25
|
+
4
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
console.warn(msg);
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
function validateSchema(sdj) {
|
|
32
|
+
const valid = ajv.validate(schemasObject[sdj.schema], sdj.data);
|
|
33
|
+
if (!valid && ajv.errors?.length) {
|
|
34
|
+
defaultValidationErrorHandler(ajv.errors)
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
`},9:function(l,n,i,m,t){var a,e,s=n??(l.nullContext||{}),o=l.hooks.helperMissing,u="function",r=l.escapeExpression,c=l.lookupProperty||function(f,y){if(Object.prototype.hasOwnProperty.call(f,y))return f[y]};return`/**
|
|
38
|
+
* Track a Snowplow event for `+r((e=(e=c(i,"typeName")||(n!=null?c(n,"typeName"):n))!=null?e:o,typeof e===u?e.call(s,{name:"typeName",hash:{},data:t,loc:{start:{line:49,column:30},end:{line:49,column:42}}}):e))+`.
|
|
39
|
+
* `+r((e=(e=c(i,"description")||(n!=null?c(n,"description"):n))!=null?e:o,typeof e===u?e.call(s,{name:"description",hash:{},data:t,loc:{start:{line:50,column:3},end:{line:50,column:18}}}):e))+`
|
|
40
|
+
* @param { `+r((e=(e=c(i,"typeName")||(n!=null?c(n,"typeName"):n))!=null?e:o,typeof e===u?e.call(s,{name:"typeName",hash:{},data:t,loc:{start:{line:51,column:12},end:{line:51,column:24}}}):e))+" & Timestamp & Context } "+r((c(i,"startLow")||n&&c(n,"startLow")||o).call(s,n!=null?c(n,"typeName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:51,column:49},end:{line:51,column:70}}}))+" - Attributes for "+r((e=(e=c(i,"typeName")||(n!=null?c(n,"typeName"):n))!=null?e:o,typeof e===u?e.call(s,{name:"typeName",hash:{},data:t,loc:{start:{line:51,column:88},end:{line:51,column:100}}}):e))+`.
|
|
15
41
|
* @param {string[]} [trackers] - Tracker names to send the event to.
|
|
16
42
|
*/
|
|
17
|
-
export function track`+
|
|
18
|
-
const { context, timestamp, ...data } = `+
|
|
43
|
+
export function track`+r((e=(e=c(i,"functionName")||(n!=null?c(n,"functionName"):n))!=null?e:o,typeof e===u?e.call(s,{name:"functionName",hash:{},data:t,loc:{start:{line:54,column:21},end:{line:54,column:37}}}):e))+"("+r((c(i,"startLow")||n&&c(n,"startLow")||o).call(s,n!=null?c(n,"typeName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:54,column:38},end:{line:54,column:59}}}))+`, trackers){
|
|
44
|
+
const { context, timestamp, ...data } = `+r((c(i,"startLow")||n&&c(n,"startLow")||o).call(s,n!=null?c(n,"typeName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:55,column:42},end:{line:55,column:63}}}))+`;
|
|
45
|
+
const event = {
|
|
46
|
+
schema: '`+r((e=(e=c(i,"igluUrl")||(n!=null?c(n,"igluUrl"):n))!=null?e:o,typeof e===u?e.call(s,{name:"igluUrl",hash:{},data:t,loc:{start:{line:57,column:13},end:{line:57,column:24}}}):e))+`',
|
|
47
|
+
data
|
|
48
|
+
};
|
|
49
|
+
`+((a=c(i,"if").call(s,n!=null?c(n,"validations"):n,{name:"if",hash:{},fn:l.program(10,t,0),inverse:l.noop,data:t,loc:{start:{line:60,column:2},end:{line:60,column:90}}}))!=null?a:"")+`
|
|
19
50
|
trackSelfDescribingEvent({
|
|
20
|
-
event
|
|
21
|
-
schema: '`+u((e=(e=t(i,"igluUrl")||(n!=null?t(n,"igluUrl"):n))!=null?e:s,typeof e===o?e.call(a,{name:"igluUrl",hash:{},data:r,loc:{start:{line:27,column:15},end:{line:27,column:26}}}):e))+`',
|
|
22
|
-
data
|
|
23
|
-
},
|
|
51
|
+
event,
|
|
24
52
|
context,
|
|
25
53
|
timestamp,
|
|
26
54
|
}, trackers);
|
|
27
55
|
}
|
|
28
56
|
|
|
29
57
|
/**
|
|
30
|
-
* Creates a Snowplow `+
|
|
31
|
-
* @param { `+
|
|
58
|
+
* Creates a Snowplow `+r((e=(e=c(i,"typeName")||(n!=null?c(n,"typeName"):n))!=null?e:o,typeof e===u?e.call(s,{name:"typeName",hash:{},data:t,loc:{start:{line:69,column:22},end:{line:69,column:34}}}):e))+` entity.
|
|
59
|
+
* @param { `+r((e=(e=c(i,"typeName")||(n!=null?c(n,"typeName"):n))!=null?e:o,typeof e===u?e.call(s,{name:"typeName",hash:{},data:t,loc:{start:{line:70,column:12},end:{line:70,column:24}}}):e))+" } "+r((c(i,"startLow")||n&&c(n,"startLow")||o).call(s,n!=null?c(n,"typeName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:70,column:27},end:{line:70,column:48}}}))+" - Attributes for "+r((e=(e=c(i,"typeName")||(n!=null?c(n,"typeName"):n))!=null?e:o,typeof e===u?e.call(s,{name:"typeName",hash:{},data:t,loc:{start:{line:70,column:66},end:{line:70,column:78}}}):e))+`.
|
|
32
60
|
*/
|
|
33
|
-
export function create`+
|
|
61
|
+
export function create`+r((e=(e=c(i,"typeName")||(n!=null?c(n,"typeName"):n))!=null?e:o,typeof e===u?e.call(s,{name:"typeName",hash:{},data:t,loc:{start:{line:72,column:22},end:{line:72,column:34}}}):e))+"("+r((c(i,"startLow")||n&&c(n,"startLow")||o).call(s,n!=null?c(n,"typeName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:72,column:35},end:{line:72,column:56}}}))+`){
|
|
34
62
|
return {
|
|
35
|
-
schema: '`+
|
|
36
|
-
data: `+
|
|
63
|
+
schema: '`+r((e=(e=c(i,"igluUrl")||(n!=null?c(n,"igluUrl"):n))!=null?e:o,typeof e===u?e.call(s,{name:"igluUrl",hash:{},data:t,loc:{start:{line:74,column:13},end:{line:74,column:24}}}):e))+`',
|
|
64
|
+
data: `+r((c(i,"startLow")||n&&c(n,"startLow")||o).call(s,n!=null?c(n,"typeName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:75,column:10},end:{line:75,column:31}}}))+`
|
|
37
65
|
}
|
|
38
66
|
}
|
|
39
|
-
`},
|
|
40
|
-
* Tracks a `+o(s(n!=null?
|
|
41
|
-
* `+o((
|
|
42
|
-
* @param { `+o(s(n!=null?
|
|
67
|
+
`},10:function(l,n,i,m,t){return"[event].concat(context || []).forEach(s => validateSchema(s));"},12:function(l,n,i,m,t){var a,e=n??(l.nullContext||{}),s=l.lambda,o=l.escapeExpression,u=l.hooks.helperMissing,r=l.lookupProperty||function(c,f){if(Object.prototype.hasOwnProperty.call(c,f))return c[f]};return((a=r(i,"if").call(e,n!=null?r(n,"entities"):n,{name:"if",hash:{},fn:l.program(13,t,0),inverse:l.noop,data:t,loc:{start:{line:81,column:0},end:{line:88,column:7}}}))!=null?a:"")+`/**
|
|
68
|
+
* Tracks a `+o(s(n!=null?r(n,"name"):n,n))+` event specification.
|
|
69
|
+
* `+o((r(i,"addEventSpecificationIdentifier")||n&&r(n,"addEventSpecificationIdentifier")||u).call(e,n!=null?r(n,"id"):n,{name:"addEventSpecificationIdentifier",hash:{},data:t,loc:{start:{line:91,column:3},end:{line:91,column:46}}}))+`
|
|
70
|
+
* @param { `+o(s(n!=null?r(n,"event"):n,n))+" & Timestamp"+((a=r(i,"if").call(e,n!=null?r(n,"entities"):n,{name:"if",hash:{},fn:l.program(16,t,0),inverse:l.noop,data:t,loc:{start:{line:92,column:38},end:{line:92,column:90}}}))!=null?a:"")+" } "+o((r(i,"startLow")||n&&r(n,"startLow")||u).call(e,n!=null?r(n,"name"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:92,column:93},end:{line:92,column:115}}}))+" - Attributes for "+o(s(n!=null?r(n,"name"):n,n))+` event specification.
|
|
43
71
|
* @param {string[]} [trackers] - Tracker names to send the event specification to.
|
|
44
72
|
*/
|
|
45
|
-
export function track`+o(s(n!=null?
|
|
46
|
-
const eventSpecificationContext = createEventSpecification({ id: '`+o(s(n!=null?
|
|
73
|
+
export function track`+o(s(n!=null?r(n,"name"):n,n))+"("+o((r(i,"startLow")||n&&r(n,"startLow")||u).call(e,n!=null?r(n,"name"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:95,column:35},end:{line:95,column:57}}}))+`, trackers){
|
|
74
|
+
const eventSpecificationContext = createEventSpecification({ id: '`+o(s(n!=null?r(n,"id"):n,n))+`' });
|
|
47
75
|
|
|
48
|
-
const context = Array.isArray(`+o((
|
|
49
|
-
? [...`+o((
|
|
76
|
+
const context = Array.isArray(`+o((r(i,"startLow")||n&&r(n,"startLow")||u).call(e,n!=null?r(n,"name"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:98,column:32},end:{line:98,column:54}}}))+`.context)
|
|
77
|
+
? [...`+o((r(i,"startLow")||n&&r(n,"startLow")||u).call(e,n!=null?r(n,"name"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:99,column:10},end:{line:99,column:32}}}))+`.context, eventSpecificationContext]
|
|
50
78
|
: [eventSpecificationContext];
|
|
51
79
|
|
|
52
|
-
const modified`+o(s(n!=null?
|
|
53
|
-
...`+o((
|
|
80
|
+
const modified`+o(s(n!=null?r(n,"name"):n,n))+` = {
|
|
81
|
+
...`+o((r(i,"startLow")||n&&r(n,"startLow")||u).call(e,n!=null?r(n,"name"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:103,column:7},end:{line:103,column:29}}}))+`,
|
|
54
82
|
context,
|
|
55
83
|
};
|
|
56
84
|
|
|
57
|
-
track`+o(s(n!=null?
|
|
85
|
+
track`+o(s(n!=null?r(n,"event"):n,n))+"(modified"+o(s(n!=null?r(n,"name"):n,n))+`, trackers);
|
|
58
86
|
}
|
|
59
|
-
`},
|
|
60
|
-
* Typedef for `+s(
|
|
61
|
-
* @typedef {object} `+s(
|
|
62
|
-
* @property {(`+((
|
|
87
|
+
`},13:function(l,n,i,m,t){var a,e=l.lambda,s=l.escapeExpression,o=l.lookupProperty||function(u,r){if(Object.prototype.hasOwnProperty.call(u,r))return u[r]};return`/**
|
|
88
|
+
* Typedef for `+s(e(n!=null?o(n,"name"):n,n))+` event specification contexts.
|
|
89
|
+
* @typedef {object} `+s(e(n!=null?o(n,"name"):n,n))+`Contexts
|
|
90
|
+
* @property {(`+((a=o(i,"join").call(n??(l.nullContext||{}),n!=null?o(n,"entities"):n," | ","Context",{name:"join",hash:{},fn:l.program(14,t,0),inverse:l.noop,data:t,loc:{start:{line:85,column:15},end:{line:85,column:63}}}))!=null?a:"")+")[]} [context] Contexts to include in the "+s(e(n!=null?o(n,"name"):n,n))+` event specification.
|
|
63
91
|
*/
|
|
64
92
|
|
|
65
|
-
`},
|
|
66
|
-
* Tracks a `+o(s(n!=null?
|
|
67
|
-
* `+o((
|
|
68
|
-
* @param { `+o((
|
|
93
|
+
`},14:function(l,n,i,m,t){return""},16:function(l,n,i,m,t){var a=l.lookupProperty||function(e,s){if(Object.prototype.hasOwnProperty.call(e,s))return e[s]};return" & "+l.escapeExpression(l.lambda(n!=null?a(n,"name"):n,n))+"Contexts"},18:function(l,n,i,m,t){var a,e=n??(l.nullContext||{}),s=l.lambda,o=l.escapeExpression,u=l.hooks.helperMissing,r=l.lookupProperty||function(c,f){if(Object.prototype.hasOwnProperty.call(c,f))return c[f]};return((a=r(i,"if").call(e,n!=null?r(n,"entities"):n,{name:"if",hash:{},fn:l.program(13,t,0),inverse:l.noop,data:t,loc:{start:{line:111,column:0},end:{line:118,column:7}}}))!=null?a:"")+`/**
|
|
94
|
+
* Tracks a `+o(s(n!=null?r(n,"name"):n,n))+` event specification.
|
|
95
|
+
* `+o((r(i,"addEventSpecificationIdentifier")||n&&r(n,"addEventSpecificationIdentifier")||u).call(e,n!=null?r(n,"id"):n,{name:"addEventSpecificationIdentifier",hash:{},data:t,loc:{start:{line:121,column:3},end:{line:121,column:46}}}))+`
|
|
96
|
+
* @param { `+o((r(i,"ecomFunctionArgument")||n&&r(n,"ecomFunctionArgument")||u).call(e,n!=null?r(n,"event"):n,{name:"ecomFunctionArgument",hash:{},data:t,loc:{start:{line:122,column:12},end:{line:122,column:47}}}))+" "+((a=r(i,"if").call(e,n!=null?r(n,"entities"):n,{name:"if",hash:{},fn:l.program(19,t,0),inverse:l.program(21,t,0),data:t,loc:{start:{line:122,column:48},end:{line:122,column:144}}}))!=null?a:"")+" } "+o((r(i,"startLow")||n&&r(n,"startLow")||u).call(e,n!=null?r(n,"name"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:122,column:147},end:{line:122,column:169}}}))+" - Attributes for "+o(s(n!=null?r(n,"name"):n,n))+` event specification.
|
|
69
97
|
* @param {string[]} [trackers] - Tracker names to send the event specification to.
|
|
70
98
|
*/
|
|
71
|
-
export function track`+o(s(n!=null?
|
|
72
|
-
const eventSpecificationContext = createEventSpecification({ id: '`+o(s(n!=null?
|
|
99
|
+
export function track`+o(s(n!=null?r(n,"name"):n,n))+"("+o((r(i,"startLow")||n&&r(n,"startLow")||u).call(e,n!=null?r(n,"name"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:125,column:35},end:{line:125,column:57}}}))+`, trackers){
|
|
100
|
+
const eventSpecificationContext = createEventSpecification({ id: '`+o(s(n!=null?r(n,"id"):n,n))+`' });
|
|
73
101
|
|
|
74
|
-
const context = Array.isArray(`+o((
|
|
75
|
-
? [...`+o((
|
|
102
|
+
const context = Array.isArray(`+o((r(i,"startLow")||n&&r(n,"startLow")||u).call(e,n!=null?r(n,"name"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:128,column:32},end:{line:128,column:54}}}))+`.context)
|
|
103
|
+
? [...`+o((r(i,"startLow")||n&&r(n,"startLow")||u).call(e,n!=null?r(n,"name"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:129,column:10},end:{line:129,column:32}}}))+`.context, eventSpecificationContext]
|
|
76
104
|
: [eventSpecificationContext];
|
|
77
105
|
|
|
78
|
-
const modified`+o(s(n!=null?
|
|
79
|
-
...`+o((
|
|
106
|
+
const modified`+o(s(n!=null?r(n,"name"):n,n))+` = {
|
|
107
|
+
...`+o((r(i,"startLow")||n&&r(n,"startLow")||u).call(e,n!=null?r(n,"name"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:133,column:7},end:{line:133,column:29}}}))+`,
|
|
80
108
|
context,
|
|
81
109
|
};
|
|
82
110
|
|
|
83
|
-
`+o((
|
|
84
|
-
}
|
|
85
|
-
`},
|
|
86
|
-
`+((
|
|
87
|
-
`+((
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
* `+u((
|
|
92
|
-
*
|
|
111
|
+
`+o((r(i,"ecomFunction")||n&&r(n,"ecomFunction")||u).call(e,n!=null?r(n,"event"):n,{name:"ecomFunction",hash:{},data:t,loc:{start:{line:137,column:2},end:{line:137,column:29}}}))+"(modified"+o(s(n!=null?r(n,"name"):n,n))+`, trackers);
|
|
112
|
+
}
|
|
113
|
+
`},19:function(l,n,i,m,t){var a=l.lookupProperty||function(e,s){if(Object.prototype.hasOwnProperty.call(e,s))return e[s]};return"& "+l.escapeExpression(l.lambda(n!=null?a(n,"name"):n,n))+"Contexts"},21:function(l,n,i,m,t){return"& Ecom.CommonEcommerceEventProperties"},compiler:[8,">= 4.3.0"],main:function(l,n,i,m,t){var a,e,s,o=n??(l.nullContext||{}),u=l.hooks.helperMissing,r=l.lookupProperty||function(f,y){if(Object.prototype.hasOwnProperty.call(f,y))return f[y]},c=`import { trackSelfDescribingEvent } from '@snowplow/browser-tracker';
|
|
114
|
+
`+((a=r(i,"if").call(o,n!=null?r(n,"validations"):n,{name:"if",hash:{},fn:l.program(1,t,0),inverse:l.noop,data:t,loc:{start:{line:2,column:0},end:{line:6,column:7}}}))!=null?a:"")+((a=r(i,"if").call(o,(a=n!=null?r(n,"ecomEventSpecifications"):n)!=null?r(a,"length"):a,{name:"if",hash:{},fn:l.program(3,t,0),inverse:l.noop,data:t,loc:{start:{line:7,column:0},end:{line:7,column:113}}}))!=null?a:"")+`
|
|
115
|
+
`+((a=r(i,"if").call(o,(r(i,"or")||n&&r(n,"or")||u).call(o,(a=n!=null?r(n,"eventSpecifications"):n)!=null?r(a,"length"):a,(a=n!=null?r(n,"ecomEventSpecifications"):n)!=null?r(a,"length"):a,{name:"or",hash:{},data:t,loc:{start:{line:8,column:6},end:{line:8,column:68}}}),{name:"if",hash:{},fn:l.program(5,t,0),inverse:l.noop,data:t,loc:{start:{line:8,column:0},end:{line:19,column:7}}}))!=null?a:"")+`
|
|
116
|
+
`+((a=r(i,"if").call(o,n!=null?r(n,"validations"):n,{name:"if",hash:{},fn:l.program(7,t,0),inverse:l.noop,data:t,loc:{start:{line:21,column:0},end:{line:45,column:7}}}))!=null?a:"")+`
|
|
117
|
+
`;return a=(e=(e=r(i,"type")||(n!=null?r(n,"type"):n))!=null?e:u,s={name:"type",hash:{},fn:l.program(9,t,0),inverse:l.noop,data:t,loc:{start:{line:47,column:0},end:{line:78,column:9}}},typeof e=="function"?e.call(o,s):e),r(i,"type")||(a=l.hooks.blockHelperMissing.call(n,a,s)),a!=null&&(c+=a),c+`
|
|
118
|
+
`+((a=r(i,"each").call(o,n!=null?r(n,"eventSpecifications"):n,{name:"each",hash:{},fn:l.program(12,t,0),inverse:l.noop,data:t,loc:{start:{line:80,column:0},end:{line:109,column:9}}}))!=null?a:"")+((a=r(i,"each").call(o,n!=null?r(n,"ecomEventSpecifications"):n,{name:"each",hash:{},fn:l.program(18,t,0),inverse:l.noop,data:t,loc:{start:{line:110,column:0},end:{line:139,column:9}}}))!=null?a:"")},useData:!0}});var Nn=O((be,Cn)=>{"use strict";Cn.exports={id:{language:"javascript",tracker:"@snowplow/javascript-tracker"},1:function(l,n,i,m,t){var a,e=n??(l.nullContext||{}),s=l.hooks.helperMissing,o="function",u=l.escapeExpression,r=l.lookupProperty||function(c,f){if(Object.prototype.hasOwnProperty.call(c,f))return c[f]};return`/**
|
|
119
|
+
* Track a Snowplow event for `+u((a=(a=r(i,"typeName")||(n!=null?r(n,"typeName"):n))!=null?a:s,typeof a===o?a.call(e,{name:"typeName",hash:{},data:t,loc:{start:{line:3,column:30},end:{line:3,column:42}}}):a))+`.
|
|
120
|
+
* `+u((a=(a=r(i,"description")||(n!=null?r(n,"description"):n))!=null?a:s,typeof a===o?a.call(e,{name:"description",hash:{},data:t,loc:{start:{line:4,column:3},end:{line:4,column:18}}}):a))+`
|
|
121
|
+
* @param { `+u((a=(a=r(i,"typeName")||(n!=null?r(n,"typeName"):n))!=null?a:s,typeof a===o?a.call(e,{name:"typeName",hash:{},data:t,loc:{start:{line:5,column:12},end:{line:5,column:24}}}):a))+" & Timestamp & Context } "+u((r(i,"startLow")||n&&r(n,"startLow")||s).call(e,n!=null?r(n,"typeName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:5,column:49},end:{line:5,column:70}}}))+" - Attributes for "+u((a=(a=r(i,"typeName")||(n!=null?r(n,"typeName"):n))!=null?a:s,typeof a===o?a.call(e,{name:"typeName",hash:{},data:t,loc:{start:{line:5,column:88},end:{line:5,column:100}}}):a))+`.
|
|
93
122
|
* @param {string[]} [trackers] - Tracker names to send the event to.
|
|
94
123
|
*/
|
|
95
|
-
function track`+u((
|
|
124
|
+
function track`+u((a=(a=r(i,"functionName")||(n!=null?r(n,"functionName"):n))!=null?a:s,typeof a===o?a.call(e,{name:"functionName",hash:{},data:t,loc:{start:{line:8,column:14},end:{line:8,column:30}}}):a))+"("+u((r(i,"startLow")||n&&r(n,"startLow")||s).call(e,n!=null?r(n,"typeName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:8,column:31},end:{line:8,column:52}}}))+`, trackers){
|
|
96
125
|
const trackerNames = (trackers && trackers.length) ? ':' + trackers.join(';') : '';
|
|
97
|
-
const { context, timestamp, ...data } = `+u((
|
|
126
|
+
const { context, timestamp, ...data } = `+u((r(i,"startLow")||n&&r(n,"startLow")||s).call(e,n!=null?r(n,"typeName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:10,column:42},end:{line:10,column:63}}}))+`;
|
|
98
127
|
window.snowplow('trackSelfDescribingEvent' + trackerNames, {
|
|
99
128
|
event: {
|
|
100
|
-
schema: '`+u((
|
|
129
|
+
schema: '`+u((a=(a=r(i,"igluUrl")||(n!=null?r(n,"igluUrl"):n))!=null?a:s,typeof a===o?a.call(e,{name:"igluUrl",hash:{},data:t,loc:{start:{line:13,column:15},end:{line:13,column:26}}}):a))+`',
|
|
101
130
|
data
|
|
102
131
|
},
|
|
103
132
|
context,
|
|
@@ -106,32 +135,32 @@ function track`+u((e=(e=t(i,"functionName")||(n!=null?t(n,"functionName"):n))!=n
|
|
|
106
135
|
}
|
|
107
136
|
|
|
108
137
|
/**
|
|
109
|
-
* Creates a Snowplow `+u((
|
|
110
|
-
* @param { `+u((
|
|
138
|
+
* Creates a Snowplow `+u((a=(a=r(i,"typeName")||(n!=null?r(n,"typeName"):n))!=null?a:s,typeof a===o?a.call(e,{name:"typeName",hash:{},data:t,loc:{start:{line:22,column:22},end:{line:22,column:34}}}):a))+` entity.
|
|
139
|
+
* @param { `+u((a=(a=r(i,"typeName")||(n!=null?r(n,"typeName"):n))!=null?a:s,typeof a===o?a.call(e,{name:"typeName",hash:{},data:t,loc:{start:{line:23,column:12},end:{line:23,column:24}}}):a))+" } "+u((r(i,"startLow")||n&&r(n,"startLow")||s).call(e,n!=null?r(n,"typeName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:23,column:27},end:{line:23,column:48}}}))+" - Attributes for "+u((a=(a=r(i,"typeName")||(n!=null?r(n,"typeName"):n))!=null?a:s,typeof a===o?a.call(e,{name:"typeName",hash:{},data:t,loc:{start:{line:23,column:66},end:{line:23,column:78}}}):a))+`.
|
|
111
140
|
*/
|
|
112
|
-
function create`+u((
|
|
141
|
+
function create`+u((a=(a=r(i,"typeName")||(n!=null?r(n,"typeName"):n))!=null?a:s,typeof a===o?a.call(e,{name:"typeName",hash:{},data:t,loc:{start:{line:25,column:15},end:{line:25,column:27}}}):a))+"("+u((r(i,"startLow")||n&&r(n,"startLow")||s).call(e,n!=null?r(n,"typeName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:25,column:28},end:{line:25,column:49}}}))+`){
|
|
113
142
|
return {
|
|
114
|
-
schema: '`+u((
|
|
115
|
-
data: `+u((
|
|
143
|
+
schema: '`+u((a=(a=r(i,"igluUrl")||(n!=null?r(n,"igluUrl"):n))!=null?a:s,typeof a===o?a.call(e,{name:"igluUrl",hash:{},data:t,loc:{start:{line:27,column:13},end:{line:27,column:24}}}):a))+`',
|
|
144
|
+
data: `+u((r(i,"startLow")||n&&r(n,"startLow")||s).call(e,n!=null?r(n,"typeName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:28,column:10},end:{line:28,column:31}}}))+`
|
|
116
145
|
}
|
|
117
146
|
}
|
|
118
|
-
`},3:function(l,n,i,
|
|
119
|
-
* Tracks a `+o(s(n!=null?
|
|
120
|
-
* `+o((
|
|
121
|
-
* @param { `+o(s(n!=null?
|
|
147
|
+
`},3:function(l,n,i,m,t){var a,e=n??(l.nullContext||{}),s=l.lambda,o=l.escapeExpression,u=l.hooks.helperMissing,r=l.lookupProperty||function(c,f){if(Object.prototype.hasOwnProperty.call(c,f))return c[f]};return((a=r(i,"if").call(e,n!=null?r(n,"entities"):n,{name:"if",hash:{},fn:l.program(4,t,0),inverse:l.noop,data:t,loc:{start:{line:34,column:0},end:{line:41,column:7}}}))!=null?a:"")+`/**
|
|
148
|
+
* Tracks a `+o(s(n!=null?r(n,"name"):n,n))+` event specification.
|
|
149
|
+
* `+o((r(i,"addEventSpecificationIdentifier")||n&&r(n,"addEventSpecificationIdentifier")||u).call(e,n!=null?r(n,"id"):n,{name:"addEventSpecificationIdentifier",hash:{},data:t,loc:{start:{line:44,column:3},end:{line:44,column:46}}}))+`
|
|
150
|
+
* @param { `+o(s(n!=null?r(n,"event"):n,n))+" & Timestamp"+((a=r(i,"if").call(e,n!=null?r(n,"entities"):n,{name:"if",hash:{},fn:l.program(7,t,0),inverse:l.noop,data:t,loc:{start:{line:45,column:38},end:{line:45,column:91}}}))!=null?a:"")+" } "+o((r(i,"startLow")||n&&r(n,"startLow")||u).call(e,n!=null?r(n,"name"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:45,column:94},end:{line:45,column:116}}}))+" - Attributes for "+o(s(n!=null?r(n,"name"):n,n))+` event specification.
|
|
122
151
|
* @param {string[]} [trackers] - Tracker names to send the event specification to.
|
|
123
152
|
*/
|
|
124
|
-
function track`+o(s(n!=null?
|
|
125
|
-
track`+o(s(n!=null?
|
|
153
|
+
function track`+o(s(n!=null?r(n,"name"):n,n))+"("+o((r(i,"startLow")||n&&r(n,"startLow")||u).call(e,n!=null?r(n,"name"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:48,column:28},end:{line:48,column:50}}}))+`, trackers){
|
|
154
|
+
track`+o(s(n!=null?r(n,"event"):n,n))+"("+o((r(i,"startLow")||n&&r(n,"startLow")||u).call(e,n!=null?r(n,"name"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:49,column:22},end:{line:49,column:44}}}))+`, trackers);
|
|
126
155
|
}
|
|
127
|
-
`},4:function(l,n,i,
|
|
128
|
-
* Typedef for a `+s(
|
|
129
|
-
* @typedef {object} `+s(
|
|
130
|
-
* @property {(`+((
|
|
156
|
+
`},4:function(l,n,i,m,t){var a,e=l.lambda,s=l.escapeExpression,o=l.lookupProperty||function(u,r){if(Object.prototype.hasOwnProperty.call(u,r))return u[r]};return`/**
|
|
157
|
+
* Typedef for a `+s(e(n!=null?o(n,"event"):n,n))+`Contexts
|
|
158
|
+
* @typedef {object} `+s(e(n!=null?o(n,"event"):n,n))+`Contexts
|
|
159
|
+
* @property {(`+((a=o(i,"join").call(n??(l.nullContext||{}),n!=null?o(n,"entities"):n," | ","Context",{name:"join",hash:{},fn:l.program(5,t,0),inverse:l.noop,data:t,loc:{start:{line:38,column:15},end:{line:38,column:63}}}))!=null?a:"")+")[]} [context] Contexts to include in the "+s(e(n!=null?o(n,"name"):n,n))+` event specification.
|
|
131
160
|
*/
|
|
132
161
|
|
|
133
|
-
`},5:function(l,n,i,
|
|
134
|
-
`+((
|
|
162
|
+
`},5:function(l,n,i,m,t){return""},7:function(l,n,i,m,t){var a=l.lookupProperty||function(e,s){if(Object.prototype.hasOwnProperty.call(e,s))return e[s]};return" & "+l.escapeExpression(l.lambda(n!=null?a(n,"event"):n,n))+"Contexts"},compiler:[8,">= 4.3.0"],main:function(l,n,i,m,t){var a,e,s,o=n??(l.nullContext||{}),u=l.lookupProperty||function(c,f){if(Object.prototype.hasOwnProperty.call(c,f))return c[f]},r="";return a=(e=(e=u(i,"type")||(n!=null?u(n,"type"):n))!=null?e:l.hooks.helperMissing,s={name:"type",hash:{},fn:l.program(1,t,0),inverse:l.noop,data:t,loc:{start:{line:1,column:0},end:{line:31,column:9}}},typeof e=="function"?e.call(o,s):e),u(i,"type")||(a=l.hooks.blockHelperMissing.call(n,a,s)),a!=null&&(r+=a),r+`
|
|
163
|
+
`+((a=u(i,"each").call(o,n!=null?u(n,"eventSpecifications"):n,{name:"each",hash:{},fn:l.program(3,t,0),inverse:l.noop,data:t,loc:{start:{line:33,column:0},end:{line:51,column:9}}}))!=null?a:"")},useData:!0}});var Mn=O((Pe,An)=>{"use strict";An.exports={id:{language:"javascript",tracker:"@snowplow/node-tracker"},1:function(l,n,i,m,t){return`/**
|
|
135
164
|
* Creates a Snowplow Event Specification entity.
|
|
136
165
|
*/
|
|
137
166
|
export function createEventSpecification(eventSpecification){
|
|
@@ -141,69 +170,73 @@ export function createEventSpecification(eventSpecification){
|
|
|
141
170
|
data: eventSpecification,
|
|
142
171
|
}
|
|
143
172
|
}
|
|
144
|
-
`},3:function(l,n,i,
|
|
145
|
-
* Track a Snowplow event for `+u((
|
|
146
|
-
* `+u((
|
|
173
|
+
`},3:function(l,n,i,m,t){var a,e=n??(l.nullContext||{}),s=l.hooks.helperMissing,o="function",u=l.escapeExpression,r=l.lookupProperty||function(c,f){if(Object.prototype.hasOwnProperty.call(c,f))return c[f]};return`/**
|
|
174
|
+
* Track a Snowplow event for `+u((a=(a=r(i,"typeName")||(n!=null?r(n,"typeName"):n))!=null?a:s,typeof a===o?a.call(e,{name:"typeName",hash:{},data:t,loc:{start:{line:23,column:30},end:{line:23,column:42}}}):a))+`.
|
|
175
|
+
* `+u((a=(a=r(i,"description")||(n!=null?r(n,"description"):n))!=null?a:s,typeof a===o?a.call(e,{name:"description",hash:{},data:t,loc:{start:{line:24,column:3},end:{line:24,column:18}}}):a))+`
|
|
147
176
|
* @param {Tracker} tracker - Tracker to send the event to.
|
|
148
|
-
* @param { `+u((
|
|
177
|
+
* @param { `+u((a=(a=r(i,"typeName")||(n!=null?r(n,"typeName"):n))!=null?a:s,typeof a===o?a.call(e,{name:"typeName",hash:{},data:t,loc:{start:{line:26,column:12},end:{line:26,column:24}}}):a))+" & Timestamp & Context } "+u((r(i,"startLow")||n&&r(n,"startLow")||s).call(e,n!=null?r(n,"typeName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:26,column:49},end:{line:26,column:70}}}))+" - Attributes for "+u((a=(a=r(i,"typeName")||(n!=null?r(n,"typeName"):n))!=null?a:s,typeof a===o?a.call(e,{name:"typeName",hash:{},data:t,loc:{start:{line:26,column:88},end:{line:26,column:100}}}):a))+`.
|
|
149
178
|
*/
|
|
150
|
-
export function track`+u((
|
|
151
|
-
const { context, timestamp, ...data } = `+u((
|
|
179
|
+
export function track`+u((a=(a=r(i,"functionName")||(n!=null?r(n,"functionName"):n))!=null?a:s,typeof a===o?a.call(e,{name:"functionName",hash:{},data:t,loc:{start:{line:28,column:21},end:{line:28,column:37}}}):a))+"(tracker, "+u((r(i,"startLow")||n&&r(n,"startLow")||s).call(e,n!=null?r(n,"typeName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:28,column:47},end:{line:28,column:68}}}))+`){
|
|
180
|
+
const { context, timestamp, ...data } = `+u((r(i,"startLow")||n&&r(n,"startLow")||s).call(e,n!=null?r(n,"typeName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:29,column:42},end:{line:29,column:63}}}))+`;
|
|
152
181
|
|
|
153
182
|
tracker.track(buildSelfDescribingEvent({
|
|
154
183
|
event: {
|
|
155
|
-
schema: '`+u((
|
|
184
|
+
schema: '`+u((a=(a=r(i,"igluUrl")||(n!=null?r(n,"igluUrl"):n))!=null?a:s,typeof a===o?a.call(e,{name:"igluUrl",hash:{},data:t,loc:{start:{line:33,column:15},end:{line:33,column:26}}}):a))+`',
|
|
156
185
|
data
|
|
157
186
|
}
|
|
158
187
|
}), context, timestamp);
|
|
159
188
|
}
|
|
160
189
|
|
|
161
190
|
/**
|
|
162
|
-
* Creates a Snowplow `+u((
|
|
163
|
-
* @param { `+u((
|
|
191
|
+
* Creates a Snowplow `+u((a=(a=r(i,"typeName")||(n!=null?r(n,"typeName"):n))!=null?a:s,typeof a===o?a.call(e,{name:"typeName",hash:{},data:t,loc:{start:{line:40,column:22},end:{line:40,column:34}}}):a))+` entity.
|
|
192
|
+
* @param { `+u((a=(a=r(i,"typeName")||(n!=null?r(n,"typeName"):n))!=null?a:s,typeof a===o?a.call(e,{name:"typeName",hash:{},data:t,loc:{start:{line:41,column:12},end:{line:41,column:24}}}):a))+" } "+u((r(i,"startLow")||n&&r(n,"startLow")||s).call(e,n!=null?r(n,"typeName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:41,column:27},end:{line:41,column:48}}}))+" - Attributes for "+u((a=(a=r(i,"typeName")||(n!=null?r(n,"typeName"):n))!=null?a:s,typeof a===o?a.call(e,{name:"typeName",hash:{},data:t,loc:{start:{line:41,column:66},end:{line:41,column:78}}}):a))+`.
|
|
164
193
|
*/
|
|
165
|
-
export function create`+u((
|
|
194
|
+
export function create`+u((a=(a=r(i,"typeName")||(n!=null?r(n,"typeName"):n))!=null?a:s,typeof a===o?a.call(e,{name:"typeName",hash:{},data:t,loc:{start:{line:43,column:22},end:{line:43,column:34}}}):a))+"("+u((r(i,"startLow")||n&&r(n,"startLow")||s).call(e,n!=null?r(n,"typeName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:43,column:35},end:{line:43,column:56}}}))+`){
|
|
166
195
|
return {
|
|
167
|
-
schema: '`+u((
|
|
168
|
-
data: `+u((
|
|
196
|
+
schema: '`+u((a=(a=r(i,"igluUrl")||(n!=null?r(n,"igluUrl"):n))!=null?a:s,typeof a===o?a.call(e,{name:"igluUrl",hash:{},data:t,loc:{start:{line:45,column:13},end:{line:45,column:24}}}):a))+`',
|
|
197
|
+
data: `+u((r(i,"startLow")||n&&r(n,"startLow")||s).call(e,n!=null?r(n,"typeName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:46,column:10},end:{line:46,column:31}}}))+`
|
|
169
198
|
}
|
|
170
199
|
}
|
|
171
|
-
`},5:function(l,n,i,
|
|
172
|
-
* Tracks a `+o(s(n!=null?
|
|
173
|
-
* `+o((
|
|
200
|
+
`},5:function(l,n,i,m,t){var a,e=n??(l.nullContext||{}),s=l.lambda,o=l.escapeExpression,u=l.hooks.helperMissing,r=l.lookupProperty||function(c,f){if(Object.prototype.hasOwnProperty.call(c,f))return c[f]};return((a=r(i,"if").call(e,n!=null?r(n,"entities"):n,{name:"if",hash:{},fn:l.program(6,t,0),inverse:l.noop,data:t,loc:{start:{line:52,column:0},end:{line:59,column:7}}}))!=null?a:"")+`/**
|
|
201
|
+
* Tracks a `+o(s(n!=null?r(n,"name"):n,n))+` event specification.
|
|
202
|
+
* `+o((r(i,"addEventSpecificationIdentifier")||n&&r(n,"addEventSpecificationIdentifier")||u).call(e,n!=null?r(n,"id"):n,{name:"addEventSpecificationIdentifier",hash:{},data:t,loc:{start:{line:62,column:3},end:{line:62,column:46}}}))+`
|
|
174
203
|
* @param {Tracker} tracker - Tracker to send the tracking event specification to.
|
|
175
|
-
* @param { `+o(s(n!=null?
|
|
204
|
+
* @param { `+o(s(n!=null?r(n,"event"):n,n))+" & Timestamp"+((a=r(i,"if").call(e,n!=null?r(n,"entities"):n,{name:"if",hash:{},fn:l.program(9,t,0),inverse:l.noop,data:t,loc:{start:{line:64,column:38},end:{line:64,column:91}}}))!=null?a:"")+" } "+o((r(i,"startLow")||n&&r(n,"startLow")||u).call(e,n!=null?r(n,"name"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:64,column:94},end:{line:64,column:116}}}))+" - Attributes for "+o(s(n!=null?r(n,"name"):n,n))+` event specification.
|
|
176
205
|
*/
|
|
177
|
-
export function track`+o(s(n!=null?
|
|
178
|
-
const eventSpecificationContext = createEventSpecification({ id: '`+o(s(n!=null?
|
|
206
|
+
export function track`+o(s(n!=null?r(n,"name"):n,n))+"(tracker, "+o((r(i,"startLow")||n&&r(n,"startLow")||u).call(e,n!=null?r(n,"name"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:66,column:44},end:{line:66,column:66}}}))+`){
|
|
207
|
+
const eventSpecificationContext = createEventSpecification({ id: '`+o(s(n!=null?r(n,"id"):n,n))+`' });
|
|
179
208
|
|
|
180
|
-
const context = Array.isArray(`+o((
|
|
181
|
-
? [...`+o((
|
|
209
|
+
const context = Array.isArray(`+o((r(i,"startLow")||n&&r(n,"startLow")||u).call(e,n!=null?r(n,"name"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:69,column:31},end:{line:69,column:53}}}))+`.context)
|
|
210
|
+
? [...`+o((r(i,"startLow")||n&&r(n,"startLow")||u).call(e,n!=null?r(n,"name"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:70,column:10},end:{line:70,column:32}}}))+`.context, eventSpecificationContext]
|
|
182
211
|
: [eventSpecificationContext];
|
|
183
212
|
|
|
184
|
-
const modified`+o(s(n!=null?
|
|
185
|
-
...`+o((
|
|
213
|
+
const modified`+o(s(n!=null?r(n,"name"):n,n))+` = {
|
|
214
|
+
...`+o((r(i,"startLow")||n&&r(n,"startLow")||u).call(e,n!=null?r(n,"name"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:74,column:7},end:{line:74,column:29}}}))+`,
|
|
186
215
|
context,
|
|
187
216
|
};
|
|
188
217
|
|
|
189
|
-
track`+o(s(n!=null?
|
|
218
|
+
track`+o(s(n!=null?r(n,"event"):n,n))+"(tracker, modified"+o(s(n!=null?r(n,"name"):n,n))+`);
|
|
190
219
|
}
|
|
191
|
-
`},6:function(l,n,i,
|
|
192
|
-
* Typedef for `+s(
|
|
193
|
-
* @typedef {object} `+s(
|
|
194
|
-
* @property {(`+((
|
|
220
|
+
`},6:function(l,n,i,m,t){var a,e=l.lambda,s=l.escapeExpression,o=l.lookupProperty||function(u,r){if(Object.prototype.hasOwnProperty.call(u,r))return u[r]};return`/**
|
|
221
|
+
* Typedef for `+s(e(n!=null?o(n,"name"):n,n))+` event specification contexts.
|
|
222
|
+
* @typedef {object} `+s(e(n!=null?o(n,"event"):n,n))+`Contexts
|
|
223
|
+
* @property {(`+((a=o(i,"join").call(n??(l.nullContext||{}),n!=null?o(n,"entities"):n," | ","Context",{name:"join",hash:{},fn:l.program(7,t,0),inverse:l.noop,data:t,loc:{start:{line:56,column:15},end:{line:56,column:63}}}))!=null?a:"")+")[]} [context] Contexts to include in the "+s(e(n!=null?o(n,"name"):n,n))+` event specification.
|
|
195
224
|
*/
|
|
196
225
|
|
|
197
|
-
`},7:function(l,n,i,
|
|
226
|
+
`},7:function(l,n,i,m,t){return""},9:function(l,n,i,m,t){var a=l.lookupProperty||function(e,s){if(Object.prototype.hasOwnProperty.call(e,s))return e[s]};return" & "+l.escapeExpression(l.lambda(n!=null?a(n,"event"):n,n))+"Contexts"},compiler:[8,">= 4.3.0"],main:function(l,n,i,m,t){var a,e,s,o=n??(l.nullContext||{}),u=l.lookupProperty||function(c,f){if(Object.prototype.hasOwnProperty.call(c,f))return c[f]},r=`import { buildSelfDescribingEvent } from '@snowplow/node-tracker';
|
|
198
227
|
|
|
199
|
-
`+((
|
|
228
|
+
`+((a=u(i,"if").call(o,(a=n!=null?u(n,"eventSpecifications"):n)!=null?u(a,"length"):a,{name:"if",hash:{},fn:l.program(1,t,0),inverse:l.noop,data:t,loc:{start:{line:3,column:0},end:{line:14,column:7}}}))!=null?a:"")+`
|
|
200
229
|
/**
|
|
201
230
|
* Typedef for a Node.js tracker object.
|
|
202
231
|
* @typedef {object} Tracker
|
|
203
232
|
*/
|
|
204
233
|
|
|
205
|
-
`;return
|
|
206
|
-
`+((
|
|
234
|
+
`;return a=(e=(e=u(i,"type")||(n!=null?u(n,"type"):n))!=null?e:l.hooks.helperMissing,s={name:"type",hash:{},fn:l.program(3,t,0),inverse:l.noop,data:t,loc:{start:{line:21,column:0},end:{line:49,column:9}}},typeof e=="function"?e.call(o,s):e),u(i,"type")||(a=l.hooks.blockHelperMissing.call(n,a,s)),a!=null&&(r+=a),r+`
|
|
235
|
+
`+((a=u(i,"each").call(o,n!=null?u(n,"eventSpecifications"):n,{name:"each",hash:{},fn:l.program(5,t,0),inverse:l.noop,data:t,loc:{start:{line:51,column:0},end:{line:80,column:9}}}))!=null?a:"")},useData:!0}});var In=O((Oe,Dn)=>{"use strict";Dn.exports={id:{language:"typescript",tracker:"@snowplow/browser-tracker"},1:function(l,n,i,m,t){return", SelfDescribingJson"},3:function(l,n,i,m,t){var a,e=n??(l.nullContext||{}),s=l.lookupProperty||function(o,u){if(Object.prototype.hasOwnProperty.call(o,u))return o[u]};return`import Ajv, { ErrorObject } from "ajv-draft-04";
|
|
236
|
+
import addFormats from "ajv-formats";
|
|
237
|
+
import { schemasObject } from "./validations";
|
|
238
|
+
`+((a=s(i,"unless").call(e,(s(i,"or")||n&&s(n,"or")||l.hooks.helperMissing).call(e,(a=n!=null?s(n,"eventSpecifications"):n)!=null?s(a,"length"):a,(a=n!=null?s(n,"ecomEventSpecifications"):n)!=null?s(a,"length"):a,{name:"or",hash:{},data:t,loc:{start:{line:6,column:10},end:{line:6,column:72}}}),{name:"unless",hash:{},fn:l.program(4,t,0),inverse:l.noop,data:t,loc:{start:{line:6,column:0},end:{line:8,column:11}}}))!=null?a:"")},4:function(l,n,i,m,t){return`import { SelfDescribingJson } from "@snowplow/browser-tracker";
|
|
239
|
+
`},6:function(l,n,i,m,t){return'import * as Ecom from "@snowplow/browser-plugin-snowplow-ecommerce";'},8:function(l,n,i,m,t){return`/**
|
|
207
240
|
* Creates a Snowplow Event Specification entity.
|
|
208
241
|
*/
|
|
209
242
|
export function createEventSpecification(eventSpecification: EventSpecification){
|
|
@@ -220,72 +253,102 @@ export function createEventSpecification(eventSpecification: EventSpecification)
|
|
|
220
253
|
interface EventSpecification {
|
|
221
254
|
id: string;
|
|
222
255
|
}
|
|
223
|
-
`},
|
|
224
|
-
|
|
225
|
-
|
|
256
|
+
`},10:function(l,n,i,m,t){return`const ajv = new Ajv({ allErrors: true, verbose: true, strict: false });
|
|
257
|
+
addFormats(ajv);
|
|
258
|
+
|
|
259
|
+
type ViolationHandler = (violations: ErrorObject<string, Record<string, any>, unknown>[]) => void
|
|
260
|
+
|
|
261
|
+
const defaultValidationErrorHandler: ViolationHandler = (
|
|
262
|
+
violations
|
|
263
|
+
) => {
|
|
264
|
+
const msg = JSON.stringify(
|
|
265
|
+
{
|
|
266
|
+
type: 'Snowtype Schema Validation Error',
|
|
267
|
+
description: 'There was passing of values that does not match the JSON Schema definition.',
|
|
268
|
+
errors: violations,
|
|
269
|
+
},
|
|
270
|
+
undefined,
|
|
271
|
+
4
|
|
272
|
+
);
|
|
273
|
+
|
|
274
|
+
console.warn(msg);
|
|
275
|
+
};
|
|
276
|
+
|
|
277
|
+
function validateSchema(sdj: SelfDescribingJson) {
|
|
278
|
+
const valid = ajv.validate(schemasObject[sdj.schema], sdj.data);
|
|
279
|
+
if (!valid && ajv.errors?.length) {
|
|
280
|
+
defaultValidationErrorHandler(ajv.errors)
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
`},12:function(l,n,i,m,t){var a,e,s=n??(l.nullContext||{}),o=l.hooks.helperMissing,u="function",r=l.escapeExpression,c=l.lookupProperty||function(f,y){if(Object.prototype.hasOwnProperty.call(f,y))return f[y]};return`/**
|
|
284
|
+
* Track a Snowplow event for `+r((e=(e=c(i,"typeName")||(n!=null?c(n,"typeName"):n))!=null?e:o,typeof e===u?e.call(s,{name:"typeName",hash:{},data:t,loc:{start:{line:63,column:30},end:{line:63,column:42}}}):e))+`.
|
|
285
|
+
* `+r((e=(e=c(i,"description")||(n!=null?c(n,"description"):n))!=null?e:o,typeof e===u?e.call(s,{name:"description",hash:{},data:t,loc:{start:{line:64,column:3},end:{line:64,column:18}}}):e))+`
|
|
226
286
|
*/
|
|
227
|
-
export function track`+
|
|
228
|
-
const { context, timestamp, ...data } = `+
|
|
287
|
+
export function track`+r((e=(e=c(i,"functionName")||(n!=null?c(n,"functionName"):n))!=null?e:o,typeof e===u?e.call(s,{name:"functionName",hash:{},data:t,loc:{start:{line:66,column:21},end:{line:66,column:37}}}):e))+"<T extends {} = any>("+r((c(i,"startLow")||n&&c(n,"startLow")||o).call(s,n!=null?c(n,"typeName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:66,column:58},end:{line:66,column:79}}}))+": "+r((e=(e=c(i,"typeName")||(n!=null?c(n,"typeName"):n))!=null?e:o,typeof e===u?e.call(s,{name:"typeName",hash:{},data:t,loc:{start:{line:66,column:81},end:{line:66,column:93}}}):e))+` & CommonEventProperties<T>, trackers?: string[]){
|
|
288
|
+
const { context, timestamp, ...data } = `+r((c(i,"startLow")||n&&c(n,"startLow")||o).call(s,n!=null?c(n,"typeName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:67,column:42},end:{line:67,column:63}}}))+`;
|
|
289
|
+
const event: SelfDescribingJson = {
|
|
290
|
+
schema: '`+r((e=(e=c(i,"igluUrl")||(n!=null?c(n,"igluUrl"):n))!=null?e:o,typeof e===u?e.call(s,{name:"igluUrl",hash:{},data:t,loc:{start:{line:69,column:13},end:{line:69,column:24}}}):e))+`',
|
|
291
|
+
data
|
|
292
|
+
};
|
|
293
|
+
`+((a=c(i,"if").call(s,n!=null?c(n,"validations"):n,{name:"if",hash:{},fn:l.program(13,t,0),inverse:l.noop,data:t,loc:{start:{line:72,column:2},end:{line:72,column:90}}}))!=null?a:"")+`
|
|
229
294
|
trackSelfDescribingEvent({
|
|
230
|
-
event
|
|
231
|
-
schema: '`+u((e=(e=t(i,"igluUrl")||(n!=null?t(n,"igluUrl"):n))!=null?e:s,typeof e===o?e.call(a,{name:"igluUrl",hash:{},data:r,loc:{start:{line:32,column:15},end:{line:32,column:26}}}):e))+`',
|
|
232
|
-
data
|
|
233
|
-
},
|
|
295
|
+
event,
|
|
234
296
|
context,
|
|
235
297
|
timestamp,
|
|
236
298
|
}, trackers);
|
|
237
299
|
}
|
|
238
300
|
|
|
239
301
|
/**
|
|
240
|
-
* Creates a Snowplow `+
|
|
302
|
+
* Creates a Snowplow `+r((e=(e=c(i,"typeName")||(n!=null?c(n,"typeName"):n))!=null?e:o,typeof e===u?e.call(s,{name:"typeName",hash:{},data:t,loc:{start:{line:81,column:22},end:{line:81,column:34}}}):e))+` entity.
|
|
241
303
|
*/
|
|
242
|
-
export function create`+
|
|
304
|
+
export function create`+r((e=(e=c(i,"typeName")||(n!=null?c(n,"typeName"):n))!=null?e:o,typeof e===u?e.call(s,{name:"typeName",hash:{},data:t,loc:{start:{line:83,column:22},end:{line:83,column:34}}}):e))+"("+r((c(i,"startLow")||n&&c(n,"startLow")||o).call(s,n!=null?c(n,"typeName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:83,column:35},end:{line:83,column:56}}}))+": "+r((e=(e=c(i,"typeName")||(n!=null?c(n,"typeName"):n))!=null?e:o,typeof e===u?e.call(s,{name:"typeName",hash:{},data:t,loc:{start:{line:83,column:58},end:{line:83,column:70}}}):e))+`){
|
|
243
305
|
return {
|
|
244
|
-
schema: '`+
|
|
245
|
-
data: `+
|
|
306
|
+
schema: '`+r((e=(e=c(i,"igluUrl")||(n!=null?c(n,"igluUrl"):n))!=null?e:o,typeof e===u?e.call(s,{name:"igluUrl",hash:{},data:t,loc:{start:{line:85,column:13},end:{line:85,column:24}}}):e))+`',
|
|
307
|
+
data: `+r((c(i,"startLow")||n&&c(n,"startLow")||o).call(s,n!=null?c(n,"typeName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:86,column:10},end:{line:86,column:31}}}))+`
|
|
246
308
|
}
|
|
247
309
|
}
|
|
248
|
-
`},
|
|
249
|
-
* Tracks a `+s(
|
|
250
|
-
* `+s((
|
|
310
|
+
`},13:function(l,n,i,m,t){return"[event].concat(context || []).forEach(s => validateSchema(s));"},15:function(l,n,i,m,t){var a,e=l.lambda,s=l.escapeExpression,o=n??(l.nullContext||{}),u=l.hooks.helperMissing,r=l.lookupProperty||function(c,f){if(Object.prototype.hasOwnProperty.call(c,f))return c[f]};return`/**
|
|
311
|
+
* Tracks a `+s(e(n!=null?r(n,"name"):n,n))+` event specification.
|
|
312
|
+
* `+s((r(i,"addEventSpecificationIdentifier")||n&&r(n,"addEventSpecificationIdentifier")||u).call(o,n!=null?r(n,"id"):n,{name:"addEventSpecificationIdentifier",hash:{},data:t,loc:{start:{line:94,column:3},end:{line:94,column:46}}}))+`
|
|
251
313
|
*/
|
|
252
|
-
export function track`+s(
|
|
253
|
-
const eventSpecificationContext: SelfDescribingJson<EventSpecification> = createEventSpecification({ id: '`+s(
|
|
314
|
+
export function track`+s(e(n!=null?r(n,"name"):n,n))+"("+s((r(i,"startLow")||n&&r(n,"startLow")||u).call(o,n!=null?r(n,"name"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:96,column:35},end:{line:96,column:57}}}))+": "+s(e(n!=null?r(n,"event"):n,n))+" & CommonEventProperties"+((a=r(i,"if").call(o,n!=null?r(n,"entities"):n,{name:"if",hash:{},fn:l.program(16,t,0),inverse:l.noop,data:t,loc:{start:{line:96,column:97},end:{line:96,column:165}}}))!=null?a:"")+`, trackers?: string[]){
|
|
315
|
+
const eventSpecificationContext: SelfDescribingJson<EventSpecification> = createEventSpecification({ id: '`+s(e(n!=null?r(n,"id"):n,n))+`' });
|
|
254
316
|
|
|
255
|
-
const context = Array.isArray(`+s((
|
|
256
|
-
? [...`+s((
|
|
317
|
+
const context = Array.isArray(`+s((r(i,"startLow")||n&&r(n,"startLow")||u).call(o,n!=null?r(n,"name"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:99,column:32},end:{line:99,column:54}}}))+`.context)
|
|
318
|
+
? [...`+s((r(i,"startLow")||n&&r(n,"startLow")||u).call(o,n!=null?r(n,"name"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:100,column:10},end:{line:100,column:32}}}))+`.context, eventSpecificationContext]
|
|
257
319
|
: [eventSpecificationContext];
|
|
258
320
|
|
|
259
|
-
const modified`+s(
|
|
260
|
-
...`+s((
|
|
321
|
+
const modified`+s(e(n!=null?r(n,"name"):n,n))+` = {
|
|
322
|
+
...`+s((r(i,"startLow")||n&&r(n,"startLow")||u).call(o,n!=null?r(n,"name"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:104,column:7},end:{line:104,column:29}}}))+`,
|
|
261
323
|
context,
|
|
262
324
|
};
|
|
263
325
|
|
|
264
|
-
track`+s(
|
|
326
|
+
track`+s(e(n!=null?r(n,"event"):n,n))+"<"+((a=r(i,"if").call(o,n!=null?r(n,"entities"):n,{name:"if",hash:{},fn:l.program(19,t,0),inverse:l.program(21,t,0),data:t,loc:{start:{line:108,column:22},end:{line:108,column:119}}}))!=null?a:"")+" | EventSpecification>(modified"+s(e(n!=null?r(n,"name"):n,n))+`, trackers);
|
|
265
327
|
}
|
|
266
|
-
`},
|
|
267
|
-
* Tracks a `+s(
|
|
268
|
-
* `+s((
|
|
328
|
+
`},16:function(l,n,i,m,t){var a,e=l.lookupProperty||function(s,o){if(Object.prototype.hasOwnProperty.call(s,o))return s[o]};return"<"+((a=e(i,"join").call(n??(l.nullContext||{}),n!=null?e(n,"entities"):n," | ",{name:"join",hash:{},fn:l.program(17,t,0),inverse:l.noop,data:t,loc:{start:{line:96,column:119},end:{line:96,column:157}}}))!=null?a:"")+">"},17:function(l,n,i,m,t){return""},19:function(l,n,i,m,t){var a,e=l.lookupProperty||function(s,o){if(Object.prototype.hasOwnProperty.call(s,o))return s[o]};return(a=e(i,"join").call(n??(l.nullContext||{}),n!=null?e(n,"entities"):n," | ",{name:"join",hash:{},fn:l.program(17,t,0),inverse:l.noop,data:t,loc:{start:{line:108,column:43},end:{line:108,column:81}}}))!=null?a:""},21:function(l,n,i,m,t){return"Record<string, unknown>"},23:function(l,n,i,m,t){var a,e=l.lambda,s=l.escapeExpression,o=n??(l.nullContext||{}),u=l.hooks.helperMissing,r=l.lookupProperty||function(c,f){if(Object.prototype.hasOwnProperty.call(c,f))return c[f]};return`/**
|
|
329
|
+
* Tracks a `+s(e(n!=null?r(n,"name"):n,n))+` event specification.
|
|
330
|
+
* `+s((r(i,"addEventSpecificationIdentifier")||n&&r(n,"addEventSpecificationIdentifier")||u).call(o,n!=null?r(n,"id"):n,{name:"addEventSpecificationIdentifier",hash:{},data:t,loc:{start:{line:114,column:3},end:{line:114,column:46}}}))+`
|
|
269
331
|
*/
|
|
270
|
-
export function track`+s(
|
|
271
|
-
const eventSpecificationContext: SelfDescribingJson<EventSpecification> = createEventSpecification({ id: '`+s(
|
|
332
|
+
export function track`+s(e(n!=null?r(n,"name"):n,n))+"("+s((r(i,"startLow")||n&&r(n,"startLow")||u).call(o,n!=null?r(n,"name"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:116,column:35},end:{line:116,column:57}}}))+": "+s((r(i,"ecomFunctionArgument")||n&&r(n,"ecomFunctionArgument")||u).call(o,n!=null?r(n,"event"):n,{name:"ecomFunctionArgument",hash:{},data:t,loc:{start:{line:116,column:59},end:{line:116,column:94}}}))+" & Ecom.CommonEcommerceEventProperties"+((a=r(i,"if").call(o,n!=null?r(n,"entities"):n,{name:"if",hash:{},fn:l.program(16,t,0),inverse:l.noop,data:t,loc:{start:{line:116,column:132},end:{line:116,column:200}}}))!=null?a:"")+`, trackers?: string[]){
|
|
333
|
+
const eventSpecificationContext: SelfDescribingJson<EventSpecification> = createEventSpecification({ id: '`+s(e(n!=null?r(n,"id"):n,n))+`' });
|
|
272
334
|
|
|
273
|
-
const context = Array.isArray(`+s((
|
|
274
|
-
? [...`+s((
|
|
335
|
+
const context = Array.isArray(`+s((r(i,"startLow")||n&&r(n,"startLow")||u).call(o,n!=null?r(n,"name"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:119,column:32},end:{line:119,column:54}}}))+`.context)
|
|
336
|
+
? [...`+s((r(i,"startLow")||n&&r(n,"startLow")||u).call(o,n!=null?r(n,"name"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:120,column:10},end:{line:120,column:32}}}))+`.context, eventSpecificationContext]
|
|
275
337
|
: [eventSpecificationContext];
|
|
276
338
|
|
|
277
|
-
const modified`+s(
|
|
278
|
-
...`+s((
|
|
339
|
+
const modified`+s(e(n!=null?r(n,"name"):n,n))+` = {
|
|
340
|
+
...`+s((r(i,"startLow")||n&&r(n,"startLow")||u).call(o,n!=null?r(n,"name"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:124,column:7},end:{line:124,column:29}}}))+`,
|
|
279
341
|
context: context as unknown as SelfDescribingJson<Record<string, unknown>>[],
|
|
280
342
|
};
|
|
281
343
|
|
|
282
|
-
`+s((
|
|
283
|
-
}
|
|
284
|
-
`},compiler:[8,">= 4.3.0"],main:function(l,n,i,
|
|
285
|
-
`+((
|
|
286
|
-
`+((
|
|
287
|
-
|
|
288
|
-
|
|
344
|
+
`+s((r(i,"ecomFunction")||n&&r(n,"ecomFunction")||u).call(o,n!=null?r(n,"event"):n,{name:"ecomFunction",hash:{},data:t,loc:{start:{line:128,column:2},end:{line:128,column:29}}}))+"(modified"+s(e(n!=null?r(n,"name"):n,n))+`, trackers);
|
|
345
|
+
}
|
|
346
|
+
`},compiler:[8,">= 4.3.0"],main:function(l,n,i,m,t){var a,e,s,o=n??(l.nullContext||{}),u=l.hooks.helperMissing,r=l.lookupProperty||function(f,y){if(Object.prototype.hasOwnProperty.call(f,y))return f[y]},c="import { trackSelfDescribingEvent, CommonEventProperties"+((a=r(i,"if").call(o,(r(i,"or")||n&&r(n,"or")||u).call(o,(a=n!=null?r(n,"eventSpecifications"):n)!=null?r(a,"length"):a,(a=n!=null?r(n,"ecomEventSpecifications"):n)!=null?r(a,"length"):a,{name:"or",hash:{},data:t,loc:{start:{line:1,column:62},end:{line:1,column:124}}}),{name:"if",hash:{},fn:l.program(1,t,0),inverse:l.noop,data:t,loc:{start:{line:1,column:56},end:{line:1,column:153}}}))!=null?a:"")+` } from '@snowplow/browser-tracker';
|
|
347
|
+
`+((a=r(i,"if").call(o,n!=null?r(n,"validations"):n,{name:"if",hash:{},fn:l.program(3,t,0),inverse:l.noop,data:t,loc:{start:{line:2,column:0},end:{line:9,column:7}}}))!=null?a:"")+((a=r(i,"if").call(o,(a=n!=null?r(n,"ecomEventSpecifications"):n)!=null?r(a,"length"):a,{name:"if",hash:{},fn:l.program(6,t,0),inverse:l.noop,data:t,loc:{start:{line:10,column:0},end:{line:10,column:113}}}))!=null?a:"")+`
|
|
348
|
+
`+((a=r(i,"if").call(o,(r(i,"or")||n&&r(n,"or")||u).call(o,(a=n!=null?r(n,"eventSpecifications"):n)!=null?r(a,"length"):a,(a=n!=null?r(n,"ecomEventSpecifications"):n)!=null?r(a,"length"):a,{name:"or",hash:{},data:t,loc:{start:{line:11,column:6},end:{line:11,column:68}}}),{name:"if",hash:{},fn:l.program(8,t,0),inverse:l.noop,data:t,loc:{start:{line:11,column:0},end:{line:29,column:7}}}))!=null?a:"")+`
|
|
349
|
+
`+((a=r(i,"if").call(o,n!=null?r(n,"validations"):n,{name:"if",hash:{},fn:l.program(10,t,0),inverse:l.noop,data:t,loc:{start:{line:31,column:0},end:{line:59,column:7}}}))!=null?a:"")+`
|
|
350
|
+
`;return a=(e=(e=r(i,"type")||(n!=null?r(n,"type"):n))!=null?e:u,s={name:"type",hash:{},fn:l.program(12,t,0),inverse:l.noop,data:t,loc:{start:{line:61,column:0},end:{line:89,column:9}}},typeof e=="function"?e.call(o,s):e),r(i,"type")||(a=l.hooks.blockHelperMissing.call(n,a,s)),a!=null&&(c+=a),c+`
|
|
351
|
+
`+((a=r(i,"each").call(o,n!=null?r(n,"eventSpecifications"):n,{name:"each",hash:{},fn:l.program(15,t,0),inverse:l.noop,data:t,loc:{start:{line:91,column:0},end:{line:110,column:9}}}))!=null?a:"")+((a=r(i,"each").call(o,n!=null?r(n,"ecomEventSpecifications"):n,{name:"each",hash:{},fn:l.program(23,t,0),inverse:l.noop,data:t,loc:{start:{line:111,column:0},end:{line:130,column:9}}}))!=null?a:"")},useData:!0}});var Fn=O((Ee,Rn)=>{"use strict";Rn.exports={id:{language:"typescript",tracker:"@snowplow/node-tracker"},1:function(l,n,i,m,t){return`/**
|
|
289
352
|
* Creates a Snowplow Event Specification entity.
|
|
290
353
|
*/
|
|
291
354
|
export function createEventSpecification(eventSpecification: EventSpecification){
|
|
@@ -302,48 +365,48 @@ export function createEventSpecification(eventSpecification: EventSpecification)
|
|
|
302
365
|
interface EventSpecification {
|
|
303
366
|
id: string;
|
|
304
367
|
}
|
|
305
|
-
`},3:function(l,n,i,
|
|
306
|
-
* Track a Snowplow event for `+u((
|
|
307
|
-
* `+u((
|
|
368
|
+
`},3:function(l,n,i,m,t){var a,e=n??(l.nullContext||{}),s=l.hooks.helperMissing,o="function",u=l.escapeExpression,r=l.lookupProperty||function(c,f){if(Object.prototype.hasOwnProperty.call(c,f))return c[f]};return`/**
|
|
369
|
+
* Track a Snowplow event for `+u((a=(a=r(i,"typeName")||(n!=null?r(n,"typeName"):n))!=null?a:s,typeof a===o?a.call(e,{name:"typeName",hash:{},data:t,loc:{start:{line:32,column:30},end:{line:32,column:42}}}):a))+`.
|
|
370
|
+
* `+u((a=(a=r(i,"description")||(n!=null?r(n,"description"):n))!=null?a:s,typeof a===o?a.call(e,{name:"description",hash:{},data:t,loc:{start:{line:33,column:3},end:{line:33,column:18}}}):a))+`
|
|
308
371
|
*/
|
|
309
|
-
export function track`+u((
|
|
310
|
-
const { context, timestamp, ...data } = `+u((
|
|
372
|
+
export function track`+u((a=(a=r(i,"functionName")||(n!=null?r(n,"functionName"):n))!=null?a:s,typeof a===o?a.call(e,{name:"functionName",hash:{},data:t,loc:{start:{line:35,column:21},end:{line:35,column:37}}}):a))+"<T extends {} = any>(tracker: Tracker, "+u((r(i,"startLow")||n&&r(n,"startLow")||s).call(e,n!=null?r(n,"typeName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:35,column:76},end:{line:35,column:97}}}))+": "+u((a=(a=r(i,"typeName")||(n!=null?r(n,"typeName"):n))!=null?a:s,typeof a===o?a.call(e,{name:"typeName",hash:{},data:t,loc:{start:{line:35,column:99},end:{line:35,column:111}}}):a))+` & CommonEventProperties<T>){
|
|
373
|
+
const { context, timestamp, ...data } = `+u((r(i,"startLow")||n&&r(n,"startLow")||s).call(e,n!=null?r(n,"typeName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:36,column:42},end:{line:36,column:63}}}))+`;
|
|
311
374
|
tracker.track(buildSelfDescribingEvent({
|
|
312
375
|
event: {
|
|
313
|
-
schema: '`+u((
|
|
376
|
+
schema: '`+u((a=(a=r(i,"igluUrl")||(n!=null?r(n,"igluUrl"):n))!=null?a:s,typeof a===o?a.call(e,{name:"igluUrl",hash:{},data:t,loc:{start:{line:39,column:15},end:{line:39,column:26}}}):a))+`',
|
|
314
377
|
data
|
|
315
378
|
}
|
|
316
379
|
}), context, timestamp);
|
|
317
380
|
}
|
|
318
381
|
|
|
319
382
|
/**
|
|
320
|
-
* Creates a Snowplow `+u((
|
|
383
|
+
* Creates a Snowplow `+u((a=(a=r(i,"typeName")||(n!=null?r(n,"typeName"):n))!=null?a:s,typeof a===o?a.call(e,{name:"typeName",hash:{},data:t,loc:{start:{line:46,column:22},end:{line:46,column:34}}}):a))+` entity.
|
|
321
384
|
*/
|
|
322
|
-
export function create`+u((
|
|
385
|
+
export function create`+u((a=(a=r(i,"typeName")||(n!=null?r(n,"typeName"):n))!=null?a:s,typeof a===o?a.call(e,{name:"typeName",hash:{},data:t,loc:{start:{line:48,column:22},end:{line:48,column:34}}}):a))+"("+u((r(i,"startLow")||n&&r(n,"startLow")||s).call(e,n!=null?r(n,"typeName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:48,column:35},end:{line:48,column:56}}}))+": "+u((a=(a=r(i,"typeName")||(n!=null?r(n,"typeName"):n))!=null?a:s,typeof a===o?a.call(e,{name:"typeName",hash:{},data:t,loc:{start:{line:48,column:58},end:{line:48,column:70}}}):a))+`){
|
|
323
386
|
return {
|
|
324
|
-
schema: '`+u((
|
|
325
|
-
data: `+u((
|
|
387
|
+
schema: '`+u((a=(a=r(i,"igluUrl")||(n!=null?r(n,"igluUrl"):n))!=null?a:s,typeof a===o?a.call(e,{name:"igluUrl",hash:{},data:t,loc:{start:{line:50,column:13},end:{line:50,column:24}}}):a))+`',
|
|
388
|
+
data: `+u((r(i,"startLow")||n&&r(n,"startLow")||s).call(e,n!=null?r(n,"typeName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:51,column:10},end:{line:51,column:31}}}))+`
|
|
326
389
|
}
|
|
327
390
|
}
|
|
328
|
-
`},5:function(l,n,i,
|
|
329
|
-
* Tracks a `+s(
|
|
330
|
-
* `+s((
|
|
391
|
+
`},5:function(l,n,i,m,t){var a,e=l.lambda,s=l.escapeExpression,o=n??(l.nullContext||{}),u=l.hooks.helperMissing,r=l.lookupProperty||function(c,f){if(Object.prototype.hasOwnProperty.call(c,f))return c[f]};return`/**
|
|
392
|
+
* Tracks a `+s(e(n!=null?r(n,"name"):n,n))+` event specification.
|
|
393
|
+
* `+s((r(i,"addEventSpecificationIdentifier")||n&&r(n,"addEventSpecificationIdentifier")||u).call(o,n!=null?r(n,"id"):n,{name:"addEventSpecificationIdentifier",hash:{},data:t,loc:{start:{line:59,column:3},end:{line:59,column:46}}}))+`
|
|
331
394
|
*/
|
|
332
|
-
export function track`+s(
|
|
333
|
-
const eventSpecificationContext: SelfDescribingJson<EventSpecification> = createEventSpecification({ id: '`+s(
|
|
395
|
+
export function track`+s(e(n!=null?r(n,"name"):n,n))+"(tracker: Tracker, "+s((r(i,"startLow")||n&&r(n,"startLow")||u).call(o,n!=null?r(n,"name"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:61,column:53},end:{line:61,column:75}}}))+": "+s(e(n!=null?r(n,"event"):n,n))+" & CommonEventProperties"+((a=r(i,"if").call(o,n!=null?r(n,"entities"):n,{name:"if",hash:{},fn:l.program(6,t,0),inverse:l.noop,data:t,loc:{start:{line:61,column:115},end:{line:61,column:183}}}))!=null?a:"")+`){
|
|
396
|
+
const eventSpecificationContext: SelfDescribingJson<EventSpecification> = createEventSpecification({ id: '`+s(e(n!=null?r(n,"id"):n,n))+`' });
|
|
334
397
|
|
|
335
|
-
const context = Array.isArray(`+s((
|
|
336
|
-
? [...`+s((
|
|
398
|
+
const context = Array.isArray(`+s((r(i,"startLow")||n&&r(n,"startLow")||u).call(o,n!=null?r(n,"name"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:64,column:32},end:{line:64,column:54}}}))+`.context)
|
|
399
|
+
? [...`+s((r(i,"startLow")||n&&r(n,"startLow")||u).call(o,n!=null?r(n,"name"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:65,column:10},end:{line:65,column:32}}}))+`.context, eventSpecificationContext]
|
|
337
400
|
: [eventSpecificationContext];
|
|
338
401
|
|
|
339
|
-
const modified`+s(
|
|
340
|
-
...`+s((
|
|
341
|
-
context: context as unknown as SelfDescribingJson`+((
|
|
402
|
+
const modified`+s(e(n!=null?r(n,"name"):n,n))+` = {
|
|
403
|
+
...`+s((r(i,"startLow")||n&&r(n,"startLow")||u).call(o,n!=null?r(n,"name"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:69,column:7},end:{line:69,column:29}}}))+`,
|
|
404
|
+
context: context as unknown as SelfDescribingJson`+((a=r(i,"if").call(o,n!=null?r(n,"entities"):n,{name:"if",hash:{},fn:l.program(9,t,0),inverse:l.noop,data:t,loc:{start:{line:70,column:53},end:{line:70,column:122}}}))!=null?a:"")+`[],
|
|
342
405
|
};
|
|
343
406
|
|
|
344
|
-
track`+s(
|
|
407
|
+
track`+s(e(n!=null?r(n,"event"):n,n))+((a=r(i,"if").call(o,n!=null?r(n,"entities"):n,{name:"if",hash:{},fn:l.program(9,t,0),inverse:l.noop,data:t,loc:{start:{line:73,column:21},end:{line:73,column:90}}}))!=null?a:"")+"(tracker, modified"+s(e(n!=null?r(n,"name"):n,n))+`);
|
|
345
408
|
}
|
|
346
|
-
`},6:function(l,n,i,
|
|
409
|
+
`},6:function(l,n,i,m,t){var a,e=l.lookupProperty||function(s,o){if(Object.prototype.hasOwnProperty.call(s,o))return s[o]};return"<"+((a=e(i,"join").call(n??(l.nullContext||{}),n!=null?e(n,"entities"):n," | ",{name:"join",hash:{},fn:l.program(7,t,0),inverse:l.noop,data:t,loc:{start:{line:61,column:137},end:{line:61,column:175}}}))!=null?a:"")+">"},7:function(l,n,i,m,t){return""},9:function(l,n,i,m,t){var a,e=l.lookupProperty||function(s,o){if(Object.prototype.hasOwnProperty.call(s,o))return s[o]};return"<"+((a=e(i,"join").call(n??(l.nullContext||{}),n!=null?e(n,"entities"):n," | ",{name:"join",hash:{},fn:l.program(7,t,0),inverse:l.noop,data:t,loc:{start:{line:70,column:75},end:{line:70,column:113}}}))!=null?a:"")+"> "},compiler:[8,">= 4.3.0"],main:function(l,n,i,m,t){var a,e,s,o=n??(l.nullContext||{}),u=l.lookupProperty||function(c,f){if(Object.prototype.hasOwnProperty.call(c,f))return c[f]},r=`import { buildSelfDescribingEvent, SelfDescribingJson, Timestamp, Tracker } from '@snowplow/node-tracker';
|
|
347
410
|
|
|
348
411
|
interface CommonEventProperties<T = Record<string, unknown>> {
|
|
349
412
|
/** Add context to an event by setting an Array of Self Describing JSON */
|
|
@@ -352,31 +415,31 @@ interface CommonEventProperties<T = Record<string, unknown>> {
|
|
|
352
415
|
timestamp?: Timestamp | null;
|
|
353
416
|
}
|
|
354
417
|
|
|
355
|
-
`+((
|
|
356
|
-
`;return
|
|
357
|
-
`+((
|
|
358
|
-
/** `+((
|
|
359
|
-
`},5:function(l,n,i,
|
|
360
|
-
`},6:function(l,n,i,
|
|
361
|
-
`},10:function(l,n,i,
|
|
362
|
-
`+((s=y(i,"each").call(u,n!=null?y(n,"properties"):n,{name:"each",hash:{},fn:l.program(11,
|
|
363
|
-
`},11:function(l,n,i,
|
|
364
|
-
`},16:function(l,n,i,
|
|
365
|
-
`},19:function(l,n,i,
|
|
366
|
-
`},22:function(l,n,i,
|
|
367
|
-
`},25:function(l,n,i,
|
|
368
|
-
`},27:function(l,n,i,
|
|
369
|
-
`},30:function(l,n,i,
|
|
370
|
-
`},33:function(l,n,i,
|
|
371
|
-
`},36:function(l,n,i,
|
|
372
|
-
`},39:function(l,n,i,
|
|
373
|
-
`},41:function(l,n,i,
|
|
374
|
-
`},44:function(l,n,i,
|
|
375
|
-
`},47:function(l,n,i,
|
|
376
|
-
`},50:function(l,n,i,
|
|
377
|
-
`},53:function(l,n,i,
|
|
378
|
-
`+((
|
|
379
|
-
`+((
|
|
418
|
+
`+((a=u(i,"if").call(o,(a=n!=null?u(n,"eventSpecifications"):n)!=null?u(a,"length"):a,{name:"if",hash:{},fn:l.program(1,t,0),inverse:l.noop,data:t,loc:{start:{line:10,column:0},end:{line:28,column:7}}}))!=null?a:"")+`
|
|
419
|
+
`;return a=(e=(e=u(i,"type")||(n!=null?u(n,"type"):n))!=null?e:l.hooks.helperMissing,s={name:"type",hash:{},fn:l.program(3,t,0),inverse:l.noop,data:t,loc:{start:{line:30,column:0},end:{line:54,column:9}}},typeof e=="function"?e.call(o,s):e),u(i,"type")||(a=l.hooks.blockHelperMissing.call(n,a,s)),a!=null&&(r+=a),r+`
|
|
420
|
+
`+((a=u(i,"each").call(o,n!=null?u(n,"eventSpecifications"):n,{name:"each",hash:{},fn:l.program(5,t,0),inverse:l.noop,data:t,loc:{start:{line:56,column:0},end:{line:75,column:9}}}))!=null?a:"")},useData:!0}});var _n=O((je,Un)=>{"use strict";Un.exports={id:{language:"kotlin",tracker:"snowplow-android-tracker"},1:function(l,n,i,m,t){var a,e=l.lookupProperty||function(s,o){if(Object.prototype.hasOwnProperty.call(s,o))return s[o]};return(a=e(i,"each").call(n??(l.nullContext||{}),n!=null?e(n,"properties"):n,{name:"each",hash:{},fn:l.program(2,t,0),inverse:l.noop,data:t,loc:{start:{line:10,column:0},end:{line:20,column:9}}}))!=null?a:""},2:function(l,n,i,m,t){var a,e=n??(l.nullContext||{}),s=l.lookupProperty||function(o,u){if(Object.prototype.hasOwnProperty.call(o,u))return o[u]};return((a=s(i,"if").call(e,n!=null?s(n,"description"):n,{name:"if",hash:{},fn:l.program(3,t,0),inverse:l.noop,data:t,loc:{start:{line:11,column:0},end:{line:14,column:7}}}))!=null?a:"")+((a=s(i,"if").call(e,n!=null?s(n,"isNullable"):n,{name:"if",hash:{},fn:l.program(5,t,0),inverse:l.program(8,t,0),data:t,loc:{start:{line:15,column:0},end:{line:19,column:7}}}))!=null?a:"")},3:function(l,n,i,m,t){var a,e,s=l.lookupProperty||function(o,u){if(Object.prototype.hasOwnProperty.call(o,u))return o[u]};return`
|
|
421
|
+
/** `+((a=(e=(e=s(i,"description")||(n!=null?s(n,"description"):n))!=null?e:l.hooks.helperMissing,typeof e=="function"?e.call(n??(l.nullContext||{}),{name:"description",hash:{},data:t,loc:{start:{line:13,column:8},end:{line:13,column:25}}}):e))!=null?a:"")+` */
|
|
422
|
+
`},5:function(l,n,i,m,t){var a,e,s=n??(l.nullContext||{}),o=l.hooks.helperMissing,u="function",r=l.lookupProperty||function(c,f){if(Object.prototype.hasOwnProperty.call(c,f))return c[f]};return" var "+l.escapeExpression((e=(e=r(i,"name")||(n!=null?r(n,"name"):n))!=null?e:o,typeof e===u?e.call(s,{name:"name",hash:{},data:t,loc:{start:{line:16,column:8},end:{line:16,column:16}}}):e))+": "+((a=(e=(e=r(i,"type")||(n!=null?r(n,"type"):n))!=null?e:o,typeof e===u?e.call(s,{name:"type",hash:{},data:t,loc:{start:{line:16,column:18},end:{line:16,column:28}}}):e))!=null?a:"")+" = null"+((a=r(i,"unless").call(s,t&&r(t,"last"),{name:"unless",hash:{},fn:l.program(6,t,0),inverse:l.noop,data:t,loc:{start:{line:16,column:35},end:{line:16,column:65}}}))!=null?a:"")+`
|
|
423
|
+
`},6:function(l,n,i,m,t){return", "},8:function(l,n,i,m,t){var a,e,s=n??(l.nullContext||{}),o=l.hooks.helperMissing,u="function",r=l.lookupProperty||function(c,f){if(Object.prototype.hasOwnProperty.call(c,f))return c[f]};return" var "+l.escapeExpression((e=(e=r(i,"name")||(n!=null?r(n,"name"):n))!=null?e:o,typeof e===u?e.call(s,{name:"name",hash:{},data:t,loc:{start:{line:18,column:8},end:{line:18,column:16}}}):e))+": "+((a=(e=(e=r(i,"type")||(n!=null?r(n,"type"):n))!=null?e:o,typeof e===u?e.call(s,{name:"type",hash:{},data:t,loc:{start:{line:18,column:18},end:{line:18,column:28}}}):e))!=null?a:"")+((a=r(i,"unless").call(s,t&&r(t,"last"),{name:"unless",hash:{},fn:l.program(6,t,0),inverse:l.noop,data:t,loc:{start:{line:18,column:28},end:{line:18,column:58}}}))!=null?a:"")+`
|
|
424
|
+
`},10:function(l,n,i,m,t,a,e){var s,o,u=n??(l.nullContext||{}),r=l.hooks.helperMissing,c="function",f=l.escapeExpression,y=l.lookupProperty||function(p,g){if(Object.prototype.hasOwnProperty.call(p,g))return p[g]};return" "+f((o=(o=y(i,"indent")||(n!=null?y(n,"indent"):n))!=null?o:r,typeof o===c?o.call(u,{name:"indent",hash:{},data:t,loc:{start:{line:25,column:8},end:{line:25,column:18}}}):o))+`val payload = HashMap<String, Any?>()
|
|
425
|
+
`+((s=y(i,"each").call(u,n!=null?y(n,"properties"):n,{name:"each",hash:{},fn:l.program(11,t,0,a,e),inverse:l.noop,data:t,loc:{start:{line:26,column:0},end:{line:71,column:9}}}))!=null?s:"")+" "+f((o=(o=y(i,"indent")||(n!=null?y(n,"indent"):n))!=null?o:r,typeof o===c?o.call(u,{name:"indent",hash:{},data:t,loc:{start:{line:72,column:8},end:{line:72,column:18}}}):o))+`return payload
|
|
426
|
+
`},11:function(l,n,i,m,t,a,e){var s,o=l.lookupProperty||function(u,r){if(Object.prototype.hasOwnProperty.call(u,r))return u[r]};return(s=o(i,"if").call(n??(l.nullContext||{}),n!=null?o(n,"isNullable"):n,{name:"if",hash:{},fn:l.program(12,t,0,a,e),inverse:l.program(41,t,0,a,e),data:t,loc:{start:{line:27,column:0},end:{line:70,column:7}}}))!=null?s:""},12:function(l,n,i,m,t,a,e){var s,o=l.lookupProperty||function(u,r){if(Object.prototype.hasOwnProperty.call(u,r))return u[r]};return(s=o(i,"if").call(n??(l.nullContext||{}),n!=null?o(n,"isOptional"):n,{name:"if",hash:{},fn:l.program(13,t,0,a,e),inverse:l.program(27,t,0,a,e),data:t,loc:{start:{line:28,column:0},end:{line:55,column:7}}}))!=null?s:""},13:function(l,n,i,m,t,a,e){var s,o=l.lookupProperty||function(u,r){if(Object.prototype.hasOwnProperty.call(u,r))return u[r]};return(s=o(i,"if").call(n??(l.nullContext||{}),n!=null?o(n,"isArrayOfEnums"):n,{name:"if",hash:{},fn:l.program(14,t,0,a,e),inverse:l.program(16,t,0,a,e),data:t,loc:{start:{line:29,column:0},end:{line:40,column:7}}}))!=null?s:""},14:function(l,n,i,m,t,a,e){var s,o,u=l.escapeExpression,r=n??(l.nullContext||{}),c=l.hooks.helperMissing,f="function",y=l.lookupProperty||function(p,g){if(Object.prototype.hasOwnProperty.call(p,g))return p[g]};return" "+u(l.lambda(e[1]!=null?y(e[1],"indent"):e[1],n))+u((o=(o=y(i,"name")||(n!=null?y(n,"name"):n))!=null?o:c,typeof o===f?o.call(r,{name:"name",hash:{},data:t,loc:{start:{line:31,column:21},end:{line:31,column:29}}}):o))+'?.let { payload["'+((s=(o=(o=y(i,"jsonName")||(n!=null?y(n,"jsonName"):n))!=null?o:c,typeof o===f?o.call(r,{name:"jsonName",hash:{},data:t,loc:{start:{line:31,column:46},end:{line:31,column:60}}}):o))!=null?s:"")+`"] = it.map { e -> e.string } }
|
|
427
|
+
`},16:function(l,n,i,m,t,a,e){var s,o=l.lookupProperty||function(u,r){if(Object.prototype.hasOwnProperty.call(u,r))return u[r]};return(s=o(i,"if").call(n??(l.nullContext||{}),n!=null?o(n,"isArrayOfObjects"):n,{name:"if",hash:{},fn:l.program(17,t,0,a,e),inverse:l.program(19,t,0,a,e),data:t,loc:{start:{line:32,column:0},end:{line:40,column:0}}}))!=null?s:""},17:function(l,n,i,m,t,a,e){var s,o,u=l.escapeExpression,r=n??(l.nullContext||{}),c=l.hooks.helperMissing,f="function",y=l.lookupProperty||function(p,g){if(Object.prototype.hasOwnProperty.call(p,g))return p[g]};return" "+u(l.lambda(e[1]!=null?y(e[1],"indent"):e[1],n))+u((o=(o=y(i,"name")||(n!=null?y(n,"name"):n))!=null?o:c,typeof o===f?o.call(r,{name:"name",hash:{},data:t,loc:{start:{line:33,column:21},end:{line:33,column:29}}}):o))+'?.let { payload["'+((s=(o=(o=y(i,"jsonName")||(n!=null?y(n,"jsonName"):n))!=null?o:c,typeof o===f?o.call(r,{name:"jsonName",hash:{},data:t,loc:{start:{line:33,column:46},end:{line:33,column:60}}}):o))!=null?s:"")+`"] = it.map { e -> e.payload } }
|
|
428
|
+
`},19:function(l,n,i,m,t,a,e){var s,o=l.lookupProperty||function(u,r){if(Object.prototype.hasOwnProperty.call(u,r))return u[r]};return(s=o(i,"if").call(n??(l.nullContext||{}),n!=null?o(n,"isEnum"):n,{name:"if",hash:{},fn:l.program(20,t,0,a,e),inverse:l.program(22,t,0,a,e),data:t,loc:{start:{line:34,column:0},end:{line:40,column:0}}}))!=null?s:""},20:function(l,n,i,m,t,a,e){var s,o,u=l.escapeExpression,r=n??(l.nullContext||{}),c=l.hooks.helperMissing,f="function",y=l.lookupProperty||function(p,g){if(Object.prototype.hasOwnProperty.call(p,g))return p[g]};return" "+u(l.lambda(e[1]!=null?y(e[1],"indent"):e[1],n))+u((o=(o=y(i,"name")||(n!=null?y(n,"name"):n))!=null?o:c,typeof o===f?o.call(r,{name:"name",hash:{},data:t,loc:{start:{line:35,column:21},end:{line:35,column:29}}}):o))+'?.let { payload["'+((s=(o=(o=y(i,"jsonName")||(n!=null?y(n,"jsonName"):n))!=null?o:c,typeof o===f?o.call(r,{name:"jsonName",hash:{},data:t,loc:{start:{line:35,column:46},end:{line:35,column:60}}}):o))!=null?s:"")+`"] = it.string }
|
|
429
|
+
`},22:function(l,n,i,m,t,a,e){var s,o=l.lookupProperty||function(u,r){if(Object.prototype.hasOwnProperty.call(u,r))return u[r]};return(s=o(i,"if").call(n??(l.nullContext||{}),n!=null?o(n,"isObject"):n,{name:"if",hash:{},fn:l.program(23,t,0,a,e),inverse:l.program(25,t,0,a,e),data:t,loc:{start:{line:36,column:0},end:{line:40,column:0}}}))!=null?s:""},23:function(l,n,i,m,t,a,e){var s,o,u=l.escapeExpression,r=n??(l.nullContext||{}),c=l.hooks.helperMissing,f="function",y=l.lookupProperty||function(p,g){if(Object.prototype.hasOwnProperty.call(p,g))return p[g]};return" "+u(l.lambda(e[1]!=null?y(e[1],"indent"):e[1],n))+u((o=(o=y(i,"name")||(n!=null?y(n,"name"):n))!=null?o:c,typeof o===f?o.call(r,{name:"name",hash:{},data:t,loc:{start:{line:37,column:21},end:{line:37,column:29}}}):o))+'?.let { payload["'+((s=(o=(o=y(i,"jsonName")||(n!=null?y(n,"jsonName"):n))!=null?o:c,typeof o===f?o.call(r,{name:"jsonName",hash:{},data:t,loc:{start:{line:37,column:46},end:{line:37,column:60}}}):o))!=null?s:"")+`"] = it.payload }
|
|
430
|
+
`},25:function(l,n,i,m,t,a,e){var s,o,u=l.escapeExpression,r=n??(l.nullContext||{}),c=l.hooks.helperMissing,f="function",y=l.lookupProperty||function(p,g){if(Object.prototype.hasOwnProperty.call(p,g))return p[g]};return" "+u(l.lambda(e[1]!=null?y(e[1],"indent"):e[1],n))+u((o=(o=y(i,"name")||(n!=null?y(n,"name"):n))!=null?o:c,typeof o===f?o.call(r,{name:"name",hash:{},data:t,loc:{start:{line:39,column:21},end:{line:39,column:29}}}):o))+'?.let { payload["'+((s=(o=(o=y(i,"jsonName")||(n!=null?y(n,"jsonName"):n))!=null?o:c,typeof o===f?o.call(r,{name:"jsonName",hash:{},data:t,loc:{start:{line:39,column:46},end:{line:39,column:60}}}):o))!=null?s:"")+`"] = it }
|
|
431
|
+
`},27:function(l,n,i,m,t,a,e){var s,o=l.lookupProperty||function(u,r){if(Object.prototype.hasOwnProperty.call(u,r))return u[r]};return(s=o(i,"if").call(n??(l.nullContext||{}),n!=null?o(n,"isArrayOfEnums"):n,{name:"if",hash:{},fn:l.program(28,t,0,a,e),inverse:l.program(30,t,0,a,e),data:t,loc:{start:{line:43,column:0},end:{line:54,column:7}}}))!=null?s:""},28:function(l,n,i,m,t,a,e){var s,o,u=l.escapeExpression,r=n??(l.nullContext||{}),c=l.hooks.helperMissing,f="function",y=l.lookupProperty||function(p,g){if(Object.prototype.hasOwnProperty.call(p,g))return p[g]};return" "+u(l.lambda(e[1]!=null?y(e[1],"indent"):e[1],n))+'payload["'+((s=(o=(o=y(i,"jsonName")||(n!=null?y(n,"jsonName"):n))!=null?o:c,typeof o===f?o.call(r,{name:"jsonName",hash:{},data:t,loc:{start:{line:45,column:30},end:{line:45,column:44}}}):o))!=null?s:"")+'"] = '+u((o=(o=y(i,"name")||(n!=null?y(n,"name"):n))!=null?o:c,typeof o===f?o.call(r,{name:"name",hash:{},data:t,loc:{start:{line:45,column:49},end:{line:45,column:57}}}):o))+`?.map { e -> e.string }
|
|
432
|
+
`},30:function(l,n,i,m,t,a,e){var s,o=l.lookupProperty||function(u,r){if(Object.prototype.hasOwnProperty.call(u,r))return u[r]};return(s=o(i,"if").call(n??(l.nullContext||{}),n!=null?o(n,"isArrayOfObjects"):n,{name:"if",hash:{},fn:l.program(31,t,0,a,e),inverse:l.program(33,t,0,a,e),data:t,loc:{start:{line:46,column:0},end:{line:54,column:0}}}))!=null?s:""},31:function(l,n,i,m,t,a,e){var s,o,u=l.escapeExpression,r=n??(l.nullContext||{}),c=l.hooks.helperMissing,f="function",y=l.lookupProperty||function(p,g){if(Object.prototype.hasOwnProperty.call(p,g))return p[g]};return" "+u(l.lambda(e[1]!=null?y(e[1],"indent"):e[1],n))+'payload["'+((s=(o=(o=y(i,"jsonName")||(n!=null?y(n,"jsonName"):n))!=null?o:c,typeof o===f?o.call(r,{name:"jsonName",hash:{},data:t,loc:{start:{line:47,column:30},end:{line:47,column:44}}}):o))!=null?s:"")+'"] = '+u((o=(o=y(i,"name")||(n!=null?y(n,"name"):n))!=null?o:c,typeof o===f?o.call(r,{name:"name",hash:{},data:t,loc:{start:{line:47,column:49},end:{line:47,column:57}}}):o))+`?.map { e -> e.payload }
|
|
433
|
+
`},33:function(l,n,i,m,t,a,e){var s,o=l.lookupProperty||function(u,r){if(Object.prototype.hasOwnProperty.call(u,r))return u[r]};return(s=o(i,"if").call(n??(l.nullContext||{}),n!=null?o(n,"isEnum"):n,{name:"if",hash:{},fn:l.program(34,t,0,a,e),inverse:l.program(36,t,0,a,e),data:t,loc:{start:{line:48,column:0},end:{line:54,column:0}}}))!=null?s:""},34:function(l,n,i,m,t,a,e){var s,o,u=l.escapeExpression,r=n??(l.nullContext||{}),c=l.hooks.helperMissing,f="function",y=l.lookupProperty||function(p,g){if(Object.prototype.hasOwnProperty.call(p,g))return p[g]};return" "+u(l.lambda(e[1]!=null?y(e[1],"indent"):e[1],n))+'payload["'+((s=(o=(o=y(i,"jsonName")||(n!=null?y(n,"jsonName"):n))!=null?o:c,typeof o===f?o.call(r,{name:"jsonName",hash:{},data:t,loc:{start:{line:49,column:30},end:{line:49,column:44}}}):o))!=null?s:"")+'"] = '+u((o=(o=y(i,"name")||(n!=null?y(n,"name"):n))!=null?o:c,typeof o===f?o.call(r,{name:"name",hash:{},data:t,loc:{start:{line:49,column:49},end:{line:49,column:57}}}):o))+`?.string
|
|
434
|
+
`},36:function(l,n,i,m,t,a,e){var s,o=l.lookupProperty||function(u,r){if(Object.prototype.hasOwnProperty.call(u,r))return u[r]};return(s=o(i,"if").call(n??(l.nullContext||{}),n!=null?o(n,"isObject"):n,{name:"if",hash:{},fn:l.program(37,t,0,a,e),inverse:l.program(39,t,0,a,e),data:t,loc:{start:{line:50,column:0},end:{line:54,column:0}}}))!=null?s:""},37:function(l,n,i,m,t,a,e){var s,o,u=l.escapeExpression,r=n??(l.nullContext||{}),c=l.hooks.helperMissing,f="function",y=l.lookupProperty||function(p,g){if(Object.prototype.hasOwnProperty.call(p,g))return p[g]};return" "+u(l.lambda(e[1]!=null?y(e[1],"indent"):e[1],n))+'payload["'+((s=(o=(o=y(i,"jsonName")||(n!=null?y(n,"jsonName"):n))!=null?o:c,typeof o===f?o.call(r,{name:"jsonName",hash:{},data:t,loc:{start:{line:51,column:30},end:{line:51,column:44}}}):o))!=null?s:"")+'"] = '+u((o=(o=y(i,"name")||(n!=null?y(n,"name"):n))!=null?o:c,typeof o===f?o.call(r,{name:"name",hash:{},data:t,loc:{start:{line:51,column:49},end:{line:51,column:57}}}):o))+`?.payload
|
|
435
|
+
`},39:function(l,n,i,m,t,a,e){var s,o,u=l.escapeExpression,r=n??(l.nullContext||{}),c=l.hooks.helperMissing,f="function",y=l.lookupProperty||function(p,g){if(Object.prototype.hasOwnProperty.call(p,g))return p[g]};return" "+u(l.lambda(e[1]!=null?y(e[1],"indent"):e[1],n))+'payload["'+((s=(o=(o=y(i,"jsonName")||(n!=null?y(n,"jsonName"):n))!=null?o:c,typeof o===f?o.call(r,{name:"jsonName",hash:{},data:t,loc:{start:{line:53,column:30},end:{line:53,column:44}}}):o))!=null?s:"")+'"] = '+u((o=(o=y(i,"name")||(n!=null?y(n,"name"):n))!=null?o:c,typeof o===f?o.call(r,{name:"name",hash:{},data:t,loc:{start:{line:53,column:49},end:{line:53,column:57}}}):o))+`
|
|
436
|
+
`},41:function(l,n,i,m,t,a,e){var s,o=l.lookupProperty||function(u,r){if(Object.prototype.hasOwnProperty.call(u,r))return u[r]};return(s=o(i,"if").call(n??(l.nullContext||{}),n!=null?o(n,"isArrayOfEnums"):n,{name:"if",hash:{},fn:l.program(42,t,0,a,e),inverse:l.program(44,t,0,a,e),data:t,loc:{start:{line:58,column:0},end:{line:69,column:7}}}))!=null?s:""},42:function(l,n,i,m,t,a,e){var s,o,u=l.escapeExpression,r=n??(l.nullContext||{}),c=l.hooks.helperMissing,f="function",y=l.lookupProperty||function(p,g){if(Object.prototype.hasOwnProperty.call(p,g))return p[g]};return" "+u(l.lambda(e[1]!=null?y(e[1],"indent"):e[1],n))+'payload["'+((s=(o=(o=y(i,"jsonName")||(n!=null?y(n,"jsonName"):n))!=null?o:c,typeof o===f?o.call(r,{name:"jsonName",hash:{},data:t,loc:{start:{line:60,column:30},end:{line:60,column:44}}}):o))!=null?s:"")+'"] = '+u((o=(o=y(i,"name")||(n!=null?y(n,"name"):n))!=null?o:c,typeof o===f?o.call(r,{name:"name",hash:{},data:t,loc:{start:{line:60,column:49},end:{line:60,column:57}}}):o))+`.map { e -> e.string }
|
|
437
|
+
`},44:function(l,n,i,m,t,a,e){var s,o=l.lookupProperty||function(u,r){if(Object.prototype.hasOwnProperty.call(u,r))return u[r]};return(s=o(i,"if").call(n??(l.nullContext||{}),n!=null?o(n,"isArrayOfObjects"):n,{name:"if",hash:{},fn:l.program(45,t,0,a,e),inverse:l.program(47,t,0,a,e),data:t,loc:{start:{line:61,column:0},end:{line:69,column:0}}}))!=null?s:""},45:function(l,n,i,m,t,a,e){var s,o,u=l.escapeExpression,r=n??(l.nullContext||{}),c=l.hooks.helperMissing,f="function",y=l.lookupProperty||function(p,g){if(Object.prototype.hasOwnProperty.call(p,g))return p[g]};return" "+u(l.lambda(e[1]!=null?y(e[1],"indent"):e[1],n))+'payload["'+((s=(o=(o=y(i,"jsonName")||(n!=null?y(n,"jsonName"):n))!=null?o:c,typeof o===f?o.call(r,{name:"jsonName",hash:{},data:t,loc:{start:{line:62,column:30},end:{line:62,column:44}}}):o))!=null?s:"")+'"] = '+u((o=(o=y(i,"name")||(n!=null?y(n,"name"):n))!=null?o:c,typeof o===f?o.call(r,{name:"name",hash:{},data:t,loc:{start:{line:62,column:49},end:{line:62,column:57}}}):o))+`.map { e -> e.payload }
|
|
438
|
+
`},47:function(l,n,i,m,t,a,e){var s,o=l.lookupProperty||function(u,r){if(Object.prototype.hasOwnProperty.call(u,r))return u[r]};return(s=o(i,"if").call(n??(l.nullContext||{}),n!=null?o(n,"isEnum"):n,{name:"if",hash:{},fn:l.program(48,t,0,a,e),inverse:l.program(50,t,0,a,e),data:t,loc:{start:{line:63,column:0},end:{line:69,column:0}}}))!=null?s:""},48:function(l,n,i,m,t,a,e){var s,o,u=l.escapeExpression,r=n??(l.nullContext||{}),c=l.hooks.helperMissing,f="function",y=l.lookupProperty||function(p,g){if(Object.prototype.hasOwnProperty.call(p,g))return p[g]};return" "+u(l.lambda(e[1]!=null?y(e[1],"indent"):e[1],n))+'payload["'+((s=(o=(o=y(i,"jsonName")||(n!=null?y(n,"jsonName"):n))!=null?o:c,typeof o===f?o.call(r,{name:"jsonName",hash:{},data:t,loc:{start:{line:64,column:30},end:{line:64,column:44}}}):o))!=null?s:"")+'"] = '+u((o=(o=y(i,"name")||(n!=null?y(n,"name"):n))!=null?o:c,typeof o===f?o.call(r,{name:"name",hash:{},data:t,loc:{start:{line:64,column:49},end:{line:64,column:57}}}):o))+`.string
|
|
439
|
+
`},50:function(l,n,i,m,t,a,e){var s,o=l.lookupProperty||function(u,r){if(Object.prototype.hasOwnProperty.call(u,r))return u[r]};return(s=o(i,"if").call(n??(l.nullContext||{}),n!=null?o(n,"isObject"):n,{name:"if",hash:{},fn:l.program(51,t,0,a,e),inverse:l.program(39,t,0,a,e),data:t,loc:{start:{line:65,column:0},end:{line:69,column:0}}}))!=null?s:""},51:function(l,n,i,m,t,a,e){var s,o,u=l.escapeExpression,r=n??(l.nullContext||{}),c=l.hooks.helperMissing,f="function",y=l.lookupProperty||function(p,g){if(Object.prototype.hasOwnProperty.call(p,g))return p[g]};return" "+u(l.lambda(e[1]!=null?y(e[1],"indent"):e[1],n))+'payload["'+((s=(o=(o=y(i,"jsonName")||(n!=null?y(n,"jsonName"):n))!=null?o:c,typeof o===f?o.call(r,{name:"jsonName",hash:{},data:t,loc:{start:{line:66,column:30},end:{line:66,column:44}}}):o))!=null?s:"")+'"] = '+u((o=(o=y(i,"name")||(n!=null?y(n,"name"):n))!=null?o:c,typeof o===f?o.call(r,{name:"name",hash:{},data:t,loc:{start:{line:66,column:49},end:{line:66,column:57}}}):o))+`.payload
|
|
440
|
+
`},53:function(l,n,i,m,t){var a,e,s=n??(l.nullContext||{}),o=l.hooks.helperMissing,u="function",r=l.escapeExpression,c=l.lookupProperty||function(f,y){if(Object.prototype.hasOwnProperty.call(f,y))return f[y]};return`/**
|
|
441
|
+
`+((a=c(i,"if").call(s,n!=null?c(n,"description"):n,{name:"if",hash:{},fn:l.program(54,t,0),inverse:l.noop,data:t,loc:{start:{line:78,column:0},end:{line:80,column:7}}}))!=null?a:"")+"* Schema: `"+r((e=(e=c(i,"igluUrl")||(n!=null?c(n,"igluUrl"):n))!=null?e:o,typeof e===u?e.call(s,{name:"igluUrl",hash:{},data:t,loc:{start:{line:81,column:11},end:{line:81,column:22}}}):e))+"`\n*\n* Example:\n* ```kotlin\n* val data = "+r((e=(e=c(i,"typeName")||(n!=null?c(n,"typeName"):n))!=null?e:o,typeof e===u?e.call(s,{name:"typeName",hash:{},data:t,loc:{start:{line:85,column:13},end:{line:85,column:25}}}):e))+`(
|
|
442
|
+
`+((a=c(i,"each").call(s,n!=null?c(n,"properties"):n,{name:"each",hash:{},fn:l.program(56,t,0),inverse:l.noop,data:t,loc:{start:{line:86,column:0},end:{line:88,column:9}}}))!=null?a:"")+`* )
|
|
380
443
|
* // Track as an event
|
|
381
444
|
* Snowplow.defaultTracker?.track(data.toEvent())
|
|
382
445
|
* // Add as an entity to another event
|
|
@@ -385,13 +448,13 @@ interface CommonEventProperties<T = Record<string, unknown>> {
|
|
|
385
448
|
* Snowplow.defaultTracker?.track(event)
|
|
386
449
|
* \`\`\`
|
|
387
450
|
*/
|
|
388
|
-
data class `+
|
|
389
|
-
`+((
|
|
390
|
-
private val schema = "`+
|
|
451
|
+
data class `+r((e=(e=c(i,"typeName")||(n!=null?c(n,"typeName"):n))!=null?e:o,typeof e===u?e.call(s,{name:"typeName",hash:{},data:t,loc:{start:{line:98,column:11},end:{line:98,column:23}}}):e))+`(
|
|
452
|
+
`+((a=l.invokePartial(c(m,"classProperties"),n,{name:"classProperties",data:t,helpers:i,partials:m,decorators:l.decorators}))!=null?a:"")+`) {
|
|
453
|
+
private val schema = "`+r((e=(e=c(i,"igluUrl")||(n!=null?c(n,"igluUrl"):n))!=null?e:o,typeof e===u?e.call(s,{name:"igluUrl",hash:{},data:t,loc:{start:{line:101,column:26},end:{line:101,column:37}}}):e))+`"
|
|
391
454
|
|
|
392
455
|
private val payload: Map<String, Any?>
|
|
393
456
|
get() {
|
|
394
|
-
`+((
|
|
457
|
+
`+((a=l.invokePartial(c(m,"createAndReturnPayloadDictionary"),n,{name:"createAndReturnPayloadDictionary",data:t,indent:" ",helpers:i,partials:m,decorators:l.decorators}))!=null?a:"")+` }
|
|
395
458
|
|
|
396
459
|
/** Creates an event instance to be tracked by the tracker. */
|
|
397
460
|
fun toEvent() : SelfDescribing {
|
|
@@ -404,48 +467,48 @@ data class `+t((a=(a=m(i,"typeName")||(n!=null?m(n,"typeName"):n))!=null?a:o,typ
|
|
|
404
467
|
}
|
|
405
468
|
}
|
|
406
469
|
|
|
407
|
-
`},54:function(l,n,i,
|
|
408
|
-
`},56:function(l,n,i,
|
|
409
|
-
`},58:function(l,n,i,
|
|
470
|
+
`},54:function(l,n,i,m,t){var a,e,s=l.lookupProperty||function(o,u){if(Object.prototype.hasOwnProperty.call(o,u))return o[u]};return"* "+((a=(e=(e=s(i,"description")||(n!=null?s(n,"description"):n))!=null?e:l.hooks.helperMissing,typeof e=="function"?e.call(n??(l.nullContext||{}),{name:"description",hash:{},data:t,loc:{start:{line:79,column:2},end:{line:79,column:19}}}):e))!=null?a:"")+`
|
|
471
|
+
`},56:function(l,n,i,m,t){var a,e,s=n??(l.nullContext||{}),o=l.hooks.helperMissing,u="function",r=l.escapeExpression,c=l.lookupProperty||function(f,y){if(Object.prototype.hasOwnProperty.call(f,y))return f[y]};return"* "+r((e=(e=c(i,"name")||(n!=null?c(n,"name"):n))!=null?e:o,typeof e===u?e.call(s,{name:"name",hash:{},data:t,loc:{start:{line:87,column:6},end:{line:87,column:14}}}):e))+" = "+r((e=(e=c(i,"name")||(n!=null?c(n,"name"):n))!=null?e:o,typeof e===u?e.call(s,{name:"name",hash:{},data:t,loc:{start:{line:87,column:17},end:{line:87,column:25}}}):e))+((a=c(i,"unless").call(s,t&&c(t,"last"),{name:"unless",hash:{},fn:l.program(6,t,0),inverse:l.noop,data:t,loc:{start:{line:87,column:25},end:{line:87,column:55}}}))!=null?a:"")+`
|
|
472
|
+
`},58:function(l,n,i,m,t){var a,e,s=n??(l.nullContext||{}),o=l.lookupProperty||function(u,r){if(Object.prototype.hasOwnProperty.call(u,r))return u[r]};return`
|
|
410
473
|
|
|
411
|
-
`+((
|
|
412
|
-
`+((
|
|
474
|
+
`+((a=o(i,"if").call(s,n!=null?o(n,"description"):n,{name:"if",hash:{},fn:l.program(59,t,0),inverse:l.noop,data:t,loc:{start:{line:166,column:0},end:{line:170,column:7}}}))!=null?a:"")+"data class "+l.escapeExpression((e=(e=o(i,"typeName")||(n!=null?o(n,"typeName"):n))!=null?e:l.hooks.helperMissing,typeof e=="function"?e.call(s,{name:"typeName",hash:{},data:t,loc:{start:{line:171,column:11},end:{line:171,column:23}}}):e))+`(
|
|
475
|
+
`+((a=l.invokePartial(o(m,"classProperties"),n,{name:"classProperties",data:t,helpers:i,partials:m,decorators:l.decorators}))!=null?a:"")+`) {
|
|
413
476
|
val payload: Map<String, Any?>
|
|
414
477
|
get() {
|
|
415
|
-
`+((
|
|
478
|
+
`+((a=l.invokePartial(o(m,"createAndReturnPayloadDictionary"),n,{name:"createAndReturnPayloadDictionary",data:t,indent:" ",helpers:i,partials:m,decorators:l.decorators}))!=null?a:"")+` }
|
|
416
479
|
}
|
|
417
|
-
`},59:function(l,n,i,
|
|
418
|
-
* `+((
|
|
480
|
+
`},59:function(l,n,i,m,t){var a,e,s=l.lookupProperty||function(o,u){if(Object.prototype.hasOwnProperty.call(o,u))return o[u]};return`/**
|
|
481
|
+
* `+((a=(e=(e=s(i,"description")||(n!=null?s(n,"description"):n))!=null?e:l.hooks.helperMissing,typeof e=="function"?e.call(n??(l.nullContext||{}),{name:"description",hash:{},data:t,loc:{start:{line:168,column:2},end:{line:168,column:19}}}):e))!=null?a:"")+`
|
|
419
482
|
*/
|
|
420
|
-
`},61:function(l,n,i,
|
|
421
|
-
`+((
|
|
422
|
-
`+((
|
|
423
|
-
`},62:function(l,n,i,
|
|
424
|
-
`},64:function(l,n,i,
|
|
483
|
+
`},61:function(l,n,i,m,t){var a,e,s=n??(l.nullContext||{}),o=l.lookupProperty||function(u,r){if(Object.prototype.hasOwnProperty.call(u,r))return u[r]};return`
|
|
484
|
+
`+((a=o(i,"if").call(s,n!=null?o(n,"description"):n,{name:"if",hash:{},fn:l.program(59,t,0),inverse:l.noop,data:t,loc:{start:{line:183,column:0},end:{line:187,column:7}}}))!=null?a:"")+"enum class "+l.escapeExpression((e=(e=o(i,"name")||(n!=null?o(n,"name"):n))!=null?e:l.hooks.helperMissing,typeof e=="function"?e.call(s,{name:"name",hash:{},data:t,loc:{start:{line:188,column:11},end:{line:188,column:19}}}):e))+`(val string: String) {
|
|
485
|
+
`+((a=o(i,"each").call(s,n!=null?o(n,"cases"):n,{name:"each",hash:{},fn:l.program(62,t,0),inverse:l.noop,data:t,loc:{start:{line:189,column:0},end:{line:191,column:9}}}))!=null?a:"")+`}
|
|
486
|
+
`},62:function(l,n,i,m,t){var a,e,s=n??(l.nullContext||{}),o=l.hooks.helperMissing,u="function",r=l.lookupProperty||function(c,f){if(Object.prototype.hasOwnProperty.call(c,f))return c[f]};return" "+l.escapeExpression((e=(e=r(i,"name")||(n!=null?r(n,"name"):n))!=null?e:o,typeof e===u?e.call(s,{name:"name",hash:{},data:t,loc:{start:{line:190,column:4},end:{line:190,column:12}}}):e))+'("'+((a=(e=(e=r(i,"jsonName")||(n!=null?r(n,"jsonName"):n))!=null?e:o,typeof e===u?e.call(s,{name:"jsonName",hash:{},data:t,loc:{start:{line:190,column:14},end:{line:190,column:28}}}):e))!=null?a:"")+'")'+((a=r(i,"unless").call(s,t&&r(t,"last"),{name:"unless",hash:{},fn:l.program(6,t,0),inverse:l.noop,data:t,loc:{start:{line:190,column:30},end:{line:190,column:60}}}))!=null?a:"")+`
|
|
487
|
+
`},64:function(l,n,i,m,t){var a,e=l.lambda,s=l.escapeExpression,o=n??(l.nullContext||{}),u=l.lookupProperty||function(r,c){if(Object.prototype.hasOwnProperty.call(r,c))return r[c]};return`
|
|
425
488
|
/**
|
|
426
|
-
* Creates an event with entities for a `+s(
|
|
427
|
-
* `+s((u(i,"addEventSpecificationIdentifier")||n&&u(n,"addEventSpecificationIdentifier")||l.hooks.helperMissing).call(o,n!=null?u(n,"id"):n,{name:"addEventSpecificationIdentifier",hash:{},data:
|
|
428
|
-
`+((
|
|
489
|
+
* Creates an event with entities for a `+s(e(n!=null?u(n,"name"):n,n))+` event specification.
|
|
490
|
+
* `+s((u(i,"addEventSpecificationIdentifier")||n&&u(n,"addEventSpecificationIdentifier")||l.hooks.helperMissing).call(o,n!=null?u(n,"id"):n,{name:"addEventSpecificationIdentifier",hash:{},data:t,loc:{start:{line:200,column:2},end:{line:200,column:45}}}))+"\n* Example:\n* ```kotlin\n* val data = "+s(e(n!=null?u(n,"event"):n,n))+`(...)
|
|
491
|
+
`+((a=u(i,"each").call(o,n!=null?u(n,"entities"):n,{name:"each",hash:{},fn:l.program(65,t,0),inverse:l.noop,data:t,loc:{start:{line:204,column:0},end:{line:206,column:9}}}))!=null?a:"")+"* val event = data.to"+s(e(n!=null?u(n,"name"):n,n))+"("+((a=u(i,"each").call(o,n!=null?u(n,"entities"):n,{name:"each",hash:{},fn:l.program(67,t,0),inverse:l.noop,data:t,loc:{start:{line:207,column:35},end:{line:207,column:110}}}))!=null?a:"")+`)
|
|
429
492
|
* // Track as an event
|
|
430
493
|
* Snowplow.defaultTracker?.track(event)
|
|
431
494
|
* \`\`\`
|
|
432
495
|
*/
|
|
433
|
-
fun `+s(
|
|
496
|
+
fun `+s(e(n!=null?u(n,"event"):n,n))+".to"+s(e(n!=null?u(n,"name"):n,n))+"("+((a=u(i,"each").call(o,n!=null?u(n,"entities"):n,{name:"each",hash:{},fn:l.program(69,t,0),inverse:l.noop,data:t,loc:{start:{line:212,column:35},end:{line:212,column:122}}}))!=null?a:"")+`) : SelfDescribing {
|
|
434
497
|
val event = toEvent()
|
|
435
|
-
val eventSpec = EventSpecification("`+s(
|
|
436
|
-
`+((
|
|
498
|
+
val eventSpec = EventSpecification("`+s(e(n!=null?u(n,"id"):n,n))+`")
|
|
499
|
+
`+((a=u(i,"each").call(o,n!=null?u(n,"entities"):n,{name:"each",hash:{},fn:l.program(71,t,0),inverse:l.noop,data:t,loc:{start:{line:215,column:0},end:{line:217,column:9}}}))!=null?a:"")+` event.entities.add(eventSpec.toEntity())
|
|
437
500
|
return event
|
|
438
501
|
}
|
|
439
|
-
`},65:function(l,n,i,
|
|
440
|
-
`},67:function(l,n,i,
|
|
441
|
-
`},compiler:[8,">= 4.3.0"],main:function(l,n,i,
|
|
502
|
+
`},65:function(l,n,i,m,t){var a=l.lambda,e=l.escapeExpression;return"* val data"+e(a(n,n))+" = "+e(a(n,n))+`(...)
|
|
503
|
+
`},67:function(l,n,i,m,t){var a,e=l.lookupProperty||function(s,o){if(Object.prototype.hasOwnProperty.call(s,o))return s[o]};return"data"+l.escapeExpression(l.lambda(n,n))+((a=e(i,"unless").call(n??(l.nullContext||{}),t&&e(t,"last"),{name:"unless",hash:{},fn:l.program(6,t,0),inverse:l.noop,data:t,loc:{start:{line:207,column:71},end:{line:207,column:101}}}))!=null?a:"")},69:function(l,n,i,m,t){var a,e=l.lambda,s=l.escapeExpression,o=l.lookupProperty||function(u,r){if(Object.prototype.hasOwnProperty.call(u,r))return u[r]};return"entity"+s(e(n,n))+": "+s(e(n,n))+((a=o(i,"unless").call(n??(l.nullContext||{}),t&&o(t,"last"),{name:"unless",hash:{},fn:l.program(6,t,0),inverse:l.noop,data:t,loc:{start:{line:212,column:83},end:{line:212,column:113}}}))!=null?a:"")},71:function(l,n,i,m,t){return" event.entities.add(entity"+l.escapeExpression(l.lambda(n,n))+`.toEntity())
|
|
504
|
+
`},compiler:[8,">= 4.3.0"],main:function(l,n,i,m,t,a,e){var s,o,u,r=n??(l.nullContext||{}),c=l.hooks.helperMissing,f="function",y=l.hooks.blockHelperMissing,p=l.lookupProperty||function(w,D){if(Object.prototype.hasOwnProperty.call(w,D))return w[D]},g=`// Automatically generated by Snowtype
|
|
442
505
|
|
|
443
506
|
package Snowtype
|
|
444
507
|
|
|
445
508
|
import com.snowplowanalytics.snowplow.event.SelfDescribing
|
|
446
509
|
import com.snowplowanalytics.snowplow.payload.SelfDescribingJson
|
|
447
510
|
|
|
448
|
-
`;return s=(o=(o=p(i,"type")||(n!=null?p(n,"type"):n))!=null?o:
|
|
511
|
+
`;return s=(o=(o=p(i,"type")||(n!=null?p(n,"type"):n))!=null?o:c,u={name:"type",hash:{},fn:l.program(53,t,0,a,e),inverse:l.noop,data:t,loc:{start:{line:75,column:0},end:{line:119,column:9}}},typeof o===f?o.call(r,u):o),p(i,"type")||(s=y.call(n,s,u)),s!=null&&(g+=s),g+=`/**
|
|
449
512
|
* Entity schema for referencing an event specification
|
|
450
513
|
* Schema: \`iglu:com.snowplowanalytics.snowplow/event_specification/jsonschema/1-0-0\`
|
|
451
514
|
*
|
|
@@ -486,29 +549,29 @@ data class EventSpecification(
|
|
|
486
549
|
return SelfDescribingJson(schema, payload)
|
|
487
550
|
}
|
|
488
551
|
}
|
|
489
|
-
`,s=(o=(o=p(i,"nestedTypes")||(n!=null?p(n,"nestedTypes"):n))!=null?o:
|
|
490
|
-
`},3:function(l,n,i,
|
|
491
|
-
`},5:function(l,n,i,
|
|
492
|
-
`+((s=y(i,"each").call(u,n!=null?y(n,"properties"):n,{name:"each",hash:{},fn:l.program(6,
|
|
493
|
-
`},6:function(l,n,i,
|
|
494
|
-
`+((s=p(i,"if").call(
|
|
495
|
-
`},8:function(l,n,i,
|
|
496
|
-
`},10:function(l,n,i,
|
|
497
|
-
`},13:function(l,n,i,
|
|
498
|
-
`},16:function(l,n,i,
|
|
499
|
-
`},19:function(l,n,i,
|
|
500
|
-
`},21:function(l,n,i,
|
|
501
|
-
`+
|
|
502
|
-
`},23:function(l,n,i,
|
|
503
|
-
`},26:function(l,n,i,
|
|
504
|
-
`},29:function(l,n,i,
|
|
505
|
-
`},32:function(l,n,i,
|
|
506
|
-
`},35:function(l,n,i,
|
|
507
|
-
`},37:function(l,n,i,
|
|
508
|
-
// MARK: - `+
|
|
509
|
-
|
|
510
|
-
`+((
|
|
511
|
-
`+((
|
|
552
|
+
`,s=(o=(o=p(i,"nestedTypes")||(n!=null?p(n,"nestedTypes"):n))!=null?o:c,u={name:"nestedTypes",hash:{},fn:l.program(58,t,0,a,e),inverse:l.noop,data:t,loc:{start:{line:162,column:0},end:{line:179,column:16}}},typeof o===f?o.call(r,u):o),p(i,"nestedTypes")||(s=y.call(n,s,u)),s!=null&&(g+=s),g+((s=p(i,"each").call(r,n!=null?p(n,"enums"):n,{name:"each",hash:{},fn:l.program(61,t,0,a,e),inverse:l.noop,data:t,loc:{start:{line:180,column:0},end:{line:193,column:9}}}))!=null?s:"")+((s=p(i,"each").call(r,n!=null?p(n,"eventSpecifications"):n,{name:"each",hash:{},fn:l.program(64,t,0,a,e),inverse:l.noop,data:t,loc:{start:{line:196,column:0},end:{line:221,column:9}}}))!=null?s:"")},main_d:function(l,n,i,m,t,a,e){var s=i.decorators,o=i.lookupProperty||function(u,r){if(Object.prototype.hasOwnProperty.call(u,r))return u[r]};return l=o(s,"inline")(l,n,i,{name:"inline",hash:{},fn:i.program(1,t,0,a,e),inverse:i.noop,args:["classProperties"],data:t,loc:{start:{line:8,column:0},end:{line:21,column:11}}})||l,l=o(s,"inline")(l,n,i,{name:"inline",hash:{},fn:i.program(10,t,0,a,e),inverse:i.noop,args:["createAndReturnPayloadDictionary"],data:t,loc:{start:{line:23,column:0},end:{line:73,column:11}}})||l,l},useDecorators:!0,usePartial:!0,useData:!0,useDepths:!0}});var $n=O((Te,Jn)=>{"use strict";Jn.exports={id:{language:"swift",tracker:"snowplow-ios-tracker"},1:function(l,n,i,m,t){var a,e=l.lookupProperty||function(s,o){if(Object.prototype.hasOwnProperty.call(s,o))return s[o]};return(a=e(i,"each").call(n??(l.nullContext||{}),n!=null?e(n,"properties"):n,{name:"each",hash:{},fn:l.program(2,t,0),inverse:l.noop,data:t,loc:{start:{line:5,column:0},end:{line:10,column:9}}}))!=null?a:""},2:function(l,n,i,m,t){var a,e,s=n??(l.nullContext||{}),o=l.hooks.helperMissing,u="function",r=l.escapeExpression,c=l.lookupProperty||function(f,y){if(Object.prototype.hasOwnProperty.call(f,y))return f[y]};return((a=c(i,"if").call(s,n!=null?c(n,"description"):n,{name:"if",hash:{},fn:l.program(3,t,0),inverse:l.noop,data:t,loc:{start:{line:6,column:0},end:{line:8,column:7}}}))!=null?a:"")+" var "+r((e=(e=c(i,"name")||(n!=null?c(n,"name"):n))!=null?e:o,typeof e===u?e.call(s,{name:"name",hash:{},data:t,loc:{start:{line:9,column:8},end:{line:9,column:16}}}):e))+": "+r((e=(e=c(i,"type")||(n!=null?c(n,"type"):n))!=null?e:o,typeof e===u?e.call(s,{name:"type",hash:{},data:t,loc:{start:{line:9,column:18},end:{line:9,column:26}}}):e))+`
|
|
553
|
+
`},3:function(l,n,i,m,t){var a,e,s=l.lookupProperty||function(o,u){if(Object.prototype.hasOwnProperty.call(o,u))return o[u]};return" /// "+((a=(e=(e=s(i,"description")||(n!=null?s(n,"description"):n))!=null?e:l.hooks.helperMissing,typeof e=="function"?e.call(n??(l.nullContext||{}),{name:"description",hash:{},data:t,loc:{start:{line:7,column:8},end:{line:7,column:25}}}):e))!=null?a:"")+`
|
|
554
|
+
`},5:function(l,n,i,m,t,a,e){var s,o,u=n??(l.nullContext||{}),r=l.hooks.helperMissing,c="function",f=l.escapeExpression,y=l.lookupProperty||function(p,g){if(Object.prototype.hasOwnProperty.call(p,g))return p[g]};return" "+f((o=(o=y(i,"indent")||(n!=null?y(n,"indent"):n))!=null?o:r,typeof o===c?o.call(u,{name:"indent",hash:{},data:t,loc:{start:{line:14,column:8},end:{line:14,column:18}}}):o))+`var payload: [String : Any] = [:]
|
|
555
|
+
`+((s=y(i,"each").call(u,n!=null?y(n,"properties"):n,{name:"each",hash:{},fn:l.program(6,t,0,a,e),inverse:l.noop,data:t,loc:{start:{line:15,column:0},end:{line:47,column:9}}}))!=null?s:"")+" "+f((o=(o=y(i,"indent")||(n!=null?y(n,"indent"):n))!=null?o:r,typeof o===c?o.call(u,{name:"indent",hash:{},data:t,loc:{start:{line:48,column:8},end:{line:48,column:18}}}):o))+`return payload
|
|
556
|
+
`},6:function(l,n,i,m,t,a,e){var s,o=l.lookupProperty||function(u,r){if(Object.prototype.hasOwnProperty.call(u,r))return u[r]};return(s=o(i,"if").call(n??(l.nullContext||{}),n!=null?o(n,"isNullableOrOptional"):n,{name:"if",hash:{},fn:l.program(7,t,0,a,e),inverse:l.program(23,t,0,a,e),data:t,loc:{start:{line:16,column:0},end:{line:46,column:7}}}))!=null?s:""},7:function(l,n,i,m,t,a,e){var s,o,u=l.lambda,r=l.escapeExpression,c=n??(l.nullContext||{}),f=l.hooks.helperMissing,y="function",p=l.lookupProperty||function(g,w){if(Object.prototype.hasOwnProperty.call(g,w))return g[w]};return" "+r(u(e[1]!=null?p(e[1],"indent"):e[1],n))+"if let "+r((o=(o=p(i,"name")||(n!=null?p(n,"name"):n))!=null?o:f,typeof o===y?o.call(c,{name:"name",hash:{},data:t,loc:{start:{line:17,column:28},end:{line:17,column:36}}}):o))+" = "+r((o=(o=p(i,"name")||(n!=null?p(n,"name"):n))!=null?o:f,typeof o===y?o.call(c,{name:"name",hash:{},data:t,loc:{start:{line:17,column:39},end:{line:17,column:47}}}):o))+` {
|
|
557
|
+
`+((s=p(i,"if").call(c,n!=null?p(n,"isArrayOfEnums"):n,{name:"if",hash:{},fn:l.program(8,t,0,a,e),inverse:l.program(10,t,0,a,e),data:t,loc:{start:{line:18,column:0},end:{line:28,column:7}}}))!=null?s:"")+((s=p(i,"unless").call(c,n!=null?p(n,"isOptional"):n,{name:"unless",hash:{},fn:l.program(21,t,0,a,e),inverse:l.noop,data:t,loc:{start:{line:29,column:0},end:{line:32,column:11}}}))!=null?s:"")+" "+r(u(e[1]!=null?p(e[1],"indent"):e[1],n))+` }
|
|
558
|
+
`},8:function(l,n,i,m,t,a,e){var s,o,u=l.escapeExpression,r=n??(l.nullContext||{}),c=l.hooks.helperMissing,f="function",y=l.lookupProperty||function(p,g){if(Object.prototype.hasOwnProperty.call(p,g))return p[g]};return" "+u(l.lambda(e[1]!=null?y(e[1],"indent"):e[1],n))+'payload["'+((s=(o=(o=y(i,"jsonName")||(n!=null?y(n,"jsonName"):n))!=null?o:c,typeof o===f?o.call(r,{name:"jsonName",hash:{},data:t,loc:{start:{line:19,column:34},end:{line:19,column:48}}}):o))!=null?s:"")+'"] = '+u((o=(o=y(i,"name")||(n!=null?y(n,"name"):n))!=null?o:c,typeof o===f?o.call(r,{name:"name",hash:{},data:t,loc:{start:{line:19,column:53},end:{line:19,column:61}}}):o))+`.map { $0.rawValue }
|
|
559
|
+
`},10:function(l,n,i,m,t,a,e){var s,o=l.lookupProperty||function(u,r){if(Object.prototype.hasOwnProperty.call(u,r))return u[r]};return(s=o(i,"if").call(n??(l.nullContext||{}),n!=null?o(n,"isArrayOfObjects"):n,{name:"if",hash:{},fn:l.program(11,t,0,a,e),inverse:l.program(13,t,0,a,e),data:t,loc:{start:{line:20,column:0},end:{line:28,column:0}}}))!=null?s:""},11:function(l,n,i,m,t,a,e){var s,o,u=l.escapeExpression,r=n??(l.nullContext||{}),c=l.hooks.helperMissing,f="function",y=l.lookupProperty||function(p,g){if(Object.prototype.hasOwnProperty.call(p,g))return p[g]};return" "+u(l.lambda(e[1]!=null?y(e[1],"indent"):e[1],n))+'payload["'+((s=(o=(o=y(i,"jsonName")||(n!=null?y(n,"jsonName"):n))!=null?o:c,typeof o===f?o.call(r,{name:"jsonName",hash:{},data:t,loc:{start:{line:21,column:34},end:{line:21,column:48}}}):o))!=null?s:"")+'"] = '+u((o=(o=y(i,"name")||(n!=null?y(n,"name"):n))!=null?o:c,typeof o===f?o.call(r,{name:"name",hash:{},data:t,loc:{start:{line:21,column:53},end:{line:21,column:61}}}):o))+`.map { $0.payload }
|
|
560
|
+
`},13:function(l,n,i,m,t,a,e){var s,o=l.lookupProperty||function(u,r){if(Object.prototype.hasOwnProperty.call(u,r))return u[r]};return(s=o(i,"if").call(n??(l.nullContext||{}),n!=null?o(n,"isEnum"):n,{name:"if",hash:{},fn:l.program(14,t,0,a,e),inverse:l.program(16,t,0,a,e),data:t,loc:{start:{line:22,column:0},end:{line:28,column:0}}}))!=null?s:""},14:function(l,n,i,m,t,a,e){var s,o,u=l.escapeExpression,r=n??(l.nullContext||{}),c=l.hooks.helperMissing,f="function",y=l.lookupProperty||function(p,g){if(Object.prototype.hasOwnProperty.call(p,g))return p[g]};return" "+u(l.lambda(e[1]!=null?y(e[1],"indent"):e[1],n))+'payload["'+((s=(o=(o=y(i,"jsonName")||(n!=null?y(n,"jsonName"):n))!=null?o:c,typeof o===f?o.call(r,{name:"jsonName",hash:{},data:t,loc:{start:{line:23,column:34},end:{line:23,column:48}}}):o))!=null?s:"")+'"] = '+u((o=(o=y(i,"name")||(n!=null?y(n,"name"):n))!=null?o:c,typeof o===f?o.call(r,{name:"name",hash:{},data:t,loc:{start:{line:23,column:53},end:{line:23,column:61}}}):o))+`.rawValue
|
|
561
|
+
`},16:function(l,n,i,m,t,a,e){var s,o=l.lookupProperty||function(u,r){if(Object.prototype.hasOwnProperty.call(u,r))return u[r]};return(s=o(i,"if").call(n??(l.nullContext||{}),n!=null?o(n,"isObject"):n,{name:"if",hash:{},fn:l.program(17,t,0,a,e),inverse:l.program(19,t,0,a,e),data:t,loc:{start:{line:24,column:0},end:{line:28,column:0}}}))!=null?s:""},17:function(l,n,i,m,t,a,e){var s,o,u=l.escapeExpression,r=n??(l.nullContext||{}),c=l.hooks.helperMissing,f="function",y=l.lookupProperty||function(p,g){if(Object.prototype.hasOwnProperty.call(p,g))return p[g]};return" "+u(l.lambda(e[1]!=null?y(e[1],"indent"):e[1],n))+'payload["'+((s=(o=(o=y(i,"jsonName")||(n!=null?y(n,"jsonName"):n))!=null?o:c,typeof o===f?o.call(r,{name:"jsonName",hash:{},data:t,loc:{start:{line:25,column:34},end:{line:25,column:48}}}):o))!=null?s:"")+'"] = '+u((o=(o=y(i,"name")||(n!=null?y(n,"name"):n))!=null?o:c,typeof o===f?o.call(r,{name:"name",hash:{},data:t,loc:{start:{line:25,column:53},end:{line:25,column:61}}}):o))+`.payload
|
|
562
|
+
`},19:function(l,n,i,m,t,a,e){var s,o,u=l.escapeExpression,r=n??(l.nullContext||{}),c=l.hooks.helperMissing,f="function",y=l.lookupProperty||function(p,g){if(Object.prototype.hasOwnProperty.call(p,g))return p[g]};return" "+u(l.lambda(e[1]!=null?y(e[1],"indent"):e[1],n))+'payload["'+((s=(o=(o=y(i,"jsonName")||(n!=null?y(n,"jsonName"):n))!=null?o:c,typeof o===f?o.call(r,{name:"jsonName",hash:{},data:t,loc:{start:{line:27,column:34},end:{line:27,column:48}}}):o))!=null?s:"")+'"] = '+u((o=(o=y(i,"name")||(n!=null?y(n,"name"):n))!=null?o:c,typeof o===f?o.call(r,{name:"name",hash:{},data:t,loc:{start:{line:27,column:53},end:{line:27,column:61}}}):o))+`
|
|
563
|
+
`},21:function(l,n,i,m,t,a,e){var s,o,u=l.lambda,r=l.escapeExpression,c=l.lookupProperty||function(f,y){if(Object.prototype.hasOwnProperty.call(f,y))return f[y]};return" "+r(u(e[1]!=null?c(e[1],"indent"):e[1],n))+` } else {
|
|
564
|
+
`+r(u(e[1]!=null?c(e[1],"indent"):e[1],n))+'payload["'+((s=(o=(o=c(i,"jsonName")||(n!=null?c(n,"jsonName"):n))!=null?o:l.hooks.helperMissing,typeof o=="function"?o.call(n??(l.nullContext||{}),{name:"jsonName",hash:{},data:t,loc:{start:{line:31,column:34},end:{line:31,column:48}}}):o))!=null?s:"")+`"] = NSNull()
|
|
565
|
+
`},23:function(l,n,i,m,t,a,e){var s,o=l.lookupProperty||function(u,r){if(Object.prototype.hasOwnProperty.call(u,r))return u[r]};return(s=o(i,"if").call(n??(l.nullContext||{}),n!=null?o(n,"isArrayOfEnums"):n,{name:"if",hash:{},fn:l.program(24,t,0,a,e),inverse:l.program(26,t,0,a,e),data:t,loc:{start:{line:35,column:0},end:{line:45,column:7}}}))!=null?s:""},24:function(l,n,i,m,t,a,e){var s,o,u=l.escapeExpression,r=n??(l.nullContext||{}),c=l.hooks.helperMissing,f="function",y=l.lookupProperty||function(p,g){if(Object.prototype.hasOwnProperty.call(p,g))return p[g]};return" "+u(l.lambda(e[1]!=null?y(e[1],"indent"):e[1],n))+'payload["'+((s=(o=(o=y(i,"jsonName")||(n!=null?y(n,"jsonName"):n))!=null?o:c,typeof o===f?o.call(r,{name:"jsonName",hash:{},data:t,loc:{start:{line:36,column:30},end:{line:36,column:44}}}):o))!=null?s:"")+'"] = '+u((o=(o=y(i,"name")||(n!=null?y(n,"name"):n))!=null?o:c,typeof o===f?o.call(r,{name:"name",hash:{},data:t,loc:{start:{line:36,column:49},end:{line:36,column:57}}}):o))+`.map { $0.rawValue }
|
|
566
|
+
`},26:function(l,n,i,m,t,a,e){var s,o=l.lookupProperty||function(u,r){if(Object.prototype.hasOwnProperty.call(u,r))return u[r]};return(s=o(i,"if").call(n??(l.nullContext||{}),n!=null?o(n,"isArrayOfObjects"):n,{name:"if",hash:{},fn:l.program(27,t,0,a,e),inverse:l.program(29,t,0,a,e),data:t,loc:{start:{line:37,column:0},end:{line:45,column:0}}}))!=null?s:""},27:function(l,n,i,m,t,a,e){var s,o,u=l.escapeExpression,r=n??(l.nullContext||{}),c=l.hooks.helperMissing,f="function",y=l.lookupProperty||function(p,g){if(Object.prototype.hasOwnProperty.call(p,g))return p[g]};return" "+u(l.lambda(e[1]!=null?y(e[1],"indent"):e[1],n))+'payload["'+((s=(o=(o=y(i,"jsonName")||(n!=null?y(n,"jsonName"):n))!=null?o:c,typeof o===f?o.call(r,{name:"jsonName",hash:{},data:t,loc:{start:{line:38,column:30},end:{line:38,column:44}}}):o))!=null?s:"")+'"] = '+u((o=(o=y(i,"name")||(n!=null?y(n,"name"):n))!=null?o:c,typeof o===f?o.call(r,{name:"name",hash:{},data:t,loc:{start:{line:38,column:49},end:{line:38,column:57}}}):o))+`.map { $0.payload }
|
|
567
|
+
`},29:function(l,n,i,m,t,a,e){var s,o=l.lookupProperty||function(u,r){if(Object.prototype.hasOwnProperty.call(u,r))return u[r]};return(s=o(i,"if").call(n??(l.nullContext||{}),n!=null?o(n,"isEnum"):n,{name:"if",hash:{},fn:l.program(30,t,0,a,e),inverse:l.program(32,t,0,a,e),data:t,loc:{start:{line:39,column:0},end:{line:45,column:0}}}))!=null?s:""},30:function(l,n,i,m,t,a,e){var s,o,u=l.escapeExpression,r=n??(l.nullContext||{}),c=l.hooks.helperMissing,f="function",y=l.lookupProperty||function(p,g){if(Object.prototype.hasOwnProperty.call(p,g))return p[g]};return" "+u(l.lambda(e[1]!=null?y(e[1],"indent"):e[1],n))+'payload["'+((s=(o=(o=y(i,"jsonName")||(n!=null?y(n,"jsonName"):n))!=null?o:c,typeof o===f?o.call(r,{name:"jsonName",hash:{},data:t,loc:{start:{line:40,column:30},end:{line:40,column:44}}}):o))!=null?s:"")+'"] = '+u((o=(o=y(i,"name")||(n!=null?y(n,"name"):n))!=null?o:c,typeof o===f?o.call(r,{name:"name",hash:{},data:t,loc:{start:{line:40,column:49},end:{line:40,column:57}}}):o))+`.rawValue
|
|
568
|
+
`},32:function(l,n,i,m,t,a,e){var s,o=l.lookupProperty||function(u,r){if(Object.prototype.hasOwnProperty.call(u,r))return u[r]};return(s=o(i,"if").call(n??(l.nullContext||{}),n!=null?o(n,"isObject"):n,{name:"if",hash:{},fn:l.program(33,t,0,a,e),inverse:l.program(35,t,0,a,e),data:t,loc:{start:{line:41,column:0},end:{line:45,column:0}}}))!=null?s:""},33:function(l,n,i,m,t,a,e){var s,o,u=l.escapeExpression,r=n??(l.nullContext||{}),c=l.hooks.helperMissing,f="function",y=l.lookupProperty||function(p,g){if(Object.prototype.hasOwnProperty.call(p,g))return p[g]};return" "+u(l.lambda(e[1]!=null?y(e[1],"indent"):e[1],n))+'payload["'+((s=(o=(o=y(i,"jsonName")||(n!=null?y(n,"jsonName"):n))!=null?o:c,typeof o===f?o.call(r,{name:"jsonName",hash:{},data:t,loc:{start:{line:42,column:30},end:{line:42,column:44}}}):o))!=null?s:"")+'"] = '+u((o=(o=y(i,"name")||(n!=null?y(n,"name"):n))!=null?o:c,typeof o===f?o.call(r,{name:"name",hash:{},data:t,loc:{start:{line:42,column:49},end:{line:42,column:57}}}):o))+`.payload
|
|
569
|
+
`},35:function(l,n,i,m,t,a,e){var s,o,u=l.escapeExpression,r=n??(l.nullContext||{}),c=l.hooks.helperMissing,f="function",y=l.lookupProperty||function(p,g){if(Object.prototype.hasOwnProperty.call(p,g))return p[g]};return" "+u(l.lambda(e[1]!=null?y(e[1],"indent"):e[1],n))+'payload["'+((s=(o=(o=y(i,"jsonName")||(n!=null?y(n,"jsonName"):n))!=null?o:c,typeof o===f?o.call(r,{name:"jsonName",hash:{},data:t,loc:{start:{line:44,column:30},end:{line:44,column:44}}}):o))!=null?s:"")+'"] = '+u((o=(o=y(i,"name")||(n!=null?y(n,"name"):n))!=null?o:c,typeof o===f?o.call(r,{name:"name",hash:{},data:t,loc:{start:{line:44,column:49},end:{line:44,column:57}}}):o))+`
|
|
570
|
+
`},37:function(l,n,i,m,t){var a,e,s=n??(l.nullContext||{}),o=l.hooks.helperMissing,u="function",r=l.escapeExpression,c=l.lookupProperty||function(f,y){if(Object.prototype.hasOwnProperty.call(f,y))return f[y]};return`
|
|
571
|
+
// MARK: - `+r((e=(e=c(i,"typeName")||(n!=null?c(n,"typeName"):n))!=null?e:o,typeof e===u?e.call(s,{name:"typeName",hash:{},data:t,loc:{start:{line:54,column:11},end:{line:54,column:23}}}):e))+`
|
|
572
|
+
|
|
573
|
+
`+((a=c(i,"if").call(s,n!=null?c(n,"description"):n,{name:"if",hash:{},fn:l.program(38,t,0),inverse:l.noop,data:t,loc:{start:{line:56,column:0},end:{line:58,column:7}}}))!=null?a:"")+"/// Schema: `"+r((e=(e=c(i,"igluUrl")||(n!=null?c(n,"igluUrl"):n))!=null?e:o,typeof e===u?e.call(s,{name:"igluUrl",hash:{},data:t,loc:{start:{line:59,column:13},end:{line:59,column:24}}}):e))+"`\n///\n/// Example:\n/// ```swift\n/// let data = "+r((e=(e=c(i,"typeName")||(n!=null?c(n,"typeName"):n))!=null?e:o,typeof e===u?e.call(s,{name:"typeName",hash:{},data:t,loc:{start:{line:63,column:15},end:{line:63,column:27}}}):e))+`(
|
|
574
|
+
`+((a=c(i,"each").call(s,n!=null?c(n,"properties"):n,{name:"each",hash:{},fn:l.program(40,t,0),inverse:l.noop,data:t,loc:{start:{line:64,column:0},end:{line:66,column:9}}}))!=null?a:"")+`/// )
|
|
512
575
|
/// // Track as an event
|
|
513
576
|
/// Snowplow.defaultTracker()?.track(data.toEvent())
|
|
514
577
|
/// // Add as an entity to another event
|
|
@@ -516,15 +579,15 @@ data class EventSpecification(
|
|
|
516
579
|
/// event.entities.append(data.toEntity())
|
|
517
580
|
/// Snowplow.defaultTracker()?.track(event)
|
|
518
581
|
/// \`\`\`
|
|
519
|
-
struct `+
|
|
582
|
+
struct `+r((e=(e=c(i,"typeName")||(n!=null?c(n,"typeName"):n))!=null?e:o,typeof e===u?e.call(s,{name:"typeName",hash:{},data:t,loc:{start:{line:75,column:7},end:{line:75,column:19}}}):e))+` {
|
|
520
583
|
|
|
521
|
-
`+((
|
|
584
|
+
`+((a=l.invokePartial(c(m,"structProperties"),n,{name:"structProperties",data:t,helpers:i,partials:m,decorators:l.decorators}))!=null?a:"")+`
|
|
522
585
|
private var schema: String {
|
|
523
|
-
return "`+
|
|
586
|
+
return "`+r((e=(e=c(i,"igluUrl")||(n!=null?c(n,"igluUrl"):n))!=null?e:o,typeof e===u?e.call(s,{name:"igluUrl",hash:{},data:t,loc:{start:{line:80,column:16},end:{line:80,column:27}}}):e))+`"
|
|
524
587
|
}
|
|
525
588
|
|
|
526
589
|
private var payload: [String : Any] {
|
|
527
|
-
`+((
|
|
590
|
+
`+((a=l.invokePartial(c(m,"createAndReturnPayloadDictionary"),n,{name:"createAndReturnPayloadDictionary",data:t,helpers:i,partials:m,decorators:l.decorators}))!=null?a:"")+` }
|
|
528
591
|
|
|
529
592
|
/// Creates an event instance to be tracked by the tracker.
|
|
530
593
|
func toEvent() -> SelfDescribing {
|
|
@@ -537,45 +600,45 @@ struct `+t((a=(a=m(i,"typeName")||(n!=null?m(n,"typeName"):n))!=null?a:o,typeof
|
|
|
537
600
|
}
|
|
538
601
|
|
|
539
602
|
}
|
|
540
|
-
`},38:function(l,n,i,
|
|
541
|
-
`},40:function(l,n,i,
|
|
542
|
-
`},41:function(l,n,i,
|
|
543
|
-
// MARK: - `+
|
|
603
|
+
`},38:function(l,n,i,m,t){var a,e,s=l.lookupProperty||function(o,u){if(Object.prototype.hasOwnProperty.call(o,u))return o[u]};return"/// "+((a=(e=(e=s(i,"description")||(n!=null?s(n,"description"):n))!=null?e:l.hooks.helperMissing,typeof e=="function"?e.call(n??(l.nullContext||{}),{name:"description",hash:{},data:t,loc:{start:{line:57,column:4},end:{line:57,column:21}}}):e))!=null?a:"")+`
|
|
604
|
+
`},40:function(l,n,i,m,t){var a,e,s=n??(l.nullContext||{}),o=l.hooks.helperMissing,u="function",r=l.escapeExpression,c=l.lookupProperty||function(f,y){if(Object.prototype.hasOwnProperty.call(f,y))return f[y]};return"/// "+r((e=(e=c(i,"name")||(n!=null?c(n,"name"):n))!=null?e:o,typeof e===u?e.call(s,{name:"name",hash:{},data:t,loc:{start:{line:65,column:8},end:{line:65,column:16}}}):e))+": "+r((e=(e=c(i,"name")||(n!=null?c(n,"name"):n))!=null?e:o,typeof e===u?e.call(s,{name:"name",hash:{},data:t,loc:{start:{line:65,column:18},end:{line:65,column:26}}}):e))+((a=c(i,"unless").call(s,t&&c(t,"last"),{name:"unless",hash:{},fn:l.program(41,t,0),inverse:l.noop,data:t,loc:{start:{line:65,column:26},end:{line:65,column:56}}}))!=null?a:"")+`
|
|
605
|
+
`},41:function(l,n,i,m,t){return", "},43:function(l,n,i,m,t){var a,e,s=n??(l.nullContext||{}),o=l.hooks.helperMissing,u="function",r=l.escapeExpression,c=l.lookupProperty||function(f,y){if(Object.prototype.hasOwnProperty.call(f,y))return f[y]};return`
|
|
606
|
+
// MARK: - `+r((e=(e=c(i,"typeName")||(n!=null?c(n,"typeName"):n))!=null?e:o,typeof e===u?e.call(s,{name:"typeName",hash:{},data:t,loc:{start:{line:147,column:11},end:{line:147,column:23}}}):e))+`
|
|
544
607
|
|
|
545
|
-
`+((
|
|
608
|
+
`+((a=c(i,"if").call(s,n!=null?c(n,"description"):n,{name:"if",hash:{},fn:l.program(38,t,0),inverse:l.noop,data:t,loc:{start:{line:149,column:0},end:{line:151,column:7}}}))!=null?a:"")+"struct "+r((e=(e=c(i,"typeName")||(n!=null?c(n,"typeName"):n))!=null?e:o,typeof e===u?e.call(s,{name:"typeName",hash:{},data:t,loc:{start:{line:152,column:7},end:{line:152,column:19}}}):e))+` {
|
|
546
609
|
|
|
547
|
-
`+((
|
|
610
|
+
`+((a=l.invokePartial(c(m,"structProperties"),n,{name:"structProperties",data:t,helpers:i,partials:m,decorators:l.decorators}))!=null?a:"")+`
|
|
548
611
|
var payload: [String : Any] {
|
|
549
|
-
`+((
|
|
612
|
+
`+((a=l.invokePartial(c(m,"createAndReturnPayloadDictionary"),n,{name:"createAndReturnPayloadDictionary",data:t,helpers:i,partials:m,decorators:l.decorators}))!=null?a:"")+` }
|
|
550
613
|
|
|
551
614
|
}
|
|
552
|
-
`},45:function(l,n,i,
|
|
553
|
-
// MARK: - `+
|
|
615
|
+
`},45:function(l,n,i,m,t){var a,e,s=n??(l.nullContext||{}),o=l.hooks.helperMissing,u="function",r=l.escapeExpression,c=l.lookupProperty||function(f,y){if(Object.prototype.hasOwnProperty.call(f,y))return f[y]};return`
|
|
616
|
+
// MARK: - `+r((e=(e=c(i,"name")||(n!=null?c(n,"name"):n))!=null?e:o,typeof e===u?e.call(s,{name:"name",hash:{},data:t,loc:{start:{line:165,column:11},end:{line:165,column:19}}}):e))+`
|
|
554
617
|
|
|
555
|
-
`+((
|
|
556
|
-
`+((
|
|
557
|
-
`},46:function(l,n,i,
|
|
558
|
-
`},48:function(l,n,i,
|
|
559
|
-
extension `+s(
|
|
560
|
-
/// Creates an event with entities for a `+s(
|
|
561
|
-
/// `+s((u(i,"addEventSpecificationIdentifier")||n&&u(n,"addEventSpecificationIdentifier")||l.hooks.helperMissing).call(o,n!=null?u(n,"id"):n,{name:"addEventSpecificationIdentifier",hash:{},data:
|
|
562
|
-
`+((
|
|
618
|
+
`+((a=c(i,"if").call(s,n!=null?c(n,"description"):n,{name:"if",hash:{},fn:l.program(38,t,0),inverse:l.noop,data:t,loc:{start:{line:167,column:0},end:{line:169,column:7}}}))!=null?a:"")+"enum "+r((e=(e=c(i,"name")||(n!=null?c(n,"name"):n))!=null?e:o,typeof e===u?e.call(s,{name:"name",hash:{},data:t,loc:{start:{line:170,column:5},end:{line:170,column:13}}}):e))+`: String {
|
|
619
|
+
`+((a=c(i,"each").call(s,n!=null?c(n,"cases"):n,{name:"each",hash:{},fn:l.program(46,t,0),inverse:l.noop,data:t,loc:{start:{line:171,column:0},end:{line:173,column:9}}}))!=null?a:"")+`}
|
|
620
|
+
`},46:function(l,n,i,m,t){var a,e,s=n??(l.nullContext||{}),o=l.hooks.helperMissing,u="function",r=l.lookupProperty||function(c,f){if(Object.prototype.hasOwnProperty.call(c,f))return c[f]};return" case "+l.escapeExpression((e=(e=r(i,"name")||(n!=null?r(n,"name"):n))!=null?e:o,typeof e===u?e.call(s,{name:"name",hash:{},data:t,loc:{start:{line:172,column:9},end:{line:172,column:17}}}):e))+' = "'+((a=(e=(e=r(i,"jsonName")||(n!=null?r(n,"jsonName"):n))!=null?e:o,typeof e===u?e.call(s,{name:"jsonName",hash:{},data:t,loc:{start:{line:172,column:21},end:{line:172,column:35}}}):e))!=null?a:"")+`"
|
|
621
|
+
`},48:function(l,n,i,m,t){var a,e=l.lambda,s=l.escapeExpression,o=n??(l.nullContext||{}),u=l.lookupProperty||function(r,c){if(Object.prototype.hasOwnProperty.call(r,c))return r[c]};return`
|
|
622
|
+
extension `+s(e(n!=null?u(n,"event"):n,n))+` {
|
|
623
|
+
/// Creates an event with entities for a `+s(e(n!=null?u(n,"name"):n,n))+` event specification.
|
|
624
|
+
/// `+s((u(i,"addEventSpecificationIdentifier")||n&&u(n,"addEventSpecificationIdentifier")||l.hooks.helperMissing).call(o,n!=null?u(n,"id"):n,{name:"addEventSpecificationIdentifier",hash:{},data:t,loc:{start:{line:180,column:8},end:{line:180,column:51}}}))+"\n /// Example:\n /// ```swift\n /// let data = "+s(e(n!=null?u(n,"event"):n,n))+`(...)
|
|
625
|
+
`+((a=u(i,"each").call(o,n!=null?u(n,"entities"):n,{name:"each",hash:{},fn:l.program(49,t,0),inverse:l.noop,data:t,loc:{start:{line:184,column:0},end:{line:186,column:9}}}))!=null?a:"")+" /// let event = data.to"+s(e(n!=null?u(n,"name"):n,n))+"("+((a=u(i,"each").call(o,n!=null?u(n,"entities"):n,{name:"each",hash:{},fn:l.program(51,t,0),inverse:l.noop,data:t,loc:{start:{line:187,column:41},end:{line:187,column:116}}}))!=null?a:"")+`)
|
|
563
626
|
/// // Track as an event
|
|
564
627
|
/// Snowplow.defaultTracker()?.track(event)
|
|
565
628
|
/// \`\`\`
|
|
566
|
-
func to`+s(
|
|
629
|
+
func to`+s(e(n!=null?u(n,"name"):n,n))+"("+((a=u(i,"each").call(o,n!=null?u(n,"entities"):n,{name:"each",hash:{},fn:l.program(53,t,0),inverse:l.noop,data:t,loc:{start:{line:191,column:25},end:{line:191,column:114}}}))!=null?a:"")+`) -> SelfDescribing {
|
|
567
630
|
let event = toEvent()
|
|
568
|
-
let eventSpec = EventSpecification(id: "`+s(
|
|
569
|
-
`+((
|
|
631
|
+
let eventSpec = EventSpecification(id: "`+s(e(n!=null?u(n,"id"):n,n))+`")
|
|
632
|
+
`+((a=u(i,"each").call(o,n!=null?u(n,"entities"):n,{name:"each",hash:{},fn:l.program(55,t,0),inverse:l.noop,data:t,loc:{start:{line:194,column:0},end:{line:196,column:9}}}))!=null?a:"")+` event.entities.append(eventSpec.toEntity())
|
|
570
633
|
return event
|
|
571
634
|
}
|
|
572
635
|
}
|
|
573
|
-
`},49:function(l,n,i,
|
|
574
|
-
`},51:function(l,n,i,
|
|
575
|
-
`},compiler:[8,">= 4.3.0"],main:function(l,n,i,
|
|
636
|
+
`},49:function(l,n,i,m,t){var a=l.lambda,e=l.escapeExpression;return" /// let data"+e(a(n,n))+" = "+e(a(n,n))+`(...)
|
|
637
|
+
`},51:function(l,n,i,m,t){var a,e=l.lookupProperty||function(s,o){if(Object.prototype.hasOwnProperty.call(s,o))return s[o]};return"data"+l.escapeExpression(l.lambda(n,n))+((a=e(i,"unless").call(n??(l.nullContext||{}),t&&e(t,"last"),{name:"unless",hash:{},fn:l.program(41,t,0),inverse:l.noop,data:t,loc:{start:{line:187,column:77},end:{line:187,column:107}}}))!=null?a:"")},53:function(l,n,i,m,t){var a,e=l.lambda,s=l.escapeExpression,o=l.lookupProperty||function(u,r){if(Object.prototype.hasOwnProperty.call(u,r))return u[r]};return"_ entity"+s(e(n,n))+": "+s(e(n,n))+((a=o(i,"unless").call(n??(l.nullContext||{}),t&&o(t,"last"),{name:"unless",hash:{},fn:l.program(41,t,0),inverse:l.noop,data:t,loc:{start:{line:191,column:75},end:{line:191,column:105}}}))!=null?a:"")},55:function(l,n,i,m,t){return" event.entities.append(entity"+l.escapeExpression(l.lambda(n,n))+`.toEntity())
|
|
638
|
+
`},compiler:[8,">= 4.3.0"],main:function(l,n,i,m,t,a,e){var s,o,u,r=n??(l.nullContext||{}),c=l.hooks.helperMissing,f="function",y=l.hooks.blockHelperMissing,p=l.lookupProperty||function(w,D){if(Object.prototype.hasOwnProperty.call(w,D))return w[D]},g=`import Foundation
|
|
576
639
|
import SnowplowTracker
|
|
577
640
|
|
|
578
|
-
`;return s=(o=(o=p(i,"type")||(n!=null?p(n,"type"):n))!=null?o:
|
|
641
|
+
`;return s=(o=(o=p(i,"type")||(n!=null?p(n,"type"):n))!=null?o:c,u={name:"type",hash:{},fn:l.program(37,t,0,a,e),inverse:l.noop,data:t,loc:{start:{line:51,column:0},end:{line:98,column:9}}},typeof o===f?o.call(r,u):o),p(i,"type")||(s=y.call(n,s,u)),s!=null&&(g+=s),g+=`
|
|
579
642
|
// MARK: - Event Specification
|
|
580
643
|
|
|
581
644
|
/// Entity schema for referencing an event specification
|
|
@@ -619,22 +682,22 @@ struct EventSpecification {
|
|
|
619
682
|
}
|
|
620
683
|
|
|
621
684
|
}
|
|
622
|
-
`,s=(o=(o=p(i,"nestedTypes")||(n!=null?p(n,"nestedTypes"):n))!=null?o:
|
|
685
|
+
`,s=(o=(o=p(i,"nestedTypes")||(n!=null?p(n,"nestedTypes"):n))!=null?o:c,u={name:"nestedTypes",hash:{},fn:l.program(43,t,0,a,e),inverse:l.noop,data:t,loc:{start:{line:144,column:0},end:{line:161,column:16}}},typeof o===f?o.call(r,u):o),p(i,"nestedTypes")||(s=y.call(n,s,u)),s!=null&&(g+=s),g+((s=p(i,"each").call(r,n!=null?p(n,"enums"):n,{name:"each",hash:{},fn:l.program(45,t,0,a,e),inverse:l.noop,data:t,loc:{start:{line:162,column:0},end:{line:175,column:9}}}))!=null?s:"")+((s=p(i,"each").call(r,n!=null?p(n,"eventSpecifications"):n,{name:"each",hash:{},fn:l.program(48,t,0,a,e),inverse:l.noop,data:t,loc:{start:{line:176,column:0},end:{line:201,column:9}}}))!=null?s:"")},main_d:function(l,n,i,m,t,a,e){var s=i.decorators,o=i.lookupProperty||function(u,r){if(Object.prototype.hasOwnProperty.call(u,r))return u[r]};return l=o(s,"inline")(l,n,i,{name:"inline",hash:{},fn:i.program(1,t,0,a,e),inverse:i.noop,args:["structProperties"],data:t,loc:{start:{line:3,column:0},end:{line:11,column:11}}})||l,l=o(s,"inline")(l,n,i,{name:"inline",hash:{},fn:i.program(5,t,0,a,e),inverse:i.noop,args:["createAndReturnPayloadDictionary"],data:t,loc:{start:{line:12,column:0},end:{line:49,column:11}}})||l,l},useDecorators:!0,usePartial:!0,useData:!0,useDepths:!0}});var Vn=O((Le,Gn)=>{"use strict";Gn.exports={id:{language:"go",tracker:"snowplow-golang-tracker"},1:function(l,n,i,m,t){var a,e=n??(l.nullContext||{}),s=l.hooks.helperMissing,o=l.escapeExpression,u="function",r=l.lookupProperty||function(c,f){if(Object.prototype.hasOwnProperty.call(c,f))return c[f]};return`
|
|
623
686
|
// SnowplowFormat implements SnowplowApplicable
|
|
624
|
-
func (`+o((
|
|
687
|
+
func (`+o((r(i,"startLow")||n&&r(n,"startLow")||s).call(e,n!=null?r(n,"typeName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:83,column:6},end:{line:83,column:27}}}))+" "+o((a=(a=r(i,"typeName")||(n!=null?r(n,"typeName"):n))!=null?a:s,typeof a===u?a.call(e,{name:"typeName",hash:{},data:t,loc:{start:{line:83,column:28},end:{line:83,column:40}}}):a))+`) SnowplowFormat() (*sp.SelfDescribingJson, error) {
|
|
625
688
|
var decodedMap map[string]interface{}
|
|
626
|
-
err := mapstructure.Decode(`+o((
|
|
689
|
+
err := mapstructure.Decode(`+o((r(i,"startLow")||n&&r(n,"startLow")||s).call(e,n!=null?r(n,"typeName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:85,column:28},end:{line:85,column:49}}}))+`, &decodedMap)
|
|
627
690
|
if err != nil {
|
|
628
691
|
return nil, err
|
|
629
692
|
}
|
|
630
693
|
|
|
631
|
-
sdj := sp.InitSelfDescribingJson("`+o((
|
|
694
|
+
sdj := sp.InitSelfDescribingJson("`+o((a=(a=r(i,"igluUrl")||(n!=null?r(n,"igluUrl"):n))!=null?a:s,typeof a===u?a.call(e,{name:"igluUrl",hash:{},data:t,loc:{start:{line:90,column:35},end:{line:90,column:46}}}):a))+`", decodedMap)
|
|
632
695
|
return sdj, nil
|
|
633
696
|
}
|
|
634
697
|
|
|
635
|
-
// Track`+o((
|
|
636
|
-
func Track`+o((
|
|
637
|
-
sdj, err := `+o((
|
|
698
|
+
// Track`+o((a=(a=r(i,"typeName")||(n!=null?r(n,"typeName"):n))!=null?a:s,typeof a===u?a.call(e,{name:"typeName",hash:{},data:t,loc:{start:{line:94,column:8},end:{line:94,column:20}}}):a))+" tracks a "+o((a=(a=r(i,"typeName")||(n!=null?r(n,"typeName"):n))!=null?a:s,typeof a===u?a.call(e,{name:"typeName",hash:{},data:t,loc:{start:{line:94,column:30},end:{line:94,column:42}}}):a))+`
|
|
699
|
+
func Track`+o((a=(a=r(i,"typeName")||(n!=null?r(n,"typeName"):n))!=null?a:s,typeof a===u?a.call(e,{name:"typeName",hash:{},data:t,loc:{start:{line:95,column:10},end:{line:95,column:22}}}):a))+"(tracker *sp.Tracker, "+o((r(i,"startLow")||n&&r(n,"startLow")||s).call(e,n!=null?r(n,"typeName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:95,column:44},end:{line:95,column:65}}}))+" "+o((a=(a=r(i,"typeName")||(n!=null?r(n,"typeName"):n))!=null?a:s,typeof a===u?a.call(e,{name:"typeName",hash:{},data:t,loc:{start:{line:95,column:66},end:{line:95,column:78}}}):a))+`, opts ...option) error {
|
|
700
|
+
sdj, err := `+o((r(i,"startLow")||n&&r(n,"startLow")||s).call(e,n!=null?r(n,"typeName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:96,column:13},end:{line:96,column:34}}}))+`.SnowplowFormat()
|
|
638
701
|
if err != nil {
|
|
639
702
|
return err
|
|
640
703
|
}
|
|
@@ -648,13 +711,13 @@ func Track`+o((e=(e=t(i,"typeName")||(n!=null?t(n,"typeName"):n))!=null?e:s,type
|
|
|
648
711
|
return nil
|
|
649
712
|
}
|
|
650
713
|
|
|
651
|
-
`},3:function(l,n,i,
|
|
714
|
+
`},3:function(l,n,i,m,t,a,e){var s,o=l.lambda,u=l.escapeExpression,r=n??(l.nullContext||{}),c=l.hooks.helperMissing,f=l.lookupProperty||function(y,p){if(Object.prototype.hasOwnProperty.call(y,p))return y[p]};return`
|
|
652
715
|
// `+u(o(n!=null?f(n,"name"):n,n))+"Applicable represents a context applicable to "+u(o(n!=null?f(n,"name"):n,n))+` event specification
|
|
653
716
|
type `+u(o(n!=null?f(n,"name"):n,n))+`Applicable interface {
|
|
654
717
|
`+u(o(n!=null?f(n,"name"):n,n))+`Format() (*sp.SelfDescribingJson, error)
|
|
655
718
|
}
|
|
656
719
|
|
|
657
|
-
`+((s=f(i,"each").call(
|
|
720
|
+
`+((s=f(i,"each").call(r,n!=null?f(n,"entities"):n,{name:"each",hash:{},fn:l.program(4,t,0,a,e),inverse:l.noop,data:t,loc:{start:{line:119,column:0},end:{line:126,column:9}}}))!=null?s:"")+`
|
|
658
721
|
// `+u(o(n!=null?f(n,"name"):n,n))+` Event Specification
|
|
659
722
|
type `+u(o(n!=null?f(n,"name"):n,n))+` struct {
|
|
660
723
|
Event `+u(o(n!=null?f(n,"event"):n,n))+`
|
|
@@ -662,9 +725,9 @@ type `+u(o(n!=null?f(n,"name"):n,n))+` struct {
|
|
|
662
725
|
}
|
|
663
726
|
|
|
664
727
|
// Track`+u(o(n!=null?f(n,"name"):n,n))+" tracks "+u(o(n!=null?f(n,"name"):n,n))+` event specification
|
|
665
|
-
// `+u((f(i,"addEventSpecificationIdentifier")||n&&f(n,"addEventSpecificationIdentifier")||
|
|
666
|
-
func Track`+u(o(n!=null?f(n,"name"):n,n))+"(tracker *sp.Tracker, "+u((f(i,"startLow")||n&&f(n,"startLow")||
|
|
667
|
-
event := `+u((f(i,"startLow")||n&&f(n,"startLow")||
|
|
728
|
+
// `+u((f(i,"addEventSpecificationIdentifier")||n&&f(n,"addEventSpecificationIdentifier")||c).call(r,n!=null?f(n,"id"):n,{name:"addEventSpecificationIdentifier",hash:{},data:t,loc:{start:{line:135,column:3},end:{line:135,column:46}}}))+`
|
|
729
|
+
func Track`+u(o(n!=null?f(n,"name"):n,n))+"(tracker *sp.Tracker, "+u((f(i,"startLow")||n&&f(n,"startLow")||c).call(r,n!=null?f(n,"name"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:136,column:45},end:{line:136,column:67}}}))+" "+u(o(n!=null?f(n,"name"):n,n))+`, opts ...option) error {
|
|
730
|
+
event := `+u((f(i,"startLow")||n&&f(n,"startLow")||c).call(r,n!=null?f(n,"name"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:137,column:10},end:{line:137,column:32}}}))+`.Event
|
|
668
731
|
sdj, err := event.SnowplowFormat()
|
|
669
732
|
if err != nil {
|
|
670
733
|
return err
|
|
@@ -682,9 +745,9 @@ func Track`+u(o(n!=null?f(n,"name"):n,n))+"(tracker *sp.Tracker, "+u((f(i,"start
|
|
|
682
745
|
return optErr
|
|
683
746
|
}
|
|
684
747
|
|
|
685
|
-
eventSpecificationCtx := make([]sp.SelfDescribingJson, len(`+u((f(i,"startLow")||n&&f(n,"startLow")||
|
|
748
|
+
eventSpecificationCtx := make([]sp.SelfDescribingJson, len(`+u((f(i,"startLow")||n&&f(n,"startLow")||c).call(r,n!=null?f(n,"name"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:155,column:60},end:{line:155,column:82}}}))+`.Contexts))
|
|
686
749
|
var ctxErr error
|
|
687
|
-
for i, val := range `+u((f(i,"startLow")||n&&f(n,"startLow")||
|
|
750
|
+
for i, val := range `+u((f(i,"startLow")||n&&f(n,"startLow")||c).call(r,n!=null?f(n,"name"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:157,column:21},end:{line:157,column:43}}}))+`.Contexts {
|
|
688
751
|
ctxSdj, ctxErr := val.`+u(o(n!=null?f(n,"name"):n,n))+`Format()
|
|
689
752
|
if ctxErr != nil {
|
|
690
753
|
break
|
|
@@ -707,13 +770,13 @@ func Track`+u(o(n!=null?f(n,"name"):n,n))+"(tracker *sp.Tracker, "+u((f(i,"start
|
|
|
707
770
|
return nil
|
|
708
771
|
}
|
|
709
772
|
|
|
710
|
-
`},4:function(l,n,i,
|
|
711
|
-
// `+o(s(
|
|
712
|
-
func (`+o((
|
|
713
|
-
return `+o((
|
|
773
|
+
`},4:function(l,n,i,m,t,a,e){var s=l.lambda,o=l.escapeExpression,u=n??(l.nullContext||{}),r=l.hooks.helperMissing,c=l.lookupProperty||function(f,y){if(Object.prototype.hasOwnProperty.call(f,y))return f[y]};return`
|
|
774
|
+
// `+o(s(e[1]!=null?c(e[1],"name"):e[1],n))+"Format implements "+o(s(e[1]!=null?c(e[1],"name"):e[1],n))+`Applicable
|
|
775
|
+
func (`+o((c(i,"startLow")||n&&c(n,"startLow")||r).call(u,n,{name:"startLow",hash:{},data:t,loc:{start:{line:122,column:6},end:{line:122,column:23}}}))+" "+o(s(n,n))+") "+o(s(e[1]!=null?c(e[1],"name"):e[1],n))+`Format() (*sp.SelfDescribingJson, error) {
|
|
776
|
+
return `+o((c(i,"startLow")||n&&c(n,"startLow")||r).call(u,n,{name:"startLow",hash:{},data:t,loc:{start:{line:123,column:8},end:{line:123,column:25}}}))+`.SnowplowFormat()
|
|
714
777
|
}
|
|
715
778
|
|
|
716
|
-
`},compiler:[8,">= 4.3.0"],main:function(l,n,i,
|
|
779
|
+
`},compiler:[8,">= 4.3.0"],main:function(l,n,i,m,t,a,e){var s,o,u,r=n??(l.nullContext||{}),c=l.lookupProperty||function(y,p){if(Object.prototype.hasOwnProperty.call(y,p))return y[p]},f=`// SnowplowApplicable signifies ability to be formatted as self-describing json
|
|
717
780
|
type SnowplowApplicable interface {
|
|
718
781
|
// SnowplowFormat constructs a Snowplow SelfDescribingJson
|
|
719
782
|
SnowplowFormat() (*sp.SelfDescribingJson, error)
|
|
@@ -792,8 +855,8 @@ func (eventSpecification EventSpecification) SnowplowFormat() (*sp.SelfDescribin
|
|
|
792
855
|
return sdj, nil
|
|
793
856
|
}
|
|
794
857
|
|
|
795
|
-
`;return s=(o=(o=
|
|
796
|
-
`+((s=
|
|
858
|
+
`;return s=(o=(o=c(i,"type")||(n!=null?c(n,"type"):n))!=null?o:l.hooks.helperMissing,u={name:"type",hash:{},fn:l.program(1,t,0,a,e),inverse:l.noop,data:t,loc:{start:{line:80,column:0},end:{line:110,column:9}}},typeof o=="function"?o.call(r,u):o),c(i,"type")||(s=l.hooks.blockHelperMissing.call(n,s,u)),s!=null&&(f+=s),f+`
|
|
859
|
+
`+((s=c(i,"each").call(r,n!=null?c(n,"eventSpecifications"):n,{name:"each",hash:{},fn:l.program(3,t,0,a,e),inverse:l.noop,data:t,loc:{start:{line:112,column:0},end:{line:180,column:9}}}))!=null?s:"")},useData:!0,useDepths:!0}});var Qn=O((Ce,Hn)=>{"use strict";Hn.exports={id:{language:"typescript",tracker:"@snowplow/react-native-tracker"},1:function(l,n,i,m,t){return`/**
|
|
797
860
|
* Creates a Snowplow Event Specification entity.
|
|
798
861
|
*/
|
|
799
862
|
export function createEventSpecification(eventSpecification: EventSpecification){
|
|
@@ -810,57 +873,57 @@ export function createEventSpecification(eventSpecification: EventSpecification)
|
|
|
810
873
|
interface EventSpecification {
|
|
811
874
|
id: string;
|
|
812
875
|
}
|
|
813
|
-
`},3:function(l,n,i,
|
|
814
|
-
* Track a Snowplow event for `+u((
|
|
815
|
-
* `+u((
|
|
876
|
+
`},3:function(l,n,i,m,t){var a,e=n??(l.nullContext||{}),s=l.hooks.helperMissing,o="function",u=l.escapeExpression,r=l.lookupProperty||function(c,f){if(Object.prototype.hasOwnProperty.call(c,f))return c[f]};return`/**
|
|
877
|
+
* Track a Snowplow event for `+u((a=(a=r(i,"typeName")||(n!=null?r(n,"typeName"):n))!=null?a:s,typeof a===o?a.call(e,{name:"typeName",hash:{},data:t,loc:{start:{line:30,column:30},end:{line:30,column:42}}}):a))+`.
|
|
878
|
+
* `+u((a=(a=r(i,"description")||(n!=null?r(n,"description"):n))!=null?a:s,typeof a===o?a.call(e,{name:"description",hash:{},data:t,loc:{start:{line:31,column:3},end:{line:31,column:18}}}):a))+`
|
|
816
879
|
*/
|
|
817
|
-
export function track`+u((
|
|
818
|
-
const { contexts, ...data } = `+u((
|
|
880
|
+
export function track`+u((a=(a=r(i,"functionName")||(n!=null?r(n,"functionName"):n))!=null?a:s,typeof a===o?a.call(e,{name:"functionName",hash:{},data:t,loc:{start:{line:33,column:21},end:{line:33,column:37}}}):a))+"<T extends {} = any>(tracker: ReactNativeTracker, "+u((r(i,"startLow")||n&&r(n,"startLow")||s).call(e,n!=null?r(n,"typeName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:33,column:87},end:{line:33,column:108}}}))+": "+u((a=(a=r(i,"typeName")||(n!=null?r(n,"typeName"):n))!=null?a:s,typeof a===o?a.call(e,{name:"typeName",hash:{},data:t,loc:{start:{line:33,column:110},end:{line:33,column:122}}}):a))+` & CommonEventProperties<T>){
|
|
881
|
+
const { contexts, ...data } = `+u((r(i,"startLow")||n&&r(n,"startLow")||s).call(e,n!=null?r(n,"typeName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:34,column:32},end:{line:34,column:53}}}))+`;
|
|
819
882
|
tracker.trackSelfDescribingEvent({
|
|
820
|
-
schema: '`+u((
|
|
883
|
+
schema: '`+u((a=(a=r(i,"igluUrl")||(n!=null?r(n,"igluUrl"):n))!=null?a:s,typeof a===o?a.call(e,{name:"igluUrl",hash:{},data:t,loc:{start:{line:36,column:13},end:{line:36,column:24}}}):a))+`',
|
|
821
884
|
data
|
|
822
885
|
}, contexts);
|
|
823
886
|
}
|
|
824
887
|
|
|
825
888
|
/**
|
|
826
|
-
* Creates a Snowplow `+u((
|
|
889
|
+
* Creates a Snowplow `+u((a=(a=r(i,"typeName")||(n!=null?r(n,"typeName"):n))!=null?a:s,typeof a===o?a.call(e,{name:"typeName",hash:{},data:t,loc:{start:{line:42,column:22},end:{line:42,column:34}}}):a))+` entity.
|
|
827
890
|
*/
|
|
828
|
-
export function create`+u((
|
|
891
|
+
export function create`+u((a=(a=r(i,"typeName")||(n!=null?r(n,"typeName"):n))!=null?a:s,typeof a===o?a.call(e,{name:"typeName",hash:{},data:t,loc:{start:{line:44,column:22},end:{line:44,column:34}}}):a))+"("+u((r(i,"startLow")||n&&r(n,"startLow")||s).call(e,n!=null?r(n,"typeName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:44,column:35},end:{line:44,column:56}}}))+": "+u((a=(a=r(i,"typeName")||(n!=null?r(n,"typeName"):n))!=null?a:s,typeof a===o?a.call(e,{name:"typeName",hash:{},data:t,loc:{start:{line:44,column:58},end:{line:44,column:70}}}):a))+`){
|
|
829
892
|
return {
|
|
830
|
-
schema: '`+u((
|
|
831
|
-
data: `+u((
|
|
893
|
+
schema: '`+u((a=(a=r(i,"igluUrl")||(n!=null?r(n,"igluUrl"):n))!=null?a:s,typeof a===o?a.call(e,{name:"igluUrl",hash:{},data:t,loc:{start:{line:46,column:13},end:{line:46,column:24}}}):a))+`',
|
|
894
|
+
data: `+u((r(i,"startLow")||n&&r(n,"startLow")||s).call(e,n!=null?r(n,"typeName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:47,column:10},end:{line:47,column:31}}}))+`
|
|
832
895
|
}
|
|
833
896
|
}
|
|
834
|
-
`},5:function(l,n,i,
|
|
835
|
-
* Tracks a `+s(
|
|
897
|
+
`},5:function(l,n,i,m,t){var a,e=l.lambda,s=l.escapeExpression,o=n??(l.nullContext||{}),u=l.hooks.helperMissing,r=l.lookupProperty||function(c,f){if(Object.prototype.hasOwnProperty.call(c,f))return c[f]};return`/**
|
|
898
|
+
* Tracks a `+s(e(n!=null?r(n,"name"):n,n))+` event specification.
|
|
836
899
|
*/
|
|
837
|
-
export function track`+s(
|
|
838
|
-
const eventSpecificationContext = createEventSpecification({ id: '`+s(
|
|
900
|
+
export function track`+s(e(n!=null?r(n,"name"):n,n))+"(tracker: ReactNativeTracker, "+s((r(i,"startLow")||n&&r(n,"startLow")||u).call(o,n!=null?r(n,"name"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:56,column:64},end:{line:56,column:86}}}))+": "+s(e(n!=null?r(n,"event"):n,n))+" & CommonEventProperties"+((a=r(i,"if").call(o,n!=null?r(n,"entities"):n,{name:"if",hash:{},fn:l.program(6,t,0),inverse:l.noop,data:t,loc:{start:{line:56,column:126},end:{line:56,column:194}}}))!=null?a:"")+`){
|
|
901
|
+
const eventSpecificationContext = createEventSpecification({ id: '`+s(e(n!=null?r(n,"id"):n,n))+`' });
|
|
839
902
|
|
|
840
|
-
const contexts = Array.isArray(`+s((
|
|
841
|
-
? [...`+s((
|
|
903
|
+
const contexts = Array.isArray(`+s((r(i,"startLow")||n&&r(n,"startLow")||u).call(o,n!=null?r(n,"name"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:59,column:33},end:{line:59,column:55}}}))+`.contexts)
|
|
904
|
+
? [...`+s((r(i,"startLow")||n&&r(n,"startLow")||u).call(o,n!=null?r(n,"name"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:60,column:10},end:{line:60,column:32}}}))+`.contexts, eventSpecificationContext]
|
|
842
905
|
: [eventSpecificationContext];
|
|
843
906
|
|
|
844
|
-
const modified`+s(
|
|
845
|
-
...`+s((
|
|
907
|
+
const modified`+s(e(n!=null?r(n,"name"):n,n))+` = {
|
|
908
|
+
...`+s((r(i,"startLow")||n&&r(n,"startLow")||u).call(o,n!=null?r(n,"name"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:64,column:7},end:{line:64,column:29}}}))+`,
|
|
846
909
|
contexts,
|
|
847
|
-
} as `+s(
|
|
910
|
+
} as `+s(e(n!=null?r(n,"event"):n,n))+" & CommonEventProperties"+((a=r(i,"if").call(o,n!=null?r(n,"entities"):n,{name:"if",hash:{},fn:l.program(6,t,0),inverse:l.noop,data:t,loc:{start:{line:66,column:45},end:{line:66,column:113}}}))!=null?a:"")+`;
|
|
848
911
|
|
|
849
|
-
track`+s(
|
|
912
|
+
track`+s(e(n!=null?r(n,"event"):n,n))+((a=r(i,"if").call(o,n!=null?r(n,"entities"):n,{name:"if",hash:{},fn:l.program(6,t,0),inverse:l.noop,data:t,loc:{start:{line:68,column:21},end:{line:68,column:89}}}))!=null?a:"")+"(tracker, modified"+s(e(n!=null?r(n,"name"):n,n))+`);
|
|
850
913
|
}
|
|
851
|
-
`},6:function(l,n,i,
|
|
914
|
+
`},6:function(l,n,i,m,t){var a,e=l.lookupProperty||function(s,o){if(Object.prototype.hasOwnProperty.call(s,o))return s[o]};return"<"+((a=e(i,"join").call(n??(l.nullContext||{}),n!=null?e(n,"entities"):n," | ",{name:"join",hash:{},fn:l.program(7,t,0),inverse:l.noop,data:t,loc:{start:{line:56,column:148},end:{line:56,column:186}}}))!=null?a:"")+">"},7:function(l,n,i,m,t){return""},compiler:[8,">= 4.3.0"],main:function(l,n,i,m,t){var a,e,s,o=n??(l.nullContext||{}),u=l.lookupProperty||function(c,f){if(Object.prototype.hasOwnProperty.call(c,f))return c[f]},r=`import { ReactNativeTracker, SelfDescribing } from '@snowplow/react-native-tracker';
|
|
852
915
|
|
|
853
916
|
interface CommonEventProperties<T extends {} = Record<string, unknown>> {
|
|
854
917
|
/** Add context to an event by setting an Array of Self Describing JSON */
|
|
855
918
|
contexts?: Array<SelfDescribing<T>> | null;
|
|
856
919
|
}
|
|
857
920
|
|
|
858
|
-
`+((
|
|
859
|
-
`;return
|
|
860
|
-
`+((
|
|
861
|
-
`),r=c.length;if(r===0)return;l.emitLine(c[0]);let e=0;for(let a=1;a<r;a++){let s=c[a],{indent:o,text:u}=kl(s,i);if(u!==null){let t=Math.floor(o/i),m=o%i;l.changeIndent(t-e),e=t,l.emitLine(" ".repeat(m),u)}else l.emitLine()}e!==0&&l.changeIndent(-e)}function w(l,n){if(n.length!==0){l.ensureBlankLine();for(let i of n)i(l)}}function mn(l,n={},i=[]){let c=Object.fromEntries(Object.entries(l).filter(([r])=>!i.includes(r)));return{...n,...c}}var T=require("quicktype-core");var fn=require("quicktype-core"),vl="__sp";function yn(l,n,i){return typeof l!="object"?void 0:{forType:I.makeAttributes({raw:l,...l[vl]})}}var G=class extends fn.TypeAttributeKind{constructor(){super("eventMetadata")}combine(n){return n[0]}makeInferred(n){}},I=new G;var Pn=k(require("handlebars"));var pn=require("quicktype-core"),gn=require("quicktype-core/dist/support/Strings");function H(l,n,i,c){let r=l.descriptionForType(n)?.join(" "),e=l.sourcelikeToString((0,pn.modifySource)(c?.functionName??gn.originalWord,i)),a=l.sourcelikeToString(i);return{description:r,functionName:e,typeName:a}}function kn(l,n,i){l.forEach(c=>{c.event===n&&(c.event=i),c.entities=c.entities?.map(r=>r===n?i:r)})}var x=k(require("handlebars"));var Q=require("quicktype-core/dist/support/Strings");function R(l){return`iglu:${l.vendor}/${l.name}/${l.format}/${l.version}`}function J(l){return`ID: ${l}`}function vn(l){let n=l.filter(wl).map(c=>({name:(0,Q.pascalCase)(c.eventSpecification.name),id:c.eventSpecification.id,event:R(c.eventSchema.self),entities:c.entitiesSchemas?c.entitiesSchemas.map(r=>R(r.self)):void 0})),i=l.filter(xl).map(c=>({name:(0,Q.pascalCase)(c.eventSpecification.name),id:c.eventSpecification.id,event:c.eventSchema.isEcomTemplateSchema,entities:c.entitiesSchemas?c.entitiesSchemas.filter(r=>!r.isEcomTemplateSchema).map(r=>R(r.self)):void 0}));return{eventSpecifications:n,ecomEventSpecifications:i}}function wl(l){return typeof l.eventSchema.isEcomTemplateSchema>"u"}function xl(l){return typeof l.eventSchema.isEcomTemplateSchema<"u"}var wn={add_to_cart:"Ecom.trackAddToCart",checkout_step:"Ecom.trackCheckoutStep",list_click:"Ecom.trackProductListClick",list_view:"Ecom.trackProductListView",product_view:"Ecom.trackProductView",promo_click:"Ecom.trackPromotionClick",promo_view:"Ecom.trackPromotionView",remove_from_cart:"Ecom.trackRemoveFromCart",transaction:"Ecom.trackTransaction",refund:"Ecom.trackRefund",trns_error:"Ecom.trackTransactionError"},xn={add_to_cart:"Ecom.Cart",checkout_step:"Ecom.CheckoutStep",list_click:"Ecom.ListClickEvent",list_view:"Ecom.ListViewEvent",product_view:"Ecom.Product",promo_click:"Ecom.SPPromotion",promo_view:"Ecom.SPPromotion",remove_from_cart:"Ecom.Cart",transaction:"Ecom.SPTransaction",refund:"Ecom.Refund",trns_error:"Ecom.TransactionError"};function Sn(){x.default.registerHelper({and(...l){return Array.prototype.every.call(l,Boolean)},or(...l){return Array.prototype.slice.call(l,0,-1).some(Boolean)}}),x.default.registerHelper("join",function(l,n,i){return i&&typeof i=="string"?l.map(c=>c+i).join(n):l.join(n)}),x.default.registerHelper("firstLow",function(l){return l&&typeof l=="string"?l.charAt(0).toLowerCase():""}),x.default.registerHelper("startLow",function(l){return l&&typeof l=="string"?l.charAt(0).toLowerCase().concat(l.slice(1)):""}),x.default.registerHelper("addEventSpecificationIdentifier",function(l){return l&&typeof l=="string"?J(l):""}),x.default.registerHelper("ecomFunction",function(l){return wn[l]}),x.default.registerHelper("ecomFunctionArgument",function(l){return xn[l]}),x.default.registerHelper("eq",function(l,n){return l===n}),x.default.registerHelper("debug",function(l,n,i){if(console.log(i===!0?JSON.stringify(l):l),n===!0)debugger;return""})}function bn(l,{eventSpecifications:n,ecomEventSpecifications:i},c){try{Sn();let r=Pn.default.template(l);return e=>{let a={type:[],nestedTypes:[],enums:[],eventSpecifications:n,ecomEventSpecifications:i};return e.forEachNamedType("leading-and-interposing",(s,o)=>{let u=s.getAttributes().get(I),t=H(e,s,o,c),m={...t,...e.getClassData&&e.getClassData(s)};if(u!==void 0&&u.raw.self!==void 0){let{raw:f}=u,y=R(f.self);[n,i].forEach(p=>kn(p,y,t.typeName)),a.type.push({igluUrl:y,...m})}else a.nestedTypes.push(m)},(s,o)=>{let u=[],{description:t}=H(e,s,o,c);e.forEachEnumCase(s,"none",(m,f)=>{u.push({name:e.sourcelikeToString(m),jsonName:f})}),a.enums.push({name:e.sourcelikeToString(o),description:t,cases:u})},()=>console.error("Unions are not yet supported in Snowtype")),e.emitMultiline(r(a))}}catch(r){throw new Error(`${JSON.stringify(r)}`)}}var N=require("quicktype-core");function On(l,n){if(l instanceof C){let i="",c='import "github.com/mitchellh/mapstructure"',r='import sp "github.com/snowplow/snowplow-golang-tracker/v3/tracker"',e=n.lines;Array.isArray(e)&&e.splice(1,0,i,c,r)}return n}async function En(l,n,i,c){let{header:r,sdk:e,outputFilename:a,...s}=c,o=new N.JSONSchemaInput(void 0,[yn]),u=new Set;await Pl(o,n,u),await Sl(o,i,u);let t=new N.InputData;t.addInput(o);let m=await(0,N.quicktype)({inputData:t,lang:l,leadingComments:r,rendererOptions:s});return On(l,m)}async function Sl(l,n,i){let c=[];for(let r of n){let e=V(r.eventSchema.self);if(i.has(e)||(c.push(q(l,r.eventSchema)),i.add(e)),!Array.isArray(r.entitiesSchemas))return;r.entitiesSchemas.forEach(a=>{let s=V(a.self);i.has(s)||(c.push(q(l,a)),i.add(s))})}await Promise.all(c)}async function Pl(l,n,i){let c=[];for(let r of n){let e=V(r.self);i.has(e)||(c.push(q(l,r)),i.add(e))}await Promise.all(c)}function V({name:l,vendor:n,version:i}){return l+"/"+n+"/"+i}async function q(l,n){await l.addSource({name:n.self.name,schema:JSON.stringify(n)})}var bl=k(jn()),Ol=k(Cn()),El=k(An()),Tl=k(Dn()),jl=k(Rn()),Ll=k(Un()),Cl=k(Jn()),Nl=k(Gn()),Al=k(Qn()),F=k(require("joi"));var Vn=["@snowplow/browser-tracker","@snowplow/javascript-tracker","snowplow-android-tracker","snowplow-ios-tracker","@snowplow/node-tracker","snowplow-golang-tracker","@snowplow/react-native-tracker"],qn=["typescript","javascript","kotlin","swift","go"];function Ml(l){let i=F.default.object().required().keys({id:F.default.object().required().keys({tracker:F.default.string().required().valid(...Vn),language:F.default.string().required().valid(...qn)})}).validate(l,{abortEarly:!1,convert:!1,allowUnknown:!0});if(i.error)throw new Error(i.error.annotate())}var Wn=[bl,Ol,El,Tl,jl,Ll,Cl,Nl,Al].map(l=>(Ml(l),l));function S(l){let{name:n,quicktypeLanguage:i,defaultOptions:c,unsupportedOptions:r,requiredOptions:e}=l,a=cn(n,r,e);return{id:a.id,name:a.name,extension:a.extension,generate:(s,o,u)=>{let{prefixes:t,suffixes:m}=u,f=[],y=Wn.find(({id:p})=>p.language===a.id&&p.tracker===u.tracker);if(y){let p=vn(o);f.push(bn(y,p))}return En(new i({generators:f,typeNameModifiers:{prefix:t?.typeName,suffix:m?.typeName}}),s,o,mn(u,c,r))}}}var E=k(require("json-pointer"));function Bn({propertyNameAsType:l,capitalizeProperty:n,defaultPropertyType:i},c){let r="*";return c!==void 0&&l?n?Xn(c):c:i===null||i===""?i:i||r}function Kn(l,n){let{maxLength:i}=l;if(!i)return[n];let c=[];for(;;){if(n.length-l.indentMaxDelta<=0){n&&c.push(n);break}let e=n.slice(0,l.indentMaxDelta),a=e.search(/\s\S*$/),s;if(a===-1){let o=n.slice(l.indentMaxDelta).match(/^\S+/);s=e+(o||"")}else s=e.slice(0,a);c.push(s),n=n.slice(s.length+1)}return c}function zn(l,n={}){let i=[];if(!l||Object.keys(l).length===0)return"";let c=Dl(n);return i.push(...Il(l,c)),E.default.has(l,"/properties")&&i.push(...B(l,l,null,c)),E.default.has(l,"/items")&&i.push(...W(l,l,null,c)),Fl(c.outerIndent,i)}function Dl(l){let i=(l.indentChar||" ").repeat(l.indent||0),c=l.maxLength-i.length-3;return{...l,outerIndent:i,indentMaxDelta:c}}function W(l,n,i,c){let r=E.default.get(l,"/items");if(!Array.isArray(r))return[];let e=[];return r.forEach((a,s)=>{let u=(i?`${i}.`:"")+s,t=a.default,m=!l.minItems||s>=l.minItems;if(a.type==="array"&&a.items)e.push(...A("array",u,a.description,m,t,c)),e.push(...W(a,n,u,c));else if(a.type==="object"&&a.properties)e.push(...A("object",u,a.description,m,t,c)),e.push(...B(a,n,u,c));else{let f=$(a,n)||Bn(c);e.push(...A(f,u,a.description,m,t,c))}}),e}function B(l,n,i,c){let r=E.default.get(l,"/properties"),e=E.default.has(l,"/required")?E.default.get(l,"/required"):[],a=[];for(let s in r)if(!(Array.isArray(c.ignore)&&c.ignore.includes(s))){let o=r[s],t=(i?`${i}.`:"")+s,m=r[s].default,f=!e.includes(s);if(o.type==="object"&&o.properties)a.push(...A("object",t,o.description,f,m,c)),a.push(...B(o,n,t,c));else if(o.type==="array"&&o.items)a.push(...A("array",t,o.description,f,m,c)),a.push(...W(o,n,t,c));else{let y=$(o,n)||Bn(c,s);a.push(...A(y,t,o.description,f,m,c))}}return a}function Il(l,n){let i=[],{objectTagName:c="typedef"}=n,{description:r}=l;r===void 0&&(r=n.autoDescribe?Rl(l.title,l.type):"");let e=n.types&&n.types[l.type],a;n.types===null?a="":a=` {${e===""?"":e||$(l,l)}}`,(r||n.addDescriptionLineBreak)&&i.push(...Kn(n,r));let s=l.title?` ${n.capitalizeTitle?Xn(l.title):l.title}`:"";return i.push(`@${c}${a}${s}`),i}function A(l,n,i="",c,r,e){let a;c?a=`[${n}${r===void 0?"":`=${JSON.stringify(r)}`}]`:a=n;let s;!i&&!e.descriptionPlaceholder?s="":e.hyphenatedDescriptions?s=` - ${i}`:s=` ${i}`;let o=l===null?"":`{${l}} `;return Kn(e,`@property ${o}${a}${s}`)}function $(l,n){if(l.$ref){let i=E.default.get(n,l.$ref.slice(1));return $(i,n)}return l.enum?(l.type||(typeof l.enum[0]=="string"&&(l.type="string"),(typeof l.enum[0]).match(/number|boolean/)&&(l.type="number")),Array.isArray(l.type)&&l.type.indexOf("string")!==-1&&l.type.indexOf("null")!==-1?`"${l.enum.filter(Boolean).join('"|"')}"|null`:l.type==="string"?`"${l.enum.join('"|"')}"`:l.type==="number"||l.type==="integer"||l.type==="boolean"?`${l.enum.join("|")}`:l.type==="null"?"null":"enum"):Array.isArray(l.type)?l.type.includes("null")?`?${l.type[0]}`:l.type.join("|"):l.type}function Xn(l){return l.slice(0,1).toUpperCase()+l.slice(1)}function Rl(l,n){let i=l?`${l} ${n}`:n;return`Represents ${`a${"aeiou".split("").includes(i.charAt())?"n":""}`} ${i}`}function Fl(l,n){let i=[`${l}/**`];return i.push(...n.map(c=>c?`${l} * ${c}`:" *")),i.push(`${l} */
|
|
921
|
+
`+((a=u(i,"if").call(o,(a=n!=null?u(n,"eventSpecifications"):n)!=null?u(a,"length"):a,{name:"if",hash:{},fn:l.program(1,t,0),inverse:l.noop,data:t,loc:{start:{line:8,column:0},end:{line:26,column:7}}}))!=null?a:"")+`
|
|
922
|
+
`;return a=(e=(e=u(i,"type")||(n!=null?u(n,"type"):n))!=null?e:l.hooks.helperMissing,s={name:"type",hash:{},fn:l.program(3,t,0),inverse:l.noop,data:t,loc:{start:{line:28,column:0},end:{line:50,column:9}}},typeof e=="function"?e.call(o,s):e),u(i,"type")||(a=l.hooks.blockHelperMissing.call(n,a,s)),a!=null&&(r+=a),r+`
|
|
923
|
+
`+((a=u(i,"each").call(o,n!=null?u(n,"eventSpecifications"):n,{name:"each",hash:{},fn:l.program(5,t,0),inverse:l.noop,data:t,loc:{start:{line:52,column:0},end:{line:70,column:9}}}))!=null?a:"")},useData:!0}});var Vl={};yl(Vl,{createEventSpecificationInstructionsIdentifier:()=>J,generate:()=>Gl});module.exports=pl(Vl);var un=require("quicktype-core"),gl=4;function vl(l,n,i){return`${n??""} ${l} ${i??""}`}function L(l,n,i,m,t){let{prefix:a,suffix:e}=n.typeNameModifiers??{},s=vl(m,a,e);return l(i,s,t)}function cn(l,n=[],i=[]){let m=(0,un.getTargetLanguage)(l),t=[],a=i;for(let e of m.optionDefinitions)n.includes(e.name);return{id:m.name,name:m.displayName,extension:m.extension,requiredOptions:a,advancedOptions:t}}function kl(l,n=gl){let i=l.length,m=0;for(let t=0;t<i;t++){let a=l.charAt(t);if(a===" ")m+=1;else if(a===" ")m=(m/n+1)*n;else return{indent:m,text:l.substring(t)}}return{indent:0,text:null}}function _(l,n,i=4){let m=n.split(`
|
|
924
|
+
`),t=m.length;if(t===0)return;l.emitLine(m[0]);let a=0;for(let e=1;e<t;e++){let s=m[e],{indent:o,text:u}=kl(s,i);if(u!==null){let r=Math.floor(o/i),c=o%i;l.changeIndent(r-a),a=r,l.emitLine(" ".repeat(c),u)}else l.emitLine()}a!==0&&l.changeIndent(-a)}function S(l,n){if(n.length!==0){l.ensureBlankLine();for(let i of n)i(l)}}function mn(l,n={},i=[]){let m=Object.fromEntries(Object.entries(l).filter(([t])=>!i.includes(t)));return{...n,...m}}var j=require("quicktype-core");var fn=require("quicktype-core"),wl="__sp";function yn(l,n,i){return typeof l!="object"?void 0:{forType:I.makeAttributes({raw:l,...l[wl]})}}var G=class extends fn.TypeAttributeKind{constructor(){super("eventMetadata")}combine(n){return n[0]}makeInferred(n){}},I=new G;var bn=v(require("handlebars"));var pn=require("quicktype-core"),gn=require("quicktype-core/dist/support/Strings");function V(l,n,i,m){let t=l.descriptionForType(n)?.join(" "),a=l.sourcelikeToString((0,pn.modifySource)(m?.functionName??gn.originalWord,i)),e=l.sourcelikeToString(i);return{description:t,functionName:a,typeName:e}}function vn(l,n,i){l.forEach(m=>{m.event===n&&(m.event=i),m.entities=m.entities?.map(t=>t===n?i:t)})}var x=v(require("handlebars"));var H=require("quicktype-core/dist/support/Strings");function R(l){return`iglu:${l.vendor}/${l.name}/${l.format}/${l.version}`}function J(l){return`ID: ${l}`}function kn(l){let n=l.filter(Sl).map(m=>({name:(0,H.pascalCase)(m.eventSpecification.name),id:m.eventSpecification.id,event:R(m.eventSchema.self),entities:m.entitiesSchemas?m.entitiesSchemas.map(t=>R(t.self)):void 0})),i=l.filter(xl).map(m=>({name:(0,H.pascalCase)(m.eventSpecification.name),id:m.eventSpecification.id,event:m.eventSchema.isEcomTemplateSchema,entities:m.entitiesSchemas?m.entitiesSchemas.filter(t=>!t.isEcomTemplateSchema).map(t=>R(t.self)):void 0}));return{eventSpecifications:n,ecomEventSpecifications:i}}function Sl(l){return typeof l.eventSchema.isEcomTemplateSchema>"u"}function xl(l){return typeof l.eventSchema.isEcomTemplateSchema<"u"}var wn={add_to_cart:"Ecom.trackAddToCart",checkout_step:"Ecom.trackCheckoutStep",list_click:"Ecom.trackProductListClick",list_view:"Ecom.trackProductListView",product_view:"Ecom.trackProductView",promo_click:"Ecom.trackPromotionClick",promo_view:"Ecom.trackPromotionView",remove_from_cart:"Ecom.trackRemoveFromCart",transaction:"Ecom.trackTransaction",refund:"Ecom.trackRefund",trns_error:"Ecom.trackTransactionError"},Sn={add_to_cart:"Ecom.Cart",checkout_step:"Ecom.CheckoutStep",list_click:"Ecom.ListClickEvent",list_view:"Ecom.ListViewEvent",product_view:"Ecom.Product",promo_click:"Ecom.SPPromotion",promo_view:"Ecom.SPPromotion",remove_from_cart:"Ecom.Cart",transaction:"Ecom.SPTransaction",refund:"Ecom.Refund",trns_error:"Ecom.TransactionError"};function xn(){x.default.registerHelper({and(...l){return Array.prototype.every.call(l,Boolean)},or(...l){return Array.prototype.slice.call(l,0,-1).some(Boolean)}}),x.default.registerHelper("join",function(l,n,i){return i&&typeof i=="string"?l.map(m=>m+i).join(n):l.join(n)}),x.default.registerHelper("firstLow",function(l){return l&&typeof l=="string"?l.charAt(0).toLowerCase():""}),x.default.registerHelper("startLow",function(l){return l&&typeof l=="string"?l.charAt(0).toLowerCase().concat(l.slice(1)):""}),x.default.registerHelper("addEventSpecificationIdentifier",function(l){return l&&typeof l=="string"?J(l):""}),x.default.registerHelper("ecomFunction",function(l){return wn[l]}),x.default.registerHelper("ecomFunctionArgument",function(l){return Sn[l]}),x.default.registerHelper("eq",function(l,n){return l===n}),x.default.registerHelper("debug",function(l,n,i){if(console.log(i===!0?JSON.stringify(l):l),n===!0)debugger;return""})}function Pn(l,{eventSpecifications:n,ecomEventSpecifications:i},m){try{xn();let t=bn.default.template(l),{nameModifiers:a,validations:e}=m;return s=>{let o={type:[],nestedTypes:[],enums:[],eventSpecifications:n,ecomEventSpecifications:i,validations:e};return s.forEachNamedType("leading-and-interposing",(u,r)=>{let c=u.getAttributes().get(I),f=V(s,u,r,a),y={...f,...s.getClassData&&s.getClassData(u)};if(c!==void 0&&c.raw.self!==void 0){let{raw:p}=c,g=R(p.self);[n,i].forEach(w=>vn(w,g,f.typeName)),o.type.push({igluUrl:g,...y})}else o.nestedTypes.push(y)},(u,r)=>{let c=[],{description:f}=V(s,u,r,a);s.forEachEnumCase(u,"none",(y,p)=>{c.push({name:s.sourcelikeToString(y),jsonName:p})}),o.enums.push({name:s.sourcelikeToString(r),description:f,cases:c})},()=>console.error("Unions are not yet supported in Snowtype")),s.emitMultiline(t(o))}}catch(t){throw new Error(`${JSON.stringify(t)}`)}}var N=require("quicktype-core");function On(l,n){if(l instanceof C){let i="",m='import "github.com/mitchellh/mapstructure"',t='import sp "github.com/snowplow/snowplow-golang-tracker/v3/tracker"',a=n.lines;Array.isArray(a)&&a.splice(1,0,i,m,t)}return n}function En(l,n){let i=Object.fromEntries(l.entries());return n&&(i["iglu:com.snowplowanalytics.snowplow/event_specification/jsonschema/1-0-0"]=bl),Object.keys(i).forEach(m=>{i[m].$schema="http://json-schema.org/draft-04/schema#"}),i}var bl={description:"Entity schema for referencing an event specification",properties:{id:{description:"Identifier for the event specification that the event adheres to",type:"string",maxLength:254,minLength:1}},additionalProperties:!1,type:"object",required:["id"],self:{vendor:"com.snowplowanalytics.snowplow",name:"event_specification",format:"jsonschema",version:"1-0-0"},$schema:"http://iglucentral.com/schemas/com.snowplowanalytics.self-desc/schema/jsonschema/1-0-0#"};async function jn(l,n,i,m){let{header:t,validations:a,...e}=m,s=new N.JSONSchemaInput(void 0,[yn]),o=new Map;await Ol(s,n,o),await Pl(s,i,o);let u=a?En(o,!!i.length):void 0,r=new N.InputData;r.addInput(s);let c=await(0,N.quicktype)({inputData:r,lang:l,leadingComments:t,rendererOptions:e});return{...On(l,c),validationsSchemaObject:u}}async function Pl(l,n,i){let m=[];for(let t of n){let a=Q(t.eventSchema.self);if(i.has(a)||(m.push(q(l,t.eventSchema)),i.set(a,t.eventSchema)),!Array.isArray(t.entitiesSchemas))return;t.entitiesSchemas.forEach(e=>{let s=Q(e.self);i.has(s)||(m.push(q(l,e)),i.set(s,e))})}await Promise.all(m)}async function Ol(l,n,i){let m=[];for(let t of n){let a=Q(t.self);i.has(a)||(m.push(q(l,t)),i.set(a,t))}await Promise.all(m)}function Q({name:l,vendor:n,version:i,format:m}){return"iglu:"+[n,l,m,i].join("/")}async function q(l,n){await l.addSource({name:n.self.name,schema:JSON.stringify(n)})}var El=v(Ln()),jl=v(Nn()),Tl=v(Mn()),Ll=v(In()),Cl=v(Fn()),Nl=v(_n()),Al=v($n()),Ml=v(Vn()),Dl=v(Qn()),F=v(require("joi"));var qn=["@snowplow/browser-tracker","@snowplow/javascript-tracker","snowplow-android-tracker","snowplow-ios-tracker","@snowplow/node-tracker","snowplow-golang-tracker","@snowplow/react-native-tracker"],Wn=["typescript","javascript","kotlin","swift","go"];function Il(l){let i=F.default.object().required().keys({id:F.default.object().required().keys({tracker:F.default.string().required().valid(...qn),language:F.default.string().required().valid(...Wn)})}).validate(l,{abortEarly:!1,convert:!1,allowUnknown:!0});if(i.error)throw new Error(i.error.annotate())}var Bn=[El,jl,Tl,Ll,Cl,Nl,Al,Ml,Dl].map(l=>(Il(l),l));function b(l){let{name:n,quicktypeLanguage:i,defaultOptions:m,unsupportedOptions:t,requiredOptions:a}=l,e=cn(n,t,a);return{id:e.id,name:e.name,extension:e.extension,generate:(s,o,u)=>{let r=[],c=Bn.find(({id:f})=>f.language===e.id&&f.tracker===u.tracker);if(c){let f=kn(o);r.push(Pn(c,f,u))}return jn(new i({generators:r}),s,o,mn(u,m,t))}}}var E=v(require("json-pointer"));function Kn({propertyNameAsType:l,capitalizeProperty:n,defaultPropertyType:i},m){let t="*";return m!==void 0&&l?n?Zn(m):m:i===null||i===""?i:i||t}function zn(l,n){let{maxLength:i}=l;if(!i)return[n];let m=[];for(;;){if(n.length-l.indentMaxDelta<=0){n&&m.push(n);break}let a=n.slice(0,l.indentMaxDelta),e=a.search(/\s\S*$/),s;if(e===-1){let o=n.slice(l.indentMaxDelta).match(/^\S+/);s=a+(o||"")}else s=a.slice(0,e);m.push(s),n=n.slice(s.length+1)}return m}function Xn(l,n={}){let i=[];if(!l||Object.keys(l).length===0)return"";let m=Rl(n);return i.push(...Fl(l,m)),E.default.has(l,"/properties")&&i.push(...B(l,l,null,m)),E.default.has(l,"/items")&&i.push(...W(l,l,null,m)),_l(m.outerIndent,i)}function Rl(l){let i=(l.indentChar||" ").repeat(l.indent||0),m=l.maxLength-i.length-3;return{...l,outerIndent:i,indentMaxDelta:m}}function W(l,n,i,m){let t=E.default.get(l,"/items");if(!Array.isArray(t))return[];let a=[];return t.forEach((e,s)=>{let u=(i?`${i}.`:"")+s,r=e.default,c=!l.minItems||s>=l.minItems;if(e.type==="array"&&e.items)a.push(...A("array",u,e.description,c,r,m)),a.push(...W(e,n,u,m));else if(e.type==="object"&&e.properties)a.push(...A("object",u,e.description,c,r,m)),a.push(...B(e,n,u,m));else{let f=$(e,n)||Kn(m);a.push(...A(f,u,e.description,c,r,m))}}),a}function B(l,n,i,m){let t=E.default.get(l,"/properties"),a=E.default.has(l,"/required")?E.default.get(l,"/required"):[],e=[];for(let s in t)if(!(Array.isArray(m.ignore)&&m.ignore.includes(s))){let o=t[s],r=(i?`${i}.`:"")+s,c=t[s].default,f=!a.includes(s);if(o.type==="object"&&o.properties)e.push(...A("object",r,o.description,f,c,m)),e.push(...B(o,n,r,m));else if(o.type==="array"&&o.items)e.push(...A("array",r,o.description,f,c,m)),e.push(...W(o,n,r,m));else{let y=$(o,n)||Kn(m,s);e.push(...A(y,r,o.description,f,c,m))}}return e}function Fl(l,n){let i=[],{objectTagName:m="typedef"}=n,{description:t}=l;t===void 0&&(t=n.autoDescribe?Ul(l.title,l.type):"");let a=n.types&&n.types[l.type],e;n.types===null?e="":e=` {${a===""?"":a||$(l,l)}}`,(t||n.addDescriptionLineBreak)&&i.push(...zn(n,t));let s=l.title?` ${n.capitalizeTitle?Zn(l.title):l.title}`:"";return i.push(`@${m}${e}${s}`),i}function A(l,n,i="",m,t,a){let e;m?e=`[${n}${t===void 0?"":`=${JSON.stringify(t)}`}]`:e=n;let s;!i&&!a.descriptionPlaceholder?s="":a.hyphenatedDescriptions?s=` - ${i}`:s=` ${i}`;let o=l===null?"":`{${l}} `;return zn(a,`@property ${o}${e}${s}`)}function $(l,n){if(l.$ref){let i=E.default.get(n,l.$ref.slice(1));return $(i,n)}return l.enum?(l.type||(typeof l.enum[0]=="string"&&(l.type="string"),(typeof l.enum[0]).match(/number|boolean/)&&(l.type="number")),Array.isArray(l.type)&&l.type.indexOf("string")!==-1&&l.type.indexOf("null")!==-1?`"${l.enum.filter(Boolean).join('"|"')}"|null`:l.type==="string"?`"${l.enum.join('"|"')}"`:l.type==="number"||l.type==="integer"||l.type==="boolean"?`${l.enum.join("|")}`:l.type==="null"?"null":"enum"):Array.isArray(l.type)?l.type.includes("null")?`?${l.type[0]}`:l.type.join("|"):l.type}function Zn(l){return l.slice(0,1).toUpperCase()+l.slice(1)}function Ul(l,n){let i=l?`${l} ${n}`:n;return`Represents ${`a${"aeiou".split("").includes(i.charAt())?"n":""}`} ${i}`}function _l(l,n){let i=[`${l}/**`];return i.push(...n.map(m=>m?`${l} * ${m}`:" *")),i.push(`${l} */
|
|
862
925
|
`),i.join(`
|
|
863
|
-
`)}var
|
|
926
|
+
`)}var dn=require("quicktype-core/dist/support/Strings"),K=class extends j.JavaScriptRenderer{constructor(i,m,t,a){super(i,m,t);this.snowtypeOptions=a}emitMultiline(i){_(this,i,2)}emitSourceStructure(){this.leadingComments!==void 0?this.emitCommentLines(this.leadingComments):this.emitUsageComments()}emitPredefinedJSDocTypes(){this.emitMultiline(`
|
|
864
927
|
/**
|
|
865
928
|
* Typedef for a DeviceTimestamp
|
|
866
929
|
* @typedef {object} DeviceTimestamp
|
|
@@ -893,10 +956,10 @@ interface CommonEventProperties<T extends {} = Record<string, unknown>> {
|
|
|
893
956
|
* @typedef {object} Context
|
|
894
957
|
* @property {SelfDescribingJson[]} [context] Contexts to include in the event
|
|
895
958
|
*/
|
|
896
|
-
`)}emitSource(i){super.emitSource(i),this.ensureBlankLine(),this.emitPredefinedJSDocTypes(),this.forEachTopLevel("none",(
|
|
959
|
+
`)}emitSource(i){super.emitSource(i),this.ensureBlankLine(),this.emitPredefinedJSDocTypes(),this.forEachTopLevel("none",(m,t)=>{let a=this.sourcelikeToString(t),e=m.getAttributes().get(I);e&&e.raw&&(e.raw.title=e.raw.title||a,this.emitMultiline(Xn(e.raw)),this.emitMultiline(Jl(e.raw.title)),this.ensureBlankLine())}),S(this,this.snowtypeOptions.generators)}makeNameForTopLevel(i,m,t){return L((...a)=>super.makeNameForTopLevel(...a),this.snowtypeOptions,i,m,t)}},z=class extends j.JavaScriptTargetLanguage{constructor(i){super();this.snowtypeOptions=i}makeRenderer(i,m){return new K(this,i,(0,j.getOptionValues)(j.tsFlowOptions,m),this.snowtypeOptions)}},Yn=b({name:"javascript",quicktypeLanguage:z,defaultOptions:{"runtime-typecheck":!1},nameModifiers:{functionName:dn.camelCase}}),X={...Yn,generate:async(l,n,i)=>{let{sdk:m,prefixes:t,suffixes:a}=i;return await Yn.generate(l,n,i)}};function Jl(l){return`
|
|
897
960
|
/**
|
|
898
961
|
* Typedef for a ${l} entity context.
|
|
899
962
|
* @typedef {object} ${l}Context
|
|
900
963
|
* @property {string} schema The schema of the context.
|
|
901
964
|
* @property { ${l} } data The data to send for the context.
|
|
902
|
-
*/`}var P=require("quicktype-core"),
|
|
965
|
+
*/`}var P=require("quicktype-core"),hn=require("quicktype-core/dist/language/Kotlin"),nl=require("quicktype-core/dist/support/Strings");var Z=class extends hn.KotlinXRenderer{constructor(i,m,t,a){super(i,m,t);this.snowtypeOptions=a}getClassData(i){let m=[];return this.forEachClassProperty(i,"none",(t,a,e)=>{let s=this.getArrayTypes(e.type);m.push({name:this.sourcelikeToString(t),jsonName:a,description:this.descriptionForClassProperty(i,a),type:this.sourcelikeToString(this.kotlinType(e.type)),isOptional:e.isOptional,isNullable:this.isNullable(e),isNullableOrOptional:e.isOptional||this.isNullable(e),isArrayOfEnums:s&&s.get("array").includes("enum"),isArrayOfObjects:s&&s.get("array").includes("class"),isEnum:this.isEnum(e),isObject:this.isObject(e)})}),{properties:m}}emitSource(i){super.emitSource(i),S(this,this.snowtypeOptions.generators)}emitSourceStructure(){}getArrayTypes(i){if(i.kind.toString()!=="array")return null;let m=new Map;return m.set("array",[]),i.getChildren().forEach(t=>{t.kind.toString()==="union"?t.getChildren().forEach(a=>{m.get("array").push(a.kind.toString())}):m.get("array").push(t.kind.toString())}),m}isEnum(i){return i.type.kind==="enum"||this.isNullable(i)&&(0,P.nullableFromUnion)(i.type)?.kind==="enum"}isObject(i){return i.type.kind==="class"||this.isNullable(i)&&(0,P.nullableFromUnion)(i.type)?.kind==="class"}isNullable(i){return i.type.kind==="union"&&(0,P.nullableFromUnion)(i.type)!==null}},Y=class extends P.KotlinTargetLanguage{constructor(i){super();this.snowtypeOptions=i}makeRenderer(i,m){return new Z(this,i,(0,P.getOptionValues)(P.kotlinOptions,m),this.snowtypeOptions)}},d=b({name:"kotlin",quicktypeLanguage:Y,defaultOptions:{framework:"kotlinx",package:"Snowtype","just-types":!0},requiredOptions:["package"],unsupportedOptions:["framework"],nameModifiers:{functionName:nl.camelCase}});var k=require("quicktype-core"),ll=require("quicktype-core/dist/support/Strings");var h=class extends k.SwiftRenderer{constructor(i,m,t,a){super(i,m,t);this.snowtypeOptions=a}getClassData(i){let m=[];return this.forEachClassProperty(i,"none",(t,a,e)=>{let s=this.getArrayTypes(e.type);m.push({name:this.sourcelikeToString(t),jsonName:a,description:this.descriptionForClassProperty(i,a),type:this.sourcelikeToString(this.swiftPropertyType(e)),isOptional:e.isOptional,isNullable:this.isNullable(e),isNullableOrOptional:e.isOptional||this.isNullable(e),isArrayOfEnums:s&&s.get("array").includes("enum"),isArrayOfObjects:s&&s.get("array").includes("class"),isEnum:this.isEnum(e),isObject:this.isObject(e)})}),{properties:m}}emitSource(i){super.emitSource(i),S(this,this.snowtypeOptions.generators)}emitSourceStructure(){}getArrayTypes(i){if(i.kind.toString()!=="array")return null;let m=new Map;return m.set("array",[]),i.getChildren().forEach(t=>{t.kind.toString()==="union"?t.getChildren().forEach(a=>{m.get("array").push(a.kind.toString())}):m.get("array").push(t.kind.toString())}),m}isEnum(i){return i.type.kind==="enum"||this.isNullable(i)&&(0,k.nullableFromUnion)(i.type)?.kind==="enum"}isObject(i){return i.type.kind==="class"||this.isNullable(i)&&(0,k.nullableFromUnion)(i.type)?.kind==="class"}isNullable(i){return i.type.kind==="union"&&(0,k.nullableFromUnion)(i.type)!==null}},nn=class extends k.SwiftTargetLanguage{constructor(i){super();this.snowtypeOptions=i}makeRenderer(i,m){return new h(this,i,(0,k.getOptionValues)(k.swiftOptions,m),this.snowtypeOptions)}},ln=b({name:"swift",quicktypeLanguage:nn,nameModifiers:{functionName:ll.camelCase}});var M=require("quicktype-core"),ol=require("quicktype-core/dist/RendererOptions"),al=require("quicktype-core/dist/support/Strings");var en=class extends M.TypeScriptRenderer{constructor(i,m,t,a){super(i,m,t);this.snowtypeOptions=a}emitMultiline(i){_(this,i,2)}emitSource(i){super.emitSource(i),S(this,this.snowtypeOptions.generators)}makeNameForTopLevel(i,m,t){return L((...a)=>super.makeNameForTopLevel(...a),this.snowtypeOptions,i,m,t)}},on=class extends M.TypeScriptTargetLanguage{constructor(i){super();this.snowtypeOptions=i}makeRenderer(i,m){return new en(this,i,(0,ol.getOptionValues)(M.tsFlowOptions,m),this.snowtypeOptions)}},el=b({name:"typescript",quicktypeLanguage:on,defaultOptions:{"just-types":!0,"prefer-unions":!0},nameModifiers:{functionName:al.camelCase}}),an={...el,generate:async(l,n,i)=>{let{sdk:m,prefixes:t,suffixes:a}=i;return await el.generate(l,n,i)}};var T=require("quicktype-core");var rl=require("quicktype-core/dist/support/Strings"),tn=class extends T.GoRenderer{constructor(i,m,t,a){super(i,m,t);this.snowtypeOptions=a}emitSource(i){super.emitSource(i),S(this,this.snowtypeOptions.generators)}makeNameForTopLevel(i,m,t){return L((...a)=>super.makeNameForTopLevel(...a),this.snowtypeOptions,i,m,t)}},C=class extends T.GoTargetLanguage{constructor(i){super();this.snowtypeOptions=i}makeRenderer(i,m){return new tn(this,i,(0,T.getOptionValues)(T.goOptions,m),this.snowtypeOptions)}},tl=b({name:"go",quicktypeLanguage:C,defaultOptions:{"just-types":!0,"just-types-and-package":!0,package:"main","multi-file-output":!1,"field-tags":"mapstructure"},nameModifiers:{functionName:rl.camelCase}}),rn={...tl,generate:async(l,n,i)=>{let{sdk:m,prefixes:t,suffixes:a}=i;return await tl.generate(l,n,i)}};var il=[an,X,d,ln,rn];var $l=["Automatically generated by Snowtype"];function Gl(l){return il.find(i=>i.id===l.language)?.generate(l.schemas,l.eventSpecifications,{header:$l,outputFilename:"snowplow",validations:l.validations,tracker:l.tracker})}0&&(module.exports={createEventSpecificationInstructionsIdentifier,generate});
|