@hot-updater/firebase 1.0.0-rc.44 → 1.0.0-rc.45

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 CHANGED
@@ -1,6 +1,5 @@
1
- import { DatabaseJsonObject, EngineDatabase, Platform, PluginTables, StorageAdapterWith } from "@hot-updater/plugin-core";
1
+ import { EngineDatabase, PluginTables, StorageAdapterWith } from "@hot-updater/plugin-core";
2
2
  import { AppOptions } from "firebase-admin/app";
3
- import "@hot-updater/protocol";
4
3
  //#region src/firebaseDatabase.d.ts
5
4
  type FirebaseDatabaseConfig = AppOptions & {
6
5
  /** The one collection the database keeps its items in. */
@@ -35,1017 +34,4 @@ interface FirebaseStorageConfig extends AppOptions {
35
34
  }
36
35
  declare const firebaseStorage: (config: FirebaseStorageConfig) => StorageAdapterWith<"put" | "get" | "getDownloadUrl" | "exists" | "delete">;
37
36
  //#endregion
38
- //#region ../insights/dist/server/eventRow.d.mts
39
- //#region src/server/eventRow.d.ts
40
- /** Where an update failed, and what failed; open sets, `unknown` for any other value. */
41
- type BundleEventFailureStage = "check" | "download" | "install" | "unknown";
42
- type BundleEventFailureReason = "network" | "http" | "invalid_response" | "hash_mismatch" | "signature" | "patch" | "extract" | "storage" | "unknown";
43
- /** An `UPDATE_FAILED` report's failure, as stored. */
44
- type BundleEventFailure = DatabaseJsonObject & {
45
- readonly stage: BundleEventFailureStage;
46
- readonly reason: BundleEventFailureReason;
47
- /** What the client was fetching or writing. */
48
- readonly resource?: "catalog" | "artifact" | "manifest" | "file" | "patch" | "archive" | "unknown";
49
- readonly http_status?: number;
50
- /** How the connection failed, when it did. */
51
- readonly transport?: "timeout" | "dns" | "tls" | "connection" | "offline" | "cancelled" | "unknown";
52
- /** The storage origin's error code, such as `ExpiredToken`. */
53
- readonly origin_code?: string;
54
- readonly error_message?: string;
55
- readonly error_stack?: string;
56
- };
57
- type DatabaseHttpResponse = DatabaseJsonObject & {
58
- readonly resource: "catalog" | "artifact";
59
- readonly path: string;
60
- readonly status: number;
61
- readonly body: string | null;
62
- readonly body_truncated: boolean;
63
- readonly received_at_ms: number;
64
- };
65
- /** What a kept UNCHANGED row changed against its installation's head. */
66
- type BundleEventChangeKind = "first_seen" | "bundle" | "release" | "app_version" | "channel" | "native_build";
67
- /**
68
- * An UNCHANGED report the server keeps: what it changed against its
69
- * installation's head, and the running values the head held before it. A
70
- * report from an installation without a head is `first_seen` alone, with no
71
- * previous values: the installation is new to this server, not necessarily
72
- * to its device.
73
- */
74
- type BundleEventChange = DatabaseJsonObject & {
75
- readonly kinds: BundleEventChangeKind[];
76
- readonly previous: (DatabaseJsonObject & {
77
- readonly bundle_id: string;
78
- readonly release_id: string | null;
79
- readonly app_version: string;
80
- readonly channel: string;
81
- readonly min_bundle_id?: string;
82
- }) | null;
83
- };
84
- /** Ancillary report data; queryable identity and lifecycle fields stay on the row. */
85
- type DatabaseBundleEventMetadata = DatabaseJsonObject & {
86
- readonly cohort: string;
87
- readonly update_strategy: "fingerprint" | "appVersion" | null;
88
- readonly fingerprint_hash: string | null;
89
- readonly sdk_version: string | null;
90
- /** The native build's built-in bundle ID, when the SDK reports it. */
91
- readonly min_bundle_id?: string;
92
- /** `UPDATE_FAILED`: what failed. */
93
- readonly failure?: BundleEventFailure;
94
- readonly http_response?: DatabaseHttpResponse;
95
- /** `UPDATE_DOWNLOADED`: how the bundle arrived. */
96
- readonly delivery?: "patch" | "manifest" | "archive" | "unknown";
97
- /** `UPDATE_DOWNLOADED`: a patch failed and the full files came instead. */
98
- readonly patch_fallback?: boolean;
99
- /** A kept `UNCHANGED` row: what it changed, which the server sets. */
100
- readonly change?: BundleEventChange;
101
- /**
102
- * A download or apply of a target its installation already ran, as when
103
- * a reload cut the first runtime's report short, or a download that
104
- * repeats the pending one: the server keeps it in history, but it moves
105
- * and counts nothing.
106
- */
107
- readonly late?: true;
108
- /**
109
- * A launch or crash of a bundle whose download report never arrived: the
110
- * server counted that download with it.
111
- */
112
- readonly implied_download?: true;
113
- };
114
- type BundleEventRowBase = {
115
- readonly id: string;
116
- readonly install_id: string;
117
- readonly user_id: string | null;
118
- readonly from_release_id: string | null;
119
- readonly to_release_id: string | null;
120
- readonly to_bundle_id: string;
121
- readonly platform: Platform;
122
- readonly app_version: string;
123
- readonly channel: string;
124
- readonly metadata: DatabaseBundleEventMetadata;
125
- readonly received_at_ms: number;
126
- };
127
- type BundleEventRow = BundleEventRowBase & ({
128
- readonly type: "UPDATE_DOWNLOADED";
129
- readonly from_bundle_id: string;
130
- } | {
131
- readonly type: "UPDATE_APPLIED" | "RECOVERED";
132
- readonly from_bundle_id: string;
133
- } |
134
- /** An update that failed: `from` is the running bundle, `to` the target (for a check, the running bundle). */
135
- {
136
- readonly type: "UPDATE_FAILED";
137
- readonly from_bundle_id: string;
138
- } | {
139
- readonly type: "UNCHANGED";
140
- readonly from_bundle_id: null;
141
- });
142
- //#endregion
143
- //#region ../insights/dist/server/modelTypes.d.mts
144
- //#region src/server/modelTypes.d.ts
145
- interface InsightsEventCursor {
146
- readonly receivedAtMs: number;
147
- readonly id: string;
148
- }
149
- interface InsightsScope {
150
- readonly platform: "ios" | "android";
151
- readonly channel: string;
152
- }
153
- /**
154
- * Raw event predicates; recovery is attributed to the source bundle. An
155
- * UNCHANGED filter matches the kept rows that moved an installation to the
156
- * bundle without an apply report.
157
- */
158
- type InsightsBundleEventFilter = InsightsScope & ({
159
- readonly type: "RECOVERED";
160
- readonly fromBundleId: string;
161
- } | {
162
- readonly type: "UPDATE_DOWNLOADED" | "UPDATE_APPLIED" | "UPDATE_FAILED" | "UNCHANGED";
163
- readonly toBundleId: string;
164
- });
165
- type InsightsEventFilter = {
166
- readonly kind: "all";
167
- } | {
168
- readonly kind: "installationMovement";
169
- readonly installId: string;
170
- } | ({
171
- readonly kind: "bundle";
172
- } & InsightsBundleEventFilter);
173
- interface InsightsListEventsInput {
174
- readonly filter: InsightsEventFilter;
175
- readonly sinceMs?: number;
176
- readonly beforeReceivedAtMs: number;
177
- readonly after?: InsightsEventCursor;
178
- readonly limit: number;
179
- }
180
- type InsightsFindLatestEventsInput = {
181
- readonly installId: string;
182
- } | {
183
- readonly userId: string;
184
- readonly afterInstallId?: string;
185
- readonly limit: number;
186
- };
187
- interface InsightsCountLatestEventsInput extends InsightsScope {
188
- /** A UTC day's start: latest events are counted by the day they fall in. */
189
- readonly sinceMs: number;
190
- /** Optional OR of one or two fixed predicates; count a matching event once. */
191
- readonly bundle?: readonly {
192
- readonly field: "from_bundle_id" | "to_bundle_id";
193
- readonly value: string;
194
- readonly types: readonly BundleEventRow["type"][];
195
- }[];
196
- }
197
- interface InsightsCountEventsInput {
198
- readonly filter: InsightsBundleEventFilter;
199
- readonly sinceMs: number;
200
- readonly beforeReceivedAtMs: number;
201
- }
202
- /** One bundle filter's stored events in each interval of a time range. */
203
- interface InsightsCountEventSeriesInput {
204
- readonly filter: InsightsBundleEventFilter;
205
- /** Whole UTC hours, at most 90 days, that a whole number of intervals fill. */
206
- readonly timeRange: InsightsTimeRange;
207
- /** Whole hours each point spans, from `timeRange.start`. */
208
- readonly intervalMs: number;
209
- }
210
- /** Stored events in [startMs, startMs + intervalMs). */
211
- interface InsightsEventSeriesPoint {
212
- readonly startMs: number;
213
- readonly events: number;
214
- }
215
- interface ReleaseReference {
216
- readonly releaseId: string;
217
- readonly platform: "ios" | "android";
218
- readonly channel: string;
219
- }
220
- interface InsightsTimeRange {
221
- /** Inclusive UTC Unix timestamp in milliseconds. */
222
- readonly start: number;
223
- /** Exclusive UTC Unix timestamp in milliseconds. */
224
- readonly end: number;
225
- }
226
- type InsightsCoverage = {
227
- readonly kind: "complete";
228
- readonly sinceMs: number;
229
- } | {
230
- readonly kind: "partial";
231
- readonly sinceMs: number | null;
232
- };
233
- /**
234
- * A release's counts since its first report, from its lifetime counters,
235
- * which are kept.
236
- */
237
- interface ReleaseActivityMetrics {
238
- /** Download reports of the release. */
239
- readonly downloads: number;
240
- /** Apply reports of the release: installations that started running it. */
241
- readonly applies: number;
242
- /** Launches that crashed on the release and recovered to the one before. */
243
- readonly failedLaunches: number;
244
- }
245
- interface InsightsGetReleaseActivityInput {
246
- /** 1 to 100 releases. */
247
- readonly releases: readonly ReleaseReference[];
248
- }
249
- interface InsightsGetReleaseActivityResult {
250
- readonly data: readonly {
251
- readonly release: ReleaseReference;
252
- readonly metrics: ReleaseActivityMetrics;
253
- }[];
254
- readonly measuredAtMs: number;
255
- }
256
- interface InsightsGetAppUsageInput {
257
- readonly channel: string;
258
- readonly platform: "all" | "ios" | "android";
259
- readonly appVersion?: string;
260
- readonly timeRange: InsightsTimeRange;
261
- readonly intervalMs: number;
262
- }
263
- interface InsightsGetAppUsageResult {
264
- readonly coverage: InsightsCoverage;
265
- readonly activeInstallations: number;
266
- readonly points: readonly {
267
- readonly startMs: number;
268
- readonly installations: number;
269
- }[];
270
- readonly appVersions: readonly string[];
271
- readonly versions: readonly {
272
- readonly name: string;
273
- readonly installations: number;
274
- }[];
275
- readonly platforms: readonly {
276
- readonly name: string;
277
- readonly installations: number;
278
- }[];
279
- readonly bundleDistribution: readonly {
280
- readonly appVersion: string;
281
- readonly platform: "ios" | "android";
282
- /** The release the installations run; null for none. */
283
- readonly releaseId: string | null;
284
- /** The native build's built-in bundle, when they run it. */
285
- readonly builtinBundleId: string | null;
286
- readonly installations: number;
287
- }[];
288
- readonly measuredAtMs: number;
289
- }
290
- //#endregion
291
- //#region ../insights/dist/server/schema.d.mts
292
- //#region src/server/schema.d.ts
293
- /** How long Insights keeps its rows, in whole days. Lifetime counters are kept. */
294
- interface InsightsRetention {
295
- /** Raw events and hourly rollups. */
296
- readonly rawDays: number;
297
- /** Daily rollups, and each installation's latest event and the gauges that count it. */
298
- readonly dailyDays: number;
299
- }
300
- //#endregion
301
- //#region ../insights/dist/server/reads.d.mts
302
- //#region src/server/reads.d.ts
303
- interface InsightsUpdateFailuresInput {
304
- readonly platform: "ios" | "android";
305
- readonly channel: string;
306
- /** A release's failures; without it, the channel's, which need a time range. */
307
- readonly releaseId?: string;
308
- /** Without it, a release's failures since its first report. */
309
- readonly timeRange?: InsightsTimeRange;
310
- }
311
- /** Update failures of one stage and reason, and what else their clients knew. */
312
- interface InsightsFailureBreakdown {
313
- readonly stage: string;
314
- readonly reason: string;
315
- readonly events: number;
316
- /** By resource, HTTP status, origin code, and transport, most first. */
317
- readonly details: readonly {
318
- readonly resource: string | null;
319
- readonly httpStatus: number | null;
320
- readonly originCode: string | null;
321
- readonly transport: string | null;
322
- readonly events: number;
323
- }[];
324
- }
325
- interface InsightsUpdateFailures {
326
- readonly coverage: InsightsCoverage;
327
- readonly measuredAtMs: number;
328
- /** Update failures other than failed checks: each client reports one at most once a UTC day. */
329
- readonly failedUpdates: number;
330
- /** Installations with such a failure, estimated. */
331
- readonly failedInstallations: number;
332
- /** Download reports: each installation reports a bundle's download once. */
333
- readonly downloads: number;
334
- /** Downloads a patch delivered, and those that fell back from a patch to files or the archive. */
335
- readonly patchDownloads: number;
336
- readonly patchFallbacks: number;
337
- /** A channel's failed update checks, installations with one, and its active installations, estimated. */
338
- readonly checks?: {
339
- readonly failures: number;
340
- readonly failedInstallations: number;
341
- readonly activeInstallations: number;
342
- };
343
- /** Over a time range: failures by stage and reason, most first. */
344
- readonly breakdown?: readonly InsightsFailureBreakdown[];
345
- }
346
- //#endregion
347
- //#region ../api-keys/dist/server/model.d.mts
348
- //#region src/server/model.d.ts
349
- interface ApiKeyRow {
350
- readonly id: string;
351
- readonly hash: string;
352
- readonly name: string;
353
- readonly prefix: string;
354
- readonly role: "client";
355
- readonly created_at_ms: number;
356
- readonly revoked_at_ms: number | null;
357
- }
358
- //#endregion
359
- //#region ../api-keys/dist/server/apiKeys.d.mts
360
- type ApiKeyMetadata = Omit<ApiKeyRow, "hash">;
361
- interface CreatedApiKey {
362
- /** Plaintext credential. It cannot be recovered after this call returns. */
363
- readonly apiKey: string;
364
- /** Non-secret metadata. The persisted SHA-256 hash is never exposed. */
365
- readonly record: ApiKeyMetadata;
366
- }
367
- //#endregion
368
- //#region ../remote-config/dist/shared/wire.d.mts
369
- //#region src/shared/wire.d.ts
370
- /** What a device tells the server, so the server can evaluate conditions. */
371
- interface RemoteConfigDeviceContext {
372
- readonly platform: "ios" | "android";
373
- /** The native app version, or null when the build has none. */
374
- readonly appVersion: string | null;
375
- readonly channel: string;
376
- /** A numeric cohort from 1 to 1000, or a custom cohort's slug. */
377
- readonly cohort: string;
378
- /** The native build's fingerprint, or null without one. */
379
- readonly fingerprintHash: string | null;
380
- }
381
- /** The body of a `200` from `GET /remote-config`. */
382
- interface RemoteConfigFetchResponse {
383
- /** The published template version the values come from; 0 before the first publish. */
384
- readonly version: number;
385
- /**
386
- * Each parameter's value for this device, as text. A parameter whose
387
- * value is the app's own default is left out.
388
- */
389
- readonly values: Readonly<Record<string, string>>;
390
- }
391
- //#endregion
392
- //#region ../remote-config/dist/server/template.d.mts
393
- //#region src/server/template.d.ts
394
- /**
395
- * How the Console edits a parameter's value and checks it before a publish.
396
- * Devices receive every value as text.
397
- */
398
- type RemoteConfigValueType = "STRING" | "NUMBER" | "BOOLEAN" | "JSON";
399
- /** A value a parameter takes: text, or the app's own default. */
400
- type RemoteConfigParameterValue = {
401
- readonly value: string;
402
- } | {
403
- readonly useInAppDefault: true;
404
- };
405
- interface RemoteConfigParameter {
406
- readonly valueType: RemoteConfigValueType;
407
- /** The value when none of the parameter's conditions match. */
408
- readonly defaultValue: RemoteConfigParameterValue;
409
- /**
410
- * Values by condition name. When several of these conditions match, the
411
- * one listed first in the template's `conditions` wins.
412
- */
413
- readonly conditionalValues?: Readonly<Record<string, RemoteConfigParameterValue>>;
414
- readonly description?: string;
415
- }
416
- /** A test on a device's context; a condition matches when all of its rules do. */
417
- type RemoteConfigRule = {
418
- readonly type: "platform";
419
- readonly platforms: readonly ("ios" | "android")[];
420
- } | {
421
- readonly type: "channel";
422
- readonly channels: readonly string[];
423
- } |
424
- /** A semver range, such as `>=1.4.0` or `2.x`, as release targets use. */
425
- {
426
- readonly type: "appVersion";
427
- readonly range: string;
428
- } |
429
- /** Devices whose cohort is one of these: numbers from 1 to 1000 or slugs. */
430
- {
431
- readonly type: "cohort";
432
- readonly cohorts: readonly string[];
433
- } |
434
- /**
435
- * A share of numeric cohorts: the devices whose cohort lands in
436
- * `[from, to)` percent once `seed` shuffles the 1,000 cohorts. Rules with
437
- * one seed pick from one order, so `0–10` and `10–20` never overlap; a new
438
- * seed picks other devices. Custom cohorts never match.
439
- */
440
- {
441
- readonly type: "percent";
442
- readonly seed: string;
443
- readonly from: number;
444
- readonly to: number;
445
- } | {
446
- readonly type: "fingerprint";
447
- readonly hashes: readonly string[];
448
- } |
449
- /**
450
- * While the server's clock is in `[from, to)`: ISO 8601 date-times in UTC,
451
- * either of them open. A device gets the change at its next fetch.
452
- */
453
- {
454
- readonly type: "dateTime";
455
- readonly from?: string;
456
- readonly to?: string;
457
- };
458
- interface RemoteConfigCondition {
459
- /** Unique in the template; parameters name it in `conditionalValues`. */
460
- readonly name: string;
461
- /** Every rule must match. */
462
- readonly rules: readonly RemoteConfigRule[];
463
- }
464
- /**
465
- * Everything Remote Config serves, published as a whole and versioned.
466
- */
467
- interface RemoteConfigTemplate {
468
- /** In priority order: the first one that matches decides a parameter's value. */
469
- readonly conditions: readonly RemoteConfigCondition[];
470
- readonly parameters: Readonly<Record<string, RemoteConfigParameter>>;
471
- }
472
- /** What the server knows of a device; a rule on a missing field never matches. */
473
- type RemoteConfigEvaluationContext = Partial<Readonly<{ [K in keyof RemoteConfigDeviceContext]: RemoteConfigDeviceContext[K] | null; }>> & {
474
- /**
475
- * When to evaluate, in ms since the epoch. The server uses its own clock;
476
- * a `dateTime` rule never matches without it.
477
- */
478
- readonly now?: number;
479
- };
480
- //#endregion
481
- //#region ../remote-config/dist/server/api.d.mts
482
- //#region src/server/api.d.ts
483
- /** A published version's record, without its template. */
484
- interface RemoteConfigVersion {
485
- readonly version: number;
486
- readonly description: string | null;
487
- /** `ROLLBACK` when the version copies `rollbackSource`. */
488
- readonly updateType: "PUBLISH" | "ROLLBACK";
489
- readonly rollbackSource: number | null;
490
- readonly createdAtMs: number;
491
- }
492
- interface RemoteConfigVersionDetail extends RemoteConfigVersion {
493
- readonly template: RemoteConfigTemplate;
494
- }
495
- /** The template devices receive now. */
496
- interface RemoteConfigActive {
497
- /** 0, with an empty template, before the first publish. */
498
- readonly version: number;
499
- readonly template: RemoteConfigTemplate;
500
- readonly updatedAtMs: number | null;
501
- }
502
- /**
503
- * How a publish or a rollback ended: `conflict` when another publish moved
504
- * the active version past `baseVersion` first, so a stale edit never
505
- * replaces a newer template.
506
- */
507
- type RemoteConfigPublishResult = {
508
- readonly status: "published";
509
- readonly version: RemoteConfigVersion;
510
- } | {
511
- readonly status: "conflict";
512
- readonly currentVersion: number;
513
- };
514
- interface RemoteConfigVersionsPage {
515
- /** Newest first. */
516
- readonly versions: readonly RemoteConfigVersion[];
517
- /** Pass as `cursor` for the next page; absent on the last one. */
518
- readonly next?: string;
519
- }
520
- /** `hotUpdater.api.remoteConfig`. */
521
- interface RemoteConfigApi {
522
- /** The active template and its version. */
523
- getActive(): Promise<RemoteConfigActive>;
524
- /**
525
- * Validates and publishes a template as the next version. Throws
526
- * `RemoteConfigValidationError` for an invalid template.
527
- */
528
- publish(input: {
529
- readonly template: unknown;
530
- /** The version the edit started from; 0 before the first publish. */
531
- readonly baseVersion: number;
532
- readonly description?: string;
533
- }): Promise<RemoteConfigPublishResult>;
534
- /** Publishes a copy of an earlier version; `not_found` when it does not exist. */
535
- rollback(input: {
536
- readonly version: number;
537
- readonly baseVersion: number;
538
- readonly description?: string;
539
- }): Promise<RemoteConfigPublishResult | {
540
- readonly status: "not_found";
541
- }>;
542
- /** One page of published versions, newest first. */
543
- listVersions(input?: {
544
- readonly limit?: number;
545
- readonly cursor?: string;
546
- }): Promise<RemoteConfigVersionsPage>;
547
- /** One version with its template, or null. */
548
- getVersion(version: number): Promise<RemoteConfigVersionDetail | null>;
549
- /**
550
- * What a device with this context receives from `GET /remote-config`, at
551
- * `context.now` or, without it, now.
552
- */
553
- resolve(context: RemoteConfigEvaluationContext): Promise<RemoteConfigFetchResponse>;
554
- }
555
- //#endregion
556
- //#region src/plugins.d.ts
557
- /**
558
- * The plugins the managed Firebase server runs: Insights, API keys on every
559
- * client route, and Remote Config. Its Cloud Function imports this list.
560
- */
561
- declare const plugins: readonly [import("@hot-updater/plugin-core").HotUpdaterPlugin<"insights", {
562
- readonly bundle_events: import("@hot-updater/plugin-core").TableDefinition<{
563
- readonly id: {
564
- readonly type: "string";
565
- readonly maxLength: 36;
566
- };
567
- readonly type: {
568
- readonly type: "string";
569
- readonly maxLength: 32;
570
- };
571
- readonly install_id: {
572
- readonly type: "string";
573
- readonly maxLength: 255;
574
- };
575
- readonly user_id: {
576
- readonly type: "string";
577
- readonly maxLength: 255;
578
- readonly required: false;
579
- };
580
- readonly from_release_id: {
581
- readonly type: "string";
582
- readonly maxLength: 36;
583
- readonly required: false;
584
- };
585
- readonly from_bundle_id: {
586
- readonly type: "string";
587
- readonly maxLength: 36;
588
- readonly required: false;
589
- };
590
- readonly to_release_id: {
591
- readonly type: "string";
592
- readonly maxLength: 36;
593
- readonly required: false;
594
- };
595
- readonly to_bundle_id: {
596
- readonly type: "string";
597
- readonly maxLength: 36;
598
- };
599
- readonly platform: {
600
- readonly type: "string";
601
- readonly maxLength: 16;
602
- };
603
- readonly app_version: {
604
- readonly type: "string";
605
- };
606
- readonly channel: {
607
- readonly type: "string";
608
- };
609
- readonly metadata: {
610
- readonly type: "json";
611
- };
612
- readonly received_at_ms: {
613
- readonly type: "integer";
614
- };
615
- }, {
616
- day: "integer";
617
- movement_install_id: "string";
618
- bundle_ref: "string";
619
- }, {
620
- readonly movementsByInstall: {
621
- readonly eq: readonly ["movement_install_id"];
622
- readonly sort: readonly ["received_at_ms"];
623
- };
624
- readonly byBundle: {
625
- readonly eq: readonly ["platform", "channel", "type", "bundle_ref", "day"];
626
- readonly sort: readonly ["received_at_ms"];
627
- };
628
- readonly byDay: {
629
- readonly eq: readonly ["day"];
630
- readonly sort: readonly ["received_at_ms"];
631
- };
632
- }, readonly ["id"]>;
633
- readonly bundle_event_heads: import("@hot-updater/plugin-core").TableDefinition<{
634
- readonly install_id: {
635
- readonly type: "string";
636
- readonly maxLength: 255;
637
- };
638
- readonly id: {
639
- readonly type: "string";
640
- readonly maxLength: 36;
641
- };
642
- readonly type: {
643
- readonly type: "string";
644
- readonly maxLength: 32;
645
- };
646
- readonly user_id: {
647
- readonly type: "string";
648
- readonly maxLength: 255;
649
- readonly required: false;
650
- };
651
- readonly from_release_id: {
652
- readonly type: "string";
653
- readonly maxLength: 36;
654
- readonly required: false;
655
- };
656
- readonly from_bundle_id: {
657
- readonly type: "string";
658
- readonly maxLength: 36;
659
- readonly required: false;
660
- };
661
- readonly to_release_id: {
662
- readonly type: "string";
663
- readonly maxLength: 36;
664
- readonly required: false;
665
- };
666
- readonly to_bundle_id: {
667
- readonly type: "string";
668
- readonly maxLength: 36;
669
- };
670
- readonly platform: {
671
- readonly type: "string";
672
- readonly maxLength: 16;
673
- };
674
- readonly app_version: {
675
- readonly type: "string";
676
- };
677
- readonly channel: {
678
- readonly type: "string";
679
- };
680
- readonly metadata: {
681
- readonly type: "json";
682
- };
683
- readonly received_at_ms: {
684
- readonly type: "integer";
685
- };
686
- }, Readonly<Record<string, import("@hot-updater/plugin-core").FieldType>>, {
687
- readonly byUser: {
688
- readonly eq: readonly ["user_id"];
689
- readonly sort: readonly ["install_id"];
690
- };
691
- }, readonly ["install_id"]>;
692
- readonly insights_overview: import("@hot-updater/plugin-core").AggregateDefinition<{
693
- readonly identity: {
694
- readonly type: "string";
695
- readonly maxLength: 32;
696
- };
697
- readonly bucket_start_ms: {
698
- readonly type: "integer";
699
- };
700
- }, "downloads" | "failed_launches" | "patch_downloads" | "patch_fallbacks", {
701
- readonly window: {
702
- readonly eq: readonly ["identity"];
703
- readonly sort: readonly ["bucket_start_ms"];
704
- };
705
- }, never, readonly ["identity", "bucket_start_ms"]>;
706
- readonly insights_sketches: import("@hot-updater/plugin-core").AggregateDefinition<{
707
- readonly identity: {
708
- readonly type: "string";
709
- readonly maxLength: 32;
710
- };
711
- readonly bucket_start_ms: {
712
- readonly type: "integer";
713
- };
714
- }, never, {
715
- readonly window: {
716
- readonly eq: readonly ["identity"];
717
- readonly sort: readonly ["bucket_start_ms"];
718
- };
719
- }, "activity_users" | "failed_users", readonly ["identity", "bucket_start_ms"]>;
720
- readonly insights_overview_daily: import("@hot-updater/plugin-core").AggregateDefinition<{
721
- readonly identity: {
722
- readonly type: "string";
723
- readonly maxLength: 32;
724
- };
725
- readonly bucket_start_ms: {
726
- readonly type: "integer";
727
- };
728
- }, "downloads" | "failed_launches" | "patch_downloads" | "patch_fallbacks", {
729
- readonly window: {
730
- readonly eq: readonly ["identity"];
731
- readonly sort: readonly ["bucket_start_ms"];
732
- };
733
- }, never, readonly ["identity", "bucket_start_ms"]>;
734
- readonly insights_sketches_daily: import("@hot-updater/plugin-core").AggregateDefinition<{
735
- readonly identity: {
736
- readonly type: "string";
737
- readonly maxLength: 32;
738
- };
739
- readonly bucket_start_ms: {
740
- readonly type: "integer";
741
- };
742
- }, never, {
743
- readonly window: {
744
- readonly eq: readonly ["identity"];
745
- readonly sort: readonly ["bucket_start_ms"];
746
- };
747
- }, "activity_users" | "failed_users", readonly ["identity", "bucket_start_ms"]>;
748
- readonly insights_overview_lifetime: import("@hot-updater/plugin-core").AggregateDefinition<{
749
- readonly identity: {
750
- readonly type: "string";
751
- readonly maxLength: 32;
752
- };
753
- readonly bucket_start_ms: {
754
- readonly type: "integer";
755
- };
756
- }, "downloads" | "failed_launches" | "patch_downloads" | "patch_fallbacks" | "applies" | "failed_updates", {
757
- readonly window: {
758
- readonly eq: readonly ["identity"];
759
- readonly sort: readonly ["bucket_start_ms"];
760
- };
761
- }, never, readonly ["identity", "bucket_start_ms"]>;
762
- readonly insights_sketches_lifetime: import("@hot-updater/plugin-core").AggregateDefinition<{
763
- readonly identity: {
764
- readonly type: "string";
765
- readonly maxLength: 32;
766
- };
767
- readonly bucket_start_ms: {
768
- readonly type: "integer";
769
- };
770
- }, never, {
771
- readonly window: {
772
- readonly eq: readonly ["identity"];
773
- readonly sort: readonly ["bucket_start_ms"];
774
- };
775
- }, "failed_users", readonly ["identity", "bucket_start_ms"]>;
776
- readonly insights_distribution: import("@hot-updater/plugin-core").AggregateDefinition<{
777
- readonly channel: {
778
- readonly type: "string";
779
- };
780
- readonly platform: {
781
- readonly type: "string";
782
- readonly maxLength: 16;
783
- };
784
- readonly app_version: {
785
- readonly type: "string";
786
- };
787
- readonly release_id: {
788
- readonly type: "string";
789
- readonly maxLength: 36;
790
- };
791
- readonly bucket_start_ms: {
792
- readonly type: "integer";
793
- };
794
- }, "latest_installations", {
795
- readonly byScope: {
796
- readonly eq: readonly ["channel", "platform"];
797
- readonly sort: readonly ["bucket_start_ms"];
798
- };
799
- readonly byVersion: {
800
- readonly eq: readonly ["channel", "platform", "app_version"];
801
- readonly sort: readonly ["bucket_start_ms"];
802
- };
803
- }, never, readonly ["channel", "platform", "app_version", "release_id", "bucket_start_ms"]>;
804
- readonly insights_builtin_distribution: import("@hot-updater/plugin-core").AggregateDefinition<{
805
- readonly channel: {
806
- readonly type: "string";
807
- };
808
- readonly platform: {
809
- readonly type: "string";
810
- readonly maxLength: 16;
811
- };
812
- readonly app_version: {
813
- readonly type: "string";
814
- };
815
- readonly release_id: {
816
- readonly type: "string";
817
- readonly maxLength: 36;
818
- };
819
- readonly builtin_bundle_id: {
820
- readonly type: "string";
821
- readonly maxLength: 36;
822
- };
823
- readonly bucket_start_ms: {
824
- readonly type: "integer";
825
- };
826
- }, "latest_installations", {
827
- readonly byScope: {
828
- readonly eq: readonly ["channel", "platform"];
829
- readonly sort: readonly ["bucket_start_ms"];
830
- };
831
- readonly byVersion: {
832
- readonly eq: readonly ["channel", "platform", "app_version"];
833
- readonly sort: readonly ["bucket_start_ms"];
834
- };
835
- }, never, readonly ["channel", "platform", "app_version", "release_id", "builtin_bundle_id", "bucket_start_ms"]>;
836
- readonly insights_latest_by_bundle: import("@hot-updater/plugin-core").AggregateDefinition<{
837
- readonly platform: {
838
- readonly type: "string";
839
- readonly maxLength: 16;
840
- };
841
- readonly channel: {
842
- readonly type: "string";
843
- };
844
- readonly bundle_field: {
845
- readonly type: "string";
846
- readonly maxLength: 16;
847
- };
848
- readonly bundle_id: {
849
- readonly type: "string";
850
- readonly maxLength: 36;
851
- };
852
- readonly type: {
853
- readonly type: "string";
854
- readonly maxLength: 32;
855
- };
856
- readonly bucket_start_ms: {
857
- readonly type: "integer";
858
- };
859
- }, "installations", {
860
- readonly byBundle: {
861
- readonly eq: readonly ["platform", "channel", "bundle_field", "bundle_id", "type"];
862
- readonly sort: readonly ["bucket_start_ms"];
863
- };
864
- }, never, readonly ["platform", "channel", "bundle_field", "bundle_id", "type", "bucket_start_ms"]>;
865
- readonly insights_outcomes: import("@hot-updater/plugin-core").AggregateDefinition<{
866
- readonly platform: {
867
- readonly type: "string";
868
- readonly maxLength: 16;
869
- };
870
- readonly channel: {
871
- readonly type: "string";
872
- };
873
- readonly type: {
874
- readonly type: "string";
875
- readonly maxLength: 32;
876
- };
877
- readonly bundle_ref: {
878
- readonly type: "string";
879
- readonly maxLength: 41;
880
- };
881
- readonly bucket_start_ms: {
882
- readonly type: "integer";
883
- };
884
- }, "events", {
885
- readonly byRef: {
886
- readonly eq: readonly ["platform", "channel", "type", "bundle_ref"];
887
- readonly sort: readonly ["bucket_start_ms"];
888
- };
889
- }, never, readonly ["platform", "channel", "type", "bundle_ref", "bucket_start_ms"]>;
890
- readonly insights_failures: import("@hot-updater/plugin-core").AggregateDefinition<{
891
- readonly platform: {
892
- readonly type: "string";
893
- readonly maxLength: 16;
894
- };
895
- readonly channel: {
896
- readonly type: "string";
897
- };
898
- readonly bucket_start_ms: {
899
- readonly type: "integer";
900
- };
901
- readonly release_id: {
902
- readonly type: "string";
903
- readonly maxLength: 36;
904
- };
905
- readonly stage: {
906
- readonly type: "string";
907
- readonly maxLength: 16;
908
- };
909
- readonly reason: {
910
- readonly type: "string";
911
- readonly maxLength: 64;
912
- };
913
- readonly detail: {
914
- readonly type: "string";
915
- readonly maxLength: 160;
916
- };
917
- }, "events", {
918
- readonly byScope: {
919
- readonly eq: readonly ["platform", "channel"];
920
- readonly sort: readonly ["bucket_start_ms"];
921
- };
922
- }, never, readonly ["platform", "channel", "bucket_start_ms", "release_id", "stage", "reason", "detail"]>;
923
- }, {
924
- api: {
925
- retention: InsightsRetention;
926
- recordEvent: (event: BundleEventRow) => Promise<void>;
927
- listEvents: (input: InsightsListEventsInput) => Promise<readonly BundleEventRow[]>;
928
- findLatestEvents: (input: InsightsFindLatestEventsInput) => Promise<readonly BundleEventRow[]>;
929
- countLatestEvents: (input: InsightsCountLatestEventsInput) => Promise<number>;
930
- countEvents: (input: InsightsCountEventsInput) => Promise<number>;
931
- countEventSeries: (input: InsightsCountEventSeriesInput) => Promise<readonly InsightsEventSeriesPoint[]>;
932
- getReleaseActivity: (input: InsightsGetReleaseActivityInput) => Promise<InsightsGetReleaseActivityResult>;
933
- getAppUsage: (input: InsightsGetAppUsageInput) => Promise<InsightsGetAppUsageResult>;
934
- getUpdateFailures: (input: InsightsUpdateFailuresInput) => Promise<InsightsUpdateFailures>;
935
- };
936
- endpoints: import("@hot-updater/plugin-core").PluginEndpoint[];
937
- }, {}>, import("@hot-updater/plugin-core").HotUpdaterPlugin<"apiKeys", {
938
- readonly api_keys: import("@hot-updater/plugin-core").TableDefinition<{
939
- readonly id: {
940
- readonly type: "string";
941
- readonly maxLength: 255;
942
- };
943
- readonly hash: {
944
- readonly type: "string";
945
- readonly maxLength: 64;
946
- readonly unique: true;
947
- };
948
- readonly name: {
949
- readonly type: "string";
950
- readonly maxLength: 64;
951
- };
952
- readonly prefix: {
953
- readonly type: "string";
954
- readonly maxLength: 16;
955
- };
956
- readonly role: {
957
- readonly type: "string";
958
- readonly maxLength: 16;
959
- };
960
- readonly created_at_ms: {
961
- readonly type: "integer";
962
- };
963
- readonly revoked_at_ms: {
964
- readonly type: "integer";
965
- readonly required: false;
966
- };
967
- }, {}, {
968
- readonly byCreated: {
969
- readonly eq: readonly [];
970
- readonly sort: readonly ["created_at_ms"];
971
- };
972
- }, readonly ["id"]>;
973
- }, {
974
- api: {
975
- register: (input: {
976
- readonly apiKey: string;
977
- readonly name: string;
978
- readonly createdAtMs?: number;
979
- }) => Promise<CreatedApiKey>;
980
- provision: (input: {
981
- readonly existingApiKey?: string;
982
- readonly name: string;
983
- }) => Promise<CreatedApiKey>;
984
- create(input: {
985
- readonly name: string;
986
- }): Promise<{
987
- readonly apiKey: string;
988
- readonly record: ApiKeyMetadata;
989
- }>;
990
- list(): Promise<readonly ApiKeyMetadata[]>;
991
- revoke(input: {
992
- readonly id: string;
993
- }): Promise<ApiKeyMetadata | null>;
994
- };
995
- clientAuth: {
996
- varyHeaders: string[];
997
- authenticate: (headers: Headers) => Promise<boolean>;
998
- };
999
- }, {
1000
- readonly clientAuth: true;
1001
- }>, import("@hot-updater/plugin-core").HotUpdaterPlugin<"remoteConfig", {
1002
- readonly remote_config_active: import("@hot-updater/plugin-core").TableDefinition<{
1003
- readonly id: {
1004
- readonly type: "string";
1005
- readonly maxLength: 16;
1006
- };
1007
- readonly version: {
1008
- readonly type: "integer";
1009
- };
1010
- readonly template: {
1011
- readonly type: "json";
1012
- };
1013
- readonly updated_at_ms: {
1014
- readonly type: "integer";
1015
- };
1016
- }, {}, {}, readonly ["id"]>;
1017
- readonly remote_config_versions: import("@hot-updater/plugin-core").TableDefinition<{
1018
- readonly version: {
1019
- readonly type: "integer";
1020
- };
1021
- readonly template: {
1022
- readonly type: "json";
1023
- };
1024
- readonly description: {
1025
- readonly type: "string";
1026
- readonly maxLength: 256;
1027
- readonly required: false;
1028
- };
1029
- readonly update_type: {
1030
- readonly type: "string";
1031
- readonly maxLength: 16;
1032
- };
1033
- readonly rollback_source: {
1034
- readonly type: "integer";
1035
- readonly required: false;
1036
- };
1037
- readonly created_at_ms: {
1038
- readonly type: "integer";
1039
- };
1040
- }, {}, {
1041
- readonly byVersion: {
1042
- readonly eq: readonly [];
1043
- readonly sort: readonly ["version"];
1044
- };
1045
- }, readonly ["version"]>;
1046
- }, {
1047
- api: RemoteConfigApi;
1048
- endpoints: readonly import("@hot-updater/plugin-core").PluginEndpoint[];
1049
- }, {}>];
1050
- //#endregion
1051
- export { FirebaseDatabaseConfig, FirebaseStorageConfig, firebaseDatabase, firebaseStorage, migrateFirebaseDatabase, plugins };
37
+ export { FirebaseDatabaseConfig, FirebaseStorageConfig, firebaseDatabase, firebaseStorage, migrateFirebaseDatabase };