@hot-updater/plugin-insights 1.0.0-rc.29 → 1.0.0-rc.30
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/server/contract.cjs +24 -3
- package/dist/server/contract.mjs +24 -3
- package/dist/server/index.cjs +28 -1
- package/dist/server/index.d.cts +66 -2
- package/dist/server/index.d.mts +66 -2
- package/dist/server/index.mjs +29 -2
- package/dist/server/model.cjs +2 -1
- package/dist/server/model.mjs +2 -1
- package/dist/server/modelTypes.d.cts +32 -2
- package/dist/server/modelTypes.d.mts +32 -2
- package/dist/server/reads.cjs +55 -6
- package/dist/server/reads.mjs +55 -7
- package/dist/server/recordEvent.cjs +50 -4
- package/dist/server/recordEvent.mjs +50 -4
- package/dist/server/schema.cjs +67 -0
- package/dist/server/schema.d.cts +124 -0
- package/dist/server/schema.d.mts +124 -0
- package/dist/server/schema.mjs +67 -0
- package/package.json +2 -2
package/dist/server/schema.d.mts
CHANGED
|
@@ -263,6 +263,68 @@ declare const createInsightsSchema: ({ rawDays, dailyDays }?: InsightsRetention)
|
|
|
263
263
|
readonly sort: readonly ["bucket_start_ms"];
|
|
264
264
|
};
|
|
265
265
|
}, never, readonly ["channel", "platform", "app_version", "release_id", "bucket_start_ms"]>;
|
|
266
|
+
readonly bundle_daily_heads: import("@hot-updater/plugin-core").TableDefinition<{
|
|
267
|
+
readonly install_id: {
|
|
268
|
+
readonly type: "string";
|
|
269
|
+
readonly maxLength: 255;
|
|
270
|
+
};
|
|
271
|
+
readonly bucket_start_ms: {
|
|
272
|
+
readonly type: "integer";
|
|
273
|
+
};
|
|
274
|
+
readonly id: {
|
|
275
|
+
readonly type: "string";
|
|
276
|
+
readonly maxLength: 36;
|
|
277
|
+
};
|
|
278
|
+
readonly received_at_ms: {
|
|
279
|
+
readonly type: "integer";
|
|
280
|
+
};
|
|
281
|
+
readonly channel: {
|
|
282
|
+
readonly type: "string";
|
|
283
|
+
};
|
|
284
|
+
readonly platform: {
|
|
285
|
+
readonly type: "string";
|
|
286
|
+
readonly maxLength: 16;
|
|
287
|
+
};
|
|
288
|
+
readonly app_version: {
|
|
289
|
+
readonly type: "string";
|
|
290
|
+
};
|
|
291
|
+
readonly release_id: {
|
|
292
|
+
readonly type: "string";
|
|
293
|
+
readonly maxLength: 36;
|
|
294
|
+
};
|
|
295
|
+
readonly bundle_kind: {
|
|
296
|
+
readonly type: "string";
|
|
297
|
+
readonly maxLength: 16;
|
|
298
|
+
};
|
|
299
|
+
}, Readonly<Record<string, import("@hot-updater/plugin-core").FieldType>>, {}, readonly ["install_id", "bucket_start_ms"]>;
|
|
300
|
+
readonly insights_distribution_history: import("@hot-updater/plugin-core").AggregateDefinition<{
|
|
301
|
+
readonly channel: {
|
|
302
|
+
readonly type: "string";
|
|
303
|
+
};
|
|
304
|
+
readonly platform: {
|
|
305
|
+
readonly type: "string";
|
|
306
|
+
readonly maxLength: 16;
|
|
307
|
+
};
|
|
308
|
+
readonly app_version: {
|
|
309
|
+
readonly type: "string";
|
|
310
|
+
};
|
|
311
|
+
readonly release_id: {
|
|
312
|
+
readonly type: "string";
|
|
313
|
+
readonly maxLength: 36;
|
|
314
|
+
};
|
|
315
|
+
readonly bundle_kind: {
|
|
316
|
+
readonly type: "string";
|
|
317
|
+
readonly maxLength: 16;
|
|
318
|
+
};
|
|
319
|
+
readonly bucket_start_ms: {
|
|
320
|
+
readonly type: "integer";
|
|
321
|
+
};
|
|
322
|
+
}, "installations", {
|
|
323
|
+
readonly byScope: {
|
|
324
|
+
readonly eq: readonly ["channel", "platform"];
|
|
325
|
+
readonly sort: readonly ["bucket_start_ms"];
|
|
326
|
+
};
|
|
327
|
+
}, never, readonly ["channel", "platform", "app_version", "release_id", "bundle_kind", "bucket_start_ms"]>;
|
|
266
328
|
readonly insights_latest_by_bundle: import("@hot-updater/plugin-core").AggregateDefinition<{
|
|
267
329
|
readonly platform: {
|
|
268
330
|
readonly type: "string";
|
|
@@ -602,6 +664,68 @@ declare const insightsSchema: {
|
|
|
602
664
|
readonly sort: readonly ["bucket_start_ms"];
|
|
603
665
|
};
|
|
604
666
|
}, never, readonly ["channel", "platform", "app_version", "release_id", "bucket_start_ms"]>;
|
|
667
|
+
readonly bundle_daily_heads: import("@hot-updater/plugin-core").TableDefinition<{
|
|
668
|
+
readonly install_id: {
|
|
669
|
+
readonly type: "string";
|
|
670
|
+
readonly maxLength: 255;
|
|
671
|
+
};
|
|
672
|
+
readonly bucket_start_ms: {
|
|
673
|
+
readonly type: "integer";
|
|
674
|
+
};
|
|
675
|
+
readonly id: {
|
|
676
|
+
readonly type: "string";
|
|
677
|
+
readonly maxLength: 36;
|
|
678
|
+
};
|
|
679
|
+
readonly received_at_ms: {
|
|
680
|
+
readonly type: "integer";
|
|
681
|
+
};
|
|
682
|
+
readonly channel: {
|
|
683
|
+
readonly type: "string";
|
|
684
|
+
};
|
|
685
|
+
readonly platform: {
|
|
686
|
+
readonly type: "string";
|
|
687
|
+
readonly maxLength: 16;
|
|
688
|
+
};
|
|
689
|
+
readonly app_version: {
|
|
690
|
+
readonly type: "string";
|
|
691
|
+
};
|
|
692
|
+
readonly release_id: {
|
|
693
|
+
readonly type: "string";
|
|
694
|
+
readonly maxLength: 36;
|
|
695
|
+
};
|
|
696
|
+
readonly bundle_kind: {
|
|
697
|
+
readonly type: "string";
|
|
698
|
+
readonly maxLength: 16;
|
|
699
|
+
};
|
|
700
|
+
}, Readonly<Record<string, import("@hot-updater/plugin-core").FieldType>>, {}, readonly ["install_id", "bucket_start_ms"]>;
|
|
701
|
+
readonly insights_distribution_history: import("@hot-updater/plugin-core").AggregateDefinition<{
|
|
702
|
+
readonly channel: {
|
|
703
|
+
readonly type: "string";
|
|
704
|
+
};
|
|
705
|
+
readonly platform: {
|
|
706
|
+
readonly type: "string";
|
|
707
|
+
readonly maxLength: 16;
|
|
708
|
+
};
|
|
709
|
+
readonly app_version: {
|
|
710
|
+
readonly type: "string";
|
|
711
|
+
};
|
|
712
|
+
readonly release_id: {
|
|
713
|
+
readonly type: "string";
|
|
714
|
+
readonly maxLength: 36;
|
|
715
|
+
};
|
|
716
|
+
readonly bundle_kind: {
|
|
717
|
+
readonly type: "string";
|
|
718
|
+
readonly maxLength: 16;
|
|
719
|
+
};
|
|
720
|
+
readonly bucket_start_ms: {
|
|
721
|
+
readonly type: "integer";
|
|
722
|
+
};
|
|
723
|
+
}, "installations", {
|
|
724
|
+
readonly byScope: {
|
|
725
|
+
readonly eq: readonly ["channel", "platform"];
|
|
726
|
+
readonly sort: readonly ["bucket_start_ms"];
|
|
727
|
+
};
|
|
728
|
+
}, never, readonly ["channel", "platform", "app_version", "release_id", "bundle_kind", "bucket_start_ms"]>;
|
|
605
729
|
readonly insights_latest_by_bundle: import("@hot-updater/plugin-core").AggregateDefinition<{
|
|
606
730
|
readonly platform: {
|
|
607
731
|
readonly type: "string";
|
package/dist/server/schema.mjs
CHANGED
|
@@ -354,6 +354,71 @@ const insightsDistribution = (retention) => defineAggregate({
|
|
|
354
354
|
},
|
|
355
355
|
retention
|
|
356
356
|
});
|
|
357
|
+
/** The last running bundle observed per installation and UTC day. */
|
|
358
|
+
const bundleDailyHeads = (retention) => defineTable({
|
|
359
|
+
install_id: {
|
|
360
|
+
type: "string",
|
|
361
|
+
maxLength: 255
|
|
362
|
+
},
|
|
363
|
+
bucket_start_ms: { type: "integer" },
|
|
364
|
+
id: {
|
|
365
|
+
type: "string",
|
|
366
|
+
maxLength: 36
|
|
367
|
+
},
|
|
368
|
+
received_at_ms: { type: "integer" },
|
|
369
|
+
channel: { type: "string" },
|
|
370
|
+
platform: {
|
|
371
|
+
type: "string",
|
|
372
|
+
maxLength: 16
|
|
373
|
+
},
|
|
374
|
+
app_version: { type: "string" },
|
|
375
|
+
release_id: {
|
|
376
|
+
type: "string",
|
|
377
|
+
maxLength: 36
|
|
378
|
+
},
|
|
379
|
+
bundle_kind: {
|
|
380
|
+
type: "string",
|
|
381
|
+
maxLength: 16
|
|
382
|
+
}
|
|
383
|
+
}, {
|
|
384
|
+
key: ["install_id", "bucket_start_ms"],
|
|
385
|
+
retention
|
|
386
|
+
});
|
|
387
|
+
/** Daily observations stay in their day when an installation reports again. */
|
|
388
|
+
const insightsDistributionHistory = (retention) => defineAggregate({
|
|
389
|
+
channel: { type: "string" },
|
|
390
|
+
platform: {
|
|
391
|
+
type: "string",
|
|
392
|
+
maxLength: 16
|
|
393
|
+
},
|
|
394
|
+
app_version: { type: "string" },
|
|
395
|
+
release_id: {
|
|
396
|
+
type: "string",
|
|
397
|
+
maxLength: 36
|
|
398
|
+
},
|
|
399
|
+
bundle_kind: {
|
|
400
|
+
type: "string",
|
|
401
|
+
maxLength: 16
|
|
402
|
+
},
|
|
403
|
+
bucket_start_ms: { type: "integer" }
|
|
404
|
+
}, {
|
|
405
|
+
key: [
|
|
406
|
+
"channel",
|
|
407
|
+
"platform",
|
|
408
|
+
"app_version",
|
|
409
|
+
"release_id",
|
|
410
|
+
"bundle_kind",
|
|
411
|
+
"bucket_start_ms"
|
|
412
|
+
],
|
|
413
|
+
gauges: ["installations"],
|
|
414
|
+
shards: GAUGE_SHARDS,
|
|
415
|
+
batched: true,
|
|
416
|
+
indexes: { byScope: {
|
|
417
|
+
eq: ["channel", "platform"],
|
|
418
|
+
sort: ["bucket_start_ms"]
|
|
419
|
+
} },
|
|
420
|
+
retention
|
|
421
|
+
});
|
|
357
422
|
/** Latest events by the bundle they came from or went to, bucketed like the distribution. */
|
|
358
423
|
const insightsLatestByBundle = (retention) => defineAggregate({
|
|
359
424
|
platform: {
|
|
@@ -473,6 +538,8 @@ const createInsightsSchema = ({ rawDays, dailyDays } = DEFAULT_INSIGHTS_RETENTIO
|
|
|
473
538
|
insights_overview_lifetime: counters(),
|
|
474
539
|
insights_sketches_lifetime: lifetimeSketches(),
|
|
475
540
|
insights_distribution: insightsDistribution(daily),
|
|
541
|
+
bundle_daily_heads: bundleDailyHeads(daily),
|
|
542
|
+
insights_distribution_history: insightsDistributionHistory(daily),
|
|
476
543
|
insights_latest_by_bundle: insightsLatestByBundle(daily),
|
|
477
544
|
insights_outcomes: insightsOutcomes(hourly),
|
|
478
545
|
insights_failures: insightsFailures(hourly)
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hot-updater/plugin-insights",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.0-rc.
|
|
4
|
+
"version": "1.0.0-rc.30",
|
|
5
5
|
"description": "Hot Updater's Insights plugin: launch, download, and update failure events, for the server and the React Native app",
|
|
6
6
|
"exports": {
|
|
7
7
|
"./client": {
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"@types/node": "^20",
|
|
48
48
|
"vitest": "4.1.4",
|
|
49
49
|
"@hot-updater/plugin-core": "1.0.0-rc.28",
|
|
50
|
-
"@hot-updater/test-utils": "1.0.0-rc.
|
|
50
|
+
"@hot-updater/test-utils": "1.0.0-rc.29"
|
|
51
51
|
},
|
|
52
52
|
"nx": {
|
|
53
53
|
"implicitDependencies": [
|