@snowplow/snowtype-core 0.4.2 → 0.5.1
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 +413 -328
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var we=Object.create;var U=Object.defineProperty;var Se=Object.getOwnPropertyDescriptor;var xe=Object.getOwnPropertyNames;var Pe=Object.getPrototypeOf,be=Object.prototype.hasOwnProperty;var P=(e,n)=>()=>(n||e((n={exports:{}}).exports,n),n.exports),Ne=(e,n)=>{for(var i in n)U(e,i,{get:n[i],enumerable:!0})},vn=(e,n,i,c)=>{if(n&&typeof n=="object"||typeof n=="function")for(let t of xe(n))!be.call(e,t)&&t!==i&&U(e,t,{get:()=>n[t],enumerable:!(c=Se(n,t))||c.enumerable});return e};var v=(e,n,i)=>(i=e!=null?we(Pe(e)):{},vn(n||!e||!e.__esModule?U(i,"default",{value:e,enumerable:!0}):i,e)),Oe=e=>vn(U({},"__esModule",{value:!0}),e);var Rn=P((_l,_n)=>{"use strict";_n.exports={id:{language:"javascript",tracker:"@snowplow/browser-tracker"},1:function(e,n,i,c,t){return`/**
|
|
2
2
|
* Creates a Snowplow Event Specification entity.
|
|
3
3
|
*/
|
|
4
4
|
export function createEventSpecification(eventSpecification){
|
|
@@ -8,7 +8,7 @@ export function createEventSpecification(eventSpecification){
|
|
|
8
8
|
data: eventSpecification,
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
|
-
`},3:function(e,n,
|
|
11
|
+
`},3:function(e,n,i,c,t){return`const ajv = new Ajv({ allErrors: true, verbose: true, strict: false });
|
|
12
12
|
addFormats(ajv);
|
|
13
13
|
|
|
14
14
|
function defaultValidationErrorHandler(violations){
|
|
@@ -31,19 +31,19 @@ function validateSchema(sdj) {
|
|
|
31
31
|
defaultValidationErrorHandler(ajv.errors)
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
|
-
`},5:function(e,n,
|
|
35
|
-
* Track a Snowplow event for `+f((l=(l=y(
|
|
36
|
-
* `+f((l=(l=y(
|
|
37
|
-
* @param { `+f((l=(l=y(
|
|
34
|
+
`},5:function(e,n,i,c,t,o,a){var s,l,u=n??(e.nullContext||{}),r=e.hooks.helperMissing,m="function",f=e.escapeExpression,y=e.lookupProperty||function(g,p){if(Object.prototype.hasOwnProperty.call(g,p))return g[p]};return`/**
|
|
35
|
+
* Track a Snowplow event for `+f((l=(l=y(i,"typeName")||(n!=null?y(n,"typeName"):n))!=null?l:r,typeof l===m?l.call(u,{name:"typeName",hash:{},data:t,loc:{start:{line:42,column:30},end:{line:42,column:42}}}):l))+`.
|
|
36
|
+
* `+f((l=(l=y(i,"description")||(n!=null?y(n,"description"):n))!=null?l:r,typeof l===m?l.call(u,{name:"description",hash:{},data:t,loc:{start:{line:43,column:3},end:{line:43,column:18}}}):l))+`
|
|
37
|
+
* @param { `+f((l=(l=y(i,"typeName")||(n!=null?y(n,"typeName"):n))!=null?l:r,typeof l===m?l.call(u,{name:"typeName",hash:{},data:t,loc:{start:{line:44,column:12},end:{line:44,column:24}}}):l))+" & Timestamp & Context } "+f((y(i,"startLow")||n&&y(n,"startLow")||r).call(u,n!=null?y(n,"typeName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:44,column:49},end:{line:44,column:70}}}))+" - Attributes for "+f((l=(l=y(i,"typeName")||(n!=null?y(n,"typeName"):n))!=null?l:r,typeof l===m?l.call(u,{name:"typeName",hash:{},data:t,loc:{start:{line:44,column:88},end:{line:44,column:100}}}):l))+`.
|
|
38
38
|
* @param {string[]} [trackers] - Tracker names to send the event to.
|
|
39
39
|
*/
|
|
40
|
-
export function track`+f((l=(l=y(
|
|
41
|
-
const { context, timestamp, ...data } = `+f((y(
|
|
40
|
+
export function track`+f((l=(l=y(i,"functionName")||(n!=null?y(n,"functionName"):n))!=null?l:r,typeof l===m?l.call(u,{name:"functionName",hash:{},data:t,loc:{start:{line:47,column:21},end:{line:47,column:37}}}):l))+"("+f((y(i,"startLow")||n&&y(n,"startLow")||r).call(u,n!=null?y(n,"typeName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:47,column:38},end:{line:47,column:59}}}))+`, trackers){
|
|
41
|
+
const { context, timestamp, ...data } = `+f((y(i,"startLow")||n&&y(n,"startLow")||r).call(u,n!=null?y(n,"typeName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:48,column:42},end:{line:48,column:63}}}))+`;
|
|
42
42
|
const event = {
|
|
43
|
-
schema: '`+f((l=(l=y(
|
|
43
|
+
schema: '`+f((l=(l=y(i,"igluUrl")||(n!=null?y(n,"igluUrl"):n))!=null?l:r,typeof l===m?l.call(u,{name:"igluUrl",hash:{},data:t,loc:{start:{line:50,column:13},end:{line:50,column:24}}}):l))+`',
|
|
44
44
|
data
|
|
45
45
|
};
|
|
46
|
-
`+((s=y(
|
|
46
|
+
`+((s=y(i,"if").call(u,a[1]!=null?y(a[1],"validations"):a[1],{name:"if",hash:{},fn:e.program(6,t,0,o,a),inverse:e.noop,data:t,loc:{start:{line:53,column:2},end:{line:53,column:93}}}))!=null?s:"")+`
|
|
47
47
|
trackSelfDescribingEvent({
|
|
48
48
|
event,
|
|
49
49
|
context,
|
|
@@ -52,86 +52,86 @@ export function track`+f((l=(l=y(r,"functionName")||(n!=null?y(n,"functionName")
|
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
/**
|
|
55
|
-
* Creates a Snowplow `+f((l=(l=y(
|
|
56
|
-
* @param { `+f((l=(l=y(
|
|
55
|
+
* Creates a Snowplow `+f((l=(l=y(i,"typeName")||(n!=null?y(n,"typeName"):n))!=null?l:r,typeof l===m?l.call(u,{name:"typeName",hash:{},data:t,loc:{start:{line:62,column:22},end:{line:62,column:34}}}):l))+` entity.
|
|
56
|
+
* @param { `+f((l=(l=y(i,"typeName")||(n!=null?y(n,"typeName"):n))!=null?l:r,typeof l===m?l.call(u,{name:"typeName",hash:{},data:t,loc:{start:{line:63,column:12},end:{line:63,column:24}}}):l))+" } "+f((y(i,"startLow")||n&&y(n,"startLow")||r).call(u,n!=null?y(n,"typeName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:63,column:27},end:{line:63,column:48}}}))+" - Attributes for "+f((l=(l=y(i,"typeName")||(n!=null?y(n,"typeName"):n))!=null?l:r,typeof l===m?l.call(u,{name:"typeName",hash:{},data:t,loc:{start:{line:63,column:66},end:{line:63,column:78}}}):l))+`.
|
|
57
57
|
*/
|
|
58
|
-
export function create`+f((l=(l=y(
|
|
58
|
+
export function create`+f((l=(l=y(i,"typeName")||(n!=null?y(n,"typeName"):n))!=null?l:r,typeof l===m?l.call(u,{name:"typeName",hash:{},data:t,loc:{start:{line:65,column:22},end:{line:65,column:34}}}):l))+"("+f((y(i,"startLow")||n&&y(n,"startLow")||r).call(u,n!=null?y(n,"typeName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:65,column:35},end:{line:65,column:56}}}))+`){
|
|
59
59
|
return {
|
|
60
|
-
schema: '`+f((l=(l=y(
|
|
61
|
-
data: `+f((y(
|
|
60
|
+
schema: '`+f((l=(l=y(i,"igluUrl")||(n!=null?y(n,"igluUrl"):n))!=null?l:r,typeof l===m?l.call(u,{name:"igluUrl",hash:{},data:t,loc:{start:{line:67,column:13},end:{line:67,column:24}}}):l))+`',
|
|
61
|
+
data: `+f((y(i,"startLow")||n&&y(n,"startLow")||r).call(u,n!=null?y(n,"typeName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:68,column:10},end:{line:68,column:31}}}))+`
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
|
-
`},6:function(e,n,
|
|
65
|
-
* Tracks a `+l(s(n!=null?
|
|
66
|
-
* `+l((i
|
|
67
|
-
* @param { `+l(s(n!=null?
|
|
64
|
+
`},6:function(e,n,i,c,t){return"[event].concat(context || []).forEach(s => validateSchema(s));"},8:function(e,n,i,c,t){var o,a=n??(e.nullContext||{}),s=e.lambda,l=e.escapeExpression,u=e.hooks.helperMissing,r=e.lookupProperty||function(m,f){if(Object.prototype.hasOwnProperty.call(m,f))return m[f]};return((o=r(i,"if").call(a,n!=null?r(n,"entities"):n,{name:"if",hash:{},fn:e.program(9,t,0),inverse:e.noop,data:t,loc:{start:{line:74,column:0},end:{line:81,column:7}}}))!=null?o:"")+`/**
|
|
65
|
+
* Tracks a `+l(s(n!=null?r(n,"generatedName"):n,n))+` event specification.
|
|
66
|
+
* `+l((r(i,"addEventSpecificationIdentifier")||n&&r(n,"addEventSpecificationIdentifier")||u).call(a,n!=null?r(n,"id"):n,{name:"addEventSpecificationIdentifier",hash:{},data:t,loc:{start:{line:84,column:3},end:{line:84,column:46}}}))+`
|
|
67
|
+
* @param { `+l(s(n!=null?r(n,"event"):n,n))+" & Timestamp"+((o=r(i,"if").call(a,n!=null?r(n,"entities"):n,{name:"if",hash:{},fn:e.program(12,t,0),inverse:e.noop,data:t,loc:{start:{line:85,column:38},end:{line:85,column:99}}}))!=null?o:"")+" } "+l((r(i,"startLow")||n&&r(n,"startLow")||u).call(a,n!=null?r(n,"generatedName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:85,column:102},end:{line:85,column:133}}}))+" - Attributes for "+l(s(n!=null?r(n,"generatedName"):n,n))+` event specification.
|
|
68
68
|
* @param {string[]} [trackers] - Tracker names to send the event specification to.
|
|
69
69
|
*/
|
|
70
|
-
export function track`+l(s(n!=null?
|
|
70
|
+
export function track`+l(s(n!=null?r(n,"generatedName"):n,n))+"Spec("+l((r(i,"startLow")||n&&r(n,"startLow")||u).call(a,n!=null?r(n,"generatedName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:88,column:48},end:{line:88,column:79}}}))+`, trackers){
|
|
71
71
|
const eventSpecificationContext = createEventSpecification({
|
|
72
|
-
id: '`+l(s(n!=null?
|
|
73
|
-
name: '`+l(s(n!=null?
|
|
74
|
-
data_product_id: '`+l(s(n!=null?
|
|
75
|
-
data_product_name: '`+l(s(n!=null?
|
|
72
|
+
id: '`+l(s(n!=null?r(n,"id"):n,n))+`',
|
|
73
|
+
name: '`+l(s(n!=null?r(n,"name"):n,n))+`',
|
|
74
|
+
data_product_id: '`+l(s(n!=null?r(n,"dataProductId"):n,n))+`',
|
|
75
|
+
data_product_name: '`+l(s(n!=null?r(n,"dataProductName"):n,n))+`'
|
|
76
76
|
});
|
|
77
77
|
|
|
78
|
-
const context = Array.isArray(`+l((i
|
|
79
|
-
? [...`+l((i
|
|
78
|
+
const context = Array.isArray(`+l((r(i,"startLow")||n&&r(n,"startLow")||u).call(a,n!=null?r(n,"generatedName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:96,column:32},end:{line:96,column:63}}}))+`.context)
|
|
79
|
+
? [...`+l((r(i,"startLow")||n&&r(n,"startLow")||u).call(a,n!=null?r(n,"generatedName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:97,column:10},end:{line:97,column:41}}}))+`.context, eventSpecificationContext]
|
|
80
80
|
: [eventSpecificationContext];
|
|
81
81
|
|
|
82
|
-
const modified`+l(s(n!=null?
|
|
83
|
-
...`+l((i
|
|
82
|
+
const modified`+l(s(n!=null?r(n,"generatedName"):n,n))+` = {
|
|
83
|
+
...`+l((r(i,"startLow")||n&&r(n,"startLow")||u).call(a,n!=null?r(n,"generatedName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:101,column:7},end:{line:101,column:38}}}))+`,
|
|
84
84
|
context,
|
|
85
85
|
};
|
|
86
86
|
|
|
87
|
-
track`+l(s(n!=null?
|
|
87
|
+
track`+l(s(n!=null?r(n,"event"):n,n))+"(modified"+l(s(n!=null?r(n,"generatedName"):n,n))+`, trackers);
|
|
88
88
|
}
|
|
89
|
-
`},9:function(e,n,
|
|
89
|
+
`},9:function(e,n,i,c,t){var o,a=e.lambda,s=e.escapeExpression,l=e.lookupProperty||function(u,r){if(Object.prototype.hasOwnProperty.call(u,r))return u[r]};return`/**
|
|
90
90
|
* Typedef for `+s(a(n!=null?l(n,"generatedName"):n,n))+` event specification contexts.
|
|
91
91
|
* @typedef {object} `+s(a(n!=null?l(n,"generatedName"):n,n))+`Contexts
|
|
92
|
-
* @property {(`+((
|
|
92
|
+
* @property {(`+((o=l(i,"join").call(n??(e.nullContext||{}),n!=null?l(n,"entities"):n," | ","Context",{name:"join",hash:{},fn:e.program(10,t,0),inverse:e.noop,data:t,loc:{start:{line:78,column:15},end:{line:78,column:63}}}))!=null?o:"")+")[]} [context] Contexts to include in the "+s(a(n!=null?l(n,"generatedName"):n,n))+` event specification.
|
|
93
93
|
*/
|
|
94
94
|
|
|
95
|
-
`},10:function(e,n,
|
|
96
|
-
* Tracks a `+l(s(n!=null?
|
|
97
|
-
* `+l((i
|
|
98
|
-
* @param { `+l((i
|
|
95
|
+
`},10:function(e,n,i,c,t){return""},12:function(e,n,i,c,t){var o=e.lookupProperty||function(a,s){if(Object.prototype.hasOwnProperty.call(a,s))return a[s]};return" & "+e.escapeExpression(e.lambda(n!=null?o(n,"generatedName"):n,n))+"Contexts"},14:function(e,n,i,c,t){var o,a=n??(e.nullContext||{}),s=e.lambda,l=e.escapeExpression,u=e.hooks.helperMissing,r=e.lookupProperty||function(m,f){if(Object.prototype.hasOwnProperty.call(m,f))return m[f]};return((o=r(i,"if").call(a,n!=null?r(n,"entities"):n,{name:"if",hash:{},fn:e.program(9,t,0),inverse:e.noop,data:t,loc:{start:{line:109,column:0},end:{line:116,column:7}}}))!=null?o:"")+`/**
|
|
96
|
+
* Tracks a `+l(s(n!=null?r(n,"generatedName"):n,n))+` event specification.
|
|
97
|
+
* `+l((r(i,"addEventSpecificationIdentifier")||n&&r(n,"addEventSpecificationIdentifier")||u).call(a,n!=null?r(n,"id"):n,{name:"addEventSpecificationIdentifier",hash:{},data:t,loc:{start:{line:119,column:3},end:{line:119,column:46}}}))+`
|
|
98
|
+
* @param { `+l((r(i,"ecomFunctionArgument")||n&&r(n,"ecomFunctionArgument")||u).call(a,n!=null?r(n,"event"):n,{name:"ecomFunctionArgument",hash:{},data:t,loc:{start:{line:120,column:12},end:{line:120,column:47}}}))+" "+((o=r(i,"if").call(a,n!=null?r(n,"entities"):n,{name:"if",hash:{},fn:e.program(15,t,0),inverse:e.program(17,t,0),data:t,loc:{start:{line:120,column:48},end:{line:120,column:153}}}))!=null?o:"")+" } "+l((r(i,"startLow")||n&&r(n,"startLow")||u).call(a,n!=null?r(n,"generatedName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:120,column:156},end:{line:120,column:187}}}))+" - Attributes for "+l(s(n!=null?r(n,"generatedName"):n,n))+` event specification.
|
|
99
99
|
* @param {string[]} [trackers] - Tracker names to send the event specification to.
|
|
100
100
|
*/
|
|
101
|
-
export function track`+l(s(n!=null?
|
|
101
|
+
export function track`+l(s(n!=null?r(n,"generatedName"):n,n))+"Spec("+l((r(i,"startLow")||n&&r(n,"startLow")||u).call(a,n!=null?r(n,"generatedName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:123,column:48},end:{line:123,column:79}}}))+`, trackers){
|
|
102
102
|
const eventSpecificationContext = createEventSpecification({
|
|
103
|
-
id: '`+l(s(n!=null?
|
|
104
|
-
name: '`+l(s(n!=null?
|
|
105
|
-
data_product_id: '`+l(s(n!=null?
|
|
106
|
-
data_product_name: '`+l(s(n!=null?
|
|
103
|
+
id: '`+l(s(n!=null?r(n,"id"):n,n))+`',
|
|
104
|
+
name: '`+l(s(n!=null?r(n,"name"):n,n))+`',
|
|
105
|
+
data_product_id: '`+l(s(n!=null?r(n,"dataProductId"):n,n))+`',
|
|
106
|
+
data_product_name: '`+l(s(n!=null?r(n,"dataProductName"):n,n))+`'
|
|
107
107
|
});
|
|
108
108
|
|
|
109
|
-
const context = Array.isArray(`+l((i
|
|
110
|
-
? [...`+l((i
|
|
109
|
+
const context = Array.isArray(`+l((r(i,"startLow")||n&&r(n,"startLow")||u).call(a,n!=null?r(n,"generatedName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:131,column:32},end:{line:131,column:63}}}))+`.context)
|
|
110
|
+
? [...`+l((r(i,"startLow")||n&&r(n,"startLow")||u).call(a,n!=null?r(n,"generatedName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:132,column:10},end:{line:132,column:41}}}))+`.context, eventSpecificationContext]
|
|
111
111
|
: [eventSpecificationContext];
|
|
112
112
|
|
|
113
|
-
const modified`+l(s(n!=null?
|
|
114
|
-
...`+l((i
|
|
113
|
+
const modified`+l(s(n!=null?r(n,"generatedName"):n,n))+` = {
|
|
114
|
+
...`+l((r(i,"startLow")||n&&r(n,"startLow")||u).call(a,n!=null?r(n,"generatedName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:136,column:7},end:{line:136,column:38}}}))+`,
|
|
115
115
|
context,
|
|
116
116
|
};
|
|
117
117
|
|
|
118
|
-
`+l((i
|
|
118
|
+
`+l((r(i,"ecomFunction")||n&&r(n,"ecomFunction")||u).call(a,n!=null?r(n,"event"):n,{name:"ecomFunction",hash:{},data:t,loc:{start:{line:140,column:2},end:{line:140,column:29}}}))+"(modified"+l(s(n!=null?r(n,"generatedName"):n,n))+`, trackers);
|
|
119
119
|
}
|
|
120
|
-
`},15:function(e,n,
|
|
121
|
-
`+((s=u(
|
|
122
|
-
`+((s=u(
|
|
123
|
-
`+((s=u(
|
|
124
|
-
* Track a Snowplow event for `+u((
|
|
125
|
-
* `+u((
|
|
126
|
-
* @param { `+u((
|
|
120
|
+
`},15:function(e,n,i,c,t){var o=e.lookupProperty||function(a,s){if(Object.prototype.hasOwnProperty.call(a,s))return a[s]};return"& "+e.escapeExpression(e.lambda(n!=null?o(n,"generatedName"):n,n))+"Contexts"},17:function(e,n,i,c,t){return"& Ecom.CommonEcommerceEventProperties"},compiler:[8,">= 4.3.0"],main:function(e,n,i,c,t,o,a){var s,l=n??(e.nullContext||{}),u=e.lookupProperty||function(r,m){if(Object.prototype.hasOwnProperty.call(r,m))return r[m]};return((s=u(i,"if").call(l,(u(i,"or")||n&&u(n,"or")||e.hooks.helperMissing).call(l,(s=n!=null?u(n,"eventSpecifications"):n)!=null?u(s,"length"):s,(s=n!=null?u(n,"ecomEventSpecifications"):n)!=null?u(s,"length"):s,{name:"or",hash:{},data:t,loc:{start:{line:1,column:6},end:{line:1,column:68}}}),{name:"if",hash:{},fn:e.program(1,t,0,o,a),inverse:e.noop,data:t,loc:{start:{line:1,column:0},end:{line:12,column:7}}}))!=null?s:"")+`
|
|
121
|
+
`+((s=u(i,"if").call(l,n!=null?u(n,"validations"):n,{name:"if",hash:{},fn:e.program(3,t,0,o,a),inverse:e.noop,data:t,loc:{start:{line:14,column:0},end:{line:38,column:7}}}))!=null?s:"")+`
|
|
122
|
+
`+((s=u(i,"each").call(l,n!=null?u(n,"type"):n,{name:"each",hash:{},fn:e.program(5,t,0,o,a),inverse:e.noop,data:t,loc:{start:{line:40,column:0},end:{line:71,column:9}}}))!=null?s:"")+`
|
|
123
|
+
`+((s=u(i,"each").call(l,n!=null?u(n,"eventSpecifications"):n,{name:"each",hash:{},fn:e.program(8,t,0,o,a),inverse:e.noop,data:t,loc:{start:{line:73,column:0},end:{line:107,column:9}}}))!=null?s:"")+((s=u(i,"each").call(l,n!=null?u(n,"ecomEventSpecifications"):n,{name:"each",hash:{},fn:e.program(14,t,0,o,a),inverse:e.noop,data:t,loc:{start:{line:108,column:0},end:{line:142,column:9}}}))!=null?s:"")},useData:!0,useDepths:!0}});var Un=P((Rl,Fn)=>{"use strict";Fn.exports={id:{language:"javascript",tracker:"@snowplow/javascript-tracker"},1:function(e,n,i,c,t){var o,a=n??(e.nullContext||{}),s=e.hooks.helperMissing,l="function",u=e.escapeExpression,r=e.lookupProperty||function(m,f){if(Object.prototype.hasOwnProperty.call(m,f))return m[f]};return`/**
|
|
124
|
+
* Track a Snowplow event for `+u((o=(o=r(i,"typeName")||(n!=null?r(n,"typeName"):n))!=null?o:s,typeof o===l?o.call(a,{name:"typeName",hash:{},data:t,loc:{start:{line:3,column:30},end:{line:3,column:42}}}):o))+`.
|
|
125
|
+
* `+u((o=(o=r(i,"description")||(n!=null?r(n,"description"):n))!=null?o:s,typeof o===l?o.call(a,{name:"description",hash:{},data:t,loc:{start:{line:4,column:3},end:{line:4,column:18}}}):o))+`
|
|
126
|
+
* @param { `+u((o=(o=r(i,"typeName")||(n!=null?r(n,"typeName"):n))!=null?o:s,typeof o===l?o.call(a,{name:"typeName",hash:{},data:t,loc:{start:{line:5,column:12},end:{line:5,column:24}}}):o))+" & Timestamp & Context } "+u((r(i,"startLow")||n&&r(n,"startLow")||s).call(a,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((o=(o=r(i,"typeName")||(n!=null?r(n,"typeName"):n))!=null?o:s,typeof o===l?o.call(a,{name:"typeName",hash:{},data:t,loc:{start:{line:5,column:88},end:{line:5,column:100}}}):o))+`.
|
|
127
127
|
* @param {string[]} [trackers] - Tracker names to send the event to.
|
|
128
128
|
*/
|
|
129
|
-
function track`+u((
|
|
129
|
+
function track`+u((o=(o=r(i,"functionName")||(n!=null?r(n,"functionName"):n))!=null?o:s,typeof o===l?o.call(a,{name:"functionName",hash:{},data:t,loc:{start:{line:8,column:14},end:{line:8,column:30}}}):o))+"("+u((r(i,"startLow")||n&&r(n,"startLow")||s).call(a,n!=null?r(n,"typeName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:8,column:31},end:{line:8,column:52}}}))+`, trackers){
|
|
130
130
|
const trackerNames = (trackers && trackers.length) ? ':' + trackers.join(';') : '';
|
|
131
|
-
const { context, timestamp, ...data } = `+u((i
|
|
131
|
+
const { context, timestamp, ...data } = `+u((r(i,"startLow")||n&&r(n,"startLow")||s).call(a,n!=null?r(n,"typeName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:10,column:42},end:{line:10,column:63}}}))+`;
|
|
132
132
|
window.snowplow('trackSelfDescribingEvent' + trackerNames, {
|
|
133
133
|
event: {
|
|
134
|
-
schema: '`+u((
|
|
134
|
+
schema: '`+u((o=(o=r(i,"igluUrl")||(n!=null?r(n,"igluUrl"):n))!=null?o:s,typeof o===l?o.call(a,{name:"igluUrl",hash:{},data:t,loc:{start:{line:13,column:15},end:{line:13,column:26}}}):o))+`',
|
|
135
135
|
data
|
|
136
136
|
},
|
|
137
137
|
context,
|
|
@@ -140,16 +140,16 @@ function track`+u((t=(t=i(r,"functionName")||(n!=null?i(n,"functionName"):n))!=n
|
|
|
140
140
|
}
|
|
141
141
|
|
|
142
142
|
/**
|
|
143
|
-
* Creates a Snowplow `+u((
|
|
144
|
-
* @param { `+u((
|
|
143
|
+
* Creates a Snowplow `+u((o=(o=r(i,"typeName")||(n!=null?r(n,"typeName"):n))!=null?o:s,typeof o===l?o.call(a,{name:"typeName",hash:{},data:t,loc:{start:{line:22,column:22},end:{line:22,column:34}}}):o))+` entity.
|
|
144
|
+
* @param { `+u((o=(o=r(i,"typeName")||(n!=null?r(n,"typeName"):n))!=null?o:s,typeof o===l?o.call(a,{name:"typeName",hash:{},data:t,loc:{start:{line:23,column:12},end:{line:23,column:24}}}):o))+" } "+u((r(i,"startLow")||n&&r(n,"startLow")||s).call(a,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((o=(o=r(i,"typeName")||(n!=null?r(n,"typeName"):n))!=null?o:s,typeof o===l?o.call(a,{name:"typeName",hash:{},data:t,loc:{start:{line:23,column:66},end:{line:23,column:78}}}):o))+`.
|
|
145
145
|
*/
|
|
146
|
-
function create`+u((
|
|
146
|
+
function create`+u((o=(o=r(i,"typeName")||(n!=null?r(n,"typeName"):n))!=null?o:s,typeof o===l?o.call(a,{name:"typeName",hash:{},data:t,loc:{start:{line:25,column:15},end:{line:25,column:27}}}):o))+"("+u((r(i,"startLow")||n&&r(n,"startLow")||s).call(a,n!=null?r(n,"typeName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:25,column:28},end:{line:25,column:49}}}))+`){
|
|
147
147
|
return {
|
|
148
|
-
schema: '`+u((
|
|
149
|
-
data: `+u((i
|
|
148
|
+
schema: '`+u((o=(o=r(i,"igluUrl")||(n!=null?r(n,"igluUrl"):n))!=null?o:s,typeof o===l?o.call(a,{name:"igluUrl",hash:{},data:t,loc:{start:{line:27,column:13},end:{line:27,column:24}}}):o))+`',
|
|
149
|
+
data: `+u((r(i,"startLow")||n&&r(n,"startLow")||s).call(a,n!=null?r(n,"typeName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:28,column:10},end:{line:28,column:31}}}))+`
|
|
150
150
|
}
|
|
151
151
|
}
|
|
152
|
-
`},3:function(e,n,
|
|
152
|
+
`},3:function(e,n,i,c,t){return`/**
|
|
153
153
|
* Creates a Snowplow Event Specification entity.
|
|
154
154
|
*/
|
|
155
155
|
export function createEventSpecification(eventSpecification){
|
|
@@ -159,40 +159,40 @@ export function createEventSpecification(eventSpecification){
|
|
|
159
159
|
data: eventSpecification,
|
|
160
160
|
}
|
|
161
161
|
}
|
|
162
|
-
`},5:function(e,n,
|
|
163
|
-
* Tracks a `+l(s(n!=null?
|
|
164
|
-
* `+l((i
|
|
165
|
-
* @param { `+l(s(n!=null?
|
|
162
|
+
`},5:function(e,n,i,c,t){var o,a=n??(e.nullContext||{}),s=e.lambda,l=e.escapeExpression,u=e.hooks.helperMissing,r=e.lookupProperty||function(m,f){if(Object.prototype.hasOwnProperty.call(m,f))return m[f]};return((o=r(i,"if").call(a,n!=null?r(n,"entities"):n,{name:"if",hash:{},fn:e.program(6,t,0),inverse:e.noop,data:t,loc:{start:{line:47,column:0},end:{line:54,column:7}}}))!=null?o:"")+`/**
|
|
163
|
+
* Tracks a `+l(s(n!=null?r(n,"generatedName"):n,n))+` event specification.
|
|
164
|
+
* `+l((r(i,"addEventSpecificationIdentifier")||n&&r(n,"addEventSpecificationIdentifier")||u).call(a,n!=null?r(n,"id"):n,{name:"addEventSpecificationIdentifier",hash:{},data:t,loc:{start:{line:57,column:3},end:{line:57,column:46}}}))+`
|
|
165
|
+
* @param { `+l(s(n!=null?r(n,"event"):n,n))+" & Timestamp"+((o=r(i,"if").call(a,n!=null?r(n,"entities"):n,{name:"if",hash:{},fn:e.program(9,t,0),inverse:e.noop,data:t,loc:{start:{line:58,column:38},end:{line:58,column:99}}}))!=null?o:"")+" } "+l((r(i,"startLow")||n&&r(n,"startLow")||u).call(a,n!=null?r(n,"generatedName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:58,column:102},end:{line:58,column:133}}}))+" - Attributes for "+l(s(n!=null?r(n,"generatedName"):n,n))+` event specification.
|
|
166
166
|
* @param {string[]} [trackers] - Tracker names to send the event specification to.
|
|
167
167
|
*/
|
|
168
|
-
function track`+l(s(n!=null?
|
|
168
|
+
function track`+l(s(n!=null?r(n,"generatedName"):n,n))+"Spec("+l((r(i,"startLow")||n&&r(n,"startLow")||u).call(a,n!=null?r(n,"generatedName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:61,column:41},end:{line:61,column:72}}}))+`, trackers){
|
|
169
169
|
const eventSpecificationContext = createEventSpecification({
|
|
170
|
-
id: '`+l(s(n!=null?
|
|
171
|
-
name: '`+l(s(n!=null?
|
|
172
|
-
data_product_id: '`+l(s(n!=null?
|
|
173
|
-
data_product_name: '`+l(s(n!=null?
|
|
170
|
+
id: '`+l(s(n!=null?r(n,"id"):n,n))+`',
|
|
171
|
+
name: '`+l(s(n!=null?r(n,"name"):n,n))+`',
|
|
172
|
+
data_product_id: '`+l(s(n!=null?r(n,"dataProductId"):n,n))+`',
|
|
173
|
+
data_product_name: '`+l(s(n!=null?r(n,"dataProductName"):n,n))+`'
|
|
174
174
|
});
|
|
175
175
|
|
|
176
|
-
const context = Array.isArray(`+l((i
|
|
177
|
-
? [...`+l((i
|
|
176
|
+
const context = Array.isArray(`+l((r(i,"startLow")||n&&r(n,"startLow")||u).call(a,n!=null?r(n,"generatedName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:69,column:32},end:{line:69,column:63}}}))+`.context)
|
|
177
|
+
? [...`+l((r(i,"startLow")||n&&r(n,"startLow")||u).call(a,n!=null?r(n,"generatedName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:70,column:10},end:{line:70,column:41}}}))+`.context, eventSpecificationContext]
|
|
178
178
|
: [eventSpecificationContext];
|
|
179
179
|
|
|
180
|
-
const modified`+l(s(n!=null?
|
|
181
|
-
...`+l((i
|
|
180
|
+
const modified`+l(s(n!=null?r(n,"generatedName"):n,n))+` = {
|
|
181
|
+
...`+l((r(i,"startLow")||n&&r(n,"startLow")||u).call(a,n!=null?r(n,"generatedName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:74,column:7},end:{line:74,column:38}}}))+`,
|
|
182
182
|
context,
|
|
183
183
|
};
|
|
184
184
|
|
|
185
|
-
track`+l(s(n!=null?
|
|
185
|
+
track`+l(s(n!=null?r(n,"event"):n,n))+"(modified"+l(s(n!=null?r(n,"generatedName"):n,n))+`, trackers);
|
|
186
186
|
}
|
|
187
|
-
`},6:function(e,n,
|
|
188
|
-
* Typedef for
|
|
189
|
-
* @typedef {object} `+s(a(n!=null?l(n,"
|
|
190
|
-
* @property {(`+((
|
|
187
|
+
`},6:function(e,n,i,c,t){var o,a=e.lambda,s=e.escapeExpression,l=e.lookupProperty||function(u,r){if(Object.prototype.hasOwnProperty.call(u,r))return u[r]};return`/**
|
|
188
|
+
* Typedef for `+s(a(n!=null?l(n,"generatedName"):n,n))+` event specification contexts.
|
|
189
|
+
* @typedef {object} `+s(a(n!=null?l(n,"generatedName"):n,n))+`Contexts
|
|
190
|
+
* @property {(`+((o=l(i,"join").call(n??(e.nullContext||{}),n!=null?l(n,"entities"):n," | ","Context",{name:"join",hash:{},fn:e.program(7,t,0),inverse:e.noop,data:t,loc:{start:{line:51,column:15},end:{line:51,column:63}}}))!=null?o:"")+")[]} [context] Contexts to include in the "+s(a(n!=null?l(n,"generatedName"):n,n))+` event specification.
|
|
191
191
|
*/
|
|
192
192
|
|
|
193
|
-
`},7:function(e,n,
|
|
194
|
-
`+((
|
|
195
|
-
`+((
|
|
193
|
+
`},7:function(e,n,i,c,t){return""},9:function(e,n,i,c,t){var o=e.lookupProperty||function(a,s){if(Object.prototype.hasOwnProperty.call(a,s))return a[s]};return" & "+e.escapeExpression(e.lambda(n!=null?o(n,"generatedName"):n,n))+"Contexts"},compiler:[8,">= 4.3.0"],main:function(e,n,i,c,t){var o,a,s,l=n??(e.nullContext||{}),u=e.lookupProperty||function(m,f){if(Object.prototype.hasOwnProperty.call(m,f))return m[f]},r="";return o=(a=(a=u(i,"type")||(n!=null?u(n,"type"):n))!=null?a:e.hooks.helperMissing,s={name:"type",hash:{},fn:e.program(1,t,0),inverse:e.noop,data:t,loc:{start:{line:1,column:0},end:{line:31,column:9}}},typeof a=="function"?a.call(l,s):a),u(i,"type")||(o=e.hooks.blockHelperMissing.call(n,o,s)),o!=null&&(r+=o),r+`
|
|
194
|
+
`+((o=u(i,"if").call(l,(o=n!=null?u(n,"eventSpecifications"):n)!=null?u(o,"length"):o,{name:"if",hash:{},fn:e.program(3,t,0),inverse:e.noop,data:t,loc:{start:{line:33,column:0},end:{line:44,column:7}}}))!=null?o:"")+`
|
|
195
|
+
`+((o=u(i,"each").call(l,n!=null?u(n,"eventSpecifications"):n,{name:"each",hash:{},fn:e.program(5,t,0),inverse:e.noop,data:t,loc:{start:{line:46,column:0},end:{line:80,column:9}}}))!=null?o:"")},useData:!0}});var $n=P((Fl,Jn)=>{"use strict";Jn.exports={id:{language:"javascript",tracker:"@snowplow/node-tracker"},1:function(e,n,i,c,t){return`/**
|
|
196
196
|
* Creates a Snowplow Event Specification entity.
|
|
197
197
|
*/
|
|
198
198
|
export function createEventSpecification(eventSpecification){
|
|
@@ -202,72 +202,72 @@ export function createEventSpecification(eventSpecification){
|
|
|
202
202
|
data: eventSpecification,
|
|
203
203
|
}
|
|
204
204
|
}
|
|
205
|
-
`},3:function(e,n,
|
|
206
|
-
* Track a Snowplow event for `+u((
|
|
207
|
-
* `+u((
|
|
205
|
+
`},3:function(e,n,i,c,t){var o,a=n??(e.nullContext||{}),s=e.hooks.helperMissing,l="function",u=e.escapeExpression,r=e.lookupProperty||function(m,f){if(Object.prototype.hasOwnProperty.call(m,f))return m[f]};return`/**
|
|
206
|
+
* Track a Snowplow event for `+u((o=(o=r(i,"typeName")||(n!=null?r(n,"typeName"):n))!=null?o:s,typeof o===l?o.call(a,{name:"typeName",hash:{},data:t,loc:{start:{line:21,column:30},end:{line:21,column:42}}}):o))+`.
|
|
207
|
+
* `+u((o=(o=r(i,"description")||(n!=null?r(n,"description"):n))!=null?o:s,typeof o===l?o.call(a,{name:"description",hash:{},data:t,loc:{start:{line:22,column:3},end:{line:22,column:18}}}):o))+`
|
|
208
208
|
* @param {Tracker} tracker - Tracker to send the event to.
|
|
209
|
-
* @param { `+u((
|
|
209
|
+
* @param { `+u((o=(o=r(i,"typeName")||(n!=null?r(n,"typeName"):n))!=null?o:s,typeof o===l?o.call(a,{name:"typeName",hash:{},data:t,loc:{start:{line:24,column:12},end:{line:24,column:24}}}):o))+" & Timestamp & Context } "+u((r(i,"startLow")||n&&r(n,"startLow")||s).call(a,n!=null?r(n,"typeName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:24,column:49},end:{line:24,column:70}}}))+" - Attributes for "+u((o=(o=r(i,"typeName")||(n!=null?r(n,"typeName"):n))!=null?o:s,typeof o===l?o.call(a,{name:"typeName",hash:{},data:t,loc:{start:{line:24,column:88},end:{line:24,column:100}}}):o))+`.
|
|
210
210
|
*/
|
|
211
|
-
export function track`+u((
|
|
212
|
-
const { context, timestamp, ...data } = `+u((i
|
|
211
|
+
export function track`+u((o=(o=r(i,"functionName")||(n!=null?r(n,"functionName"):n))!=null?o:s,typeof o===l?o.call(a,{name:"functionName",hash:{},data:t,loc:{start:{line:26,column:21},end:{line:26,column:37}}}):o))+"(tracker, "+u((r(i,"startLow")||n&&r(n,"startLow")||s).call(a,n!=null?r(n,"typeName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:26,column:47},end:{line:26,column:68}}}))+`){
|
|
212
|
+
const { context, timestamp, ...data } = `+u((r(i,"startLow")||n&&r(n,"startLow")||s).call(a,n!=null?r(n,"typeName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:27,column:42},end:{line:27,column:63}}}))+`;
|
|
213
213
|
|
|
214
214
|
tracker.track(buildSelfDescribingEvent({
|
|
215
215
|
event: {
|
|
216
|
-
schema: '`+u((
|
|
216
|
+
schema: '`+u((o=(o=r(i,"igluUrl")||(n!=null?r(n,"igluUrl"):n))!=null?o:s,typeof o===l?o.call(a,{name:"igluUrl",hash:{},data:t,loc:{start:{line:31,column:15},end:{line:31,column:26}}}):o))+`',
|
|
217
217
|
data
|
|
218
218
|
}
|
|
219
219
|
}), context, timestamp);
|
|
220
220
|
}
|
|
221
221
|
|
|
222
222
|
/**
|
|
223
|
-
* Creates a Snowplow `+u((
|
|
224
|
-
* @param { `+u((
|
|
223
|
+
* Creates a Snowplow `+u((o=(o=r(i,"typeName")||(n!=null?r(n,"typeName"):n))!=null?o:s,typeof o===l?o.call(a,{name:"typeName",hash:{},data:t,loc:{start:{line:38,column:22},end:{line:38,column:34}}}):o))+` entity.
|
|
224
|
+
* @param { `+u((o=(o=r(i,"typeName")||(n!=null?r(n,"typeName"):n))!=null?o:s,typeof o===l?o.call(a,{name:"typeName",hash:{},data:t,loc:{start:{line:39,column:12},end:{line:39,column:24}}}):o))+" } "+u((r(i,"startLow")||n&&r(n,"startLow")||s).call(a,n!=null?r(n,"typeName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:39,column:27},end:{line:39,column:48}}}))+" - Attributes for "+u((o=(o=r(i,"typeName")||(n!=null?r(n,"typeName"):n))!=null?o:s,typeof o===l?o.call(a,{name:"typeName",hash:{},data:t,loc:{start:{line:39,column:66},end:{line:39,column:78}}}):o))+`.
|
|
225
225
|
*/
|
|
226
|
-
export function create`+u((
|
|
226
|
+
export function create`+u((o=(o=r(i,"typeName")||(n!=null?r(n,"typeName"):n))!=null?o:s,typeof o===l?o.call(a,{name:"typeName",hash:{},data:t,loc:{start:{line:41,column:22},end:{line:41,column:34}}}):o))+"("+u((r(i,"startLow")||n&&r(n,"startLow")||s).call(a,n!=null?r(n,"typeName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:41,column:35},end:{line:41,column:56}}}))+`){
|
|
227
227
|
return {
|
|
228
|
-
schema: '`+u((
|
|
229
|
-
data: `+u((i
|
|
228
|
+
schema: '`+u((o=(o=r(i,"igluUrl")||(n!=null?r(n,"igluUrl"):n))!=null?o:s,typeof o===l?o.call(a,{name:"igluUrl",hash:{},data:t,loc:{start:{line:43,column:13},end:{line:43,column:24}}}):o))+`',
|
|
229
|
+
data: `+u((r(i,"startLow")||n&&r(n,"startLow")||s).call(a,n!=null?r(n,"typeName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:44,column:10},end:{line:44,column:31}}}))+`
|
|
230
230
|
}
|
|
231
231
|
}
|
|
232
|
-
`},5:function(e,n,
|
|
233
|
-
* Tracks a `+l(s(n!=null?
|
|
234
|
-
* `+l((i
|
|
232
|
+
`},5:function(e,n,i,c,t){var o,a=n??(e.nullContext||{}),s=e.lambda,l=e.escapeExpression,u=e.hooks.helperMissing,r=e.lookupProperty||function(m,f){if(Object.prototype.hasOwnProperty.call(m,f))return m[f]};return((o=r(i,"if").call(a,n!=null?r(n,"entities"):n,{name:"if",hash:{},fn:e.program(6,t,0),inverse:e.noop,data:t,loc:{start:{line:50,column:0},end:{line:57,column:7}}}))!=null?o:"")+`/**
|
|
233
|
+
* Tracks a `+l(s(n!=null?r(n,"generatedName"):n,n))+` event specification.
|
|
234
|
+
* `+l((r(i,"addEventSpecificationIdentifier")||n&&r(n,"addEventSpecificationIdentifier")||u).call(a,n!=null?r(n,"id"):n,{name:"addEventSpecificationIdentifier",hash:{},data:t,loc:{start:{line:60,column:3},end:{line:60,column:46}}}))+`
|
|
235
235
|
* @param {Tracker} tracker - Tracker to send the tracking event specification to.
|
|
236
|
-
* @param { `+l(s(n!=null?
|
|
236
|
+
* @param { `+l(s(n!=null?r(n,"event"):n,n))+" & Timestamp"+((o=r(i,"if").call(a,n!=null?r(n,"entities"):n,{name:"if",hash:{},fn:e.program(9,t,0),inverse:e.noop,data:t,loc:{start:{line:62,column:38},end:{line:62,column:91}}}))!=null?o:"")+" } "+l((r(i,"startLow")||n&&r(n,"startLow")||u).call(a,n!=null?r(n,"generatedName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:62,column:94},end:{line:62,column:125}}}))+" - Attributes for "+l(s(n!=null?r(n,"generatedName"):n,n))+` event specification.
|
|
237
237
|
*/
|
|
238
|
-
export function track`+l(s(n!=null?
|
|
238
|
+
export function track`+l(s(n!=null?r(n,"generatedName"):n,n))+"Spec(tracker, "+l((r(i,"startLow")||n&&r(n,"startLow")||u).call(a,n!=null?r(n,"generatedName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:64,column:57},end:{line:64,column:88}}}))+`){
|
|
239
239
|
const eventSpecificationContext = createEventSpecification({
|
|
240
|
-
id: '`+l(s(n!=null?
|
|
241
|
-
name: '`+l(s(n!=null?
|
|
242
|
-
data_product_id: '`+l(s(n!=null?
|
|
243
|
-
data_product_name: '`+l(s(n!=null?
|
|
240
|
+
id: '`+l(s(n!=null?r(n,"id"):n,n))+`',
|
|
241
|
+
name: '`+l(s(n!=null?r(n,"name"):n,n))+`',
|
|
242
|
+
data_product_id: '`+l(s(n!=null?r(n,"dataProductId"):n,n))+`',
|
|
243
|
+
data_product_name: '`+l(s(n!=null?r(n,"dataProductName"):n,n))+`'
|
|
244
244
|
});
|
|
245
245
|
|
|
246
|
-
const context = Array.isArray(`+l((i
|
|
247
|
-
? [...`+l((i
|
|
246
|
+
const context = Array.isArray(`+l((r(i,"startLow")||n&&r(n,"startLow")||u).call(a,n!=null?r(n,"generatedName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:72,column:31},end:{line:72,column:62}}}))+`.context)
|
|
247
|
+
? [...`+l((r(i,"startLow")||n&&r(n,"startLow")||u).call(a,n!=null?r(n,"generatedName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:73,column:10},end:{line:73,column:41}}}))+`.context, eventSpecificationContext]
|
|
248
248
|
: [eventSpecificationContext];
|
|
249
249
|
|
|
250
|
-
const modified`+l(s(n!=null?
|
|
251
|
-
...`+l((i
|
|
250
|
+
const modified`+l(s(n!=null?r(n,"generatedName"):n,n))+` = {
|
|
251
|
+
...`+l((r(i,"startLow")||n&&r(n,"startLow")||u).call(a,n!=null?r(n,"generatedName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:77,column:7},end:{line:77,column:38}}}))+`,
|
|
252
252
|
context,
|
|
253
253
|
};
|
|
254
254
|
|
|
255
|
-
track`+l(s(n!=null?
|
|
255
|
+
track`+l(s(n!=null?r(n,"event"):n,n))+"(tracker, modified"+l(s(n!=null?r(n,"generatedName"):n,n))+`);
|
|
256
256
|
}
|
|
257
|
-
`},6:function(e,n,
|
|
257
|
+
`},6:function(e,n,i,c,t){var o,a=e.lambda,s=e.escapeExpression,l=e.lookupProperty||function(u,r){if(Object.prototype.hasOwnProperty.call(u,r))return u[r]};return`/**
|
|
258
258
|
* Typedef for `+s(a(n!=null?l(n,"generatedName"):n,n))+` event specification contexts.
|
|
259
259
|
* @typedef {object} `+s(a(n!=null?l(n,"event"):n,n))+`Contexts
|
|
260
|
-
* @property {(`+((
|
|
260
|
+
* @property {(`+((o=l(i,"join").call(n??(e.nullContext||{}),n!=null?l(n,"entities"):n," | ","Context",{name:"join",hash:{},fn:e.program(7,t,0),inverse:e.noop,data:t,loc:{start:{line:54,column:15},end:{line:54,column:63}}}))!=null?o:"")+")[]} [context] Contexts to include in the "+s(a(n!=null?l(n,"generatedName"):n,n))+` event specification.
|
|
261
261
|
*/
|
|
262
262
|
|
|
263
|
-
`},7:function(e,n,
|
|
263
|
+
`},7:function(e,n,i,c,t){return""},9:function(e,n,i,c,t){var o=e.lookupProperty||function(a,s){if(Object.prototype.hasOwnProperty.call(a,s))return a[s]};return" & "+e.escapeExpression(e.lambda(n!=null?o(n,"event"):n,n))+"Contexts"},compiler:[8,">= 4.3.0"],main:function(e,n,i,c,t){var o,a,s,l=n??(e.nullContext||{}),u=e.lookupProperty||function(m,f){if(Object.prototype.hasOwnProperty.call(m,f))return m[f]},r=((o=u(i,"if").call(l,(o=n!=null?u(n,"eventSpecifications"):n)!=null?u(o,"length"):o,{name:"if",hash:{},fn:e.program(1,t,0),inverse:e.noop,data:t,loc:{start:{line:1,column:0},end:{line:12,column:7}}}))!=null?o:"")+`
|
|
264
264
|
/**
|
|
265
265
|
* Typedef for a Node.js tracker object.
|
|
266
266
|
* @typedef {object} Tracker
|
|
267
267
|
*/
|
|
268
268
|
|
|
269
|
-
`;return
|
|
270
|
-
`+((
|
|
269
|
+
`;return o=(a=(a=u(i,"type")||(n!=null?u(n,"type"):n))!=null?a:e.hooks.helperMissing,s={name:"type",hash:{},fn:e.program(3,t,0),inverse:e.noop,data:t,loc:{start:{line:19,column:0},end:{line:47,column:9}}},typeof a=="function"?a.call(l,s):a),u(i,"type")||(o=e.hooks.blockHelperMissing.call(n,o,s)),o!=null&&(r+=o),r+`
|
|
270
|
+
`+((o=u(i,"each").call(l,n!=null?u(n,"eventSpecifications"):n,{name:"each",hash:{},fn:e.program(5,t,0),inverse:e.noop,data:t,loc:{start:{line:49,column:0},end:{line:83,column:9}}}))!=null?o:"")},useData:!0}});var Vn=P((Ul,Gn)=>{"use strict";Gn.exports={id:{language:"typescript",tracker:"@snowplow/browser-tracker"},1:function(e,n,i,c,t){return`/**
|
|
271
271
|
* Creates a Snowplow Event Specification entity.
|
|
272
272
|
*/
|
|
273
273
|
export function createEventSpecification(eventSpecification: EventSpecification){
|
|
@@ -287,7 +287,7 @@ interface EventSpecification {
|
|
|
287
287
|
data_product_id: string;
|
|
288
288
|
data_product_name: string;
|
|
289
289
|
}
|
|
290
|
-
`},3:function(e,n,
|
|
290
|
+
`},3:function(e,n,i,c,t){return`const ajv = new Ajv({ allErrors: true, verbose: true, strict: false });
|
|
291
291
|
addFormats(ajv);
|
|
292
292
|
|
|
293
293
|
type ErrorType = {
|
|
@@ -378,17 +378,17 @@ function validateEntityRules(
|
|
|
378
378
|
}
|
|
379
379
|
});
|
|
380
380
|
}
|
|
381
|
-
`},5:function(e,n,
|
|
382
|
-
* Track a Snowplow event for `+f((l=(l=y(
|
|
383
|
-
* `+f((l=(l=y(
|
|
381
|
+
`},5:function(e,n,i,c,t,o,a){var s,l,u=n??(e.nullContext||{}),r=e.hooks.helperMissing,m="function",f=e.escapeExpression,y=e.lookupProperty||function(g,p){if(Object.prototype.hasOwnProperty.call(g,p))return g[p]};return`/**
|
|
382
|
+
* Track a Snowplow event for `+f((l=(l=y(i,"typeName")||(n!=null?y(n,"typeName"):n))!=null?l:r,typeof l===m?l.call(u,{name:"typeName",hash:{},data:t,loc:{start:{line:120,column:30},end:{line:120,column:42}}}):l))+`.
|
|
383
|
+
* `+f((l=(l=y(i,"description")||(n!=null?y(n,"description"):n))!=null?l:r,typeof l===m?l.call(u,{name:"description",hash:{},data:t,loc:{start:{line:121,column:3},end:{line:121,column:18}}}):l))+`
|
|
384
384
|
*/
|
|
385
|
-
export function track`+f((l=(l=y(
|
|
386
|
-
const { context, timestamp, ...data } = `+f((y(
|
|
385
|
+
export function track`+f((l=(l=y(i,"functionName")||(n!=null?y(n,"functionName"):n))!=null?l:r,typeof l===m?l.call(u,{name:"functionName",hash:{},data:t,loc:{start:{line:123,column:21},end:{line:123,column:37}}}):l))+"<T extends {} = any>("+f((y(i,"startLow")||n&&y(n,"startLow")||r).call(u,n!=null?y(n,"typeName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:123,column:58},end:{line:123,column:79}}}))+": "+f((l=(l=y(i,"typeName")||(n!=null?y(n,"typeName"):n))!=null?l:r,typeof l===m?l.call(u,{name:"typeName",hash:{},data:t,loc:{start:{line:123,column:81},end:{line:123,column:93}}}):l))+` & CommonEventProperties<T>, trackers?: string[]){
|
|
386
|
+
const { context, timestamp, ...data } = `+f((y(i,"startLow")||n&&y(n,"startLow")||r).call(u,n!=null?y(n,"typeName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:124,column:42},end:{line:124,column:63}}}))+`;
|
|
387
387
|
const event: SelfDescribingJson = {
|
|
388
|
-
schema: '`+f((l=(l=y(
|
|
388
|
+
schema: '`+f((l=(l=y(i,"igluUrl")||(n!=null?y(n,"igluUrl"):n))!=null?l:r,typeof l===m?l.call(u,{name:"igluUrl",hash:{},data:t,loc:{start:{line:126,column:13},end:{line:126,column:24}}}):l))+`',
|
|
389
389
|
data
|
|
390
390
|
};
|
|
391
|
-
`+((s=y(
|
|
391
|
+
`+((s=y(i,"if").call(u,a[1]!=null?y(a[1],"validations"):a[1],{name:"if",hash:{},fn:e.program(6,t,0,o,a),inverse:e.noop,data:t,loc:{start:{line:129,column:2},end:{line:129,column:93}}}))!=null?s:"")+`
|
|
392
392
|
trackSelfDescribingEvent({
|
|
393
393
|
event,
|
|
394
394
|
context,
|
|
@@ -397,19 +397,19 @@ export function track`+f((l=(l=y(r,"functionName")||(n!=null?y(n,"functionName")
|
|
|
397
397
|
}
|
|
398
398
|
|
|
399
399
|
/**
|
|
400
|
-
* Creates a Snowplow `+f((l=(l=y(
|
|
400
|
+
* Creates a Snowplow `+f((l=(l=y(i,"typeName")||(n!=null?y(n,"typeName"):n))!=null?l:r,typeof l===m?l.call(u,{name:"typeName",hash:{},data:t,loc:{start:{line:138,column:22},end:{line:138,column:34}}}):l))+` entity.
|
|
401
401
|
*/
|
|
402
|
-
export function create`+f((l=(l=y(
|
|
402
|
+
export function create`+f((l=(l=y(i,"typeName")||(n!=null?y(n,"typeName"):n))!=null?l:r,typeof l===m?l.call(u,{name:"typeName",hash:{},data:t,loc:{start:{line:140,column:22},end:{line:140,column:34}}}):l))+"("+f((y(i,"startLow")||n&&y(n,"startLow")||r).call(u,n!=null?y(n,"typeName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:140,column:35},end:{line:140,column:56}}}))+": "+f((l=(l=y(i,"typeName")||(n!=null?y(n,"typeName"):n))!=null?l:r,typeof l===m?l.call(u,{name:"typeName",hash:{},data:t,loc:{start:{line:140,column:58},end:{line:140,column:70}}}):l))+`){
|
|
403
403
|
return {
|
|
404
|
-
schema: '`+f((l=(l=y(
|
|
405
|
-
data: `+f((y(
|
|
404
|
+
schema: '`+f((l=(l=y(i,"igluUrl")||(n!=null?y(n,"igluUrl"):n))!=null?l:r,typeof l===m?l.call(u,{name:"igluUrl",hash:{},data:t,loc:{start:{line:142,column:13},end:{line:142,column:24}}}):l))+`',
|
|
405
|
+
data: `+f((y(i,"startLow")||n&&y(n,"startLow")||r).call(u,n!=null?y(n,"typeName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:143,column:10},end:{line:143,column:31}}}))+`
|
|
406
406
|
}
|
|
407
407
|
}
|
|
408
|
-
`},6:function(e,n,
|
|
408
|
+
`},6:function(e,n,i,c,t){return"[event].concat(context || []).forEach(s => validateSchema(s));"},8:function(e,n,i,c,t,o,a){var s,l=e.lambda,u=e.escapeExpression,r=n??(e.nullContext||{}),m=e.hooks.helperMissing,f=e.lookupProperty||function(y,g){if(Object.prototype.hasOwnProperty.call(y,g))return y[g]};return`/**
|
|
409
409
|
* Tracks a `+u(l(n!=null?f(n,"generatedName"):n,n))+` event specification.
|
|
410
|
-
* `+u((f(
|
|
410
|
+
* `+u((f(i,"addEventSpecificationIdentifier")||n&&f(n,"addEventSpecificationIdentifier")||m).call(r,n!=null?f(n,"id"):n,{name:"addEventSpecificationIdentifier",hash:{},data:t,loc:{start:{line:151,column:3},end:{line:151,column:46}}}))+`
|
|
411
411
|
*/
|
|
412
|
-
export function track`+u(l(n!=null?f(n,"generatedName"):n,n))+"Spec("+u((f(
|
|
412
|
+
export function track`+u(l(n!=null?f(n,"generatedName"):n,n))+"Spec("+u((f(i,"startLow")||n&&f(n,"startLow")||m).call(r,n!=null?f(n,"generatedName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:153,column:48},end:{line:153,column:79}}}))+": "+u(l(n!=null?f(n,"event"):n,n))+" & CommonEventProperties"+((s=f(i,"if").call(r,n!=null?f(n,"entities"):n,{name:"if",hash:{},fn:e.program(9,t,0,o,a),inverse:e.noop,data:t,loc:{start:{line:153,column:119},end:{line:153,column:187}}}))!=null?s:"")+`, trackers?: string[]){
|
|
413
413
|
const eventSpecificationContext: SelfDescribingJson<EventSpecification> = createEventSpecification({
|
|
414
414
|
id: '`+u(l(n!=null?f(n,"id"):n,n))+`',
|
|
415
415
|
name: '`+u(l(n!=null?f(n,"name"):n,n))+`',
|
|
@@ -417,48 +417,48 @@ export function track`+u(l(n!=null?f(n,"generatedName"):n,n))+"Spec("+u((f(r,"st
|
|
|
417
417
|
data_product_name: '`+u(l(n!=null?f(n,"dataProductName"):n,n))+`'
|
|
418
418
|
});
|
|
419
419
|
|
|
420
|
-
`+((s=f(
|
|
421
|
-
? [...`+u((f(
|
|
420
|
+
`+((s=f(i,"if").call(r,a[1]!=null?f(a[1],"validations"):a[1],{name:"if",hash:{},fn:e.program(12,t,0,o,a),inverse:e.noop,data:t,loc:{start:{line:161,column:2},end:{line:166,column:9}}}))!=null?s:"")+" const context = Array.isArray("+u((f(i,"startLow")||n&&f(n,"startLow")||m).call(r,n!=null?f(n,"generatedName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:167,column:32},end:{line:167,column:63}}}))+`.context)
|
|
421
|
+
? [...`+u((f(i,"startLow")||n&&f(n,"startLow")||m).call(r,n!=null?f(n,"generatedName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:168,column:10},end:{line:168,column:41}}}))+`.context, eventSpecificationContext]
|
|
422
422
|
: [eventSpecificationContext];
|
|
423
423
|
|
|
424
424
|
const modified`+u(l(n!=null?f(n,"generatedName"):n,n))+` = {
|
|
425
|
-
...`+u((f(
|
|
425
|
+
...`+u((f(i,"startLow")||n&&f(n,"startLow")||m).call(r,n!=null?f(n,"generatedName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:172,column:7},end:{line:172,column:38}}}))+`,
|
|
426
426
|
context,
|
|
427
427
|
};
|
|
428
428
|
|
|
429
|
-
track`+u(l(n!=null?f(n,"event"):n,n))+"<"+((s=f(
|
|
429
|
+
track`+u(l(n!=null?f(n,"event"):n,n))+"<"+((s=f(i,"if").call(r,n!=null?f(n,"entities"):n,{name:"if",hash:{},fn:e.program(14,t,0,o,a),inverse:e.program(16,t,0,o,a),data:t,loc:{start:{line:176,column:22},end:{line:176,column:119}}}))!=null?s:"")+" | EventSpecification>(modified"+u(l(n!=null?f(n,"generatedName"):n,n))+`, trackers);
|
|
430
430
|
}
|
|
431
|
-
`},9:function(e,n,
|
|
432
|
-
'`+
|
|
433
|
-
`+
|
|
431
|
+
`},9:function(e,n,i,c,t){var o,a=e.lookupProperty||function(s,l){if(Object.prototype.hasOwnProperty.call(s,l))return s[l]};return"<"+((o=a(i,"join").call(n??(e.nullContext||{}),n!=null?a(n,"entities"):n," | ",{name:"join",hash:{},fn:e.program(10,t,0),inverse:e.noop,data:t,loc:{start:{line:153,column:141},end:{line:153,column:179}}}))!=null?o:"")+">"},10:function(e,n,i,c,t){return""},12:function(e,n,i,c,t){var o=e.escapeExpression,a=e.lookupProperty||function(s,l){if(Object.prototype.hasOwnProperty.call(s,l))return s[l]};return` validateEntityRules(
|
|
432
|
+
'`+o(e.lambda(n!=null?a(n,"id"):n,n))+`' as keyof typeof entityRules,
|
|
433
|
+
`+o((a(i,"startLow")||n&&a(n,"startLow")||e.hooks.helperMissing).call(n??(e.nullContext||{}),n!=null?a(n,"generatedName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:164,column:4},end:{line:164,column:35}}}))+`.context as unknown as SelfDescribingJson[]
|
|
434
434
|
);
|
|
435
|
-
`},14:function(e,n,
|
|
436
|
-
* Tracks a `+s(a(n!=null?
|
|
437
|
-
* `+s((i
|
|
435
|
+
`},14:function(e,n,i,c,t){var o,a=e.lookupProperty||function(s,l){if(Object.prototype.hasOwnProperty.call(s,l))return s[l]};return(o=a(i,"join").call(n??(e.nullContext||{}),n!=null?a(n,"entities"):n," | ",{name:"join",hash:{},fn:e.program(10,t,0),inverse:e.noop,data:t,loc:{start:{line:176,column:43},end:{line:176,column:81}}}))!=null?o:""},16:function(e,n,i,c,t){return"Record<string, unknown>"},18:function(e,n,i,c,t){var o,a=e.lambda,s=e.escapeExpression,l=n??(e.nullContext||{}),u=e.hooks.helperMissing,r=e.lookupProperty||function(m,f){if(Object.prototype.hasOwnProperty.call(m,f))return m[f]};return`/**
|
|
436
|
+
* Tracks a `+s(a(n!=null?r(n,"generatedName"):n,n))+` event specification.
|
|
437
|
+
* `+s((r(i,"addEventSpecificationIdentifier")||n&&r(n,"addEventSpecificationIdentifier")||u).call(l,n!=null?r(n,"id"):n,{name:"addEventSpecificationIdentifier",hash:{},data:t,loc:{start:{line:182,column:3},end:{line:182,column:46}}}))+`
|
|
438
438
|
*/
|
|
439
|
-
export function track`+s(a(n!=null?
|
|
439
|
+
export function track`+s(a(n!=null?r(n,"generatedName"):n,n))+"Spec("+s((r(i,"startLow")||n&&r(n,"startLow")||u).call(l,n!=null?r(n,"generatedName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:184,column:48},end:{line:184,column:79}}}))+": "+s((r(i,"ecomFunctionArgument")||n&&r(n,"ecomFunctionArgument")||u).call(l,n!=null?r(n,"event"):n,{name:"ecomFunctionArgument",hash:{},data:t,loc:{start:{line:184,column:81},end:{line:184,column:116}}}))+" & Ecom.CommonEcommerceEventProperties"+((o=r(i,"if").call(l,n!=null?r(n,"entities"):n,{name:"if",hash:{},fn:e.program(9,t,0),inverse:e.noop,data:t,loc:{start:{line:184,column:154},end:{line:184,column:222}}}))!=null?o:"")+`, trackers?: string[]){
|
|
440
440
|
const eventSpecificationContext: SelfDescribingJson<EventSpecification> = createEventSpecification({
|
|
441
|
-
id: '`+s(a(n!=null?
|
|
442
|
-
name: '`+s(a(n!=null?
|
|
443
|
-
data_product_id: '`+s(a(n!=null?
|
|
444
|
-
data_product_name: '`+s(a(n!=null?
|
|
441
|
+
id: '`+s(a(n!=null?r(n,"id"):n,n))+`',
|
|
442
|
+
name: '`+s(a(n!=null?r(n,"name"):n,n))+`',
|
|
443
|
+
data_product_id: '`+s(a(n!=null?r(n,"dataProductId"):n,n))+`',
|
|
444
|
+
data_product_name: '`+s(a(n!=null?r(n,"dataProductName"):n,n))+`'
|
|
445
445
|
});
|
|
446
446
|
|
|
447
|
-
const context = Array.isArray(`+s((i
|
|
448
|
-
? [...`+s((i
|
|
447
|
+
const context = Array.isArray(`+s((r(i,"startLow")||n&&r(n,"startLow")||u).call(l,n!=null?r(n,"generatedName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:192,column:32},end:{line:192,column:63}}}))+`.context)
|
|
448
|
+
? [...`+s((r(i,"startLow")||n&&r(n,"startLow")||u).call(l,n!=null?r(n,"generatedName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:193,column:10},end:{line:193,column:41}}}))+`.context, eventSpecificationContext]
|
|
449
449
|
: [eventSpecificationContext];
|
|
450
450
|
|
|
451
|
-
const modified`+s(a(n!=null?
|
|
452
|
-
...`+s((i
|
|
451
|
+
const modified`+s(a(n!=null?r(n,"generatedName"):n,n))+` = {
|
|
452
|
+
...`+s((r(i,"startLow")||n&&r(n,"startLow")||u).call(l,n!=null?r(n,"generatedName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:197,column:7},end:{line:197,column:38}}}))+`,
|
|
453
453
|
context: context as unknown as SelfDescribingJson<Record<string, unknown>>[],
|
|
454
454
|
};
|
|
455
455
|
|
|
456
|
-
`+s((i
|
|
456
|
+
`+s((r(i,"ecomFunction")||n&&r(n,"ecomFunction")||u).call(l,n!=null?r(n,"event"):n,{name:"ecomFunction",hash:{},data:t,loc:{start:{line:201,column:2},end:{line:201,column:29}}}))+"(modified"+s(a(n!=null?r(n,"generatedName"):n,n))+`, trackers);
|
|
457
457
|
}
|
|
458
|
-
`},compiler:[8,">= 4.3.0"],main:function(e,n,
|
|
459
|
-
`+((s=u(
|
|
460
|
-
`+((s=u(
|
|
461
|
-
`+((s=u(
|
|
458
|
+
`},compiler:[8,">= 4.3.0"],main:function(e,n,i,c,t,o,a){var s,l=n??(e.nullContext||{}),u=e.lookupProperty||function(r,m){if(Object.prototype.hasOwnProperty.call(r,m))return r[m]};return((s=u(i,"if").call(l,(u(i,"or")||n&&u(n,"or")||e.hooks.helperMissing).call(l,(s=n!=null?u(n,"eventSpecifications"):n)!=null?u(s,"length"):s,(s=n!=null?u(n,"ecomEventSpecifications"):n)!=null?u(s,"length"):s,{name:"or",hash:{},data:t,loc:{start:{line:1,column:6},end:{line:1,column:68}}}),{name:"if",hash:{},fn:e.program(1,t,0,o,a),inverse:e.noop,data:t,loc:{start:{line:1,column:0},end:{line:22,column:7}}}))!=null?s:"")+`
|
|
459
|
+
`+((s=u(i,"if").call(l,n!=null?u(n,"validations"):n,{name:"if",hash:{},fn:e.program(3,t,0,o,a),inverse:e.noop,data:t,loc:{start:{line:24,column:0},end:{line:116,column:7}}}))!=null?s:"")+`
|
|
460
|
+
`+((s=u(i,"each").call(l,n!=null?u(n,"type"):n,{name:"each",hash:{},fn:e.program(5,t,0,o,a),inverse:e.noop,data:t,loc:{start:{line:118,column:0},end:{line:146,column:9}}}))!=null?s:"")+`
|
|
461
|
+
`+((s=u(i,"each").call(l,n!=null?u(n,"eventSpecifications"):n,{name:"each",hash:{},fn:e.program(8,t,0,o,a),inverse:e.noop,data:t,loc:{start:{line:148,column:0},end:{line:178,column:9}}}))!=null?s:"")+((s=u(i,"each").call(l,n!=null?u(n,"ecomEventSpecifications"):n,{name:"each",hash:{},fn:e.program(18,t,0,o,a),inverse:e.noop,data:t,loc:{start:{line:179,column:0},end:{line:203,column:9}}}))!=null?s:"")},useData:!0,useDepths:!0}});var qn=P((Jl,Hn)=>{"use strict";Hn.exports={id:{language:"typescript",tracker:"@snowplow/node-tracker"},1:function(e,n,i,c,t){return`/**
|
|
462
462
|
* Creates a Snowplow Event Specification entity.
|
|
463
463
|
*/
|
|
464
464
|
export function createEventSpecification(eventSpecification: EventSpecification){
|
|
@@ -478,84 +478,84 @@ interface EventSpecification {
|
|
|
478
478
|
data_product_id: string;
|
|
479
479
|
data_product_name: string;
|
|
480
480
|
}
|
|
481
|
-
`},3:function(e,n,
|
|
482
|
-
* Track a Snowplow event for `+u((
|
|
483
|
-
* `+u((
|
|
481
|
+
`},3:function(e,n,i,c,t){var o,a=n??(e.nullContext||{}),s=e.hooks.helperMissing,l="function",u=e.escapeExpression,r=e.lookupProperty||function(m,f){if(Object.prototype.hasOwnProperty.call(m,f))return m[f]};return`/**
|
|
482
|
+
* Track a Snowplow event for `+u((o=(o=r(i,"typeName")||(n!=null?r(n,"typeName"):n))!=null?o:s,typeof o===l?o.call(a,{name:"typeName",hash:{},data:t,loc:{start:{line:33,column:30},end:{line:33,column:42}}}):o))+`.
|
|
483
|
+
* `+u((o=(o=r(i,"description")||(n!=null?r(n,"description"):n))!=null?o:s,typeof o===l?o.call(a,{name:"description",hash:{},data:t,loc:{start:{line:34,column:3},end:{line:34,column:18}}}):o))+`
|
|
484
484
|
*/
|
|
485
|
-
export function track`+u((
|
|
486
|
-
const { context, timestamp, ...data } = `+u((i
|
|
485
|
+
export function track`+u((o=(o=r(i,"functionName")||(n!=null?r(n,"functionName"):n))!=null?o:s,typeof o===l?o.call(a,{name:"functionName",hash:{},data:t,loc:{start:{line:36,column:21},end:{line:36,column:37}}}):o))+"<T extends {} = any>(tracker: Tracker, "+u((r(i,"startLow")||n&&r(n,"startLow")||s).call(a,n!=null?r(n,"typeName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:36,column:76},end:{line:36,column:97}}}))+": "+u((o=(o=r(i,"typeName")||(n!=null?r(n,"typeName"):n))!=null?o:s,typeof o===l?o.call(a,{name:"typeName",hash:{},data:t,loc:{start:{line:36,column:99},end:{line:36,column:111}}}):o))+` & CommonEventProperties<T>){
|
|
486
|
+
const { context, timestamp, ...data } = `+u((r(i,"startLow")||n&&r(n,"startLow")||s).call(a,n!=null?r(n,"typeName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:37,column:42},end:{line:37,column:63}}}))+`;
|
|
487
487
|
tracker.track(buildSelfDescribingEvent({
|
|
488
488
|
event: {
|
|
489
|
-
schema: '`+u((
|
|
489
|
+
schema: '`+u((o=(o=r(i,"igluUrl")||(n!=null?r(n,"igluUrl"):n))!=null?o:s,typeof o===l?o.call(a,{name:"igluUrl",hash:{},data:t,loc:{start:{line:40,column:15},end:{line:40,column:26}}}):o))+`',
|
|
490
490
|
data
|
|
491
491
|
}
|
|
492
492
|
}), context, timestamp);
|
|
493
493
|
}
|
|
494
494
|
|
|
495
495
|
/**
|
|
496
|
-
* Creates a Snowplow `+u((
|
|
496
|
+
* Creates a Snowplow `+u((o=(o=r(i,"typeName")||(n!=null?r(n,"typeName"):n))!=null?o:s,typeof o===l?o.call(a,{name:"typeName",hash:{},data:t,loc:{start:{line:47,column:22},end:{line:47,column:34}}}):o))+` entity.
|
|
497
497
|
*/
|
|
498
|
-
export function create`+u((
|
|
498
|
+
export function create`+u((o=(o=r(i,"typeName")||(n!=null?r(n,"typeName"):n))!=null?o:s,typeof o===l?o.call(a,{name:"typeName",hash:{},data:t,loc:{start:{line:49,column:22},end:{line:49,column:34}}}):o))+"("+u((r(i,"startLow")||n&&r(n,"startLow")||s).call(a,n!=null?r(n,"typeName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:49,column:35},end:{line:49,column:56}}}))+": "+u((o=(o=r(i,"typeName")||(n!=null?r(n,"typeName"):n))!=null?o:s,typeof o===l?o.call(a,{name:"typeName",hash:{},data:t,loc:{start:{line:49,column:58},end:{line:49,column:70}}}):o))+`){
|
|
499
499
|
return {
|
|
500
|
-
schema: '`+u((
|
|
501
|
-
data: `+u((i
|
|
500
|
+
schema: '`+u((o=(o=r(i,"igluUrl")||(n!=null?r(n,"igluUrl"):n))!=null?o:s,typeof o===l?o.call(a,{name:"igluUrl",hash:{},data:t,loc:{start:{line:51,column:13},end:{line:51,column:24}}}):o))+`',
|
|
501
|
+
data: `+u((r(i,"startLow")||n&&r(n,"startLow")||s).call(a,n!=null?r(n,"typeName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:52,column:10},end:{line:52,column:31}}}))+`
|
|
502
502
|
}
|
|
503
503
|
}
|
|
504
|
-
`},5:function(e,n,
|
|
505
|
-
* Tracks a `+s(a(n!=null?
|
|
506
|
-
* `+s((i
|
|
504
|
+
`},5:function(e,n,i,c,t){var o,a=e.lambda,s=e.escapeExpression,l=n??(e.nullContext||{}),u=e.hooks.helperMissing,r=e.lookupProperty||function(m,f){if(Object.prototype.hasOwnProperty.call(m,f))return m[f]};return`/**
|
|
505
|
+
* Tracks a `+s(a(n!=null?r(n,"generatedName"):n,n))+` event specification.
|
|
506
|
+
* `+s((r(i,"addEventSpecificationIdentifier")||n&&r(n,"addEventSpecificationIdentifier")||u).call(l,n!=null?r(n,"id"):n,{name:"addEventSpecificationIdentifier",hash:{},data:t,loc:{start:{line:60,column:3},end:{line:60,column:46}}}))+`
|
|
507
507
|
*/
|
|
508
|
-
export function track`+s(a(n!=null?
|
|
508
|
+
export function track`+s(a(n!=null?r(n,"generatedName"):n,n))+"Spec(tracker: Tracker, "+s((r(i,"startLow")||n&&r(n,"startLow")||u).call(l,n!=null?r(n,"generatedName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:62,column:66},end:{line:62,column:97}}}))+": "+s(a(n!=null?r(n,"event"):n,n))+" & CommonEventProperties"+((o=r(i,"if").call(l,n!=null?r(n,"entities"):n,{name:"if",hash:{},fn:e.program(6,t,0),inverse:e.noop,data:t,loc:{start:{line:62,column:137},end:{line:62,column:205}}}))!=null?o:"")+`){
|
|
509
509
|
const eventSpecificationContext: SelfDescribingJson<EventSpecification> = createEventSpecification({
|
|
510
|
-
id: '`+s(a(n!=null?
|
|
511
|
-
name: '`+s(a(n!=null?
|
|
512
|
-
data_product_id: '`+s(a(n!=null?
|
|
513
|
-
data_product_name: '`+s(a(n!=null?
|
|
510
|
+
id: '`+s(a(n!=null?r(n,"id"):n,n))+`',
|
|
511
|
+
name: '`+s(a(n!=null?r(n,"name"):n,n))+`',
|
|
512
|
+
data_product_id: '`+s(a(n!=null?r(n,"dataProductId"):n,n))+`',
|
|
513
|
+
data_product_name: '`+s(a(n!=null?r(n,"dataProductName"):n,n))+`'
|
|
514
514
|
});
|
|
515
515
|
|
|
516
|
-
const context = Array.isArray(`+s((i
|
|
517
|
-
? [...`+s((i
|
|
516
|
+
const context = Array.isArray(`+s((r(i,"startLow")||n&&r(n,"startLow")||u).call(l,n!=null?r(n,"generatedName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:70,column:32},end:{line:70,column:63}}}))+`.context)
|
|
517
|
+
? [...`+s((r(i,"startLow")||n&&r(n,"startLow")||u).call(l,n!=null?r(n,"generatedName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:71,column:10},end:{line:71,column:41}}}))+`.context, eventSpecificationContext]
|
|
518
518
|
: [eventSpecificationContext];
|
|
519
519
|
|
|
520
|
-
const modified`+s(a(n!=null?
|
|
521
|
-
...`+s((i
|
|
520
|
+
const modified`+s(a(n!=null?r(n,"generatedName"):n,n))+` = {
|
|
521
|
+
...`+s((r(i,"startLow")||n&&r(n,"startLow")||u).call(l,n!=null?r(n,"generatedName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:75,column:7},end:{line:75,column:38}}}))+`,
|
|
522
522
|
context,
|
|
523
523
|
};
|
|
524
524
|
|
|
525
|
-
track`+s(a(n!=null?
|
|
525
|
+
track`+s(a(n!=null?r(n,"event"):n,n))+((o=r(i,"if").call(l,n!=null?r(n,"entities"):n,{name:"if",hash:{},fn:e.program(9,t,0),inverse:e.noop,data:t,loc:{start:{line:79,column:21},end:{line:79,column:90}}}))!=null?o:"")+"(tracker, modified"+s(a(n!=null?r(n,"generatedName"):n,n))+`);
|
|
526
526
|
}
|
|
527
|
-
`},6:function(e,n,
|
|
527
|
+
`},6:function(e,n,i,c,t){var o,a=e.lookupProperty||function(s,l){if(Object.prototype.hasOwnProperty.call(s,l))return s[l]};return"<"+((o=a(i,"join").call(n??(e.nullContext||{}),n!=null?a(n,"entities"):n," | ",{name:"join",hash:{},fn:e.program(7,t,0),inverse:e.noop,data:t,loc:{start:{line:62,column:159},end:{line:62,column:197}}}))!=null?o:"")+">"},7:function(e,n,i,c,t){return""},9:function(e,n,i,c,t){var o,a=e.lookupProperty||function(s,l){if(Object.prototype.hasOwnProperty.call(s,l))return s[l]};return"<"+((o=a(i,"join").call(n??(e.nullContext||{}),n!=null?a(n,"entities"):n," | ",{name:"join",hash:{},fn:e.program(7,t,0),inverse:e.noop,data:t,loc:{start:{line:79,column:43},end:{line:79,column:81}}}))!=null?o:"")+"> "},compiler:[8,">= 4.3.0"],main:function(e,n,i,c,t){var o,a,s,l=n??(e.nullContext||{}),u=e.lookupProperty||function(m,f){if(Object.prototype.hasOwnProperty.call(m,f))return m[f]},r=`interface CommonEventProperties<T = Record<string, unknown>> {
|
|
528
528
|
/** Add context to an event by setting an Array of Self Describing JSON */
|
|
529
529
|
context?: Array<SelfDescribingJson<T>> | null;
|
|
530
530
|
/** Set the true timestamp or overwrite the device sent timestamp on an event */
|
|
531
531
|
timestamp?: Timestamp | null;
|
|
532
532
|
}
|
|
533
533
|
|
|
534
|
-
`+((
|
|
535
|
-
`;return
|
|
536
|
-
`+((
|
|
537
|
-
/** `+((
|
|
538
|
-
`},5:function(e,n,
|
|
539
|
-
`},6:function(e,n,
|
|
540
|
-
`},10:function(e,n,
|
|
541
|
-
`+((s=y(
|
|
542
|
-
`},11:function(e,n,
|
|
543
|
-
`},16:function(e,n,
|
|
544
|
-
`},19:function(e,n,
|
|
545
|
-
`},22:function(e,n,
|
|
546
|
-
`},25:function(e,n,
|
|
547
|
-
`},27:function(e,n,
|
|
548
|
-
`},30:function(e,n,
|
|
549
|
-
`},33:function(e,n,
|
|
550
|
-
`},36:function(e,n,
|
|
551
|
-
`},39:function(e,n,
|
|
552
|
-
`},41:function(e,n,
|
|
553
|
-
`},44:function(e,n,
|
|
554
|
-
`},47:function(e,n,
|
|
555
|
-
`},50:function(e,n,
|
|
556
|
-
`},53:function(e,n,
|
|
557
|
-
`+((
|
|
558
|
-
`+((
|
|
534
|
+
`+((o=u(i,"if").call(l,(o=n!=null?u(n,"eventSpecifications"):n)!=null?u(o,"length"):o,{name:"if",hash:{},fn:e.program(1,t,0),inverse:e.noop,data:t,loc:{start:{line:8,column:0},end:{line:29,column:7}}}))!=null?o:"")+`
|
|
535
|
+
`;return o=(a=(a=u(i,"type")||(n!=null?u(n,"type"):n))!=null?a:e.hooks.helperMissing,s={name:"type",hash:{},fn:e.program(3,t,0),inverse:e.noop,data:t,loc:{start:{line:31,column:0},end:{line:55,column:9}}},typeof a=="function"?a.call(l,s):a),u(i,"type")||(o=e.hooks.blockHelperMissing.call(n,o,s)),o!=null&&(r+=o),r+`
|
|
536
|
+
`+((o=u(i,"each").call(l,n!=null?u(n,"eventSpecifications"):n,{name:"each",hash:{},fn:e.program(5,t,0),inverse:e.noop,data:t,loc:{start:{line:57,column:0},end:{line:81,column:9}}}))!=null?o:"")},useData:!0}});var Wn=P(($l,Qn)=>{"use strict";Qn.exports={id:{language:"kotlin",tracker:"snowplow-android-tracker"},1:function(e,n,i,c,t){var o,a=e.lookupProperty||function(s,l){if(Object.prototype.hasOwnProperty.call(s,l))return s[l]};return(o=a(i,"each").call(n??(e.nullContext||{}),n!=null?a(n,"properties"):n,{name:"each",hash:{},fn:e.program(2,t,0),inverse:e.noop,data:t,loc:{start:{line:10,column:0},end:{line:20,column:9}}}))!=null?o:""},2:function(e,n,i,c,t){var o,a=n??(e.nullContext||{}),s=e.lookupProperty||function(l,u){if(Object.prototype.hasOwnProperty.call(l,u))return l[u]};return((o=s(i,"if").call(a,n!=null?s(n,"description"):n,{name:"if",hash:{},fn:e.program(3,t,0),inverse:e.noop,data:t,loc:{start:{line:11,column:0},end:{line:14,column:7}}}))!=null?o:"")+((o=s(i,"if").call(a,n!=null?s(n,"isNullable"):n,{name:"if",hash:{},fn:e.program(5,t,0),inverse:e.program(8,t,0),data:t,loc:{start:{line:15,column:0},end:{line:19,column:7}}}))!=null?o:"")},3:function(e,n,i,c,t){var o,a,s=e.lookupProperty||function(l,u){if(Object.prototype.hasOwnProperty.call(l,u))return l[u]};return`
|
|
537
|
+
/** `+((o=(a=(a=s(i,"description")||(n!=null?s(n,"description"):n))!=null?a:e.hooks.helperMissing,typeof a=="function"?a.call(n??(e.nullContext||{}),{name:"description",hash:{},data:t,loc:{start:{line:13,column:8},end:{line:13,column:25}}}):a))!=null?o:"")+` */
|
|
538
|
+
`},5:function(e,n,i,c,t){var o,a,s=n??(e.nullContext||{}),l=e.hooks.helperMissing,u="function",r=e.lookupProperty||function(m,f){if(Object.prototype.hasOwnProperty.call(m,f))return m[f]};return" var "+e.escapeExpression((a=(a=r(i,"name")||(n!=null?r(n,"name"):n))!=null?a:l,typeof a===u?a.call(s,{name:"name",hash:{},data:t,loc:{start:{line:16,column:8},end:{line:16,column:16}}}):a))+": "+((o=(a=(a=r(i,"type")||(n!=null?r(n,"type"):n))!=null?a:l,typeof a===u?a.call(s,{name:"type",hash:{},data:t,loc:{start:{line:16,column:18},end:{line:16,column:28}}}):a))!=null?o:"")+" = null"+((o=r(i,"unless").call(s,t&&r(t,"last"),{name:"unless",hash:{},fn:e.program(6,t,0),inverse:e.noop,data:t,loc:{start:{line:16,column:35},end:{line:16,column:65}}}))!=null?o:"")+`
|
|
539
|
+
`},6:function(e,n,i,c,t){return", "},8:function(e,n,i,c,t){var o,a,s=n??(e.nullContext||{}),l=e.hooks.helperMissing,u="function",r=e.lookupProperty||function(m,f){if(Object.prototype.hasOwnProperty.call(m,f))return m[f]};return" var "+e.escapeExpression((a=(a=r(i,"name")||(n!=null?r(n,"name"):n))!=null?a:l,typeof a===u?a.call(s,{name:"name",hash:{},data:t,loc:{start:{line:18,column:8},end:{line:18,column:16}}}):a))+": "+((o=(a=(a=r(i,"type")||(n!=null?r(n,"type"):n))!=null?a:l,typeof a===u?a.call(s,{name:"type",hash:{},data:t,loc:{start:{line:18,column:18},end:{line:18,column:28}}}):a))!=null?o:"")+((o=r(i,"unless").call(s,t&&r(t,"last"),{name:"unless",hash:{},fn:e.program(6,t,0),inverse:e.noop,data:t,loc:{start:{line:18,column:28},end:{line:18,column:58}}}))!=null?o:"")+`
|
|
540
|
+
`},10:function(e,n,i,c,t,o,a){var s,l,u=n??(e.nullContext||{}),r=e.hooks.helperMissing,m="function",f=e.escapeExpression,y=e.lookupProperty||function(g,p){if(Object.prototype.hasOwnProperty.call(g,p))return g[p]};return" "+f((l=(l=y(i,"indent")||(n!=null?y(n,"indent"):n))!=null?l:r,typeof l===m?l.call(u,{name:"indent",hash:{},data:t,loc:{start:{line:25,column:8},end:{line:25,column:18}}}):l))+`val payload = HashMap<String, Any?>()
|
|
541
|
+
`+((s=y(i,"each").call(u,n!=null?y(n,"properties"):n,{name:"each",hash:{},fn:e.program(11,t,0,o,a),inverse:e.noop,data:t,loc:{start:{line:26,column:0},end:{line:71,column:9}}}))!=null?s:"")+" "+f((l=(l=y(i,"indent")||(n!=null?y(n,"indent"):n))!=null?l:r,typeof l===m?l.call(u,{name:"indent",hash:{},data:t,loc:{start:{line:72,column:8},end:{line:72,column:18}}}):l))+`return payload
|
|
542
|
+
`},11:function(e,n,i,c,t,o,a){var s,l=e.lookupProperty||function(u,r){if(Object.prototype.hasOwnProperty.call(u,r))return u[r]};return(s=l(i,"if").call(n??(e.nullContext||{}),n!=null?l(n,"isNullable"):n,{name:"if",hash:{},fn:e.program(12,t,0,o,a),inverse:e.program(41,t,0,o,a),data:t,loc:{start:{line:27,column:0},end:{line:70,column:7}}}))!=null?s:""},12:function(e,n,i,c,t,o,a){var s,l=e.lookupProperty||function(u,r){if(Object.prototype.hasOwnProperty.call(u,r))return u[r]};return(s=l(i,"if").call(n??(e.nullContext||{}),n!=null?l(n,"isOptional"):n,{name:"if",hash:{},fn:e.program(13,t,0,o,a),inverse:e.program(27,t,0,o,a),data:t,loc:{start:{line:28,column:0},end:{line:55,column:7}}}))!=null?s:""},13:function(e,n,i,c,t,o,a){var s,l=e.lookupProperty||function(u,r){if(Object.prototype.hasOwnProperty.call(u,r))return u[r]};return(s=l(i,"if").call(n??(e.nullContext||{}),n!=null?l(n,"isArrayOfEnums"):n,{name:"if",hash:{},fn:e.program(14,t,0,o,a),inverse:e.program(16,t,0,o,a),data:t,loc:{start:{line:29,column:0},end:{line:40,column:7}}}))!=null?s:""},14:function(e,n,i,c,t,o,a){var s,l,u=e.escapeExpression,r=n??(e.nullContext||{}),m=e.hooks.helperMissing,f="function",y=e.lookupProperty||function(g,p){if(Object.prototype.hasOwnProperty.call(g,p))return g[p]};return" "+u(e.lambda(a[1]!=null?y(a[1],"indent"):a[1],n))+u((l=(l=y(i,"name")||(n!=null?y(n,"name"):n))!=null?l:m,typeof l===f?l.call(r,{name:"name",hash:{},data:t,loc:{start:{line:31,column:21},end:{line:31,column:29}}}):l))+'?.let { payload["'+((s=(l=(l=y(i,"jsonName")||(n!=null?y(n,"jsonName"):n))!=null?l:m,typeof l===f?l.call(r,{name:"jsonName",hash:{},data:t,loc:{start:{line:31,column:46},end:{line:31,column:60}}}):l))!=null?s:"")+`"] = it.map { e -> e.string } }
|
|
543
|
+
`},16:function(e,n,i,c,t,o,a){var s,l=e.lookupProperty||function(u,r){if(Object.prototype.hasOwnProperty.call(u,r))return u[r]};return(s=l(i,"if").call(n??(e.nullContext||{}),n!=null?l(n,"isArrayOfObjects"):n,{name:"if",hash:{},fn:e.program(17,t,0,o,a),inverse:e.program(19,t,0,o,a),data:t,loc:{start:{line:32,column:0},end:{line:40,column:0}}}))!=null?s:""},17:function(e,n,i,c,t,o,a){var s,l,u=e.escapeExpression,r=n??(e.nullContext||{}),m=e.hooks.helperMissing,f="function",y=e.lookupProperty||function(g,p){if(Object.prototype.hasOwnProperty.call(g,p))return g[p]};return" "+u(e.lambda(a[1]!=null?y(a[1],"indent"):a[1],n))+u((l=(l=y(i,"name")||(n!=null?y(n,"name"):n))!=null?l:m,typeof l===f?l.call(r,{name:"name",hash:{},data:t,loc:{start:{line:33,column:21},end:{line:33,column:29}}}):l))+'?.let { payload["'+((s=(l=(l=y(i,"jsonName")||(n!=null?y(n,"jsonName"):n))!=null?l:m,typeof l===f?l.call(r,{name:"jsonName",hash:{},data:t,loc:{start:{line:33,column:46},end:{line:33,column:60}}}):l))!=null?s:"")+`"] = it.map { e -> e.payload } }
|
|
544
|
+
`},19:function(e,n,i,c,t,o,a){var s,l=e.lookupProperty||function(u,r){if(Object.prototype.hasOwnProperty.call(u,r))return u[r]};return(s=l(i,"if").call(n??(e.nullContext||{}),n!=null?l(n,"isEnum"):n,{name:"if",hash:{},fn:e.program(20,t,0,o,a),inverse:e.program(22,t,0,o,a),data:t,loc:{start:{line:34,column:0},end:{line:40,column:0}}}))!=null?s:""},20:function(e,n,i,c,t,o,a){var s,l,u=e.escapeExpression,r=n??(e.nullContext||{}),m=e.hooks.helperMissing,f="function",y=e.lookupProperty||function(g,p){if(Object.prototype.hasOwnProperty.call(g,p))return g[p]};return" "+u(e.lambda(a[1]!=null?y(a[1],"indent"):a[1],n))+u((l=(l=y(i,"name")||(n!=null?y(n,"name"):n))!=null?l:m,typeof l===f?l.call(r,{name:"name",hash:{},data:t,loc:{start:{line:35,column:21},end:{line:35,column:29}}}):l))+'?.let { payload["'+((s=(l=(l=y(i,"jsonName")||(n!=null?y(n,"jsonName"):n))!=null?l:m,typeof l===f?l.call(r,{name:"jsonName",hash:{},data:t,loc:{start:{line:35,column:46},end:{line:35,column:60}}}):l))!=null?s:"")+`"] = it.string }
|
|
545
|
+
`},22:function(e,n,i,c,t,o,a){var s,l=e.lookupProperty||function(u,r){if(Object.prototype.hasOwnProperty.call(u,r))return u[r]};return(s=l(i,"if").call(n??(e.nullContext||{}),n!=null?l(n,"isObject"):n,{name:"if",hash:{},fn:e.program(23,t,0,o,a),inverse:e.program(25,t,0,o,a),data:t,loc:{start:{line:36,column:0},end:{line:40,column:0}}}))!=null?s:""},23:function(e,n,i,c,t,o,a){var s,l,u=e.escapeExpression,r=n??(e.nullContext||{}),m=e.hooks.helperMissing,f="function",y=e.lookupProperty||function(g,p){if(Object.prototype.hasOwnProperty.call(g,p))return g[p]};return" "+u(e.lambda(a[1]!=null?y(a[1],"indent"):a[1],n))+u((l=(l=y(i,"name")||(n!=null?y(n,"name"):n))!=null?l:m,typeof l===f?l.call(r,{name:"name",hash:{},data:t,loc:{start:{line:37,column:21},end:{line:37,column:29}}}):l))+'?.let { payload["'+((s=(l=(l=y(i,"jsonName")||(n!=null?y(n,"jsonName"):n))!=null?l:m,typeof l===f?l.call(r,{name:"jsonName",hash:{},data:t,loc:{start:{line:37,column:46},end:{line:37,column:60}}}):l))!=null?s:"")+`"] = it.payload }
|
|
546
|
+
`},25:function(e,n,i,c,t,o,a){var s,l,u=e.escapeExpression,r=n??(e.nullContext||{}),m=e.hooks.helperMissing,f="function",y=e.lookupProperty||function(g,p){if(Object.prototype.hasOwnProperty.call(g,p))return g[p]};return" "+u(e.lambda(a[1]!=null?y(a[1],"indent"):a[1],n))+u((l=(l=y(i,"name")||(n!=null?y(n,"name"):n))!=null?l:m,typeof l===f?l.call(r,{name:"name",hash:{},data:t,loc:{start:{line:39,column:21},end:{line:39,column:29}}}):l))+'?.let { payload["'+((s=(l=(l=y(i,"jsonName")||(n!=null?y(n,"jsonName"):n))!=null?l:m,typeof l===f?l.call(r,{name:"jsonName",hash:{},data:t,loc:{start:{line:39,column:46},end:{line:39,column:60}}}):l))!=null?s:"")+`"] = it }
|
|
547
|
+
`},27:function(e,n,i,c,t,o,a){var s,l=e.lookupProperty||function(u,r){if(Object.prototype.hasOwnProperty.call(u,r))return u[r]};return(s=l(i,"if").call(n??(e.nullContext||{}),n!=null?l(n,"isArrayOfEnums"):n,{name:"if",hash:{},fn:e.program(28,t,0,o,a),inverse:e.program(30,t,0,o,a),data:t,loc:{start:{line:43,column:0},end:{line:54,column:7}}}))!=null?s:""},28:function(e,n,i,c,t,o,a){var s,l,u=e.escapeExpression,r=n??(e.nullContext||{}),m=e.hooks.helperMissing,f="function",y=e.lookupProperty||function(g,p){if(Object.prototype.hasOwnProperty.call(g,p))return g[p]};return" "+u(e.lambda(a[1]!=null?y(a[1],"indent"):a[1],n))+'payload["'+((s=(l=(l=y(i,"jsonName")||(n!=null?y(n,"jsonName"):n))!=null?l:m,typeof l===f?l.call(r,{name:"jsonName",hash:{},data:t,loc:{start:{line:45,column:30},end:{line:45,column:44}}}):l))!=null?s:"")+'"] = '+u((l=(l=y(i,"name")||(n!=null?y(n,"name"):n))!=null?l:m,typeof l===f?l.call(r,{name:"name",hash:{},data:t,loc:{start:{line:45,column:49},end:{line:45,column:57}}}):l))+`?.map { e -> e.string }
|
|
548
|
+
`},30:function(e,n,i,c,t,o,a){var s,l=e.lookupProperty||function(u,r){if(Object.prototype.hasOwnProperty.call(u,r))return u[r]};return(s=l(i,"if").call(n??(e.nullContext||{}),n!=null?l(n,"isArrayOfObjects"):n,{name:"if",hash:{},fn:e.program(31,t,0,o,a),inverse:e.program(33,t,0,o,a),data:t,loc:{start:{line:46,column:0},end:{line:54,column:0}}}))!=null?s:""},31:function(e,n,i,c,t,o,a){var s,l,u=e.escapeExpression,r=n??(e.nullContext||{}),m=e.hooks.helperMissing,f="function",y=e.lookupProperty||function(g,p){if(Object.prototype.hasOwnProperty.call(g,p))return g[p]};return" "+u(e.lambda(a[1]!=null?y(a[1],"indent"):a[1],n))+'payload["'+((s=(l=(l=y(i,"jsonName")||(n!=null?y(n,"jsonName"):n))!=null?l:m,typeof l===f?l.call(r,{name:"jsonName",hash:{},data:t,loc:{start:{line:47,column:30},end:{line:47,column:44}}}):l))!=null?s:"")+'"] = '+u((l=(l=y(i,"name")||(n!=null?y(n,"name"):n))!=null?l:m,typeof l===f?l.call(r,{name:"name",hash:{},data:t,loc:{start:{line:47,column:49},end:{line:47,column:57}}}):l))+`?.map { e -> e.payload }
|
|
549
|
+
`},33:function(e,n,i,c,t,o,a){var s,l=e.lookupProperty||function(u,r){if(Object.prototype.hasOwnProperty.call(u,r))return u[r]};return(s=l(i,"if").call(n??(e.nullContext||{}),n!=null?l(n,"isEnum"):n,{name:"if",hash:{},fn:e.program(34,t,0,o,a),inverse:e.program(36,t,0,o,a),data:t,loc:{start:{line:48,column:0},end:{line:54,column:0}}}))!=null?s:""},34:function(e,n,i,c,t,o,a){var s,l,u=e.escapeExpression,r=n??(e.nullContext||{}),m=e.hooks.helperMissing,f="function",y=e.lookupProperty||function(g,p){if(Object.prototype.hasOwnProperty.call(g,p))return g[p]};return" "+u(e.lambda(a[1]!=null?y(a[1],"indent"):a[1],n))+'payload["'+((s=(l=(l=y(i,"jsonName")||(n!=null?y(n,"jsonName"):n))!=null?l:m,typeof l===f?l.call(r,{name:"jsonName",hash:{},data:t,loc:{start:{line:49,column:30},end:{line:49,column:44}}}):l))!=null?s:"")+'"] = '+u((l=(l=y(i,"name")||(n!=null?y(n,"name"):n))!=null?l:m,typeof l===f?l.call(r,{name:"name",hash:{},data:t,loc:{start:{line:49,column:49},end:{line:49,column:57}}}):l))+`?.string
|
|
550
|
+
`},36:function(e,n,i,c,t,o,a){var s,l=e.lookupProperty||function(u,r){if(Object.prototype.hasOwnProperty.call(u,r))return u[r]};return(s=l(i,"if").call(n??(e.nullContext||{}),n!=null?l(n,"isObject"):n,{name:"if",hash:{},fn:e.program(37,t,0,o,a),inverse:e.program(39,t,0,o,a),data:t,loc:{start:{line:50,column:0},end:{line:54,column:0}}}))!=null?s:""},37:function(e,n,i,c,t,o,a){var s,l,u=e.escapeExpression,r=n??(e.nullContext||{}),m=e.hooks.helperMissing,f="function",y=e.lookupProperty||function(g,p){if(Object.prototype.hasOwnProperty.call(g,p))return g[p]};return" "+u(e.lambda(a[1]!=null?y(a[1],"indent"):a[1],n))+'payload["'+((s=(l=(l=y(i,"jsonName")||(n!=null?y(n,"jsonName"):n))!=null?l:m,typeof l===f?l.call(r,{name:"jsonName",hash:{},data:t,loc:{start:{line:51,column:30},end:{line:51,column:44}}}):l))!=null?s:"")+'"] = '+u((l=(l=y(i,"name")||(n!=null?y(n,"name"):n))!=null?l:m,typeof l===f?l.call(r,{name:"name",hash:{},data:t,loc:{start:{line:51,column:49},end:{line:51,column:57}}}):l))+`?.payload
|
|
551
|
+
`},39:function(e,n,i,c,t,o,a){var s,l,u=e.escapeExpression,r=n??(e.nullContext||{}),m=e.hooks.helperMissing,f="function",y=e.lookupProperty||function(g,p){if(Object.prototype.hasOwnProperty.call(g,p))return g[p]};return" "+u(e.lambda(a[1]!=null?y(a[1],"indent"):a[1],n))+'payload["'+((s=(l=(l=y(i,"jsonName")||(n!=null?y(n,"jsonName"):n))!=null?l:m,typeof l===f?l.call(r,{name:"jsonName",hash:{},data:t,loc:{start:{line:53,column:30},end:{line:53,column:44}}}):l))!=null?s:"")+'"] = '+u((l=(l=y(i,"name")||(n!=null?y(n,"name"):n))!=null?l:m,typeof l===f?l.call(r,{name:"name",hash:{},data:t,loc:{start:{line:53,column:49},end:{line:53,column:57}}}):l))+`
|
|
552
|
+
`},41:function(e,n,i,c,t,o,a){var s,l=e.lookupProperty||function(u,r){if(Object.prototype.hasOwnProperty.call(u,r))return u[r]};return(s=l(i,"if").call(n??(e.nullContext||{}),n!=null?l(n,"isArrayOfEnums"):n,{name:"if",hash:{},fn:e.program(42,t,0,o,a),inverse:e.program(44,t,0,o,a),data:t,loc:{start:{line:58,column:0},end:{line:69,column:7}}}))!=null?s:""},42:function(e,n,i,c,t,o,a){var s,l,u=e.escapeExpression,r=n??(e.nullContext||{}),m=e.hooks.helperMissing,f="function",y=e.lookupProperty||function(g,p){if(Object.prototype.hasOwnProperty.call(g,p))return g[p]};return" "+u(e.lambda(a[1]!=null?y(a[1],"indent"):a[1],n))+'payload["'+((s=(l=(l=y(i,"jsonName")||(n!=null?y(n,"jsonName"):n))!=null?l:m,typeof l===f?l.call(r,{name:"jsonName",hash:{},data:t,loc:{start:{line:60,column:30},end:{line:60,column:44}}}):l))!=null?s:"")+'"] = '+u((l=(l=y(i,"name")||(n!=null?y(n,"name"):n))!=null?l:m,typeof l===f?l.call(r,{name:"name",hash:{},data:t,loc:{start:{line:60,column:49},end:{line:60,column:57}}}):l))+`.map { e -> e.string }
|
|
553
|
+
`},44:function(e,n,i,c,t,o,a){var s,l=e.lookupProperty||function(u,r){if(Object.prototype.hasOwnProperty.call(u,r))return u[r]};return(s=l(i,"if").call(n??(e.nullContext||{}),n!=null?l(n,"isArrayOfObjects"):n,{name:"if",hash:{},fn:e.program(45,t,0,o,a),inverse:e.program(47,t,0,o,a),data:t,loc:{start:{line:61,column:0},end:{line:69,column:0}}}))!=null?s:""},45:function(e,n,i,c,t,o,a){var s,l,u=e.escapeExpression,r=n??(e.nullContext||{}),m=e.hooks.helperMissing,f="function",y=e.lookupProperty||function(g,p){if(Object.prototype.hasOwnProperty.call(g,p))return g[p]};return" "+u(e.lambda(a[1]!=null?y(a[1],"indent"):a[1],n))+'payload["'+((s=(l=(l=y(i,"jsonName")||(n!=null?y(n,"jsonName"):n))!=null?l:m,typeof l===f?l.call(r,{name:"jsonName",hash:{},data:t,loc:{start:{line:62,column:30},end:{line:62,column:44}}}):l))!=null?s:"")+'"] = '+u((l=(l=y(i,"name")||(n!=null?y(n,"name"):n))!=null?l:m,typeof l===f?l.call(r,{name:"name",hash:{},data:t,loc:{start:{line:62,column:49},end:{line:62,column:57}}}):l))+`.map { e -> e.payload }
|
|
554
|
+
`},47:function(e,n,i,c,t,o,a){var s,l=e.lookupProperty||function(u,r){if(Object.prototype.hasOwnProperty.call(u,r))return u[r]};return(s=l(i,"if").call(n??(e.nullContext||{}),n!=null?l(n,"isEnum"):n,{name:"if",hash:{},fn:e.program(48,t,0,o,a),inverse:e.program(50,t,0,o,a),data:t,loc:{start:{line:63,column:0},end:{line:69,column:0}}}))!=null?s:""},48:function(e,n,i,c,t,o,a){var s,l,u=e.escapeExpression,r=n??(e.nullContext||{}),m=e.hooks.helperMissing,f="function",y=e.lookupProperty||function(g,p){if(Object.prototype.hasOwnProperty.call(g,p))return g[p]};return" "+u(e.lambda(a[1]!=null?y(a[1],"indent"):a[1],n))+'payload["'+((s=(l=(l=y(i,"jsonName")||(n!=null?y(n,"jsonName"):n))!=null?l:m,typeof l===f?l.call(r,{name:"jsonName",hash:{},data:t,loc:{start:{line:64,column:30},end:{line:64,column:44}}}):l))!=null?s:"")+'"] = '+u((l=(l=y(i,"name")||(n!=null?y(n,"name"):n))!=null?l:m,typeof l===f?l.call(r,{name:"name",hash:{},data:t,loc:{start:{line:64,column:49},end:{line:64,column:57}}}):l))+`.string
|
|
555
|
+
`},50:function(e,n,i,c,t,o,a){var s,l=e.lookupProperty||function(u,r){if(Object.prototype.hasOwnProperty.call(u,r))return u[r]};return(s=l(i,"if").call(n??(e.nullContext||{}),n!=null?l(n,"isObject"):n,{name:"if",hash:{},fn:e.program(51,t,0,o,a),inverse:e.program(39,t,0,o,a),data:t,loc:{start:{line:65,column:0},end:{line:69,column:0}}}))!=null?s:""},51:function(e,n,i,c,t,o,a){var s,l,u=e.escapeExpression,r=n??(e.nullContext||{}),m=e.hooks.helperMissing,f="function",y=e.lookupProperty||function(g,p){if(Object.prototype.hasOwnProperty.call(g,p))return g[p]};return" "+u(e.lambda(a[1]!=null?y(a[1],"indent"):a[1],n))+'payload["'+((s=(l=(l=y(i,"jsonName")||(n!=null?y(n,"jsonName"):n))!=null?l:m,typeof l===f?l.call(r,{name:"jsonName",hash:{},data:t,loc:{start:{line:66,column:30},end:{line:66,column:44}}}):l))!=null?s:"")+'"] = '+u((l=(l=y(i,"name")||(n!=null?y(n,"name"):n))!=null?l:m,typeof l===f?l.call(r,{name:"name",hash:{},data:t,loc:{start:{line:66,column:49},end:{line:66,column:57}}}):l))+`.payload
|
|
556
|
+
`},53:function(e,n,i,c,t){var o,a,s=n??(e.nullContext||{}),l=e.hooks.helperMissing,u="function",r=e.escapeExpression,m=e.lookupProperty||function(f,y){if(Object.prototype.hasOwnProperty.call(f,y))return f[y]};return`/**
|
|
557
|
+
`+((o=m(i,"if").call(s,n!=null?m(n,"description"):n,{name:"if",hash:{},fn:e.program(54,t,0),inverse:e.noop,data:t,loc:{start:{line:78,column:0},end:{line:80,column:7}}}))!=null?o:"")+"* Schema: `"+r((a=(a=m(i,"igluUrl")||(n!=null?m(n,"igluUrl"):n))!=null?a:l,typeof a===u?a.call(s,{name:"igluUrl",hash:{},data:t,loc:{start:{line:81,column:11},end:{line:81,column:22}}}):a))+"`\n*\n* Example:\n* ```kotlin\n* val data = "+r((a=(a=m(i,"typeName")||(n!=null?m(n,"typeName"):n))!=null?a:l,typeof a===u?a.call(s,{name:"typeName",hash:{},data:t,loc:{start:{line:85,column:13},end:{line:85,column:25}}}):a))+`(
|
|
558
|
+
`+((o=m(i,"each").call(s,n!=null?m(n,"properties"):n,{name:"each",hash:{},fn:e.program(56,t,0),inverse:e.noop,data:t,loc:{start:{line:86,column:0},end:{line:88,column:9}}}))!=null?o:"")+`* )
|
|
559
559
|
* // Track as an event
|
|
560
560
|
* Snowplow.defaultTracker?.track(data.toEvent())
|
|
561
561
|
* // Add as an entity to another event
|
|
@@ -564,13 +564,13 @@ export function track`+s(a(n!=null?i(n,"generatedName"):n,n))+"Spec(tracker: Tra
|
|
|
564
564
|
* Snowplow.defaultTracker?.track(event)
|
|
565
565
|
* \`\`\`
|
|
566
566
|
*/
|
|
567
|
-
data class `+
|
|
568
|
-
`+((
|
|
569
|
-
private val schema = "`+
|
|
567
|
+
data class `+r((a=(a=m(i,"typeName")||(n!=null?m(n,"typeName"):n))!=null?a:l,typeof a===u?a.call(s,{name:"typeName",hash:{},data:t,loc:{start:{line:98,column:11},end:{line:98,column:23}}}):a))+`(
|
|
568
|
+
`+((o=e.invokePartial(m(c,"classProperties"),n,{name:"classProperties",data:t,helpers:i,partials:c,decorators:e.decorators}))!=null?o:"")+`) {
|
|
569
|
+
private val schema = "`+r((a=(a=m(i,"igluUrl")||(n!=null?m(n,"igluUrl"):n))!=null?a:l,typeof a===u?a.call(s,{name:"igluUrl",hash:{},data:t,loc:{start:{line:101,column:26},end:{line:101,column:37}}}):a))+`"
|
|
570
570
|
|
|
571
571
|
private val payload: Map<String, Any?>
|
|
572
572
|
get() {
|
|
573
|
-
`+((
|
|
573
|
+
`+((o=e.invokePartial(m(c,"createAndReturnPayloadDictionary"),n,{name:"createAndReturnPayloadDictionary",data:t,indent:" ",helpers:i,partials:c,decorators:e.decorators}))!=null?o:"")+` }
|
|
574
574
|
|
|
575
575
|
/** Creates an event instance to be tracked by the tracker. */
|
|
576
576
|
fun toEvent() : SelfDescribing {
|
|
@@ -583,33 +583,33 @@ data class `+i((a=(a=m(r,"typeName")||(n!=null?m(n,"typeName"):n))!=null?a:l,typ
|
|
|
583
583
|
}
|
|
584
584
|
}
|
|
585
585
|
|
|
586
|
-
`},54:function(e,n,
|
|
587
|
-
`},56:function(e,n,
|
|
588
|
-
`},58:function(e,n,
|
|
586
|
+
`},54:function(e,n,i,c,t){var o,a,s=e.lookupProperty||function(l,u){if(Object.prototype.hasOwnProperty.call(l,u))return l[u]};return"* "+((o=(a=(a=s(i,"description")||(n!=null?s(n,"description"):n))!=null?a:e.hooks.helperMissing,typeof a=="function"?a.call(n??(e.nullContext||{}),{name:"description",hash:{},data:t,loc:{start:{line:79,column:2},end:{line:79,column:19}}}):a))!=null?o:"")+`
|
|
587
|
+
`},56:function(e,n,i,c,t){var o,a,s=n??(e.nullContext||{}),l=e.hooks.helperMissing,u="function",r=e.escapeExpression,m=e.lookupProperty||function(f,y){if(Object.prototype.hasOwnProperty.call(f,y))return f[y]};return"* "+r((a=(a=m(i,"name")||(n!=null?m(n,"name"):n))!=null?a:l,typeof a===u?a.call(s,{name:"name",hash:{},data:t,loc:{start:{line:87,column:6},end:{line:87,column:14}}}):a))+" = "+r((a=(a=m(i,"name")||(n!=null?m(n,"name"):n))!=null?a:l,typeof a===u?a.call(s,{name:"name",hash:{},data:t,loc:{start:{line:87,column:17},end:{line:87,column:25}}}):a))+((o=m(i,"unless").call(s,t&&m(t,"last"),{name:"unless",hash:{},fn:e.program(6,t,0),inverse:e.noop,data:t,loc:{start:{line:87,column:25},end:{line:87,column:55}}}))!=null?o:"")+`
|
|
588
|
+
`},58:function(e,n,i,c,t){var o,a,s=n??(e.nullContext||{}),l=e.lookupProperty||function(u,r){if(Object.prototype.hasOwnProperty.call(u,r))return u[r]};return`
|
|
589
589
|
|
|
590
|
-
`+((
|
|
591
|
-
`+((
|
|
590
|
+
`+((o=l(i,"if").call(s,n!=null?l(n,"description"):n,{name:"if",hash:{},fn:e.program(59,t,0),inverse:e.noop,data:t,loc:{start:{line:181,column:0},end:{line:185,column:7}}}))!=null?o:"")+"data class "+e.escapeExpression((a=(a=l(i,"typeName")||(n!=null?l(n,"typeName"):n))!=null?a:e.hooks.helperMissing,typeof a=="function"?a.call(s,{name:"typeName",hash:{},data:t,loc:{start:{line:186,column:11},end:{line:186,column:23}}}):a))+`(
|
|
591
|
+
`+((o=e.invokePartial(l(c,"classProperties"),n,{name:"classProperties",data:t,helpers:i,partials:c,decorators:e.decorators}))!=null?o:"")+`) {
|
|
592
592
|
val payload: Map<String, Any?>
|
|
593
593
|
get() {
|
|
594
|
-
`+((
|
|
594
|
+
`+((o=e.invokePartial(l(c,"createAndReturnPayloadDictionary"),n,{name:"createAndReturnPayloadDictionary",data:t,indent:" ",helpers:i,partials:c,decorators:e.decorators}))!=null?o:"")+` }
|
|
595
595
|
}
|
|
596
|
-
`},59:function(e,n,
|
|
597
|
-
* `+((
|
|
596
|
+
`},59:function(e,n,i,c,t){var o,a,s=e.lookupProperty||function(l,u){if(Object.prototype.hasOwnProperty.call(l,u))return l[u]};return`/**
|
|
597
|
+
* `+((o=(a=(a=s(i,"description")||(n!=null?s(n,"description"):n))!=null?a:e.hooks.helperMissing,typeof a=="function"?a.call(n??(e.nullContext||{}),{name:"description",hash:{},data:t,loc:{start:{line:183,column:2},end:{line:183,column:19}}}):a))!=null?o:"")+`
|
|
598
598
|
*/
|
|
599
|
-
`},61:function(e,n,
|
|
600
|
-
`+((
|
|
601
|
-
`+((
|
|
602
|
-
`},62:function(e,n,
|
|
603
|
-
`},64:function(e,n,
|
|
599
|
+
`},61:function(e,n,i,c,t){var o,a,s=n??(e.nullContext||{}),l=e.lookupProperty||function(u,r){if(Object.prototype.hasOwnProperty.call(u,r))return u[r]};return`
|
|
600
|
+
`+((o=l(i,"if").call(s,n!=null?l(n,"description"):n,{name:"if",hash:{},fn:e.program(59,t,0),inverse:e.noop,data:t,loc:{start:{line:198,column:0},end:{line:202,column:7}}}))!=null?o:"")+"enum class "+e.escapeExpression((a=(a=l(i,"name")||(n!=null?l(n,"name"):n))!=null?a:e.hooks.helperMissing,typeof a=="function"?a.call(s,{name:"name",hash:{},data:t,loc:{start:{line:203,column:11},end:{line:203,column:19}}}):a))+`(val string: String) {
|
|
601
|
+
`+((o=l(i,"each").call(s,n!=null?l(n,"cases"):n,{name:"each",hash:{},fn:e.program(62,t,0),inverse:e.noop,data:t,loc:{start:{line:204,column:0},end:{line:206,column:9}}}))!=null?o:"")+`}
|
|
602
|
+
`},62:function(e,n,i,c,t){var o,a,s=n??(e.nullContext||{}),l=e.hooks.helperMissing,u="function",r=e.lookupProperty||function(m,f){if(Object.prototype.hasOwnProperty.call(m,f))return m[f]};return" "+e.escapeExpression((a=(a=r(i,"name")||(n!=null?r(n,"name"):n))!=null?a:l,typeof a===u?a.call(s,{name:"name",hash:{},data:t,loc:{start:{line:205,column:4},end:{line:205,column:12}}}):a))+'("'+((o=(a=(a=r(i,"jsonName")||(n!=null?r(n,"jsonName"):n))!=null?a:l,typeof a===u?a.call(s,{name:"jsonName",hash:{},data:t,loc:{start:{line:205,column:14},end:{line:205,column:28}}}):a))!=null?o:"")+'")'+((o=r(i,"unless").call(s,t&&r(t,"last"),{name:"unless",hash:{},fn:e.program(6,t,0),inverse:e.noop,data:t,loc:{start:{line:205,column:30},end:{line:205,column:60}}}))!=null?o:"")+`
|
|
603
|
+
`},64:function(e,n,i,c,t){var o,a=e.lambda,s=e.escapeExpression,l=n??(e.nullContext||{}),u=e.lookupProperty||function(r,m){if(Object.prototype.hasOwnProperty.call(r,m))return r[m]};return`
|
|
604
604
|
/**
|
|
605
605
|
* Creates an event with entities for a `+s(a(n!=null?u(n,"generatedName"):n,n))+` event specification.
|
|
606
|
-
* `+s((u(
|
|
607
|
-
`+((
|
|
606
|
+
* `+s((u(i,"addEventSpecificationIdentifier")||n&&u(n,"addEventSpecificationIdentifier")||e.hooks.helperMissing).call(l,n!=null?u(n,"id"):n,{name:"addEventSpecificationIdentifier",hash:{},data:t,loc:{start:{line:215,column:2},end:{line:215,column:45}}}))+"\n* Example:\n* ```kotlin\n* val data = "+s(a(n!=null?u(n,"event"):n,n))+`(...)
|
|
607
|
+
`+((o=u(i,"each").call(l,n!=null?u(n,"entities"):n,{name:"each",hash:{},fn:e.program(65,t,0),inverse:e.noop,data:t,loc:{start:{line:219,column:0},end:{line:221,column:9}}}))!=null?o:"")+"* val event = data.to"+s(a(n!=null?u(n,"generatedName"):n,n))+"Spec("+((o=u(i,"each").call(l,n!=null?u(n,"entities"):n,{name:"each",hash:{},fn:e.program(67,t,0),inverse:e.noop,data:t,loc:{start:{line:222,column:48},end:{line:222,column:123}}}))!=null?o:"")+`)
|
|
608
608
|
* // Track as an event
|
|
609
609
|
* Snowplow.defaultTracker?.track(event)
|
|
610
610
|
* \`\`\`
|
|
611
611
|
*/
|
|
612
|
-
fun `+s(a(n!=null?u(n,"event"):n,n))+".to"+s(a(n!=null?u(n,"generatedName"):n,n))+"Spec("+((
|
|
612
|
+
fun `+s(a(n!=null?u(n,"event"):n,n))+".to"+s(a(n!=null?u(n,"generatedName"):n,n))+"Spec("+((o=u(i,"each").call(l,n!=null?u(n,"entities"):n,{name:"each",hash:{},fn:e.program(69,t,0),inverse:e.noop,data:t,loc:{start:{line:227,column:48},end:{line:227,column:135}}}))!=null?o:"")+`) : SelfDescribing {
|
|
613
613
|
val event = toEvent()
|
|
614
614
|
val eventSpec = EventSpecification(
|
|
615
615
|
"`+s(a(n!=null?u(n,"id"):n,n))+`",
|
|
@@ -617,19 +617,19 @@ fun `+s(a(n!=null?u(n,"event"):n,n))+".to"+s(a(n!=null?u(n,"generatedName"):n,n)
|
|
|
617
617
|
"`+s(a(n!=null?u(n,"dataProductId"):n,n))+`",
|
|
618
618
|
"`+s(a(n!=null?u(n,"dataProductName"):n,n))+`"
|
|
619
619
|
)
|
|
620
|
-
`+((
|
|
620
|
+
`+((o=u(i,"each").call(l,n!=null?u(n,"entities"):n,{name:"each",hash:{},fn:e.program(71,t,0),inverse:e.noop,data:t,loc:{start:{line:235,column:0},end:{line:237,column:9}}}))!=null?o:"")+` event.entities.add(eventSpec.toEntity())
|
|
621
621
|
return event
|
|
622
622
|
}
|
|
623
|
-
`},65:function(e,n,
|
|
624
|
-
`},67:function(e,n,
|
|
625
|
-
`},compiler:[8,">= 4.3.0"],main:function(e,n,
|
|
623
|
+
`},65:function(e,n,i,c,t){var o=e.lambda,a=e.escapeExpression;return"* val data"+a(o(n,n))+" = "+a(o(n,n))+`(...)
|
|
624
|
+
`},67:function(e,n,i,c,t){var o,a=e.lookupProperty||function(s,l){if(Object.prototype.hasOwnProperty.call(s,l))return s[l]};return"data"+e.escapeExpression(e.lambda(n,n))+((o=a(i,"unless").call(n??(e.nullContext||{}),t&&a(t,"last"),{name:"unless",hash:{},fn:e.program(6,t,0),inverse:e.noop,data:t,loc:{start:{line:222,column:84},end:{line:222,column:114}}}))!=null?o:"")},69:function(e,n,i,c,t){var o,a=e.lambda,s=e.escapeExpression,l=e.lookupProperty||function(u,r){if(Object.prototype.hasOwnProperty.call(u,r))return u[r]};return"entity"+s(a(n,n))+": "+s(a(n,n))+((o=l(i,"unless").call(n??(e.nullContext||{}),t&&l(t,"last"),{name:"unless",hash:{},fn:e.program(6,t,0),inverse:e.noop,data:t,loc:{start:{line:227,column:96},end:{line:227,column:126}}}))!=null?o:"")},71:function(e,n,i,c,t){return" event.entities.add(entity"+e.escapeExpression(e.lambda(n,n))+`.toEntity())
|
|
625
|
+
`},compiler:[8,">= 4.3.0"],main:function(e,n,i,c,t,o,a){var s,l,u,r=n??(e.nullContext||{}),m=e.hooks.helperMissing,f="function",y=e.hooks.blockHelperMissing,g=e.lookupProperty||function(x,_){if(Object.prototype.hasOwnProperty.call(x,_))return x[_]},p=`// Automatically generated by Snowtype
|
|
626
626
|
|
|
627
627
|
package Snowtype
|
|
628
628
|
|
|
629
629
|
import com.snowplowanalytics.snowplow.event.SelfDescribing
|
|
630
630
|
import com.snowplowanalytics.snowplow.payload.SelfDescribingJson
|
|
631
631
|
|
|
632
|
-
`;return s=(l=(l=
|
|
632
|
+
`;return s=(l=(l=g(i,"type")||(n!=null?g(n,"type"):n))!=null?l:m,u={name:"type",hash:{},fn:e.program(53,t,0,o,a),inverse:e.noop,data:t,loc:{start:{line:75,column:0},end:{line:119,column:9}}},typeof l===f?l.call(r,u):l),g(i,"type")||(s=y.call(n,s,u)),s!=null&&(p+=s),p+=`/**
|
|
633
633
|
* Entity schema for referencing an event specification
|
|
634
634
|
* Schema: \`iglu:com.snowplowanalytics.snowplow/event_specification/jsonschema/1-0-2\`
|
|
635
635
|
*
|
|
@@ -685,29 +685,29 @@ data class EventSpecification(
|
|
|
685
685
|
return SelfDescribingJson(schema, payload)
|
|
686
686
|
}
|
|
687
687
|
}
|
|
688
|
-
`,s=(l=(l=
|
|
689
|
-
`},3:function(e,n,
|
|
690
|
-
`},5:function(e,n,
|
|
691
|
-
`+((s=y(
|
|
692
|
-
`},6:function(e,n,
|
|
693
|
-
`+((s=
|
|
694
|
-
`},8:function(e,n,
|
|
695
|
-
`},10:function(e,n,
|
|
696
|
-
`},13:function(e,n,
|
|
697
|
-
`},16:function(e,n,
|
|
698
|
-
`},19:function(e,n,
|
|
699
|
-
`},21:function(e,n,
|
|
700
|
-
`+
|
|
701
|
-
`},23:function(e,n,
|
|
702
|
-
`},26:function(e,n,
|
|
703
|
-
`},29:function(e,n,
|
|
704
|
-
`},32:function(e,n,
|
|
705
|
-
`},35:function(e,n,
|
|
706
|
-
`},37:function(e,n,
|
|
707
|
-
// MARK: - `+
|
|
708
|
-
|
|
709
|
-
`+((
|
|
710
|
-
`+((
|
|
688
|
+
`,s=(l=(l=g(i,"nestedTypes")||(n!=null?g(n,"nestedTypes"):n))!=null?l:m,u={name:"nestedTypes",hash:{},fn:e.program(58,t,0,o,a),inverse:e.noop,data:t,loc:{start:{line:177,column:0},end:{line:194,column:16}}},typeof l===f?l.call(r,u):l),g(i,"nestedTypes")||(s=y.call(n,s,u)),s!=null&&(p+=s),p+((s=g(i,"each").call(r,n!=null?g(n,"enums"):n,{name:"each",hash:{},fn:e.program(61,t,0,o,a),inverse:e.noop,data:t,loc:{start:{line:195,column:0},end:{line:208,column:9}}}))!=null?s:"")+((s=g(i,"each").call(r,n!=null?g(n,"eventSpecifications"):n,{name:"each",hash:{},fn:e.program(64,t,0,o,a),inverse:e.noop,data:t,loc:{start:{line:211,column:0},end:{line:241,column:9}}}))!=null?s:"")},main_d:function(e,n,i,c,t,o,a){var s=i.decorators,l=i.lookupProperty||function(u,r){if(Object.prototype.hasOwnProperty.call(u,r))return u[r]};return e=l(s,"inline")(e,n,i,{name:"inline",hash:{},fn:i.program(1,t,0,o,a),inverse:i.noop,args:["classProperties"],data:t,loc:{start:{line:8,column:0},end:{line:21,column:11}}})||e,e=l(s,"inline")(e,n,i,{name:"inline",hash:{},fn:i.program(10,t,0,o,a),inverse:i.noop,args:["createAndReturnPayloadDictionary"],data:t,loc:{start:{line:23,column:0},end:{line:73,column:11}}})||e,e},useDecorators:!0,usePartial:!0,useData:!0,useDepths:!0}});var Kn=P((Gl,Bn)=>{"use strict";Bn.exports={id:{language:"swift",tracker:"snowplow-ios-tracker"},1:function(e,n,i,c,t){var o,a=e.lookupProperty||function(s,l){if(Object.prototype.hasOwnProperty.call(s,l))return s[l]};return(o=a(i,"each").call(n??(e.nullContext||{}),n!=null?a(n,"properties"):n,{name:"each",hash:{},fn:e.program(2,t,0),inverse:e.noop,data:t,loc:{start:{line:5,column:0},end:{line:10,column:9}}}))!=null?o:""},2:function(e,n,i,c,t){var o,a,s=n??(e.nullContext||{}),l=e.hooks.helperMissing,u="function",r=e.escapeExpression,m=e.lookupProperty||function(f,y){if(Object.prototype.hasOwnProperty.call(f,y))return f[y]};return((o=m(i,"if").call(s,n!=null?m(n,"description"):n,{name:"if",hash:{},fn:e.program(3,t,0),inverse:e.noop,data:t,loc:{start:{line:6,column:0},end:{line:8,column:7}}}))!=null?o:"")+" var "+r((a=(a=m(i,"name")||(n!=null?m(n,"name"):n))!=null?a:l,typeof a===u?a.call(s,{name:"name",hash:{},data:t,loc:{start:{line:9,column:8},end:{line:9,column:16}}}):a))+": "+r((a=(a=m(i,"type")||(n!=null?m(n,"type"):n))!=null?a:l,typeof a===u?a.call(s,{name:"type",hash:{},data:t,loc:{start:{line:9,column:18},end:{line:9,column:26}}}):a))+`
|
|
689
|
+
`},3:function(e,n,i,c,t){var o,a,s=e.lookupProperty||function(l,u){if(Object.prototype.hasOwnProperty.call(l,u))return l[u]};return" /// "+((o=(a=(a=s(i,"description")||(n!=null?s(n,"description"):n))!=null?a:e.hooks.helperMissing,typeof a=="function"?a.call(n??(e.nullContext||{}),{name:"description",hash:{},data:t,loc:{start:{line:7,column:8},end:{line:7,column:25}}}):a))!=null?o:"")+`
|
|
690
|
+
`},5:function(e,n,i,c,t,o,a){var s,l,u=n??(e.nullContext||{}),r=e.hooks.helperMissing,m="function",f=e.escapeExpression,y=e.lookupProperty||function(g,p){if(Object.prototype.hasOwnProperty.call(g,p))return g[p]};return" "+f((l=(l=y(i,"indent")||(n!=null?y(n,"indent"):n))!=null?l:r,typeof l===m?l.call(u,{name:"indent",hash:{},data:t,loc:{start:{line:14,column:8},end:{line:14,column:18}}}):l))+`var payload: [String : Any] = [:]
|
|
691
|
+
`+((s=y(i,"each").call(u,n!=null?y(n,"properties"):n,{name:"each",hash:{},fn:e.program(6,t,0,o,a),inverse:e.noop,data:t,loc:{start:{line:15,column:0},end:{line:47,column:9}}}))!=null?s:"")+" "+f((l=(l=y(i,"indent")||(n!=null?y(n,"indent"):n))!=null?l:r,typeof l===m?l.call(u,{name:"indent",hash:{},data:t,loc:{start:{line:48,column:8},end:{line:48,column:18}}}):l))+`return payload
|
|
692
|
+
`},6:function(e,n,i,c,t,o,a){var s,l=e.lookupProperty||function(u,r){if(Object.prototype.hasOwnProperty.call(u,r))return u[r]};return(s=l(i,"if").call(n??(e.nullContext||{}),n!=null?l(n,"isNullableOrOptional"):n,{name:"if",hash:{},fn:e.program(7,t,0,o,a),inverse:e.program(23,t,0,o,a),data:t,loc:{start:{line:16,column:0},end:{line:46,column:7}}}))!=null?s:""},7:function(e,n,i,c,t,o,a){var s,l,u=e.lambda,r=e.escapeExpression,m=n??(e.nullContext||{}),f=e.hooks.helperMissing,y="function",g=e.lookupProperty||function(p,x){if(Object.prototype.hasOwnProperty.call(p,x))return p[x]};return" "+r(u(a[1]!=null?g(a[1],"indent"):a[1],n))+"if let "+r((l=(l=g(i,"name")||(n!=null?g(n,"name"):n))!=null?l:f,typeof l===y?l.call(m,{name:"name",hash:{},data:t,loc:{start:{line:17,column:28},end:{line:17,column:36}}}):l))+" = "+r((l=(l=g(i,"name")||(n!=null?g(n,"name"):n))!=null?l:f,typeof l===y?l.call(m,{name:"name",hash:{},data:t,loc:{start:{line:17,column:39},end:{line:17,column:47}}}):l))+` {
|
|
693
|
+
`+((s=g(i,"if").call(m,n!=null?g(n,"isArrayOfEnums"):n,{name:"if",hash:{},fn:e.program(8,t,0,o,a),inverse:e.program(10,t,0,o,a),data:t,loc:{start:{line:18,column:0},end:{line:28,column:7}}}))!=null?s:"")+((s=g(i,"unless").call(m,n!=null?g(n,"isOptional"):n,{name:"unless",hash:{},fn:e.program(21,t,0,o,a),inverse:e.noop,data:t,loc:{start:{line:29,column:0},end:{line:32,column:11}}}))!=null?s:"")+" "+r(u(a[1]!=null?g(a[1],"indent"):a[1],n))+` }
|
|
694
|
+
`},8:function(e,n,i,c,t,o,a){var s,l,u=e.escapeExpression,r=n??(e.nullContext||{}),m=e.hooks.helperMissing,f="function",y=e.lookupProperty||function(g,p){if(Object.prototype.hasOwnProperty.call(g,p))return g[p]};return" "+u(e.lambda(a[1]!=null?y(a[1],"indent"):a[1],n))+'payload["'+((s=(l=(l=y(i,"jsonName")||(n!=null?y(n,"jsonName"):n))!=null?l:m,typeof l===f?l.call(r,{name:"jsonName",hash:{},data:t,loc:{start:{line:19,column:34},end:{line:19,column:48}}}):l))!=null?s:"")+'"] = '+u((l=(l=y(i,"name")||(n!=null?y(n,"name"):n))!=null?l:m,typeof l===f?l.call(r,{name:"name",hash:{},data:t,loc:{start:{line:19,column:53},end:{line:19,column:61}}}):l))+`.map { $0.rawValue }
|
|
695
|
+
`},10:function(e,n,i,c,t,o,a){var s,l=e.lookupProperty||function(u,r){if(Object.prototype.hasOwnProperty.call(u,r))return u[r]};return(s=l(i,"if").call(n??(e.nullContext||{}),n!=null?l(n,"isArrayOfObjects"):n,{name:"if",hash:{},fn:e.program(11,t,0,o,a),inverse:e.program(13,t,0,o,a),data:t,loc:{start:{line:20,column:0},end:{line:28,column:0}}}))!=null?s:""},11:function(e,n,i,c,t,o,a){var s,l,u=e.escapeExpression,r=n??(e.nullContext||{}),m=e.hooks.helperMissing,f="function",y=e.lookupProperty||function(g,p){if(Object.prototype.hasOwnProperty.call(g,p))return g[p]};return" "+u(e.lambda(a[1]!=null?y(a[1],"indent"):a[1],n))+'payload["'+((s=(l=(l=y(i,"jsonName")||(n!=null?y(n,"jsonName"):n))!=null?l:m,typeof l===f?l.call(r,{name:"jsonName",hash:{},data:t,loc:{start:{line:21,column:34},end:{line:21,column:48}}}):l))!=null?s:"")+'"] = '+u((l=(l=y(i,"name")||(n!=null?y(n,"name"):n))!=null?l:m,typeof l===f?l.call(r,{name:"name",hash:{},data:t,loc:{start:{line:21,column:53},end:{line:21,column:61}}}):l))+`.map { $0.payload }
|
|
696
|
+
`},13:function(e,n,i,c,t,o,a){var s,l=e.lookupProperty||function(u,r){if(Object.prototype.hasOwnProperty.call(u,r))return u[r]};return(s=l(i,"if").call(n??(e.nullContext||{}),n!=null?l(n,"isEnum"):n,{name:"if",hash:{},fn:e.program(14,t,0,o,a),inverse:e.program(16,t,0,o,a),data:t,loc:{start:{line:22,column:0},end:{line:28,column:0}}}))!=null?s:""},14:function(e,n,i,c,t,o,a){var s,l,u=e.escapeExpression,r=n??(e.nullContext||{}),m=e.hooks.helperMissing,f="function",y=e.lookupProperty||function(g,p){if(Object.prototype.hasOwnProperty.call(g,p))return g[p]};return" "+u(e.lambda(a[1]!=null?y(a[1],"indent"):a[1],n))+'payload["'+((s=(l=(l=y(i,"jsonName")||(n!=null?y(n,"jsonName"):n))!=null?l:m,typeof l===f?l.call(r,{name:"jsonName",hash:{},data:t,loc:{start:{line:23,column:34},end:{line:23,column:48}}}):l))!=null?s:"")+'"] = '+u((l=(l=y(i,"name")||(n!=null?y(n,"name"):n))!=null?l:m,typeof l===f?l.call(r,{name:"name",hash:{},data:t,loc:{start:{line:23,column:53},end:{line:23,column:61}}}):l))+`.rawValue
|
|
697
|
+
`},16:function(e,n,i,c,t,o,a){var s,l=e.lookupProperty||function(u,r){if(Object.prototype.hasOwnProperty.call(u,r))return u[r]};return(s=l(i,"if").call(n??(e.nullContext||{}),n!=null?l(n,"isObject"):n,{name:"if",hash:{},fn:e.program(17,t,0,o,a),inverse:e.program(19,t,0,o,a),data:t,loc:{start:{line:24,column:0},end:{line:28,column:0}}}))!=null?s:""},17:function(e,n,i,c,t,o,a){var s,l,u=e.escapeExpression,r=n??(e.nullContext||{}),m=e.hooks.helperMissing,f="function",y=e.lookupProperty||function(g,p){if(Object.prototype.hasOwnProperty.call(g,p))return g[p]};return" "+u(e.lambda(a[1]!=null?y(a[1],"indent"):a[1],n))+'payload["'+((s=(l=(l=y(i,"jsonName")||(n!=null?y(n,"jsonName"):n))!=null?l:m,typeof l===f?l.call(r,{name:"jsonName",hash:{},data:t,loc:{start:{line:25,column:34},end:{line:25,column:48}}}):l))!=null?s:"")+'"] = '+u((l=(l=y(i,"name")||(n!=null?y(n,"name"):n))!=null?l:m,typeof l===f?l.call(r,{name:"name",hash:{},data:t,loc:{start:{line:25,column:53},end:{line:25,column:61}}}):l))+`.payload
|
|
698
|
+
`},19:function(e,n,i,c,t,o,a){var s,l,u=e.escapeExpression,r=n??(e.nullContext||{}),m=e.hooks.helperMissing,f="function",y=e.lookupProperty||function(g,p){if(Object.prototype.hasOwnProperty.call(g,p))return g[p]};return" "+u(e.lambda(a[1]!=null?y(a[1],"indent"):a[1],n))+'payload["'+((s=(l=(l=y(i,"jsonName")||(n!=null?y(n,"jsonName"):n))!=null?l:m,typeof l===f?l.call(r,{name:"jsonName",hash:{},data:t,loc:{start:{line:27,column:34},end:{line:27,column:48}}}):l))!=null?s:"")+'"] = '+u((l=(l=y(i,"name")||(n!=null?y(n,"name"):n))!=null?l:m,typeof l===f?l.call(r,{name:"name",hash:{},data:t,loc:{start:{line:27,column:53},end:{line:27,column:61}}}):l))+`
|
|
699
|
+
`},21:function(e,n,i,c,t,o,a){var s,l,u=e.lambda,r=e.escapeExpression,m=e.lookupProperty||function(f,y){if(Object.prototype.hasOwnProperty.call(f,y))return f[y]};return" "+r(u(a[1]!=null?m(a[1],"indent"):a[1],n))+` } else {
|
|
700
|
+
`+r(u(a[1]!=null?m(a[1],"indent"):a[1],n))+'payload["'+((s=(l=(l=m(i,"jsonName")||(n!=null?m(n,"jsonName"):n))!=null?l:e.hooks.helperMissing,typeof l=="function"?l.call(n??(e.nullContext||{}),{name:"jsonName",hash:{},data:t,loc:{start:{line:31,column:34},end:{line:31,column:48}}}):l))!=null?s:"")+`"] = NSNull()
|
|
701
|
+
`},23:function(e,n,i,c,t,o,a){var s,l=e.lookupProperty||function(u,r){if(Object.prototype.hasOwnProperty.call(u,r))return u[r]};return(s=l(i,"if").call(n??(e.nullContext||{}),n!=null?l(n,"isArrayOfEnums"):n,{name:"if",hash:{},fn:e.program(24,t,0,o,a),inverse:e.program(26,t,0,o,a),data:t,loc:{start:{line:35,column:0},end:{line:45,column:7}}}))!=null?s:""},24:function(e,n,i,c,t,o,a){var s,l,u=e.escapeExpression,r=n??(e.nullContext||{}),m=e.hooks.helperMissing,f="function",y=e.lookupProperty||function(g,p){if(Object.prototype.hasOwnProperty.call(g,p))return g[p]};return" "+u(e.lambda(a[1]!=null?y(a[1],"indent"):a[1],n))+'payload["'+((s=(l=(l=y(i,"jsonName")||(n!=null?y(n,"jsonName"):n))!=null?l:m,typeof l===f?l.call(r,{name:"jsonName",hash:{},data:t,loc:{start:{line:36,column:30},end:{line:36,column:44}}}):l))!=null?s:"")+'"] = '+u((l=(l=y(i,"name")||(n!=null?y(n,"name"):n))!=null?l:m,typeof l===f?l.call(r,{name:"name",hash:{},data:t,loc:{start:{line:36,column:49},end:{line:36,column:57}}}):l))+`.map { $0.rawValue }
|
|
702
|
+
`},26:function(e,n,i,c,t,o,a){var s,l=e.lookupProperty||function(u,r){if(Object.prototype.hasOwnProperty.call(u,r))return u[r]};return(s=l(i,"if").call(n??(e.nullContext||{}),n!=null?l(n,"isArrayOfObjects"):n,{name:"if",hash:{},fn:e.program(27,t,0,o,a),inverse:e.program(29,t,0,o,a),data:t,loc:{start:{line:37,column:0},end:{line:45,column:0}}}))!=null?s:""},27:function(e,n,i,c,t,o,a){var s,l,u=e.escapeExpression,r=n??(e.nullContext||{}),m=e.hooks.helperMissing,f="function",y=e.lookupProperty||function(g,p){if(Object.prototype.hasOwnProperty.call(g,p))return g[p]};return" "+u(e.lambda(a[1]!=null?y(a[1],"indent"):a[1],n))+'payload["'+((s=(l=(l=y(i,"jsonName")||(n!=null?y(n,"jsonName"):n))!=null?l:m,typeof l===f?l.call(r,{name:"jsonName",hash:{},data:t,loc:{start:{line:38,column:30},end:{line:38,column:44}}}):l))!=null?s:"")+'"] = '+u((l=(l=y(i,"name")||(n!=null?y(n,"name"):n))!=null?l:m,typeof l===f?l.call(r,{name:"name",hash:{},data:t,loc:{start:{line:38,column:49},end:{line:38,column:57}}}):l))+`.map { $0.payload }
|
|
703
|
+
`},29:function(e,n,i,c,t,o,a){var s,l=e.lookupProperty||function(u,r){if(Object.prototype.hasOwnProperty.call(u,r))return u[r]};return(s=l(i,"if").call(n??(e.nullContext||{}),n!=null?l(n,"isEnum"):n,{name:"if",hash:{},fn:e.program(30,t,0,o,a),inverse:e.program(32,t,0,o,a),data:t,loc:{start:{line:39,column:0},end:{line:45,column:0}}}))!=null?s:""},30:function(e,n,i,c,t,o,a){var s,l,u=e.escapeExpression,r=n??(e.nullContext||{}),m=e.hooks.helperMissing,f="function",y=e.lookupProperty||function(g,p){if(Object.prototype.hasOwnProperty.call(g,p))return g[p]};return" "+u(e.lambda(a[1]!=null?y(a[1],"indent"):a[1],n))+'payload["'+((s=(l=(l=y(i,"jsonName")||(n!=null?y(n,"jsonName"):n))!=null?l:m,typeof l===f?l.call(r,{name:"jsonName",hash:{},data:t,loc:{start:{line:40,column:30},end:{line:40,column:44}}}):l))!=null?s:"")+'"] = '+u((l=(l=y(i,"name")||(n!=null?y(n,"name"):n))!=null?l:m,typeof l===f?l.call(r,{name:"name",hash:{},data:t,loc:{start:{line:40,column:49},end:{line:40,column:57}}}):l))+`.rawValue
|
|
704
|
+
`},32:function(e,n,i,c,t,o,a){var s,l=e.lookupProperty||function(u,r){if(Object.prototype.hasOwnProperty.call(u,r))return u[r]};return(s=l(i,"if").call(n??(e.nullContext||{}),n!=null?l(n,"isObject"):n,{name:"if",hash:{},fn:e.program(33,t,0,o,a),inverse:e.program(35,t,0,o,a),data:t,loc:{start:{line:41,column:0},end:{line:45,column:0}}}))!=null?s:""},33:function(e,n,i,c,t,o,a){var s,l,u=e.escapeExpression,r=n??(e.nullContext||{}),m=e.hooks.helperMissing,f="function",y=e.lookupProperty||function(g,p){if(Object.prototype.hasOwnProperty.call(g,p))return g[p]};return" "+u(e.lambda(a[1]!=null?y(a[1],"indent"):a[1],n))+'payload["'+((s=(l=(l=y(i,"jsonName")||(n!=null?y(n,"jsonName"):n))!=null?l:m,typeof l===f?l.call(r,{name:"jsonName",hash:{},data:t,loc:{start:{line:42,column:30},end:{line:42,column:44}}}):l))!=null?s:"")+'"] = '+u((l=(l=y(i,"name")||(n!=null?y(n,"name"):n))!=null?l:m,typeof l===f?l.call(r,{name:"name",hash:{},data:t,loc:{start:{line:42,column:49},end:{line:42,column:57}}}):l))+`.payload
|
|
705
|
+
`},35:function(e,n,i,c,t,o,a){var s,l,u=e.escapeExpression,r=n??(e.nullContext||{}),m=e.hooks.helperMissing,f="function",y=e.lookupProperty||function(g,p){if(Object.prototype.hasOwnProperty.call(g,p))return g[p]};return" "+u(e.lambda(a[1]!=null?y(a[1],"indent"):a[1],n))+'payload["'+((s=(l=(l=y(i,"jsonName")||(n!=null?y(n,"jsonName"):n))!=null?l:m,typeof l===f?l.call(r,{name:"jsonName",hash:{},data:t,loc:{start:{line:44,column:30},end:{line:44,column:44}}}):l))!=null?s:"")+'"] = '+u((l=(l=y(i,"name")||(n!=null?y(n,"name"):n))!=null?l:m,typeof l===f?l.call(r,{name:"name",hash:{},data:t,loc:{start:{line:44,column:49},end:{line:44,column:57}}}):l))+`
|
|
706
|
+
`},37:function(e,n,i,c,t){var o,a,s=n??(e.nullContext||{}),l=e.hooks.helperMissing,u="function",r=e.escapeExpression,m=e.lookupProperty||function(f,y){if(Object.prototype.hasOwnProperty.call(f,y))return f[y]};return`
|
|
707
|
+
// MARK: - `+r((a=(a=m(i,"typeName")||(n!=null?m(n,"typeName"):n))!=null?a:l,typeof a===u?a.call(s,{name:"typeName",hash:{},data:t,loc:{start:{line:54,column:11},end:{line:54,column:23}}}):a))+`
|
|
708
|
+
|
|
709
|
+
`+((o=m(i,"if").call(s,n!=null?m(n,"description"):n,{name:"if",hash:{},fn:e.program(38,t,0),inverse:e.noop,data:t,loc:{start:{line:56,column:0},end:{line:58,column:7}}}))!=null?o:"")+"/// Schema: `"+r((a=(a=m(i,"igluUrl")||(n!=null?m(n,"igluUrl"):n))!=null?a:l,typeof a===u?a.call(s,{name:"igluUrl",hash:{},data:t,loc:{start:{line:59,column:13},end:{line:59,column:24}}}):a))+"`\n///\n/// Example:\n/// ```swift\n/// let data = "+r((a=(a=m(i,"typeName")||(n!=null?m(n,"typeName"):n))!=null?a:l,typeof a===u?a.call(s,{name:"typeName",hash:{},data:t,loc:{start:{line:63,column:15},end:{line:63,column:27}}}):a))+`(
|
|
710
|
+
`+((o=m(i,"each").call(s,n!=null?m(n,"properties"):n,{name:"each",hash:{},fn:e.program(40,t,0),inverse:e.noop,data:t,loc:{start:{line:64,column:0},end:{line:66,column:9}}}))!=null?o:"")+`/// )
|
|
711
711
|
/// // Track as an event
|
|
712
712
|
/// Snowplow.defaultTracker()?.track(data.toEvent())
|
|
713
713
|
/// // Add as an entity to another event
|
|
@@ -715,15 +715,15 @@ data class EventSpecification(
|
|
|
715
715
|
/// event.entities.append(data.toEntity())
|
|
716
716
|
/// Snowplow.defaultTracker()?.track(event)
|
|
717
717
|
/// \`\`\`
|
|
718
|
-
struct `+
|
|
718
|
+
struct `+r((a=(a=m(i,"typeName")||(n!=null?m(n,"typeName"):n))!=null?a:l,typeof a===u?a.call(s,{name:"typeName",hash:{},data:t,loc:{start:{line:75,column:7},end:{line:75,column:19}}}):a))+` {
|
|
719
719
|
|
|
720
|
-
`+((
|
|
720
|
+
`+((o=e.invokePartial(m(c,"structProperties"),n,{name:"structProperties",data:t,helpers:i,partials:c,decorators:e.decorators}))!=null?o:"")+`
|
|
721
721
|
private var schema: String {
|
|
722
|
-
return "`+
|
|
722
|
+
return "`+r((a=(a=m(i,"igluUrl")||(n!=null?m(n,"igluUrl"):n))!=null?a:l,typeof a===u?a.call(s,{name:"igluUrl",hash:{},data:t,loc:{start:{line:80,column:16},end:{line:80,column:27}}}):a))+`"
|
|
723
723
|
}
|
|
724
724
|
|
|
725
725
|
private var payload: [String : Any] {
|
|
726
|
-
`+((
|
|
726
|
+
`+((o=e.invokePartial(m(c,"createAndReturnPayloadDictionary"),n,{name:"createAndReturnPayloadDictionary",data:t,helpers:i,partials:c,decorators:e.decorators}))!=null?o:"")+` }
|
|
727
727
|
|
|
728
728
|
/// Creates an event instance to be tracked by the tracker.
|
|
729
729
|
func toEvent() -> SelfDescribing {
|
|
@@ -736,33 +736,33 @@ struct `+i((a=(a=m(r,"typeName")||(n!=null?m(n,"typeName"):n))!=null?a:l,typeof
|
|
|
736
736
|
}
|
|
737
737
|
|
|
738
738
|
}
|
|
739
|
-
`},38:function(e,n,
|
|
740
|
-
`},40:function(e,n,
|
|
741
|
-
`},41:function(e,n,
|
|
742
|
-
// MARK: - `+
|
|
739
|
+
`},38:function(e,n,i,c,t){var o,a,s=e.lookupProperty||function(l,u){if(Object.prototype.hasOwnProperty.call(l,u))return l[u]};return"/// "+((o=(a=(a=s(i,"description")||(n!=null?s(n,"description"):n))!=null?a:e.hooks.helperMissing,typeof a=="function"?a.call(n??(e.nullContext||{}),{name:"description",hash:{},data:t,loc:{start:{line:57,column:4},end:{line:57,column:21}}}):a))!=null?o:"")+`
|
|
740
|
+
`},40:function(e,n,i,c,t){var o,a,s=n??(e.nullContext||{}),l=e.hooks.helperMissing,u="function",r=e.escapeExpression,m=e.lookupProperty||function(f,y){if(Object.prototype.hasOwnProperty.call(f,y))return f[y]};return"/// "+r((a=(a=m(i,"name")||(n!=null?m(n,"name"):n))!=null?a:l,typeof a===u?a.call(s,{name:"name",hash:{},data:t,loc:{start:{line:65,column:8},end:{line:65,column:16}}}):a))+": "+r((a=(a=m(i,"name")||(n!=null?m(n,"name"):n))!=null?a:l,typeof a===u?a.call(s,{name:"name",hash:{},data:t,loc:{start:{line:65,column:18},end:{line:65,column:26}}}):a))+((o=m(i,"unless").call(s,t&&m(t,"last"),{name:"unless",hash:{},fn:e.program(41,t,0),inverse:e.noop,data:t,loc:{start:{line:65,column:26},end:{line:65,column:56}}}))!=null?o:"")+`
|
|
741
|
+
`},41:function(e,n,i,c,t){return", "},43:function(e,n,i,c,t){var o,a,s=n??(e.nullContext||{}),l=e.hooks.helperMissing,u="function",r=e.escapeExpression,m=e.lookupProperty||function(f,y){if(Object.prototype.hasOwnProperty.call(f,y))return f[y]};return`
|
|
742
|
+
// MARK: - `+r((a=(a=m(i,"typeName")||(n!=null?m(n,"typeName"):n))!=null?a:l,typeof a===u?a.call(s,{name:"typeName",hash:{},data:t,loc:{start:{line:162,column:11},end:{line:162,column:23}}}):a))+`
|
|
743
743
|
|
|
744
|
-
`+((
|
|
744
|
+
`+((o=m(i,"if").call(s,n!=null?m(n,"description"):n,{name:"if",hash:{},fn:e.program(38,t,0),inverse:e.noop,data:t,loc:{start:{line:164,column:0},end:{line:166,column:7}}}))!=null?o:"")+"struct "+r((a=(a=m(i,"typeName")||(n!=null?m(n,"typeName"):n))!=null?a:l,typeof a===u?a.call(s,{name:"typeName",hash:{},data:t,loc:{start:{line:167,column:7},end:{line:167,column:19}}}):a))+` {
|
|
745
745
|
|
|
746
|
-
`+((
|
|
746
|
+
`+((o=e.invokePartial(m(c,"structProperties"),n,{name:"structProperties",data:t,helpers:i,partials:c,decorators:e.decorators}))!=null?o:"")+`
|
|
747
747
|
var payload: [String : Any] {
|
|
748
|
-
`+((
|
|
748
|
+
`+((o=e.invokePartial(m(c,"createAndReturnPayloadDictionary"),n,{name:"createAndReturnPayloadDictionary",data:t,helpers:i,partials:c,decorators:e.decorators}))!=null?o:"")+` }
|
|
749
749
|
|
|
750
750
|
}
|
|
751
|
-
`},45:function(e,n,
|
|
752
|
-
// MARK: - `+
|
|
751
|
+
`},45:function(e,n,i,c,t){var o,a,s=n??(e.nullContext||{}),l=e.hooks.helperMissing,u="function",r=e.escapeExpression,m=e.lookupProperty||function(f,y){if(Object.prototype.hasOwnProperty.call(f,y))return f[y]};return`
|
|
752
|
+
// MARK: - `+r((a=(a=m(i,"name")||(n!=null?m(n,"name"):n))!=null?a:l,typeof a===u?a.call(s,{name:"name",hash:{},data:t,loc:{start:{line:180,column:11},end:{line:180,column:19}}}):a))+`
|
|
753
753
|
|
|
754
|
-
`+((
|
|
755
|
-
`+((
|
|
756
|
-
`},46:function(e,n,
|
|
757
|
-
`},48:function(e,n,
|
|
754
|
+
`+((o=m(i,"if").call(s,n!=null?m(n,"description"):n,{name:"if",hash:{},fn:e.program(38,t,0),inverse:e.noop,data:t,loc:{start:{line:182,column:0},end:{line:184,column:7}}}))!=null?o:"")+"enum "+r((a=(a=m(i,"name")||(n!=null?m(n,"name"):n))!=null?a:l,typeof a===u?a.call(s,{name:"name",hash:{},data:t,loc:{start:{line:185,column:5},end:{line:185,column:13}}}):a))+`: String {
|
|
755
|
+
`+((o=m(i,"each").call(s,n!=null?m(n,"cases"):n,{name:"each",hash:{},fn:e.program(46,t,0),inverse:e.noop,data:t,loc:{start:{line:186,column:0},end:{line:188,column:9}}}))!=null?o:"")+`}
|
|
756
|
+
`},46:function(e,n,i,c,t){var o,a,s=n??(e.nullContext||{}),l=e.hooks.helperMissing,u="function",r=e.lookupProperty||function(m,f){if(Object.prototype.hasOwnProperty.call(m,f))return m[f]};return" case "+e.escapeExpression((a=(a=r(i,"name")||(n!=null?r(n,"name"):n))!=null?a:l,typeof a===u?a.call(s,{name:"name",hash:{},data:t,loc:{start:{line:187,column:9},end:{line:187,column:17}}}):a))+' = "'+((o=(a=(a=r(i,"jsonName")||(n!=null?r(n,"jsonName"):n))!=null?a:l,typeof a===u?a.call(s,{name:"jsonName",hash:{},data:t,loc:{start:{line:187,column:21},end:{line:187,column:35}}}):a))!=null?o:"")+`"
|
|
757
|
+
`},48:function(e,n,i,c,t){var o,a=e.lambda,s=e.escapeExpression,l=n??(e.nullContext||{}),u=e.lookupProperty||function(r,m){if(Object.prototype.hasOwnProperty.call(r,m))return r[m]};return`
|
|
758
758
|
extension `+s(a(n!=null?u(n,"event"):n,n))+` {
|
|
759
759
|
/// Creates an event with entities for a `+s(a(n!=null?u(n,"generatedName"):n,n))+` event specification.
|
|
760
|
-
/// `+s((u(
|
|
761
|
-
`+((
|
|
760
|
+
/// `+s((u(i,"addEventSpecificationIdentifier")||n&&u(n,"addEventSpecificationIdentifier")||e.hooks.helperMissing).call(l,n!=null?u(n,"id"):n,{name:"addEventSpecificationIdentifier",hash:{},data:t,loc:{start:{line:195,column:8},end:{line:195,column:51}}}))+"\n /// Example:\n /// ```swift\n /// let data = "+s(a(n!=null?u(n,"event"):n,n))+`(...)
|
|
761
|
+
`+((o=u(i,"each").call(l,n!=null?u(n,"entities"):n,{name:"each",hash:{},fn:e.program(49,t,0),inverse:e.noop,data:t,loc:{start:{line:199,column:0},end:{line:201,column:9}}}))!=null?o:"")+" /// let event = data.to"+s(a(n!=null?u(n,"generatedName"):n,n))+"Spec("+((o=u(i,"each").call(l,n!=null?u(n,"entities"):n,{name:"each",hash:{},fn:e.program(51,t,0),inverse:e.noop,data:t,loc:{start:{line:202,column:54},end:{line:202,column:129}}}))!=null?o:"")+`)
|
|
762
762
|
/// // Track as an event
|
|
763
763
|
/// Snowplow.defaultTracker()?.track(event)
|
|
764
764
|
/// \`\`\`
|
|
765
|
-
func to`+s(a(n!=null?u(n,"generatedName"):n,n))+"Spec("+((
|
|
765
|
+
func to`+s(a(n!=null?u(n,"generatedName"):n,n))+"Spec("+((o=u(i,"each").call(l,n!=null?u(n,"entities"):n,{name:"each",hash:{},fn:e.program(53,t,0),inverse:e.noop,data:t,loc:{start:{line:206,column:38},end:{line:206,column:127}}}))!=null?o:"")+`) -> SelfDescribing {
|
|
766
766
|
let event = toEvent()
|
|
767
767
|
let eventSpec = EventSpecification(
|
|
768
768
|
id: "`+s(a(n!=null?u(n,"id"):n,n))+`",
|
|
@@ -770,16 +770,16 @@ extension `+s(a(n!=null?u(n,"event"):n,n))+` {
|
|
|
770
770
|
dataProductId: "`+s(a(n!=null?u(n,"dataProductId"):n,n))+`",
|
|
771
771
|
dataProductName: "`+s(a(n!=null?u(n,"dataProductName"):n,n))+`"
|
|
772
772
|
)
|
|
773
|
-
`+((
|
|
773
|
+
`+((o=u(i,"each").call(l,n!=null?u(n,"entities"):n,{name:"each",hash:{},fn:e.program(55,t,0),inverse:e.noop,data:t,loc:{start:{line:214,column:0},end:{line:216,column:9}}}))!=null?o:"")+` event.entities.append(eventSpec.toEntity())
|
|
774
774
|
return event
|
|
775
775
|
}
|
|
776
776
|
}
|
|
777
|
-
`},49:function(e,n,
|
|
778
|
-
`},51:function(e,n,
|
|
779
|
-
`},compiler:[8,">= 4.3.0"],main:function(e,n,
|
|
777
|
+
`},49:function(e,n,i,c,t){var o=e.lambda,a=e.escapeExpression;return" /// let data"+a(o(n,n))+" = "+a(o(n,n))+`(...)
|
|
778
|
+
`},51:function(e,n,i,c,t){var o,a=e.lookupProperty||function(s,l){if(Object.prototype.hasOwnProperty.call(s,l))return s[l]};return"data"+e.escapeExpression(e.lambda(n,n))+((o=a(i,"unless").call(n??(e.nullContext||{}),t&&a(t,"last"),{name:"unless",hash:{},fn:e.program(41,t,0),inverse:e.noop,data:t,loc:{start:{line:202,column:90},end:{line:202,column:120}}}))!=null?o:"")},53:function(e,n,i,c,t){var o,a=e.lambda,s=e.escapeExpression,l=e.lookupProperty||function(u,r){if(Object.prototype.hasOwnProperty.call(u,r))return u[r]};return"_ entity"+s(a(n,n))+": "+s(a(n,n))+((o=l(i,"unless").call(n??(e.nullContext||{}),t&&l(t,"last"),{name:"unless",hash:{},fn:e.program(41,t,0),inverse:e.noop,data:t,loc:{start:{line:206,column:88},end:{line:206,column:118}}}))!=null?o:"")},55:function(e,n,i,c,t){return" event.entities.append(entity"+e.escapeExpression(e.lambda(n,n))+`.toEntity())
|
|
779
|
+
`},compiler:[8,">= 4.3.0"],main:function(e,n,i,c,t,o,a){var s,l,u,r=n??(e.nullContext||{}),m=e.hooks.helperMissing,f="function",y=e.hooks.blockHelperMissing,g=e.lookupProperty||function(x,_){if(Object.prototype.hasOwnProperty.call(x,_))return x[_]},p=`import Foundation
|
|
780
780
|
import SnowplowTracker
|
|
781
781
|
|
|
782
|
-
`;return s=(l=(l=
|
|
782
|
+
`;return s=(l=(l=g(i,"type")||(n!=null?g(n,"type"):n))!=null?l:m,u={name:"type",hash:{},fn:e.program(37,t,0,o,a),inverse:e.noop,data:t,loc:{start:{line:51,column:0},end:{line:98,column:9}}},typeof l===f?l.call(r,u):l),g(i,"type")||(s=y.call(n,s,u)),s!=null&&(p+=s),p+=`
|
|
783
783
|
// MARK: - Event Specification
|
|
784
784
|
|
|
785
785
|
/// Entity schema for referencing an event specification
|
|
@@ -838,22 +838,22 @@ struct EventSpecification {
|
|
|
838
838
|
}
|
|
839
839
|
|
|
840
840
|
}
|
|
841
|
-
`,s=(l=(l=
|
|
841
|
+
`,s=(l=(l=g(i,"nestedTypes")||(n!=null?g(n,"nestedTypes"):n))!=null?l:m,u={name:"nestedTypes",hash:{},fn:e.program(43,t,0,o,a),inverse:e.noop,data:t,loc:{start:{line:159,column:0},end:{line:176,column:16}}},typeof l===f?l.call(r,u):l),g(i,"nestedTypes")||(s=y.call(n,s,u)),s!=null&&(p+=s),p+((s=g(i,"each").call(r,n!=null?g(n,"enums"):n,{name:"each",hash:{},fn:e.program(45,t,0,o,a),inverse:e.noop,data:t,loc:{start:{line:177,column:0},end:{line:190,column:9}}}))!=null?s:"")+((s=g(i,"each").call(r,n!=null?g(n,"eventSpecifications"):n,{name:"each",hash:{},fn:e.program(48,t,0,o,a),inverse:e.noop,data:t,loc:{start:{line:191,column:0},end:{line:221,column:9}}}))!=null?s:"")},main_d:function(e,n,i,c,t,o,a){var s=i.decorators,l=i.lookupProperty||function(u,r){if(Object.prototype.hasOwnProperty.call(u,r))return u[r]};return e=l(s,"inline")(e,n,i,{name:"inline",hash:{},fn:i.program(1,t,0,o,a),inverse:i.noop,args:["structProperties"],data:t,loc:{start:{line:3,column:0},end:{line:11,column:11}}})||e,e=l(s,"inline")(e,n,i,{name:"inline",hash:{},fn:i.program(5,t,0,o,a),inverse:i.noop,args:["createAndReturnPayloadDictionary"],data:t,loc:{start:{line:12,column:0},end:{line:49,column:11}}})||e,e},useDecorators:!0,usePartial:!0,useData:!0,useDepths:!0}});var Xn=P((Vl,zn)=>{"use strict";zn.exports={id:{language:"go",tracker:"snowplow-golang-tracker"},1:function(e,n,i,c,t){var o,a=n??(e.nullContext||{}),s=e.hooks.helperMissing,l=e.escapeExpression,u="function",r=e.lookupProperty||function(m,f){if(Object.prototype.hasOwnProperty.call(m,f))return m[f]};return`
|
|
842
842
|
// SnowplowFormat implements SnowplowApplicable
|
|
843
|
-
func (`+l((i
|
|
843
|
+
func (`+l((r(i,"startLow")||n&&r(n,"startLow")||s).call(a,n!=null?r(n,"typeName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:86,column:6},end:{line:86,column:27}}}))+" "+l((o=(o=r(i,"typeName")||(n!=null?r(n,"typeName"):n))!=null?o:s,typeof o===u?o.call(a,{name:"typeName",hash:{},data:t,loc:{start:{line:86,column:28},end:{line:86,column:40}}}):o))+`) SnowplowFormat() (*sp.SelfDescribingJson, error) {
|
|
844
844
|
var decodedMap map[string]interface{}
|
|
845
|
-
err := mapstructure.Decode(`+l((i
|
|
845
|
+
err := mapstructure.Decode(`+l((r(i,"startLow")||n&&r(n,"startLow")||s).call(a,n!=null?r(n,"typeName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:88,column:28},end:{line:88,column:49}}}))+`, &decodedMap)
|
|
846
846
|
if err != nil {
|
|
847
847
|
return nil, err
|
|
848
848
|
}
|
|
849
849
|
|
|
850
|
-
sdj := sp.InitSelfDescribingJson("`+l((
|
|
850
|
+
sdj := sp.InitSelfDescribingJson("`+l((o=(o=r(i,"igluUrl")||(n!=null?r(n,"igluUrl"):n))!=null?o:s,typeof o===u?o.call(a,{name:"igluUrl",hash:{},data:t,loc:{start:{line:93,column:35},end:{line:93,column:46}}}):o))+`", decodedMap)
|
|
851
851
|
return sdj, nil
|
|
852
852
|
}
|
|
853
853
|
|
|
854
|
-
// Track`+l((
|
|
855
|
-
func Track`+l((
|
|
856
|
-
sdj, err := `+l((i
|
|
854
|
+
// Track`+l((o=(o=r(i,"typeName")||(n!=null?r(n,"typeName"):n))!=null?o:s,typeof o===u?o.call(a,{name:"typeName",hash:{},data:t,loc:{start:{line:97,column:8},end:{line:97,column:20}}}):o))+" tracks a "+l((o=(o=r(i,"typeName")||(n!=null?r(n,"typeName"):n))!=null?o:s,typeof o===u?o.call(a,{name:"typeName",hash:{},data:t,loc:{start:{line:97,column:30},end:{line:97,column:42}}}):o))+`
|
|
855
|
+
func Track`+l((o=(o=r(i,"typeName")||(n!=null?r(n,"typeName"):n))!=null?o:s,typeof o===u?o.call(a,{name:"typeName",hash:{},data:t,loc:{start:{line:98,column:10},end:{line:98,column:22}}}):o))+"(tracker *sp.Tracker, "+l((r(i,"startLow")||n&&r(n,"startLow")||s).call(a,n!=null?r(n,"typeName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:98,column:44},end:{line:98,column:65}}}))+" "+l((o=(o=r(i,"typeName")||(n!=null?r(n,"typeName"):n))!=null?o:s,typeof o===u?o.call(a,{name:"typeName",hash:{},data:t,loc:{start:{line:98,column:66},end:{line:98,column:78}}}):o))+`, opts ...option) error {
|
|
856
|
+
sdj, err := `+l((r(i,"startLow")||n&&r(n,"startLow")||s).call(a,n!=null?r(n,"typeName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:99,column:13},end:{line:99,column:34}}}))+`.SnowplowFormat()
|
|
857
857
|
if err != nil {
|
|
858
858
|
return err
|
|
859
859
|
}
|
|
@@ -867,13 +867,13 @@ func Track`+l((t=(t=i(r,"typeName")||(n!=null?i(n,"typeName"):n))!=null?t:s,type
|
|
|
867
867
|
return nil
|
|
868
868
|
}
|
|
869
869
|
|
|
870
|
-
`},3:function(e,n,
|
|
870
|
+
`},3:function(e,n,i,c,t,o,a){var s,l=e.lambda,u=e.escapeExpression,r=n??(e.nullContext||{}),m=e.hooks.helperMissing,f=e.lookupProperty||function(y,g){if(Object.prototype.hasOwnProperty.call(y,g))return y[g]};return`
|
|
871
871
|
// `+u(l(n!=null?f(n,"generatedName"):n,n))+"Applicable represents a context applicable to "+u(l(n!=null?f(n,"generatedName"):n,n))+` event specification
|
|
872
872
|
type `+u(l(n!=null?f(n,"generatedName"):n,n))+`Applicable interface {
|
|
873
873
|
`+u(l(n!=null?f(n,"generatedName"):n,n))+`Format() (*sp.SelfDescribingJson, error)
|
|
874
874
|
}
|
|
875
875
|
|
|
876
|
-
`+((s=f(
|
|
876
|
+
`+((s=f(i,"each").call(r,n!=null?f(n,"entities"):n,{name:"each",hash:{},fn:e.program(4,t,0,o,a),inverse:e.noop,data:t,loc:{start:{line:122,column:0},end:{line:129,column:9}}}))!=null?s:"")+`
|
|
877
877
|
// `+u(l(n!=null?f(n,"generatedName"):n,n))+` Event Specification
|
|
878
878
|
type `+u(l(n!=null?f(n,"generatedName"):n,n))+` struct {
|
|
879
879
|
Event `+u(l(n!=null?f(n,"event"):n,n))+`
|
|
@@ -881,9 +881,9 @@ type `+u(l(n!=null?f(n,"generatedName"):n,n))+` struct {
|
|
|
881
881
|
}
|
|
882
882
|
|
|
883
883
|
// Track`+u(l(n!=null?f(n,"generatedName"):n,n))+"Spec tracks "+u(l(n!=null?f(n,"generatedName"):n,n))+` event specification
|
|
884
|
-
// `+u((f(
|
|
885
|
-
func Track`+u(l(n!=null?f(n,"generatedName"):n,n))+"Spec(tracker *sp.Tracker, "+u((f(
|
|
886
|
-
event := `+u((f(
|
|
884
|
+
// `+u((f(i,"addEventSpecificationIdentifier")||n&&f(n,"addEventSpecificationIdentifier")||m).call(r,n!=null?f(n,"id"):n,{name:"addEventSpecificationIdentifier",hash:{},data:t,loc:{start:{line:138,column:3},end:{line:138,column:46}}}))+`
|
|
885
|
+
func Track`+u(l(n!=null?f(n,"generatedName"):n,n))+"Spec(tracker *sp.Tracker, "+u((f(i,"startLow")||n&&f(n,"startLow")||m).call(r,n!=null?f(n,"generatedName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:139,column:58},end:{line:139,column:89}}}))+" "+u(l(n!=null?f(n,"generatedName"):n,n))+`, opts ...option) error {
|
|
886
|
+
event := `+u((f(i,"startLow")||n&&f(n,"startLow")||m).call(r,n!=null?f(n,"generatedName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:140,column:10},end:{line:140,column:41}}}))+`.Event
|
|
887
887
|
sdj, err := event.SnowplowFormat()
|
|
888
888
|
if err != nil {
|
|
889
889
|
return err
|
|
@@ -901,9 +901,9 @@ func Track`+u(l(n!=null?f(n,"generatedName"):n,n))+"Spec(tracker *sp.Tracker, "+
|
|
|
901
901
|
return optErr
|
|
902
902
|
}
|
|
903
903
|
|
|
904
|
-
eventSpecificationCtx := make([]sp.SelfDescribingJson, len(`+u((f(
|
|
904
|
+
eventSpecificationCtx := make([]sp.SelfDescribingJson, len(`+u((f(i,"startLow")||n&&f(n,"startLow")||m).call(r,n!=null?f(n,"generatedName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:158,column:60},end:{line:158,column:91}}}))+`.Contexts))
|
|
905
905
|
var ctxErr error
|
|
906
|
-
for i, val := range `+u((f(
|
|
906
|
+
for i, val := range `+u((f(i,"startLow")||n&&f(n,"startLow")||m).call(r,n!=null?f(n,"generatedName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:160,column:21},end:{line:160,column:52}}}))+`.Contexts {
|
|
907
907
|
ctxSdj, ctxErr := val.`+u(l(n!=null?f(n,"generatedName"):n,n))+`Format()
|
|
908
908
|
if ctxErr != nil {
|
|
909
909
|
break
|
|
@@ -931,13 +931,13 @@ func Track`+u(l(n!=null?f(n,"generatedName"):n,n))+"Spec(tracker *sp.Tracker, "+
|
|
|
931
931
|
return nil
|
|
932
932
|
}
|
|
933
933
|
|
|
934
|
-
`},4:function(e,n,
|
|
934
|
+
`},4:function(e,n,i,c,t,o,a){var s=e.lambda,l=e.escapeExpression,u=n??(e.nullContext||{}),r=e.hooks.helperMissing,m=e.lookupProperty||function(f,y){if(Object.prototype.hasOwnProperty.call(f,y))return f[y]};return`
|
|
935
935
|
// `+l(s(a[1]!=null?m(a[1],"generatedName"):a[1],n))+"Format implements "+l(s(a[1]!=null?m(a[1],"generatedName"):a[1],n))+`Applicable
|
|
936
|
-
func (`+l((m(
|
|
937
|
-
return `+l((m(
|
|
936
|
+
func (`+l((m(i,"startLow")||n&&m(n,"startLow")||r).call(u,n,{name:"startLow",hash:{},data:t,loc:{start:{line:125,column:6},end:{line:125,column:23}}}))+" "+l(s(n,n))+") "+l(s(a[1]!=null?m(a[1],"generatedName"):a[1],n))+`Format() (*sp.SelfDescribingJson, error) {
|
|
937
|
+
return `+l((m(i,"startLow")||n&&m(n,"startLow")||r).call(u,n,{name:"startLow",hash:{},data:t,loc:{start:{line:126,column:8},end:{line:126,column:25}}}))+`.SnowplowFormat()
|
|
938
938
|
}
|
|
939
939
|
|
|
940
|
-
`},compiler:[8,">= 4.3.0"],main:function(e,n,
|
|
940
|
+
`},compiler:[8,">= 4.3.0"],main:function(e,n,i,c,t,o,a){var s,l,u,r=n??(e.nullContext||{}),m=e.lookupProperty||function(y,g){if(Object.prototype.hasOwnProperty.call(y,g))return y[g]},f=`// SnowplowApplicable signifies ability to be formatted as self-describing json
|
|
941
941
|
type SnowplowApplicable interface {
|
|
942
942
|
// SnowplowFormat constructs a Snowplow SelfDescribingJson
|
|
943
943
|
SnowplowFormat() (*sp.SelfDescribingJson, error)
|
|
@@ -1019,8 +1019,8 @@ func (eventSpecification EventSpecification) SnowplowFormat() (*sp.SelfDescribin
|
|
|
1019
1019
|
return sdj, nil
|
|
1020
1020
|
}
|
|
1021
1021
|
|
|
1022
|
-
`;return s=(l=(l=m(
|
|
1023
|
-
`+((s=m(
|
|
1022
|
+
`;return s=(l=(l=m(i,"type")||(n!=null?m(n,"type"):n))!=null?l:e.hooks.helperMissing,u={name:"type",hash:{},fn:e.program(1,t,0,o,a),inverse:e.noop,data:t,loc:{start:{line:83,column:0},end:{line:113,column:9}}},typeof l=="function"?l.call(r,u):l),m(i,"type")||(s=e.hooks.blockHelperMissing.call(n,s,u)),s!=null&&(f+=s),f+`
|
|
1023
|
+
`+((s=m(i,"each").call(r,n!=null?m(n,"eventSpecifications"):n,{name:"each",hash:{},fn:e.program(3,t,0,o,a),inverse:e.noop,data:t,loc:{start:{line:115,column:0},end:{line:188,column:9}}}))!=null?s:"")},useData:!0,useDepths:!0}});var Yn=P((Hl,Zn)=>{"use strict";Zn.exports={id:{language:"typescript",tracker:"@snowplow/react-native-tracker"},1:function(e,n,i,c,t){return`/**
|
|
1024
1024
|
* Creates a Snowplow Event Specification entity.
|
|
1025
1025
|
*/
|
|
1026
1026
|
export function createEventSpecification(eventSpecification: EventSpecification){
|
|
@@ -1040,61 +1040,147 @@ interface EventSpecification {
|
|
|
1040
1040
|
data_product_id: string;
|
|
1041
1041
|
data_product_name: string;
|
|
1042
1042
|
}
|
|
1043
|
-
`},3:function(e,n,
|
|
1044
|
-
* Track a Snowplow event for `+u((
|
|
1045
|
-
* `+u((
|
|
1043
|
+
`},3:function(e,n,i,c,t){var o,a=n??(e.nullContext||{}),s=e.hooks.helperMissing,l="function",u=e.escapeExpression,r=e.lookupProperty||function(m,f){if(Object.prototype.hasOwnProperty.call(m,f))return m[f]};return`/**
|
|
1044
|
+
* Track a Snowplow event for `+u((o=(o=r(i,"typeName")||(n!=null?r(n,"typeName"):n))!=null?o:s,typeof o===l?o.call(a,{name:"typeName",hash:{},data:t,loc:{start:{line:31,column:30},end:{line:31,column:42}}}):o))+`.
|
|
1045
|
+
* `+u((o=(o=r(i,"description")||(n!=null?r(n,"description"):n))!=null?o:s,typeof o===l?o.call(a,{name:"description",hash:{},data:t,loc:{start:{line:32,column:3},end:{line:32,column:18}}}):o))+`
|
|
1046
1046
|
*/
|
|
1047
|
-
export function track`+u((
|
|
1048
|
-
const { contexts, ...data } = `+u((i
|
|
1047
|
+
export function track`+u((o=(o=r(i,"functionName")||(n!=null?r(n,"functionName"):n))!=null?o:s,typeof o===l?o.call(a,{name:"functionName",hash:{},data:t,loc:{start:{line:34,column:21},end:{line:34,column:37}}}):o))+"<T extends {} = any>(tracker: ReactNativeTracker, "+u((r(i,"startLow")||n&&r(n,"startLow")||s).call(a,n!=null?r(n,"typeName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:34,column:87},end:{line:34,column:108}}}))+": "+u((o=(o=r(i,"typeName")||(n!=null?r(n,"typeName"):n))!=null?o:s,typeof o===l?o.call(a,{name:"typeName",hash:{},data:t,loc:{start:{line:34,column:110},end:{line:34,column:122}}}):o))+` & CommonEventProperties<T>){
|
|
1048
|
+
const { contexts, ...data } = `+u((r(i,"startLow")||n&&r(n,"startLow")||s).call(a,n!=null?r(n,"typeName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:35,column:32},end:{line:35,column:53}}}))+`;
|
|
1049
1049
|
tracker.trackSelfDescribingEvent({
|
|
1050
|
-
schema: '`+u((
|
|
1050
|
+
schema: '`+u((o=(o=r(i,"igluUrl")||(n!=null?r(n,"igluUrl"):n))!=null?o:s,typeof o===l?o.call(a,{name:"igluUrl",hash:{},data:t,loc:{start:{line:37,column:13},end:{line:37,column:24}}}):o))+`',
|
|
1051
1051
|
data
|
|
1052
1052
|
}, contexts);
|
|
1053
1053
|
}
|
|
1054
1054
|
|
|
1055
1055
|
/**
|
|
1056
|
-
* Creates a Snowplow `+u((
|
|
1056
|
+
* Creates a Snowplow `+u((o=(o=r(i,"typeName")||(n!=null?r(n,"typeName"):n))!=null?o:s,typeof o===l?o.call(a,{name:"typeName",hash:{},data:t,loc:{start:{line:43,column:22},end:{line:43,column:34}}}):o))+` entity.
|
|
1057
1057
|
*/
|
|
1058
|
-
export function create`+u((
|
|
1058
|
+
export function create`+u((o=(o=r(i,"typeName")||(n!=null?r(n,"typeName"):n))!=null?o:s,typeof o===l?o.call(a,{name:"typeName",hash:{},data:t,loc:{start:{line:45,column:22},end:{line:45,column:34}}}):o))+"("+u((r(i,"startLow")||n&&r(n,"startLow")||s).call(a,n!=null?r(n,"typeName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:45,column:35},end:{line:45,column:56}}}))+": "+u((o=(o=r(i,"typeName")||(n!=null?r(n,"typeName"):n))!=null?o:s,typeof o===l?o.call(a,{name:"typeName",hash:{},data:t,loc:{start:{line:45,column:58},end:{line:45,column:70}}}):o))+`){
|
|
1059
1059
|
return {
|
|
1060
|
-
schema: '`+u((
|
|
1061
|
-
data: `+u((i
|
|
1060
|
+
schema: '`+u((o=(o=r(i,"igluUrl")||(n!=null?r(n,"igluUrl"):n))!=null?o:s,typeof o===l?o.call(a,{name:"igluUrl",hash:{},data:t,loc:{start:{line:47,column:13},end:{line:47,column:24}}}):o))+`',
|
|
1061
|
+
data: `+u((r(i,"startLow")||n&&r(n,"startLow")||s).call(a,n!=null?r(n,"typeName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:48,column:10},end:{line:48,column:31}}}))+`
|
|
1062
1062
|
}
|
|
1063
1063
|
}
|
|
1064
|
-
`},5:function(e,n,
|
|
1065
|
-
* Tracks a `+s(a(n!=null?
|
|
1064
|
+
`},5:function(e,n,i,c,t){var o,a=e.lambda,s=e.escapeExpression,l=n??(e.nullContext||{}),u=e.hooks.helperMissing,r=e.lookupProperty||function(m,f){if(Object.prototype.hasOwnProperty.call(m,f))return m[f]};return`/**
|
|
1065
|
+
* Tracks a `+s(a(n!=null?r(n,"generatedName"):n,n))+` event specification.
|
|
1066
1066
|
*/
|
|
1067
|
-
export function track`+s(a(n!=null?
|
|
1067
|
+
export function track`+s(a(n!=null?r(n,"generatedName"):n,n))+"Spec(tracker: ReactNativeTracker, "+s((r(i,"startLow")||n&&r(n,"startLow")||u).call(l,n!=null?r(n,"generatedName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:57,column:77},end:{line:57,column:108}}}))+": "+s(a(n!=null?r(n,"event"):n,n))+" & CommonEventProperties"+((o=r(i,"if").call(l,n!=null?r(n,"entities"):n,{name:"if",hash:{},fn:e.program(6,t,0),inverse:e.noop,data:t,loc:{start:{line:57,column:148},end:{line:57,column:216}}}))!=null?o:"")+`){
|
|
1068
1068
|
const eventSpecificationContext = createEventSpecification({
|
|
1069
|
-
id: '`+s(a(n!=null?
|
|
1070
|
-
name: '`+s(a(n!=null?
|
|
1071
|
-
data_product_id: '`+s(a(n!=null?
|
|
1072
|
-
data_product_name: '`+s(a(n!=null?
|
|
1069
|
+
id: '`+s(a(n!=null?r(n,"id"):n,n))+`',
|
|
1070
|
+
name: '`+s(a(n!=null?r(n,"name"):n,n))+`',
|
|
1071
|
+
data_product_id: '`+s(a(n!=null?r(n,"dataProductId"):n,n))+`',
|
|
1072
|
+
data_product_name: '`+s(a(n!=null?r(n,"dataProductName"):n,n))+`'
|
|
1073
1073
|
});
|
|
1074
1074
|
|
|
1075
|
-
const contexts = Array.isArray(`+s((i
|
|
1076
|
-
? [...`+s((i
|
|
1075
|
+
const contexts = Array.isArray(`+s((r(i,"startLow")||n&&r(n,"startLow")||u).call(l,n!=null?r(n,"generatedName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:65,column:33},end:{line:65,column:64}}}))+`.contexts)
|
|
1076
|
+
? [...`+s((r(i,"startLow")||n&&r(n,"startLow")||u).call(l,n!=null?r(n,"generatedName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:66,column:10},end:{line:66,column:41}}}))+`.contexts, eventSpecificationContext]
|
|
1077
1077
|
: [eventSpecificationContext];
|
|
1078
1078
|
|
|
1079
|
-
const modified`+s(a(n!=null?
|
|
1080
|
-
...`+s((i
|
|
1079
|
+
const modified`+s(a(n!=null?r(n,"generatedName"):n,n))+` = {
|
|
1080
|
+
...`+s((r(i,"startLow")||n&&r(n,"startLow")||u).call(l,n!=null?r(n,"generatedName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:70,column:7},end:{line:70,column:38}}}))+`,
|
|
1081
1081
|
contexts,
|
|
1082
|
-
} as `+s(a(n!=null?
|
|
1082
|
+
} as `+s(a(n!=null?r(n,"event"):n,n))+" & CommonEventProperties"+((o=r(i,"if").call(l,n!=null?r(n,"entities"):n,{name:"if",hash:{},fn:e.program(6,t,0),inverse:e.noop,data:t,loc:{start:{line:72,column:45},end:{line:72,column:113}}}))!=null?o:"")+`;
|
|
1083
1083
|
|
|
1084
|
-
track`+s(a(n!=null?
|
|
1084
|
+
track`+s(a(n!=null?r(n,"event"):n,n))+((o=r(i,"if").call(l,n!=null?r(n,"entities"):n,{name:"if",hash:{},fn:e.program(6,t,0),inverse:e.noop,data:t,loc:{start:{line:74,column:21},end:{line:74,column:89}}}))!=null?o:"")+"(tracker, modified"+s(a(n!=null?r(n,"generatedName"):n,n))+`);
|
|
1085
1085
|
}
|
|
1086
|
-
`},6:function(e,n,
|
|
1086
|
+
`},6:function(e,n,i,c,t){var o,a=e.lookupProperty||function(s,l){if(Object.prototype.hasOwnProperty.call(s,l))return s[l]};return"<"+((o=a(i,"join").call(n??(e.nullContext||{}),n!=null?a(n,"entities"):n," | ",{name:"join",hash:{},fn:e.program(7,t,0),inverse:e.noop,data:t,loc:{start:{line:57,column:170},end:{line:57,column:208}}}))!=null?o:"")+">"},7:function(e,n,i,c,t){return""},compiler:[8,">= 4.3.0"],main:function(e,n,i,c,t){var o,a,s,l=n??(e.nullContext||{}),u=e.lookupProperty||function(m,f){if(Object.prototype.hasOwnProperty.call(m,f))return m[f]},r=`interface CommonEventProperties<T extends {} = Record<string, unknown>> {
|
|
1087
1087
|
/** Add context to an event by setting an Array of Self Describing JSON */
|
|
1088
1088
|
contexts?: Array<SelfDescribing<T>> | null;
|
|
1089
1089
|
}
|
|
1090
1090
|
|
|
1091
|
-
`+((
|
|
1092
|
-
`;return
|
|
1093
|
-
`+((
|
|
1094
|
-
`),o=c.length;if(o===0)return;e.emitLine(c[0]);let t=0;for(let a=1;a<o;a++){let s=c[a],{indent:l,text:u}=we(s,r);if(u!==null){let i=Math.floor(l/r),m=l%r;e.changeIndent(i-t),t=i,e.emitLine(" ".repeat(m),u)}else e.emitLine()}t!==0&&e.changeIndent(-t)}function S(e,n){if(n.length!==0){e.ensureBlankLine();for(let r of n)r(e)}}function mn(e,n={},r=[]){let c=Object.fromEntries(Object.entries(e).filter(([o])=>!r.includes(o)));return{...n,...c}}var j=require("quicktype-core");var fn=require("quicktype-core"),Se="__sp";function yn(e,n,r){return typeof e!="object"?void 0:{forType:M.makeAttributes({raw:e,...e[Se]})}}var G=class extends fn.TypeAttributeKind{constructor(){super("eventMetadata")}combine(n){return n[0]}makeInferred(n){}},M=new G;var bn=v(require("handlebars"));var pn=require("quicktype-core"),gn=require("quicktype-core/dist/support/Strings");function V(e,n,r,c){let o=e.descriptionForType(n)?.join(" "),t=e.sourcelikeToString((0,pn.modifySource)(c?.functionName??gn.originalWord,r)),a=e.sourcelikeToString(r);return{description:o,functionName:t,typeName:a}}function vn(e,n,r){e.forEach(c=>{c.event===n&&(c.event=r),c.entities=c.entities?.map(o=>o===n?r:o)})}var x=v(require("handlebars"));var N=require("quicktype-core/dist/support/Strings");function D(e){return`iglu:${e.vendor}/${e.name}/${e.format}/${e.version}`}function U(e){return`ID: ${e}`}var xe=(0,N.legalizeCharacters)(e=>(0,N.isAscii)(e)&&(0,N.isLetterOrUnderscoreOrDigit)(e)),kn=(0,N.makeNameStyle)("pascal",xe);function wn(e){let n=e.filter(Pe).map(c=>({generatedName:kn(c.eventSpecification.name),id:c.eventSpecification.id,name:c.eventSpecification.name,dataProductName:c.eventSpecification.dataProductName,dataProductId:c.eventSpecification.dataProductId,event:D(c.eventSchema.self),entities:c.entitiesSchemas?c.entitiesSchemas.map(o=>D(o.self)):void 0})),r=e.filter(be).map(c=>({generatedName:kn(c.eventSpecification.name),id:c.eventSpecification.id,name:c.eventSpecification.name,dataProductName:c.eventSpecification.dataProductName,dataProductId:c.eventSpecification.dataProductId,event:c.eventSchema.isEcomTemplateSchema,entities:c.entitiesSchemas?c.entitiesSchemas.filter(o=>!o.isEcomTemplateSchema).map(o=>D(o.self)):void 0}));return{eventSpecifications:n,ecomEventSpecifications:r}}function Pe(e){return typeof e.eventSchema.isEcomTemplateSchema>"u"}function be(e){return typeof e.eventSchema.isEcomTemplateSchema<"u"}var Sn={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 Pn(){x.default.registerHelper({and(...e){return Array.prototype.every.call(e,Boolean)},or(...e){return Array.prototype.slice.call(e,0,-1).some(Boolean)}}),x.default.registerHelper("join",function(e,n,r){return r&&typeof r=="string"?e.map(c=>c+r).join(n):e.join(n)}),x.default.registerHelper("firstLow",function(e){return e&&typeof e=="string"?e.charAt(0).toLowerCase():""}),x.default.registerHelper("startLow",function(e){return e&&typeof e=="string"?e.charAt(0).toLowerCase().concat(e.slice(1)):""}),x.default.registerHelper("addEventSpecificationIdentifier",function(e){return e&&typeof e=="string"?U(e):""}),x.default.registerHelper("ecomFunction",function(e){return Sn[e]}),x.default.registerHelper("ecomFunctionArgument",function(e){return xn[e]}),x.default.registerHelper("eq",function(e,n){return e===n}),x.default.registerHelper("debug",function(e,n,r){if(console.log(r===!0?JSON.stringify(e):e),n===!0)debugger;return""})}function En(e,{eventSpecifications:n,ecomEventSpecifications:r},c){try{Pn();let o=bn.default.template(e),{nameModifiers:t,validations:a}=c;return s=>{let l={type:[],nestedTypes:[],enums:[],eventSpecifications:n,ecomEventSpecifications:r,validations:a};return s.forEachNamedType("leading-and-interposing",(u,i)=>{let m=u.getAttributes().get(M),f=V(s,u,i,t),y={...f,...s.getClassData&&s.getClassData(u)};if(m!==void 0&&m.raw.self!==void 0){let{raw:p}=m,g=D(p.self);[n,r].forEach(w=>vn(w,g,f.typeName)),l.type.push({igluUrl:g,...y})}else l.nestedTypes.push(y)},(u,i)=>{let m=[],{description:f}=V(s,u,i,t);s.forEachEnumCase(u,"none",(y,p)=>{m.push({name:s.sourcelikeToString(y),jsonName:p})}),l.enums.push({name:s.sourcelikeToString(i),description:f,cases:m})},()=>console.error("Unions are not yet supported in Snowtype")),s.emitMultiline(o(l))}}catch(o){throw new Error(`${JSON.stringify(o)}`)}}var C=require("quicktype-core");function Nn(e,n){if(Ee(e)&&e.snowtypeOptions.inputs.tracker==="snowplow-golang-tracker"){let r="",c='import "github.com/mitchellh/mapstructure"',o='import sp "github.com/snowplow/snowplow-golang-tracker/v3/tracker"',t=n.lines;Array.isArray(t)&&t.splice(1,0,r,c,o)}return n}function Ee(e){return Object.hasOwn(e,"snowtypeOptions")}function On(e,n){let r=Object.fromEntries(e.entries());return n&&(r["iglu:com.snowplowanalytics.snowplow/event_specification/jsonschema/1-0-2"]=Ne),Object.keys(r).forEach(c=>{r[c].$schema="http://json-schema.org/draft-04/schema#"}),r}var Ne={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},name:{description:"Name for the event specification that the event adheres to",type:["string","null"],maxLength:256,minLength:1},data_product_id:{description:"Identifier for the data product that the event specification belongs to",type:["string","null"],maxLength:256,minLength:1},data_product_name:{description:"Name for the data product that the event specification belongs to",type:["string","null"],maxLength:256,minLength:1}},additionalProperties:!1,type:"object",required:["id"],self:{vendor:"com.snowplowanalytics.snowplow",name:"event_specification",format:"jsonschema",version:"1-0-2"},$schema:"http://iglucentral.com/schemas/com.snowplowanalytics.self-desc/schema/jsonschema/1-0-0#"};async function jn(e,n,r,c){let{header:o,validations:t,...a}=c,s=new C.JSONSchemaInput(void 0,[yn]),l=new Map;await je(s,n,l),await Oe(s,r,l);let u=t?On(l,!!r.length):void 0,i=new C.InputData;i.addInput(s);let m=await(0,C.quicktype)({inputData:i,lang:e,leadingComments:o,rendererOptions:a});return{...Nn(e,m),validationsSchemaObject:u}}async function Oe(e,n,r){let c=[];for(let o of n){let t=H(o.eventSchema.self);if(r.has(t)||(c.push(q(e,o.eventSchema)),r.set(t,o.eventSchema)),!Array.isArray(o.entitiesSchemas))return;o.entitiesSchemas.forEach(a=>{let s=H(a.self);r.has(s)||(c.push(q(e,a)),r.set(s,a))})}await Promise.all(c)}async function je(e,n,r){let c=[];for(let o of n){let t=H(o.self);r.has(t)||(c.push(q(e,o)),r.set(t,o))}await Promise.all(c)}function H({name:e,vendor:n,version:r,format:c}){return"iglu:"+[n,e,c,r].join("/")}async function q(e,n){await e.addSource({name:n.self.name,schema:JSON.stringify(n)})}var Te=v(Ln()),Le=v(dn()),Ce=v(An()),de=v(Dn()),Ie=v(_n()),Ae=v(Un()),Me=v($n()),De=v(Vn()),Re=v(qn()),R=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 _e(e){let r=R.default.object().required().keys({id:R.default.object().required().keys({tracker:R.default.string().required().valid(...Qn),language:R.default.string().required().valid(...Wn)})}).validate(e,{abortEarly:!1,convert:!1,allowUnknown:!0});if(r.error)throw new Error(r.error.annotate())}var Bn=[Te,Le,Ce,de,Ie,Ae,Me,De,Re].map(e=>(_e(e),e));function P(e){let{name:n,quicktypeLanguage:r,defaultOptions:c,unsupportedOptions:o,requiredOptions:t}=e,a=cn(n,o,t);return{id:a.id,name:a.name,extension:a.extension,generate:(s,l,u)=>{let i=[],m=Bn.find(({id:y})=>y.language===a.id&&y.tracker===u.tracker),f=wn(l);return m&&i.push(En(m,f,u)),jn(new r({generators:i,inputs:{tracker:m?.id.tracker,validations:u.validations,...f}}),s,l,mn(u,c,o))}}}var O=v(require("json-pointer"));function Kn({propertyNameAsType:e,capitalizeProperty:n,defaultPropertyType:r},c){let o="*";return c!==void 0&&e?n?Zn(c):c:r===null||r===""?r:r||o}function zn(e,n){let{maxLength:r}=e;if(!r)return[n];let c=[];for(;;){if(n.length-e.indentMaxDelta<=0){n&&c.push(n);break}let t=n.slice(0,e.indentMaxDelta),a=t.search(/\s\S*$/),s;if(a===-1){let l=n.slice(e.indentMaxDelta).match(/^\S+/);s=t+(l||"")}else s=t.slice(0,a);c.push(s),n=n.slice(s.length+1)}return c}function Xn(e,n={}){let r=[];if(!e||Object.keys(e).length===0)return"";let c=Fe(n);return r.push(...Ue(e,c)),O.default.has(e,"/properties")&&r.push(...W(e,e,null,c)),O.default.has(e,"/items")&&r.push(...Q(e,e,null,c)),$e(c.outerIndent,r)}function Fe(e){let r=(e.indentChar||" ").repeat(e.indent||0),c=e.maxLength-r.length-3;return{...e,outerIndent:r,indentMaxDelta:c}}function Q(e,n,r,c){let o=O.default.get(e,"/items");if(!Array.isArray(o))return[];let t=[];return o.forEach((a,s)=>{let u=(r?`${r}.`:"")+s,i=a.default,m=!e.minItems||s>=e.minItems;if(a.type==="array"&&a.items)t.push(...d("array",u,a.description,m,i,c)),t.push(...Q(a,n,u,c));else if(a.type==="object"&&a.properties)t.push(...d("object",u,a.description,m,i,c)),t.push(...W(a,n,u,c));else{let f=J(a,n)||Kn(c);t.push(...d(f,u,a.description,m,i,c))}}),t}function W(e,n,r,c){let o=O.default.get(e,"/properties"),t=O.default.has(e,"/required")?O.default.get(e,"/required"):[],a=[];for(let s in o)if(!(Array.isArray(c.ignore)&&c.ignore.includes(s))){let l=o[s],i=(r?`${r}.`:"")+s,m=o[s].default,f=!t.includes(s);if(l.type==="object"&&l.properties)a.push(...d("object",i,l.description,f,m,c)),a.push(...W(l,n,i,c));else if(l.type==="array"&&l.items)a.push(...d("array",i,l.description,f,m,c)),a.push(...Q(l,n,i,c));else{let y=J(l,n)||Kn(c,s);a.push(...d(y,i,l.description,f,m,c))}}return a}function Ue(e,n){let r=[],{objectTagName:c="typedef"}=n,{description:o}=e;o===void 0&&(o=n.autoDescribe?Je(e.title,e.type):"");let t=n.types&&n.types[e.type],a;n.types===null?a="":a=` {${t===""?"":t||J(e,e)}}`,(o||n.addDescriptionLineBreak)&&r.push(...zn(n,o));let s=e.title?` ${n.capitalizeTitle?Zn(e.title):e.title}`:"";return r.push(`@${c}${a}${s}`),r}function d(e,n,r="",c,o,t){let a;c?a=`[${n}${o===void 0?"":`=${JSON.stringify(o)}`}]`:a=n;let s;!r&&!t.descriptionPlaceholder?s="":t.hyphenatedDescriptions?s=` - ${r}`:s=` ${r}`;let l=e===null?"":`{${e}} `;return zn(t,`@property ${l}${a}${s}`)}function J(e,n){if(e.$ref){let r=O.default.get(n,e.$ref.slice(1));return J(r,n)}return e.enum?(e.type||(typeof e.enum[0]=="string"&&(e.type="string"),(typeof e.enum[0]).match(/number|boolean/)&&(e.type="number")),Array.isArray(e.type)&&e.type.indexOf("string")!==-1&&e.type.indexOf("null")!==-1?`"${e.enum.filter(Boolean).join('"|"')}"|null`:e.type==="string"?`"${e.enum.join('"|"')}"`:e.type==="number"||e.type==="integer"||e.type==="boolean"?`${e.enum.join("|")}`:e.type==="null"?"null":"enum"):Array.isArray(e.type)?e.type.includes("null")?`?${e.type[0]}`:e.type.join("|"):e.type}function Zn(e){return e.slice(0,1).toUpperCase()+e.slice(1)}function Je(e,n){let r=e?`${e} ${n}`:n;return`Represents ${`a${"aeiou".split("").includes(r.charAt())?"n":""}`} ${r}`}function $e(e,n){let r=[`${e}/**`];return r.push(...n.map(c=>c?`${e} * ${c}`:" *")),r.push(`${e} */
|
|
1095
|
-
`
|
|
1096
|
-
|
|
1091
|
+
`+((o=u(i,"if").call(l,(o=n!=null?u(n,"eventSpecifications"):n)!=null?u(o,"length"):o,{name:"if",hash:{},fn:e.program(1,t,0),inverse:e.noop,data:t,loc:{start:{line:6,column:0},end:{line:27,column:7}}}))!=null?o:"")+`
|
|
1092
|
+
`;return o=(a=(a=u(i,"type")||(n!=null?u(n,"type"):n))!=null?a:e.hooks.helperMissing,s={name:"type",hash:{},fn:e.program(3,t,0),inverse:e.noop,data:t,loc:{start:{line:29,column:0},end:{line:51,column:9}}},typeof a=="function"?a.call(l,s):a),u(i,"type")||(o=e.hooks.blockHelperMissing.call(n,o,s)),o!=null&&(r+=o),r+`
|
|
1093
|
+
`+((o=u(i,"each").call(l,n!=null?u(n,"eventSpecifications"):n,{name:"each",hash:{},fn:e.program(5,t,0),inverse:e.noop,data:t,loc:{start:{line:53,column:0},end:{line:76,column:9}}}))!=null?o:"")},useData:!0}});var ne=P((ql,hn)=>{"use strict";hn.exports={id:{language:"javascript",tracker:"google-tag-manager"},1:function(e,n,i,c,t){return` function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], t.indexOf(o) >= 0 || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
1094
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.indexOf(n) >= 0) continue; t[n] = r[n]; } return t; }
|
|
1095
|
+
`},3:function(e,n,i,c,t){return` /**
|
|
1096
|
+
* Creates a Snowplow Event Specification entity.
|
|
1097
|
+
*/
|
|
1098
|
+
function createEventSpecification(eventSpecification){
|
|
1099
|
+
return {
|
|
1100
|
+
schema: 'iglu:com.snowplowanalytics.snowplow/event_specification/jsonschema/1-0-2',
|
|
1101
|
+
data: eventSpecification,
|
|
1102
|
+
}
|
|
1103
|
+
}
|
|
1104
|
+
`},5:function(e,n,i,c,t){var o,a=n??(e.nullContext||{}),s=e.hooks.helperMissing,l="function",u=e.escapeExpression,r=e.lookupProperty||function(m,f){if(Object.prototype.hasOwnProperty.call(m,f))return m[f]};return` /**
|
|
1105
|
+
* Track a Snowplow event for `+u((o=(o=r(i,"typeName")||(n!=null?r(n,"typeName"):n))!=null?o:s,typeof o===l?o.call(a,{name:"typeName",hash:{},data:t,loc:{start:{line:23,column:33},end:{line:23,column:45}}}):o))+`.
|
|
1106
|
+
* `+u((o=(o=r(i,"description")||(n!=null?r(n,"description"):n))!=null?o:s,typeof o===l?o.call(a,{name:"description",hash:{},data:t,loc:{start:{line:24,column:6},end:{line:24,column:21}}}):o))+`
|
|
1107
|
+
* @param { `+u((o=(o=r(i,"typeName")||(n!=null?r(n,"typeName"):n))!=null?o:s,typeof o===l?o.call(a,{name:"typeName",hash:{},data:t,loc:{start:{line:25,column:15},end:{line:25,column:27}}}):o))+" & Timestamp & Context } "+u((r(i,"startLow")||n&&r(n,"startLow")||s).call(a,n!=null?r(n,"typeName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:25,column:52},end:{line:25,column:73}}}))+" - Attributes for "+u((o=(o=r(i,"typeName")||(n!=null?r(n,"typeName"):n))!=null?o:s,typeof o===l?o.call(a,{name:"typeName",hash:{},data:t,loc:{start:{line:25,column:91},end:{line:25,column:103}}}):o))+`.
|
|
1108
|
+
* @param {string[]} [trackers] - Tracker names to send the event to.
|
|
1109
|
+
*/
|
|
1110
|
+
track`+u((o=(o=r(i,"functionName")||(n!=null?r(n,"functionName"):n))!=null?o:s,typeof o===l?o.call(a,{name:"functionName",hash:{},data:t,loc:{start:{line:28,column:9},end:{line:28,column:25}}}):o))+": function("+u((r(i,"startLow")||n&&r(n,"startLow")||s).call(a,n!=null?r(n,"typeName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:28,column:36},end:{line:28,column:57}}}))+`, trackers){
|
|
1111
|
+
var trackerNames = (trackers && trackers.length) ? ':' + trackers.join(';') : '';
|
|
1112
|
+
var context = `+u((r(i,"startLow")||n&&r(n,"startLow")||s).call(a,n!=null?r(n,"typeName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:30,column:22},end:{line:30,column:43}}}))+`.context;
|
|
1113
|
+
var timestamp = `+u((r(i,"startLow")||n&&r(n,"startLow")||s).call(a,n!=null?r(n,"typeName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:31,column:24},end:{line:31,column:45}}}))+`.timestamp;
|
|
1114
|
+
var data = _objectWithoutProperties(`+u((r(i,"startLow")||n&&r(n,"startLow")||s).call(a,n!=null?r(n,"typeName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:32,column:44},end:{line:32,column:65}}}))+`, ["context", "timestamp"]);
|
|
1115
|
+
window.snowplow('trackSelfDescribingEvent' + trackerNames, {
|
|
1116
|
+
event: {
|
|
1117
|
+
schema: '`+u((o=(o=r(i,"igluUrl")||(n!=null?r(n,"igluUrl"):n))!=null?o:s,typeof o===l?o.call(a,{name:"igluUrl",hash:{},data:t,loc:{start:{line:35,column:25},end:{line:35,column:36}}}):o))+`',
|
|
1118
|
+
data: data
|
|
1119
|
+
},
|
|
1120
|
+
context: context,
|
|
1121
|
+
timestamp: timestamp,
|
|
1122
|
+
});
|
|
1123
|
+
},
|
|
1124
|
+
/**
|
|
1125
|
+
* Creates a Snowplow `+u((o=(o=r(i,"typeName")||(n!=null?r(n,"typeName"):n))!=null?o:s,typeof o===l?o.call(a,{name:"typeName",hash:{},data:t,loc:{start:{line:43,column:25},end:{line:43,column:37}}}):o))+` entity.
|
|
1126
|
+
* @param { `+u((o=(o=r(i,"typeName")||(n!=null?r(n,"typeName"):n))!=null?o:s,typeof o===l?o.call(a,{name:"typeName",hash:{},data:t,loc:{start:{line:44,column:15},end:{line:44,column:27}}}):o))+" } "+u((r(i,"startLow")||n&&r(n,"startLow")||s).call(a,n!=null?r(n,"typeName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:44,column:30},end:{line:44,column:51}}}))+" - Attributes for "+u((o=(o=r(i,"typeName")||(n!=null?r(n,"typeName"):n))!=null?o:s,typeof o===l?o.call(a,{name:"typeName",hash:{},data:t,loc:{start:{line:44,column:69},end:{line:44,column:81}}}):o))+`.
|
|
1127
|
+
*/
|
|
1128
|
+
create`+u((o=(o=r(i,"typeName")||(n!=null?r(n,"typeName"):n))!=null?o:s,typeof o===l?o.call(a,{name:"typeName",hash:{},data:t,loc:{start:{line:46,column:10},end:{line:46,column:22}}}):o))+": function("+u((r(i,"startLow")||n&&r(n,"startLow")||s).call(a,n!=null?r(n,"typeName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:46,column:33},end:{line:46,column:54}}}))+`){
|
|
1129
|
+
return {
|
|
1130
|
+
schema: '`+u((o=(o=r(i,"igluUrl")||(n!=null?r(n,"igluUrl"):n))!=null?o:s,typeof o===l?o.call(a,{name:"igluUrl",hash:{},data:t,loc:{start:{line:48,column:21},end:{line:48,column:32}}}):o))+`',
|
|
1131
|
+
data: `+u((r(i,"startLow")||n&&r(n,"startLow")||s).call(a,n!=null?r(n,"typeName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:49,column:18},end:{line:49,column:39}}}))+`
|
|
1132
|
+
};
|
|
1133
|
+
},
|
|
1134
|
+
`},7:function(e,n,i,c,t){var o,a=e.lambda,s=e.escapeExpression,l=n??(e.nullContext||{}),u=e.hooks.helperMissing,r=e.lookupProperty||function(m,f){if(Object.prototype.hasOwnProperty.call(m,f))return m[f]};return` /**
|
|
1135
|
+
* Tracks a `+s(a(n!=null?r(n,"generatedName"):n,n))+` event specification.
|
|
1136
|
+
* `+s((r(i,"addEventSpecificationIdentifier")||n&&r(n,"addEventSpecificationIdentifier")||u).call(l,n!=null?r(n,"id"):n,{name:"addEventSpecificationIdentifier",hash:{},data:t,loc:{start:{line:56,column:6},end:{line:56,column:49}}}))+`
|
|
1137
|
+
* @param { `+s(a(n!=null?r(n,"event"):n,n))+" & Timestamp"+((o=r(i,"if").call(l,n!=null?r(n,"entities"):n,{name:"if",hash:{},fn:e.program(8,t,0),inverse:e.noop,data:t,loc:{start:{line:57,column:41},end:{line:57,column:102}}}))!=null?o:"")+" } "+s((r(i,"startLow")||n&&r(n,"startLow")||u).call(l,n!=null?r(n,"generatedName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:57,column:105},end:{line:57,column:136}}}))+" - Attributes for "+s(a(n!=null?r(n,"generatedName"):n,n))+` event specification.
|
|
1138
|
+
* @param {string[]} [trackers] - Tracker names to send the event specification to.
|
|
1139
|
+
*/
|
|
1140
|
+
track`+s(a(n!=null?r(n,"generatedName"):n,n))+"Spec: function("+s((r(i,"startLow")||n&&r(n,"startLow")||u).call(l,n!=null?r(n,"generatedName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:60,column:46},end:{line:60,column:77}}}))+`, trackers){
|
|
1141
|
+
var eventSpecificationContext = createEventSpecification({
|
|
1142
|
+
id: '`+s(a(n!=null?r(n,"id"):n,n))+`',
|
|
1143
|
+
name: '`+s(a(n!=null?r(n,"name"):n,n))+`',
|
|
1144
|
+
data_product_id: '`+s(a(n!=null?r(n,"dataProductId"):n,n))+`',
|
|
1145
|
+
data_product_name: '`+s(a(n!=null?r(n,"dataProductName"):n,n))+`'
|
|
1146
|
+
});
|
|
1147
|
+
|
|
1148
|
+
var context = Array.isArray(`+s((r(i,"startLow")||n&&r(n,"startLow")||u).call(l,n!=null?r(n,"generatedName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:68,column:36},end:{line:68,column:67}}}))+`.context)
|
|
1149
|
+
? `+s((r(i,"startLow")||n&&r(n,"startLow")||u).call(l,n!=null?r(n,"generatedName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:69,column:14},end:{line:69,column:45}}}))+`.context.concat(eventSpecificationContext)
|
|
1150
|
+
: [eventSpecificationContext];
|
|
1151
|
+
|
|
1152
|
+
var modified`+s(a(n!=null?r(n,"generatedName"):n,n))+` = Object.assign(
|
|
1153
|
+
`+s((r(i,"startLow")||n&&r(n,"startLow")||u).call(l,n!=null?r(n,"generatedName"):n,{name:"startLow",hash:{},data:t,loc:{start:{line:73,column:12},end:{line:73,column:43}}}))+`,
|
|
1154
|
+
{ context: context }
|
|
1155
|
+
);
|
|
1156
|
+
|
|
1157
|
+
this.track`+s(a(n!=null?r(n,"event"):n,n))+"(modified"+s(a(n!=null?r(n,"generatedName"):n,n))+`, trackers);
|
|
1158
|
+
},
|
|
1159
|
+
`},8:function(e,n,i,c,t){var o=e.lookupProperty||function(a,s){if(Object.prototype.hasOwnProperty.call(a,s))return a[s]};return" & "+e.escapeExpression(e.lambda(n!=null?o(n,"generatedName"):n,n))+"Contexts"},10:function(e,n,i,c,t){var o,a=e.lookupProperty||function(s,l){if(Object.prototype.hasOwnProperty.call(s,l))return s[l]};return(o=a(i,"if").call(n??(e.nullContext||{}),n!=null?a(n,"entities"):n,{name:"if",hash:{},fn:e.program(11,t,0),inverse:e.noop,data:t,loc:{start:{line:85,column:0},end:{line:92,column:7}}}))!=null?o:""},11:function(e,n,i,c,t){var o,a=e.lambda,s=e.escapeExpression,l=e.lookupProperty||function(u,r){if(Object.prototype.hasOwnProperty.call(u,r))return u[r]};return`/**
|
|
1160
|
+
* Typedef for a `+s(a(n!=null?l(n,"generatedName"):n,n))+`Contexts
|
|
1161
|
+
* @typedef {object} `+s(a(n!=null?l(n,"generatedName"):n,n))+`Contexts
|
|
1162
|
+
* @property {(`+((o=l(i,"join").call(n??(e.nullContext||{}),n!=null?l(n,"entities"):n," | ","Context",{name:"join",hash:{},fn:e.program(12,t,0),inverse:e.noop,data:t,loc:{start:{line:89,column:15},end:{line:89,column:63}}}))!=null?o:"")+")[]} [context] Contexts to include in the "+s(a(n!=null?l(n,"generatedName"):n,n))+` event specification.
|
|
1163
|
+
*/
|
|
1164
|
+
|
|
1165
|
+
`},12:function(e,n,i,c,t){return""},compiler:[8,">= 4.3.0"],main:function(e,n,i,c,t){var o,a,s,l=n??(e.nullContext||{}),u=e.lookupProperty||function(m,f){if(Object.prototype.hasOwnProperty.call(m,f))return m[f]},r=`function snowtypeInit() {
|
|
1166
|
+
`+((o=u(i,"if").call(l,(o=n!=null?u(n,"type"):n)!=null?u(o,"length"):o,{name:"if",hash:{},fn:e.program(1,t,0),inverse:e.noop,data:t,loc:{start:{line:3,column:0},end:{line:6,column:7}}}))!=null?o:"")+`
|
|
1167
|
+
`+((o=u(i,"if").call(l,(o=n!=null?u(n,"eventSpecifications"):n)!=null?u(o,"length"):o,{name:"if",hash:{},fn:e.program(3,t,0),inverse:e.noop,data:t,loc:{start:{line:8,column:0},end:{line:18,column:7}}}))!=null?o:"")+`
|
|
1168
|
+
window.__snowtype = {
|
|
1169
|
+
`;return o=(a=(a=u(i,"type")||(n!=null?u(n,"type"):n))!=null?a:e.hooks.helperMissing,s={name:"type",hash:{},fn:e.program(5,t,0),inverse:e.noop,data:t,loc:{start:{line:21,column:0},end:{line:52,column:9}}},typeof a=="function"?a.call(l,s):a),u(i,"type")||(o=e.hooks.blockHelperMissing.call(n,o,s)),o!=null&&(r+=o),r+((o=u(i,"each").call(l,n!=null?u(n,"eventSpecifications"):n,{name:"each",hash:{},fn:e.program(7,t,0),inverse:e.noop,data:t,loc:{start:{line:53,column:0},end:{line:79,column:9}}}))!=null?o:"")+` };
|
|
1170
|
+
return undefined;
|
|
1171
|
+
}
|
|
1172
|
+
|
|
1173
|
+
`+((o=u(i,"each").call(l,n!=null?u(n,"eventSpecifications"):n,{name:"each",hash:{},fn:e.program(10,t,0),inverse:e.noop,data:t,loc:{start:{line:84,column:0},end:{line:93,column:9}}}))!=null?o:"")},useData:!0}});var al={};Ne(al,{createEventSpecificationInstructionsIdentifier:()=>J,generate:()=>ll,languageIds:()=>G,trackerTemplates:()=>$});module.exports=Oe(al);var kn=require("quicktype-core"),Ee=4;function je(e,n,i){return`${n??""} ${e} ${i??""}`}function O(e,n,i,c,t){let{prefix:o,suffix:a}=n.typeNameModifiers??{},s=je(c,o,a);return e(i,s,t)}function wn(e,n=[],i=[]){let c=(0,kn.getTargetLanguage)(e),t=[],o=i;for(let a of c.optionDefinitions)n.includes(a.name);return{id:c.name,name:c.displayName,extension:c.extension,requiredOptions:o,advancedOptions:t}}function Le(e,n=Ee){let i=e.length,c=0;for(let t=0;t<i;t++){let o=e.charAt(t);if(o===" ")c+=1;else if(o===" ")c=(c/n+1)*n;else return{indent:c,text:e.substring(t)}}return{indent:0,text:null}}function A(e,n,i=4){let c=n.split(`
|
|
1174
|
+
`),t=c.length;if(t===0)return;e.emitLine(c[0]);let o=0;for(let a=1;a<t;a++){let s=c[a],{indent:l,text:u}=Le(s,i);if(u!==null){let r=Math.floor(l/i),m=l%i;e.changeIndent(r-o),o=r,e.emitLine(" ".repeat(m),u)}else e.emitLine()}o!==0&&e.changeIndent(-o)}function k(e,n){if(n.length!==0){e.ensureBlankLine();for(let i of n)i(e)}}function Sn(e,n={},i=[]){let c=Object.fromEntries(Object.entries(e).filter(([t])=>!i.includes(t)));return{...n,...c}}var L=require("quicktype-core");var xn=require("quicktype-core"),Te="__sp";function Pn(e,n,i){return typeof e!="object"?void 0:{forType:M.makeAttributes({raw:e,...e[Te]})}}var Q=class extends xn.TypeAttributeKind{constructor(){super("eventMetadata")}combine(n){return n[0]}makeInferred(n){}},M=new Q;var Mn=v(require("handlebars"));var bn=require("quicktype-core"),Nn=require("quicktype-core/dist/support/Strings");function W(e,n,i,c){let t=e.descriptionForType(n)?.join(" "),o=e.sourcelikeToString((0,bn.modifySource)(c?.functionName??Nn.originalWord,i)),a=e.sourcelikeToString(i);return{description:t,functionName:o,typeName:a}}function On(e,n,i){e.forEach(c=>{c.event===n&&(c.event=i),c.entities=c.entities?.map(t=>t===n?i:t)})}var b=v(require("handlebars"));var E=require("quicktype-core/dist/support/Strings");function R(e){return`iglu:${e.vendor}/${e.name}/${e.format}/${e.version}`}function J(e){return`ID: ${e}`}var Ce=(0,E.legalizeCharacters)(e=>(0,E.isAscii)(e)&&(0,E.isLetterOrUnderscoreOrDigit)(e)),En=(0,E.makeNameStyle)("pascal",Ce);function jn(e){let n=e.filter(Me).map(c=>({generatedName:En(c.eventSpecification.name),id:c.eventSpecification.id,name:c.eventSpecification.name,dataProductName:c.eventSpecification.dataProductName,dataProductId:c.eventSpecification.dataProductId,event:R(c.eventSchema.self),entities:c.entitiesSchemas?c.entitiesSchemas.map(t=>R(t.self)):void 0})),i=e.filter(Ae).map(c=>({generatedName:En(c.eventSpecification.name),id:c.eventSpecification.id,name:c.eventSpecification.name,dataProductName:c.eventSpecification.dataProductName,dataProductId:c.eventSpecification.dataProductId,event:c.eventSchema.isEcomTemplateSchema,entities:c.entitiesSchemas?c.entitiesSchemas.filter(t=>!t.isEcomTemplateSchema).map(t=>R(t.self)):void 0}));return{eventSpecifications:n,ecomEventSpecifications:i}}function Me(e){return typeof e.eventSchema.isEcomTemplateSchema>"u"}function Ae(e){return typeof e.eventSchema.isEcomTemplateSchema<"u"}var Ln={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"},Tn={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 Cn(){b.default.registerHelper({and(...e){return Array.prototype.every.call(e,Boolean)},or(...e){return Array.prototype.slice.call(e,0,-1).some(Boolean)}}),b.default.registerHelper("join",function(e,n,i){return i&&typeof i=="string"?e.map(c=>c+i).join(n):e.join(n)}),b.default.registerHelper("firstLow",function(e){return e&&typeof e=="string"?e.charAt(0).toLowerCase():""}),b.default.registerHelper("startLow",function(e){return e&&typeof e=="string"?e.charAt(0).toLowerCase().concat(e.slice(1)):""}),b.default.registerHelper("addEventSpecificationIdentifier",function(e){return e&&typeof e=="string"?J(e):""}),b.default.registerHelper("ecomFunction",function(e){return Ln[e]}),b.default.registerHelper("ecomFunctionArgument",function(e){return Tn[e]}),b.default.registerHelper("eq",function(e,n){return e===n}),b.default.registerHelper("debug",function(e,n,i){if(console.log(i===!0?JSON.stringify(e):e),n===!0)debugger;return""})}function An(e,{eventSpecifications:n,ecomEventSpecifications:i},c){try{Cn();let t=Mn.default.template(e),{nameModifiers:o,validations:a}=c;return s=>{let l={type:[],nestedTypes:[],enums:[],eventSpecifications:n,ecomEventSpecifications:i,validations:a};return s.forEachNamedType("leading-and-interposing",(u,r)=>{let m=u.getAttributes().get(M),f=W(s,u,r,o),y={...f,...s.getClassData&&s.getClassData(u)};if(m!==void 0&&m.raw.self!==void 0){let{raw:g}=m,p=R(g.self);[n,i].forEach(x=>On(x,p,f.typeName)),l.type.push({igluUrl:p,...y})}else l.nestedTypes.push(y)},(u,r)=>{let m=[],{description:f}=W(s,u,r,o);s.forEachEnumCase(u,"none",(y,g)=>{m.push({name:s.sourcelikeToString(y),jsonName:g})}),l.enums.push({name:s.sourcelikeToString(r),description:f,cases:m})},()=>console.error("Unions are not yet supported in Snowtype")),s.emitMultiline(t(l))}}catch(t){throw new Error(`${JSON.stringify(t)}`)}}var I=require("quicktype-core");function In(e,n){if(Ie(e)&&e.snowtypeOptions.inputs.tracker==="snowplow-golang-tracker"){let i="",c='import "github.com/mitchellh/mapstructure"',t='import sp "github.com/snowplow/snowplow-golang-tracker/v3/tracker"',o=n.lines;Array.isArray(o)&&o.splice(1,0,i,c,t)}return n}function Ie(e){return Object.hasOwn(e,"snowtypeOptions")}function Dn(e,n){let i=Object.fromEntries(e.entries());return n&&(i["iglu:com.snowplowanalytics.snowplow/event_specification/jsonschema/1-0-2"]=De),Object.keys(i).forEach(c=>{i[c].$schema="http://json-schema.org/draft-04/schema#"}),i}var De={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},name:{description:"Name for the event specification that the event adheres to",type:["string","null"],maxLength:256,minLength:1},data_product_id:{description:"Identifier for the data product that the event specification belongs to",type:["string","null"],maxLength:256,minLength:1},data_product_name:{description:"Name for the data product that the event specification belongs to",type:["string","null"],maxLength:256,minLength:1}},additionalProperties:!1,type:"object",required:["id"],self:{vendor:"com.snowplowanalytics.snowplow",name:"event_specification",format:"jsonschema",version:"1-0-2"},$schema:"http://iglucentral.com/schemas/com.snowplowanalytics.self-desc/schema/jsonschema/1-0-0#"};async function dn(e,n,i,c){let{header:t,validations:o,...a}=c,s=new I.JSONSchemaInput(void 0,[Pn]),l=new Map;await _e(s,n,l),await de(s,i,l);let u=o?Dn(l,!!i.length):void 0,r=new I.InputData;r.addInput(s);let m=await(0,I.quicktype)({inputData:r,lang:e,leadingComments:t,rendererOptions:a});return{...In(e,m),validationsSchemaObject:u}}async function de(e,n,i){let c=[];for(let t of n){let o=B(t.eventSchema.self);if(i.has(o)||(c.push(K(e,t.eventSchema)),i.set(o,t.eventSchema)),!Array.isArray(t.entitiesSchemas))return;t.entitiesSchemas.forEach(a=>{let s=B(a.self);i.has(s)||(c.push(K(e,a)),i.set(s,a))})}await Promise.all(c)}async function _e(e,n,i){let c=[];for(let t of n){let o=B(t.self);i.has(o)||(c.push(K(e,t)),i.set(o,t))}await Promise.all(c)}function B({name:e,vendor:n,version:i,format:c}){return"iglu:"+[n,e,c,i].join("/")}async function K(e,n){await e.addSource({name:n.self.name,schema:JSON.stringify(n)})}var Re=v(Rn()),Fe=v(Un()),Ue=v($n()),Je=v(Vn()),$e=v(qn()),Ge=v(Wn()),Ve=v(Kn()),He=v(Xn()),qe=v(Yn()),Qe=v(ne()),F=v(require("joi"));var $=["@snowplow/browser-tracker","@snowplow/javascript-tracker","snowplow-android-tracker","snowplow-ios-tracker","@snowplow/node-tracker","snowplow-golang-tracker","@snowplow/react-native-tracker","google-tag-manager"],G=["typescript","javascript","javascript-gtm","kotlin","swift","go"];function We(e){let i=F.default.object().required().keys({id:F.default.object().required().keys({tracker:F.default.string().required().valid(...$),language:F.default.string().required().valid(...G)})}).validate(e,{abortEarly:!1,convert:!1,allowUnknown:!0});if(i.error)throw new Error(i.error.annotate())}var ee=[Re,Fe,Ue,Je,$e,Ge,Ve,He,qe,Qe].map(e=>(We(e),e));function w(e){let{name:n,quicktypeLanguage:i,defaultOptions:c,unsupportedOptions:t,requiredOptions:o}=e,a=wn(n,t,o);return{id:a.id,name:a.name,extension:a.extension,generate:(s,l,u)=>{let r=[],m=ee.find(({id:y})=>y.language===a.id&&y.tracker===u.tracker),f=jn(l);return m&&r.push(An(m,f,u)),dn(new i({generators:r,inputs:{tracker:m?.id.tracker,validations:u.validations,...f}}),s,l,Sn(u,c,t))}}}var j=v(require("json-pointer"));function le({propertyNameAsType:e,capitalizeProperty:n,defaultPropertyType:i},c){let t="*";return c!==void 0&&e?n?oe(c):c:i===null||i===""?i:i||t}function ae(e,n){let{maxLength:i}=e;if(!i)return[n];let c=[];for(;;){if(n.length-e.indentMaxDelta<=0){n&&c.push(n);break}let o=n.slice(0,e.indentMaxDelta),a=o.search(/\s\S*$/),s;if(a===-1){let l=n.slice(e.indentMaxDelta).match(/^\S+/);s=o+(l||"")}else s=o.slice(0,a);c.push(s),n=n.slice(s.length+1)}return c}function V(e,n={}){let i=[];if(!e||Object.keys(e).length===0)return"";let c=Be(n);return i.push(...Ke(e,c)),j.default.has(e,"/properties")&&i.push(...X(e,e,null,c)),j.default.has(e,"/items")&&i.push(...z(e,e,null,c)),Xe(c.outerIndent,i)}function Be(e){let i=(e.indentChar||" ").repeat(e.indent||0),c=e.maxLength-i.length-3;return{...e,outerIndent:i,indentMaxDelta:c}}function z(e,n,i,c){let t=j.default.get(e,"/items");if(!Array.isArray(t))return[];let o=[];return t.forEach((a,s)=>{let u=(i?`${i}.`:"")+s,r=a.default,m=!e.minItems||s>=e.minItems;if(a.type==="array"&&a.items)o.push(...D("array",u,a.description,m,r,c)),o.push(...z(a,n,u,c));else if(a.type==="object"&&a.properties)o.push(...D("object",u,a.description,m,r,c)),o.push(...X(a,n,u,c));else{let f=H(a,n)||le(c);o.push(...D(f,u,a.description,m,r,c))}}),o}function X(e,n,i,c){let t=j.default.get(e,"/properties"),o=j.default.has(e,"/required")?j.default.get(e,"/required"):[],a=[];for(let s in t)if(!(Array.isArray(c.ignore)&&c.ignore.includes(s))){let l=t[s],r=(i?`${i}.`:"")+s,m=t[s].default,f=!o.includes(s);if(l.type==="object"&&l.properties)a.push(...D("object",r,l.description,f,m,c)),a.push(...X(l,n,r,c));else if(l.type==="array"&&l.items)a.push(...D("array",r,l.description,f,m,c)),a.push(...z(l,n,r,c));else{let y=H(l,n)||le(c,s);a.push(...D(y,r,l.description,f,m,c))}}return a}function Ke(e,n){let i=[],{objectTagName:c="typedef"}=n,{description:t}=e;t===void 0&&(t=n.autoDescribe?ze(e.title,e.type):"");let o=n.types&&n.types[e.type],a;n.types===null?a="":a=` {${o===""?"":o||H(e,e)}}`,(t||n.addDescriptionLineBreak)&&i.push(...ae(n,t));let s=e.title?` ${n.capitalizeTitle?oe(e.title):e.title}`:"";return i.push(`@${c}${a}${s}`),i}function D(e,n,i="",c,t,o){let a;c?a=`[${n}${t===void 0?"":`=${JSON.stringify(t)}`}]`:a=n;let s;!i&&!o.descriptionPlaceholder?s="":o.hyphenatedDescriptions?s=` - ${i}`:s=` ${i}`;let l=e===null?"":`{${e}} `;return ae(o,`@property ${l}${a}${s}`)}function H(e,n){if(e.$ref){let i=j.default.get(n,e.$ref.slice(1));return H(i,n)}return e.enum?(e.type||(typeof e.enum[0]=="string"&&(e.type="string"),(typeof e.enum[0]).match(/number|boolean/)&&(e.type="number")),Array.isArray(e.type)&&e.type.indexOf("string")!==-1&&e.type.indexOf("null")!==-1?`"${e.enum.filter(Boolean).join('"|"')}"|null`:e.type==="string"?`"${e.enum.join('"|"')}"`:e.type==="number"||e.type==="integer"||e.type==="boolean"?`${e.enum.join("|")}`:e.type==="null"?"null":"enum"):Array.isArray(e.type)?e.type.includes("null")?`?${e.type[0]}`:e.type.join("|"):e.type}function oe(e){return e.slice(0,1).toUpperCase()+e.slice(1)}function ze(e,n){let i=e?`${e} ${n}`:n;return`Represents ${`a${"aeiou".split("").includes(i.charAt())?"n":""}`} ${i}`}function Xe(e,n){let i=[`${e}/**`];return i.push(...n.map(c=>c?`${e} * ${c}`:" *")),i.push(`${e} */
|
|
1175
|
+
`),i.join(`
|
|
1176
|
+
`)}var re=require("quicktype-core/dist/support/Strings"),Z=class extends L.JavaScriptRenderer{constructor(i,c,t,o){super(i,c,t);this.snowtypeOptions=o}emitMultiline(i){A(this,i,2)}emitSourceStructure(){this.leadingComments!==void 0?this.emitCommentLines(this.leadingComments):this.emitUsageComments()}emitPredefinedJSDocTypes(){this.emitMultiline(nn)}emitRequiredImports(){let i=Ye(this.snowtypeOptions.inputs);i.length>0&&this.emitMultiline(i.join(`
|
|
1177
|
+
`))}emitSource(i){this.emitRequiredImports(),super.emitSource(i),this.ensureBlankLine(),this.emitPredefinedJSDocTypes(),this.forEachTopLevel("none",(c,t)=>{let o=this.sourcelikeToString(t),a=c.getAttributes().get(M);a&&a.raw&&(a.raw.title=a.raw.title||o,this.emitMultiline(V(a.raw)),this.emitMultiline(Ze(a.raw.title)),this.ensureBlankLine())}),k(this,this.snowtypeOptions.generators)}makeNameForTopLevel(i,c,t){return O((...o)=>super.makeNameForTopLevel(...o),this.snowtypeOptions,i,c,t)}},Y=class extends L.JavaScriptTargetLanguage{constructor(i){super();this.snowtypeOptions=i}makeRenderer(i,c){return new Z(this,i,(0,L.getOptionValues)(L.tsFlowOptions,c),this.snowtypeOptions)}},te=w({name:"javascript",quicktypeLanguage:Y,defaultOptions:{"runtime-typecheck":!1},nameModifiers:{functionName:re.camelCase}}),h={...te,generate:async(e,n,i)=>{let{sdk:c,prefixes:t,suffixes:o}=i;return await te.generate(e,n,i)}};function Ze(e){return`
|
|
1097
1178
|
/**
|
|
1179
|
+
* Typedef for a ${e} entity context.
|
|
1180
|
+
* @typedef {object} ${e}Context
|
|
1181
|
+
* @property {string} schema The schema of the context.
|
|
1182
|
+
* @property { ${e} } data The data to send for the context.
|
|
1183
|
+
*/`}var nn=`/**
|
|
1098
1184
|
* Typedef for a DeviceTimestamp
|
|
1099
1185
|
* @typedef {object} DeviceTimestamp
|
|
1100
1186
|
* @property {'dtm'} type The value of 'dtm'
|
|
@@ -1126,12 +1212,11 @@ export function track`+s(a(n!=null?i(n,"generatedName"):n,n))+"Spec(tracker: Rea
|
|
|
1126
1212
|
* @typedef {object} Context
|
|
1127
1213
|
* @property {SelfDescribingJson[]} [context] Contexts to include in the event
|
|
1128
1214
|
*/
|
|
1129
|
-
|
|
1130
|
-
`))}emitSource(
|
|
1215
|
+
`;function Ye({ecomEventSpecifications:e,validations:n,tracker:i}){let c=[];switch(i){case"@snowplow/browser-tracker":c.push("import { trackSelfDescribingEvent } from '@snowplow/browser-tracker';"),n&&c.push("import Ajv from 'ajv-draft-04';","import addFormats from 'ajv-formats';","import { schemasObject } from './validations';"),e.length>0&&c.push("import * as Ecom from '@snowplow/browser-plugin-snowplow-ecommerce';");break;case"@snowplow/node-tracker":c.push("import { buildSelfDescribingEvent } from '@snowplow/node-tracker';");break;case"@snowplow/javascript-tracker":case"google-tag-manager":break;default:throw Error("Unexpected tracker value")}return c}var N=require("quicktype-core"),ie=require("quicktype-core/dist/language/Kotlin"),se=require("quicktype-core/dist/support/Strings");var en=class extends ie.KotlinXRenderer{constructor(i,c,t,o){super(i,c,t);this.snowtypeOptions=o}getClassData(i){let c=[];return this.forEachClassProperty(i,"none",(t,o,a)=>{let s=this.getArrayTypes(a.type);c.push({name:this.sourcelikeToString(t),jsonName:o,description:this.descriptionForClassProperty(i,o),type:this.sourcelikeToString(this.kotlinType(a.type)),isOptional:a.isOptional,isNullable:this.isNullable(a),isNullableOrOptional:a.isOptional||this.isNullable(a),isArrayOfEnums:s&&s.get("array").includes("enum"),isArrayOfObjects:s&&s.get("array").includes("class"),isEnum:this.isEnum(a),isObject:this.isObject(a)})}),{properties:c}}emitSource(i){super.emitSource(i),k(this,this.snowtypeOptions.generators)}emitSourceStructure(){}getArrayTypes(i){if(i.kind.toString()!=="array")return null;let c=new Map;return c.set("array",[]),i.getChildren().forEach(t=>{t.kind.toString()==="union"?t.getChildren().forEach(o=>{c.get("array").push(o.kind.toString())}):c.get("array").push(t.kind.toString())}),c}isEnum(i){return i.type.kind==="enum"||this.isNullable(i)&&(0,N.nullableFromUnion)(i.type)?.kind==="enum"}isObject(i){return i.type.kind==="class"||this.isNullable(i)&&(0,N.nullableFromUnion)(i.type)?.kind==="class"}isNullable(i){return i.type.kind==="union"&&(0,N.nullableFromUnion)(i.type)!==null}},ln=class extends N.KotlinTargetLanguage{constructor(i){super();this.snowtypeOptions=i}makeRenderer(i,c){return new en(this,i,(0,N.getOptionValues)(N.kotlinOptions,c),this.snowtypeOptions)}},an=w({name:"kotlin",quicktypeLanguage:ln,defaultOptions:{framework:"kotlinx",package:"Snowtype","just-types":!0},requiredOptions:["package"],unsupportedOptions:["framework"],nameModifiers:{functionName:se.camelCase}});var S=require("quicktype-core"),ue=require("quicktype-core/dist/support/Strings");var on=class extends S.SwiftRenderer{constructor(i,c,t,o){super(i,c,t);this.snowtypeOptions=o}getClassData(i){let c=[];return this.forEachClassProperty(i,"none",(t,o,a)=>{let s=this.getArrayTypes(a.type);c.push({name:this.sourcelikeToString(t),jsonName:o,description:this.descriptionForClassProperty(i,o),type:this.sourcelikeToString(this.swiftPropertyType(a)),isOptional:a.isOptional,isNullable:this.isNullable(a),isNullableOrOptional:a.isOptional||this.isNullable(a),isArrayOfEnums:s&&s.get("array").includes("enum"),isArrayOfObjects:s&&s.get("array").includes("class"),isEnum:this.isEnum(a),isObject:this.isObject(a)})}),{properties:c}}emitSource(i){super.emitSource(i),k(this,this.snowtypeOptions.generators)}emitSourceStructure(){}getArrayTypes(i){if(i.kind.toString()!=="array")return null;let c=new Map;return c.set("array",[]),i.getChildren().forEach(t=>{t.kind.toString()==="union"?t.getChildren().forEach(o=>{c.get("array").push(o.kind.toString())}):c.get("array").push(t.kind.toString())}),c}isEnum(i){return i.type.kind==="enum"||this.isNullable(i)&&(0,S.nullableFromUnion)(i.type)?.kind==="enum"}isObject(i){return i.type.kind==="class"||this.isNullable(i)&&(0,S.nullableFromUnion)(i.type)?.kind==="class"}isNullable(i){return i.type.kind==="union"&&(0,S.nullableFromUnion)(i.type)!==null}},tn=class extends S.SwiftTargetLanguage{constructor(i){super();this.snowtypeOptions=i}makeRenderer(i,c){return new on(this,i,(0,S.getOptionValues)(S.swiftOptions,c),this.snowtypeOptions)}},rn=w({name:"swift",quicktypeLanguage:tn,nameModifiers:{functionName:ue.camelCase}});var d=require("quicktype-core"),me=require("quicktype-core/dist/RendererOptions"),fe=require("quicktype-core/dist/support/Strings");var sn=class extends d.TypeScriptRenderer{constructor(i,c,t,o){super(i,c,t);this.snowtypeOptions=o}emitMultiline(i){A(this,i,2)}emitRequiredImports(){let i=he(this.snowtypeOptions.inputs);i.length>0&&this.emitMultiline(i.join(`
|
|
1216
|
+
`))}emitSource(i){this.emitRequiredImports(),super.emitSource(i),k(this,this.snowtypeOptions.generators)}makeNameForTopLevel(i,c,t){return O((...o)=>super.makeNameForTopLevel(...o),this.snowtypeOptions,i,c,t)}},un=class extends d.TypeScriptTargetLanguage{constructor(i){super();this.snowtypeOptions=i}makeRenderer(i,c){return new sn(this,i,(0,me.getOptionValues)(d.tsFlowOptions,c),this.snowtypeOptions)}},ce=w({name:"typescript",quicktypeLanguage:un,defaultOptions:{"just-types":!0,"prefer-unions":!0,"prefer-types":!0},nameModifiers:{functionName:fe.camelCase}}),cn={...ce,generate:async(e,n,i)=>{let{sdk:c,prefixes:t,suffixes:o}=i;return await ce.generate(e,n,i)}};function he({ecomEventSpecifications:e,validations:n,tracker:i}){let c=[];switch(i){case"@snowplow/browser-tracker":c.push("import { trackSelfDescribingEvent, CommonEventProperties, SelfDescribingJson } from '@snowplow/browser-tracker';"),n&&c.push("import Ajv, { ErrorObject } from 'ajv-draft-04';","import addFormats from 'ajv-formats';","import { schemasObject, entityRules, CardinalityRule } from './validations';"),e.length>0&&c.push("import * as Ecom from '@snowplow/browser-plugin-snowplow-ecommerce';");break;case"@snowplow/node-tracker":c.push("import { buildSelfDescribingEvent, SelfDescribingJson, Timestamp, Tracker } from '@snowplow/node-tracker';");break;case"@snowplow/react-native-tracker":c.push("import { ReactNativeTracker, SelfDescribing } from '@snowplow/react-native-tracker';");break;default:throw Error("Unexpected tracker value")}return c}var T=require("quicktype-core");var ge=require("quicktype-core/dist/support/Strings");var mn=class extends T.JavaScriptRenderer{constructor(i,c,t,o){super(i,c,t);this.snowtypeOptions=o}emitMultiline(i){A(this,i,2)}emitSourceStructure(){this.leadingComments!==void 0?this.emitCommentLines(this.leadingComments):this.emitUsageComments()}emitPredefinedJSDocTypes(){this.emitMultiline(nn)}emitSource(i){super.emitSource(i),this.emitCommentLines(["This code should be copied and pasted in a Google Tag Manager Custom JavaScript Variable"]),k(this,this.snowtypeOptions.generators),this.emitPredefinedJSDocTypes(),this.forEachTopLevel("none",(c,t)=>{let o=this.sourcelikeToString(t),a=c.getAttributes().get(M);a&&a.raw&&(a.raw.title=a.raw.title||o,this.emitMultiline(V(a.raw)),this.emitMultiline(nl(a.raw.title)),this.ensureBlankLine())})}makeNameForTopLevel(i,c,t){return O((...o)=>super.makeNameForTopLevel(...o),this.snowtypeOptions,i,c,t)}},fn=class extends T.JavaScriptTargetLanguage{constructor(i){super();this.snowtypeOptions=i}makeRenderer(i,c){return new mn(this,i,(0,T.getOptionValues)(T.tsFlowOptions,c),this.snowtypeOptions)}},ye=w({name:"javascript",quicktypeLanguage:fn,defaultOptions:{"runtime-typecheck":!1},nameModifiers:{functionName:ge.camelCase}}),yn={...ye,id:"javascript-gtm",name:"JavaScript - Google Tag Manager",generate:async(e,n,i)=>{let{sdk:c,prefixes:t,suffixes:o}=i;return await ye.generate(e,n,i)}};function nl(e){return`
|
|
1131
1217
|
/**
|
|
1132
1218
|
* Typedef for a ${e} entity context.
|
|
1133
1219
|
* @typedef {object} ${e}Context
|
|
1134
1220
|
* @property {string} schema The schema of the context.
|
|
1135
1221
|
* @property { ${e} } data The data to send for the context.
|
|
1136
|
-
*/`}
|
|
1137
|
-
`))}emitSource(r){this.emitRequiredImports(),super.emitSource(r),S(this,this.snowtypeOptions.generators)}makeNameForTopLevel(r,c,o){return L((...t)=>super.makeNameForTopLevel(...t),this.snowtypeOptions,r,c,o)}},an=class extends I.TypeScriptTargetLanguage{constructor(r){super();this.snowtypeOptions=r}makeRenderer(r,c){return new ln(this,r,(0,oe.getOptionValues)(I.tsFlowOptions,c),this.snowtypeOptions)}},ae=P({name:"typescript",quicktypeLanguage:an,defaultOptions:{"just-types":!0,"prefer-unions":!0,"prefer-types":!0},nameModifiers:{functionName:te.camelCase}}),on={...ae,generate:async(e,n,r)=>{let{sdk:c,prefixes:o,suffixes:t}=r;return await ae.generate(e,n,r)}};function He({ecomEventSpecifications:e,validations:n,tracker:r}){let c=[];switch(r){case"@snowplow/browser-tracker":c.push("import { trackSelfDescribingEvent, CommonEventProperties, SelfDescribingJson } from '@snowplow/browser-tracker';"),n&&c.push("import Ajv, { ErrorObject } from 'ajv-draft-04';","import addFormats from 'ajv-formats';","import { schemasObject, entityRules, CardinalityRule } from './validations';"),e.length>0&&c.push("import * as Ecom from '@snowplow/browser-plugin-snowplow-ecommerce';");break;case"@snowplow/node-tracker":c.push("import { buildSelfDescribingEvent, SelfDescribingJson, Timestamp, Tracker } from '@snowplow/node-tracker';");break;case"@snowplow/react-native-tracker":c.push("import { ReactNativeTracker, SelfDescribing } from '@snowplow/react-native-tracker';");break;default:throw Error("Unexpected tracker value")}return c}var T=require("quicktype-core");var ie=require("quicktype-core/dist/support/Strings"),tn=class extends T.GoRenderer{constructor(r,c,o,t){super(r,c,o);this.snowtypeOptions=t}emitSource(r){super.emitSource(r),S(this,this.snowtypeOptions.generators)}makeNameForTopLevel(r,c,o){return L((...t)=>super.makeNameForTopLevel(...t),this.snowtypeOptions,r,c,o)}},$=class extends T.GoTargetLanguage{constructor(r){super();this.snowtypeOptions=r}makeRenderer(r,c){return new tn(this,r,(0,T.getOptionValues)(T.goOptions,c),this.snowtypeOptions)}},re=P({name:"go",quicktypeLanguage:$,defaultOptions:{"just-types":!0,"just-types-and-package":!0,package:"snowtypegenerated","multi-file-output":!1,"field-tags":"mapstructure"},nameModifiers:{functionName:ie.camelCase}}),rn={...re,generate:async(e,n,r)=>{let{sdk:c,prefixes:o,suffixes:t}=r;return await re.generate(e,n,r)}};var se=[on,z,Y,en,rn];var qe=["Automatically generated by Snowtype"];function Qe(e){return se.find(r=>r.id===e.language)?.generate(e.schemas,e.eventSpecifications,{header:qe,outputFilename:"snowplow",validations:e.validations,tracker:e.tracker})}0&&(module.exports={createEventSpecificationInstructionsIdentifier,generate});
|
|
1222
|
+
*/`}var C=require("quicktype-core");var ve=require("quicktype-core/dist/support/Strings"),gn=class extends C.GoRenderer{constructor(i,c,t,o){super(i,c,t);this.snowtypeOptions=o}emitSource(i){super.emitSource(i),k(this,this.snowtypeOptions.generators)}makeNameForTopLevel(i,c,t){return O((...o)=>super.makeNameForTopLevel(...o),this.snowtypeOptions,i,c,t)}},q=class extends C.GoTargetLanguage{constructor(i){super();this.snowtypeOptions=i}makeRenderer(i,c){return new gn(this,i,(0,C.getOptionValues)(C.goOptions,c),this.snowtypeOptions)}},pe=w({name:"go",quicktypeLanguage:q,defaultOptions:{"just-types":!0,"just-types-and-package":!0,package:"snowtypegenerated","multi-file-output":!1,"field-tags":"mapstructure"},nameModifiers:{functionName:ve.camelCase}}),pn={...pe,generate:async(e,n,i)=>{let{sdk:c,prefixes:t,suffixes:o}=i;return await pe.generate(e,n,i)}};var ke=[cn,h,yn,an,rn,pn];var el=["Automatically generated by Snowtype"];function ll(e){return ke.find(i=>i.id===e.language)?.generate(e.schemas,e.eventSpecifications,{header:el,outputFilename:"snowplow",validations:e.validations,tracker:e.tracker})}0&&(module.exports={createEventSpecificationInstructionsIdentifier,generate,languageIds,trackerTemplates});
|