@mirafive/protocol 2.0.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +124 -113
- package/dist/index.js +123 -112
- package/dist/index.js.map +3 -3
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -163,124 +163,135 @@ var properties = (value, path, issues) => {
|
|
|
163
163
|
issues.push({ path, message: `at most ${LIMITS.propertyKeys} properties per event` });
|
|
164
164
|
}
|
|
165
165
|
};
|
|
166
|
-
var
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
166
|
+
var built;
|
|
167
|
+
function rules() {
|
|
168
|
+
if (built)
|
|
169
|
+
return built;
|
|
170
|
+
const short = string({ max: LIMITS.stringLength });
|
|
171
|
+
const url = string({ max: LIMITS.urlLength });
|
|
172
|
+
const size = integer(0, 20000);
|
|
173
|
+
const context = object({
|
|
174
|
+
page: object({ url, referrer: url, title: short }),
|
|
175
|
+
app: object({ name: short, version: short, build: short, namespace: short }),
|
|
176
|
+
device: object({
|
|
177
|
+
type: oneOf(["desktop", "mobile", "tablet", "tv", "other"]),
|
|
178
|
+
manufacturer: short,
|
|
179
|
+
model: short
|
|
180
|
+
}),
|
|
181
|
+
os: object({ name: short, version: short }),
|
|
182
|
+
screen: object({ width: size, height: size, density: number({ positive: true, max: 10 }) }),
|
|
183
|
+
viewport: object({ width: size, height: size }),
|
|
184
|
+
locale: string({ max: 35 }),
|
|
185
|
+
languages: (value, path, issues) => {
|
|
186
|
+
if (!Array.isArray(value)) {
|
|
187
|
+
issues.push({ path, message: "expected a list" });
|
|
188
|
+
return;
|
|
189
|
+
}
|
|
190
|
+
if (value.length > 10)
|
|
191
|
+
issues.push({ path, message: "at most 10 languages" });
|
|
192
|
+
value.forEach((entry, index) => string({ max: 35 })(entry, join(path, index), issues));
|
|
193
|
+
},
|
|
194
|
+
timezone: string({ max: 64 }),
|
|
195
|
+
location: object({
|
|
196
|
+
latitude: number({ min: -90, max: 90 }),
|
|
197
|
+
longitude: number({ min: -180, max: 180 })
|
|
198
|
+
}, ["latitude", "longitude"]),
|
|
199
|
+
library: object({ name: string({ max: 50 }), version: string({ max: 30 }) }, [
|
|
200
|
+
"name",
|
|
201
|
+
"version"
|
|
202
|
+
]),
|
|
203
|
+
ip: string({ max: 45 }),
|
|
204
|
+
user_agent: string({ max: 1024 })
|
|
205
|
+
});
|
|
206
|
+
const consentState = oneOf(consentStates);
|
|
207
|
+
const consent = (value, path, issues) => {
|
|
208
|
+
if (value === "not_applicable")
|
|
184
209
|
return;
|
|
210
|
+
if (!isObject(value)) {
|
|
211
|
+
{
|
|
212
|
+
issues.push({ path, message: 'expected { analytics, marketing } or "not_applicable"' });
|
|
213
|
+
return;
|
|
214
|
+
}
|
|
185
215
|
}
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
216
|
+
object({ analytics: consentState, marketing: consentState }, ["analytics"])(value, path, issues);
|
|
217
|
+
};
|
|
218
|
+
const minor = integer(-1000000000000000, 1000000000000000);
|
|
219
|
+
const id = string({ max: LIMITS.idLength });
|
|
220
|
+
const revenue = object({
|
|
221
|
+
amount: minor,
|
|
222
|
+
currency: string({ min: 3, max: 3, hint: "an ISO 4217 code" }),
|
|
223
|
+
entry_id: id,
|
|
224
|
+
kind: oneOf(revenueKinds),
|
|
225
|
+
fee: minor,
|
|
226
|
+
tax: minor,
|
|
227
|
+
refund_of: id,
|
|
228
|
+
product: id,
|
|
229
|
+
subscription: object({
|
|
230
|
+
id: string({ min: 1, max: LIMITS.idLength }),
|
|
231
|
+
interval: oneOf(billingIntervals),
|
|
232
|
+
interval_count: integer(1, 36),
|
|
233
|
+
period_start: dateTime,
|
|
234
|
+
period_end: dateTime
|
|
235
|
+
}, ["id"])
|
|
236
|
+
}, ["amount", "currency"]);
|
|
237
|
+
const externalIds = (value, path, issues) => {
|
|
238
|
+
if (!isObject(value)) {
|
|
239
|
+
issues.push({ path, message: "expected an object" });
|
|
206
240
|
return;
|
|
207
241
|
}
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
kind: oneOf(revenueKinds),
|
|
218
|
-
fee: minor,
|
|
219
|
-
tax: minor,
|
|
220
|
-
refund_of: id,
|
|
221
|
-
product: id,
|
|
222
|
-
subscription: object({
|
|
223
|
-
id: string({ min: 1, max: LIMITS.idLength }),
|
|
224
|
-
interval: oneOf(billingIntervals),
|
|
225
|
-
interval_count: integer(1, 36),
|
|
226
|
-
period_start: dateTime,
|
|
227
|
-
period_end: dateTime
|
|
228
|
-
}, ["id"])
|
|
229
|
-
}, ["amount", "currency"]);
|
|
230
|
-
var externalIds = (value, path, issues) => {
|
|
231
|
-
if (!isObject(value)) {
|
|
232
|
-
issues.push({ path, message: "expected an object" });
|
|
233
|
-
return;
|
|
234
|
-
}
|
|
235
|
-
for (const [key, item] of Object.entries(value)) {
|
|
236
|
-
if (!externalIdTypes.includes(key)) {
|
|
237
|
-
issues.push({
|
|
238
|
-
path: join(path, key),
|
|
239
|
-
message: `expected one of ${externalIdTypes.join(", ")}`
|
|
240
|
-
});
|
|
241
|
-
} else if (item !== undefined) {
|
|
242
|
-
string({ min: 1, max: LIMITS.idLength })(item, join(path, key), issues);
|
|
242
|
+
for (const [key, item] of Object.entries(value)) {
|
|
243
|
+
if (!externalIdTypes.includes(key)) {
|
|
244
|
+
issues.push({
|
|
245
|
+
path: join(path, key),
|
|
246
|
+
message: `expected one of ${externalIdTypes.join(", ")}`
|
|
247
|
+
});
|
|
248
|
+
} else if (item !== undefined) {
|
|
249
|
+
string({ min: 1, max: LIMITS.idLength })(item, join(path, key), issues);
|
|
250
|
+
}
|
|
243
251
|
}
|
|
244
|
-
}
|
|
245
|
-
};
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
252
|
+
};
|
|
253
|
+
const text = string({ max: 200, trim: true });
|
|
254
|
+
const touchpoint = object({
|
|
255
|
+
kind: oneOf(touchpointKinds),
|
|
256
|
+
channel: oneOf(touchpointChannels),
|
|
257
|
+
source: text,
|
|
258
|
+
medium: text,
|
|
259
|
+
campaign: text,
|
|
260
|
+
content: text,
|
|
261
|
+
campaign_id: text,
|
|
262
|
+
ad_group_id: text,
|
|
263
|
+
ad_id: text,
|
|
264
|
+
code: text,
|
|
265
|
+
answer: string({ max: 500, trim: true }),
|
|
266
|
+
external_ref: text
|
|
267
|
+
}, ["kind"]);
|
|
268
|
+
const event = object({
|
|
269
|
+
event_id: string({ max: 36, pattern: UUID, hint: "expected a UUID" }),
|
|
270
|
+
type: oneOf(["track", "page", "screen", "identify", "group"]),
|
|
271
|
+
event: string({
|
|
272
|
+
min: 1,
|
|
273
|
+
max: LIMITS.nameLength,
|
|
274
|
+
pattern: /^\P{Cc}+$/u,
|
|
275
|
+
hint: "no control characters"
|
|
276
|
+
}),
|
|
277
|
+
timestamp: dateTime,
|
|
278
|
+
anonymous_id: id,
|
|
279
|
+
user_id: id,
|
|
280
|
+
session_id: id,
|
|
281
|
+
group_id: id,
|
|
282
|
+
properties,
|
|
283
|
+
traits: properties,
|
|
284
|
+
external_ids: externalIds,
|
|
285
|
+
revenue,
|
|
286
|
+
context,
|
|
287
|
+
consent
|
|
288
|
+
}, ["event_id", "type", "event"]);
|
|
289
|
+
built = { event, touchpoint };
|
|
290
|
+
return built;
|
|
291
|
+
}
|
|
282
292
|
function validateEvent(value, path = "") {
|
|
283
293
|
const issues = [];
|
|
294
|
+
const { event, touchpoint } = rules();
|
|
284
295
|
event(value, path, issues);
|
|
285
296
|
if (isObject(value) && value.event === "$touchpoint") {
|
|
286
297
|
if (value.type !== "track") {
|
|
@@ -323,10 +334,10 @@ function validateBatch(value) {
|
|
|
323
334
|
|
|
324
335
|
// src/cli.ts
|
|
325
336
|
var file = process.argv[2];
|
|
326
|
-
var
|
|
337
|
+
var text = readFileSync(file && file !== "-" ? file : 0, "utf8");
|
|
327
338
|
var input;
|
|
328
339
|
try {
|
|
329
|
-
input = JSON.parse(
|
|
340
|
+
input = JSON.parse(text);
|
|
330
341
|
} catch (error) {
|
|
331
342
|
console.error(`✗ not JSON: ${String(error)}`);
|
|
332
343
|
process.exit(1);
|
package/dist/index.js
CHANGED
|
@@ -307,124 +307,135 @@ var properties = (value, path, issues) => {
|
|
|
307
307
|
issues.push({ path, message: `at most ${LIMITS.propertyKeys} properties per event` });
|
|
308
308
|
}
|
|
309
309
|
};
|
|
310
|
-
var
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
310
|
+
var built;
|
|
311
|
+
function rules() {
|
|
312
|
+
if (built)
|
|
313
|
+
return built;
|
|
314
|
+
const short = string({ max: LIMITS.stringLength });
|
|
315
|
+
const url = string({ max: LIMITS.urlLength });
|
|
316
|
+
const size = integer(0, 20000);
|
|
317
|
+
const context = object({
|
|
318
|
+
page: object({ url, referrer: url, title: short }),
|
|
319
|
+
app: object({ name: short, version: short, build: short, namespace: short }),
|
|
320
|
+
device: object({
|
|
321
|
+
type: oneOf(["desktop", "mobile", "tablet", "tv", "other"]),
|
|
322
|
+
manufacturer: short,
|
|
323
|
+
model: short
|
|
324
|
+
}),
|
|
325
|
+
os: object({ name: short, version: short }),
|
|
326
|
+
screen: object({ width: size, height: size, density: number({ positive: true, max: 10 }) }),
|
|
327
|
+
viewport: object({ width: size, height: size }),
|
|
328
|
+
locale: string({ max: 35 }),
|
|
329
|
+
languages: (value, path, issues) => {
|
|
330
|
+
if (!Array.isArray(value)) {
|
|
331
|
+
issues.push({ path, message: "expected a list" });
|
|
332
|
+
return;
|
|
333
|
+
}
|
|
334
|
+
if (value.length > 10)
|
|
335
|
+
issues.push({ path, message: "at most 10 languages" });
|
|
336
|
+
value.forEach((entry, index) => string({ max: 35 })(entry, join(path, index), issues));
|
|
337
|
+
},
|
|
338
|
+
timezone: string({ max: 64 }),
|
|
339
|
+
location: object({
|
|
340
|
+
latitude: number({ min: -90, max: 90 }),
|
|
341
|
+
longitude: number({ min: -180, max: 180 })
|
|
342
|
+
}, ["latitude", "longitude"]),
|
|
343
|
+
library: object({ name: string({ max: 50 }), version: string({ max: 30 }) }, [
|
|
344
|
+
"name",
|
|
345
|
+
"version"
|
|
346
|
+
]),
|
|
347
|
+
ip: string({ max: 45 }),
|
|
348
|
+
user_agent: string({ max: 1024 })
|
|
349
|
+
});
|
|
350
|
+
const consentState = oneOf(consentStates);
|
|
351
|
+
const consent = (value, path, issues) => {
|
|
352
|
+
if (value === "not_applicable")
|
|
328
353
|
return;
|
|
354
|
+
if (!isObject(value)) {
|
|
355
|
+
{
|
|
356
|
+
issues.push({ path, message: 'expected { analytics, marketing } or "not_applicable"' });
|
|
357
|
+
return;
|
|
358
|
+
}
|
|
329
359
|
}
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
360
|
+
object({ analytics: consentState, marketing: consentState }, ["analytics"])(value, path, issues);
|
|
361
|
+
};
|
|
362
|
+
const minor = integer(-1000000000000000, 1000000000000000);
|
|
363
|
+
const id = string({ max: LIMITS.idLength });
|
|
364
|
+
const revenue = object({
|
|
365
|
+
amount: minor,
|
|
366
|
+
currency: string({ min: 3, max: 3, hint: "an ISO 4217 code" }),
|
|
367
|
+
entry_id: id,
|
|
368
|
+
kind: oneOf(revenueKinds),
|
|
369
|
+
fee: minor,
|
|
370
|
+
tax: minor,
|
|
371
|
+
refund_of: id,
|
|
372
|
+
product: id,
|
|
373
|
+
subscription: object({
|
|
374
|
+
id: string({ min: 1, max: LIMITS.idLength }),
|
|
375
|
+
interval: oneOf(billingIntervals),
|
|
376
|
+
interval_count: integer(1, 36),
|
|
377
|
+
period_start: dateTime,
|
|
378
|
+
period_end: dateTime
|
|
379
|
+
}, ["id"])
|
|
380
|
+
}, ["amount", "currency"]);
|
|
381
|
+
const externalIds = (value, path, issues) => {
|
|
382
|
+
if (!isObject(value)) {
|
|
383
|
+
issues.push({ path, message: "expected an object" });
|
|
350
384
|
return;
|
|
351
385
|
}
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
kind: oneOf(revenueKinds),
|
|
362
|
-
fee: minor,
|
|
363
|
-
tax: minor,
|
|
364
|
-
refund_of: id,
|
|
365
|
-
product: id,
|
|
366
|
-
subscription: object({
|
|
367
|
-
id: string({ min: 1, max: LIMITS.idLength }),
|
|
368
|
-
interval: oneOf(billingIntervals),
|
|
369
|
-
interval_count: integer(1, 36),
|
|
370
|
-
period_start: dateTime,
|
|
371
|
-
period_end: dateTime
|
|
372
|
-
}, ["id"])
|
|
373
|
-
}, ["amount", "currency"]);
|
|
374
|
-
var externalIds = (value, path, issues) => {
|
|
375
|
-
if (!isObject(value)) {
|
|
376
|
-
issues.push({ path, message: "expected an object" });
|
|
377
|
-
return;
|
|
378
|
-
}
|
|
379
|
-
for (const [key, item] of Object.entries(value)) {
|
|
380
|
-
if (!externalIdTypes.includes(key)) {
|
|
381
|
-
issues.push({
|
|
382
|
-
path: join(path, key),
|
|
383
|
-
message: `expected one of ${externalIdTypes.join(", ")}`
|
|
384
|
-
});
|
|
385
|
-
} else if (item !== undefined) {
|
|
386
|
-
string({ min: 1, max: LIMITS.idLength })(item, join(path, key), issues);
|
|
386
|
+
for (const [key, item] of Object.entries(value)) {
|
|
387
|
+
if (!externalIdTypes.includes(key)) {
|
|
388
|
+
issues.push({
|
|
389
|
+
path: join(path, key),
|
|
390
|
+
message: `expected one of ${externalIdTypes.join(", ")}`
|
|
391
|
+
});
|
|
392
|
+
} else if (item !== undefined) {
|
|
393
|
+
string({ min: 1, max: LIMITS.idLength })(item, join(path, key), issues);
|
|
394
|
+
}
|
|
387
395
|
}
|
|
388
|
-
}
|
|
389
|
-
};
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
396
|
+
};
|
|
397
|
+
const text = string({ max: 200, trim: true });
|
|
398
|
+
const touchpoint = object({
|
|
399
|
+
kind: oneOf(touchpointKinds),
|
|
400
|
+
channel: oneOf(touchpointChannels),
|
|
401
|
+
source: text,
|
|
402
|
+
medium: text,
|
|
403
|
+
campaign: text,
|
|
404
|
+
content: text,
|
|
405
|
+
campaign_id: text,
|
|
406
|
+
ad_group_id: text,
|
|
407
|
+
ad_id: text,
|
|
408
|
+
code: text,
|
|
409
|
+
answer: string({ max: 500, trim: true }),
|
|
410
|
+
external_ref: text
|
|
411
|
+
}, ["kind"]);
|
|
412
|
+
const event = object({
|
|
413
|
+
event_id: string({ max: 36, pattern: UUID2, hint: "expected a UUID" }),
|
|
414
|
+
type: oneOf(["track", "page", "screen", "identify", "group"]),
|
|
415
|
+
event: string({
|
|
416
|
+
min: 1,
|
|
417
|
+
max: LIMITS.nameLength,
|
|
418
|
+
pattern: /^\P{Cc}+$/u,
|
|
419
|
+
hint: "no control characters"
|
|
420
|
+
}),
|
|
421
|
+
timestamp: dateTime,
|
|
422
|
+
anonymous_id: id,
|
|
423
|
+
user_id: id,
|
|
424
|
+
session_id: id,
|
|
425
|
+
group_id: id,
|
|
426
|
+
properties,
|
|
427
|
+
traits: properties,
|
|
428
|
+
external_ids: externalIds,
|
|
429
|
+
revenue,
|
|
430
|
+
context,
|
|
431
|
+
consent
|
|
432
|
+
}, ["event_id", "type", "event"]);
|
|
433
|
+
built = { event, touchpoint };
|
|
434
|
+
return built;
|
|
435
|
+
}
|
|
426
436
|
function validateEvent(value, path = "") {
|
|
427
437
|
const issues = [];
|
|
438
|
+
const { event, touchpoint } = rules();
|
|
428
439
|
event(value, path, issues);
|
|
429
440
|
if (isObject(value) && value.event === "$touchpoint") {
|
|
430
441
|
if (value.type !== "track") {
|
|
@@ -492,5 +503,5 @@ export {
|
|
|
492
503
|
validateEvent
|
|
493
504
|
};
|
|
494
505
|
|
|
495
|
-
//# debugId=
|
|
506
|
+
//# debugId=6A5A5FC5BEA339E164756E2164756E21
|
|
496
507
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
"import type { Consent, ConsentState } from \"./wire\";\n\n/** What callers may pass for one purpose: a plain boolean from a custom banner, or a wire state. */\nexport type ConsentInput = boolean | ConsentState | undefined;\n\n/** `true` → granted, `false` → denied, nothing → unknown. */\nexport const consentState = (value: ConsentInput): ConsentState =>\n value === true ? \"granted\" : value === false ? \"denied\" : (value ?? \"unknown\");\n\n/** Consent for an event from booleans or states; `not_applicable` passes through. */\nexport function toConsent(\n input: \"not_applicable\" | { analytics: ConsentInput; marketing?: ConsentInput } | undefined,\n fallback: Consent = \"not_applicable\",\n): Consent {\n if (input === undefined) return fallback;\n if (input === \"not_applicable\") return input;\n return { analytics: consentState(input.analytics), marketing: consentState(input.marketing) };\n}\n\n/**\n * Which kind of key this is. Public keys (`mira_pk_…`) belong in browsers and apps; secret keys\n * (`mira_sk_…`) only on servers, because they may send revenue and backfills.\n */\nexport function keyKind(key: string | undefined): \"public\" | \"secret\" | \"unknown\" {\n if (!key) return \"unknown\";\n if (key.startsWith(\"mira_pk_\")) return \"public\";\n if (key.startsWith(\"mira_sk_\")) return \"secret\";\n return \"unknown\";\n}\n\n/** Strips trailing slashes, so `host + \"/v1/batch\"` is always one URL. */\nexport const trimHost = (host: string) => host.replace(/\\/+$/, \"\");\n\n/** Answers worth retrying: timeouts, rate limits and server errors. Other 4xx are final. */\nexport const retryable = (status: number) => status === 408 || status === 429 || status >= 500;\n\n/**\n * Exponential backoff with full jitter, capped, but never sooner than the server asked\n * (`Retry-After`, in milliseconds).\n */\nexport function backoffMs(attempt: number, atLeastMs = 0, baseMs = 500, capMs = 30_000) {\n const ceiling = Math.min(capMs, baseMs * 2 ** attempt);\n return Math.max(atLeastMs, Math.random() * ceiling);\n}\n\n/** `Retry-After` in milliseconds: seconds or an HTTP date. 0 when absent or unreadable. */\nexport function retryAfterMs(header: string | null, now = Date.now()): number {\n if (!header) return 0;\n const seconds = Number(header);\n if (Number.isFinite(seconds)) return Math.max(0, seconds * 1000);\n const at = Date.parse(header);\n return Number.isNaN(at) ? 0 : Math.max(0, at - now);\n}\n\nconst UUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;\n\n/** A UUID of version 1 to 8 in the RFC 9562 variant, as the ingest accepts for `event_id`. */\nexport const isUuid = (value: string) => UUID.test(value);\n\n/**\n * A stable event id from your own key, such as `order:123:paid`. The same key always gives the\n * same UUID, in every MIRA FIVE SDK and language, so a retried job, a backfill run twice, or the\n * browser and the server reporting one conversion all count once.\n * Format: UUIDv8 (RFC 9562) from the first 122 bits of SHA-256.\n */\nexport async function eventIdFor(key: string): Promise<string> {\n const digest = new Uint8Array(\n await crypto.subtle.digest(\"SHA-256\", new TextEncoder().encode(key)),\n );\n digest[6] = (digest[6]! & 0x0f) | 0x80;\n digest[8] = (digest[8]! & 0x3f) | 0x80;\n const hex = Array.from(digest.subarray(0, 16), (byte) => byte.toString(16).padStart(2, \"0\")).join(\n \"\",\n );\n return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(12, 16)}-${hex.slice(16, 20)}-${hex.slice(20)}`;\n}\n",
|
|
7
7
|
"import { externalIdTypes, LIMITS, type ExternalIds, type Properties } from \"./wire\";\n\nconst MAX_KEYS = LIMITS.propertyKeys;\nconst MAX_STRING = LIMITS.stringLength;\nconst MAX_KEY = LIMITS.propertyKeyLength;\nconst MAX_ARRAY = LIMITS.arrayLength;\nconst MAX_DEPTH = 3;\n\ntype Scalar = string | number | boolean | null;\n\nfunction scalar(value: unknown): Scalar | undefined {\n if (value === null || typeof value === \"boolean\") return value;\n if (typeof value === \"string\") return value.slice(0, MAX_STRING);\n if (typeof value === \"number\") return Number.isFinite(value) ? value : null;\n if (typeof value === \"bigint\") return value.toString();\n if (value instanceof Date) return Number.isNaN(value.getTime()) ? null : value.toISOString();\n return undefined;\n}\n\n/**\n * Turns whatever the caller passes into properties the ingest accepts: nested objects are\n * flattened to dot keys (`plan.name`), dates become ISO strings, functions and `undefined` are\n * dropped, and every limit is applied here. The ingest validates each event on its own and\n * rejects the whole event on a violation, so trimming here keeps the rest of the data.\n */\nexport function cleanProperties(input: unknown): Properties {\n const output: Properties = {};\n let count = 0;\n\n const walk = (value: unknown, prefix: string, depth: number) => {\n if (!value || typeof value !== \"object\" || value instanceof Date) return;\n for (const [rawKey, item] of Object.entries(value)) {\n if (count >= MAX_KEYS) return;\n const key = (prefix ? `${prefix}.${rawKey}` : rawKey).slice(0, MAX_KEY);\n if (!key) continue;\n if (Array.isArray(item)) {\n const list = item\n .map(scalar)\n .filter(\n (entry): entry is string | number | boolean => entry !== undefined && entry !== null,\n );\n output[key] = list.slice(0, MAX_ARRAY);\n count += 1;\n continue;\n }\n const flat = scalar(item);\n if (flat !== undefined) {\n output[key] = flat;\n count += 1;\n } else if (item && typeof item === \"object\" && depth < MAX_DEPTH) {\n walk(item, key, depth + 1);\n }\n }\n };\n\n walk(input, \"\", 0);\n return output;\n}\n\n/**\n * Known types with usable values only; `undefined` when nothing is left. An id is never cut\n * short: a truncated id would link the money to the wrong person, so an overlong one is dropped.\n */\nexport function cleanExternalIds(input: unknown): ExternalIds | undefined {\n if (!input || typeof input !== \"object\") return undefined;\n const ids: ExternalIds = {};\n let found = false;\n for (const type of externalIdTypes) {\n const value: unknown = Reflect.get(input, type);\n if (typeof value === \"string\" && value.trim() && value.length <= LIMITS.idLength) {\n ids[type] = value;\n found = true;\n }\n }\n return found ? ids : undefined;\n}\n",
|
|
8
8
|
"/**\n * UUIDv7 (RFC 9562): 48 bits of Unix milliseconds, then randomness. Ids sort by creation time,\n * which keeps ClickHouse inserts local and makes a retried batch easy to recognise.\n *\n * Monotonic within one page or process: when two ids fall into the same millisecond, the 12-bit `rand_a`\n * field is used as a counter (RFC 9562, section 6.2, method 1), so ids made in a loop still sort\n * in the order they were made. If the counter overflows, the timestamp is moved forward by 1 ms.\n */\nlet lastMs = 0;\nlet counter = 0;\n\nconst hex = (bytes: Uint8Array) =>\n Array.from(bytes, (byte) => byte.toString(16).padStart(2, \"0\")).join(\"\");\n\nexport function uuidv7(now: number = Date.now()): string {\n const bytes = new Uint8Array(16);\n crypto.getRandomValues(bytes);\n\n if (now > lastMs) {\n lastMs = now;\n // Start each millisecond at a random point in the lower half, so there is room to count up.\n counter = ((bytes[6]! & 0x07) << 8) | bytes[7]!;\n } else {\n counter += 1;\n if (counter > 0xfff) {\n lastMs += 1;\n counter = 0;\n }\n }\n\n // 48-bit timestamp, big-endian. Division instead of bit shifts: shifts are 32-bit in JavaScript.\n let ms = lastMs;\n for (let index = 5; index >= 0; index -= 1) {\n bytes[index] = ms % 256;\n ms = Math.floor(ms / 256);\n }\n bytes[6] = 0x70 | (counter >> 8);\n bytes[7] = counter & 0xff;\n bytes[8] = (bytes[8]! & 0x3f) | 0x80;\n\n const value = hex(bytes);\n return `${value.slice(0, 8)}-${value.slice(8, 12)}-${value.slice(12, 16)}-${value.slice(16, 20)}-${value.slice(20)}`;\n}\n",
|
|
9
|
-
"/**\n * Validates events and batches exactly as the MIRA FIVE ingest does, without dependencies. For\n * SDK test suites, for integrations in other languages (`mirafive-validate`, see `cli.ts`), and\n * for checking an event before sending it.\n *\n * The rules mirror the ingest's own schema; the MIRA FIVE monorepo runs the same inputs through\n * both on every build and fails when they disagree.\n */\nimport {\n billingIntervals,\n consentStates,\n externalIdTypes,\n LIMITS,\n revenueKinds,\n touchpointChannels,\n touchpointKinds,\n} from \"./wire\";\n\n/** One problem: where (`events.0.revenue.amount`) and what. */\nexport interface Issue {\n path: string;\n message: string;\n}\n\ntype Check = (value: unknown, path: string, issues: Issue[]) => void;\n\nconst isObject = (value: unknown): value is Record<string, unknown> =>\n typeof value === \"object\" && value !== null && !Array.isArray(value);\n\nconst join = (path: string, key: string | number) => (path ? `${path}.${key}` : String(key));\n\nconst UUID =\n /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;\nconst DATETIME =\n /^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2})(?:\\.\\d+)?(?:Z|([+-])(\\d{2}):(\\d{2}))$/;\n\n/** ISO 8601 date and time with `Z` or an offset, as the ingest accepts it. */\nexport function isDateTime(value: string): boolean {\n const match = DATETIME.exec(value);\n if (!match) return false;\n const [, year, month, day, hour, minute, second, , offsetHour, offsetMinute] = match;\n const days = new Date(Date.UTC(Number(year), Number(month), 0)).getUTCDate();\n return (\n Number(month) >= 1 &&\n Number(month) <= 12 &&\n Number(day) >= 1 &&\n Number(day) <= days &&\n Number(hour) <= 23 &&\n Number(minute) <= 59 &&\n Number(second) <= 59 &&\n (offsetHour === undefined || (Number(offsetHour) <= 23 && Number(offsetMinute) <= 59))\n );\n}\n\nconst string =\n (options: {\n min?: number;\n max: number;\n trim?: boolean;\n pattern?: RegExp;\n hint?: string;\n }): Check =>\n (value, path, issues) => {\n if (typeof value !== \"string\") {\n issues.push({ path, message: \"expected a string\" });\n return;\n }\n const text = options.trim ? value.trim() : value;\n if (options.min !== undefined && text.length < options.min) {\n issues.push({ path, message: `at least ${options.min} character(s)` });\n } else if (text.length > options.max) {\n issues.push({ path, message: `at most ${options.max} characters` });\n }\n if (options.pattern && !options.pattern.test(text)) {\n issues.push({ path, message: options.hint ?? \"invalid format\" });\n }\n };\n\nconst dateTime: Check = (value, path, issues) => {\n if (typeof value !== \"string\" || !isDateTime(value)) {\n issues.push({ path, message: \"expected an ISO 8601 date and time with Z or an offset\" });\n }\n};\n\nconst oneOf =\n (values: readonly string[]): Check =>\n (value, path, issues) => {\n if (typeof value !== \"string\" || !values.includes(value)) {\n issues.push({ path, message: `expected one of ${values.join(\", \")}` });\n }\n };\n\nconst integer =\n (min: number, max: number): Check =>\n (value, path, issues) => {\n if (typeof value !== \"number\" || !Number.isInteger(value)) {\n {\n issues.push({ path, message: \"expected an integer\" });\n return;\n }\n }\n if (value < min || value > max) issues.push({ path, message: `expected ${min} to ${max}` });\n };\n\nconst number =\n (options: { min?: number; max?: number; positive?: boolean; int?: boolean }): Check =>\n (value, path, issues) => {\n if (typeof value !== \"number\" || !Number.isFinite(value)) {\n {\n issues.push({ path, message: \"expected a number\" });\n return;\n }\n }\n if (options.int && !Number.isInteger(value))\n issues.push({ path, message: \"expected an integer\" });\n if (options.positive && value <= 0)\n issues.push({ path, message: \"expected a positive number\" });\n if (options.min !== undefined && value < options.min) {\n issues.push({ path, message: `at least ${options.min}` });\n }\n if (options.max !== undefined && value > options.max) {\n issues.push({ path, message: `at most ${options.max}` });\n }\n };\n\n/** An object with optional fields; unknown fields are allowed (the ingest ignores them). */\nconst object =\n (fields: Record<string, Check>, required: string[] = []): Check =>\n (value, path, issues) => {\n if (!isObject(value)) {\n issues.push({ path, message: \"expected an object\" });\n return;\n }\n for (const [key, check] of Object.entries(fields)) {\n if (value[key] === undefined) {\n if (required.includes(key)) issues.push({ path: join(path, key), message: \"required\" });\n continue;\n }\n check(value[key], join(path, key), issues);\n }\n };\n\nconst scalar = (value: unknown) =>\n typeof value === \"boolean\" ||\n (typeof value === \"number\" && Number.isFinite(value)) ||\n (typeof value === \"string\" && value.length <= LIMITS.stringLength);\n\nconst properties: Check = (value, path, issues) => {\n if (!isObject(value)) {\n issues.push({ path, message: \"expected an object\" });\n return;\n }\n const keys = Object.keys(value);\n for (const key of keys) {\n const at = join(path, key);\n if (key.length < 1 || key.length > LIMITS.propertyKeyLength) {\n issues.push({ path: at, message: `keys have 1 to ${LIMITS.propertyKeyLength} characters` });\n }\n const item = value[key];\n if (item === null || scalar(item)) continue;\n if (Array.isArray(item)) {\n if (item.length > LIMITS.arrayLength) {\n issues.push({ path: at, message: `at most ${LIMITS.arrayLength} items` });\n }\n item.forEach((entry, index) => {\n if (!scalar(entry)) {\n issues.push({ path: join(at, index), message: \"expected a string, number or boolean\" });\n }\n });\n continue;\n }\n issues.push({\n path: at,\n message:\n typeof item === \"string\"\n ? `at most ${LIMITS.stringLength} characters`\n : \"expected a string, number, boolean, null or a list of them (nested objects are flattened by the SDKs)\",\n });\n }\n if (keys.length > LIMITS.propertyKeys) {\n issues.push({ path, message: `at most ${LIMITS.propertyKeys} properties per event` });\n }\n};\n\nconst short = string({ max: LIMITS.stringLength });\nconst url = string({ max: LIMITS.urlLength });\nconst size = integer(0, 20_000);\n\nconst context = object({\n page: object({ url, referrer: url, title: short }),\n app: object({ name: short, version: short, build: short, namespace: short }),\n device: object({\n type: oneOf([\"desktop\", \"mobile\", \"tablet\", \"tv\", \"other\"]),\n manufacturer: short,\n model: short,\n }),\n os: object({ name: short, version: short }),\n screen: object({ width: size, height: size, density: number({ positive: true, max: 10 }) }),\n viewport: object({ width: size, height: size }),\n locale: string({ max: 35 }),\n languages: (value, path, issues) => {\n if (!Array.isArray(value)) {\n issues.push({ path, message: \"expected a list\" });\n return;\n }\n if (value.length > 10) issues.push({ path, message: \"at most 10 languages\" });\n value.forEach((entry, index) => string({ max: 35 })(entry, join(path, index), issues));\n },\n timezone: string({ max: 64 }),\n location: object(\n {\n latitude: number({ min: -90, max: 90 }),\n longitude: number({ min: -180, max: 180 }),\n },\n [\"latitude\", \"longitude\"],\n ),\n library: object({ name: string({ max: 50 }), version: string({ max: 30 }) }, [\"name\", \"version\"]),\n ip: string({ max: 45 }),\n user_agent: string({ max: 1024 }),\n});\n\nconst consentState = oneOf(consentStates);\nconst consent: Check = (value, path, issues) => {\n if (value === \"not_applicable\") return;\n if (!isObject(value)) {\n {\n issues.push({ path, message: 'expected { analytics, marketing } or \"not_applicable\"' });\n return;\n }\n }\n object({ analytics: consentState, marketing: consentState }, [\"analytics\"])(value, path, issues);\n};\n\nconst minor = integer(-1e15, 1e15);\nconst id = string({ max: LIMITS.idLength });\nconst revenue = object(\n {\n amount: minor,\n currency: string({ min: 3, max: 3, hint: \"an ISO 4217 code\" }),\n entry_id: id,\n kind: oneOf(revenueKinds),\n fee: minor,\n tax: minor,\n refund_of: id,\n product: id,\n subscription: object(\n {\n id: string({ min: 1, max: LIMITS.idLength }),\n interval: oneOf(billingIntervals),\n interval_count: integer(1, 36),\n period_start: dateTime,\n period_end: dateTime,\n },\n [\"id\"],\n ),\n },\n [\"amount\", \"currency\"],\n);\n\nconst externalIds: Check = (value, path, issues) => {\n if (!isObject(value)) {\n issues.push({ path, message: \"expected an object\" });\n return;\n }\n for (const [key, item] of Object.entries(value)) {\n if (!(externalIdTypes as readonly string[]).includes(key)) {\n issues.push({\n path: join(path, key),\n message: `expected one of ${externalIdTypes.join(\", \")}`,\n });\n } else if (item !== undefined) {\n string({ min: 1, max: LIMITS.idLength })(item, join(path, key), issues);\n }\n }\n};\n\nconst text = string({ max: 200, trim: true });\nconst touchpoint = object(\n {\n kind: oneOf(touchpointKinds),\n channel: oneOf(touchpointChannels),\n source: text,\n medium: text,\n campaign: text,\n content: text,\n campaign_id: text,\n ad_group_id: text,\n ad_id: text,\n code: text,\n answer: string({ max: 500, trim: true }),\n external_ref: text,\n },\n [\"kind\"],\n);\n\nconst event = object(\n {\n event_id: string({ max: 36, pattern: UUID, hint: \"expected a UUID\" }),\n type: oneOf([\"track\", \"page\", \"screen\", \"identify\", \"group\"]),\n event: string({\n min: 1,\n max: LIMITS.nameLength,\n pattern: /^\\P{Cc}+$/u,\n hint: \"no control characters\",\n }),\n timestamp: dateTime,\n anonymous_id: id,\n user_id: id,\n session_id: id,\n group_id: id,\n properties,\n traits: properties,\n external_ids: externalIds,\n revenue,\n context,\n consent,\n },\n [\"event_id\", \"type\", \"event\"],\n);\n\n/** Every problem the ingest would reject this event for; an empty list means it is accepted. */\nexport function validateEvent(value: unknown, path = \"\"): Issue[] {\n const issues: Issue[] = [];\n event(value, path, issues);\n if (isObject(value) && value.event === \"$touchpoint\") {\n if (value.type !== \"track\") {\n issues.push({ path: join(path, \"type\"), message: \"$touchpoint is a track event\" });\n }\n const props = isObject(value.properties) ? value.properties : {};\n const before = issues.length;\n touchpoint(props, join(path, \"properties\"), issues);\n const source = typeof props.source === \"string\" ? props.source.trim() : \"\";\n if (issues.length === before && !props.channel && !source) {\n issues.push({\n path: join(path, \"properties.source\"),\n message: \"a touchpoint needs a channel or a source\",\n });\n }\n }\n return issues;\n}\n\n/**\n * Problems with the batch envelope (key, sent_at, stream, seq, 1 to 100 events) and with each\n * event. The ingest rejects a bad envelope as a whole and a bad event on its own.\n */\nexport function validateBatch(value: unknown): Issue[] {\n const issues: Issue[] = [];\n object({\n key: string({ max: 100 }),\n sent_at: dateTime,\n stream: string({ min: 1, max: 64 }),\n seq: integer(1, 2_147_483_647),\n })(value, \"\", issues);\n if (!isObject(value)) return issues;\n const events = value.events;\n if (!Array.isArray(events)) {\n issues.push({ path: \"events\", message: \"expected a list of events\" });\n return issues;\n }\n if (events.length < 1 || events.length > LIMITS.eventsPerBatch) {\n issues.push({ path: \"events\", message: `1 to ${LIMITS.eventsPerBatch} events per batch` });\n }\n events.forEach((item, index) => issues.push(...validateEvent(item, join(\"events\", index))));\n return issues;\n}\n"
|
|
9
|
+
"/**\n * Validates events and batches exactly as the MIRA FIVE ingest does, without dependencies. For\n * SDK test suites, for integrations in other languages (`mirafive-validate`, see `cli.ts`), and\n * for checking an event before sending it.\n *\n * The rules mirror the ingest's own schema; the MIRA FIVE monorepo runs the same inputs through\n * both on every build and fails when they disagree.\n */\nimport {\n billingIntervals,\n consentStates,\n externalIdTypes,\n LIMITS,\n revenueKinds,\n touchpointChannels,\n touchpointKinds,\n} from \"./wire\";\n\n/** One problem: where (`events.0.revenue.amount`) and what. */\nexport interface Issue {\n path: string;\n message: string;\n}\n\ntype Check = (value: unknown, path: string, issues: Issue[]) => void;\n\nconst isObject = (value: unknown): value is Record<string, unknown> =>\n typeof value === \"object\" && value !== null && !Array.isArray(value);\n\nconst join = (path: string, key: string | number) => (path ? `${path}.${key}` : String(key));\n\nconst UUID =\n /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;\nconst DATETIME =\n /^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2})(?:\\.\\d+)?(?:Z|([+-])(\\d{2}):(\\d{2}))$/;\n\n/** ISO 8601 date and time with `Z` or an offset, as the ingest accepts it. */\nexport function isDateTime(value: string): boolean {\n const match = DATETIME.exec(value);\n if (!match) return false;\n const [, year, month, day, hour, minute, second, , offsetHour, offsetMinute] = match;\n const days = new Date(Date.UTC(Number(year), Number(month), 0)).getUTCDate();\n return (\n Number(month) >= 1 &&\n Number(month) <= 12 &&\n Number(day) >= 1 &&\n Number(day) <= days &&\n Number(hour) <= 23 &&\n Number(minute) <= 59 &&\n Number(second) <= 59 &&\n (offsetHour === undefined || (Number(offsetHour) <= 23 && Number(offsetMinute) <= 59))\n );\n}\n\nconst string =\n (options: {\n min?: number;\n max: number;\n trim?: boolean;\n pattern?: RegExp;\n hint?: string;\n }): Check =>\n (value, path, issues) => {\n if (typeof value !== \"string\") {\n issues.push({ path, message: \"expected a string\" });\n return;\n }\n const text = options.trim ? value.trim() : value;\n if (options.min !== undefined && text.length < options.min) {\n issues.push({ path, message: `at least ${options.min} character(s)` });\n } else if (text.length > options.max) {\n issues.push({ path, message: `at most ${options.max} characters` });\n }\n if (options.pattern && !options.pattern.test(text)) {\n issues.push({ path, message: options.hint ?? \"invalid format\" });\n }\n };\n\nconst dateTime: Check = (value, path, issues) => {\n if (typeof value !== \"string\" || !isDateTime(value)) {\n issues.push({ path, message: \"expected an ISO 8601 date and time with Z or an offset\" });\n }\n};\n\nconst oneOf =\n (values: readonly string[]): Check =>\n (value, path, issues) => {\n if (typeof value !== \"string\" || !values.includes(value)) {\n issues.push({ path, message: `expected one of ${values.join(\", \")}` });\n }\n };\n\nconst integer =\n (min: number, max: number): Check =>\n (value, path, issues) => {\n if (typeof value !== \"number\" || !Number.isInteger(value)) {\n {\n issues.push({ path, message: \"expected an integer\" });\n return;\n }\n }\n if (value < min || value > max) issues.push({ path, message: `expected ${min} to ${max}` });\n };\n\nconst number =\n (options: { min?: number; max?: number; positive?: boolean; int?: boolean }): Check =>\n (value, path, issues) => {\n if (typeof value !== \"number\" || !Number.isFinite(value)) {\n {\n issues.push({ path, message: \"expected a number\" });\n return;\n }\n }\n if (options.int && !Number.isInteger(value))\n issues.push({ path, message: \"expected an integer\" });\n if (options.positive && value <= 0)\n issues.push({ path, message: \"expected a positive number\" });\n if (options.min !== undefined && value < options.min) {\n issues.push({ path, message: `at least ${options.min}` });\n }\n if (options.max !== undefined && value > options.max) {\n issues.push({ path, message: `at most ${options.max}` });\n }\n };\n\n/** An object with optional fields; unknown fields are allowed (the ingest ignores them). */\nconst object =\n (fields: Record<string, Check>, required: string[] = []): Check =>\n (value, path, issues) => {\n if (!isObject(value)) {\n issues.push({ path, message: \"expected an object\" });\n return;\n }\n for (const [key, check] of Object.entries(fields)) {\n if (value[key] === undefined) {\n if (required.includes(key)) issues.push({ path: join(path, key), message: \"required\" });\n continue;\n }\n check(value[key], join(path, key), issues);\n }\n };\n\nconst scalar = (value: unknown) =>\n typeof value === \"boolean\" ||\n (typeof value === \"number\" && Number.isFinite(value)) ||\n (typeof value === \"string\" && value.length <= LIMITS.stringLength);\n\nconst properties: Check = (value, path, issues) => {\n if (!isObject(value)) {\n issues.push({ path, message: \"expected an object\" });\n return;\n }\n const keys = Object.keys(value);\n for (const key of keys) {\n const at = join(path, key);\n if (key.length < 1 || key.length > LIMITS.propertyKeyLength) {\n issues.push({ path: at, message: `keys have 1 to ${LIMITS.propertyKeyLength} characters` });\n }\n const item = value[key];\n if (item === null || scalar(item)) continue;\n if (Array.isArray(item)) {\n if (item.length > LIMITS.arrayLength) {\n issues.push({ path: at, message: `at most ${LIMITS.arrayLength} items` });\n }\n item.forEach((entry, index) => {\n if (!scalar(entry)) {\n issues.push({ path: join(at, index), message: \"expected a string, number or boolean\" });\n }\n });\n continue;\n }\n issues.push({\n path: at,\n message:\n typeof item === \"string\"\n ? `at most ${LIMITS.stringLength} characters`\n : \"expected a string, number, boolean, null or a list of them (nested objects are flattened by the SDKs)\",\n });\n }\n if (keys.length > LIMITS.propertyKeys) {\n issues.push({ path, message: `at most ${LIMITS.propertyKeys} properties per event` });\n }\n};\n\n/**\n * The rules, built on first use: nothing runs when the module loads, so bundlers drop the\n * validator from apps that never call it (the browser SDK's script tag, for one).\n */\nlet built: { event: Check; touchpoint: Check } | undefined;\nfunction rules() {\n if (built) return built;\n const short = string({ max: LIMITS.stringLength });\n const url = string({ max: LIMITS.urlLength });\n const size = integer(0, 20_000);\n\n const context = object({\n page: object({ url, referrer: url, title: short }),\n app: object({ name: short, version: short, build: short, namespace: short }),\n device: object({\n type: oneOf([\"desktop\", \"mobile\", \"tablet\", \"tv\", \"other\"]),\n manufacturer: short,\n model: short,\n }),\n os: object({ name: short, version: short }),\n screen: object({ width: size, height: size, density: number({ positive: true, max: 10 }) }),\n viewport: object({ width: size, height: size }),\n locale: string({ max: 35 }),\n languages: (value, path, issues) => {\n if (!Array.isArray(value)) {\n issues.push({ path, message: \"expected a list\" });\n return;\n }\n if (value.length > 10) issues.push({ path, message: \"at most 10 languages\" });\n value.forEach((entry, index) => string({ max: 35 })(entry, join(path, index), issues));\n },\n timezone: string({ max: 64 }),\n location: object(\n {\n latitude: number({ min: -90, max: 90 }),\n longitude: number({ min: -180, max: 180 }),\n },\n [\"latitude\", \"longitude\"],\n ),\n library: object({ name: string({ max: 50 }), version: string({ max: 30 }) }, [\n \"name\",\n \"version\",\n ]),\n ip: string({ max: 45 }),\n user_agent: string({ max: 1024 }),\n });\n\n const consentState = oneOf(consentStates);\n const consent: Check = (value, path, issues) => {\n if (value === \"not_applicable\") return;\n if (!isObject(value)) {\n {\n issues.push({ path, message: 'expected { analytics, marketing } or \"not_applicable\"' });\n return;\n }\n }\n object({ analytics: consentState, marketing: consentState }, [\"analytics\"])(\n value,\n path,\n issues,\n );\n };\n\n const minor = integer(-1e15, 1e15);\n const id = string({ max: LIMITS.idLength });\n const revenue = object(\n {\n amount: minor,\n currency: string({ min: 3, max: 3, hint: \"an ISO 4217 code\" }),\n entry_id: id,\n kind: oneOf(revenueKinds),\n fee: minor,\n tax: minor,\n refund_of: id,\n product: id,\n subscription: object(\n {\n id: string({ min: 1, max: LIMITS.idLength }),\n interval: oneOf(billingIntervals),\n interval_count: integer(1, 36),\n period_start: dateTime,\n period_end: dateTime,\n },\n [\"id\"],\n ),\n },\n [\"amount\", \"currency\"],\n );\n\n const externalIds: Check = (value, path, issues) => {\n if (!isObject(value)) {\n issues.push({ path, message: \"expected an object\" });\n return;\n }\n for (const [key, item] of Object.entries(value)) {\n if (!(externalIdTypes as readonly string[]).includes(key)) {\n issues.push({\n path: join(path, key),\n message: `expected one of ${externalIdTypes.join(\", \")}`,\n });\n } else if (item !== undefined) {\n string({ min: 1, max: LIMITS.idLength })(item, join(path, key), issues);\n }\n }\n };\n\n const text = string({ max: 200, trim: true });\n const touchpoint = object(\n {\n kind: oneOf(touchpointKinds),\n channel: oneOf(touchpointChannels),\n source: text,\n medium: text,\n campaign: text,\n content: text,\n campaign_id: text,\n ad_group_id: text,\n ad_id: text,\n code: text,\n answer: string({ max: 500, trim: true }),\n external_ref: text,\n },\n [\"kind\"],\n );\n\n const event = object(\n {\n event_id: string({ max: 36, pattern: UUID, hint: \"expected a UUID\" }),\n type: oneOf([\"track\", \"page\", \"screen\", \"identify\", \"group\"]),\n event: string({\n min: 1,\n max: LIMITS.nameLength,\n pattern: /^\\P{Cc}+$/u,\n hint: \"no control characters\",\n }),\n timestamp: dateTime,\n anonymous_id: id,\n user_id: id,\n session_id: id,\n group_id: id,\n properties,\n traits: properties,\n external_ids: externalIds,\n revenue,\n context,\n consent,\n },\n [\"event_id\", \"type\", \"event\"],\n );\n\n built = { event, touchpoint };\n return built;\n}\n\n/** Every problem the ingest would reject this event for; an empty list means it is accepted. */\nexport function validateEvent(value: unknown, path = \"\"): Issue[] {\n const issues: Issue[] = [];\n const { event, touchpoint } = rules();\n event(value, path, issues);\n if (isObject(value) && value.event === \"$touchpoint\") {\n if (value.type !== \"track\") {\n issues.push({ path: join(path, \"type\"), message: \"$touchpoint is a track event\" });\n }\n const props = isObject(value.properties) ? value.properties : {};\n const before = issues.length;\n touchpoint(props, join(path, \"properties\"), issues);\n const source = typeof props.source === \"string\" ? props.source.trim() : \"\";\n if (issues.length === before && !props.channel && !source) {\n issues.push({\n path: join(path, \"properties.source\"),\n message: \"a touchpoint needs a channel or a source\",\n });\n }\n }\n return issues;\n}\n\n/**\n * Problems with the batch envelope (key, sent_at, stream, seq, 1 to 100 events) and with each\n * event. The ingest rejects a bad envelope as a whole and a bad event on its own.\n */\nexport function validateBatch(value: unknown): Issue[] {\n const issues: Issue[] = [];\n object({\n key: string({ max: 100 }),\n sent_at: dateTime,\n stream: string({ min: 1, max: 64 }),\n seq: integer(1, 2_147_483_647),\n })(value, \"\", issues);\n if (!isObject(value)) return issues;\n const events = value.events;\n if (!Array.isArray(events)) {\n issues.push({ path: \"events\", message: \"expected a list of events\" });\n return issues;\n }\n if (events.length < 1 || events.length > LIMITS.eventsPerBatch) {\n issues.push({ path: \"events\", message: `1 to ${LIMITS.eventsPerBatch} events per batch` });\n }\n events.forEach((item, index) => issues.push(...validateEvent(item, join(\"events\", index))));\n return issues;\n}\n"
|
|
10
10
|
],
|
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