avo 3.0.0-beta.1 → 3.0.0-beta.2
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/Avo.js +771 -1038
- package/cli.js +36 -9
- package/package.json +1 -1
package/Avo.js
CHANGED
|
@@ -1,1170 +1,903 @@
|
|
|
1
|
-
// Generated by Avo VERSION
|
|
1
|
+
// Generated by Avo VERSION 107.29.0. You should never have to make changes to this file.
|
|
2
2
|
// If you find yourself in the situation where you have to edit the file please contact us at hi@avo.app.
|
|
3
3
|
// If you encounter a git conflict in this file run `avo pull` and it will be resolved automatically.
|
|
4
|
+
/* tslint:disable */
|
|
4
5
|
/* eslint-disable */
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
6
|
+
export var AvoEnv;
|
|
7
|
+
(function (AvoEnv) {
|
|
8
|
+
AvoEnv["Prod"] = "prod";
|
|
9
|
+
AvoEnv["Dev"] = "dev";
|
|
10
|
+
})(AvoEnv = AvoEnv || (AvoEnv = {}));
|
|
11
|
+
let __AVO_ENV__ = null;
|
|
12
|
+
// @ts-ignore
|
|
13
|
+
let __AVO_NOOP__ = false;
|
|
14
|
+
// @ts-ignore
|
|
15
|
+
let __AVO_LOGGER__ = null;
|
|
16
|
+
// @ts-ignore
|
|
17
|
+
let __STRICT__ = null;
|
|
18
|
+
// @ts-ignore
|
|
19
|
+
let __REPORT_FAILURE_AS__ = null;
|
|
20
|
+
export const avoInspectorApiKey = "3UWtteG9HenZ825cYoYr";
|
|
21
|
+
let __INSPECTOR__ = null;
|
|
22
|
+
// @ts-ignore
|
|
23
|
+
if (typeof Object.assign !== 'function') {
|
|
24
|
+
// Must be writable: true, enumerable: false, configurable: true
|
|
25
|
+
Object.defineProperty(Object, "assign", {
|
|
26
|
+
value: function assign(target, _varArgs) {
|
|
27
|
+
if (target == null) { // TypeError if undefined or null
|
|
28
|
+
throw new TypeError('Cannot convert undefined or null to object');
|
|
29
|
+
}
|
|
30
|
+
let to = Object(target);
|
|
31
|
+
for (let index = 1; index < arguments.length; index++) {
|
|
32
|
+
let nextSource = arguments[index];
|
|
33
|
+
if (nextSource != null) { // Skip over if undefined or null
|
|
34
|
+
for (let nextKey in nextSource) {
|
|
35
|
+
// Avoid bugs when hasOwnProperty is shadowed
|
|
36
|
+
if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) {
|
|
37
|
+
to[nextKey] = nextSource[nextKey];
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return to;
|
|
43
|
+
},
|
|
44
|
+
writable: true,
|
|
45
|
+
configurable: true
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
let InternalAvoLogger = {
|
|
49
|
+
logEventSent: function logEventSent(eventName, eventProperties, userProperties) {
|
|
50
|
+
const message = "Event Sent:" + eventName + "Event Props:" + JSON.stringify(eventProperties) + "User Props:" + JSON.stringify(userProperties);
|
|
51
|
+
if (__AVO_LOGGER__ && __AVO_LOGGER__.logDebug && __AVO_LOGGER__.logDebug(__AVO_ENV__, message)) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
typeof console !== 'undefined' && console.log("[avo] Event Sent:", eventName, "Event Props:", eventProperties, "User Props:", userProperties);
|
|
55
|
+
},
|
|
56
|
+
log: function log(message) {
|
|
57
|
+
if (__AVO_LOGGER__ && __AVO_LOGGER__.logDebug && __AVO_LOGGER__.logDebug(__AVO_ENV__, message)) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
typeof console !== 'undefined' && console.log("[avo] " + message);
|
|
61
|
+
},
|
|
62
|
+
warn: function warn(message) {
|
|
63
|
+
if (__AVO_LOGGER__ && __AVO_LOGGER__.logWarn && __AVO_LOGGER__.logWarn(__AVO_ENV__, message)) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
typeof console !== 'undefined' && console.warn("[avo] " + message);
|
|
67
|
+
},
|
|
68
|
+
error: function error(message, error) {
|
|
69
|
+
if (__AVO_LOGGER__ && __AVO_LOGGER__.logError && __AVO_LOGGER__.logError(__AVO_ENV__, message + error)) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
typeof console !== 'undefined' && console.error("[avo] " + message, error);
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
// @ts-ignore
|
|
76
|
+
let array_difference;
|
|
77
|
+
// @ts-ignore
|
|
78
|
+
let AvoAssert;
|
|
79
|
+
array_difference = function array_difference(a1, a2) {
|
|
80
|
+
let result = [];
|
|
81
|
+
for (let i = 0; i < a1.length; i++) {
|
|
82
|
+
if (a2.indexOf(a1[i]) === -1) {
|
|
83
|
+
result.push(a1[i]);
|
|
84
|
+
}
|
|
22
85
|
}
|
|
23
86
|
return result;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
AvoAssert = {
|
|
87
|
+
};
|
|
88
|
+
AvoAssert = {
|
|
27
89
|
assertObject: function assertObject(propertyId, propName, obj) {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
90
|
+
if (typeof obj !== 'object') {
|
|
91
|
+
let message = propName +
|
|
92
|
+
' should be of type object but you provided type ' +
|
|
93
|
+
typeof obj +
|
|
94
|
+
' with value ' +
|
|
95
|
+
JSON.stringify(obj);
|
|
96
|
+
return [{ tag: 'expectedObjectType', propertyId, message, actualType: typeof obj }];
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
return [];
|
|
100
|
+
}
|
|
38
101
|
},
|
|
39
|
-
|
|
40
102
|
assertString: function assertString(propertyId, propName, str) {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
103
|
+
if (typeof str !== 'string') {
|
|
104
|
+
let message = propName +
|
|
105
|
+
' should be of type string but you provided type ' +
|
|
106
|
+
typeof str +
|
|
107
|
+
' with value ' +
|
|
108
|
+
JSON.stringify(str);
|
|
109
|
+
return [{ tag: 'expectedStringType', propertyId, message, actualType: typeof str }];
|
|
110
|
+
}
|
|
111
|
+
else {
|
|
112
|
+
return [];
|
|
113
|
+
}
|
|
51
114
|
},
|
|
52
|
-
|
|
53
115
|
assertInt: function assertInt(propertyId, propName, int) {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
116
|
+
if (typeof int === 'number' && int !== Math.round(int)) {
|
|
117
|
+
let message = propName +
|
|
118
|
+
' should be of type int but you provided type float with value ' +
|
|
119
|
+
JSON.stringify(int);
|
|
120
|
+
return [{ tag: 'expectedIntType', propertyId, message, actualType: 'float' }];
|
|
121
|
+
}
|
|
122
|
+
else if (typeof int !== 'number') {
|
|
123
|
+
let message = propName +
|
|
124
|
+
' should be of type int but you provided type ' +
|
|
125
|
+
typeof int +
|
|
126
|
+
' with value ' +
|
|
127
|
+
JSON.stringify(int);
|
|
128
|
+
return [{ tag: 'expectedIntType', propertyId, message, actualType: typeof int }];
|
|
129
|
+
}
|
|
130
|
+
else {
|
|
131
|
+
return [];
|
|
132
|
+
}
|
|
69
133
|
},
|
|
70
|
-
|
|
71
134
|
assertLong: function assertLong(propertyId, propName, long) {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
135
|
+
if (typeof long === 'number' && long !== Math.round(long)) {
|
|
136
|
+
let message = propName +
|
|
137
|
+
' should be of type long but you provided type float with value ' +
|
|
138
|
+
JSON.stringify(long);
|
|
139
|
+
return [{ tag: 'expectedLongType', propertyId, message, actualType: 'float' }];
|
|
140
|
+
}
|
|
141
|
+
else if (typeof long !== 'number') {
|
|
142
|
+
let message = propName +
|
|
143
|
+
' should be of type long but you provided type ' +
|
|
144
|
+
typeof long +
|
|
145
|
+
' with value ' +
|
|
146
|
+
JSON.stringify(long);
|
|
147
|
+
return [{ tag: 'expectedLongType', propertyId, message, actualType: typeof long }];
|
|
148
|
+
}
|
|
149
|
+
else {
|
|
150
|
+
return [];
|
|
151
|
+
}
|
|
87
152
|
},
|
|
88
|
-
|
|
89
153
|
assertFloat: function assertFloat(propertyId, propName, float) {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
154
|
+
if (typeof float !== 'number') {
|
|
155
|
+
let message = propName +
|
|
156
|
+
' should be of type float but you provided type ' +
|
|
157
|
+
typeof float +
|
|
158
|
+
' with value ' +
|
|
159
|
+
JSON.stringify(float);
|
|
160
|
+
return [{ tag: 'expectedFloatType', propertyId, message, actualType: typeof float }];
|
|
161
|
+
}
|
|
162
|
+
else {
|
|
163
|
+
return [];
|
|
164
|
+
}
|
|
100
165
|
},
|
|
101
|
-
|
|
102
166
|
assertBool: function assertBool(propertyId, propName, bool) {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
167
|
+
if (typeof bool !== 'boolean') {
|
|
168
|
+
let message = propName +
|
|
169
|
+
' should be of type boolean but you provided type ' +
|
|
170
|
+
typeof bool +
|
|
171
|
+
' with value ' +
|
|
172
|
+
JSON.stringify(bool);
|
|
173
|
+
return [{ tag: 'expectedBoolType', propertyId, message, actualType: typeof bool }];
|
|
174
|
+
}
|
|
175
|
+
else {
|
|
176
|
+
return [];
|
|
177
|
+
}
|
|
113
178
|
},
|
|
114
|
-
|
|
115
179
|
assertMax: function assertMax(propertyId, propName, max, value) {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
180
|
+
if (value > max) {
|
|
181
|
+
let message = propName +
|
|
182
|
+
' has a maximum value of ' +
|
|
183
|
+
max +
|
|
184
|
+
' but you provided the value ' +
|
|
185
|
+
JSON.stringify(value);
|
|
186
|
+
return [{ tag: 'expectedMax', propertyId, message }];
|
|
187
|
+
}
|
|
188
|
+
else {
|
|
189
|
+
return [];
|
|
190
|
+
}
|
|
126
191
|
},
|
|
127
|
-
|
|
128
192
|
assertMin: function assertMin(propertyId, propName, min, value) {
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
193
|
+
if (value < min) {
|
|
194
|
+
let message = propName +
|
|
195
|
+
' has a minimum value of ' +
|
|
196
|
+
min +
|
|
197
|
+
' but you provided the value ' +
|
|
198
|
+
JSON.stringify(value);
|
|
199
|
+
return [{ tag: 'expectedMin', propertyId, message }];
|
|
200
|
+
}
|
|
201
|
+
else {
|
|
202
|
+
return [];
|
|
203
|
+
}
|
|
139
204
|
},
|
|
140
|
-
|
|
141
205
|
assertList: function assertList(propertyId, propName, value) {
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
206
|
+
if (!Array.isArray(value)) {
|
|
207
|
+
let message = propName + ' should be of type list but you provided type ' + typeof value;
|
|
208
|
+
return [{ tag: 'expectedList', propertyId, message }];
|
|
209
|
+
}
|
|
210
|
+
else {
|
|
211
|
+
return [];
|
|
212
|
+
}
|
|
148
213
|
},
|
|
149
|
-
|
|
150
214
|
assertNoAdditionalProperties: function assertNoAdditionalProperties(eventName, input, spec) {
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
215
|
+
let additionalKeys = array_difference(input, spec);
|
|
216
|
+
if (additionalKeys.length) {
|
|
217
|
+
let message = "Additional properties when sending event " + eventName + ": " + JSON.stringify(additionalKeys);
|
|
218
|
+
return [{ tag: 'expectedNoAdditionalProperties', additionalProperties: additionalKeys, message: message }];
|
|
219
|
+
}
|
|
220
|
+
else {
|
|
221
|
+
return [];
|
|
222
|
+
}
|
|
158
223
|
},
|
|
159
|
-
|
|
160
224
|
assertNoAdditionalUserProperties: function assertNoAdditionalProperties(eventName, input, spec) {
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
};
|
|
170
|
-
|
|
171
|
-
InternalAvoLogger = {
|
|
172
|
-
logEventSent: function logEventSent(eventName, eventProperties, userProperties, groupProperties) {
|
|
173
|
-
const message = "Event Sent:" + eventName + "Event Props:" + JSON.stringify(eventProperties) + "User Props:" + JSON.stringify(userProperties) + "Group Props:" + JSON.stringify(groupProperties);
|
|
174
|
-
|
|
175
|
-
if (__AVO_LOGGER__ && __AVO_LOGGER__.logDebug && __AVO_LOGGER__.logDebug(__AVO_ENV__, message)) {
|
|
176
|
-
return
|
|
177
|
-
}
|
|
178
|
-
typeof console !== 'undefined' && console.log("[avo] Event Sent:", eventName, "Event Props:", eventProperties, "User Props:", userProperties, "Group Props:", groupProperties);
|
|
179
|
-
},
|
|
180
|
-
|
|
181
|
-
log: function log(message) {
|
|
182
|
-
if (__AVO_LOGGER__ && __AVO_LOGGER__.logDebug && __AVO_LOGGER__.logDebug(__AVO_ENV__, message)) {
|
|
183
|
-
return
|
|
184
|
-
}
|
|
185
|
-
typeof console !== 'undefined' && console.log("[avo] " + message);
|
|
186
|
-
},
|
|
187
|
-
|
|
188
|
-
warn: function warn(message) {
|
|
189
|
-
if (__AVO_LOGGER__ && __AVO_LOGGER__.logWarn && __AVO_LOGGER__.logWarn(__AVO_ENV__, message)) {
|
|
190
|
-
return
|
|
191
|
-
}
|
|
192
|
-
typeof console !== 'undefined' && console.warn("[avo] " + message);
|
|
225
|
+
let additionalKeys = array_difference(input, spec);
|
|
226
|
+
if (additionalKeys.length) {
|
|
227
|
+
let message = "Additional user properties when sending event " + eventName + ": " + JSON.stringify(additionalKeys);
|
|
228
|
+
return [{ tag: 'expectedNoAdditionalUserProperties', additionalProperties: additionalKeys, message: message }];
|
|
229
|
+
}
|
|
230
|
+
else {
|
|
231
|
+
return [];
|
|
232
|
+
}
|
|
193
233
|
},
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
}
|
|
199
|
-
typeof console !== 'undefined' && console.error("[avo] " + message, error);
|
|
200
|
-
}
|
|
201
|
-
};
|
|
202
|
-
|
|
203
|
-
var _avo_invoke, _avo_invoke_meta;
|
|
204
|
-
var _avo_sampling_rate = 1.0;
|
|
234
|
+
};
|
|
235
|
+
let _avo_invoke;
|
|
236
|
+
let _avo_invoke_meta;
|
|
237
|
+
let _avo_sampling_rate = 1.0;
|
|
205
238
|
function _avo_invoke_payload(body) {
|
|
206
|
-
|
|
207
|
-
if (
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
239
|
+
// @ts-ignore
|
|
240
|
+
if (_avo_sampling_rate > 0) {
|
|
241
|
+
// @ts-ignore
|
|
242
|
+
if (Math.random() < _avo_sampling_rate) {
|
|
243
|
+
// @ts-ignore
|
|
244
|
+
const data = JSON.stringify(body);
|
|
245
|
+
let options = {
|
|
246
|
+
hostname: 'api.avo.app',
|
|
247
|
+
port: 443,
|
|
248
|
+
path: '/i',
|
|
249
|
+
method: 'POST',
|
|
250
|
+
headers: {
|
|
251
|
+
'Content-Type': 'application/json',
|
|
252
|
+
'Content-Length': Buffer.byteLength(data)
|
|
253
|
+
}
|
|
254
|
+
};
|
|
255
|
+
let req = require('https').request(options, (res) => {
|
|
256
|
+
const chunks = [];
|
|
257
|
+
res.on('data', (data) => chunks.push(data));
|
|
258
|
+
res.on('end', () => {
|
|
259
|
+
try {
|
|
260
|
+
// @ts-ignore
|
|
261
|
+
const data = JSON.parse(Buffer.concat(chunks).toString());
|
|
262
|
+
// @ts-ignore
|
|
263
|
+
_avo_sampling_rate = data.sa;
|
|
264
|
+
}
|
|
265
|
+
catch (e) { }
|
|
266
|
+
});
|
|
267
|
+
});
|
|
268
|
+
req.write(data);
|
|
269
|
+
// @ts-ignore
|
|
270
|
+
req.on('error', () => { });
|
|
271
|
+
req.end();
|
|
217
272
|
}
|
|
218
|
-
};
|
|
219
|
-
var req = require('https').request(options, (res) => {
|
|
220
|
-
const chunks = [];
|
|
221
|
-
res.on('data', (data) => chunks.push(data));
|
|
222
|
-
res.on('end', () => {
|
|
223
|
-
try {
|
|
224
|
-
const data = JSON.parse(Buffer.concat(chunks));
|
|
225
|
-
_avo_sampling_rate = data.sa;
|
|
226
|
-
} catch(e) {}
|
|
227
|
-
});
|
|
228
|
-
});
|
|
229
|
-
req.write(data);
|
|
230
|
-
req.on('error', () => { });
|
|
231
|
-
req.end();
|
|
232
273
|
}
|
|
233
|
-
}
|
|
234
274
|
}
|
|
235
|
-
|
|
236
275
|
_avo_invoke = function _avo_invoke(env, eventId, hash, messages, origin) {
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
276
|
+
try {
|
|
277
|
+
_avo_invoke_payload({
|
|
278
|
+
"ac": "DL73ZlCScWgNkQwC3eRv",
|
|
279
|
+
"br": "master",
|
|
280
|
+
"en": env,
|
|
281
|
+
"ev": eventId,
|
|
282
|
+
"ha": hash,
|
|
283
|
+
"sc": "fwtXqAc0fCLy7b7oGW40",
|
|
284
|
+
"se": (new Date()).toISOString(),
|
|
285
|
+
"so": "xOUFa-ew2",
|
|
286
|
+
"va": messages.length === 0,
|
|
287
|
+
"me": messages,
|
|
288
|
+
"or": origin
|
|
289
|
+
});
|
|
290
|
+
}
|
|
291
|
+
catch (e) {
|
|
292
|
+
if (env !== AvoEnv.Prod) {
|
|
293
|
+
throw e;
|
|
294
|
+
}
|
|
295
|
+
else {
|
|
296
|
+
InternalAvoLogger.error("", e);
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
};
|
|
254
300
|
_avo_invoke_meta = function _avo_invoke_meta(env, type, messages, origin) {
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
INVALID_EMAIL: "Invalid Email",
|
|
301
|
+
try {
|
|
302
|
+
_avo_invoke_payload({
|
|
303
|
+
"ac": "DL73ZlCScWgNkQwC3eRv",
|
|
304
|
+
"br": "master",
|
|
305
|
+
"en": env,
|
|
306
|
+
"ty": type,
|
|
307
|
+
"sc": "fwtXqAc0fCLy7b7oGW40",
|
|
308
|
+
"se": (new Date()).toISOString(),
|
|
309
|
+
"so": "xOUFa-ew2",
|
|
310
|
+
"va": messages.length === 0,
|
|
311
|
+
"me": messages,
|
|
312
|
+
"or": origin
|
|
313
|
+
});
|
|
314
|
+
}
|
|
315
|
+
catch (e) {
|
|
316
|
+
if (env !== AvoEnv.Prod) {
|
|
317
|
+
throw e;
|
|
318
|
+
}
|
|
319
|
+
else {
|
|
320
|
+
InternalAvoLogger.error("", e);
|
|
321
|
+
}
|
|
322
|
+
}
|
|
278
323
|
};
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
WEB_DEBUGGER: "Web Debugger",
|
|
286
|
-
ANDROID_DEBUGGER: "Android Debugger",
|
|
287
|
-
IOS_DEBUGGER: "Ios Debugger",
|
|
288
|
-
REACT_NATIVE_DEBUGGER_IOS: "React Native Debugger (ios)",
|
|
289
|
-
REACT_NATIVE_DEBUGGER_ANDROID: "React Native Debugger (android)",
|
|
290
|
-
DOCS: "Docs",
|
|
291
|
-
PUBLISHING_WORKER: "Publishing Worker",
|
|
324
|
+
export const SignInError = {
|
|
325
|
+
'UNKNOWN': 'Unknown',
|
|
326
|
+
'WRONG_PASSWORD': 'Wrong Password',
|
|
327
|
+
'USER_NOT_FOUND': 'User Not Found',
|
|
328
|
+
'USER_DISABLED': 'User Disabled',
|
|
329
|
+
'INVALID_EMAIL': 'Invalid Email',
|
|
292
330
|
};
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
331
|
+
export const Client = {
|
|
332
|
+
'CLOUD_FUNCTIONS': 'Cloud Functions',
|
|
333
|
+
'WEB': 'Web',
|
|
334
|
+
'LANDING_PAGE': 'Landing Page',
|
|
335
|
+
'CLI': 'Cli',
|
|
336
|
+
'WEB_DEBUGGER': 'Web Debugger',
|
|
337
|
+
'ANDROID_DEBUGGER': 'Android Debugger',
|
|
338
|
+
'IOS_DEBUGGER': 'Ios Debugger',
|
|
339
|
+
'REACT_NATIVE_DEBUGGER_IOS': 'React Native Debugger (ios)',
|
|
340
|
+
'REACT_NATIVE_DEBUGGER_ANDROID': 'React Native Debugger (android)',
|
|
341
|
+
'DOCS': 'Docs',
|
|
342
|
+
'PUBLISHING_WORKER': 'Publishing Worker',
|
|
298
343
|
};
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
CHECKOUT: "Checkout",
|
|
305
|
-
INIT: "Init",
|
|
306
|
-
STATUS: "Status",
|
|
307
|
-
BRANCH: "Branch",
|
|
308
|
-
EDIT: "Edit",
|
|
309
|
-
WHOAMI: "Whoami",
|
|
310
|
-
SOURCE: "Source",
|
|
311
|
-
SOURCE_ADD: "Source Add",
|
|
312
|
-
SOURCE_REMOVE: "Source Remove",
|
|
313
|
-
MERGE: "Merge",
|
|
314
|
-
CONFLICT: "Conflict",
|
|
344
|
+
export const AuthenticationMethod = {
|
|
345
|
+
'GOOGLE': 'Google',
|
|
346
|
+
'EMAIL': 'Email',
|
|
347
|
+
'SSO': 'SSO',
|
|
348
|
+
'CLI': 'CLI',
|
|
315
349
|
};
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
messages = messages.concat(AvoAssert.assertString("40958e87-d69a-4d5a-98f8-b36922466787", label_ ? "Schema Id" + ": " + label_ : "Schema Id", schemaId));
|
|
338
|
-
return messages;
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
function assertOptionalEmailInput(emailInput, label_) {
|
|
342
|
-
var messages = [];
|
|
343
|
-
if (emailInput !== undefined && emailInput !== null) {
|
|
344
|
-
messages = messages.concat(AvoAssert.assertString("439349b2-72cb-4ac1-81d9-1c4aa89da524", label_ ? "Email Input" + ": " + label_ : "Email Input", emailInput));
|
|
345
|
-
}
|
|
346
|
-
return messages;
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
function assertEmail(email, label_) {
|
|
350
|
-
var messages = [];
|
|
351
|
-
messages = messages.concat(AvoAssert.assertString("92588d93-5307-4fa2-be00-be0821596abe", label_ ? "Email" + ": " + label_ : "Email", email));
|
|
352
|
-
return messages;
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
function assertClient(client, label_) {
|
|
356
|
-
var messages = [];
|
|
357
|
-
messages = messages.concat(AvoAssert.assertString("9e5c4ff5-d5f6-4e82-b061-d5fa02755aae", label_ ? "Client" + ": " + label_ : "Client", client));
|
|
358
|
-
if ("Cloud Functions" !== client && "Web" !== client &&
|
|
359
|
-
"Landing Page" !== client && "Cli" !== client &&
|
|
360
|
-
"Web Debugger" !== client && "Android Debugger" !== client &&
|
|
361
|
-
"Ios Debugger" !== client &&
|
|
362
|
-
"React Native Debugger (ios)" !== client &&
|
|
363
|
-
"React Native Debugger (android)" !== client && "Docs" !== client &&
|
|
364
|
-
"Publishing Worker" !== client) {
|
|
365
|
-
var message = (label_ ? "Client" + ": " + label_ : "Client") + " should match one of the following values [ Cloud Functions | Web | Landing Page | Cli | Web Debugger | Android Debugger | Ios Debugger | React Native Debugger (ios) | React Native Debugger (android) | Docs | Publishing Worker ] but you provided the value " + client
|
|
366
|
-
messages = messages.concat([{tag: 'expectedStringMatch', propertyId: "9e5c4ff5-d5f6-4e82-b061-d5fa02755aae", message: message}]);
|
|
367
|
-
}
|
|
368
|
-
return messages;
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
function assertBranchName(branchName, label_) {
|
|
372
|
-
var messages = [];
|
|
373
|
-
messages = messages.concat(AvoAssert.assertString("9xcXzuN-3", label_ ? "Branch Name" + ": " + label_ : "Branch Name", branchName));
|
|
374
|
-
return messages;
|
|
375
|
-
}
|
|
376
|
-
|
|
377
|
-
function assertCliInvokedByCi(cliInvokedByCi, label_) {
|
|
378
|
-
var messages = [];
|
|
379
|
-
messages = messages.concat(AvoAssert.assertBool("IyaXHTG7C", label_ ? "Cli Invoked by Ci" + ": " + label_ : "Cli Invoked by Ci", cliInvokedByCi));
|
|
380
|
-
return messages;
|
|
381
|
-
}
|
|
382
|
-
|
|
383
|
-
function assertAuthenticationMethod(authenticationMethod, label_) {
|
|
384
|
-
var messages = [];
|
|
385
|
-
messages = messages.concat(AvoAssert.assertString("R9pE83vdh", label_ ? "Authentication Method" + ": " + label_ : "Authentication Method", authenticationMethod));
|
|
386
|
-
if ("Google" !== authenticationMethod &&
|
|
387
|
-
"Email" !== authenticationMethod && "SSO" !== authenticationMethod) {
|
|
388
|
-
var message = (label_ ? "Authentication Method" + ": " + label_ : "Authentication Method") + " should match one of the following values [ Google | Email | SSO ] but you provided the value " + authenticationMethod
|
|
389
|
-
messages = messages.concat([{tag: 'expectedStringMatch', propertyId: "R9pE83vdh", message: message}]);
|
|
390
|
-
}
|
|
391
|
-
return messages;
|
|
392
|
-
}
|
|
393
|
-
|
|
394
|
-
function assertCliAction(cliAction, label_) {
|
|
395
|
-
var messages = [];
|
|
396
|
-
messages = messages.concat(AvoAssert.assertString("YRq1Pt0ey", label_ ? "Cli Action" + ": " + label_ : "Cli Action", cliAction));
|
|
397
|
-
if ("Login" !== cliAction && "Logout" !== cliAction &&
|
|
398
|
-
"Pull" !== cliAction && "Checkout" !== cliAction &&
|
|
399
|
-
"Init" !== cliAction && "Status" !== cliAction &&
|
|
400
|
-
"Branch" !== cliAction && "Edit" !== cliAction &&
|
|
401
|
-
"Whoami" !== cliAction && "Source" !== cliAction &&
|
|
402
|
-
"Source Add" !== cliAction && "Source Remove" !== cliAction &&
|
|
403
|
-
"Merge" !== cliAction && "Conflict" !== cliAction) {
|
|
404
|
-
var message = (label_ ? "Cli Action" + ": " + label_ : "Cli Action") + " should match one of the following values [ Login | Logout | Pull | Checkout | Init | Status | Branch | Edit | Whoami | Source | Source Add | Source Remove | Merge | Conflict ] but you provided the value " + cliAction
|
|
405
|
-
messages = messages.concat([{tag: 'expectedStringMatch', propertyId: "YRq1Pt0ey", message: message}]);
|
|
406
|
-
}
|
|
407
|
-
return messages;
|
|
408
|
-
}
|
|
409
|
-
|
|
410
|
-
function assertOptionalSchemaName(schemaName, label_) {
|
|
411
|
-
var messages = [];
|
|
412
|
-
if (schemaName !== undefined && schemaName !== null) {
|
|
413
|
-
messages = messages.concat(AvoAssert.assertString("a49af1dc-3166-45db-a906-86179135854b", label_ ? "Schema Name" + ": " + label_ : "Schema Name", schemaName));
|
|
414
|
-
}
|
|
415
|
-
return messages;
|
|
416
|
-
}
|
|
417
|
-
|
|
418
|
-
function _assertUserId_(userId_, label_) {
|
|
419
|
-
var messages = [];
|
|
420
|
-
messages = messages.concat(AvoAssert.assertString("avo-enriched-server-user-id", label_ ? "User Id" + ": " + label_ : "User Id", userId_));
|
|
421
|
-
return messages;
|
|
422
|
-
}
|
|
423
|
-
|
|
424
|
-
function assertUserId_(userId_, label_) {
|
|
425
|
-
var messages = [];
|
|
426
|
-
messages = messages.concat(AvoAssert.assertString("avo-enriched-type-user-id", label_ ? "User Id" + ": " + label_ : "User Id", userId_));
|
|
427
|
-
return messages;
|
|
428
|
-
}
|
|
429
|
-
|
|
430
|
-
function assertBranchId(branchId, label_) {
|
|
431
|
-
var messages = [];
|
|
432
|
-
messages = messages.concat(AvoAssert.assertString("tlrUtYcti", label_ ? "Branch Id" + ": " + label_ : "Branch Id", branchId));
|
|
433
|
-
return messages;
|
|
434
|
-
}
|
|
435
|
-
|
|
436
|
-
function assertOptionalForce(force, label_) {
|
|
437
|
-
var messages = [];
|
|
438
|
-
if (force !== undefined && force !== null) {
|
|
439
|
-
messages = messages.concat(AvoAssert.assertBool("xSnIO4dt8", label_ ? "Force" + ": " + label_ : "Force", force));
|
|
440
|
-
}
|
|
441
|
-
return messages;
|
|
442
|
-
}
|
|
443
|
-
|
|
444
|
-
function setAvoLogger(avoLogger) {
|
|
445
|
-
__AVO_LOGGER__ = avoLogger;
|
|
446
|
-
}
|
|
447
|
-
|
|
448
|
-
var sysClient;
|
|
449
|
-
var sysVersion;
|
|
450
|
-
|
|
451
|
-
function setSystemProperties(properties) {
|
|
452
|
-
if (properties.client !== null && properties.client !== undefined) {
|
|
453
|
-
sysClient = properties.client;
|
|
454
|
-
assertClient(sysClient);
|
|
455
|
-
}
|
|
456
|
-
if (properties.version !== null && properties.version !== undefined) {
|
|
457
|
-
sysVersion = properties.version;
|
|
458
|
-
assertVersion(sysVersion);
|
|
459
|
-
}
|
|
460
|
-
}
|
|
461
|
-
|
|
462
|
-
function setSystemProperties_(properties) {
|
|
463
|
-
if (properties.client !== null && properties.client !== undefined) {
|
|
464
|
-
sysClient = properties.client;
|
|
465
|
-
assertClient(sysClient);
|
|
466
|
-
}
|
|
467
|
-
if (properties.version !== null && properties.version !== undefined) {
|
|
468
|
-
sysVersion = properties.version;
|
|
469
|
-
assertVersion(sysVersion);
|
|
470
|
-
}
|
|
471
|
-
}
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
var CustomNodeJS;
|
|
475
|
-
function setup_(options, systemProperties, CustomNodeJSDestination,
|
|
476
|
-
destinationOptions) {
|
|
477
|
-
if (options.validateProperties === true) {
|
|
478
|
-
__AVO_DEV__ = true;
|
|
479
|
-
}
|
|
480
|
-
|
|
481
|
-
setSystemProperties_(systemProperties);
|
|
482
|
-
|
|
483
|
-
destinationOptions = destinationOptions || {};
|
|
484
|
-
|
|
485
|
-
if (!__AVO_NOOP__) {
|
|
486
|
-
if (options.useProductionKey) {
|
|
487
|
-
} else {
|
|
350
|
+
export const CliAction = {
|
|
351
|
+
'LOGIN': 'Login',
|
|
352
|
+
'LOGOUT': 'Logout',
|
|
353
|
+
'PULL': 'Pull',
|
|
354
|
+
'CHECKOUT': 'Checkout',
|
|
355
|
+
'INIT': 'Init',
|
|
356
|
+
'STATUS': 'Status',
|
|
357
|
+
'BRANCH': 'Branch',
|
|
358
|
+
'EDIT': 'Edit',
|
|
359
|
+
'WHOAMI': 'Whoami',
|
|
360
|
+
'SOURCE': 'Source',
|
|
361
|
+
'SOURCE_ADD': 'Source Add',
|
|
362
|
+
'SOURCE_REMOVE': 'Source Remove',
|
|
363
|
+
'MERGE': 'Merge',
|
|
364
|
+
'CONFLICT': 'Conflict',
|
|
365
|
+
};
|
|
366
|
+
let sysClient;
|
|
367
|
+
let sysVersion;
|
|
368
|
+
export function setSystemProperties(properties) {
|
|
369
|
+
if (properties.client !== null && properties.client !== undefined) {
|
|
370
|
+
sysClient = properties.client;
|
|
488
371
|
}
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
CustomNodeJS.make(options.useProductionKey);
|
|
492
|
-
if (__AVO_DEV__) {
|
|
493
|
-
// debug console in Avo
|
|
494
|
-
_avo_invoke_meta(__AVO_ENV__, 'setup', [], 'setup');
|
|
372
|
+
if (properties.version !== null && properties.version !== undefined) {
|
|
373
|
+
sysVersion = properties.version;
|
|
495
374
|
}
|
|
496
|
-
}
|
|
497
375
|
}
|
|
498
|
-
|
|
499
|
-
function initAvo(options, systemProperties, destinationOptions,
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
return;
|
|
503
|
-
}
|
|
504
|
-
__AVO_ENV__ = options.env.toLowerCase();
|
|
505
|
-
if (options.avoLogger !== undefined) {
|
|
506
|
-
__AVO_LOGGER__ = options.avoLogger;
|
|
507
|
-
}
|
|
508
|
-
if (options.noop === true) {
|
|
509
|
-
__AVO_NOOP__ = true;
|
|
510
|
-
}
|
|
511
|
-
if (__AVO_NOOP__ && __AVO_ENV__ == 'prod') {
|
|
512
|
-
InternalAvoLogger.warn("****************************************************");
|
|
513
|
-
InternalAvoLogger.warn("WARNING Avo cannot be initialized in noop mode in production:");
|
|
514
|
-
InternalAvoLogger.warn("- Overwriting configuration with noop=false.");
|
|
515
|
-
InternalAvoLogger.warn("- Please reach out if you want to be able to run Avo in production mode with noop=true");
|
|
516
|
-
InternalAvoLogger.warn("****************************************************");
|
|
517
|
-
__AVO_NOOP__ = false;
|
|
518
|
-
}
|
|
519
|
-
if (__AVO_NOOP__) {
|
|
520
|
-
InternalAvoLogger.log("****************************************************");
|
|
521
|
-
InternalAvoLogger.log("Avo is now initialized in noop mode. This means:");
|
|
522
|
-
InternalAvoLogger.log("- No events will be sent");
|
|
523
|
-
InternalAvoLogger.log("- No network requests are made");
|
|
524
|
-
InternalAvoLogger.log("****************************************************");
|
|
525
|
-
}
|
|
526
|
-
if (options.strict !== undefined) {
|
|
527
|
-
__STRICT__ = options.strict !== false;
|
|
528
|
-
}
|
|
529
|
-
if (options.reportFailureAs !== undefined) {
|
|
530
|
-
__REPORT_FAILURE_AS__ = options.reportFailureAs;
|
|
531
|
-
}
|
|
532
|
-
if (!__AVO_NOOP__ && options.inspector !== undefined) {
|
|
533
|
-
__INSPECTOR__ = options.inspector;
|
|
534
|
-
} else if (__AVO_ENV__ !== 'prod') {
|
|
535
|
-
InternalAvoLogger.warn("Avo Inspector not provided in initAvo() call");
|
|
536
|
-
}
|
|
537
|
-
if (__AVO_ENV__ !== 'prod') {
|
|
538
|
-
__AVO_DEV__ = true;
|
|
539
|
-
}
|
|
540
|
-
|
|
541
|
-
setSystemProperties(systemProperties);
|
|
542
|
-
|
|
543
|
-
destinationOptions = destinationOptions || {};
|
|
544
|
-
|
|
545
|
-
if (!__AVO_NOOP__) {
|
|
546
|
-
if (__AVO_ENV__ === 'prod') {
|
|
376
|
+
let CustomNodeJS;
|
|
377
|
+
export function initAvo(options, systemProperties, destinationOptions, CustomNodeJSDestination) {
|
|
378
|
+
if (__AVO_ENV__ !== null) {
|
|
379
|
+
return;
|
|
547
380
|
}
|
|
548
|
-
|
|
381
|
+
__AVO_ENV__ = options.env;
|
|
382
|
+
if (options.avoLogger !== undefined) {
|
|
383
|
+
__AVO_LOGGER__ = options.avoLogger;
|
|
549
384
|
}
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
if (__AVO_ENV__ === 'prod') {
|
|
553
|
-
CustomNodeJS.make && CustomNodeJS.make(__AVO_ENV__, "2");
|
|
554
|
-
} else if (__AVO_ENV__ === 'dev') {
|
|
555
|
-
CustomNodeJS.make && CustomNodeJS.make(__AVO_ENV__, "1");
|
|
556
|
-
} else {
|
|
557
|
-
console[__REPORT_FAILURE_AS__ || 'error']("[avo] No staging key is set for Custom Node JS. Head to destination settings in Avo to set a staging key.");
|
|
558
|
-
CustomNodeJS.make && CustomNodeJS.make(__AVO_ENV__, "");
|
|
385
|
+
if (options.noop === true) {
|
|
386
|
+
__AVO_NOOP__ = true;
|
|
559
387
|
}
|
|
560
|
-
if (
|
|
561
|
-
|
|
562
|
-
|
|
388
|
+
if (__AVO_NOOP__ && __AVO_ENV__ == AvoEnv.Prod) {
|
|
389
|
+
InternalAvoLogger.warn("[avo] ****************************************************");
|
|
390
|
+
InternalAvoLogger.warn("[avo] WARNING Avo cannot be initialized in noop mode in production:");
|
|
391
|
+
InternalAvoLogger.warn("[avo] - Overwriting configuration with noop=false.");
|
|
392
|
+
InternalAvoLogger.warn("[avo] - Please reach out if you want to be able to run Avo in production mode with noop=true");
|
|
393
|
+
InternalAvoLogger.warn("[avo] ****************************************************");
|
|
394
|
+
__AVO_NOOP__ = false;
|
|
395
|
+
}
|
|
396
|
+
if (__AVO_NOOP__) {
|
|
397
|
+
InternalAvoLogger.log("[avo] ****************************************************");
|
|
398
|
+
InternalAvoLogger.log("[avo] Avo is now initialized in noop mode. This means:");
|
|
399
|
+
InternalAvoLogger.log("[avo] - No events will be sent");
|
|
400
|
+
InternalAvoLogger.log("[avo] - No network requests are made");
|
|
401
|
+
InternalAvoLogger.log("[avo] ****************************************************");
|
|
402
|
+
}
|
|
403
|
+
if (options.strict !== undefined) {
|
|
404
|
+
__STRICT__ = options.strict !== false;
|
|
405
|
+
}
|
|
406
|
+
if (options.reportFailureAs !== undefined) {
|
|
407
|
+
__REPORT_FAILURE_AS__ = options.reportFailureAs;
|
|
408
|
+
}
|
|
409
|
+
if (!__AVO_NOOP__ && options.inspector !== undefined) {
|
|
410
|
+
__INSPECTOR__ = options.inspector;
|
|
411
|
+
}
|
|
412
|
+
else if (__AVO_ENV__ !== 'prod') {
|
|
413
|
+
InternalAvoLogger.warn("[avo] Avo Inspector not provided in initAvo() call");
|
|
414
|
+
}
|
|
415
|
+
setSystemProperties(systemProperties);
|
|
416
|
+
destinationOptions = destinationOptions || {};
|
|
417
|
+
if (!__AVO_NOOP__) {
|
|
418
|
+
if (__AVO_ENV__ === AvoEnv.Prod) {
|
|
419
|
+
}
|
|
420
|
+
if (__AVO_ENV__ === AvoEnv.Dev) {
|
|
421
|
+
}
|
|
422
|
+
CustomNodeJS = CustomNodeJSDestination;
|
|
423
|
+
if (__AVO_ENV__ === 'prod') {
|
|
424
|
+
CustomNodeJS && CustomNodeJS.make && CustomNodeJS.make(__AVO_ENV__, "2");
|
|
425
|
+
}
|
|
426
|
+
else if (__AVO_ENV__ === 'dev') {
|
|
427
|
+
CustomNodeJS && CustomNodeJS.make && CustomNodeJS.make(__AVO_ENV__, "1");
|
|
428
|
+
}
|
|
429
|
+
else {
|
|
430
|
+
console[__REPORT_FAILURE_AS__ || 'error']("[avo] No staging key is set for Custom Node JS. Head to destination settings in Avo to set a staging key.");
|
|
431
|
+
CustomNodeJS && CustomNodeJS.make && CustomNodeJS.make(__AVO_ENV__, null);
|
|
432
|
+
}
|
|
433
|
+
if (__AVO_ENV__ === AvoEnv.Dev) {
|
|
434
|
+
// debug console in Avo
|
|
435
|
+
_avo_invoke_meta(__AVO_ENV__, 'init', [], 'init');
|
|
436
|
+
}
|
|
563
437
|
}
|
|
564
|
-
}
|
|
565
438
|
}
|
|
566
|
-
|
|
439
|
+
export function setAvoLogger(avoLogger) {
|
|
440
|
+
__AVO_LOGGER__ = avoLogger;
|
|
441
|
+
}
|
|
567
442
|
/**
|
|
568
443
|
* Signed In: Sent when user successfully signs in or when we successfully authenticate a user.
|
|
569
444
|
*
|
|
570
|
-
* @param
|
|
571
|
-
* @param
|
|
572
|
-
* @param
|
|
573
|
-
* @param
|
|
445
|
+
* @param properties the properties associatied with this event
|
|
446
|
+
* @param properties.userId_: The value used to identify the user. Make sure it's a unique sequence of characters used to identify the user.
|
|
447
|
+
* @param properties.email: The user's email
|
|
448
|
+
* @param properties.authenticationMethod: Type of authentication method used by user logging in or signing up
|
|
574
449
|
*
|
|
575
450
|
* @see {@link https://www.avo.app/schemas/fwtXqAc0fCLy7b7oGW40/events/54e92613-090c-4f0b-afeb-ed720eff3422}
|
|
576
451
|
*/
|
|
577
452
|
export function signedIn(properties) {
|
|
578
|
-
properties = properties || {};
|
|
579
|
-
if (__AVO_DEV__) {
|
|
580
453
|
// assert properties
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
454
|
+
if (__AVO_ENV__ !== AvoEnv.Prod) {
|
|
455
|
+
let messages = [];
|
|
456
|
+
// debug console in Avo
|
|
457
|
+
if (!__AVO_NOOP__) {
|
|
458
|
+
_avo_invoke(__AVO_ENV__, "54e92613-090c-4f0b-afeb-ed720eff3422", "a1718f3b64ff5fb6ebf7227dac25c5ab3f8c0cfecf4cc395076adfab2326fcae", messages.map(m => Object.assign({}, { tag: m.tag, propertyId: m.propertyId, additionalProperties: m.additionalProperties, actualType: m.actualType })), 'event');
|
|
459
|
+
}
|
|
460
|
+
InternalAvoLogger.logEventSent("Signed In", {
|
|
461
|
+
"Authentication Method": properties.authenticationMethod,
|
|
462
|
+
"Client": sysClient,
|
|
463
|
+
"Version": sysVersion,
|
|
464
|
+
}, {
|
|
465
|
+
"Email": properties.email,
|
|
466
|
+
});
|
|
467
|
+
}
|
|
468
|
+
// @ts-ignore
|
|
469
|
+
let eventPropertiesCustomNodeJS = {};
|
|
470
|
+
eventPropertiesCustomNodeJS["Authentication Method"] = properties.authenticationMethod;
|
|
471
|
+
eventPropertiesCustomNodeJS["Client"] = sysClient;
|
|
472
|
+
eventPropertiesCustomNodeJS["Version"] = sysVersion;
|
|
473
|
+
// @ts-ignore
|
|
474
|
+
let userPropertiesCustomNodeJS = {};
|
|
475
|
+
userPropertiesCustomNodeJS["Email"] = properties.email;
|
|
593
476
|
if (!__AVO_NOOP__) {
|
|
594
|
-
|
|
477
|
+
return Promise.all([
|
|
478
|
+
// report to Avo Inspector
|
|
479
|
+
__INSPECTOR__ != null
|
|
480
|
+
// @ts-ignore
|
|
481
|
+
? __INSPECTOR__._avoFunctionTrackSchemaFromEvent("Signed In", {
|
|
482
|
+
"Authentication Method": properties.authenticationMethod,
|
|
483
|
+
"Client": sysClient,
|
|
484
|
+
"Version": sysVersion,
|
|
485
|
+
}, "54e92613-090c-4f0b-afeb-ed720eff3422", "a1718f3b64ff5fb6ebf7227dac25c5ab3f8c0cfecf4cc395076adfab2326fcae")
|
|
486
|
+
: Promise.resolve(),
|
|
487
|
+
// destination CustomNodeJS
|
|
488
|
+
CustomNodeJS.setUserProperties(properties.userId_, Object.assign({}, userPropertiesCustomNodeJS)),
|
|
489
|
+
CustomNodeJS.logEvent(properties.userId_, "Signed In", Object.assign({}, eventPropertiesCustomNodeJS)),
|
|
490
|
+
]);
|
|
595
491
|
}
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
"Client": sysClient,
|
|
600
|
-
"Version": sysVersion,
|
|
601
|
-
}, {
|
|
602
|
-
"Email": properties.email,
|
|
603
|
-
}, {});
|
|
604
|
-
if (__AVO_DEV__ && (__STRICT__ === null || __STRICT__)) {
|
|
605
|
-
// throw exception if messages is not empty
|
|
606
|
-
if (messages.length !== 0) {
|
|
607
|
-
throw new Error("Error sending event 'Signed In': " + messages[0].message)
|
|
608
|
-
}
|
|
609
|
-
} else {
|
|
610
|
-
messages.forEach(function(m) {
|
|
611
|
-
console[__REPORT_FAILURE_AS__ || 'error']("[avo] " + m.message);
|
|
612
|
-
});
|
|
492
|
+
else {
|
|
493
|
+
// do nothing
|
|
494
|
+
return new Promise((resolve) => { resolve(null); });
|
|
613
495
|
}
|
|
614
|
-
}
|
|
615
|
-
|
|
616
|
-
if (!__AVO_NOOP__) {
|
|
617
|
-
return Promise.all([
|
|
618
|
-
// report to Avo Inspector
|
|
619
|
-
__INSPECTOR__ != null ? __INSPECTOR__._avoFunctionTrackSchemaFromEvent("Signed In", {
|
|
620
|
-
"Authentication Method": properties.authenticationMethod,
|
|
621
|
-
"Client": sysClient,
|
|
622
|
-
"Version": sysVersion,
|
|
623
|
-
}, "54e92613-090c-4f0b-afeb-ed720eff3422", "2fec10106ad560f43f307ffdc820e3bd7a474585f9c62ee39961730c35694cb1")
|
|
624
|
-
: Promise.resolve(),
|
|
625
|
-
// destination CustomNodeJS
|
|
626
|
-
CustomNodeJS.setUserProperties(properties.userId_, {
|
|
627
|
-
"Email": properties.email,
|
|
628
|
-
}),
|
|
629
|
-
CustomNodeJS.logEvent(properties.userId_, "Signed In", {
|
|
630
|
-
"Authentication Method": properties.authenticationMethod,
|
|
631
|
-
"Client": sysClient,
|
|
632
|
-
"Version": sysVersion,
|
|
633
|
-
}),
|
|
634
|
-
]);
|
|
635
|
-
} else {
|
|
636
|
-
// do nothing
|
|
637
|
-
return new Promise((resolve) => { resolve(null); });
|
|
638
|
-
}
|
|
639
496
|
}
|
|
640
|
-
|
|
641
497
|
/**
|
|
642
498
|
* Sign In Failed: Sent when sign in request fails.
|
|
643
499
|
*
|
|
644
|
-
* @param
|
|
645
|
-
* @param
|
|
646
|
-
* @param
|
|
647
|
-
* @param
|
|
500
|
+
* @param properties the properties associatied with this event
|
|
501
|
+
* @param properties.userId_: User Id is required for server sources.
|
|
502
|
+
* @param properties.signInError: no description
|
|
503
|
+
* @param properties.emailInput: The email address that is put into the email input on the landing page
|
|
648
504
|
*
|
|
649
505
|
* @see {@link https://www.avo.app/schemas/fwtXqAc0fCLy7b7oGW40/events/7aa64217-bb89-44f5-9a68-f3bc0255a864}
|
|
650
506
|
*/
|
|
651
507
|
export function signInFailed(properties) {
|
|
652
|
-
properties = properties || {};
|
|
653
|
-
if (__AVO_DEV__) {
|
|
654
508
|
// assert properties
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
509
|
+
if (__AVO_ENV__ !== AvoEnv.Prod) {
|
|
510
|
+
let messages = [];
|
|
511
|
+
// debug console in Avo
|
|
512
|
+
if (!__AVO_NOOP__) {
|
|
513
|
+
_avo_invoke(__AVO_ENV__, "7aa64217-bb89-44f5-9a68-f3bc0255a864", "ddc8c1ee0b5dbe58efd0d44d6d4dd8c2bc61bf1d64c7c8f74ea1f50d5b24b2ed", messages.map(m => Object.assign({}, { tag: m.tag, propertyId: m.propertyId, additionalProperties: m.additionalProperties, actualType: m.actualType })), 'event');
|
|
514
|
+
}
|
|
515
|
+
InternalAvoLogger.logEventSent("Sign In Failed", {
|
|
516
|
+
"Sign In Error": properties.signInError,
|
|
517
|
+
"Email Input": properties.emailInput,
|
|
518
|
+
"Client": sysClient,
|
|
519
|
+
"Version": sysVersion,
|
|
520
|
+
}, {});
|
|
521
|
+
}
|
|
522
|
+
// @ts-ignore
|
|
523
|
+
let eventProperties = {};
|
|
524
|
+
eventProperties["Sign In Error"] = properties.signInError;
|
|
525
|
+
if (properties.emailInput !== undefined && properties.emailInput !== null) {
|
|
526
|
+
eventProperties["Email Input"] = properties.emailInput;
|
|
527
|
+
}
|
|
528
|
+
eventProperties["Client"] = sysClient;
|
|
529
|
+
eventProperties["Version"] = sysVersion;
|
|
530
|
+
// @ts-ignore
|
|
531
|
+
let userProperties = {};
|
|
667
532
|
if (!__AVO_NOOP__) {
|
|
668
|
-
|
|
533
|
+
return Promise.all([
|
|
534
|
+
// report to Avo Inspector
|
|
535
|
+
__INSPECTOR__ != null
|
|
536
|
+
// @ts-ignore
|
|
537
|
+
? __INSPECTOR__._avoFunctionTrackSchemaFromEvent("Sign In Failed", {
|
|
538
|
+
"Sign In Error": properties.signInError,
|
|
539
|
+
"Email Input": properties.emailInput,
|
|
540
|
+
"Client": sysClient,
|
|
541
|
+
"Version": sysVersion,
|
|
542
|
+
}, "7aa64217-bb89-44f5-9a68-f3bc0255a864", "ddc8c1ee0b5dbe58efd0d44d6d4dd8c2bc61bf1d64c7c8f74ea1f50d5b24b2ed")
|
|
543
|
+
: Promise.resolve(),
|
|
544
|
+
// destination CustomNodeJS
|
|
545
|
+
CustomNodeJS.logEvent(properties.userId_, "Sign In Failed", Object.assign({}, eventProperties)),
|
|
546
|
+
]);
|
|
669
547
|
}
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
"Email Input": properties.emailInput,
|
|
674
|
-
"Client": sysClient,
|
|
675
|
-
"Version": sysVersion,
|
|
676
|
-
}, {}, {});
|
|
677
|
-
if (__AVO_DEV__ && (__STRICT__ === null || __STRICT__)) {
|
|
678
|
-
// throw exception if messages is not empty
|
|
679
|
-
if (messages.length !== 0) {
|
|
680
|
-
throw new Error("Error sending event 'Sign In Failed': " + messages[0].message)
|
|
681
|
-
}
|
|
682
|
-
} else {
|
|
683
|
-
messages.forEach(function(m) {
|
|
684
|
-
console[__REPORT_FAILURE_AS__ || 'error']("[avo] " + m.message);
|
|
685
|
-
});
|
|
548
|
+
else {
|
|
549
|
+
// do nothing
|
|
550
|
+
return new Promise((resolve) => { resolve(null); });
|
|
686
551
|
}
|
|
687
|
-
}
|
|
688
|
-
|
|
689
|
-
if (!__AVO_NOOP__) {
|
|
690
|
-
return Promise.all([
|
|
691
|
-
// report to Avo Inspector
|
|
692
|
-
__INSPECTOR__ != null ? __INSPECTOR__._avoFunctionTrackSchemaFromEvent("Sign In Failed", {
|
|
693
|
-
"Sign In Error": properties.signInError,
|
|
694
|
-
"Email Input": properties.emailInput,
|
|
695
|
-
"Client": sysClient,
|
|
696
|
-
"Version": sysVersion,
|
|
697
|
-
}, "7aa64217-bb89-44f5-9a68-f3bc0255a864", "ddc8c1ee0b5dbe58efd0d44d6d4dd8c2bc61bf1d64c7c8f74ea1f50d5b24b2ed")
|
|
698
|
-
: Promise.resolve(),
|
|
699
|
-
// destination CustomNodeJS
|
|
700
|
-
CustomNodeJS.logEvent(properties.userId_, "Sign In Failed", {
|
|
701
|
-
"Sign In Error": properties.signInError,
|
|
702
|
-
"Email Input": properties.emailInput,
|
|
703
|
-
"Client": sysClient,
|
|
704
|
-
"Version": sysVersion,
|
|
705
|
-
}),
|
|
706
|
-
]);
|
|
707
|
-
} else {
|
|
708
|
-
// do nothing
|
|
709
|
-
return new Promise((resolve) => { resolve(null); });
|
|
710
|
-
}
|
|
711
552
|
}
|
|
712
|
-
|
|
713
553
|
/**
|
|
714
554
|
* Cli Invoked: Sent when any action is made in the CLI.
|
|
715
555
|
*
|
|
716
|
-
* @param
|
|
717
|
-
* @param
|
|
718
|
-
* @param
|
|
719
|
-
* @param
|
|
720
|
-
* @param
|
|
721
|
-
* @param
|
|
722
|
-
* @param
|
|
723
|
-
* @param
|
|
724
|
-
* @param
|
|
556
|
+
* @param properties the properties associatied with this event
|
|
557
|
+
* @param properties.userId_: User Id is required for server sources.
|
|
558
|
+
* @param properties.cliAction: no description
|
|
559
|
+
* @param properties.schemaId: The ID of the schema that this event is related to.
|
|
560
|
+
* @param properties.cliInvokedByCi: True iff process.env.CI is set.
|
|
561
|
+
* @param properties.branchId: The ID of the branch that this event is related to.
|
|
562
|
+
* @param properties.branchName: The name of the branch that this event is related to.
|
|
563
|
+
* @param properties.schemaName: Name of the schema that this event is related to.
|
|
564
|
+
* @param properties.force: Whether the command was called with --force parameter
|
|
725
565
|
*
|
|
726
566
|
* @see {@link https://www.avo.app/schemas/fwtXqAc0fCLy7b7oGW40/events/qqpIQEK11}
|
|
727
567
|
*/
|
|
728
568
|
export function cliInvoked(properties) {
|
|
729
|
-
properties = properties || {};
|
|
730
|
-
if (__AVO_DEV__) {
|
|
731
569
|
// assert properties
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
]
|
|
753
|
-
|
|
570
|
+
if (__AVO_ENV__ !== AvoEnv.Prod) {
|
|
571
|
+
let messages = [];
|
|
572
|
+
// debug console in Avo
|
|
573
|
+
if (!__AVO_NOOP__) {
|
|
574
|
+
_avo_invoke(__AVO_ENV__, "qqpIQEK11", "33cb14472604cc190f9a5added26d5adb763245b0dc9a2138dc2a4b2cc5a48ef", messages.map(m => Object.assign({}, { tag: m.tag, propertyId: m.propertyId, additionalProperties: m.additionalProperties, actualType: m.actualType })), 'event');
|
|
575
|
+
}
|
|
576
|
+
InternalAvoLogger.logEventSent("Cli Invoked", {
|
|
577
|
+
"Cli Action": properties.cliAction,
|
|
578
|
+
"Schema Id": properties.schemaId,
|
|
579
|
+
"Cli Invoked by Ci": properties.cliInvokedByCi,
|
|
580
|
+
"Branch Id": properties.branchId,
|
|
581
|
+
"Branch Name": properties.branchName,
|
|
582
|
+
"Schema Name": properties.schemaName,
|
|
583
|
+
"Force": properties.force,
|
|
584
|
+
"Client": sysClient,
|
|
585
|
+
"Version": sysVersion,
|
|
586
|
+
}, {});
|
|
587
|
+
}
|
|
588
|
+
// @ts-ignore
|
|
589
|
+
let eventProperties = {};
|
|
590
|
+
eventProperties["Cli Action"] = properties.cliAction;
|
|
591
|
+
eventProperties["Schema Id"] = properties.schemaId;
|
|
592
|
+
eventProperties["Cli Invoked by Ci"] = properties.cliInvokedByCi;
|
|
593
|
+
eventProperties["Branch Id"] = properties.branchId;
|
|
594
|
+
eventProperties["Branch Name"] = properties.branchName;
|
|
595
|
+
if (properties.schemaName !== undefined && properties.schemaName !== null) {
|
|
596
|
+
eventProperties["Schema Name"] = properties.schemaName;
|
|
597
|
+
}
|
|
598
|
+
if (properties.force !== undefined && properties.force !== null) {
|
|
599
|
+
eventProperties["Force"] = properties.force;
|
|
600
|
+
}
|
|
601
|
+
eventProperties["Client"] = sysClient;
|
|
602
|
+
eventProperties["Version"] = sysVersion;
|
|
603
|
+
// @ts-ignore
|
|
604
|
+
let userProperties = {};
|
|
754
605
|
if (!__AVO_NOOP__) {
|
|
755
|
-
|
|
606
|
+
return Promise.all([
|
|
607
|
+
// report to Avo Inspector
|
|
608
|
+
__INSPECTOR__ != null
|
|
609
|
+
// @ts-ignore
|
|
610
|
+
? __INSPECTOR__._avoFunctionTrackSchemaFromEvent("Cli Invoked", {
|
|
611
|
+
"Cli Action": properties.cliAction,
|
|
612
|
+
"Schema Id": properties.schemaId,
|
|
613
|
+
"Cli Invoked by Ci": properties.cliInvokedByCi,
|
|
614
|
+
"Branch Id": properties.branchId,
|
|
615
|
+
"Branch Name": properties.branchName,
|
|
616
|
+
"Schema Name": properties.schemaName,
|
|
617
|
+
"Force": properties.force,
|
|
618
|
+
"Client": sysClient,
|
|
619
|
+
"Version": sysVersion,
|
|
620
|
+
}, "qqpIQEK11", "33cb14472604cc190f9a5added26d5adb763245b0dc9a2138dc2a4b2cc5a48ef")
|
|
621
|
+
: Promise.resolve(),
|
|
622
|
+
// destination CustomNodeJS
|
|
623
|
+
CustomNodeJS.logEvent(properties.userId_, "Cli Invoked", Object.assign({}, eventProperties)),
|
|
624
|
+
]);
|
|
756
625
|
}
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
"Schema Id": properties.schemaId,
|
|
761
|
-
"Cli Invoked by Ci": properties.cliInvokedByCi,
|
|
762
|
-
"Branch Id": properties.branchId,
|
|
763
|
-
"Branch Name": properties.branchName,
|
|
764
|
-
"Schema Name": properties.schemaName,
|
|
765
|
-
"Force": properties.force,
|
|
766
|
-
"Client": sysClient,
|
|
767
|
-
"Version": sysVersion,
|
|
768
|
-
}, {}, {});
|
|
769
|
-
if (__AVO_DEV__ && (__STRICT__ === null || __STRICT__)) {
|
|
770
|
-
// throw exception if messages is not empty
|
|
771
|
-
if (messages.length !== 0) {
|
|
772
|
-
throw new Error("Error sending event 'Cli Invoked': " + messages[0].message)
|
|
773
|
-
}
|
|
774
|
-
} else {
|
|
775
|
-
messages.forEach(function(m) {
|
|
776
|
-
console[__REPORT_FAILURE_AS__ || 'error']("[avo] " + m.message);
|
|
777
|
-
});
|
|
626
|
+
else {
|
|
627
|
+
// do nothing
|
|
628
|
+
return new Promise((resolve) => { resolve(null); });
|
|
778
629
|
}
|
|
779
|
-
}
|
|
780
|
-
|
|
781
|
-
if (!__AVO_NOOP__) {
|
|
782
|
-
return Promise.all([
|
|
783
|
-
// report to Avo Inspector
|
|
784
|
-
__INSPECTOR__ != null ? __INSPECTOR__._avoFunctionTrackSchemaFromEvent("Cli Invoked", {
|
|
785
|
-
"Cli Action": properties.cliAction,
|
|
786
|
-
"Schema Id": properties.schemaId,
|
|
787
|
-
"Cli Invoked by Ci": properties.cliInvokedByCi,
|
|
788
|
-
"Branch Id": properties.branchId,
|
|
789
|
-
"Branch Name": properties.branchName,
|
|
790
|
-
"Schema Name": properties.schemaName,
|
|
791
|
-
"Force": properties.force,
|
|
792
|
-
"Client": sysClient,
|
|
793
|
-
"Version": sysVersion,
|
|
794
|
-
}, "qqpIQEK11", "2c085b5b559ba4f21772aefcc05d8169572edea6375b711f3cb6a547445ffb2c")
|
|
795
|
-
: Promise.resolve(),
|
|
796
|
-
// destination CustomNodeJS
|
|
797
|
-
CustomNodeJS.logEvent(properties.userId_, "Cli Invoked", {
|
|
798
|
-
"Cli Action": properties.cliAction,
|
|
799
|
-
"Schema Id": properties.schemaId,
|
|
800
|
-
"Cli Invoked by Ci": properties.cliInvokedByCi,
|
|
801
|
-
"Branch Id": properties.branchId,
|
|
802
|
-
"Branch Name": properties.branchName,
|
|
803
|
-
"Schema Name": properties.schemaName,
|
|
804
|
-
"Force": properties.force,
|
|
805
|
-
"Client": sysClient,
|
|
806
|
-
"Version": sysVersion,
|
|
807
|
-
}),
|
|
808
|
-
]);
|
|
809
|
-
} else {
|
|
810
|
-
// do nothing
|
|
811
|
-
return new Promise((resolve) => { resolve(null); });
|
|
812
|
-
}
|
|
813
630
|
}
|
|
814
|
-
|
|
815
631
|
/**
|
|
816
632
|
* Cli Installed: Event sent when the CLI is successfully installed
|
|
817
633
|
*
|
|
818
|
-
* @param
|
|
819
|
-
* @param
|
|
820
|
-
* @param
|
|
634
|
+
* @param properties the properties associatied with this event
|
|
635
|
+
* @param properties.userId_: User Id is required for server sources.
|
|
636
|
+
* @param properties.cliInvokedByCi: True iff process.env.CI is set.
|
|
821
637
|
*
|
|
822
638
|
* @see {@link https://www.avo.app/schemas/fwtXqAc0fCLy7b7oGW40/events/JCwfVYXTS}
|
|
823
639
|
*/
|
|
824
640
|
export function cliInstalled(properties) {
|
|
825
|
-
properties = properties || {};
|
|
826
|
-
if (__AVO_DEV__) {
|
|
827
641
|
// assert properties
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
642
|
+
if (__AVO_ENV__ !== AvoEnv.Prod) {
|
|
643
|
+
let messages = [];
|
|
644
|
+
// debug console in Avo
|
|
645
|
+
if (!__AVO_NOOP__) {
|
|
646
|
+
_avo_invoke(__AVO_ENV__, "JCwfVYXTS", "588b1f5190686099b083ad56d3fa443fd2f4c5558878d09a1ef5818f0c731f50", messages.map(m => Object.assign({}, { tag: m.tag, propertyId: m.propertyId, additionalProperties: m.additionalProperties, actualType: m.actualType })), 'event');
|
|
647
|
+
}
|
|
648
|
+
InternalAvoLogger.logEventSent("Cli Installed", {
|
|
649
|
+
"Cli Invoked by Ci": properties.cliInvokedByCi,
|
|
650
|
+
"Client": sysClient,
|
|
651
|
+
"Version": sysVersion,
|
|
652
|
+
}, {});
|
|
653
|
+
}
|
|
654
|
+
// @ts-ignore
|
|
655
|
+
let eventProperties = {};
|
|
656
|
+
eventProperties["Cli Invoked by Ci"] = properties.cliInvokedByCi;
|
|
657
|
+
eventProperties["Client"] = sysClient;
|
|
658
|
+
eventProperties["Version"] = sysVersion;
|
|
659
|
+
// @ts-ignore
|
|
660
|
+
let userProperties = {};
|
|
838
661
|
if (!__AVO_NOOP__) {
|
|
839
|
-
|
|
662
|
+
return Promise.all([
|
|
663
|
+
// report to Avo Inspector
|
|
664
|
+
__INSPECTOR__ != null
|
|
665
|
+
// @ts-ignore
|
|
666
|
+
? __INSPECTOR__._avoFunctionTrackSchemaFromEvent("Cli Installed", {
|
|
667
|
+
"Cli Invoked by Ci": properties.cliInvokedByCi,
|
|
668
|
+
"Client": sysClient,
|
|
669
|
+
"Version": sysVersion,
|
|
670
|
+
}, "JCwfVYXTS", "588b1f5190686099b083ad56d3fa443fd2f4c5558878d09a1ef5818f0c731f50")
|
|
671
|
+
: Promise.resolve(),
|
|
672
|
+
// destination CustomNodeJS
|
|
673
|
+
CustomNodeJS.logEvent(properties.userId_, "Cli Installed", Object.assign({}, eventProperties)),
|
|
674
|
+
]);
|
|
840
675
|
}
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
"Client": sysClient,
|
|
845
|
-
"Version": sysVersion,
|
|
846
|
-
}, {}, {});
|
|
847
|
-
if (__AVO_DEV__ && (__STRICT__ === null || __STRICT__)) {
|
|
848
|
-
// throw exception if messages is not empty
|
|
849
|
-
if (messages.length !== 0) {
|
|
850
|
-
throw new Error("Error sending event 'Cli Installed': " + messages[0].message)
|
|
851
|
-
}
|
|
852
|
-
} else {
|
|
853
|
-
messages.forEach(function(m) {
|
|
854
|
-
console[__REPORT_FAILURE_AS__ || 'error']("[avo] " + m.message);
|
|
855
|
-
});
|
|
676
|
+
else {
|
|
677
|
+
// do nothing
|
|
678
|
+
return new Promise((resolve) => { resolve(null); });
|
|
856
679
|
}
|
|
857
|
-
}
|
|
858
|
-
|
|
859
|
-
if (!__AVO_NOOP__) {
|
|
860
|
-
return Promise.all([
|
|
861
|
-
// report to Avo Inspector
|
|
862
|
-
__INSPECTOR__ != null ? __INSPECTOR__._avoFunctionTrackSchemaFromEvent("Cli Installed", {
|
|
863
|
-
"Cli Invoked by Ci": properties.cliInvokedByCi,
|
|
864
|
-
"Client": sysClient,
|
|
865
|
-
"Version": sysVersion,
|
|
866
|
-
}, "JCwfVYXTS", "588b1f5190686099b083ad56d3fa443fd2f4c5558878d09a1ef5818f0c731f50")
|
|
867
|
-
: Promise.resolve(),
|
|
868
|
-
// destination CustomNodeJS
|
|
869
|
-
CustomNodeJS.logEvent(properties.userId_, "Cli Installed", {
|
|
870
|
-
"Cli Invoked by Ci": properties.cliInvokedByCi,
|
|
871
|
-
"Client": sysClient,
|
|
872
|
-
"Version": sysVersion,
|
|
873
|
-
}),
|
|
874
|
-
]);
|
|
875
|
-
} else {
|
|
876
|
-
// do nothing
|
|
877
|
-
return new Promise((resolve) => { resolve(null); });
|
|
878
|
-
}
|
|
879
680
|
}
|
|
880
|
-
|
|
881
681
|
/**
|
|
882
682
|
* Cli Conflict Resolve Attempted: No description
|
|
883
683
|
*
|
|
884
|
-
* @param
|
|
885
|
-
* @param
|
|
886
|
-
* @param
|
|
887
|
-
* @param
|
|
888
|
-
* @param
|
|
889
|
-
* @param
|
|
890
|
-
* @param
|
|
684
|
+
* @param properties the properties associatied with this event
|
|
685
|
+
* @param properties.userId_: User Id is required for server sources.
|
|
686
|
+
* @param properties.cliInvokedByCi: True iff process.env.CI is set.
|
|
687
|
+
* @param properties.schemaId: The ID of the schema that this event is related to.
|
|
688
|
+
* @param properties.branchId: The ID of the branch that this event is related to.
|
|
689
|
+
* @param properties.branchName: The name of the branch that this event is related to.
|
|
690
|
+
* @param properties.schemaName: Name of the schema that this event is related to.
|
|
891
691
|
*
|
|
892
692
|
* @see {@link https://www.avo.app/schemas/fwtXqAc0fCLy7b7oGW40/events/Un5dTEMQYy}
|
|
893
693
|
*/
|
|
894
694
|
export function cliConflictResolveAttempted(properties) {
|
|
895
|
-
properties = properties || {};
|
|
896
|
-
if (__AVO_DEV__) {
|
|
897
695
|
// assert properties
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
696
|
+
if (__AVO_ENV__ !== AvoEnv.Prod) {
|
|
697
|
+
let messages = [];
|
|
698
|
+
// debug console in Avo
|
|
699
|
+
if (!__AVO_NOOP__) {
|
|
700
|
+
_avo_invoke(__AVO_ENV__, "Un5dTEMQYy", "c867f79479ce7c82d8c80d34ae1847e346f03cf8e742cf5706a2f18142f692a7", messages.map(m => Object.assign({}, { tag: m.tag, propertyId: m.propertyId, additionalProperties: m.additionalProperties, actualType: m.actualType })), 'event');
|
|
701
|
+
}
|
|
702
|
+
InternalAvoLogger.logEventSent("Cli Conflict Resolve Attempted", {
|
|
703
|
+
"Cli Invoked by Ci": properties.cliInvokedByCi,
|
|
704
|
+
"Schema Id": properties.schemaId,
|
|
705
|
+
"Branch Id": properties.branchId,
|
|
706
|
+
"Branch Name": properties.branchName,
|
|
707
|
+
"Schema Name": properties.schemaName,
|
|
708
|
+
"Client": sysClient,
|
|
709
|
+
"Version": sysVersion,
|
|
710
|
+
}, {});
|
|
711
|
+
}
|
|
712
|
+
// @ts-ignore
|
|
713
|
+
let eventProperties = {};
|
|
714
|
+
eventProperties["Cli Invoked by Ci"] = properties.cliInvokedByCi;
|
|
715
|
+
eventProperties["Schema Id"] = properties.schemaId;
|
|
716
|
+
eventProperties["Branch Id"] = properties.branchId;
|
|
717
|
+
eventProperties["Branch Name"] = properties.branchName;
|
|
718
|
+
if (properties.schemaName !== undefined && properties.schemaName !== null) {
|
|
719
|
+
eventProperties["Schema Name"] = properties.schemaName;
|
|
720
|
+
}
|
|
721
|
+
eventProperties["Client"] = sysClient;
|
|
722
|
+
eventProperties["Version"] = sysVersion;
|
|
723
|
+
// @ts-ignore
|
|
724
|
+
let userProperties = {};
|
|
916
725
|
if (!__AVO_NOOP__) {
|
|
917
|
-
|
|
726
|
+
return Promise.all([
|
|
727
|
+
// report to Avo Inspector
|
|
728
|
+
__INSPECTOR__ != null
|
|
729
|
+
// @ts-ignore
|
|
730
|
+
? __INSPECTOR__._avoFunctionTrackSchemaFromEvent("Cli Conflict Resolve Attempted", {
|
|
731
|
+
"Cli Invoked by Ci": properties.cliInvokedByCi,
|
|
732
|
+
"Schema Id": properties.schemaId,
|
|
733
|
+
"Branch Id": properties.branchId,
|
|
734
|
+
"Branch Name": properties.branchName,
|
|
735
|
+
"Schema Name": properties.schemaName,
|
|
736
|
+
"Client": sysClient,
|
|
737
|
+
"Version": sysVersion,
|
|
738
|
+
}, "Un5dTEMQYy", "c867f79479ce7c82d8c80d34ae1847e346f03cf8e742cf5706a2f18142f692a7")
|
|
739
|
+
: Promise.resolve(),
|
|
740
|
+
// destination CustomNodeJS
|
|
741
|
+
CustomNodeJS.logEvent(properties.userId_, "Cli Conflict Resolve Attempted", Object.assign({}, eventProperties)),
|
|
742
|
+
]);
|
|
918
743
|
}
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
"Schema Id": properties.schemaId,
|
|
923
|
-
"Branch Id": properties.branchId,
|
|
924
|
-
"Branch Name": properties.branchName,
|
|
925
|
-
"Schema Name": properties.schemaName,
|
|
926
|
-
"Client": sysClient,
|
|
927
|
-
"Version": sysVersion,
|
|
928
|
-
}, {}, {});
|
|
929
|
-
if (__AVO_DEV__ && (__STRICT__ === null || __STRICT__)) {
|
|
930
|
-
// throw exception if messages is not empty
|
|
931
|
-
if (messages.length !== 0) {
|
|
932
|
-
throw new Error("Error sending event 'Cli Conflict Resolve Attempted': " + messages[0].message)
|
|
933
|
-
}
|
|
934
|
-
} else {
|
|
935
|
-
messages.forEach(function(m) {
|
|
936
|
-
console[__REPORT_FAILURE_AS__ || 'error']("[avo] " + m.message);
|
|
937
|
-
});
|
|
744
|
+
else {
|
|
745
|
+
// do nothing
|
|
746
|
+
return new Promise((resolve) => { resolve(null); });
|
|
938
747
|
}
|
|
939
|
-
}
|
|
940
|
-
|
|
941
|
-
if (!__AVO_NOOP__) {
|
|
942
|
-
return Promise.all([
|
|
943
|
-
// report to Avo Inspector
|
|
944
|
-
__INSPECTOR__ != null ? __INSPECTOR__._avoFunctionTrackSchemaFromEvent("Cli Conflict Resolve Attempted", {
|
|
945
|
-
"Cli Invoked by Ci": properties.cliInvokedByCi,
|
|
946
|
-
"Schema Id": properties.schemaId,
|
|
947
|
-
"Branch Id": properties.branchId,
|
|
948
|
-
"Branch Name": properties.branchName,
|
|
949
|
-
"Schema Name": properties.schemaName,
|
|
950
|
-
"Client": sysClient,
|
|
951
|
-
"Version": sysVersion,
|
|
952
|
-
}, "Un5dTEMQYy", "7404977817fc78c9c765838ebf115d8d684453662663c3947b3ebbc15154a3f7")
|
|
953
|
-
: Promise.resolve(),
|
|
954
|
-
// destination CustomNodeJS
|
|
955
|
-
CustomNodeJS.logEvent(properties.userId_, "Cli Conflict Resolve Attempted", {
|
|
956
|
-
"Cli Invoked by Ci": properties.cliInvokedByCi,
|
|
957
|
-
"Schema Id": properties.schemaId,
|
|
958
|
-
"Branch Id": properties.branchId,
|
|
959
|
-
"Branch Name": properties.branchName,
|
|
960
|
-
"Schema Name": properties.schemaName,
|
|
961
|
-
"Client": sysClient,
|
|
962
|
-
"Version": sysVersion,
|
|
963
|
-
}),
|
|
964
|
-
]);
|
|
965
|
-
} else {
|
|
966
|
-
// do nothing
|
|
967
|
-
return new Promise((resolve) => { resolve(null); });
|
|
968
|
-
}
|
|
969
748
|
}
|
|
970
|
-
|
|
971
749
|
/**
|
|
972
750
|
* Cli Conflict Resolve Failed: No description
|
|
973
751
|
*
|
|
974
|
-
* @param
|
|
975
|
-
* @param
|
|
976
|
-
* @param
|
|
977
|
-
* @param
|
|
978
|
-
* @param
|
|
979
|
-
* @param
|
|
980
|
-
* @param
|
|
752
|
+
* @param properties the properties associatied with this event
|
|
753
|
+
* @param properties.userId_: User Id is required for server sources.
|
|
754
|
+
* @param properties.cliInvokedByCi: True iff process.env.CI is set.
|
|
755
|
+
* @param properties.schemaId: The ID of the schema that this event is related to.
|
|
756
|
+
* @param properties.schemaName: Name of the schema that this event is related to.
|
|
757
|
+
* @param properties.branchId: The ID of the branch that this event is related to.
|
|
758
|
+
* @param properties.branchName: The name of the branch that this event is related to.
|
|
981
759
|
*
|
|
982
760
|
* @see {@link https://www.avo.app/schemas/fwtXqAc0fCLy7b7oGW40/events/4ZhoijIA2U}
|
|
983
761
|
*/
|
|
984
762
|
export function cliConflictResolveFailed(properties) {
|
|
985
|
-
properties = properties || {};
|
|
986
|
-
if (__AVO_DEV__) {
|
|
987
763
|
// assert properties
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
764
|
+
if (__AVO_ENV__ !== AvoEnv.Prod) {
|
|
765
|
+
let messages = [];
|
|
766
|
+
// debug console in Avo
|
|
767
|
+
if (!__AVO_NOOP__) {
|
|
768
|
+
_avo_invoke(__AVO_ENV__, "4ZhoijIA2U", "403808c3d3db8ed1d0a2298ac0c684fa8fcdc16c816f7bd878f136647aff8c00", messages.map(m => Object.assign({}, { tag: m.tag, propertyId: m.propertyId, additionalProperties: m.additionalProperties, actualType: m.actualType })), 'event');
|
|
769
|
+
}
|
|
770
|
+
InternalAvoLogger.logEventSent("Cli Conflict Resolve Failed", {
|
|
771
|
+
"Cli Invoked by Ci": properties.cliInvokedByCi,
|
|
772
|
+
"Schema Id": properties.schemaId,
|
|
773
|
+
"Schema Name": properties.schemaName,
|
|
774
|
+
"Branch Id": properties.branchId,
|
|
775
|
+
"Branch Name": properties.branchName,
|
|
776
|
+
"Client": sysClient,
|
|
777
|
+
"Version": sysVersion,
|
|
778
|
+
}, {});
|
|
779
|
+
}
|
|
780
|
+
// @ts-ignore
|
|
781
|
+
let eventProperties = {};
|
|
782
|
+
eventProperties["Cli Invoked by Ci"] = properties.cliInvokedByCi;
|
|
783
|
+
eventProperties["Schema Id"] = properties.schemaId;
|
|
784
|
+
if (properties.schemaName !== undefined && properties.schemaName !== null) {
|
|
785
|
+
eventProperties["Schema Name"] = properties.schemaName;
|
|
786
|
+
}
|
|
787
|
+
eventProperties["Branch Id"] = properties.branchId;
|
|
788
|
+
eventProperties["Branch Name"] = properties.branchName;
|
|
789
|
+
eventProperties["Client"] = sysClient;
|
|
790
|
+
eventProperties["Version"] = sysVersion;
|
|
791
|
+
// @ts-ignore
|
|
792
|
+
let userProperties = {};
|
|
1006
793
|
if (!__AVO_NOOP__) {
|
|
1007
|
-
|
|
794
|
+
return Promise.all([
|
|
795
|
+
// report to Avo Inspector
|
|
796
|
+
__INSPECTOR__ != null
|
|
797
|
+
// @ts-ignore
|
|
798
|
+
? __INSPECTOR__._avoFunctionTrackSchemaFromEvent("Cli Conflict Resolve Failed", {
|
|
799
|
+
"Cli Invoked by Ci": properties.cliInvokedByCi,
|
|
800
|
+
"Schema Id": properties.schemaId,
|
|
801
|
+
"Schema Name": properties.schemaName,
|
|
802
|
+
"Branch Id": properties.branchId,
|
|
803
|
+
"Branch Name": properties.branchName,
|
|
804
|
+
"Client": sysClient,
|
|
805
|
+
"Version": sysVersion,
|
|
806
|
+
}, "4ZhoijIA2U", "403808c3d3db8ed1d0a2298ac0c684fa8fcdc16c816f7bd878f136647aff8c00")
|
|
807
|
+
: Promise.resolve(),
|
|
808
|
+
// destination CustomNodeJS
|
|
809
|
+
CustomNodeJS.logEvent(properties.userId_, "Cli Conflict Resolve Failed", Object.assign({}, eventProperties)),
|
|
810
|
+
]);
|
|
1008
811
|
}
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
"Schema Id": properties.schemaId,
|
|
1013
|
-
"Schema Name": properties.schemaName,
|
|
1014
|
-
"Branch Id": properties.branchId,
|
|
1015
|
-
"Branch Name": properties.branchName,
|
|
1016
|
-
"Client": sysClient,
|
|
1017
|
-
"Version": sysVersion,
|
|
1018
|
-
}, {}, {});
|
|
1019
|
-
if (__AVO_DEV__ && (__STRICT__ === null || __STRICT__)) {
|
|
1020
|
-
// throw exception if messages is not empty
|
|
1021
|
-
if (messages.length !== 0) {
|
|
1022
|
-
throw new Error("Error sending event 'Cli Conflict Resolve Failed': " + messages[0].message)
|
|
1023
|
-
}
|
|
1024
|
-
} else {
|
|
1025
|
-
messages.forEach(function(m) {
|
|
1026
|
-
console[__REPORT_FAILURE_AS__ || 'error']("[avo] " + m.message);
|
|
1027
|
-
});
|
|
812
|
+
else {
|
|
813
|
+
// do nothing
|
|
814
|
+
return new Promise((resolve) => { resolve(null); });
|
|
1028
815
|
}
|
|
1029
|
-
}
|
|
1030
|
-
|
|
1031
|
-
if (!__AVO_NOOP__) {
|
|
1032
|
-
return Promise.all([
|
|
1033
|
-
// report to Avo Inspector
|
|
1034
|
-
__INSPECTOR__ != null ? __INSPECTOR__._avoFunctionTrackSchemaFromEvent("Cli Conflict Resolve Failed", {
|
|
1035
|
-
"Cli Invoked by Ci": properties.cliInvokedByCi,
|
|
1036
|
-
"Schema Id": properties.schemaId,
|
|
1037
|
-
"Schema Name": properties.schemaName,
|
|
1038
|
-
"Branch Id": properties.branchId,
|
|
1039
|
-
"Branch Name": properties.branchName,
|
|
1040
|
-
"Client": sysClient,
|
|
1041
|
-
"Version": sysVersion,
|
|
1042
|
-
}, "4ZhoijIA2U", "67b876f2a00dbd0b854836a8adfca0084118e427ce3332a428dbfc563dab8bc0")
|
|
1043
|
-
: Promise.resolve(),
|
|
1044
|
-
// destination CustomNodeJS
|
|
1045
|
-
CustomNodeJS.logEvent(properties.userId_, "Cli Conflict Resolve Failed", {
|
|
1046
|
-
"Cli Invoked by Ci": properties.cliInvokedByCi,
|
|
1047
|
-
"Schema Id": properties.schemaId,
|
|
1048
|
-
"Schema Name": properties.schemaName,
|
|
1049
|
-
"Branch Id": properties.branchId,
|
|
1050
|
-
"Branch Name": properties.branchName,
|
|
1051
|
-
"Client": sysClient,
|
|
1052
|
-
"Version": sysVersion,
|
|
1053
|
-
}),
|
|
1054
|
-
]);
|
|
1055
|
-
} else {
|
|
1056
|
-
// do nothing
|
|
1057
|
-
return new Promise((resolve) => { resolve(null); });
|
|
1058
|
-
}
|
|
1059
816
|
}
|
|
1060
|
-
|
|
1061
817
|
/**
|
|
1062
818
|
* Cli Conflict Resolve Succeeded: No description
|
|
1063
819
|
*
|
|
1064
|
-
* @param
|
|
1065
|
-
* @param
|
|
1066
|
-
* @param
|
|
1067
|
-
* @param
|
|
1068
|
-
* @param
|
|
1069
|
-
* @param
|
|
1070
|
-
* @param
|
|
820
|
+
* @param properties the properties associatied with this event
|
|
821
|
+
* @param properties.userId_: User Id is required for server sources.
|
|
822
|
+
* @param properties.cliInvokedByCi: True iff process.env.CI is set.
|
|
823
|
+
* @param properties.schemaId: The ID of the schema that this event is related to.
|
|
824
|
+
* @param properties.schemaName: Name of the schema that this event is related to.
|
|
825
|
+
* @param properties.branchId: The ID of the branch that this event is related to.
|
|
826
|
+
* @param properties.branchName: The name of the branch that this event is related to.
|
|
1071
827
|
*
|
|
1072
828
|
* @see {@link https://www.avo.app/schemas/fwtXqAc0fCLy7b7oGW40/events/yj_554q43i}
|
|
1073
829
|
*/
|
|
1074
830
|
export function cliConflictResolveSucceeded(properties) {
|
|
1075
|
-
properties = properties || {};
|
|
1076
|
-
if (__AVO_DEV__) {
|
|
1077
831
|
// assert properties
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
832
|
+
if (__AVO_ENV__ !== AvoEnv.Prod) {
|
|
833
|
+
let messages = [];
|
|
834
|
+
// debug console in Avo
|
|
835
|
+
if (!__AVO_NOOP__) {
|
|
836
|
+
_avo_invoke(__AVO_ENV__, "yj_554q43i", "a4a180d66deeb76b91d67098746764905c5b37c201019c26da254a8358110f9f", messages.map(m => Object.assign({}, { tag: m.tag, propertyId: m.propertyId, additionalProperties: m.additionalProperties, actualType: m.actualType })), 'event');
|
|
837
|
+
}
|
|
838
|
+
InternalAvoLogger.logEventSent("Cli Conflict Resolve Succeeded", {
|
|
839
|
+
"Cli Invoked by Ci": properties.cliInvokedByCi,
|
|
840
|
+
"Schema Id": properties.schemaId,
|
|
841
|
+
"Schema Name": properties.schemaName,
|
|
842
|
+
"Branch Id": properties.branchId,
|
|
843
|
+
"Branch Name": properties.branchName,
|
|
844
|
+
"Client": sysClient,
|
|
845
|
+
"Version": sysVersion,
|
|
846
|
+
}, {});
|
|
847
|
+
}
|
|
848
|
+
// @ts-ignore
|
|
849
|
+
let eventProperties = {};
|
|
850
|
+
eventProperties["Cli Invoked by Ci"] = properties.cliInvokedByCi;
|
|
851
|
+
eventProperties["Schema Id"] = properties.schemaId;
|
|
852
|
+
if (properties.schemaName !== undefined && properties.schemaName !== null) {
|
|
853
|
+
eventProperties["Schema Name"] = properties.schemaName;
|
|
854
|
+
}
|
|
855
|
+
eventProperties["Branch Id"] = properties.branchId;
|
|
856
|
+
eventProperties["Branch Name"] = properties.branchName;
|
|
857
|
+
eventProperties["Client"] = sysClient;
|
|
858
|
+
eventProperties["Version"] = sysVersion;
|
|
859
|
+
// @ts-ignore
|
|
860
|
+
let userProperties = {};
|
|
1096
861
|
if (!__AVO_NOOP__) {
|
|
1097
|
-
|
|
862
|
+
return Promise.all([
|
|
863
|
+
// report to Avo Inspector
|
|
864
|
+
__INSPECTOR__ != null
|
|
865
|
+
// @ts-ignore
|
|
866
|
+
? __INSPECTOR__._avoFunctionTrackSchemaFromEvent("Cli Conflict Resolve Succeeded", {
|
|
867
|
+
"Cli Invoked by Ci": properties.cliInvokedByCi,
|
|
868
|
+
"Schema Id": properties.schemaId,
|
|
869
|
+
"Schema Name": properties.schemaName,
|
|
870
|
+
"Branch Id": properties.branchId,
|
|
871
|
+
"Branch Name": properties.branchName,
|
|
872
|
+
"Client": sysClient,
|
|
873
|
+
"Version": sysVersion,
|
|
874
|
+
}, "yj_554q43i", "a4a180d66deeb76b91d67098746764905c5b37c201019c26da254a8358110f9f")
|
|
875
|
+
: Promise.resolve(),
|
|
876
|
+
// destination CustomNodeJS
|
|
877
|
+
CustomNodeJS.logEvent(properties.userId_, "Cli Conflict Resolve Succeeded", Object.assign({}, eventProperties)),
|
|
878
|
+
]);
|
|
1098
879
|
}
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
"Schema Id": properties.schemaId,
|
|
1103
|
-
"Schema Name": properties.schemaName,
|
|
1104
|
-
"Branch Id": properties.branchId,
|
|
1105
|
-
"Branch Name": properties.branchName,
|
|
1106
|
-
"Client": sysClient,
|
|
1107
|
-
"Version": sysVersion,
|
|
1108
|
-
}, {}, {});
|
|
1109
|
-
if (__AVO_DEV__ && (__STRICT__ === null || __STRICT__)) {
|
|
1110
|
-
// throw exception if messages is not empty
|
|
1111
|
-
if (messages.length !== 0) {
|
|
1112
|
-
throw new Error("Error sending event 'Cli Conflict Resolve Succeeded': " + messages[0].message)
|
|
1113
|
-
}
|
|
1114
|
-
} else {
|
|
1115
|
-
messages.forEach(function(m) {
|
|
1116
|
-
console[__REPORT_FAILURE_AS__ || 'error']("[avo] " + m.message);
|
|
1117
|
-
});
|
|
880
|
+
else {
|
|
881
|
+
// do nothing
|
|
882
|
+
return new Promise((resolve) => { resolve(null); });
|
|
1118
883
|
}
|
|
1119
|
-
}
|
|
1120
|
-
|
|
1121
|
-
if (!__AVO_NOOP__) {
|
|
1122
|
-
return Promise.all([
|
|
1123
|
-
// report to Avo Inspector
|
|
1124
|
-
__INSPECTOR__ != null ? __INSPECTOR__._avoFunctionTrackSchemaFromEvent("Cli Conflict Resolve Succeeded", {
|
|
1125
|
-
"Cli Invoked by Ci": properties.cliInvokedByCi,
|
|
1126
|
-
"Schema Id": properties.schemaId,
|
|
1127
|
-
"Schema Name": properties.schemaName,
|
|
1128
|
-
"Branch Id": properties.branchId,
|
|
1129
|
-
"Branch Name": properties.branchName,
|
|
1130
|
-
"Client": sysClient,
|
|
1131
|
-
"Version": sysVersion,
|
|
1132
|
-
}, "yj_554q43i", "15ed68a02ce2178bd8be746d338dcec50f4e325069f03df6e5c164376fcb9c1f")
|
|
1133
|
-
: Promise.resolve(),
|
|
1134
|
-
// destination CustomNodeJS
|
|
1135
|
-
CustomNodeJS.logEvent(properties.userId_, "Cli Conflict Resolve Succeeded", {
|
|
1136
|
-
"Cli Invoked by Ci": properties.cliInvokedByCi,
|
|
1137
|
-
"Schema Id": properties.schemaId,
|
|
1138
|
-
"Schema Name": properties.schemaName,
|
|
1139
|
-
"Branch Id": properties.branchId,
|
|
1140
|
-
"Branch Name": properties.branchName,
|
|
1141
|
-
"Client": sysClient,
|
|
1142
|
-
"Version": sysVersion,
|
|
1143
|
-
}),
|
|
1144
|
-
]);
|
|
1145
|
-
} else {
|
|
1146
|
-
// do nothing
|
|
1147
|
-
return new Promise((resolve) => { resolve(null); });
|
|
1148
|
-
}
|
|
1149
884
|
}
|
|
1150
|
-
|
|
1151
885
|
export default {
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
}
|
|
1168
|
-
|
|
886
|
+
AvoEnv,
|
|
887
|
+
initAvo,
|
|
888
|
+
setSystemProperties,
|
|
889
|
+
avoInspectorApiKey,
|
|
890
|
+
SignInError,
|
|
891
|
+
Client,
|
|
892
|
+
AuthenticationMethod,
|
|
893
|
+
CliAction,
|
|
894
|
+
signedIn,
|
|
895
|
+
signInFailed,
|
|
896
|
+
cliInvoked,
|
|
897
|
+
cliInstalled,
|
|
898
|
+
cliConflictResolveAttempted,
|
|
899
|
+
cliConflictResolveFailed,
|
|
900
|
+
cliConflictResolveSucceeded,
|
|
901
|
+
};
|
|
1169
902
|
// AVOMODULEMAP:"Avo"
|
|
1170
903
|
// AVOEVENTMAP:["signedIn","signInFailed","cliInvoked","cliInstalled","cliConflictResolveAttempted","cliConflictResolveFailed","cliConflictResolveSucceeded"]
|