@hot-updater/aws 1.0.0-rc.18 → 1.0.0-rc.21

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.cjs CHANGED
@@ -1,13 +1,12 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  let _aws_sdk_client_dynamodb = require("@aws-sdk/client-dynamodb");
3
- let _hot_updater_server_database = require("@hot-updater/server/database");
3
+ let _hot_updater_plugin_core = require("@hot-updater/plugin-core");
4
4
  let _aws_sdk_client_cloudfront = require("@aws-sdk/client-cloudfront");
5
5
  let _aws_sdk_lib_dynamodb = require("@aws-sdk/lib-dynamodb");
6
6
  let _aws_sdk_client_ssm = require("@aws-sdk/client-ssm");
7
7
  let _aws_sdk_cloudfront_signer = require("@aws-sdk/cloudfront-signer");
8
8
  let _aws_sdk_client_s3 = require("@aws-sdk/client-s3");
9
9
  let _aws_sdk_lib_storage = require("@aws-sdk/lib-storage");
10
- let _hot_updater_plugin_core = require("@hot-updater/plugin-core");
11
10
  let _hot_updater_server_plugins_api_keys = require("@hot-updater/server/plugins/api-keys");
12
11
  let _hot_updater_server_plugins_insights = require("@hot-updater/server/plugins/insights");
13
12
  //#region src/cloudFrontInvalidation.ts
@@ -327,7 +326,7 @@ const adapterOf = ({ tableName, ...clientConfig }) => {
327
326
  });
328
327
  return {
329
328
  client,
330
- adapter: (0, _hot_updater_server_database.createKvAdapter)({ store })
329
+ adapter: (0, _hot_updater_plugin_core.createKvAdapter)({ store })
331
330
  };
332
331
  };
333
332
  /**
@@ -338,7 +337,7 @@ const adapterOf = ({ tableName, ...clientConfig }) => {
338
337
  */
339
338
  const migrateDynamoDB = (config, plugins = []) => {
340
339
  const { client, adapter } = adapterOf(config);
341
- return (0, _hot_updater_server_database.migrateCoreSchema)(adapter, "dynamoDB", plugins).finally(() => client.destroy());
340
+ return (0, _hot_updater_plugin_core.migrateCoreSchema)(adapter, "dynamoDB", plugins).finally(() => client.destroy());
342
341
  };
