@hot-updater/cloudflare 1.0.0-rc.31 → 1.0.0-rc.33
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/index.d.cts +7 -4
- package/dist/index.d.mts +7 -4
- package/dist/worker/index.d.cts +7 -4
- package/dist/worker/index.d.mts +7 -4
- package/package.json +6 -6
- package/sql/bundles.sql +4 -4
- package/worker/dist/README.md +1 -1
- package/worker/dist/index.js +39 -31
- package/worker/dist/index.js.map +2 -2
- package/worker/migrations/0001_hot-updater_1.0.0.sql +4 -4
package/dist/index.d.cts
CHANGED
|
@@ -204,8 +204,11 @@ type InsightsCoverage = {
|
|
|
204
204
|
* which are kept.
|
|
205
205
|
*/
|
|
206
206
|
interface ReleaseActivityMetrics {
|
|
207
|
+
/** Download reports of the release. */
|
|
207
208
|
readonly downloads: number;
|
|
208
|
-
|
|
209
|
+
/** Apply reports of the release: installations that started running it. */
|
|
210
|
+
readonly applies: number;
|
|
211
|
+
/** Launches that crashed on the release and recovered to the one before. */
|
|
209
212
|
readonly failedLaunches: number;
|
|
210
213
|
}
|
|
211
214
|
interface InsightsGetReleaseActivityInput {
|
|
@@ -483,7 +486,7 @@ declare const plugins: readonly [import("@hot-updater/plugin-core").HotUpdaterPl
|
|
|
483
486
|
readonly bucket_start_ms: {
|
|
484
487
|
readonly type: "integer";
|
|
485
488
|
};
|
|
486
|
-
}, "downloads" | "
|
|
489
|
+
}, "downloads" | "failed_launches" | "patch_downloads" | "patch_fallbacks", {
|
|
487
490
|
readonly window: {
|
|
488
491
|
readonly eq: readonly ["identity"];
|
|
489
492
|
readonly sort: readonly ["bucket_start_ms"];
|
|
@@ -511,7 +514,7 @@ declare const plugins: readonly [import("@hot-updater/plugin-core").HotUpdaterPl
|
|
|
511
514
|
readonly bucket_start_ms: {
|
|
512
515
|
readonly type: "integer";
|
|
513
516
|
};
|
|
514
|
-
}, "downloads" | "
|
|
517
|
+
}, "downloads" | "failed_launches" | "patch_downloads" | "patch_fallbacks", {
|
|
515
518
|
readonly window: {
|
|
516
519
|
readonly eq: readonly ["identity"];
|
|
517
520
|
readonly sort: readonly ["bucket_start_ms"];
|
|
@@ -539,7 +542,7 @@ declare const plugins: readonly [import("@hot-updater/plugin-core").HotUpdaterPl
|
|
|
539
542
|
readonly bucket_start_ms: {
|
|
540
543
|
readonly type: "integer";
|
|
541
544
|
};
|
|
542
|
-
}, "downloads" | "
|
|
545
|
+
}, "downloads" | "failed_launches" | "patch_downloads" | "patch_fallbacks" | "applies" | "failed_updates", {
|
|
543
546
|
readonly window: {
|
|
544
547
|
readonly eq: readonly ["identity"];
|
|
545
548
|
readonly sort: readonly ["bucket_start_ms"];
|
package/dist/index.d.mts
CHANGED
|
@@ -204,8 +204,11 @@ type InsightsCoverage = {
|
|
|
204
204
|
* which are kept.
|
|
205
205
|
*/
|
|
206
206
|
interface ReleaseActivityMetrics {
|
|
207
|
+
/** Download reports of the release. */
|
|
207
208
|
readonly downloads: number;
|
|
208
|
-
|
|
209
|
+
/** Apply reports of the release: installations that started running it. */
|
|
210
|
+
readonly applies: number;
|
|
211
|
+
/** Launches that crashed on the release and recovered to the one before. */
|
|
209
212
|
readonly failedLaunches: number;
|
|
210
213
|
}
|
|
211
214
|
interface InsightsGetReleaseActivityInput {
|
|
@@ -483,7 +486,7 @@ declare const plugins: readonly [import("@hot-updater/plugin-core").HotUpdaterPl
|
|
|
483
486
|
readonly bucket_start_ms: {
|
|
484
487
|
readonly type: "integer";
|
|
485
488
|
};
|
|
486
|
-
}, "downloads" | "
|
|
489
|
+
}, "downloads" | "failed_launches" | "patch_downloads" | "patch_fallbacks", {
|
|
487
490
|
readonly window: {
|
|
488
491
|
readonly eq: readonly ["identity"];
|
|
489
492
|
readonly sort: readonly ["bucket_start_ms"];
|
|
@@ -511,7 +514,7 @@ declare const plugins: readonly [import("@hot-updater/plugin-core").HotUpdaterPl
|
|
|
511
514
|
readonly bucket_start_ms: {
|
|
512
515
|
readonly type: "integer";
|
|
513
516
|
};
|
|
514
|
-
}, "downloads" | "
|
|
517
|
+
}, "downloads" | "failed_launches" | "patch_downloads" | "patch_fallbacks", {
|
|
515
518
|
readonly window: {
|
|
516
519
|
readonly eq: readonly ["identity"];
|
|
517
520
|
readonly sort: readonly ["bucket_start_ms"];
|
|
@@ -539,7 +542,7 @@ declare const plugins: readonly [import("@hot-updater/plugin-core").HotUpdaterPl
|
|
|
539
542
|
readonly bucket_start_ms: {
|
|
540
543
|
readonly type: "integer";
|
|
541
544
|
};
|
|
542
|
-
}, "downloads" | "
|
|
545
|
+
}, "downloads" | "failed_launches" | "patch_downloads" | "patch_fallbacks" | "applies" | "failed_updates", {
|
|
543
546
|
readonly window: {
|
|
544
547
|
readonly eq: readonly ["identity"];
|
|
545
548
|
readonly sort: readonly ["bucket_start_ms"];
|
package/dist/worker/index.d.cts
CHANGED
|
@@ -192,8 +192,11 @@ type InsightsCoverage = {
|
|
|
192
192
|
* which are kept.
|
|
193
193
|
*/
|
|
194
194
|
interface ReleaseActivityMetrics {
|
|
195
|
+
/** Download reports of the release. */
|
|
195
196
|
readonly downloads: number;
|
|
196
|
-
|
|
197
|
+
/** Apply reports of the release: installations that started running it. */
|
|
198
|
+
readonly applies: number;
|
|
199
|
+
/** Launches that crashed on the release and recovered to the one before. */
|
|
197
200
|
readonly failedLaunches: number;
|
|
198
201
|
}
|
|
199
202
|
interface InsightsGetReleaseActivityInput {
|
|
@@ -471,7 +474,7 @@ declare const plugins: readonly [import("@hot-updater/plugin-core").HotUpdaterPl
|
|
|
471
474
|
readonly bucket_start_ms: {
|
|
472
475
|
readonly type: "integer";
|
|
473
476
|
};
|
|
474
|
-
}, "downloads" | "
|
|
477
|
+
}, "downloads" | "failed_launches" | "patch_downloads" | "patch_fallbacks", {
|
|
475
478
|
readonly window: {
|
|
476
479
|
readonly eq: readonly ["identity"];
|
|
477
480
|
readonly sort: readonly ["bucket_start_ms"];
|
|
@@ -499,7 +502,7 @@ declare const plugins: readonly [import("@hot-updater/plugin-core").HotUpdaterPl
|
|
|
499
502
|
readonly bucket_start_ms: {
|
|
500
503
|
readonly type: "integer";
|
|
501
504
|
};
|
|
502
|
-
}, "downloads" | "
|
|
505
|
+
}, "downloads" | "failed_launches" | "patch_downloads" | "patch_fallbacks", {
|
|
503
506
|
readonly window: {
|
|
504
507
|
readonly eq: readonly ["identity"];
|
|
505
508
|
readonly sort: readonly ["bucket_start_ms"];
|
|
@@ -527,7 +530,7 @@ declare const plugins: readonly [import("@hot-updater/plugin-core").HotUpdaterPl
|
|
|
527
530
|
readonly bucket_start_ms: {
|
|
528
531
|
readonly type: "integer";
|
|
529
532
|
};
|
|
530
|
-
}, "downloads" | "
|
|
533
|
+
}, "downloads" | "failed_launches" | "patch_downloads" | "patch_fallbacks" | "applies" | "failed_updates", {
|
|
531
534
|
readonly window: {
|
|
532
535
|
readonly eq: readonly ["identity"];
|
|
533
536
|
readonly sort: readonly ["bucket_start_ms"];
|
package/dist/worker/index.d.mts
CHANGED
|
@@ -192,8 +192,11 @@ type InsightsCoverage = {
|
|
|
192
192
|
* which are kept.
|
|
193
193
|
*/
|
|
194
194
|
interface ReleaseActivityMetrics {
|
|
195
|
+
/** Download reports of the release. */
|
|
195
196
|
readonly downloads: number;
|
|
196
|
-
|
|
197
|
+
/** Apply reports of the release: installations that started running it. */
|
|
198
|
+
readonly applies: number;
|
|
199
|
+
/** Launches that crashed on the release and recovered to the one before. */
|
|
197
200
|
readonly failedLaunches: number;
|
|
198
201
|
}
|
|
199
202
|
interface InsightsGetReleaseActivityInput {
|
|
@@ -471,7 +474,7 @@ declare const plugins: readonly [import("@hot-updater/plugin-core").HotUpdaterPl
|
|
|
471
474
|
readonly bucket_start_ms: {
|
|
472
475
|
readonly type: "integer";
|
|
473
476
|
};
|
|
474
|
-
}, "downloads" | "
|
|
477
|
+
}, "downloads" | "failed_launches" | "patch_downloads" | "patch_fallbacks", {
|
|
475
478
|
readonly window: {
|
|
476
479
|
readonly eq: readonly ["identity"];
|
|
477
480
|
readonly sort: readonly ["bucket_start_ms"];
|
|
@@ -499,7 +502,7 @@ declare const plugins: readonly [import("@hot-updater/plugin-core").HotUpdaterPl
|
|
|
499
502
|
readonly bucket_start_ms: {
|
|
500
503
|
readonly type: "integer";
|
|
501
504
|
};
|
|
502
|
-
}, "downloads" | "
|
|
505
|
+
}, "downloads" | "failed_launches" | "patch_downloads" | "patch_fallbacks", {
|
|
503
506
|
readonly window: {
|
|
504
507
|
readonly eq: readonly ["identity"];
|
|
505
508
|
readonly sort: readonly ["bucket_start_ms"];
|
|
@@ -527,7 +530,7 @@ declare const plugins: readonly [import("@hot-updater/plugin-core").HotUpdaterPl
|
|
|
527
530
|
readonly bucket_start_ms: {
|
|
528
531
|
readonly type: "integer";
|
|
529
532
|
};
|
|
530
|
-
}, "downloads" | "
|
|
533
|
+
}, "downloads" | "failed_launches" | "patch_downloads" | "patch_fallbacks" | "applies" | "failed_updates", {
|
|
531
534
|
readonly window: {
|
|
532
535
|
readonly eq: readonly ["identity"];
|
|
533
536
|
readonly sort: readonly ["bucket_start_ms"];
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hot-updater/cloudflare",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.0-rc.
|
|
4
|
+
"version": "1.0.0-rc.33",
|
|
5
5
|
"description": "React Native OTA solution for self-hosted",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
7
7
|
"module": "dist/index.mjs",
|
|
@@ -56,10 +56,10 @@
|
|
|
56
56
|
"cloudflare": "4.2.0",
|
|
57
57
|
"hono": "4.12.34",
|
|
58
58
|
"uuidv7": "^1.0.2",
|
|
59
|
-
"@hot-updater/cli-tools": "1.0.0-rc.
|
|
60
|
-
"@hot-updater/protocol": "1.0.0-rc.
|
|
61
|
-
"@hot-updater/
|
|
62
|
-
"@hot-updater/
|
|
59
|
+
"@hot-updater/cli-tools": "1.0.0-rc.33",
|
|
60
|
+
"@hot-updater/protocol": "1.0.0-rc.29",
|
|
61
|
+
"@hot-updater/server": "1.0.0-rc.33",
|
|
62
|
+
"@hot-updater/plugin-core": "1.0.0-rc.29"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
65
|
"@cloudflare/vitest-pool-workers": "0.13.0",
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
"vitest": "4.1.4",
|
|
76
76
|
"wrangler": "^4.69.0",
|
|
77
77
|
"xdg-app-paths": "^8.3.0",
|
|
78
|
-
"@hot-updater/test-utils": "1.0.0-rc.
|
|
78
|
+
"@hot-updater/test-utils": "1.0.0-rc.31"
|
|
79
79
|
},
|
|
80
80
|
"scripts": {
|
|
81
81
|
"build": "tsdown && pnpm build:worker",
|
package/sql/bundles.sql
CHANGED
|
@@ -50,7 +50,7 @@ CREATE INDEX IF NOT EXISTS "bundle_event_heads_byUser" ON "bundle_event_heads" (
|
|
|
50
50
|
|
|
51
51
|
CREATE INDEX IF NOT EXISTS "bundle_event_heads__retention" ON "bundle_event_heads" ("received_at_ms", "install_id");
|
|
52
52
|
|
|
53
|
-
CREATE TABLE IF NOT EXISTS "insights_overview" ("identity" TEXT NOT NULL, "bucket_start_ms" INTEGER NOT NULL, "_shard" INTEGER NOT NULL, "downloads" INTEGER NOT NULL, "
|
|
53
|
+
CREATE TABLE IF NOT EXISTS "insights_overview" ("identity" TEXT NOT NULL, "bucket_start_ms" INTEGER NOT NULL, "_shard" INTEGER NOT NULL, "downloads" INTEGER NOT NULL, "failed_launches" INTEGER NOT NULL, "patch_downloads" INTEGER NOT NULL, "patch_fallbacks" INTEGER NOT NULL, "_v" INTEGER NOT NULL DEFAULT 0, PRIMARY KEY ("identity", "bucket_start_ms", "_shard"));
|
|
54
54
|
|
|
55
55
|
CREATE INDEX IF NOT EXISTS "insights_overview__retention" ON "insights_overview" ("bucket_start_ms", "identity", "_shard");
|
|
56
56
|
|
|
@@ -58,7 +58,7 @@ CREATE TABLE IF NOT EXISTS "insights_sketches" ("identity" TEXT NOT NULL, "bucke
|
|
|
58
58
|
|
|
59
59
|
CREATE INDEX IF NOT EXISTS "insights_sketches__retention" ON "insights_sketches" ("bucket_start_ms", "identity", "_shard");
|
|
60
60
|
|
|
61
|
-
CREATE TABLE IF NOT EXISTS "insights_overview_daily" ("identity" TEXT NOT NULL, "bucket_start_ms" INTEGER NOT NULL, "_shard" INTEGER NOT NULL, "downloads" INTEGER NOT NULL, "
|
|
61
|
+
CREATE TABLE IF NOT EXISTS "insights_overview_daily" ("identity" TEXT NOT NULL, "bucket_start_ms" INTEGER NOT NULL, "_shard" INTEGER NOT NULL, "downloads" INTEGER NOT NULL, "failed_launches" INTEGER NOT NULL, "patch_downloads" INTEGER NOT NULL, "patch_fallbacks" INTEGER NOT NULL, "_v" INTEGER NOT NULL DEFAULT 0, PRIMARY KEY ("identity", "bucket_start_ms", "_shard"));
|
|
62
62
|
|
|
63
63
|
CREATE INDEX IF NOT EXISTS "insights_overview_daily__retention" ON "insights_overview_daily" ("bucket_start_ms", "identity", "_shard");
|
|
64
64
|
|
|
@@ -66,7 +66,7 @@ CREATE TABLE IF NOT EXISTS "insights_sketches_daily" ("identity" TEXT NOT NULL,
|
|
|
66
66
|
|
|
67
67
|
CREATE INDEX IF NOT EXISTS "insights_sketches_daily__retention" ON "insights_sketches_daily" ("bucket_start_ms", "identity", "_shard");
|
|
68
68
|
|
|
69
|
-
CREATE TABLE IF NOT EXISTS "insights_overview_lifetime" ("identity" TEXT NOT NULL, "bucket_start_ms" INTEGER NOT NULL, "_shard" INTEGER NOT NULL, "downloads" INTEGER NOT NULL, "
|
|
69
|
+
CREATE TABLE IF NOT EXISTS "insights_overview_lifetime" ("identity" TEXT NOT NULL, "bucket_start_ms" INTEGER NOT NULL, "_shard" INTEGER NOT NULL, "downloads" INTEGER NOT NULL, "failed_launches" INTEGER NOT NULL, "patch_downloads" INTEGER NOT NULL, "patch_fallbacks" INTEGER NOT NULL, "applies" INTEGER NOT NULL, "failed_updates" INTEGER NOT NULL, "_v" INTEGER NOT NULL DEFAULT 0, PRIMARY KEY ("identity", "bucket_start_ms", "_shard"));
|
|
70
70
|
|
|
71
71
|
CREATE TABLE IF NOT EXISTS "insights_sketches_lifetime" ("identity" TEXT NOT NULL, "bucket_start_ms" INTEGER NOT NULL, "_shard" INTEGER NOT NULL, "failed_users" TEXT, "_v" INTEGER NOT NULL DEFAULT 0, PRIMARY KEY ("identity", "bucket_start_ms", "_shard"));
|
|
72
72
|
|
|
@@ -102,6 +102,6 @@ INSERT INTO "private_hot_updater_settings" ("key", "value", "_v") VALUES ('schem
|
|
|
102
102
|
|
|
103
103
|
INSERT INTO "private_hot_updater_settings" ("key", "value", "_v") VALUES ('schema.core', '1.0.0', 0) ON CONFLICT ("key") DO UPDATE SET "value" = excluded."value";
|
|
104
104
|
|
|
105
|
-
INSERT INTO "private_hot_updater_settings" ("key", "value", "_v") VALUES ('schema.insights', '1.
|
|
105
|
+
INSERT INTO "private_hot_updater_settings" ("key", "value", "_v") VALUES ('schema.insights', '1.4.0', 0) ON CONFLICT ("key") DO UPDATE SET "value" = excluded."value";
|
|
106
106
|
|
|
107
107
|
INSERT INTO "private_hot_updater_settings" ("key", "value", "_v") VALUES ('schema.apiKeys', '1.0.0', 0) ON CONFLICT ("key") DO UPDATE SET "value" = excluded."value";
|
package/worker/dist/README.md
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
This folder contains the built output assets for the worker "hot-updater" generated at 2026-10-
|
|
1
|
+
This folder contains the built output assets for the worker "hot-updater" generated at 2026-10-06T01:54:23.369Z.
|
package/worker/dist/index.js
CHANGED
|
@@ -4511,7 +4511,7 @@ var createSqlAdapter = /* @__PURE__ */ __name(({ executor, tablePrefix = "", max
|
|
|
4511
4511
|
}, "createSqlAdapter");
|
|
4512
4512
|
|
|
4513
4513
|
// ../../packages/server/dist/package.mjs
|
|
4514
|
-
var version = "1.0.0-rc.
|
|
4514
|
+
var version = "1.0.0-rc.33";
|
|
4515
4515
|
|
|
4516
4516
|
// ../../packages/server/dist/version.mjs
|
|
4517
4517
|
var HOT_UPDATER_SERVER_VERSION = version;
|
|
@@ -9747,7 +9747,7 @@ var createValidatedInsightsModel = /* @__PURE__ */ __name((model) => ({
|
|
|
9747
9747
|
async getReleaseActivity(input) {
|
|
9748
9748
|
if (!isRecord5(input) || !hasOnlyKeys(input, ["releases"]) || !Array.isArray(input.releases) || input.releases.length < 1 || input.releases.length > 100 || !input.releases.every(isReleaseReference)) invalidQuery();
|
|
9749
9749
|
const result = await model.getReleaseActivity(input);
|
|
9750
|
-
if (!isRecord5(result) || !isTimestamp(result.measuredAtMs) || !Array.isArray(result.data) || result.data.some((item) => !isRecord5(item) || !isReleaseReference(item.release) || !isRecord5(item.metrics) || !isTimestamp(item.metrics.downloads) || !isTimestamp(item.metrics.
|
|
9750
|
+
if (!isRecord5(result) || !isTimestamp(result.measuredAtMs) || !Array.isArray(result.data) || result.data.some((item) => !isRecord5(item) || !isReleaseReference(item.release) || !isRecord5(item.metrics) || !isTimestamp(item.metrics.downloads) || !isTimestamp(item.metrics.applies) || !isTimestamp(item.metrics.failedLaunches))) invalidResult();
|
|
9751
9751
|
return result;
|
|
9752
9752
|
},
|
|
9753
9753
|
async getAppUsage(input) {
|
|
@@ -10680,21 +10680,31 @@ var window = {
|
|
|
10680
10680
|
eq: ["identity"],
|
|
10681
10681
|
sort: ["bucket_start_ms"]
|
|
10682
10682
|
};
|
|
10683
|
+
var WINDOW_COUNTERS = [
|
|
10684
|
+
"downloads",
|
|
10685
|
+
"failed_launches",
|
|
10686
|
+
"patch_downloads",
|
|
10687
|
+
"patch_fallbacks"
|
|
10688
|
+
];
|
|
10683
10689
|
var counters = /* @__PURE__ */ __name((retention) => defineAggregate(identityFields, {
|
|
10684
10690
|
key: ["identity", "bucket_start_ms"],
|
|
10685
|
-
counters:
|
|
10686
|
-
"downloads",
|
|
10687
|
-
"launches",
|
|
10688
|
-
"failed_launches",
|
|
10689
|
-
"failed_updates",
|
|
10690
|
-
"patch_downloads",
|
|
10691
|
-
"patch_fallbacks"
|
|
10692
|
-
],
|
|
10691
|
+
counters: WINDOW_COUNTERS,
|
|
10693
10692
|
shards: COUNTER_SHARDS,
|
|
10694
10693
|
batched: true,
|
|
10695
10694
|
indexes: { window },
|
|
10696
|
-
|
|
10695
|
+
retention
|
|
10697
10696
|
}), "counters");
|
|
10697
|
+
var lifetimeCounters = /* @__PURE__ */ __name(() => defineAggregate(identityFields, {
|
|
10698
|
+
key: ["identity", "bucket_start_ms"],
|
|
10699
|
+
counters: [
|
|
10700
|
+
...WINDOW_COUNTERS,
|
|
10701
|
+
"applies",
|
|
10702
|
+
"failed_updates"
|
|
10703
|
+
],
|
|
10704
|
+
shards: COUNTER_SHARDS,
|
|
10705
|
+
batched: true,
|
|
10706
|
+
indexes: { window }
|
|
10707
|
+
}), "lifetimeCounters");
|
|
10698
10708
|
var sketches = /* @__PURE__ */ __name((retention) => defineAggregate(identityFields, {
|
|
10699
10709
|
key: ["identity", "bucket_start_ms"],
|
|
10700
10710
|
distinct: ["activity_users", "failed_users"],
|
|
@@ -10890,7 +10900,7 @@ var createInsightsSchema = /* @__PURE__ */ __name(({ rawDays, dailyDays } = DEFA
|
|
|
10890
10900
|
insights_overview_daily: counters(daily),
|
|
10891
10901
|
insights_sketches_daily: sketches(daily),
|
|
10892
10902
|
/** A release's counters since its first event, and its failed installations: kept. */
|
|
10893
|
-
insights_overview_lifetime:
|
|
10903
|
+
insights_overview_lifetime: lifetimeCounters(),
|
|
10894
10904
|
insights_sketches_lifetime: lifetimeSketches(),
|
|
10895
10905
|
insights_distribution: insightsDistribution(daily),
|
|
10896
10906
|
insights_latest_by_bundle: insightsLatestByBundle(daily),
|
|
@@ -10932,7 +10942,7 @@ var insightsOverviewDeltas = /* @__PURE__ */ __name((event) => {
|
|
|
10932
10942
|
counters2.set(key, {
|
|
10933
10943
|
identity,
|
|
10934
10944
|
downloads: (previous?.downloads ?? 0) + values.downloads,
|
|
10935
|
-
|
|
10945
|
+
applies: (previous?.applies ?? 0) + values.applies,
|
|
10936
10946
|
failedLaunches: (previous?.failedLaunches ?? 0) + values.failedLaunches,
|
|
10937
10947
|
activityIdentity: previous?.activityIdentity ?? values.activityIdentity
|
|
10938
10948
|
});
|
|
@@ -10940,7 +10950,7 @@ var insightsOverviewDeltas = /* @__PURE__ */ __name((event) => {
|
|
|
10940
10950
|
const metric = /* @__PURE__ */ __name((releaseId, values) => {
|
|
10941
10951
|
const windowed = {
|
|
10942
10952
|
...values,
|
|
10943
|
-
|
|
10953
|
+
applies: 0
|
|
10944
10954
|
};
|
|
10945
10955
|
if (releaseId !== null) for (const [periodKind, start] of [["lifetime", 0], ["hour", bucketStartMs]]) append({
|
|
10946
10956
|
scopeKind: "release",
|
|
@@ -10967,21 +10977,19 @@ var insightsOverviewDeltas = /* @__PURE__ */ __name((event) => {
|
|
|
10967
10977
|
}, "metric");
|
|
10968
10978
|
if (event.type === "UPDATE_DOWNLOADED") metric(event.to_release_id, {
|
|
10969
10979
|
downloads: 1,
|
|
10970
|
-
|
|
10980
|
+
applies: 0,
|
|
10971
10981
|
failedLaunches: 0
|
|
10972
10982
|
});
|
|
10973
|
-
else if (event.type
|
|
10974
|
-
|
|
10975
|
-
|
|
10976
|
-
|
|
10977
|
-
|
|
10978
|
-
|
|
10979
|
-
|
|
10980
|
-
|
|
10981
|
-
|
|
10982
|
-
|
|
10983
|
-
});
|
|
10984
|
-
}
|
|
10983
|
+
else if (event.type === "UPDATE_APPLIED") metric(event.to_release_id, {
|
|
10984
|
+
downloads: 0,
|
|
10985
|
+
applies: 1,
|
|
10986
|
+
failedLaunches: 0
|
|
10987
|
+
});
|
|
10988
|
+
else if (event.type === "RECOVERED") metric(event.from_release_id, {
|
|
10989
|
+
downloads: 0,
|
|
10990
|
+
applies: 0,
|
|
10991
|
+
failedLaunches: 1
|
|
10992
|
+
});
|
|
10985
10993
|
for (const platform of [event.platform, "all"]) for (const appVersionKind of ["specific", "all"]) append({
|
|
10986
10994
|
scopeKind: "usage",
|
|
10987
10995
|
releaseKind: "all",
|
|
@@ -10994,7 +11002,7 @@ var insightsOverviewDeltas = /* @__PURE__ */ __name((event) => {
|
|
|
10994
11002
|
bucketStartMs
|
|
10995
11003
|
}, {
|
|
10996
11004
|
downloads: 0,
|
|
10997
|
-
|
|
11005
|
+
applies: 0,
|
|
10998
11006
|
failedLaunches: 0,
|
|
10999
11007
|
activityIdentity: event.install_id
|
|
11000
11008
|
});
|
|
@@ -11083,7 +11091,7 @@ var countEvent = /* @__PURE__ */ __name((tx, event) => {
|
|
|
11083
11091
|
const counters2 = {
|
|
11084
11092
|
...Object.fromEntries([
|
|
11085
11093
|
["downloads", delta.downloads],
|
|
11086
|
-
["
|
|
11094
|
+
["applies", delta.applies],
|
|
11087
11095
|
["failed_launches", delta.failedLaunches]
|
|
11088
11096
|
].filter(([, value]) => value !== 0)),
|
|
11089
11097
|
...delta.downloads === 0 ? {} : patchCounters(event)
|
|
@@ -11560,7 +11568,7 @@ var lifetimeMetrics = /* @__PURE__ */ __name(async (db, release) => {
|
|
|
11560
11568
|
})).rows;
|
|
11561
11569
|
return {
|
|
11562
11570
|
downloads: lifetime?.downloads ?? 0,
|
|
11563
|
-
|
|
11571
|
+
applies: lifetime?.applies ?? 0,
|
|
11564
11572
|
failedLaunches: lifetime?.failed_launches ?? 0
|
|
11565
11573
|
};
|
|
11566
11574
|
}, "lifetimeMetrics");
|
|
@@ -12069,7 +12077,7 @@ var insights = /* @__PURE__ */ __name((options = {}) => {
|
|
|
12069
12077
|
const plugin = definePlugin({
|
|
12070
12078
|
id: "insights",
|
|
12071
12079
|
namespace: false,
|
|
12072
|
-
schemaVersion: "1.
|
|
12080
|
+
schemaVersion: "1.4.0",
|
|
12073
12081
|
schema: createInsightsSchema(retention),
|
|
12074
12082
|
init: /* @__PURE__ */ __name(({ db, now }) => {
|
|
12075
12083
|
const api = createInsightsApi(db, now, retention);
|