@hot-updater/plugin-insights 1.0.0-rc.30 → 1.0.0-rc.32
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 +13 -32
- package/dist/server/contract.mjs +13 -32
- package/dist/server/index.cjs +3 -29
- package/dist/server/index.d.cts +6 -72
- package/dist/server/index.d.mts +6 -72
- package/dist/server/index.mjs +4 -30
- package/dist/server/model.cjs +2 -2
- package/dist/server/model.mjs +2 -2
- package/dist/server/modelTypes.d.cts +28 -51
- package/dist/server/modelTypes.d.mts +28 -51
- package/dist/server/overview.cjs +6 -10
- package/dist/server/overview.mjs +6 -10
- package/dist/server/reads.cjs +34 -104
- package/dist/server/reads.mjs +34 -104
- package/dist/server/recordEvent.cjs +9 -60
- package/dist/server/recordEvent.mjs +9 -60
- package/dist/server/schema.cjs +9 -87
- package/dist/server/schema.d.cts +4 -136
- package/dist/server/schema.d.mts +4 -136
- package/dist/server/schema.mjs +9 -87
- package/package.json +5 -5
|
@@ -2,7 +2,6 @@ import { assertBundleEventRow } from "./contract.mjs";
|
|
|
2
2
|
import { insightsKey, insightsOverviewDeltas, insightsOverviewId } from "./overview.mjs";
|
|
3
3
|
import { DAILY_EVENTS, DAY_MS, HOUR_MS, isFailedCheck } from "./schema.mjs";
|
|
4
4
|
import { addDistinct, compareUtf8 } from "@hot-updater/plugin-core";
|
|
5
|
-
import { NIL_UUID } from "@hot-updater/protocol";
|
|
6
5
|
//#region src/server/recordEvent.ts
|
|
7
6
|
const hourOf = (ms) => ms - ms % HOUR_MS;
|
|
8
7
|
const dayOf = (ms) => ms - ms % DAY_MS;
|
|
@@ -90,11 +89,10 @@ const patchCounters = (event) => event.type !== "UPDATE_DOWNLOADED" ? {} : {
|
|
|
90
89
|
};
|
|
91
90
|
/**
|
|
92
91
|
* Counters and sketches for one event: release, channel, and usage rows, with
|
|
93
|
-
* day rollups for channel and usage.
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
*
|
|
97
|
-
* in the rows that count it.
|
|
92
|
+
* day rollups for channel and usage. Only usage rows keep a sketch, of active
|
|
93
|
+
* installations, and only for the event's platform, since a read for every
|
|
94
|
+
* platform merges the ios and android sketches. A download's patch counters
|
|
95
|
+
* go in the rows that count it.
|
|
98
96
|
*/
|
|
99
97
|
const countEvent = (tx, event) => {
|
|
100
98
|
const shardBy = event.install_id;
|
|
@@ -120,11 +118,7 @@ const countEvent = (tx, event) => {
|
|
|
120
118
|
...delta.downloads === 0 ? {} : patchCounters(event)
|
|
121
119
|
};
|
|
122
120
|
if (Object.keys(counters).length > 0) tx.aggregate(models.counters, key, counters, { shardBy });
|
|
123
|
-
|
|
124
|
-
...delta.launchIdentity === void 0 || parts.scopeKind === "channel" ? {} : { launch_users: addDistinct(null, delta.launchIdentity) },
|
|
125
|
-
...delta.activityIdentity === void 0 ? {} : { activity_users: addDistinct(null, delta.activityIdentity) }
|
|
126
|
-
};
|
|
127
|
-
if (models.sketches !== void 0 && Object.keys(sketches).length > 0) tx.aggregate(models.sketches, key, sketches, { shardBy });
|
|
121
|
+
if (models.sketches !== void 0 && delta.activityIdentity !== void 0) tx.aggregate(models.sketches, key, { activity_users: addDistinct(null, delta.activityIdentity) }, { shardBy });
|
|
128
122
|
}
|
|
129
123
|
}
|
|
130
124
|
};
|
|
@@ -277,66 +271,21 @@ const REPEATED_FIELDS = [
|
|
|
277
271
|
const repeatsHead = (event, head) => event.type === "UNCHANGED" && head.type !== "UPDATE_DOWNLOADED" && dayOf(event.received_at_ms) === dayOf(head.received_at_ms) && REPEATED_FIELDS.every((field) => event[field] === head[field]);
|
|
278
272
|
/**
|
|
279
273
|
* Records one event in one transaction: one batch read of the event and its
|
|
280
|
-
* installation's
|
|
281
|
-
* changes and one
|
|
274
|
+
* installation's head, one of the gauge and sketch rows it changes, then one
|
|
282
275
|
* write. On a database that batches aggregates (DynamoDB, Firestore), the
|
|
283
276
|
* write holds the event's rows and one log row instead, and a compaction
|
|
284
277
|
* reads and writes the aggregate rows. A stored event's id changes nothing
|
|
285
278
|
* when repeated, whichever installation sends it, and neither does the id
|
|
286
279
|
* of the installation's head. An UNCHANGED report that repeats its head on
|
|
287
|
-
* the same UTC day
|
|
280
|
+
* the same UTC day writes nothing at all. An older event still counts in its
|
|
288
281
|
* own hour but never replaces the head. An update failure is stored and
|
|
289
282
|
* counted, but changes what no installation runs, so it moves no head.
|
|
290
283
|
*/
|
|
291
284
|
const recordEvent = (db, event) => {
|
|
292
285
|
assertBundleEventRow(event);
|
|
293
286
|
return db.transaction(async (tx) => {
|
|
294
|
-
const
|
|
295
|
-
|
|
296
|
-
bucket_start_ms: dayOf(event.received_at_ms)
|
|
297
|
-
};
|
|
298
|
-
const [existing, previous, daily] = await Promise.all([
|
|
299
|
-
tx.findOne("bundle_events", { id: event.id }),
|
|
300
|
-
tx.findOne("bundle_event_heads", { install_id: event.install_id }),
|
|
301
|
-
event.type === "UPDATE_FAILED" ? null : tx.findOne("bundle_daily_heads", dailyKey)
|
|
302
|
-
]);
|
|
303
|
-
if (existing !== null || previous?.id === event.id || daily?.id === event.id) return;
|
|
304
|
-
if (event.type !== "UPDATE_FAILED" && (daily === null || isNewer(event, daily))) {
|
|
305
|
-
const downloaded = event.type === "UPDATE_DOWNLOADED";
|
|
306
|
-
const releaseId = downloaded ? event.from_release_id : event.to_release_id;
|
|
307
|
-
const bundleId = downloaded ? event.from_bundle_id : event.to_bundle_id;
|
|
308
|
-
const next = {
|
|
309
|
-
...dailyKey,
|
|
310
|
-
id: event.id,
|
|
311
|
-
received_at_ms: event.received_at_ms,
|
|
312
|
-
channel: event.channel,
|
|
313
|
-
platform: event.platform,
|
|
314
|
-
app_version: event.app_version,
|
|
315
|
-
release_id: releaseId ?? "",
|
|
316
|
-
bundle_kind: bundleId === NIL_UUID ? "builtin" : releaseId === null ? "unknown" : "release"
|
|
317
|
-
};
|
|
318
|
-
const count = (head, delta) => {
|
|
319
|
-
tx.aggregate("insights_distribution_history", {
|
|
320
|
-
channel: head.channel,
|
|
321
|
-
platform: head.platform,
|
|
322
|
-
app_version: head.app_version,
|
|
323
|
-
release_id: head.release_id,
|
|
324
|
-
bundle_kind: head.bundle_kind,
|
|
325
|
-
bucket_start_ms: head.bucket_start_ms
|
|
326
|
-
}, { installations: delta }, { shardBy: head.install_id });
|
|
327
|
-
};
|
|
328
|
-
if (daily !== null) {
|
|
329
|
-
if (daily.channel !== next.channel || daily.platform !== next.platform || daily.app_version !== next.app_version || daily.release_id !== next.release_id || daily.bundle_kind !== next.bundle_kind) {
|
|
330
|
-
count(daily, -1);
|
|
331
|
-
count(next, 1);
|
|
332
|
-
}
|
|
333
|
-
const { install_id: _, bucket_start_ms: __, ...fields } = next;
|
|
334
|
-
tx.update("bundle_daily_heads", daily, fields);
|
|
335
|
-
} else {
|
|
336
|
-
tx.create("bundle_daily_heads", next);
|
|
337
|
-
count(next, 1);
|
|
338
|
-
}
|
|
339
|
-
}
|
|
287
|
+
const [existing, previous] = await Promise.all([tx.findOne("bundle_events", { id: event.id }), tx.findOne("bundle_event_heads", { install_id: event.install_id })]);
|
|
288
|
+
if (existing !== null || previous?.id === event.id) return;
|
|
340
289
|
if (previous !== null && repeatsHead(event, previous)) return;
|
|
341
290
|
if (event.type !== "UNCHANGED") {
|
|
342
291
|
tx.create("bundle_events", event);
|
package/dist/server/schema.cjs
CHANGED
|
@@ -92,14 +92,6 @@ const bundleEvents = (days) => (0, _hot_updater_plugin_core.defineTable)({
|
|
|
92
92
|
}
|
|
93
93
|
},
|
|
94
94
|
indexes: {
|
|
95
|
-
recent: {
|
|
96
|
-
eq: [
|
|
97
|
-
"channel",
|
|
98
|
-
"platform",
|
|
99
|
-
"day"
|
|
100
|
-
],
|
|
101
|
-
sort: ["received_at_ms"]
|
|
102
|
-
},
|
|
103
95
|
movementsByInstall: {
|
|
104
96
|
eq: ["movement_install_id"],
|
|
105
97
|
sort: ["received_at_ms"]
|
|
@@ -216,10 +208,11 @@ const window = {
|
|
|
216
208
|
};
|
|
217
209
|
/**
|
|
218
210
|
* Counters of one period kind: hourly, daily, or lifetime at bucket 0. A
|
|
219
|
-
* release or channel row counts downloads
|
|
220
|
-
*
|
|
221
|
-
*
|
|
222
|
-
*
|
|
211
|
+
* release or channel row counts downloads and failed launches, and downloads
|
|
212
|
+
* a patch delivered and those that fell back from one. Only a release's
|
|
213
|
+
* lifetime row counts launches, which the bundle list reads and no windowed
|
|
214
|
+
* read sums. It also counts the release's failed updates (`failed_updates`),
|
|
215
|
+
* since no breakdown row outlives the raw period; windowed reads sum
|
|
223
216
|
* `insights_failures` instead.
|
|
224
217
|
*/
|
|
225
218
|
const counters = (retention) => (0, _hot_updater_plugin_core.defineAggregate)(identityFields, {
|
|
@@ -238,17 +231,13 @@ const counters = (retention) => (0, _hot_updater_plugin_core.defineAggregate)(id
|
|
|
238
231
|
...retention === void 0 ? {} : { retention }
|
|
239
232
|
});
|
|
240
233
|
/**
|
|
241
|
-
* Unique-installation sketches of one period kind
|
|
242
|
-
*
|
|
243
|
-
*
|
|
234
|
+
* Unique-installation sketches of one period kind: a usage row's active
|
|
235
|
+
* installations (`activity_users`), and a `failure` or `check` row's
|
|
236
|
+
* installations whose update or update check failed (`failed_users`).
|
|
244
237
|
*/
|
|
245
238
|
const sketches = (retention) => (0, _hot_updater_plugin_core.defineAggregate)(identityFields, {
|
|
246
239
|
key: ["identity", "bucket_start_ms"],
|
|
247
|
-
distinct: [
|
|
248
|
-
"launch_users",
|
|
249
|
-
"activity_users",
|
|
250
|
-
"failed_users"
|
|
251
|
-
],
|
|
240
|
+
distinct: ["activity_users", "failed_users"],
|
|
252
241
|
shards: SKETCH_SHARDS,
|
|
253
242
|
batched: true,
|
|
254
243
|
indexes: { window },
|
|
@@ -354,71 +343,6 @@ const insightsDistribution = (retention) => (0, _hot_updater_plugin_core.defineA
|
|
|
354
343
|
},
|
|
355
344
|
retention
|
|
356
345
|
});
|
|
357
|
-
/** The last running bundle observed per installation and UTC day. */
|
|
358
|
-
const bundleDailyHeads = (retention) => (0, _hot_updater_plugin_core.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) => (0, _hot_updater_plugin_core.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
|
-
});
|
|
422
346
|
/** Latest events by the bundle they came from or went to, bucketed like the distribution. */
|
|
423
347
|
const insightsLatestByBundle = (retention) => (0, _hot_updater_plugin_core.defineAggregate)({
|
|
424
348
|
platform: {
|
|
@@ -538,8 +462,6 @@ const createInsightsSchema = ({ rawDays, dailyDays } = DEFAULT_INSIGHTS_RETENTIO
|
|
|
538
462
|
insights_overview_lifetime: counters(),
|
|
539
463
|
insights_sketches_lifetime: lifetimeSketches(),
|
|
540
464
|
insights_distribution: insightsDistribution(daily),
|
|
541
|
-
bundle_daily_heads: bundleDailyHeads(daily),
|
|
542
|
-
insights_distribution_history: insightsDistributionHistory(daily),
|
|
543
465
|
insights_latest_by_bundle: insightsLatestByBundle(daily),
|
|
544
466
|
insights_outcomes: insightsOutcomes(hourly),
|
|
545
467
|
insights_failures: insightsFailures(hourly)
|
package/dist/server/schema.d.cts
CHANGED
|
@@ -71,10 +71,6 @@ declare const createInsightsSchema: ({ rawDays, dailyDays }?: InsightsRetention)
|
|
|
71
71
|
movement_install_id: "string";
|
|
72
72
|
bundle_ref: "string";
|
|
73
73
|
}, {
|
|
74
|
-
readonly recent: {
|
|
75
|
-
readonly eq: readonly ["channel", "platform", "day"];
|
|
76
|
-
readonly sort: readonly ["received_at_ms"];
|
|
77
|
-
};
|
|
78
74
|
readonly movementsByInstall: {
|
|
79
75
|
readonly eq: readonly ["movement_install_id"];
|
|
80
76
|
readonly sort: readonly ["received_at_ms"];
|
|
@@ -176,7 +172,7 @@ declare const createInsightsSchema: ({ rawDays, dailyDays }?: InsightsRetention)
|
|
|
176
172
|
readonly eq: readonly ["identity"];
|
|
177
173
|
readonly sort: readonly ["bucket_start_ms"];
|
|
178
174
|
};
|
|
179
|
-
}, "
|
|
175
|
+
}, "activity_users" | "failed_users", readonly ["identity", "bucket_start_ms"]>;
|
|
180
176
|
/** Daily counters and sketches: the daily period. */
|
|
181
177
|
readonly insights_overview_daily: import("@hot-updater/plugin-core").AggregateDefinition<{
|
|
182
178
|
readonly identity: {
|
|
@@ -205,7 +201,7 @@ declare const createInsightsSchema: ({ rawDays, dailyDays }?: InsightsRetention)
|
|
|
205
201
|
readonly eq: readonly ["identity"];
|
|
206
202
|
readonly sort: readonly ["bucket_start_ms"];
|
|
207
203
|
};
|
|
208
|
-
}, "
|
|
204
|
+
}, "activity_users" | "failed_users", readonly ["identity", "bucket_start_ms"]>;
|
|
209
205
|
/** A release's counters since its first event, and its failed installations: kept. */
|
|
210
206
|
readonly insights_overview_lifetime: import("@hot-updater/plugin-core").AggregateDefinition<{
|
|
211
207
|
readonly identity: {
|
|
@@ -263,68 +259,6 @@ declare const createInsightsSchema: ({ rawDays, dailyDays }?: InsightsRetention)
|
|
|
263
259
|
readonly sort: readonly ["bucket_start_ms"];
|
|
264
260
|
};
|
|
265
261
|
}, 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"]>;
|
|
328
262
|
readonly insights_latest_by_bundle: import("@hot-updater/plugin-core").AggregateDefinition<{
|
|
329
263
|
readonly platform: {
|
|
330
264
|
readonly type: "string";
|
|
@@ -472,10 +406,6 @@ declare const insightsSchema: {
|
|
|
472
406
|
movement_install_id: "string";
|
|
473
407
|
bundle_ref: "string";
|
|
474
408
|
}, {
|
|
475
|
-
readonly recent: {
|
|
476
|
-
readonly eq: readonly ["channel", "platform", "day"];
|
|
477
|
-
readonly sort: readonly ["received_at_ms"];
|
|
478
|
-
};
|
|
479
409
|
readonly movementsByInstall: {
|
|
480
410
|
readonly eq: readonly ["movement_install_id"];
|
|
481
411
|
readonly sort: readonly ["received_at_ms"];
|
|
@@ -577,7 +507,7 @@ declare const insightsSchema: {
|
|
|
577
507
|
readonly eq: readonly ["identity"];
|
|
578
508
|
readonly sort: readonly ["bucket_start_ms"];
|
|
579
509
|
};
|
|
580
|
-
}, "
|
|
510
|
+
}, "activity_users" | "failed_users", readonly ["identity", "bucket_start_ms"]>;
|
|
581
511
|
/** Daily counters and sketches: the daily period. */
|
|
582
512
|
readonly insights_overview_daily: import("@hot-updater/plugin-core").AggregateDefinition<{
|
|
583
513
|
readonly identity: {
|
|
@@ -606,7 +536,7 @@ declare const insightsSchema: {
|
|
|
606
536
|
readonly eq: readonly ["identity"];
|
|
607
537
|
readonly sort: readonly ["bucket_start_ms"];
|
|
608
538
|
};
|
|
609
|
-
}, "
|
|
539
|
+
}, "activity_users" | "failed_users", readonly ["identity", "bucket_start_ms"]>;
|
|
610
540
|
/** A release's counters since its first event, and its failed installations: kept. */
|
|
611
541
|
readonly insights_overview_lifetime: import("@hot-updater/plugin-core").AggregateDefinition<{
|
|
612
542
|
readonly identity: {
|
|
@@ -664,68 +594,6 @@ declare const insightsSchema: {
|
|
|
664
594
|
readonly sort: readonly ["bucket_start_ms"];
|
|
665
595
|
};
|
|
666
596
|
}, 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"]>;
|
|
729
597
|
readonly insights_latest_by_bundle: import("@hot-updater/plugin-core").AggregateDefinition<{
|
|
730
598
|
readonly platform: {
|
|
731
599
|
readonly type: "string";
|
package/dist/server/schema.d.mts
CHANGED
|
@@ -71,10 +71,6 @@ declare const createInsightsSchema: ({ rawDays, dailyDays }?: InsightsRetention)
|
|
|
71
71
|
movement_install_id: "string";
|
|
72
72
|
bundle_ref: "string";
|
|
73
73
|
}, {
|
|
74
|
-
readonly recent: {
|
|
75
|
-
readonly eq: readonly ["channel", "platform", "day"];
|
|
76
|
-
readonly sort: readonly ["received_at_ms"];
|
|
77
|
-
};
|
|
78
74
|
readonly movementsByInstall: {
|
|
79
75
|
readonly eq: readonly ["movement_install_id"];
|
|
80
76
|
readonly sort: readonly ["received_at_ms"];
|
|
@@ -176,7 +172,7 @@ declare const createInsightsSchema: ({ rawDays, dailyDays }?: InsightsRetention)
|
|
|
176
172
|
readonly eq: readonly ["identity"];
|
|
177
173
|
readonly sort: readonly ["bucket_start_ms"];
|
|
178
174
|
};
|
|
179
|
-
}, "
|
|
175
|
+
}, "activity_users" | "failed_users", readonly ["identity", "bucket_start_ms"]>;
|
|
180
176
|
/** Daily counters and sketches: the daily period. */
|
|
181
177
|
readonly insights_overview_daily: import("@hot-updater/plugin-core").AggregateDefinition<{
|
|
182
178
|
readonly identity: {
|
|
@@ -205,7 +201,7 @@ declare const createInsightsSchema: ({ rawDays, dailyDays }?: InsightsRetention)
|
|
|
205
201
|
readonly eq: readonly ["identity"];
|
|
206
202
|
readonly sort: readonly ["bucket_start_ms"];
|
|
207
203
|
};
|
|
208
|
-
}, "
|
|
204
|
+
}, "activity_users" | "failed_users", readonly ["identity", "bucket_start_ms"]>;
|
|
209
205
|
/** A release's counters since its first event, and its failed installations: kept. */
|
|
210
206
|
readonly insights_overview_lifetime: import("@hot-updater/plugin-core").AggregateDefinition<{
|
|
211
207
|
readonly identity: {
|
|
@@ -263,68 +259,6 @@ declare const createInsightsSchema: ({ rawDays, dailyDays }?: InsightsRetention)
|
|
|
263
259
|
readonly sort: readonly ["bucket_start_ms"];
|
|
264
260
|
};
|
|
265
261
|
}, 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"]>;
|
|
328
262
|
readonly insights_latest_by_bundle: import("@hot-updater/plugin-core").AggregateDefinition<{
|
|
329
263
|
readonly platform: {
|
|
330
264
|
readonly type: "string";
|
|
@@ -472,10 +406,6 @@ declare const insightsSchema: {
|
|
|
472
406
|
movement_install_id: "string";
|
|
473
407
|
bundle_ref: "string";
|
|
474
408
|
}, {
|
|
475
|
-
readonly recent: {
|
|
476
|
-
readonly eq: readonly ["channel", "platform", "day"];
|
|
477
|
-
readonly sort: readonly ["received_at_ms"];
|
|
478
|
-
};
|
|
479
409
|
readonly movementsByInstall: {
|
|
480
410
|
readonly eq: readonly ["movement_install_id"];
|
|
481
411
|
readonly sort: readonly ["received_at_ms"];
|
|
@@ -577,7 +507,7 @@ declare const insightsSchema: {
|
|
|
577
507
|
readonly eq: readonly ["identity"];
|
|
578
508
|
readonly sort: readonly ["bucket_start_ms"];
|
|
579
509
|
};
|
|
580
|
-
}, "
|
|
510
|
+
}, "activity_users" | "failed_users", readonly ["identity", "bucket_start_ms"]>;
|
|
581
511
|
/** Daily counters and sketches: the daily period. */
|
|
582
512
|
readonly insights_overview_daily: import("@hot-updater/plugin-core").AggregateDefinition<{
|
|
583
513
|
readonly identity: {
|
|
@@ -606,7 +536,7 @@ declare const insightsSchema: {
|
|
|
606
536
|
readonly eq: readonly ["identity"];
|
|
607
537
|
readonly sort: readonly ["bucket_start_ms"];
|
|
608
538
|
};
|
|
609
|
-
}, "
|
|
539
|
+
}, "activity_users" | "failed_users", readonly ["identity", "bucket_start_ms"]>;
|
|
610
540
|
/** A release's counters since its first event, and its failed installations: kept. */
|
|
611
541
|
readonly insights_overview_lifetime: import("@hot-updater/plugin-core").AggregateDefinition<{
|
|
612
542
|
readonly identity: {
|
|
@@ -664,68 +594,6 @@ declare const insightsSchema: {
|
|
|
664
594
|
readonly sort: readonly ["bucket_start_ms"];
|
|
665
595
|
};
|
|
666
596
|
}, 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"]>;
|
|
729
597
|
readonly insights_latest_by_bundle: import("@hot-updater/plugin-core").AggregateDefinition<{
|
|
730
598
|
readonly platform: {
|
|
731
599
|
readonly type: "string";
|