343
342
  /**
344
343
  * Hot Updater's database on one DynamoDB table, through the storage engine.
@@ -349,7 +348,7 @@ const dynamoDB = (config) => {
349
348
  const { client, adapter } = adapterOf(config);
350
349
  const cloudFront = createUpdateRouteInvalidation(config);
351
350
  return {
352
- ...(0, _hot_updater_server_database.createEngineDatabase)({
351
+ ...(0, _hot_updater_plugin_core.createEngineDatabase)({
353
352
  name: "dynamoDB",
354
353
  adapter,
355
354
  onCachedRoutesChange: cloudFront?.invalidate,
@@ -450,6 +449,21 @@ function s3Storage(config) {
450
449
  const value = [normalizedBasePath, normalizedPrefix].filter(Boolean).join("/");
451
450
  return value ? `${value}/` : "";
452
451
  };
452
+ /**
453
+ * The URI `put` returns for the key, or null for a key no `put` writes,
454
+ * such as a folder marker that ends in "/".
455
+ */
456
+ const getListedStorageUri = (key) => {
457
+ try {
458
+ return (0, _hot_updater_plugin_core.createStorageUri)({
459
+ bucket: bucketName,
460
+ key,
461
+ protocol: "s3"
462
+ });
463
+ } catch {
464
+ return null;
465
+ }
466
+ };
453
467
  const getRelativeKey = (key) => {
454
468
  if (!normalizedBasePath) return key;
455
469
  const basePrefix = `${normalizedBasePath}/`;
@@ -460,7 +474,7 @@ function s3Storage(config) {
460
474
  if (parsed.bucket !== bucketName) throw new Error(`Bucket name mismatch: expected "${bucketName}", but found "${parsed.bucket}".`);
461
475
  return parsed;
462
476
  };
463
- return (0, _hot_updater_plugin_core.createStoragePlugin)({
477
+ return (0, _hot_updater_plugin_core.createStorageAdapter)({
464
478
  name: "s3Storage",
465
479
  protocol: "s3",
466
480
  async listObjects(prefix) {
@@ -474,11 +488,13 @@ function s3Storage(config) {
474
488
  }));
475
489
  for (const object of response.Contents ?? []) {
476
490
  if (!object.Key) continue;
491
+ const storageUri = getListedStorageUri(object.Key);
492
+ if (storageUri === null) continue;
477
493
  objects.push({
478
494
  key: getRelativeKey(object.Key),
479
495
  lastModifiedAt: object.LastModified,
480
496
  size: object.Size ?? 0,
481
- storageUri: `s3://${bucketName}/${object.Key}`
497
+ storageUri
482
498
  });
483
499
  }
484
500
  continuationToken = response.NextContinuationToken;
package/dist/index.d.cts CHANGED
@@ -1,6 +1,5 @@
1
1
  import { DynamoDBClientConfig } from "@aws-sdk/client-dynamodb";
2
- import { EngineDatabase, StoragePlugin, StoragePluginWith } from "@hot-updater/plugin-core";
3
- import { PluginTables } from "@hot-updater/server/database";
2
+ import { DatabaseJsonObject, EngineDatabase, Platform, PluginTables, StorageAdapter, StorageAdapterWith } from "@hot-updater/plugin-core";
4
3
  import { S3ClientConfig } from "@aws-sdk/client-s3";
5
4
  //#region src/dynamoDB.d.ts
6
5
  interface DynamoDBConfig extends DynamoDBClientConfig {
@@ -58,24 +57,314 @@ interface S3StorageConfig extends S3ClientConfig {
58
57
  /** Base path where bundles will be stored in the bucket. */
59
58
  basePath?: string;
60
59
  downloadUrlSigningKey?: string;
61
- getDownloadUrl?: StoragePlugin["getDownloadUrl"];
60
+ getDownloadUrl?: StorageAdapter["getDownloadUrl"];
62
61
  }
63
62
  type S3StorageConfigWithDownloadUrl = S3StorageConfig & ({
64
63
  downloadUrlSigningKey: string;
65
64
  } | {
66
- getDownloadUrl: NonNullable<StoragePlugin["getDownloadUrl"]>;
65
+ getDownloadUrl: NonNullable<StorageAdapter["getDownloadUrl"]>;
67
66
  });
68
67
  type S3StorageOperations = "put" | "get" | "exists" | "delete" | "listObjects" | "deleteObjects";
69
- declare function s3Storage(config: S3StorageConfigWithDownloadUrl): StoragePluginWith<S3StorageOperations | "getDownloadUrl">;
70
- declare function s3Storage(config: S3StorageConfig): StoragePluginWith<S3StorageOperations>;
68
+ declare function s3Storage(config: S3StorageConfigWithDownloadUrl): StorageAdapterWith<S3StorageOperations | "getDownloadUrl">;
69
+ declare function s3Storage(config: S3StorageConfig): StorageAdapterWith<S3StorageOperations>;
70
+ //#endregion
71
+ //#region ../insights/dist/server/eventRow.d.mts
72
+ //#region src/server/eventRow.d.ts
73
+ /** Where an update failed, and what failed; open sets, `unknown` for any other value. */
74
+ type BundleEventFailureStage = "check" | "download" | "install" | "unknown";
75
+ type BundleEventFailureReason = "network" | "http" | "invalid_response" | "hash_mismatch" | "signature" | "patch" | "extract" | "storage" | "unknown";
76
+ /** An `UPDATE_FAILED` report's failure, as stored. */
77
+ type BundleEventFailure = DatabaseJsonObject & {
78
+ readonly stage: BundleEventFailureStage;
79
+ readonly reason: BundleEventFailureReason;
80
+ /** What the client was fetching or writing. */
81
+ readonly resource?: "catalog" | "artifact" | "manifest" | "file" | "patch" | "archive" | "unknown";
82
+ readonly http_status?: number;
83
+ /** How the connection failed, when it did. */
84
+ readonly transport?: "timeout" | "dns" | "tls" | "connection" | "offline" | "cancelled" | "unknown";
85
+ /** The storage origin's error code, such as `ExpiredToken`. */
86
+ readonly origin_code?: string;
87
+ /** Android's `ApplicationExitInfo` reason for the process before this one. */
88
+ readonly previous_process_exit?: string;
89
+ };
90
+ /** Ancillary report data; queryable identity and lifecycle fields stay on the row. */
91
+ type DatabaseBundleEventMetadata = DatabaseJsonObject & {
92
+ readonly cohort: string;
93
+ readonly update_strategy: "fingerprint" | "appVersion" | null;
94
+ readonly fingerprint_hash: string | null;
95
+ readonly sdk_version: string | null;
96
+ /** `UPDATE_FAILED`: what failed. */
97
+ readonly failure?: BundleEventFailure;
98
+ /** `UPDATE_DOWNLOADED`: how the bundle arrived. */
99
+ readonly delivery?: "patch" | "manifest" | "archive" | "unknown";
100
+ /** `UPDATE_DOWNLOADED`: a patch failed and the full files came instead. */
101
+ readonly patch_fallback?: boolean;
102
+ /** `RECOVERED`: Android's `ApplicationExitInfo` reason for the crashed process. */
103
+ readonly previous_process_exit?: string;
104
+ };
105
+ type BundleEventRowBase = {
106
+ readonly id: string;
107
+ readonly install_id: string;
108
+ readonly user_id: string | null;
109
+ readonly from_release_id: string | null;
110
+ readonly to_release_id: string | null;
111
+ readonly to_bundle_id: string;
112
+ readonly platform: Platform;
113
+ readonly app_version: string;
114
+ readonly channel: string;
115
+ readonly metadata: DatabaseBundleEventMetadata;
116
+ readonly received_at_ms: number;
117
+ };
118
+ type BundleEventRow = BundleEventRowBase & ({
119
+ readonly type: "UPDATE_DOWNLOADED";
120
+ readonly from_bundle_id: string;
121
+ } | {
122
+ readonly type: "UPDATE_APPLIED" | "RECOVERED";
123
+ readonly from_bundle_id: string;
124
+ } |
125
+ /** An update that failed: `from` is the running bundle, `to` the target (for a check, the running bundle). */
126
+ {
127
+ readonly type: "UPDATE_FAILED";
128
+ readonly from_bundle_id: string;
129
+ } | {
130
+ readonly type: "UNCHANGED";
131
+ readonly from_bundle_id: null;
132
+ });
133
+ //#endregion
134
+ //#region ../insights/dist/server/modelTypes.d.mts
135
+ //#region src/server/modelTypes.d.ts
136
+ interface InsightsEventCursor {
137
+ readonly receivedAtMs: number;
138
+ readonly id: string;
139
+ }
140
+ interface InsightsScope {
141
+ readonly platform: "ios" | "android";
142
+ readonly channel: string;
143
+ }
144
+ /**
145
+ * Raw event predicates; recovery is attributed to the source bundle. An
146
+ * UNCHANGED report is kept as no event, so no filter names it.
147
+ */
148
+ type InsightsBundleEventFilter = InsightsScope & ({
149
+ readonly type: "RECOVERED";
150
+ readonly fromBundleId: string;
151
+ } | {
152
+ readonly type: "UPDATE_DOWNLOADED" | "UPDATE_APPLIED" | "UPDATE_FAILED";
153
+ readonly toBundleId: string;
154
+ });
155
+ type InsightsEventFilter = {
156
+ readonly kind: "all";
157
+ } | {
158
+ readonly kind: "installationMovement";
159
+ readonly installId: string;
160
+ } | ({
161
+ readonly kind: "bundle";
162
+ } & InsightsBundleEventFilter);
163
+ interface InsightsListEventsInput {
164
+ readonly filter: InsightsEventFilter;
165
+ readonly sinceMs?: number;
166
+ readonly beforeReceivedAtMs: number;
167
+ readonly after?: InsightsEventCursor;
168
+ readonly limit: number;
169
+ }
170
+ type InsightsFindLatestEventsInput = {
171
+ readonly installId: string;
172
+ } | {
173
+ readonly userId: string;
174
+ readonly afterInstallId?: string;
175
+ readonly limit: number;
176
+ };
177
+ interface InsightsCountLatestEventsInput extends InsightsScope {
178
+ /** A UTC day's start: latest events are counted by the day they fall in. */
179
+ readonly sinceMs: number;
180
+ /** Optional OR of one or two fixed predicates; count a matching event once. */
181
+ readonly bundle?: readonly {
182
+ readonly field: "from_bundle_id" | "to_bundle_id";
183
+ readonly value: string;
184
+ readonly types: readonly BundleEventRow["type"][];
185
+ }[];
186
+ }
187
+ interface InsightsCountEventsInput {
188
+ readonly filter: InsightsBundleEventFilter;
189
+ readonly sinceMs: number;
190
+ readonly beforeReceivedAtMs: number;
191
+ }
192
+ interface ReleaseReference {
193
+ readonly releaseId: string;
194
+ readonly platform: "ios" | "android";
195
+ readonly channel: string;
196
+ }
197
+ interface InsightsTimeRange {
198
+ /** Inclusive UTC Unix timestamp in milliseconds. */
199
+ readonly start: number;
200
+ /** Exclusive UTC Unix timestamp in milliseconds. */
201
+ readonly end: number;
202
+ }
203
+ type InsightsCoverage = {
204
+ readonly kind: "complete";
205
+ readonly sinceMs: number;
206
+ } | {
207
+ readonly kind: "partial";
208
+ readonly sinceMs: number | null;
209
+ };
210
+ interface ReleaseActivityMetrics {
211
+ readonly downloads: number;
212
+ readonly launches: number;
213
+ readonly failedLaunches: number;
214
+ /** Omitted for lifetime-only bundle-row reads. */
215
+ readonly uniqueUsers?: number;
216
+ /** Daily points, present only for period reads. */
217
+ readonly series?: readonly {
218
+ readonly startMs: number;
219
+ readonly launches: number;
220
+ readonly failedLaunches: number;
221
+ }[];
222
+ }
223
+ type InsightsGetReleaseActivityInput = {
224
+ readonly releases: readonly ReleaseReference[];
225
+ readonly timeRange?: InsightsTimeRange;
226
+ readonly scope?: never;
227
+ } | {
228
+ readonly scope: InsightsScope;
229
+ readonly timeRange: InsightsTimeRange;
230
+ readonly releases?: never;
231
+ };
232
+ interface InsightsGetReleaseActivityResult {
233
+ readonly coverage: InsightsCoverage;
234
+ readonly data: readonly {
235
+ readonly release?: ReleaseReference;
236
+ readonly scope?: InsightsScope;
237
+ readonly metrics: ReleaseActivityMetrics;
238
+ }[];
239
+ readonly measuredAtMs: number;
240
+ }
241
+ interface InsightsGetAppUsageInput {
242
+ readonly channel: string;
243
+ readonly platform: "all" | "ios" | "android";
244
+ readonly appVersion?: string;
245
+ readonly timeRange: InsightsTimeRange;
246
+ readonly intervalMs: number;
247
+ }
248
+ interface InsightsGetAppUsageResult {
249
+ readonly coverage: InsightsCoverage;
250
+ readonly activeInstallations: number;
251
+ readonly points: readonly {
252
+ readonly startMs: number;
253
+ readonly installations: number;
254
+ }[];
255
+ readonly appVersions: readonly string[];
256
+ readonly versions: readonly {
257
+ readonly name: string;
258
+ readonly installations: number;
259
+ }[];
260
+ readonly platforms: readonly {
261
+ readonly name: string;
262
+ readonly installations: number;
263
+ }[];
264
+ readonly bundleDistribution: readonly {
265
+ readonly appVersion: string;
266
+ readonly platform: "ios" | "android";
267
+ readonly releaseId: string | null;
268
+ readonly installations: number;
269
+ }[];
270
+ readonly measuredAtMs: number;
271
+ }
272
+ //#endregion
273
+ //#region ../insights/dist/server/schema.d.mts
274
+ //#region src/server/schema.d.ts
275
+ /** How long Insights keeps its rows, in whole days. Lifetime counters are kept. */
276
+ interface InsightsRetention {
277
+ /** Raw events and hourly rollups. */
278
+ readonly rawDays: number;
279
+ /** Daily rollups, and each installation's latest event and the gauges that count it. */
280
+ readonly dailyDays: number;
281
+ }
282
+ //#endregion
283
+ //#region ../insights/dist/server/reads.d.mts
284
+ //#region src/server/reads.d.ts
285
+ interface InsightsUpdateFailuresInput {
286
+ readonly platform: "ios" | "android";
287
+ readonly channel: string;
288
+ /** A release's failures; without it, the channel's, which need a time range. */
289
+ readonly releaseId?: string;
290
+ /** Without it, a release's failures since its first report. */
291
+ readonly timeRange?: InsightsTimeRange;
292
+ }
293
+ /** Update failures of one stage and reason, and what else their clients knew. */
294
+ interface InsightsFailureBreakdown {
295
+ readonly stage: string;
296
+ readonly reason: string;
297
+ readonly events: number;
298
+ /** By resource, HTTP status, origin code, and transport, most first. */
299
+ readonly details: readonly {
300
+ readonly resource: string | null;
301
+ readonly httpStatus: number | null;
302
+ readonly originCode: string | null;
303
+ readonly transport: string | null;
304
+ readonly events: number;
305
+ }[];
306
+ }
307
+ interface InsightsUpdateFailures {
308
+ readonly coverage: InsightsCoverage;
309
+ readonly measuredAtMs: number;
310
+ /** Update failures other than failed checks: each client reports one at most once a UTC day. */
311
+ readonly failedUpdates: number;
312
+ /** Installations with such a failure, estimated. */
313
+ readonly failedInstallations: number;
314
+ /** Download reports: each installation reports a bundle's download once. */
315
+ readonly downloads: number;
316
+ /** Downloads a patch delivered, and those that fell back from a patch to files or the archive. */
317
+ readonly patchDownloads: number;
318
+ readonly patchFallbacks: number;
319
+ /** A channel's failed update checks, installations with one, and its active installations, estimated. */
320
+ readonly checks?: {
321
+ readonly failures: number;
322
+ readonly failedInstallations: number;
323
+ readonly activeInstallations: number;
324
+ };
325
+ /** Over a time range: failures by stage and reason, most first. */
326
+ readonly breakdown?: readonly InsightsFailureBreakdown[];
327
+ /**
328
+ * Over a time range: failed launches, and the recoveries whose crashed
329
+ * process exited for a reason Android 11+ reported, by reason, most first.
330
+ */
331
+ readonly recoveries?: {
332
+ readonly failedLaunches: number;
333
+ readonly byExitReason: readonly {
334
+ readonly exitReason: string;
335
+ readonly events: number;
336
+ }[];
337
+ };
338
+ }
339
+ //#endregion
340
+ //#region ../api-keys/dist/server/model.d.mts
341
+ //#region src/server/model.d.ts
342
+ interface ApiKeyRow {
343
+ readonly id: string;
344
+ readonly hash: string;
345
+ readonly name: string;
346
+ readonly prefix: string;
347
+ readonly role: "client";
348
+ readonly created_at_ms: number;
349
+ readonly revoked_at_ms: number | null;
350
+ }
351
+ //#endregion
352
+ //#region ../api-keys/dist/server/apiKeys.d.mts
353
+ type ApiKeyMetadata = Omit<ApiKeyRow, "hash">;
354
+ interface CreatedApiKey {
355
+ /** Plaintext credential. It cannot be recovered after this call returns. */
356
+ readonly apiKey: string;
357
+ /** Non-secret metadata. The persisted SHA-256 hash is never exposed. */
358
+ readonly record: ApiKeyMetadata;
359
+ }
71
360
  //#endregion
72
361
  //#region src/plugins.d.ts
73
362
  /**
74
363
  * The plugins the managed AWS server runs: Insights, and API keys on every
75
364
  * client route. Its Lambda@Edge function imports this list.
76
365
  */
77
- declare const plugins: readonly [import("@hot-updater/server/plugins").HotUpdaterPlugin<"insights", {
78
- readonly bundle_events: import("@hot-updater/server/database").TableDefinition<{
366
+ declare const plugins: readonly [import("@hot-updater/plugin-core").HotUpdaterPlugin<"insights", {
367
+ readonly bundle_events: import("@hot-updater/plugin-core").TableDefinition<{
79
368
  readonly id: {
80
369
  readonly type: "string";
81
370
  readonly maxLength: 36;
@@ -150,7 +439,7 @@ declare const plugins: readonly [import("@hot-updater/server/plugins").HotUpdate
150
439
  readonly sort: readonly ["received_at_ms"];
151
440
  };
152
441
  }, readonly ["id"]>;
153
- readonly bundle_event_heads: import("@hot-updater/server/database").TableDefinition<{
442
+ readonly bundle_event_heads: import("@hot-updater/plugin-core").TableDefinition<{
154
443
  readonly install_id: {
155
444
  readonly type: "string";
156
445
  readonly maxLength: 255;
@@ -203,13 +492,13 @@ declare const plugins: readonly [import("@hot-updater/server/plugins").HotUpdate
203
492
  readonly received_at_ms: {
204
493
  readonly type: "integer";
205
494
  };
206
- }, Readonly<Record<string, import("@hot-updater/server/database").FieldType>>, {
495
+ }, Readonly<Record<string, import("@hot-updater/plugin-core").FieldType>>, {
207
496
  readonly byUser: {
208
497
  readonly eq: readonly ["user_id"];
209
498
  readonly sort: readonly ["install_id"];
210
499
  };
211
500
  }, readonly ["install_id"]>;
212
- readonly insights_overview: import("@hot-updater/server/database").AggregateDefinition<{
501
+ readonly insights_overview: import("@hot-updater/plugin-core").AggregateDefinition<{
213
502
  readonly identity: {
214
503
  readonly type: "string";
215
504
  readonly maxLength: 32;
@@ -223,7 +512,7 @@ declare const plugins: readonly [import("@hot-updater/server/plugins").HotUpdate
223
512
  readonly sort: readonly ["bucket_start_ms"];
224
513
  };
225
514
  }, never, readonly ["identity", "bucket_start_ms"]>;
226
- readonly insights_sketches: import("@hot-updater/server/database").AggregateDefinition<{
515
+ readonly insights_sketches: import("@hot-updater/plugin-core").AggregateDefinition<{
227
516
  readonly identity: {
228
517
  readonly type: "string";
229
518
  readonly maxLength: 32;
@@ -237,7 +526,7 @@ declare const plugins: readonly [import("@hot-updater/server/plugins").HotUpdate
237
526
  readonly sort: readonly ["bucket_start_ms"];
238
527
  };
239
528
  }, "launch_users" | "activity_users" | "failed_users", readonly ["identity", "bucket_start_ms"]>;
240
- readonly insights_overview_daily: import("@hot-updater/server/database").AggregateDefinition<{
529
+ readonly insights_overview_daily: import("@hot-updater/plugin-core").AggregateDefinition<{
241
530
  readonly identity: {
242
531
  readonly type: "string";
243
532
  readonly maxLength: 32;
@@ -251,7 +540,7 @@ declare const plugins: readonly [import("@hot-updater/server/plugins").HotUpdate
251
540
  readonly sort: readonly ["bucket_start_ms"];
252
541
  };
253
542
  }, never, readonly ["identity", "bucket_start_ms"]>;
254
- readonly insights_sketches_daily: import("@hot-updater/server/database").AggregateDefinition<{
543
+ readonly insights_sketches_daily: import("@hot-updater/plugin-core").AggregateDefinition<{
255
544
  readonly identity: {
256
545
  readonly type: "string";
257
546
  readonly maxLength: 32;
@@ -265,7 +554,7 @@ declare const plugins: readonly [import("@hot-updater/server/plugins").HotUpdate
265
554
  readonly sort: readonly ["bucket_start_ms"];
266
555
  };
267
556
  }, "launch_users" | "activity_users" | "failed_users", readonly ["identity", "bucket_start_ms"]>;
268
- readonly insights_overview_lifetime: import("@hot-updater/server/database").AggregateDefinition<{
557
+ readonly insights_overview_lifetime: import("@hot-updater/plugin-core").AggregateDefinition<{
269
558
  readonly identity: {
270
559
  readonly type: "string";
271
560
  readonly maxLength: 32;
@@ -279,7 +568,7 @@ declare const plugins: readonly [import("@hot-updater/server/plugins").HotUpdate
279
568
  readonly sort: readonly ["bucket_start_ms"];
280
569
  };
281
570
  }, never, readonly ["identity", "bucket_start_ms"]>;
282
- readonly insights_sketches_lifetime: import("@hot-updater/server/database").AggregateDefinition<{
571
+ readonly insights_sketches_lifetime: import("@hot-updater/plugin-core").AggregateDefinition<{
283
572
  readonly identity: {
284
573
  readonly type: "string";
285
574
  readonly maxLength: 32;
@@ -293,7 +582,7 @@ declare const plugins: readonly [import("@hot-updater/server/plugins").HotUpdate
293
582
  readonly sort: readonly ["bucket_start_ms"];
294
583
  };
295
584
  }, "failed_users", readonly ["identity", "bucket_start_ms"]>;
296
- readonly insights_distribution: import("@hot-updater/server/database").AggregateDefinition<{
585
+ readonly insights_distribution: import("@hot-updater/plugin-core").AggregateDefinition<{
297
586
  readonly channel: {
298
587
  readonly type: "string";
299
588
  };
@@ -321,7 +610,7 @@ declare const plugins: readonly [import("@hot-updater/server/plugins").HotUpdate
321
610
  readonly sort: readonly ["bucket_start_ms"];
322
611
  };
323
612
  }, never, readonly ["channel", "platform", "app_version", "release_id", "bucket_start_ms"]>;
324
- readonly insights_latest_by_bundle: import("@hot-updater/server/database").AggregateDefinition<{
613
+ readonly insights_latest_by_bundle: import("@hot-updater/plugin-core").AggregateDefinition<{
325
614
  readonly platform: {
326
615
  readonly type: "string";
327
616
  readonly maxLength: 16;
@@ -350,7 +639,7 @@ declare const plugins: readonly [import("@hot-updater/server/plugins").HotUpdate
350
639
  readonly sort: readonly ["bucket_start_ms"];
351
640
  };
352
641
  }, never, readonly ["platform", "channel", "bundle_field", "bundle_id", "type", "bucket_start_ms"]>;
353
- readonly insights_outcomes: import("@hot-updater/server/database").AggregateDefinition<{
642
+ readonly insights_outcomes: import("@hot-updater/plugin-core").AggregateDefinition<{
354
643
  readonly platform: {
355
644
  readonly type: "string";
356
645
  readonly maxLength: 16;
@@ -375,7 +664,7 @@ declare const plugins: readonly [import("@hot-updater/server/plugins").HotUpdate
375
664
  readonly sort: readonly ["bucket_start_ms"];
376
665
  };
377
666
  }, never, readonly ["platform", "channel", "type", "bundle_ref", "bucket_start_ms"]>;
378
- readonly insights_failures: import("@hot-updater/server/database").AggregateDefinition<{
667
+ readonly insights_failures: import("@hot-updater/plugin-core").AggregateDefinition<{
379
668
  readonly platform: {
380
669
  readonly type: "string";
381
670
  readonly maxLength: 16;
@@ -410,19 +699,19 @@ declare const plugins: readonly [import("@hot-updater/server/plugins").HotUpdate
410
699
  }, never, readonly ["platform", "channel", "bucket_start_ms", "release_id", "stage", "reason", "detail"]>;
411
700
  }, {
412
701
  api: {
413
- retention: import("@hot-updater/server/plugins/insights").InsightsRetention;
414
- recordEvent: (event: import("@hot-updater/server/plugins/insights").BundleEventRow) => Promise<void>;
415
- listEvents: (input: import("@hot-updater/server/plugins/insights").InsightsListEventsInput) => Promise<readonly import("@hot-updater/server/plugins/insights").BundleEventRow[]>;
416
- findLatestEvents: (input: import("@hot-updater/server/plugins/insights").InsightsFindLatestEventsInput) => Promise<readonly import("@hot-updater/server/plugins/insights").BundleEventRow[]>;
417
- countLatestEvents: (input: import("@hot-updater/server/plugins/insights").InsightsCountLatestEventsInput) => Promise<number>;
418
- countEvents: (input: import("@hot-updater/server/plugins/insights").InsightsCountEventsInput) => Promise<number>;
419
- getReleaseActivity: (input: import("@hot-updater/server/plugins/insights").InsightsGetReleaseActivityInput) => Promise<import("@hot-updater/server/plugins/insights").InsightsGetReleaseActivityResult>;
420
- getAppUsage: (input: import("@hot-updater/server/plugins/insights").InsightsGetAppUsageInput) => Promise<import("@hot-updater/server/plugins/insights").InsightsGetAppUsageResult>;
421
- getUpdateFailures: (input: import("@hot-updater/server/plugins/insights").InsightsUpdateFailuresInput) => Promise<import("@hot-updater/server/plugins/insights").InsightsUpdateFailures>;
702
+ retention: InsightsRetention;
703
+ recordEvent: (event: BundleEventRow) => Promise<void>;
704
+ listEvents: (input: InsightsListEventsInput) => Promise<readonly BundleEventRow[]>;
705
+ findLatestEvents: (input: InsightsFindLatestEventsInput) => Promise<readonly BundleEventRow[]>;
706
+ countLatestEvents: (input: InsightsCountLatestEventsInput) => Promise<number>;
707
+ countEvents: (input: InsightsCountEventsInput) => Promise<number>;
708
+ getReleaseActivity: (input: InsightsGetReleaseActivityInput) => Promise<InsightsGetReleaseActivityResult>;
709
+ getAppUsage: (input: InsightsGetAppUsageInput) => Promise<InsightsGetAppUsageResult>;
710
+ getUpdateFailures: (input: InsightsUpdateFailuresInput) => Promise<InsightsUpdateFailures>;
422
711
  };
423
- endpoints: import("@hot-updater/server/plugins").PluginEndpoint[];
424
- }, {}>, import("@hot-updater/server/plugins").HotUpdaterPlugin<"apiKeys", {
425
- readonly api_keys: import("@hot-updater/server/database").TableDefinition<{
712
+ endpoints: import("@hot-updater/plugin-core").PluginEndpoint[];
713
+ }, {}>, import("@hot-updater/plugin-core").HotUpdaterPlugin<"apiKeys", {
714
+ readonly api_keys: import("@hot-updater/plugin-core").TableDefinition<{
426
715
  readonly id: {
427
716
  readonly type: "string";
428
717
  readonly maxLength: 255;
@@ -463,21 +752,21 @@ declare const plugins: readonly [import("@hot-updater/server/plugins").HotUpdate
463
752
  readonly apiKey: string;
464
753
  readonly name: string;
465
754
  readonly createdAtMs?: number;
466
- }) => Promise<import("@hot-updater/server/plugins/api-keys").CreatedApiKey>;
755
+ }) => Promise<CreatedApiKey>;
467
756
  provision: (input: {
468
757
  readonly existingApiKey?: string;
469
758
  readonly name: string;
470
- }) => Promise<import("@hot-updater/server/plugins/api-keys").CreatedApiKey>;
759
+ }) => Promise<CreatedApiKey>;
471
760
  create(input: {
472
761
  readonly name: string;
473
762
  }): Promise<{
474
763
  readonly apiKey: string;
475
- readonly record: import("@hot-updater/server/plugins/api-keys").ApiKeyMetadata;
764
+ readonly record: ApiKeyMetadata;
476
765
  }>;
477
- list(): Promise<readonly import("@hot-updater/server/plugins/api-keys").ApiKeyMetadata[]>;
766
+ list(): Promise<readonly ApiKeyMetadata[]>;
478
767
  revoke(input: {
479
768
  readonly id: string;
480
- }): Promise<import("@hot-updater/server/plugins/api-keys").ApiKeyMetadata | null>;
769
+ }): Promise<ApiKeyMetadata | null>;
481
770
  };
482
771
  clientAuth: {
483
772
  varyHeaders: string[];