@hot-updater/cloudflare 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/index.d.cts +92 -1
- package/dist/index.d.mts +92 -1
- package/dist/worker/index.d.cts +92 -1
- package/dist/worker/index.d.mts +92 -1
- package/package.json +6 -6
- package/sql/bundles.sql +11 -1
- package/worker/dist/README.md +1 -1
- package/worker/dist/index.js +214 -13
- package/worker/dist/index.js.map +2 -2
- package/worker/migrations/0002_hot-updater_1.0.0-rc.30.sql +119 -0
package/dist/index.d.cts
CHANGED
|
@@ -192,9 +192,13 @@ interface ReleaseActivityMetrics {
|
|
|
192
192
|
readonly failedLaunches: number;
|
|
193
193
|
/** Omitted for lifetime-only bundle-row reads. */
|
|
194
194
|
readonly uniqueUsers?: number;
|
|
195
|
-
/**
|
|
195
|
+
/**
|
|
196
|
+
* Points of each UTC day, or of each `intervalMs` from the period's start
|
|
197
|
+
* on a release read that asks for one; present only for period reads.
|
|
198
|
+
*/
|
|
196
199
|
readonly series?: readonly {
|
|
197
200
|
readonly startMs: number;
|
|
201
|
+
readonly downloads: number;
|
|
198
202
|
readonly launches: number;
|
|
199
203
|
readonly failedLaunches: number;
|
|
200
204
|
}[];
|
|
@@ -202,10 +206,17 @@ interface ReleaseActivityMetrics {
|
|
|
202
206
|
type InsightsGetReleaseActivityInput = {
|
|
203
207
|
readonly releases: readonly ReleaseReference[];
|
|
204
208
|
readonly timeRange?: InsightsTimeRange;
|
|
209
|
+
/**
|
|
210
|
+
* Whole hours each series point spans, from `timeRange.start`, with
|
|
211
|
+
* every point present; omitted, the series has a point per UTC day
|
|
212
|
+
* with reports. Only with a `timeRange`.
|
|
213
|
+
*/
|
|
214
|
+
readonly intervalMs?: number;
|
|
205
215
|
readonly scope?: never;
|
|
206
216
|
} | {
|
|
207
217
|
readonly scope: InsightsScope;
|
|
208
218
|
readonly timeRange: InsightsTimeRange;
|
|
219
|
+
readonly intervalMs?: never;
|
|
209
220
|
readonly releases?: never;
|
|
210
221
|
};
|
|
211
222
|
interface InsightsGetReleaseActivityResult {
|
|
@@ -248,6 +259,23 @@ interface InsightsGetAppUsageResult {
|
|
|
248
259
|
}[];
|
|
249
260
|
readonly measuredAtMs: number;
|
|
250
261
|
}
|
|
262
|
+
/** Whole UTC days, at most 31, including the current unfinished day. */
|
|
263
|
+
interface InsightsGetDistributionHistoryInput extends InsightsScope {
|
|
264
|
+
readonly timeRange: InsightsTimeRange;
|
|
265
|
+
}
|
|
266
|
+
interface InsightsGetDistributionHistoryResult {
|
|
267
|
+
readonly coverage: InsightsCoverage;
|
|
268
|
+
readonly measuredAtMs: number;
|
|
269
|
+
readonly points: readonly {
|
|
270
|
+
readonly startMs: number;
|
|
271
|
+
readonly bundles: readonly {
|
|
272
|
+
readonly appVersion: string;
|
|
273
|
+
readonly releaseId: string | null;
|
|
274
|
+
readonly bundleKind: "release" | "builtin" | "unknown";
|
|
275
|
+
readonly installations: number;
|
|
276
|
+
}[];
|
|
277
|
+
}[];
|
|
278
|
+
}
|
|
251
279
|
//#endregion
|
|
252
280
|
//#region ../insights/dist/server/schema.d.mts
|
|
253
281
|
//#region src/server/schema.d.ts
|
|
@@ -589,6 +617,68 @@ declare const plugins: readonly [import("@hot-updater/plugin-core").HotUpdaterPl
|
|
|
589
617
|
readonly sort: readonly ["bucket_start_ms"];
|
|
590
618
|
};
|
|
591
619
|
}, never, readonly ["channel", "platform", "app_version", "release_id", "bucket_start_ms"]>;
|
|
620
|
+
readonly bundle_daily_heads: import("@hot-updater/plugin-core").TableDefinition<{
|
|
621
|
+
readonly install_id: {
|
|
622
|
+
readonly type: "string";
|
|
623
|
+
readonly maxLength: 255;
|
|
624
|
+
};
|
|
625
|
+
readonly bucket_start_ms: {
|
|
626
|
+
readonly type: "integer";
|
|
627
|
+
};
|
|
628
|
+
readonly id: {
|
|
629
|
+
readonly type: "string";
|
|
630
|
+
readonly maxLength: 36;
|
|
631
|
+
};
|
|
632
|
+
readonly received_at_ms: {
|
|
633
|
+
readonly type: "integer";
|
|
634
|
+
};
|
|
635
|
+
readonly channel: {
|
|
636
|
+
readonly type: "string";
|
|
637
|
+
};
|
|
638
|
+
readonly platform: {
|
|
639
|
+
readonly type: "string";
|
|
640
|
+
readonly maxLength: 16;
|
|
641
|
+
};
|
|
642
|
+
readonly app_version: {
|
|
643
|
+
readonly type: "string";
|
|
644
|
+
};
|
|
645
|
+
readonly release_id: {
|
|
646
|
+
readonly type: "string";
|
|
647
|
+
readonly maxLength: 36;
|
|
648
|
+
};
|
|
649
|
+
readonly bundle_kind: {
|
|
650
|
+
readonly type: "string";
|
|
651
|
+
readonly maxLength: 16;
|
|
652
|
+
};
|
|
653
|
+
}, Readonly<Record<string, import("@hot-updater/plugin-core").FieldType>>, {}, readonly ["install_id", "bucket_start_ms"]>;
|
|
654
|
+
readonly insights_distribution_history: import("@hot-updater/plugin-core").AggregateDefinition<{
|
|
655
|
+
readonly channel: {
|
|
656
|
+
readonly type: "string";
|
|
657
|
+
};
|
|
658
|
+
readonly platform: {
|
|
659
|
+
readonly type: "string";
|
|
660
|
+
readonly maxLength: 16;
|
|
661
|
+
};
|
|
662
|
+
readonly app_version: {
|
|
663
|
+
readonly type: "string";
|
|
664
|
+
};
|
|
665
|
+
readonly release_id: {
|
|
666
|
+
readonly type: "string";
|
|
667
|
+
readonly maxLength: 36;
|
|
668
|
+
};
|
|
669
|
+
readonly bundle_kind: {
|
|
670
|
+
readonly type: "string";
|
|
671
|
+
readonly maxLength: 16;
|
|
672
|
+
};
|
|
673
|
+
readonly bucket_start_ms: {
|
|
674
|
+
readonly type: "integer";
|
|
675
|
+
};
|
|
676
|
+
}, "installations", {
|
|
677
|
+
readonly byScope: {
|
|
678
|
+
readonly eq: readonly ["channel", "platform"];
|
|
679
|
+
readonly sort: readonly ["bucket_start_ms"];
|
|
680
|
+
};
|
|
681
|
+
}, never, readonly ["channel", "platform", "app_version", "release_id", "bundle_kind", "bucket_start_ms"]>;
|
|
592
682
|
readonly insights_latest_by_bundle: import("@hot-updater/plugin-core").AggregateDefinition<{
|
|
593
683
|
readonly platform: {
|
|
594
684
|
readonly type: "string";
|
|
@@ -685,6 +775,7 @@ declare const plugins: readonly [import("@hot-updater/plugin-core").HotUpdaterPl
|
|
|
685
775
|
countLatestEvents: (input: InsightsCountLatestEventsInput) => Promise<number>;
|
|
686
776
|
countEvents: (input: InsightsCountEventsInput) => Promise<number>;
|
|
687
777
|
getReleaseActivity: (input: InsightsGetReleaseActivityInput) => Promise<InsightsGetReleaseActivityResult>;
|
|
778
|
+
getDistributionHistory: (input: InsightsGetDistributionHistoryInput) => Promise<InsightsGetDistributionHistoryResult>;
|
|
688
779
|
getAppUsage: (input: InsightsGetAppUsageInput) => Promise<InsightsGetAppUsageResult>;
|
|
689
780
|
getUpdateFailures: (input: InsightsUpdateFailuresInput) => Promise<InsightsUpdateFailures>;
|
|
690
781
|
};
|
package/dist/index.d.mts
CHANGED
|
@@ -192,9 +192,13 @@ interface ReleaseActivityMetrics {
|
|
|
192
192
|
readonly failedLaunches: number;
|
|
193
193
|
/** Omitted for lifetime-only bundle-row reads. */
|
|
194
194
|
readonly uniqueUsers?: number;
|
|
195
|
-
/**
|
|
195
|
+
/**
|
|
196
|
+
* Points of each UTC day, or of each `intervalMs` from the period's start
|
|
197
|
+
* on a release read that asks for one; present only for period reads.
|
|
198
|
+
*/
|
|
196
199
|
readonly series?: readonly {
|
|
197
200
|
readonly startMs: number;
|
|
201
|
+
readonly downloads: number;
|
|
198
202
|
readonly launches: number;
|
|
199
203
|
readonly failedLaunches: number;
|
|
200
204
|
}[];
|
|
@@ -202,10 +206,17 @@ interface ReleaseActivityMetrics {
|
|
|
202
206
|
type InsightsGetReleaseActivityInput = {
|
|
203
207
|
readonly releases: readonly ReleaseReference[];
|
|
204
208
|
readonly timeRange?: InsightsTimeRange;
|
|
209
|
+
/**
|
|
210
|
+
* Whole hours each series point spans, from `timeRange.start`, with
|
|
211
|
+
* every point present; omitted, the series has a point per UTC day
|
|
212
|
+
* with reports. Only with a `timeRange`.
|
|
213
|
+
*/
|
|
214
|
+
readonly intervalMs?: number;
|
|
205
215
|
readonly scope?: never;
|
|
206
216
|
} | {
|
|
207
217
|
readonly scope: InsightsScope;
|
|
208
218
|
readonly timeRange: InsightsTimeRange;
|
|
219
|
+
readonly intervalMs?: never;
|
|
209
220
|
readonly releases?: never;
|
|
210
221
|
};
|
|
211
222
|
interface InsightsGetReleaseActivityResult {
|
|
@@ -248,6 +259,23 @@ interface InsightsGetAppUsageResult {
|
|
|
248
259
|
}[];
|
|
249
260
|
readonly measuredAtMs: number;
|
|
250
261
|
}
|
|
262
|
+
/** Whole UTC days, at most 31, including the current unfinished day. */
|
|
263
|
+
interface InsightsGetDistributionHistoryInput extends InsightsScope {
|
|
264
|
+
readonly timeRange: InsightsTimeRange;
|
|
265
|
+
}
|
|
266
|
+
interface InsightsGetDistributionHistoryResult {
|
|
267
|
+
readonly coverage: InsightsCoverage;
|
|
268
|
+
readonly measuredAtMs: number;
|
|
269
|
+
readonly points: readonly {
|
|
270
|
+
readonly startMs: number;
|
|
271
|
+
readonly bundles: readonly {
|
|
272
|
+
readonly appVersion: string;
|
|
273
|
+
readonly releaseId: string | null;
|
|
274
|
+
readonly bundleKind: "release" | "builtin" | "unknown";
|
|
275
|
+
readonly installations: number;
|
|
276
|
+
}[];
|
|
277
|
+
}[];
|
|
278
|
+
}
|
|
251
279
|
//#endregion
|
|
252
280
|
//#region ../insights/dist/server/schema.d.mts
|
|
253
281
|
//#region src/server/schema.d.ts
|
|
@@ -589,6 +617,68 @@ declare const plugins: readonly [import("@hot-updater/plugin-core").HotUpdaterPl
|
|
|
589
617
|
readonly sort: readonly ["bucket_start_ms"];
|
|
590
618
|
};
|
|
591
619
|
}, never, readonly ["channel", "platform", "app_version", "release_id", "bucket_start_ms"]>;
|
|
620
|
+
readonly bundle_daily_heads: import("@hot-updater/plugin-core").TableDefinition<{
|
|
621
|
+
readonly install_id: {
|
|
622
|
+
readonly type: "string";
|
|
623
|
+
readonly maxLength: 255;
|
|
624
|
+
};
|
|
625
|
+
readonly bucket_start_ms: {
|
|
626
|
+
readonly type: "integer";
|
|
627
|
+
};
|
|
628
|
+
readonly id: {
|
|
629
|
+
readonly type: "string";
|
|
630
|
+
readonly maxLength: 36;
|
|
631
|
+
};
|
|
632
|
+
readonly received_at_ms: {
|
|
633
|
+
readonly type: "integer";
|
|
634
|
+
};
|
|
635
|
+
readonly channel: {
|
|
636
|
+
readonly type: "string";
|
|
637
|
+
};
|
|
638
|
+
readonly platform: {
|
|
639
|
+
readonly type: "string";
|
|
640
|
+
readonly maxLength: 16;
|
|
641
|
+
};
|
|
642
|
+
readonly app_version: {
|
|
643
|
+
readonly type: "string";
|
|
644
|
+
};
|
|
645
|
+
readonly release_id: {
|
|
646
|
+
readonly type: "string";
|
|
647
|
+
readonly maxLength: 36;
|
|
648
|
+
};
|
|
649
|
+
readonly bundle_kind: {
|
|
650
|
+
readonly type: "string";
|
|
651
|
+
readonly maxLength: 16;
|
|
652
|
+
};
|
|
653
|
+
}, Readonly<Record<string, import("@hot-updater/plugin-core").FieldType>>, {}, readonly ["install_id", "bucket_start_ms"]>;
|
|
654
|
+
readonly insights_distribution_history: import("@hot-updater/plugin-core").AggregateDefinition<{
|
|
655
|
+
readonly channel: {
|
|
656
|
+
readonly type: "string";
|
|
657
|
+
};
|
|
658
|
+
readonly platform: {
|
|
659
|
+
readonly type: "string";
|
|
660
|
+
readonly maxLength: 16;
|
|
661
|
+
};
|
|
662
|
+
readonly app_version: {
|
|
663
|
+
readonly type: "string";
|
|
664
|
+
};
|
|
665
|
+
readonly release_id: {
|
|
666
|
+
readonly type: "string";
|
|
667
|
+
readonly maxLength: 36;
|
|
668
|
+
};
|
|
669
|
+
readonly bundle_kind: {
|
|
670
|
+
readonly type: "string";
|
|
671
|
+
readonly maxLength: 16;
|
|
672
|
+
};
|
|
673
|
+
readonly bucket_start_ms: {
|
|
674
|
+
readonly type: "integer";
|
|
675
|
+
};
|
|
676
|
+
}, "installations", {
|
|
677
|
+
readonly byScope: {
|
|
678
|
+
readonly eq: readonly ["channel", "platform"];
|
|
679
|
+
readonly sort: readonly ["bucket_start_ms"];
|
|
680
|
+
};
|
|
681
|
+
}, never, readonly ["channel", "platform", "app_version", "release_id", "bundle_kind", "bucket_start_ms"]>;
|
|
592
682
|
readonly insights_latest_by_bundle: import("@hot-updater/plugin-core").AggregateDefinition<{
|
|
593
683
|
readonly platform: {
|
|
594
684
|
readonly type: "string";
|
|
@@ -685,6 +775,7 @@ declare const plugins: readonly [import("@hot-updater/plugin-core").HotUpdaterPl
|
|
|
685
775
|
countLatestEvents: (input: InsightsCountLatestEventsInput) => Promise<number>;
|
|
686
776
|
countEvents: (input: InsightsCountEventsInput) => Promise<number>;
|
|
687
777
|
getReleaseActivity: (input: InsightsGetReleaseActivityInput) => Promise<InsightsGetReleaseActivityResult>;
|
|
778
|
+
getDistributionHistory: (input: InsightsGetDistributionHistoryInput) => Promise<InsightsGetDistributionHistoryResult>;
|
|
688
779
|
getAppUsage: (input: InsightsGetAppUsageInput) => Promise<InsightsGetAppUsageResult>;
|
|
689
780
|
getUpdateFailures: (input: InsightsUpdateFailuresInput) => Promise<InsightsUpdateFailures>;
|
|
690
781
|
};
|
package/dist/worker/index.d.cts
CHANGED
|
@@ -180,9 +180,13 @@ interface ReleaseActivityMetrics {
|
|
|
180
180
|
readonly failedLaunches: number;
|
|
181
181
|
/** Omitted for lifetime-only bundle-row reads. */
|
|
182
182
|
readonly uniqueUsers?: number;
|
|
183
|
-
/**
|
|
183
|
+
/**
|
|
184
|
+
* Points of each UTC day, or of each `intervalMs` from the period's start
|
|
185
|
+
* on a release read that asks for one; present only for period reads.
|
|
186
|
+
*/
|
|
184
187
|
readonly series?: readonly {
|
|
185
188
|
readonly startMs: number;
|
|
189
|
+
readonly downloads: number;
|
|
186
190
|
readonly launches: number;
|
|
187
191
|
readonly failedLaunches: number;
|
|
188
192
|
}[];
|
|
@@ -190,10 +194,17 @@ interface ReleaseActivityMetrics {
|
|
|
190
194
|
type InsightsGetReleaseActivityInput = {
|
|
191
195
|
readonly releases: readonly ReleaseReference[];
|
|
192
196
|
readonly timeRange?: InsightsTimeRange;
|
|
197
|
+
/**
|
|
198
|
+
* Whole hours each series point spans, from `timeRange.start`, with
|
|
199
|
+
* every point present; omitted, the series has a point per UTC day
|
|
200
|
+
* with reports. Only with a `timeRange`.
|
|
201
|
+
*/
|
|
202
|
+
readonly intervalMs?: number;
|
|
193
203
|
readonly scope?: never;
|
|
194
204
|
} | {
|
|
195
205
|
readonly scope: InsightsScope;
|
|
196
206
|
readonly timeRange: InsightsTimeRange;
|
|
207
|
+
readonly intervalMs?: never;
|
|
197
208
|
readonly releases?: never;
|
|
198
209
|
};
|
|
199
210
|
interface InsightsGetReleaseActivityResult {
|
|
@@ -236,6 +247,23 @@ interface InsightsGetAppUsageResult {
|
|
|
236
247
|
}[];
|
|
237
248
|
readonly measuredAtMs: number;
|
|
238
249
|
}
|
|
250
|
+
/** Whole UTC days, at most 31, including the current unfinished day. */
|
|
251
|
+
interface InsightsGetDistributionHistoryInput extends InsightsScope {
|
|
252
|
+
readonly timeRange: InsightsTimeRange;
|
|
253
|
+
}
|
|
254
|
+
interface InsightsGetDistributionHistoryResult {
|
|
255
|
+
readonly coverage: InsightsCoverage;
|
|
256
|
+
readonly measuredAtMs: number;
|
|
257
|
+
readonly points: readonly {
|
|
258
|
+
readonly startMs: number;
|
|
259
|
+
readonly bundles: readonly {
|
|
260
|
+
readonly appVersion: string;
|
|
261
|
+
readonly releaseId: string | null;
|
|
262
|
+
readonly bundleKind: "release" | "builtin" | "unknown";
|
|
263
|
+
readonly installations: number;
|
|
264
|
+
}[];
|
|
265
|
+
}[];
|
|
266
|
+
}
|
|
239
267
|
//#endregion
|
|
240
268
|
//#region ../insights/dist/server/schema.d.mts
|
|
241
269
|
//#region src/server/schema.d.ts
|
|
@@ -577,6 +605,68 @@ declare const plugins: readonly [import("@hot-updater/plugin-core").HotUpdaterPl
|
|
|
577
605
|
readonly sort: readonly ["bucket_start_ms"];
|
|
578
606
|
};
|
|
579
607
|
}, never, readonly ["channel", "platform", "app_version", "release_id", "bucket_start_ms"]>;
|
|
608
|
+
readonly bundle_daily_heads: import("@hot-updater/plugin-core").TableDefinition<{
|
|
609
|
+
readonly install_id: {
|
|
610
|
+
readonly type: "string";
|
|
611
|
+
readonly maxLength: 255;
|
|
612
|
+
};
|
|
613
|
+
readonly bucket_start_ms: {
|
|
614
|
+
readonly type: "integer";
|
|
615
|
+
};
|
|
616
|
+
readonly id: {
|
|
617
|
+
readonly type: "string";
|
|
618
|
+
readonly maxLength: 36;
|
|
619
|
+
};
|
|
620
|
+
readonly received_at_ms: {
|
|
621
|
+
readonly type: "integer";
|
|
622
|
+
};
|
|
623
|
+
readonly channel: {
|
|
624
|
+
readonly type: "string";
|
|
625
|
+
};
|
|
626
|
+
readonly platform: {
|
|
627
|
+
readonly type: "string";
|
|
628
|
+
readonly maxLength: 16;
|
|
629
|
+
};
|
|
630
|
+
readonly app_version: {
|
|
631
|
+
readonly type: "string";
|
|
632
|
+
};
|
|
633
|
+
readonly release_id: {
|
|
634
|
+
readonly type: "string";
|
|
635
|
+
readonly maxLength: 36;
|
|
636
|
+
};
|
|
637
|
+
readonly bundle_kind: {
|
|
638
|
+
readonly type: "string";
|
|
639
|
+
readonly maxLength: 16;
|
|
640
|
+
};
|
|
641
|
+
}, Readonly<Record<string, import("@hot-updater/plugin-core").FieldType>>, {}, readonly ["install_id", "bucket_start_ms"]>;
|
|
642
|
+
readonly insights_distribution_history: import("@hot-updater/plugin-core").AggregateDefinition<{
|
|
643
|
+
readonly channel: {
|
|
644
|
+
readonly type: "string";
|
|
645
|
+
};
|
|
646
|
+
readonly platform: {
|
|
647
|
+
readonly type: "string";
|
|
648
|
+
readonly maxLength: 16;
|
|
649
|
+
};
|
|
650
|
+
readonly app_version: {
|
|
651
|
+
readonly type: "string";
|
|
652
|
+
};
|
|
653
|
+
readonly release_id: {
|
|
654
|
+
readonly type: "string";
|
|
655
|
+
readonly maxLength: 36;
|
|
656
|
+
};
|
|
657
|
+
readonly bundle_kind: {
|
|
658
|
+
readonly type: "string";
|
|
659
|
+
readonly maxLength: 16;
|
|
660
|
+
};
|
|
661
|
+
readonly bucket_start_ms: {
|
|
662
|
+
readonly type: "integer";
|
|
663
|
+
};
|
|
664
|
+
}, "installations", {
|
|
665
|
+
readonly byScope: {
|
|
666
|
+
readonly eq: readonly ["channel", "platform"];
|
|
667
|
+
readonly sort: readonly ["bucket_start_ms"];
|
|
668
|
+
};
|
|
669
|
+
}, never, readonly ["channel", "platform", "app_version", "release_id", "bundle_kind", "bucket_start_ms"]>;
|
|
580
670
|
readonly insights_latest_by_bundle: import("@hot-updater/plugin-core").AggregateDefinition<{
|
|
581
671
|
readonly platform: {
|
|
582
672
|
readonly type: "string";
|
|
@@ -673,6 +763,7 @@ declare const plugins: readonly [import("@hot-updater/plugin-core").HotUpdaterPl
|
|
|
673
763
|
countLatestEvents: (input: InsightsCountLatestEventsInput) => Promise<number>;
|
|
674
764
|
countEvents: (input: InsightsCountEventsInput) => Promise<number>;
|
|
675
765
|
getReleaseActivity: (input: InsightsGetReleaseActivityInput) => Promise<InsightsGetReleaseActivityResult>;
|
|
766
|
+
getDistributionHistory: (input: InsightsGetDistributionHistoryInput) => Promise<InsightsGetDistributionHistoryResult>;
|
|
676
767
|
getAppUsage: (input: InsightsGetAppUsageInput) => Promise<InsightsGetAppUsageResult>;
|
|
677
768
|
getUpdateFailures: (input: InsightsUpdateFailuresInput) => Promise<InsightsUpdateFailures>;
|
|
678
769
|
};
|
package/dist/worker/index.d.mts
CHANGED
|
@@ -180,9 +180,13 @@ interface ReleaseActivityMetrics {
|
|
|
180
180
|
readonly failedLaunches: number;
|
|
181
181
|
/** Omitted for lifetime-only bundle-row reads. */
|
|
182
182
|
readonly uniqueUsers?: number;
|
|
183
|
-
/**
|
|
183
|
+
/**
|
|
184
|
+
* Points of each UTC day, or of each `intervalMs` from the period's start
|
|
185
|
+
* on a release read that asks for one; present only for period reads.
|
|
186
|
+
*/
|
|
184
187
|
readonly series?: readonly {
|
|
185
188
|
readonly startMs: number;
|
|
189
|
+
readonly downloads: number;
|
|
186
190
|
readonly launches: number;
|
|
187
191
|
readonly failedLaunches: number;
|
|
188
192
|
}[];
|
|
@@ -190,10 +194,17 @@ interface ReleaseActivityMetrics {
|
|
|
190
194
|
type InsightsGetReleaseActivityInput = {
|
|
191
195
|
readonly releases: readonly ReleaseReference[];
|
|
192
196
|
readonly timeRange?: InsightsTimeRange;
|
|
197
|
+
/**
|
|
198
|
+
* Whole hours each series point spans, from `timeRange.start`, with
|
|
199
|
+
* every point present; omitted, the series has a point per UTC day
|
|
200
|
+
* with reports. Only with a `timeRange`.
|
|
201
|
+
*/
|
|
202
|
+
readonly intervalMs?: number;
|
|
193
203
|
readonly scope?: never;
|
|
194
204
|
} | {
|
|
195
205
|
readonly scope: InsightsScope;
|
|
196
206
|
readonly timeRange: InsightsTimeRange;
|
|
207
|
+
readonly intervalMs?: never;
|
|
197
208
|
readonly releases?: never;
|
|
198
209
|
};
|
|
199
210
|
interface InsightsGetReleaseActivityResult {
|
|
@@ -236,6 +247,23 @@ interface InsightsGetAppUsageResult {
|
|
|
236
247
|
}[];
|
|
237
248
|
readonly measuredAtMs: number;
|
|
238
249
|
}
|
|
250
|
+
/** Whole UTC days, at most 31, including the current unfinished day. */
|
|
251
|
+
interface InsightsGetDistributionHistoryInput extends InsightsScope {
|
|
252
|
+
readonly timeRange: InsightsTimeRange;
|
|
253
|
+
}
|
|
254
|
+
interface InsightsGetDistributionHistoryResult {
|
|
255
|
+
readonly coverage: InsightsCoverage;
|
|
256
|
+
readonly measuredAtMs: number;
|
|
257
|
+
readonly points: readonly {
|
|
258
|
+
readonly startMs: number;
|
|
259
|
+
readonly bundles: readonly {
|
|
260
|
+
readonly appVersion: string;
|
|
261
|
+
readonly releaseId: string | null;
|
|
262
|
+
readonly bundleKind: "release" | "builtin" | "unknown";
|
|
263
|
+
readonly installations: number;
|
|
264
|
+
}[];
|
|
265
|
+
}[];
|
|
266
|
+
}
|
|
239
267
|
//#endregion
|
|
240
268
|
//#region ../insights/dist/server/schema.d.mts
|
|
241
269
|
//#region src/server/schema.d.ts
|
|
@@ -577,6 +605,68 @@ declare const plugins: readonly [import("@hot-updater/plugin-core").HotUpdaterPl
|
|
|
577
605
|
readonly sort: readonly ["bucket_start_ms"];
|
|
578
606
|
};
|
|
579
607
|
}, never, readonly ["channel", "platform", "app_version", "release_id", "bucket_start_ms"]>;
|
|
608
|
+
readonly bundle_daily_heads: import("@hot-updater/plugin-core").TableDefinition<{
|
|
609
|
+
readonly install_id: {
|
|
610
|
+
readonly type: "string";
|
|
611
|
+
readonly maxLength: 255;
|
|
612
|
+
};
|
|
613
|
+
readonly bucket_start_ms: {
|
|
614
|
+
readonly type: "integer";
|
|
615
|
+
};
|
|
616
|
+
readonly id: {
|
|
617
|
+
readonly type: "string";
|
|
618
|
+
readonly maxLength: 36;
|
|
619
|
+
};
|
|
620
|
+
readonly received_at_ms: {
|
|
621
|
+
readonly type: "integer";
|
|
622
|
+
};
|
|
623
|
+
readonly channel: {
|
|
624
|
+
readonly type: "string";
|
|
625
|
+
};
|
|
626
|
+
readonly platform: {
|
|
627
|
+
readonly type: "string";
|
|
628
|
+
readonly maxLength: 16;
|
|
629
|
+
};
|
|
630
|
+
readonly app_version: {
|
|
631
|
+
readonly type: "string";
|
|
632
|
+
};
|
|
633
|
+
readonly release_id: {
|
|
634
|
+
readonly type: "string";
|
|
635
|
+
readonly maxLength: 36;
|
|
636
|
+
};
|
|
637
|
+
readonly bundle_kind: {
|
|
638
|
+
readonly type: "string";
|
|
639
|
+
readonly maxLength: 16;
|
|
640
|
+
};
|
|
641
|
+
}, Readonly<Record<string, import("@hot-updater/plugin-core").FieldType>>, {}, readonly ["install_id", "bucket_start_ms"]>;
|
|
642
|
+
readonly insights_distribution_history: import("@hot-updater/plugin-core").AggregateDefinition<{
|
|
643
|
+
readonly channel: {
|
|
644
|
+
readonly type: "string";
|
|
645
|
+
};
|
|
646
|
+
readonly platform: {
|
|
647
|
+
readonly type: "string";
|
|
648
|
+
readonly maxLength: 16;
|
|
649
|
+
};
|
|
650
|
+
readonly app_version: {
|
|
651
|
+
readonly type: "string";
|
|
652
|
+
};
|
|
653
|
+
readonly release_id: {
|
|
654
|
+
readonly type: "string";
|
|
655
|
+
readonly maxLength: 36;
|
|
656
|
+
};
|
|
657
|
+
readonly bundle_kind: {
|
|
658
|
+
readonly type: "string";
|
|
659
|
+
readonly maxLength: 16;
|
|
660
|
+
};
|
|
661
|
+
readonly bucket_start_ms: {
|
|
662
|
+
readonly type: "integer";
|
|
663
|
+
};
|
|
664
|
+
}, "installations", {
|
|
665
|
+
readonly byScope: {
|
|
666
|
+
readonly eq: readonly ["channel", "platform"];
|
|
667
|
+
readonly sort: readonly ["bucket_start_ms"];
|
|
668
|
+
};
|
|
669
|
+
}, never, readonly ["channel", "platform", "app_version", "release_id", "bundle_kind", "bucket_start_ms"]>;
|
|
580
670
|
readonly insights_latest_by_bundle: import("@hot-updater/plugin-core").AggregateDefinition<{
|
|
581
671
|
readonly platform: {
|
|
582
672
|
readonly type: "string";
|
|
@@ -673,6 +763,7 @@ declare const plugins: readonly [import("@hot-updater/plugin-core").HotUpdaterPl
|
|
|
673
763
|
countLatestEvents: (input: InsightsCountLatestEventsInput) => Promise<number>;
|
|
674
764
|
countEvents: (input: InsightsCountEventsInput) => Promise<number>;
|
|
675
765
|
getReleaseActivity: (input: InsightsGetReleaseActivityInput) => Promise<InsightsGetReleaseActivityResult>;
|
|
766
|
+
getDistributionHistory: (input: InsightsGetDistributionHistoryInput) => Promise<InsightsGetDistributionHistoryResult>;
|
|
676
767
|
getAppUsage: (input: InsightsGetAppUsageInput) => Promise<InsightsGetAppUsageResult>;
|
|
677
768
|
getUpdateFailures: (input: InsightsUpdateFailuresInput) => Promise<InsightsUpdateFailures>;
|
|
678
769
|
};
|
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.30",
|
|
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/
|
|
61
|
-
"@hot-updater/server": "1.0.0-rc.
|
|
62
|
-
"@hot-updater/
|
|
59
|
+
"@hot-updater/cli-tools": "1.0.0-rc.30",
|
|
60
|
+
"@hot-updater/plugin-core": "1.0.0-rc.28",
|
|
61
|
+
"@hot-updater/server": "1.0.0-rc.30",
|
|
62
|
+
"@hot-updater/protocol": "1.0.0-rc.28"
|
|
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.29"
|
|
79
79
|
},
|
|
80
80
|
"scripts": {
|
|
81
81
|
"build": "tsdown && pnpm build:worker",
|
package/sql/bundles.sql
CHANGED
|
@@ -80,6 +80,16 @@ CREATE INDEX IF NOT EXISTS "insights_distribution_byVersion" ON "insights_distri
|
|
|
80
80
|
|
|
81
81
|
CREATE INDEX IF NOT EXISTS "insights_distribution__retention" ON "insights_distribution" ("bucket_start_ms", "channel", "platform", "app_version", "release_id", "_shard");
|
|
82
82
|
|
|
83
|
+
CREATE TABLE IF NOT EXISTS "bundle_daily_heads" ("install_id" TEXT NOT NULL, "bucket_start_ms" INTEGER NOT NULL, "id" TEXT NOT NULL, "received_at_ms" INTEGER NOT NULL, "channel" TEXT NOT NULL, "platform" TEXT NOT NULL, "app_version" TEXT NOT NULL, "release_id" TEXT NOT NULL, "bundle_kind" TEXT NOT NULL, "_v" INTEGER NOT NULL DEFAULT 0, PRIMARY KEY ("install_id", "bucket_start_ms"));
|
|
84
|
+
|
|
85
|
+
CREATE INDEX IF NOT EXISTS "bundle_daily_heads__retention" ON "bundle_daily_heads" ("bucket_start_ms", "install_id");
|
|
86
|
+
|
|
87
|
+
CREATE TABLE IF NOT EXISTS "insights_distribution_history" ("channel" TEXT NOT NULL, "platform" TEXT NOT NULL, "app_version" TEXT NOT NULL, "release_id" TEXT NOT NULL, "bundle_kind" TEXT NOT NULL, "bucket_start_ms" INTEGER NOT NULL, "_shard" INTEGER NOT NULL, "installations" INTEGER NOT NULL, "_v" INTEGER NOT NULL DEFAULT 0, PRIMARY KEY ("channel", "platform", "app_version", "release_id", "bundle_kind", "bucket_start_ms", "_shard"));
|
|
88
|
+
|
|
89
|
+
CREATE INDEX IF NOT EXISTS "insights_distribution_history_byScope" ON "insights_distribution_history" ("channel", "platform", "bucket_start_ms", "app_version", "release_id", "bundle_kind", "_shard");
|
|
90
|
+
|
|
91
|
+
CREATE INDEX IF NOT EXISTS "insights_distribution_history__retention" ON "insights_distribution_history" ("bucket_start_ms", "channel", "platform", "app_version", "release_id", "bundle_kind", "_shard");
|
|
92
|
+
|
|
83
93
|
CREATE TABLE IF NOT EXISTS "insights_latest_by_bundle" ("platform" TEXT NOT NULL, "channel" TEXT NOT NULL, "bundle_field" TEXT NOT NULL, "bundle_id" TEXT NOT NULL, "type" TEXT NOT NULL, "bucket_start_ms" INTEGER NOT NULL, "_shard" INTEGER NOT NULL, "installations" INTEGER NOT NULL, "_v" INTEGER NOT NULL DEFAULT 0, PRIMARY KEY ("platform", "channel", "bundle_field", "bundle_id", "type", "bucket_start_ms", "_shard"));
|
|
84
94
|
|
|
85
95
|
CREATE INDEX IF NOT EXISTS "insights_latest_by_bundle__retention" ON "insights_latest_by_bundle" ("bucket_start_ms", "platform", "channel", "bundle_field", "bundle_id", "type", "_shard");
|
|
@@ -104,6 +114,6 @@ INSERT INTO "private_hot_updater_settings" ("key", "value", "_v") VALUES ('schem
|
|
|
104
114
|
|
|
105
115
|
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";
|
|
106
116
|
|
|
107
|
-
INSERT INTO "private_hot_updater_settings" ("key", "value", "_v") VALUES ('schema.insights', '1.
|
|
117
|
+
INSERT INTO "private_hot_updater_settings" ("key", "value", "_v") VALUES ('schema.insights', '1.3.0', 0) ON CONFLICT ("key") DO UPDATE SET "value" = excluded."value";
|
|
108
118
|
|
|
109
119
|
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-03T16:41:41.572Z.
|