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