@hot-updater/firebase 1.0.0-rc.4 → 1.0.0-rc.40
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/firebase/functions/index.cjs +9769 -5549
- package/dist/firebase/public/firestore.indexes.json +29 -58
- package/dist/firebase/public/functions/_package.json +2 -2
- package/dist/index.cjs +185 -898
- package/dist/index.d.cts +801 -5
- package/dist/index.d.mts +801 -5
- package/dist/index.mjs +186 -901
- package/dist/init/index.cjs +7799 -2
- package/dist/init/index.d.cts +42 -3
- package/dist/init/index.d.mts +42 -3
- package/dist/init/index.mjs +7792 -1
- package/package.json +9 -15
- package/dist/iac/index.cjs +0 -8611
- package/dist/iac/index.d.cts +0 -5
- package/dist/iac/index.d.mts +0 -5
- package/dist/iac/index.mjs +0 -8604
package/dist/index.d.cts
CHANGED
|
@@ -1,8 +1,27 @@
|
|
|
1
|
+
import { DatabaseJsonObject, EngineDatabase, Platform, PluginTables, StorageAdapterWith } from "@hot-updater/plugin-core";
|
|
1
2
|
import { AppOptions } from "firebase-admin/app";
|
|
2
|
-
import
|
|
3
|
+
import "@hot-updater/protocol";
|
|
3
4
|
//#region src/firebaseDatabase.d.ts
|
|
4
|
-
type FirebaseDatabaseConfig = AppOptions
|
|
5
|
-
|
|
5
|
+
type FirebaseDatabaseConfig = AppOptions & {
|
|
6
|
+
/** The one collection the database keeps its items in. */
|
|
7
|
+
readonly collection?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Firestore bills each document write, so Insights' aggregates are
|
|
10
|
+
* batched: through log rows a compaction merges (the default), or
|
|
11
|
+
* `{ mode: "memory" }` on a long-lived server. `false` commits them with
|
|
12
|
+
* each event.
|
|
13
|
+
*/
|
|
14
|
+
readonly aggregateBatching?: EngineDatabase["aggregateBatching"] | false;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Writes the schema settings of core and `plugins`, the plugins the server
|
|
18
|
+
* runs, which the database checks before its first read. Firestore needs no
|
|
19
|
+
* other setup beyond `firestore.indexes.json`; `hot-updater init` runs it
|
|
20
|
+
* after deploying the indexes.
|
|
21
|
+
*/
|
|
22
|
+
declare const migrateFirebaseDatabase: (config: FirebaseDatabaseConfig, plugins?: readonly PluginTables[]) => Promise<void>;
|
|
23
|
+
/** Hot Updater's database in one Firestore collection, through the storage engine. */
|
|
24
|
+
declare const firebaseDatabase: (config: FirebaseDatabaseConfig) => EngineDatabase;
|
|
6
25
|
//#endregion
|
|
7
26
|
//#region src/firebaseStorage.d.ts
|
|
8
27
|
interface FirebaseStorageConfig extends AppOptions {
|
|
@@ -14,6 +33,783 @@ interface FirebaseStorageConfig extends AppOptions {
|
|
|
14
33
|
/** Firebase signed URL lifetime in seconds. @default 3600 */
|
|
15
34
|
signedUrlExpiresIn?: number;
|
|
16
35
|
}
|
|
17
|
-
declare const firebaseStorage: (config: FirebaseStorageConfig) =>
|
|
36
|
+
declare const firebaseStorage: (config: FirebaseStorageConfig) => StorageAdapterWith<"put" | "get" | "getDownloadUrl" | "exists" | "delete">;
|
|
18
37
|
//#endregion
|
|
19
|
-
|
|
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 src/plugins.d.ts
|
|
369
|
+
/**
|
|
370
|
+
* The plugins the managed Firebase server runs: Insights, and API keys on every
|
|
371
|
+
* client route. Its Cloud Function imports this list.
|
|
372
|
+
*/
|
|
373
|
+
declare const plugins: readonly [import("@hot-updater/plugin-core").HotUpdaterPlugin<"insights", {
|
|
374
|
+
readonly bundle_events: import("@hot-updater/plugin-core").TableDefinition<{
|
|
375
|
+
readonly id: {
|
|
376
|
+
readonly type: "string";
|
|
377
|
+
readonly maxLength: 36;
|
|
378
|
+
};
|
|
379
|
+
readonly type: {
|
|
380
|
+
readonly type: "string";
|
|
381
|
+
readonly maxLength: 32;
|
|
382
|
+
};
|
|
383
|
+
readonly install_id: {
|
|
384
|
+
readonly type: "string";
|
|
385
|
+
readonly maxLength: 255;
|
|
386
|
+
};
|
|
387
|
+
readonly user_id: {
|
|
388
|
+
readonly type: "string";
|
|
389
|
+
readonly maxLength: 255;
|
|
390
|
+
readonly required: false;
|
|
391
|
+
};
|
|
392
|
+
readonly from_release_id: {
|
|
393
|
+
readonly type: "string";
|
|
394
|
+
readonly maxLength: 36;
|
|
395
|
+
readonly required: false;
|
|
396
|
+
};
|
|
397
|
+
readonly from_bundle_id: {
|
|
398
|
+
readonly type: "string";
|
|
399
|
+
readonly maxLength: 36;
|
|
400
|
+
readonly required: false;
|
|
401
|
+
};
|
|
402
|
+
readonly to_release_id: {
|
|
403
|
+
readonly type: "string";
|
|
404
|
+
readonly maxLength: 36;
|
|
405
|
+
readonly required: false;
|
|
406
|
+
};
|
|
407
|
+
readonly to_bundle_id: {
|
|
408
|
+
readonly type: "string";
|
|
409
|
+
readonly maxLength: 36;
|
|
410
|
+
};
|
|
411
|
+
readonly platform: {
|
|
412
|
+
readonly type: "string";
|
|
413
|
+
readonly maxLength: 16;
|
|
414
|
+
};
|
|
415
|
+
readonly app_version: {
|
|
416
|
+
readonly type: "string";
|
|
417
|
+
};
|
|
418
|
+
readonly channel: {
|
|
419
|
+
readonly type: "string";
|
|
420
|
+
};
|
|
421
|
+
readonly metadata: {
|
|
422
|
+
readonly type: "json";
|
|
423
|
+
};
|
|
424
|
+
readonly received_at_ms: {
|
|
425
|
+
readonly type: "integer";
|
|
426
|
+
};
|
|
427
|
+
}, {
|
|
428
|
+
day: "integer";
|
|
429
|
+
movement_install_id: "string";
|
|
430
|
+
bundle_ref: "string";
|
|
431
|
+
}, {
|
|
432
|
+
readonly movementsByInstall: {
|
|
433
|
+
readonly eq: readonly ["movement_install_id"];
|
|
434
|
+
readonly sort: readonly ["received_at_ms"];
|
|
435
|
+
};
|
|
436
|
+
readonly byBundle: {
|
|
437
|
+
readonly eq: readonly ["platform", "channel", "type", "bundle_ref", "day"];
|
|
438
|
+
readonly sort: readonly ["received_at_ms"];
|
|
439
|
+
};
|
|
440
|
+
readonly byDay: {
|
|
441
|
+
readonly eq: readonly ["day"];
|
|
442
|
+
readonly sort: readonly ["received_at_ms"];
|
|
443
|
+
};
|
|
444
|
+
}, readonly ["id"]>;
|
|
445
|
+
readonly bundle_event_heads: import("@hot-updater/plugin-core").TableDefinition<{
|
|
446
|
+
readonly install_id: {
|
|
447
|
+
readonly type: "string";
|
|
448
|
+
readonly maxLength: 255;
|
|
449
|
+
};
|
|
450
|
+
readonly id: {
|
|
451
|
+
readonly type: "string";
|
|
452
|
+
readonly maxLength: 36;
|
|
453
|
+
};
|
|
454
|
+
readonly type: {
|
|
455
|
+
readonly type: "string";
|
|
456
|
+
readonly maxLength: 32;
|
|
457
|
+
};
|
|
458
|
+
readonly user_id: {
|
|
459
|
+
readonly type: "string";
|
|
460
|
+
readonly maxLength: 255;
|
|
461
|
+
readonly required: false;
|
|
462
|
+
};
|
|
463
|
+
readonly from_release_id: {
|
|
464
|
+
readonly type: "string";
|
|
465
|
+
readonly maxLength: 36;
|
|
466
|
+
readonly required: false;
|
|
467
|
+
};
|
|
468
|
+
readonly from_bundle_id: {
|
|
469
|
+
readonly type: "string";
|
|
470
|
+
readonly maxLength: 36;
|
|
471
|
+
readonly required: false;
|
|
472
|
+
};
|
|
473
|
+
readonly to_release_id: {
|
|
474
|
+
readonly type: "string";
|
|
475
|
+
readonly maxLength: 36;
|
|
476
|
+
readonly required: false;
|
|
477
|
+
};
|
|
478
|
+
readonly to_bundle_id: {
|
|
479
|
+
readonly type: "string";
|
|
480
|
+
readonly maxLength: 36;
|
|
481
|
+
};
|
|
482
|
+
readonly platform: {
|
|
483
|
+
readonly type: "string";
|
|
484
|
+
readonly maxLength: 16;
|
|
485
|
+
};
|
|
486
|
+
readonly app_version: {
|
|
487
|
+
readonly type: "string";
|
|
488
|
+
};
|
|
489
|
+
readonly channel: {
|
|
490
|
+
readonly type: "string";
|
|
491
|
+
};
|
|
492
|
+
readonly metadata: {
|
|
493
|
+
readonly type: "json";
|
|
494
|
+
};
|
|
495
|
+
readonly received_at_ms: {
|
|
496
|
+
readonly type: "integer";
|
|
497
|
+
};
|
|
498
|
+
}, Readonly<Record<string, import("@hot-updater/plugin-core").FieldType>>, {
|
|
499
|
+
readonly byUser: {
|
|
500
|
+
readonly eq: readonly ["user_id"];
|
|
501
|
+
readonly sort: readonly ["install_id"];
|
|
502
|
+
};
|
|
503
|
+
}, readonly ["install_id"]>;
|
|
504
|
+
readonly insights_overview: import("@hot-updater/plugin-core").AggregateDefinition<{
|
|
505
|
+
readonly identity: {
|
|
506
|
+
readonly type: "string";
|
|
507
|
+
readonly maxLength: 32;
|
|
508
|
+
};
|
|
509
|
+
readonly bucket_start_ms: {
|
|
510
|
+
readonly type: "integer";
|
|
511
|
+
};
|
|
512
|
+
}, "downloads" | "failed_launches" | "patch_downloads" | "patch_fallbacks", {
|
|
513
|
+
readonly window: {
|
|
514
|
+
readonly eq: readonly ["identity"];
|
|
515
|
+
readonly sort: readonly ["bucket_start_ms"];
|
|
516
|
+
};
|
|
517
|
+
}, never, readonly ["identity", "bucket_start_ms"]>;
|
|
518
|
+
readonly insights_sketches: import("@hot-updater/plugin-core").AggregateDefinition<{
|
|
519
|
+
readonly identity: {
|
|
520
|
+
readonly type: "string";
|
|
521
|
+
readonly maxLength: 32;
|
|
522
|
+
};
|
|
523
|
+
readonly bucket_start_ms: {
|
|
524
|
+
readonly type: "integer";
|
|
525
|
+
};
|
|
526
|
+
}, never, {
|
|
527
|
+
readonly window: {
|
|
528
|
+
readonly eq: readonly ["identity"];
|
|
529
|
+
readonly sort: readonly ["bucket_start_ms"];
|
|
530
|
+
};
|
|
531
|
+
}, "activity_users" | "failed_users", readonly ["identity", "bucket_start_ms"]>;
|
|
532
|
+
readonly insights_overview_daily: import("@hot-updater/plugin-core").AggregateDefinition<{
|
|
533
|
+
readonly identity: {
|
|
534
|
+
readonly type: "string";
|
|
535
|
+
readonly maxLength: 32;
|
|
536
|
+
};
|
|
537
|
+
readonly bucket_start_ms: {
|
|
538
|
+
readonly type: "integer";
|
|
539
|
+
};
|
|
540
|
+
}, "downloads" | "failed_launches" | "patch_downloads" | "patch_fallbacks", {
|
|
541
|
+
readonly window: {
|
|
542
|
+
readonly eq: readonly ["identity"];
|
|
543
|
+
readonly sort: readonly ["bucket_start_ms"];
|
|
544
|
+
};
|
|
545
|
+
}, never, readonly ["identity", "bucket_start_ms"]>;
|
|
546
|
+
readonly insights_sketches_daily: import("@hot-updater/plugin-core").AggregateDefinition<{
|
|
547
|
+
readonly identity: {
|
|
548
|
+
readonly type: "string";
|
|
549
|
+
readonly maxLength: 32;
|
|
550
|
+
};
|
|
551
|
+
readonly bucket_start_ms: {
|
|
552
|
+
readonly type: "integer";
|
|
553
|
+
};
|
|
554
|
+
}, never, {
|
|
555
|
+
readonly window: {
|
|
556
|
+
readonly eq: readonly ["identity"];
|
|
557
|
+
readonly sort: readonly ["bucket_start_ms"];
|
|
558
|
+
};
|
|
559
|
+
}, "activity_users" | "failed_users", readonly ["identity", "bucket_start_ms"]>;
|
|
560
|
+
readonly insights_overview_lifetime: import("@hot-updater/plugin-core").AggregateDefinition<{
|
|
561
|
+
readonly identity: {
|
|
562
|
+
readonly type: "string";
|
|
563
|
+
readonly maxLength: 32;
|
|
564
|
+
};
|
|
565
|
+
readonly bucket_start_ms: {
|
|
566
|
+
readonly type: "integer";
|
|
567
|
+
};
|
|
568
|
+
}, "downloads" | "failed_launches" | "patch_downloads" | "patch_fallbacks" | "applies" | "failed_updates", {
|
|
569
|
+
readonly window: {
|
|
570
|
+
readonly eq: readonly ["identity"];
|
|
571
|
+
readonly sort: readonly ["bucket_start_ms"];
|
|
572
|
+
};
|
|
573
|
+
}, never, readonly ["identity", "bucket_start_ms"]>;
|
|
574
|
+
readonly insights_sketches_lifetime: import("@hot-updater/plugin-core").AggregateDefinition<{
|
|
575
|
+
readonly identity: {
|
|
576
|
+
readonly type: "string";
|
|
577
|
+
readonly maxLength: 32;
|
|
578
|
+
};
|
|
579
|
+
readonly bucket_start_ms: {
|
|
580
|
+
readonly type: "integer";
|
|
581
|
+
};
|
|
582
|
+
}, never, {
|
|
583
|
+
readonly window: {
|
|
584
|
+
readonly eq: readonly ["identity"];
|
|
585
|
+
readonly sort: readonly ["bucket_start_ms"];
|
|
586
|
+
};
|
|
587
|
+
}, "failed_users", readonly ["identity", "bucket_start_ms"]>;
|
|
588
|
+
readonly insights_distribution: import("@hot-updater/plugin-core").AggregateDefinition<{
|
|
589
|
+
readonly channel: {
|
|
590
|
+
readonly type: "string";
|
|
591
|
+
};
|
|
592
|
+
readonly platform: {
|
|
593
|
+
readonly type: "string";
|
|
594
|
+
readonly maxLength: 16;
|
|
595
|
+
};
|
|
596
|
+
readonly app_version: {
|
|
597
|
+
readonly type: "string";
|
|
598
|
+
};
|
|
599
|
+
readonly release_id: {
|
|
600
|
+
readonly type: "string";
|
|
601
|
+
readonly maxLength: 36;
|
|
602
|
+
};
|
|
603
|
+
readonly bucket_start_ms: {
|
|
604
|
+
readonly type: "integer";
|
|
605
|
+
};
|
|
606
|
+
}, "latest_installations", {
|
|
607
|
+
readonly byScope: {
|
|
608
|
+
readonly eq: readonly ["channel", "platform"];
|
|
609
|
+
readonly sort: readonly ["bucket_start_ms"];
|
|
610
|
+
};
|
|
611
|
+
readonly byVersion: {
|
|
612
|
+
readonly eq: readonly ["channel", "platform", "app_version"];
|
|
613
|
+
readonly sort: readonly ["bucket_start_ms"];
|
|
614
|
+
};
|
|
615
|
+
}, never, readonly ["channel", "platform", "app_version", "release_id", "bucket_start_ms"]>;
|
|
616
|
+
readonly insights_builtin_distribution: import("@hot-updater/plugin-core").AggregateDefinition<{
|
|
617
|
+
readonly channel: {
|
|
618
|
+
readonly type: "string";
|
|
619
|
+
};
|
|
620
|
+
readonly platform: {
|
|
621
|
+
readonly type: "string";
|
|
622
|
+
readonly maxLength: 16;
|
|
623
|
+
};
|
|
624
|
+
readonly app_version: {
|
|
625
|
+
readonly type: "string";
|
|
626
|
+
};
|
|
627
|
+
readonly release_id: {
|
|
628
|
+
readonly type: "string";
|
|
629
|
+
readonly maxLength: 36;
|
|
630
|
+
};
|
|
631
|
+
readonly builtin_bundle_id: {
|
|
632
|
+
readonly type: "string";
|
|
633
|
+
readonly maxLength: 36;
|
|
634
|
+
};
|
|
635
|
+
readonly bucket_start_ms: {
|
|
636
|
+
readonly type: "integer";
|
|
637
|
+
};
|
|
638
|
+
}, "latest_installations", {
|
|
639
|
+
readonly byScope: {
|
|
640
|
+
readonly eq: readonly ["channel", "platform"];
|
|
641
|
+
readonly sort: readonly ["bucket_start_ms"];
|
|
642
|
+
};
|
|
643
|
+
readonly byVersion: {
|
|
644
|
+
readonly eq: readonly ["channel", "platform", "app_version"];
|
|
645
|
+
readonly sort: readonly ["bucket_start_ms"];
|
|
646
|
+
};
|
|
647
|
+
}, never, readonly ["channel", "platform", "app_version", "release_id", "builtin_bundle_id", "bucket_start_ms"]>;
|
|
648
|
+
readonly insights_latest_by_bundle: import("@hot-updater/plugin-core").AggregateDefinition<{
|
|
649
|
+
readonly platform: {
|
|
650
|
+
readonly type: "string";
|
|
651
|
+
readonly maxLength: 16;
|
|
652
|
+
};
|
|
653
|
+
readonly channel: {
|
|
654
|
+
readonly type: "string";
|
|
655
|
+
};
|
|
656
|
+
readonly bundle_field: {
|
|
657
|
+
readonly type: "string";
|
|
658
|
+
readonly maxLength: 16;
|
|
659
|
+
};
|
|
660
|
+
readonly bundle_id: {
|
|
661
|
+
readonly type: "string";
|
|
662
|
+
readonly maxLength: 36;
|
|
663
|
+
};
|
|
664
|
+
readonly type: {
|
|
665
|
+
readonly type: "string";
|
|
666
|
+
readonly maxLength: 32;
|
|
667
|
+
};
|
|
668
|
+
readonly bucket_start_ms: {
|
|
669
|
+
readonly type: "integer";
|
|
670
|
+
};
|
|
671
|
+
}, "installations", {
|
|
672
|
+
readonly byBundle: {
|
|
673
|
+
readonly eq: readonly ["platform", "channel", "bundle_field", "bundle_id", "type"];
|
|
674
|
+
readonly sort: readonly ["bucket_start_ms"];
|
|
675
|
+
};
|
|
676
|
+
}, never, readonly ["platform", "channel", "bundle_field", "bundle_id", "type", "bucket_start_ms"]>;
|
|
677
|
+
readonly insights_outcomes: import("@hot-updater/plugin-core").AggregateDefinition<{
|
|
678
|
+
readonly platform: {
|
|
679
|
+
readonly type: "string";
|
|
680
|
+
readonly maxLength: 16;
|
|
681
|
+
};
|
|
682
|
+
readonly channel: {
|
|
683
|
+
readonly type: "string";
|
|
684
|
+
};
|
|
685
|
+
readonly type: {
|
|
686
|
+
readonly type: "string";
|
|
687
|
+
readonly maxLength: 32;
|
|
688
|
+
};
|
|
689
|
+
readonly bundle_ref: {
|
|
690
|
+
readonly type: "string";
|
|
691
|
+
readonly maxLength: 41;
|
|
692
|
+
};
|
|
693
|
+
readonly bucket_start_ms: {
|
|
694
|
+
readonly type: "integer";
|
|
695
|
+
};
|
|
696
|
+
}, "events", {
|
|
697
|
+
readonly byRef: {
|
|
698
|
+
readonly eq: readonly ["platform", "channel", "type", "bundle_ref"];
|
|
699
|
+
readonly sort: readonly ["bucket_start_ms"];
|
|
700
|
+
};
|
|
701
|
+
}, never, readonly ["platform", "channel", "type", "bundle_ref", "bucket_start_ms"]>;
|
|
702
|
+
readonly insights_failures: import("@hot-updater/plugin-core").AggregateDefinition<{
|
|
703
|
+
readonly platform: {
|
|
704
|
+
readonly type: "string";
|
|
705
|
+
readonly maxLength: 16;
|
|
706
|
+
};
|
|
707
|
+
readonly channel: {
|
|
708
|
+
readonly type: "string";
|
|
709
|
+
};
|
|
710
|
+
readonly bucket_start_ms: {
|
|
711
|
+
readonly type: "integer";
|
|
712
|
+
};
|
|
713
|
+
readonly release_id: {
|
|
714
|
+
readonly type: "string";
|
|
715
|
+
readonly maxLength: 36;
|
|
716
|
+
};
|
|
717
|
+
readonly stage: {
|
|
718
|
+
readonly type: "string";
|
|
719
|
+
readonly maxLength: 16;
|
|
720
|
+
};
|
|
721
|
+
readonly reason: {
|
|
722
|
+
readonly type: "string";
|
|
723
|
+
readonly maxLength: 64;
|
|
724
|
+
};
|
|
725
|
+
readonly detail: {
|
|
726
|
+
readonly type: "string";
|
|
727
|
+
readonly maxLength: 160;
|
|
728
|
+
};
|
|
729
|
+
}, "events", {
|
|
730
|
+
readonly byScope: {
|
|
731
|
+
readonly eq: readonly ["platform", "channel"];
|
|
732
|
+
readonly sort: readonly ["bucket_start_ms"];
|
|
733
|
+
};
|
|
734
|
+
}, never, readonly ["platform", "channel", "bucket_start_ms", "release_id", "stage", "reason", "detail"]>;
|
|
735
|
+
}, {
|
|
736
|
+
api: {
|
|
737
|
+
retention: InsightsRetention;
|
|
738
|
+
recordEvent: (event: BundleEventRow) => Promise<void>;
|
|
739
|
+
listEvents: (input: InsightsListEventsInput) => Promise<readonly BundleEventRow[]>;
|
|
740
|
+
findLatestEvents: (input: InsightsFindLatestEventsInput) => Promise<readonly BundleEventRow[]>;
|
|
741
|
+
countLatestEvents: (input: InsightsCountLatestEventsInput) => Promise<number>;
|
|
742
|
+
countEvents: (input: InsightsCountEventsInput) => Promise<number>;
|
|
743
|
+
countEventSeries: (input: InsightsCountEventSeriesInput) => Promise<readonly InsightsEventSeriesPoint[]>;
|
|
744
|
+
getReleaseActivity: (input: InsightsGetReleaseActivityInput) => Promise<InsightsGetReleaseActivityResult>;
|
|
745
|
+
getAppUsage: (input: InsightsGetAppUsageInput) => Promise<InsightsGetAppUsageResult>;
|
|
746
|
+
getUpdateFailures: (input: InsightsUpdateFailuresInput) => Promise<InsightsUpdateFailures>;
|
|
747
|
+
};
|
|
748
|
+
endpoints: import("@hot-updater/plugin-core").PluginEndpoint[];
|
|
749
|
+
}, {}>, import("@hot-updater/plugin-core").HotUpdaterPlugin<"apiKeys", {
|
|
750
|
+
readonly api_keys: import("@hot-updater/plugin-core").TableDefinition<{
|
|
751
|
+
readonly id: {
|
|
752
|
+
readonly type: "string";
|
|
753
|
+
readonly maxLength: 255;
|
|
754
|
+
};
|
|
755
|
+
readonly hash: {
|
|
756
|
+
readonly type: "string";
|
|
757
|
+
readonly maxLength: 64;
|
|
758
|
+
readonly unique: true;
|
|
759
|
+
};
|
|
760
|
+
readonly name: {
|
|
761
|
+
readonly type: "string";
|
|
762
|
+
readonly maxLength: 64;
|
|
763
|
+
};
|
|
764
|
+
readonly prefix: {
|
|
765
|
+
readonly type: "string";
|
|
766
|
+
readonly maxLength: 16;
|
|
767
|
+
};
|
|
768
|
+
readonly role: {
|
|
769
|
+
readonly type: "string";
|
|
770
|
+
readonly maxLength: 16;
|
|
771
|
+
};
|
|
772
|
+
readonly created_at_ms: {
|
|
773
|
+
readonly type: "integer";
|
|
774
|
+
};
|
|
775
|
+
readonly revoked_at_ms: {
|
|
776
|
+
readonly type: "integer";
|
|
777
|
+
readonly required: false;
|
|
778
|
+
};
|
|
779
|
+
}, {}, {
|
|
780
|
+
readonly byCreated: {
|
|
781
|
+
readonly eq: readonly [];
|
|
782
|
+
readonly sort: readonly ["created_at_ms"];
|
|
783
|
+
};
|
|
784
|
+
}, readonly ["id"]>;
|
|
785
|
+
}, {
|
|
786
|
+
api: {
|
|
787
|
+
register: (input: {
|
|
788
|
+
readonly apiKey: string;
|
|
789
|
+
readonly name: string;
|
|
790
|
+
readonly createdAtMs?: number;
|
|
791
|
+
}) => Promise<CreatedApiKey>;
|
|
792
|
+
provision: (input: {
|
|
793
|
+
readonly existingApiKey?: string;
|
|
794
|
+
readonly name: string;
|
|
795
|
+
}) => Promise<CreatedApiKey>;
|
|
796
|
+
create(input: {
|
|
797
|
+
readonly name: string;
|
|
798
|
+
}): Promise<{
|
|
799
|
+
readonly apiKey: string;
|
|
800
|
+
readonly record: ApiKeyMetadata;
|
|
801
|
+
}>;
|
|
802
|
+
list(): Promise<readonly ApiKeyMetadata[]>;
|
|
803
|
+
revoke(input: {
|
|
804
|
+
readonly id: string;
|
|
805
|
+
}): Promise<ApiKeyMetadata | null>;
|
|
806
|
+
};
|
|
807
|
+
clientAuth: {
|
|
808
|
+
varyHeaders: string[];
|
|
809
|
+
authenticate: (headers: Headers) => Promise<boolean>;
|
|
810
|
+
};
|
|
811
|
+
}, {
|
|
812
|
+
readonly clientAuth: true;
|
|
813
|
+
}>];
|
|
814
|
+
//#endregion
|
|
815
|
+
export { FirebaseDatabaseConfig, FirebaseStorageConfig, firebaseDatabase, firebaseStorage, migrateFirebaseDatabase, plugins };
|