@hot-updater/aws 1.0.0-rc.38 → 1.0.0-rc.39

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.
@@ -4570,7 +4570,7 @@ const createKvAdapter = ({ store, tablePrefix = "" }) => {
4570
4570
  };
4571
4571
  //#endregion
4572
4572
  //#region ../../packages/server/dist/version.mjs
4573
- const HOT_UPDATER_SERVER_VERSION = "1.0.0-rc.38";
4573
+ const HOT_UPDATER_SERVER_VERSION = "1.0.0-rc.39";
4574
4574
  //#endregion
4575
4575
  //#region ../../packages/server/dist/handlerVersionRoutes.mjs
4576
4576
  /**
@@ -11577,17 +11577,25 @@ const countEvent = (tx, event) => {
11577
11577
  };
11578
11578
  /**
11579
11579
  * A stored event's outcome rows: its bundle filter's hour, when it has one
11580
- * (`bundleRefsOf`), and every stored event's UTC day.
11580
+ * (`bundleRefsOf`), and every stored event's UTC day. A download that a
11581
+ * launch or crash implied counts in its bundle's download hour too, in the
11582
+ * hour of that launch or crash, so the download series covers what the
11583
+ * release's downloads count; the launch or crash is its row.
11581
11584
  */
11582
11585
  const countOutcome = (tx, event) => {
11583
11586
  const shardBy = event.install_id;
11584
- for (const bundleRef of bundleRefsOf(event)) tx.aggregate("insights_outcomes", {
11587
+ const hour = (type, bundleRef) => tx.aggregate("insights_outcomes", {
11585
11588
  platform: event.platform,
11586
11589
  channel: event.channel,
11587
- type: event.type,
11590
+ type,
11588
11591
  bundle_ref: bundleRef,
11589
11592
  bucket_start_ms: hourOf(event.received_at_ms)
11590
11593
  }, { events: 1 }, { shardBy });
11594
+ for (const bundleRef of bundleRefsOf(event)) hour(event.type, bundleRef);
11595
+ if (event.metadata.implied_download === true) hour("UPDATE_DOWNLOADED", bundleRefOfFilter({
11596
+ type: "UPDATE_DOWNLOADED",
11597
+ toBundleId: event.type === "RECOVERED" ? event.from_bundle_id : event.to_bundle_id
11598
+ }));
11591
11599
  tx.aggregate("insights_outcomes", {
11592
11600
  ...DAILY_EVENTS,
11593
11601
  bucket_start_ms: dayOf(event.received_at_ms)
@@ -12020,7 +12028,11 @@ const countRaw = async (db, filter, from, to) => {
12020
12028
  }
12021
12029
  return total;
12022
12030
  };
12023
- /** Whole hours from outcome counters; the partial hours at either edge from raw events. */
12031
+ /**
12032
+ * Whole hours from outcome counters; the partial hours at either edge from
12033
+ * raw events. A download filter's whole hours count the downloads a launch
12034
+ * or crash implied too, which its raw events do not hold.
12035
+ */
12024
12036
  const countEvents = async (db, input) => {
12025
12037
  const { filter, sinceMs, beforeReceivedAtMs } = input;
12026
12038
  const start = hourCeil(sinceMs);
@@ -12039,8 +12051,9 @@ const countEvents = async (db, input) => {
12039
12051
  return await countRaw(db, filter, sinceMs, start) + hours.reduce((sum, row) => sum + row.events, 0) + await countRaw(db, filter, end, beforeReceivedAtMs);
12040
12052
  };
12041
12053
  /**
12042
- * A bundle filter's stored events in each interval of whole hours: one read
12043
- * of its hourly counts, every interval present.
12054
+ * A bundle filter's stored events in each interval of whole hours, and for a
12055
+ * download filter the downloads a launch or crash implied: one read of its
12056
+ * hourly counts, every interval present.
12044
12057
  */
12045
12058
  const countEventSeries = async (db, input) => {
12046
12059
  const { filter, intervalMs } = input;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@hot-updater/aws",
3
3
  "type": "module",
4
- "version": "1.0.0-rc.38",
4
+ "version": "1.0.0-rc.39",
5
5
  "description": "React Native OTA solution for self-hosted",
6
6
  "main": "dist/index.cjs",
7
7
  "module": "dist/index.mjs",
@@ -45,9 +45,9 @@
45
45
  "es-toolkit": "^1.32.0",
46
46
  "execa": "9.5.2",
47
47
  "mime": "^4.0.4",
48
- "@hot-updater/protocol": "1.0.0-rc.38",
49
- "@hot-updater/test-utils": "1.0.0-rc.38",
50
- "@hot-updater/mock": "1.0.0-rc.38"
48
+ "@hot-updater/protocol": "1.0.0-rc.39",
49
+ "@hot-updater/mock": "1.0.0-rc.39",
50
+ "@hot-updater/test-utils": "1.0.0-rc.39"
51
51
  },
52
52
  "dependencies": {
53
53
  "@aws-sdk/client-cloudfront": "3.1066.0",
@@ -62,9 +62,9 @@
62
62
  "@aws-sdk/lib-storage": "3.1066.0",
63
63
  "@aws-sdk/lib-dynamodb": "3.1066.0",
64
64
  "hono": "4.12.34",
65
- "@hot-updater/cli-tools": "1.0.0-rc.38",
66
- "@hot-updater/server": "1.0.0-rc.38",
67
- "@hot-updater/plugin-core": "1.0.0-rc.38"
65
+ "@hot-updater/cli-tools": "1.0.0-rc.39",
66
+ "@hot-updater/plugin-core": "1.0.0-rc.39",
67
+ "@hot-updater/server": "1.0.0-rc.39"
68
68
  },
69
69
  "scripts": {
70
70
  "build": "tsdown",