@hot-updater/server 1.0.0-rc.2 → 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/LICENSE +12 -14
- package/dist/adapters/drizzle.cjs +32 -75
- package/dist/adapters/drizzle.d.cts +13 -5
- package/dist/adapters/drizzle.d.mts +13 -5
- package/dist/adapters/drizzle.mjs +32 -77
- package/dist/adapters/drizzleExecutor.cjs +114 -0
- package/dist/adapters/drizzleExecutor.d.cts +9 -0
- package/dist/adapters/drizzleExecutor.d.mts +9 -0
- package/dist/adapters/drizzleExecutor.mjs +112 -0
- package/dist/adapters/kysely.cjs +22 -31
- package/dist/adapters/kysely.d.cts +10 -6
- package/dist/adapters/kysely.d.mts +10 -6
- package/dist/adapters/kysely.mjs +23 -33
- package/dist/adapters/kyselyExecutor.cjs +32 -0
- package/dist/adapters/kyselyExecutor.d.cts +11 -0
- package/dist/adapters/kyselyExecutor.d.mts +11 -0
- package/dist/adapters/kyselyExecutor.mjs +32 -0
- package/dist/adapters/mongodb.cjs +18 -54
- package/dist/adapters/mongodb.d.cts +10 -5
- package/dist/adapters/mongodb.d.mts +10 -5
- package/dist/adapters/mongodb.mjs +19 -56
- package/dist/adapters/mongodbAdapter.cjs +192 -0
- package/dist/adapters/mongodbAdapter.d.cts +9 -0
- package/dist/adapters/mongodbAdapter.d.mts +9 -0
- package/dist/adapters/mongodbAdapter.mjs +191 -0
- package/dist/adapters/prisma.cjs +35 -267
- package/dist/adapters/prisma.d.cts +12 -7
- package/dist/adapters/prisma.d.mts +12 -7
- package/dist/adapters/prisma.mjs +36 -268
- package/dist/adapters/prismaExecutor.cjs +63 -0
- package/dist/adapters/prismaExecutor.mjs +63 -0
- package/dist/adapters/sqlProviders.cjs +14 -0
- package/dist/adapters/sqlProviders.mjs +14 -0
- package/dist/assembly/assemblePlugins.cjs +144 -0
- package/dist/assembly/assemblePlugins.d.cts +5 -0
- package/dist/assembly/assemblePlugins.d.mts +5 -0
- package/dist/assembly/assemblePlugins.mjs +139 -0
- package/dist/assembly/clientPlugins.cjs +88 -0
- package/dist/assembly/clientPlugins.mjs +88 -0
- package/dist/assembly/configError.d.cts +2 -0
- package/dist/assembly/configError.d.mts +2 -0
- package/dist/assembly/configError.mjs +2 -0
- package/dist/core/api.cjs +51 -0
- package/dist/core/api.d.cts +54 -0
- package/dist/core/api.d.mts +54 -0
- package/dist/core/api.mjs +51 -0
- package/dist/core/baseCandidates.cjs +28 -0
- package/dist/core/baseCandidates.mjs +28 -0
- package/dist/core/operations.cjs +351 -0
- package/dist/core/operations.mjs +351 -0
- package/dist/core/reads.cjs +273 -0
- package/dist/core/reads.d.cts +9 -0
- package/dist/core/reads.d.mts +9 -0
- package/dist/core/reads.mjs +267 -0
- package/dist/core/releases.cjs +193 -0
- package/dist/core/releases.mjs +190 -0
- package/dist/core/writes.cjs +96 -0
- package/dist/core/writes.mjs +91 -0
- package/dist/createHotUpdaterCore.cjs +72 -91
- package/dist/createHotUpdaterCore.d.cts +106 -38
- package/dist/createHotUpdaterCore.d.mts +106 -38
- package/dist/createHotUpdaterCore.mjs +74 -89
- package/dist/db/engineDrizzleSchema.cjs +53 -0
- package/dist/db/engineDrizzleSchema.mjs +53 -0
- package/dist/db/enginePrismaSchema.cjs +84 -0
- package/dist/db/enginePrismaSchema.d.cts +5 -0
- package/dist/db/enginePrismaSchema.d.mts +5 -0
- package/dist/db/enginePrismaSchema.mjs +83 -0
- package/dist/db/releaseCatalog.cjs +24 -47
- package/dist/db/releaseCatalog.mjs +20 -44
- package/dist/db/updateArtifacts.cjs +43 -72
- package/dist/db/updateArtifacts.mjs +40 -69
- package/dist/handler.cjs +59 -43
- package/dist/handler.d.cts +3 -5
- package/dist/handler.d.mts +3 -5
- package/dist/handler.mjs +61 -43
- package/dist/handlerAdminRoutes.cjs +374 -0
- package/dist/handlerAdminRoutes.mjs +372 -0
- package/dist/handlerParameters.cjs +6 -11
- package/dist/handlerParameters.mjs +6 -10
- package/dist/handlerReleaseCatalogRoutes.cjs +32 -15
- package/dist/handlerReleaseCatalogRoutes.mjs +32 -15
- package/dist/handlerTypes.d.cts +2 -55
- package/dist/handlerTypes.d.mts +2 -55
- package/dist/handlerVersionRoutes.cjs +20 -4
- package/dist/handlerVersionRoutes.mjs +20 -4
- package/dist/index.cjs +9 -9
- package/dist/index.d.cts +8 -9
- package/dist/index.d.mts +8 -9
- package/dist/index.mjs +3 -4
- package/dist/node.cjs +3 -6
- package/dist/node.d.cts +2 -2
- package/dist/node.d.mts +2 -2
- package/dist/node.mjs +4 -4
- package/dist/package.cjs +1 -1
- package/dist/package.mjs +1 -1
- package/dist/plugins/api-keys/index.cjs +9 -0
- package/dist/plugins/api-keys/index.d.cts +1 -0
- package/dist/plugins/api-keys/index.d.mts +1 -0
- package/dist/plugins/api-keys/index.mjs +2 -0
- package/dist/plugins/definePlugin.d.cts +2 -0
- package/dist/plugins/definePlugin.d.mts +2 -0
- package/dist/plugins/insights/index.cjs +9 -0
- package/dist/plugins/insights/index.d.cts +1 -0
- package/dist/plugins/insights/index.d.mts +1 -0
- package/dist/plugins/insights/index.mjs +2 -0
- package/dist/plugins/official.cjs +30 -0
- package/dist/plugins/official.mjs +29 -0
- package/dist/storageAccess.cjs +13 -10
- package/dist/storageAccess.mjs +13 -10
- package/dist/types/index.d.cts +2 -28
- package/dist/types/index.d.mts +2 -28
- package/package.json +26 -14
- package/dist/_virtual/_rolldown/runtime.cjs +0 -23
- package/dist/adapters/databaseConstraintErrors.cjs +0 -22
- package/dist/adapters/databaseConstraintErrors.mjs +0 -21
- package/dist/adapters/databasePluginUtils.cjs +0 -116
- package/dist/adapters/databasePluginUtils.mjs +0 -106
- package/dist/adapters/drizzleCrud.cjs +0 -311
- package/dist/adapters/drizzleCrud.mjs +0 -308
- package/dist/adapters/drizzleLazyDB.cjs +0 -106
- package/dist/adapters/drizzleLazyDB.mjs +0 -106
- package/dist/adapters/drizzleQuery.cjs +0 -69
- package/dist/adapters/drizzleQuery.mjs +0 -69
- package/dist/adapters/insightsTransaction.cjs +0 -22
- package/dist/adapters/insightsTransaction.mjs +0 -22
- package/dist/adapters/kyselyCrud.cjs +0 -305
- package/dist/adapters/kyselyCrud.mjs +0 -304
- package/dist/adapters/kyselyQuery.cjs +0 -56
- package/dist/adapters/kyselyQuery.mjs +0 -56
- package/dist/adapters/mongodbCollections.cjs +0 -38
- package/dist/adapters/mongodbCollections.mjs +0 -32
- package/dist/adapters/mongodbQuery.cjs +0 -94
- package/dist/adapters/mongodbQuery.mjs +0 -86
- package/dist/adapters/mongodbReads.cjs +0 -210
- package/dist/adapters/mongodbReads.mjs +0 -210
- package/dist/adapters/mongodbWrites.cjs +0 -148
- package/dist/adapters/mongodbWrites.mjs +0 -148
- package/dist/adapters/prismaQuery.cjs +0 -57
- package/dist/adapters/prismaQuery.mjs +0 -56
- package/dist/adapters/prismaRows.cjs +0 -219
- package/dist/adapters/prismaRows.mjs +0 -209
- package/dist/apiKeys.cjs +0 -143
- package/dist/apiKeys.d.cts +0 -49
- package/dist/apiKeys.d.mts +0 -49
- package/dist/apiKeys.mjs +0 -133
- package/dist/db/createBundleDiff.cjs +0 -144
- package/dist/db/createBundleDiff.d.cts +0 -16
- package/dist/db/createBundleDiff.d.mts +0 -16
- package/dist/db/createBundleDiff.mjs +0 -141
- package/dist/db/databasePluginCore.cjs +0 -137
- package/dist/db/databasePluginCore.mjs +0 -137
- package/dist/db/fixedMigrator.cjs +0 -79
- package/dist/db/fixedMigrator.mjs +0 -78
- package/dist/db/fixedMigratorMongo.cjs +0 -321
- package/dist/db/fixedMigratorMongo.mjs +0 -321
- package/dist/db/fixedMigratorShared.cjs +0 -23
- package/dist/db/fixedMigratorShared.mjs +0 -18
- package/dist/db/index.cjs +0 -27
- package/dist/db/index.d.cts +0 -12
- package/dist/db/index.d.mts +0 -12
- package/dist/db/index.mjs +0 -22
- package/dist/db/mongoMigrationExecution.cjs +0 -11
- package/dist/db/mongoMigrationExecution.mjs +0 -11
- package/dist/db/releaseCatalog.d.cts +0 -16
- package/dist/db/releaseCatalog.d.mts +0 -16
- package/dist/db/schema/insightsCollation.cjs +0 -14
- package/dist/db/schema/insightsCollation.mjs +0 -14
- package/dist/db/schema/mongodb.cjs +0 -25
- package/dist/db/schema/mongodb.mjs +0 -25
- package/dist/db/schema/registry.cjs +0 -21
- package/dist/db/schema/registry.mjs +0 -17
- package/dist/db/schema/sql.cjs +0 -105
- package/dist/db/schema/sql.mjs +0 -97
- package/dist/db/schema/sqlOperations.cjs +0 -27
- package/dist/db/schema/sqlOperations.mjs +0 -26
- package/dist/db/schemaGenerators.cjs +0 -275
- package/dist/db/schemaGenerators.mjs +0 -273
- package/dist/db/schemaReadiness.cjs +0 -26
- package/dist/db/schemaReadiness.d.cts +0 -9
- package/dist/db/schemaReadiness.d.mts +0 -9
- package/dist/db/schemaReadiness.mjs +0 -25
- package/dist/db/sqlMigrationExecution.cjs +0 -67
- package/dist/db/sqlMigrationExecution.mjs +0 -67
- package/dist/db/types.cjs +0 -22
- package/dist/db/types.d.cts +0 -118
- package/dist/db/types.d.mts +0 -118
- package/dist/db/types.mjs +0 -19
- package/dist/handlerBundleRoutes.cjs +0 -155
- package/dist/handlerBundleRoutes.mjs +0 -155
- package/dist/handlerReleaseManagementRoutes.cjs +0 -124
- package/dist/handlerReleaseManagementRoutes.mjs +0 -124
- package/dist/insights/domain.d.cts +0 -89
- package/dist/insights/domain.d.mts +0 -89
- package/dist/insights/errors.cjs +0 -15
- package/dist/insights/errors.mjs +0 -14
- package/dist/insights/eventInput.cjs +0 -155
- package/dist/insights/eventInput.mjs +0 -153
- package/dist/insights/provider.cjs +0 -314
- package/dist/insights/provider.d.cts +0 -6
- package/dist/insights/provider.d.mts +0 -6
- package/dist/insights/provider.mjs +0 -314
- package/dist/insights/queryInput.cjs +0 -93
- package/dist/insights/queryInput.mjs +0 -91
- package/dist/insights/routes.cjs +0 -58
- package/dist/insights/routes.mjs +0 -56
- package/dist/insights/types.d.cts +0 -32
- package/dist/insights/types.d.mts +0 -32
- package/dist/schema/dsl.cjs +0 -103
- package/dist/schema/dsl.mjs +0 -87
- package/dist/schema/index.cjs +0 -20
- package/dist/schema/index.mjs +0 -7
- package/dist/schema/settings.cjs +0 -9
- package/dist/schema/settings.mjs +0 -9
- package/dist/schema/types.cjs +0 -8
- package/dist/schema/types.mjs +0 -6
- package/dist/schema/v1_0_0.cjs +0 -406
- package/dist/schema/v1_0_0.mjs +0 -398
- package/src/adapters/databaseConstraintErrors.ts +0 -25
- package/src/adapters/databasePluginTestDatabase.ts +0 -120
- package/src/adapters/databasePluginUtils.spec.ts +0 -29
- package/src/adapters/databasePluginUtils.ts +0 -214
- package/src/adapters/drizzle.spec.ts +0 -336
- package/src/adapters/drizzle.ts +0 -162
- package/src/adapters/drizzleCrud.ts +0 -571
- package/src/adapters/drizzleLazyDB.ts +0 -271
- package/src/adapters/drizzleQuery.ts +0 -164
- package/src/adapters/insightsTransaction.ts +0 -32
- package/src/adapters/kysely.spec.ts +0 -174
- package/src/adapters/kysely.ts +0 -110
- package/src/adapters/kyselyCrud.ts +0 -709
- package/src/adapters/kyselyQuery.ts +0 -128
- package/src/adapters/mongodb.integration.spec.ts +0 -210
- package/src/adapters/mongodb.spec.ts +0 -209
- package/src/adapters/mongodb.ts +0 -138
- package/src/adapters/mongodbCollections.ts +0 -67
- package/src/adapters/mongodbQuery.ts +0 -255
- package/src/adapters/mongodbReads.ts +0 -380
- package/src/adapters/mongodbRows.spec.ts +0 -64
- package/src/adapters/mongodbRows.ts +0 -118
- package/src/adapters/mongodbTestClient.ts +0 -377
- package/src/adapters/mongodbTestFilter.ts +0 -169
- package/src/adapters/mongodbWrites.ts +0 -287
- package/src/adapters/prisma.spec.ts +0 -293
- package/src/adapters/prisma.ts +0 -565
- package/src/adapters/prismaQuery.ts +0 -129
- package/src/adapters/prismaRows.spec.ts +0 -98
- package/src/adapters/prismaRows.ts +0 -337
- package/src/adapters/prismaTestClient.ts +0 -413
- package/src/apiKeys.integration.spec.ts +0 -192
- package/src/apiKeys.spec.ts +0 -162
- package/src/apiKeys.ts +0 -220
- package/src/calculatePagination.ts +0 -34
- package/src/createHotUpdaterCore.ts +0 -246
- package/src/db/bundleRows.spec.ts +0 -164
- package/src/db/bundleRows.ts +0 -10
- package/src/db/createBundleDiff.spec.ts +0 -450
- package/src/db/createBundleDiff.ts +0 -364
- package/src/db/databasePluginCore.spec.ts +0 -62
- package/src/db/databasePluginCore.testFixtures.ts +0 -76
- package/src/db/databasePluginCore.ts +0 -185
- package/src/db/databasePluginUpdateCheck.bench.ts +0 -110
- package/src/db/fixedMigrator.spec.ts +0 -296
- package/src/db/fixedMigrator.ts +0 -147
- package/src/db/fixedMigratorMongo.spec.ts +0 -239
- package/src/db/fixedMigratorMongo.ts +0 -425
- package/src/db/fixedMigratorShared.ts +0 -36
- package/src/db/hotUpdaterSchema.ts +0 -5
- package/src/db/index.spec.ts +0 -1269
- package/src/db/index.ts +0 -47
- package/src/db/mongoMigrationExecution.ts +0 -23
- package/src/db/node-sqlite.d.ts +0 -25
- package/src/db/releaseCatalog.ts +0 -148
- package/src/db/schema/definitions.ts +0 -1
- package/src/db/schema/insightsCollation.ts +0 -21
- package/src/db/schema/mongodb.ts +0 -40
- package/src/db/schema/registry.ts +0 -55
- package/src/db/schema/sql.ts +0 -244
- package/src/db/schema/sqlOperations.ts +0 -63
- package/src/db/schema/types.ts +0 -1
- package/src/db/schemaGenerators.ts +0 -494
- package/src/db/schemaReadiness.ts +0 -34
- package/src/db/sqlMigrationExecution.spec.ts +0 -65
- package/src/db/sqlMigrationExecution.ts +0 -108
- package/src/db/types.spec.ts +0 -63
- package/src/db/types.ts +0 -228
- package/src/db/updateArtifacts.spec.ts +0 -359
- package/src/db/updateArtifacts.ts +0 -541
- package/src/handler-standalone.integration.spec.ts +0 -528
- package/src/handler.spec.ts +0 -190
- package/src/handler.testFixtures.ts +0 -30
- package/src/handler.ts +0 -245
- package/src/handlerAuth.integration.spec.ts +0 -33
- package/src/handlerBundleRoutes.ts +0 -259
- package/src/handlerErrors.ts +0 -7
- package/src/handlerManagement.spec.ts +0 -262
- package/src/handlerParameters.ts +0 -105
- package/src/handlerReleaseCatalogRoutes.ts +0 -154
- package/src/handlerReleaseManagementRoutes.ts +0 -213
- package/src/handlerTypes.ts +0 -96
- package/src/handlerVersionRoutes.ts +0 -12
- package/src/index.ts +0 -30
- package/src/insights/domain.ts +0 -103
- package/src/insights/errors.ts +0 -11
- package/src/insights/eventInput.ts +0 -225
- package/src/insights/insights.integration.spec.ts +0 -381
- package/src/insights/provider.spec.ts +0 -385
- package/src/insights/provider.ts +0 -591
- package/src/insights/queryInput.ts +0 -141
- package/src/insights/routes.ts +0 -104
- package/src/insights/types.ts +0 -55
- package/src/internalRouter.ts +0 -104
- package/src/node.spec.ts +0 -119
- package/src/node.ts +0 -111
- package/src/releaseCatalogRoutes.integration.spec.ts +0 -238
- package/src/runtime.spec.ts +0 -194
- package/src/runtime.testFixtures.ts +0 -71
- package/src/schema/dsl-all-versions.spec.ts +0 -37
- package/src/schema/dsl.ts +0 -187
- package/src/schema/index.ts +0 -10
- package/src/schema/settings.ts +0 -15
- package/src/schema/types.ts +0 -79
- package/src/schema/v1_0_0.spec.ts +0 -220
- package/src/schema/v1_0_0.ts +0 -529
- package/src/storageAccess.spec.ts +0 -152
- package/src/storageAccess.ts +0 -141
- package/src/types/index.ts +0 -34
- package/src/version.ts +0 -3
package/src/insights/provider.ts
DELETED
|
@@ -1,591 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
compareInsightsText,
|
|
3
|
-
isInsightsMovementEvent,
|
|
4
|
-
isUUIDv7,
|
|
5
|
-
toInsightsInstallationRow,
|
|
6
|
-
type InsightsBundleEventFilter,
|
|
7
|
-
type BundleEventRow,
|
|
8
|
-
type InsightsEventCursor,
|
|
9
|
-
type InsightsEventFilter,
|
|
10
|
-
type InsightsInstallationRow,
|
|
11
|
-
type InsightsModel,
|
|
12
|
-
} from "@hot-updater/plugin-core";
|
|
13
|
-
|
|
14
|
-
import type {
|
|
15
|
-
ActiveInstallationWindow,
|
|
16
|
-
InsightsBundleSelection,
|
|
17
|
-
InsightsScope,
|
|
18
|
-
EventHistoryRow,
|
|
19
|
-
InstallationHistoryRow,
|
|
20
|
-
InstallationRow,
|
|
21
|
-
} from "./domain";
|
|
22
|
-
import { InsightsBadRequestError } from "./errors";
|
|
23
|
-
import { createBundleEventRow } from "./eventInput";
|
|
24
|
-
import type {
|
|
25
|
-
InsightsEventPageInput,
|
|
26
|
-
InsightsInstallationEventPageInput,
|
|
27
|
-
InsightsProvider,
|
|
28
|
-
InsightsUserInstallationPageInput,
|
|
29
|
-
} from "./types";
|
|
30
|
-
|
|
31
|
-
const DEFAULT_PAGE_LIMIT = 50;
|
|
32
|
-
const MAX_PAGE_LIMIT = 100;
|
|
33
|
-
const MAX_EVENT_ID_LENGTH = 1_024;
|
|
34
|
-
const MAX_IDENTITY_LENGTH = 255;
|
|
35
|
-
const MAX_CURSOR_LENGTH = 8 * 1_024;
|
|
36
|
-
|
|
37
|
-
const WINDOW_MS: Record<ActiveInstallationWindow, number> = {
|
|
38
|
-
"24h": 24 * 60 * 60 * 1_000,
|
|
39
|
-
"7d": 7 * 24 * 60 * 60 * 1_000,
|
|
40
|
-
"30d": 30 * 24 * 60 * 60 * 1_000,
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
type EventCursorPayload = {
|
|
44
|
-
readonly after: InsightsEventCursor;
|
|
45
|
-
readonly beforeReceivedAtMs: number;
|
|
46
|
-
readonly sinceMs: number;
|
|
47
|
-
readonly kind: "events";
|
|
48
|
-
readonly filter: InsightsEventFilter;
|
|
49
|
-
readonly version: 2;
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
type UserInstallationCursorPayload = {
|
|
53
|
-
readonly afterInstallId: string;
|
|
54
|
-
readonly kind: "user-installations";
|
|
55
|
-
readonly userId: string;
|
|
56
|
-
readonly version: 1;
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
const isRecord = (value: unknown): value is Readonly<Record<string, unknown>> =>
|
|
60
|
-
typeof value === "object" && value !== null && !Array.isArray(value);
|
|
61
|
-
|
|
62
|
-
const requireString = (
|
|
63
|
-
value: unknown,
|
|
64
|
-
label: string,
|
|
65
|
-
maximumLength: number,
|
|
66
|
-
): string => {
|
|
67
|
-
if (
|
|
68
|
-
typeof value !== "string" ||
|
|
69
|
-
value.length === 0 ||
|
|
70
|
-
value.length > maximumLength ||
|
|
71
|
-
new TextDecoder("utf-8", { ignoreBOM: true }).decode(
|
|
72
|
-
new TextEncoder().encode(value),
|
|
73
|
-
) !== value
|
|
74
|
-
) {
|
|
75
|
-
throw new InsightsBadRequestError(`Invalid ${label}.`);
|
|
76
|
-
}
|
|
77
|
-
return value;
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
const requireTimestamp = (value: unknown, label: string): number => {
|
|
81
|
-
if (!Number.isSafeInteger(value) || Number(value) < 0) {
|
|
82
|
-
throw new InsightsBadRequestError(`Invalid ${label}.`);
|
|
83
|
-
}
|
|
84
|
-
return Number(value);
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
const readLimit = (value: number | undefined): number => {
|
|
88
|
-
const limit = value ?? DEFAULT_PAGE_LIMIT;
|
|
89
|
-
if (!Number.isSafeInteger(limit) || limit < 1 || limit > MAX_PAGE_LIMIT) {
|
|
90
|
-
throw new InsightsBadRequestError("Invalid page limit.");
|
|
91
|
-
}
|
|
92
|
-
return limit;
|
|
93
|
-
};
|
|
94
|
-
|
|
95
|
-
const encodeBase64Url = (value: string): string => {
|
|
96
|
-
const bytes = new TextEncoder().encode(value);
|
|
97
|
-
let binary = "";
|
|
98
|
-
for (const byte of bytes) binary += String.fromCharCode(byte);
|
|
99
|
-
return btoa(binary)
|
|
100
|
-
.replaceAll("+", "-")
|
|
101
|
-
.replaceAll("/", "_")
|
|
102
|
-
.replace(/=+$/u, "");
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
const decodeBase64Url = (value: string): string => {
|
|
106
|
-
if (value.length === 0 || value.length > MAX_CURSOR_LENGTH) {
|
|
107
|
-
throw new InsightsBadRequestError("Invalid Insights cursor.");
|
|
108
|
-
}
|
|
109
|
-
try {
|
|
110
|
-
const base64 = value.replaceAll("-", "+").replaceAll("_", "/");
|
|
111
|
-
const padded = base64.padEnd(Math.ceil(base64.length / 4) * 4, "=");
|
|
112
|
-
const binary = atob(padded);
|
|
113
|
-
const bytes = Uint8Array.from(binary, (character) =>
|
|
114
|
-
character.charCodeAt(0),
|
|
115
|
-
);
|
|
116
|
-
return new TextDecoder("utf-8", { fatal: true }).decode(bytes);
|
|
117
|
-
} catch {
|
|
118
|
-
throw new InsightsBadRequestError("Invalid Insights cursor.");
|
|
119
|
-
}
|
|
120
|
-
};
|
|
121
|
-
|
|
122
|
-
const encodeCursor = (
|
|
123
|
-
value: EventCursorPayload | UserInstallationCursorPayload,
|
|
124
|
-
): string => encodeBase64Url(JSON.stringify(value));
|
|
125
|
-
|
|
126
|
-
const decodeCursor = (value: string): unknown => {
|
|
127
|
-
try {
|
|
128
|
-
return JSON.parse(decodeBase64Url(value));
|
|
129
|
-
} catch (error) {
|
|
130
|
-
if (error instanceof InsightsBadRequestError) throw error;
|
|
131
|
-
throw new InsightsBadRequestError("Invalid Insights cursor.");
|
|
132
|
-
}
|
|
133
|
-
};
|
|
134
|
-
|
|
135
|
-
const readScope = (input: InsightsScope): InsightsScope => {
|
|
136
|
-
if (input.platform !== "ios" && input.platform !== "android") {
|
|
137
|
-
throw new InsightsBadRequestError("Invalid Insights platform.");
|
|
138
|
-
}
|
|
139
|
-
return {
|
|
140
|
-
platform: input.platform,
|
|
141
|
-
channel: requireString(input.channel, "channel", MAX_EVENT_ID_LENGTH),
|
|
142
|
-
};
|
|
143
|
-
};
|
|
144
|
-
|
|
145
|
-
// Counts and drill-downs share the exact same raw predicate.
|
|
146
|
-
const bundleFilter = (
|
|
147
|
-
input: InsightsBundleSelection,
|
|
148
|
-
): InsightsBundleEventFilter => {
|
|
149
|
-
const scope = readScope(input);
|
|
150
|
-
const bundleId = requireString(
|
|
151
|
-
input.bundleId,
|
|
152
|
-
"bundle ID",
|
|
153
|
-
MAX_EVENT_ID_LENGTH,
|
|
154
|
-
);
|
|
155
|
-
switch (input.outcome) {
|
|
156
|
-
case "applied":
|
|
157
|
-
return { ...scope, type: "UPDATE_APPLIED", toBundleId: bundleId };
|
|
158
|
-
case "recovered":
|
|
159
|
-
return { ...scope, type: "RECOVERED", fromBundleId: bundleId };
|
|
160
|
-
case "adopted":
|
|
161
|
-
return { ...scope, type: "RELEASE_ADOPTED", toBundleId: bundleId };
|
|
162
|
-
default:
|
|
163
|
-
throw new InsightsBadRequestError("Invalid Insights outcome.");
|
|
164
|
-
}
|
|
165
|
-
};
|
|
166
|
-
|
|
167
|
-
const sameFilter = (left: unknown, right: InsightsEventFilter): boolean => {
|
|
168
|
-
if (!isRecord(left) || left.kind !== right.kind) return false;
|
|
169
|
-
switch (right.kind) {
|
|
170
|
-
case "all":
|
|
171
|
-
return true;
|
|
172
|
-
case "installationMovement":
|
|
173
|
-
return left.installId === right.installId;
|
|
174
|
-
case "bundle":
|
|
175
|
-
return (
|
|
176
|
-
left.platform === right.platform &&
|
|
177
|
-
left.channel === right.channel &&
|
|
178
|
-
left.type === right.type &&
|
|
179
|
-
(right.type === "RECOVERED"
|
|
180
|
-
? left.fromBundleId === right.fromBundleId
|
|
181
|
-
: left.toBundleId === right.toBundleId)
|
|
182
|
-
);
|
|
183
|
-
}
|
|
184
|
-
};
|
|
185
|
-
|
|
186
|
-
const readEventCursor = (
|
|
187
|
-
value: string,
|
|
188
|
-
filter: InsightsEventFilter,
|
|
189
|
-
): EventCursorPayload => {
|
|
190
|
-
const cursor = decodeCursor(value);
|
|
191
|
-
if (
|
|
192
|
-
!isRecord(cursor) ||
|
|
193
|
-
cursor.version !== 2 ||
|
|
194
|
-
cursor.kind !== "events" ||
|
|
195
|
-
!isRecord(cursor.filter) ||
|
|
196
|
-
!isRecord(cursor.after)
|
|
197
|
-
) {
|
|
198
|
-
throw new InsightsBadRequestError("Invalid Insights cursor.");
|
|
199
|
-
}
|
|
200
|
-
if (!sameFilter(cursor.filter, filter)) {
|
|
201
|
-
throw new InsightsBadRequestError(
|
|
202
|
-
"Insights cursor does not match the requested events.",
|
|
203
|
-
);
|
|
204
|
-
}
|
|
205
|
-
if (typeof cursor.after.id !== "string" || !isUUIDv7(cursor.after.id)) {
|
|
206
|
-
throw new InsightsBadRequestError("Invalid Insights event cursor ID.");
|
|
207
|
-
}
|
|
208
|
-
return {
|
|
209
|
-
after: {
|
|
210
|
-
id: cursor.after.id,
|
|
211
|
-
receivedAtMs: requireTimestamp(cursor.after.receivedAtMs, "event cursor"),
|
|
212
|
-
},
|
|
213
|
-
beforeReceivedAtMs: requireTimestamp(
|
|
214
|
-
cursor.beforeReceivedAtMs,
|
|
215
|
-
"event cutoff",
|
|
216
|
-
),
|
|
217
|
-
kind: "events",
|
|
218
|
-
sinceMs: requireTimestamp(cursor.sinceMs, "event start"),
|
|
219
|
-
filter,
|
|
220
|
-
version: 2,
|
|
221
|
-
};
|
|
222
|
-
};
|
|
223
|
-
|
|
224
|
-
const readUserInstallationCursor = (
|
|
225
|
-
value: string,
|
|
226
|
-
userId: string,
|
|
227
|
-
): UserInstallationCursorPayload => {
|
|
228
|
-
const cursor = decodeCursor(value);
|
|
229
|
-
if (
|
|
230
|
-
!isRecord(cursor) ||
|
|
231
|
-
cursor.version !== 1 ||
|
|
232
|
-
cursor.kind !== "user-installations" ||
|
|
233
|
-
cursor.userId !== userId
|
|
234
|
-
) {
|
|
235
|
-
throw new InsightsBadRequestError(
|
|
236
|
-
"Insights cursor does not match the requested user ID.",
|
|
237
|
-
);
|
|
238
|
-
}
|
|
239
|
-
return {
|
|
240
|
-
afterInstallId: requireString(
|
|
241
|
-
cursor.afterInstallId,
|
|
242
|
-
"installation cursor",
|
|
243
|
-
MAX_IDENTITY_LENGTH,
|
|
244
|
-
),
|
|
245
|
-
kind: "user-installations",
|
|
246
|
-
userId,
|
|
247
|
-
version: 1,
|
|
248
|
-
};
|
|
249
|
-
};
|
|
250
|
-
|
|
251
|
-
const compareEventNewest = (
|
|
252
|
-
left: Pick<BundleEventRow, "id" | "received_at_ms">,
|
|
253
|
-
right: Pick<BundleEventRow, "id" | "received_at_ms">,
|
|
254
|
-
): number =>
|
|
255
|
-
right.received_at_ms - left.received_at_ms ||
|
|
256
|
-
compareInsightsText(right.id, left.id);
|
|
257
|
-
|
|
258
|
-
const isAfterEventCursor = (
|
|
259
|
-
row: BundleEventRow,
|
|
260
|
-
after: InsightsEventCursor,
|
|
261
|
-
): boolean =>
|
|
262
|
-
row.received_at_ms < after.receivedAtMs ||
|
|
263
|
-
(row.received_at_ms === after.receivedAtMs &&
|
|
264
|
-
compareInsightsText(row.id, after.id) < 0);
|
|
265
|
-
|
|
266
|
-
const assertEventRows = (
|
|
267
|
-
rows: readonly BundleEventRow[],
|
|
268
|
-
input: {
|
|
269
|
-
readonly after?: InsightsEventCursor;
|
|
270
|
-
readonly beforeReceivedAtMs: number;
|
|
271
|
-
readonly limit: number;
|
|
272
|
-
readonly filter: InsightsEventFilter;
|
|
273
|
-
readonly sinceMs: number;
|
|
274
|
-
},
|
|
275
|
-
): void => {
|
|
276
|
-
if (rows.length > input.limit) {
|
|
277
|
-
throw new Error("Insights database returned too many event rows.");
|
|
278
|
-
}
|
|
279
|
-
for (let index = 0; index < rows.length; index += 1) {
|
|
280
|
-
const row = rows[index];
|
|
281
|
-
const previous = rows[index - 1];
|
|
282
|
-
if (
|
|
283
|
-
!row ||
|
|
284
|
-
typeof row.id !== "string" ||
|
|
285
|
-
!isUUIDv7(row.id) ||
|
|
286
|
-
!Number.isSafeInteger(row.received_at_ms) ||
|
|
287
|
-
row.received_at_ms >= input.beforeReceivedAtMs ||
|
|
288
|
-
row.received_at_ms < input.sinceMs ||
|
|
289
|
-
(previous !== undefined && compareEventNewest(previous, row) >= 0) ||
|
|
290
|
-
(input.after !== undefined && !isAfterEventCursor(row, input.after)) ||
|
|
291
|
-
(input.filter.kind === "installationMovement" &&
|
|
292
|
-
(row.install_id !== input.filter.installId ||
|
|
293
|
-
!isInsightsMovementEvent(row))) ||
|
|
294
|
-
(input.filter.kind === "bundle" &&
|
|
295
|
-
(row.platform !== input.filter.platform ||
|
|
296
|
-
row.channel !== input.filter.channel ||
|
|
297
|
-
row.type !== input.filter.type ||
|
|
298
|
-
(input.filter.type === "RECOVERED"
|
|
299
|
-
? row.from_bundle_id !== input.filter.fromBundleId
|
|
300
|
-
: row.to_bundle_id !== input.filter.toBundleId)))
|
|
301
|
-
) {
|
|
302
|
-
throw new Error("Insights database returned invalid event rows.");
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
};
|
|
306
|
-
|
|
307
|
-
const toEventHistoryRow = (row: BundleEventRow): EventHistoryRow => ({
|
|
308
|
-
appVersion: row.app_version,
|
|
309
|
-
channel: row.channel,
|
|
310
|
-
cohort: row.cohort,
|
|
311
|
-
fromBundleId: row.from_bundle_id,
|
|
312
|
-
id: row.id,
|
|
313
|
-
installId: row.install_id,
|
|
314
|
-
platform: row.platform,
|
|
315
|
-
receivedAtMs: row.received_at_ms,
|
|
316
|
-
toBundleId: row.to_bundle_id,
|
|
317
|
-
type: row.type,
|
|
318
|
-
userId: row.user_id,
|
|
319
|
-
username: row.username,
|
|
320
|
-
});
|
|
321
|
-
|
|
322
|
-
const toInstallationRow = (row: InsightsInstallationRow): InstallationRow => ({
|
|
323
|
-
appVersion: row.app_version,
|
|
324
|
-
channel: row.channel,
|
|
325
|
-
cohort: row.cohort,
|
|
326
|
-
installId: row.install_id,
|
|
327
|
-
lastKnownBundleId: row.to_bundle_id,
|
|
328
|
-
latestStatus: row.type,
|
|
329
|
-
platform: row.platform,
|
|
330
|
-
receivedAtMs: row.received_at_ms,
|
|
331
|
-
userId: row.user_id,
|
|
332
|
-
username: row.username,
|
|
333
|
-
});
|
|
334
|
-
|
|
335
|
-
const pageEventRows = async <T extends EventHistoryRow>(
|
|
336
|
-
model: InsightsModel,
|
|
337
|
-
input: InsightsEventPageInput,
|
|
338
|
-
filter: InsightsEventFilter,
|
|
339
|
-
map: (row: BundleEventRow) => T,
|
|
340
|
-
) => {
|
|
341
|
-
const limit = readLimit(input.limit);
|
|
342
|
-
const cursor =
|
|
343
|
-
input.cursor === undefined
|
|
344
|
-
? undefined
|
|
345
|
-
: readEventCursor(input.cursor, filter);
|
|
346
|
-
const beforeReceivedAtMs =
|
|
347
|
-
cursor?.beforeReceivedAtMs ??
|
|
348
|
-
(input.beforeReceivedAtMs === undefined
|
|
349
|
-
? Date.now()
|
|
350
|
-
: requireTimestamp(input.beforeReceivedAtMs, "event cutoff"));
|
|
351
|
-
if (
|
|
352
|
-
cursor !== undefined &&
|
|
353
|
-
input.beforeReceivedAtMs !== undefined &&
|
|
354
|
-
input.beforeReceivedAtMs !== beforeReceivedAtMs
|
|
355
|
-
) {
|
|
356
|
-
throw new InsightsBadRequestError(
|
|
357
|
-
"Insights cursor does not match the requested event cutoff.",
|
|
358
|
-
);
|
|
359
|
-
}
|
|
360
|
-
const sinceMs =
|
|
361
|
-
cursor?.sinceMs ??
|
|
362
|
-
(input.sinceMs === undefined
|
|
363
|
-
? 0
|
|
364
|
-
: requireTimestamp(input.sinceMs, "event start"));
|
|
365
|
-
if (
|
|
366
|
-
sinceMs > beforeReceivedAtMs ||
|
|
367
|
-
(input.sinceMs !== undefined && input.sinceMs !== sinceMs) ||
|
|
368
|
-
(cursor !== undefined &&
|
|
369
|
-
(cursor.after.receivedAtMs < sinceMs ||
|
|
370
|
-
cursor.after.receivedAtMs >= beforeReceivedAtMs))
|
|
371
|
-
) {
|
|
372
|
-
throw new InsightsBadRequestError(
|
|
373
|
-
"Insights cursor or range does not match the requested event start.",
|
|
374
|
-
);
|
|
375
|
-
}
|
|
376
|
-
const databaseInput = {
|
|
377
|
-
filter,
|
|
378
|
-
sinceMs,
|
|
379
|
-
beforeReceivedAtMs,
|
|
380
|
-
...(cursor === undefined ? {} : { after: cursor.after }),
|
|
381
|
-
limit: limit + 1,
|
|
382
|
-
};
|
|
383
|
-
const rows = await model.listEvents(databaseInput);
|
|
384
|
-
assertEventRows(rows, databaseInput);
|
|
385
|
-
const pageRows = rows.slice(0, limit);
|
|
386
|
-
const last = pageRows.at(-1);
|
|
387
|
-
return {
|
|
388
|
-
beforeReceivedAtMs,
|
|
389
|
-
data: pageRows.map(map),
|
|
390
|
-
nextCursor:
|
|
391
|
-
rows.length > limit && last
|
|
392
|
-
? encodeCursor({
|
|
393
|
-
after: { id: last.id, receivedAtMs: last.received_at_ms },
|
|
394
|
-
beforeReceivedAtMs,
|
|
395
|
-
kind: "events",
|
|
396
|
-
filter,
|
|
397
|
-
sinceMs,
|
|
398
|
-
version: 2,
|
|
399
|
-
})
|
|
400
|
-
: null,
|
|
401
|
-
};
|
|
402
|
-
};
|
|
403
|
-
|
|
404
|
-
const assertInstallationRows = (
|
|
405
|
-
rows: readonly InsightsInstallationRow[],
|
|
406
|
-
input: {
|
|
407
|
-
readonly afterInstallId?: string;
|
|
408
|
-
readonly limit: number;
|
|
409
|
-
readonly userId: string;
|
|
410
|
-
},
|
|
411
|
-
): void => {
|
|
412
|
-
if (rows.length > input.limit) {
|
|
413
|
-
throw new Error("Insights database returned too many installation rows.");
|
|
414
|
-
}
|
|
415
|
-
for (let index = 0; index < rows.length; index += 1) {
|
|
416
|
-
const row = rows[index];
|
|
417
|
-
const previous = rows[index - 1];
|
|
418
|
-
if (
|
|
419
|
-
!row ||
|
|
420
|
-
row.user_id !== input.userId ||
|
|
421
|
-
(input.afterInstallId !== undefined &&
|
|
422
|
-
compareInsightsText(row.install_id, input.afterInstallId) <= 0) ||
|
|
423
|
-
(previous !== undefined &&
|
|
424
|
-
compareInsightsText(previous.install_id, row.install_id) >= 0)
|
|
425
|
-
) {
|
|
426
|
-
throw new Error("Insights database returned invalid installation rows.");
|
|
427
|
-
}
|
|
428
|
-
}
|
|
429
|
-
};
|
|
430
|
-
|
|
431
|
-
export const createInsightsProvider = (
|
|
432
|
-
model: InsightsModel,
|
|
433
|
-
): InsightsProvider =>
|
|
434
|
-
Object.freeze({
|
|
435
|
-
async appendBundleEvent(input) {
|
|
436
|
-
const event = createBundleEventRow(input);
|
|
437
|
-
await model.record({
|
|
438
|
-
event,
|
|
439
|
-
installation: toInsightsInstallationRow(event),
|
|
440
|
-
});
|
|
441
|
-
},
|
|
442
|
-
listEvents(input) {
|
|
443
|
-
const filter: InsightsEventFilter =
|
|
444
|
-
input.bundle === undefined
|
|
445
|
-
? { kind: "all" }
|
|
446
|
-
: { kind: "bundle", ...bundleFilter(input.bundle) };
|
|
447
|
-
return pageEventRows(model, input, filter, toEventHistoryRow);
|
|
448
|
-
},
|
|
449
|
-
async listInstallationEvents(input: InsightsInstallationEventPageInput) {
|
|
450
|
-
if ("bundle" in input && input.bundle !== undefined) {
|
|
451
|
-
throw new InsightsBadRequestError(
|
|
452
|
-
"Installation movement queries cannot include a bundle filter.",
|
|
453
|
-
);
|
|
454
|
-
}
|
|
455
|
-
const installId = requireString(
|
|
456
|
-
input.installId,
|
|
457
|
-
"install ID",
|
|
458
|
-
MAX_IDENTITY_LENGTH,
|
|
459
|
-
);
|
|
460
|
-
return pageEventRows(
|
|
461
|
-
model,
|
|
462
|
-
input,
|
|
463
|
-
{ kind: "installationMovement", installId },
|
|
464
|
-
(row) => toEventHistoryRow(row) as InstallationHistoryRow,
|
|
465
|
-
);
|
|
466
|
-
},
|
|
467
|
-
async getInstallation({ installId }) {
|
|
468
|
-
const normalizedInstallId = requireString(
|
|
469
|
-
installId,
|
|
470
|
-
"install ID",
|
|
471
|
-
MAX_IDENTITY_LENGTH,
|
|
472
|
-
);
|
|
473
|
-
const rows = await model.findInstallations({
|
|
474
|
-
installId: normalizedInstallId,
|
|
475
|
-
});
|
|
476
|
-
const row = rows[0] ?? null;
|
|
477
|
-
if (
|
|
478
|
-
rows.length > 1 ||
|
|
479
|
-
(row !== null && row.install_id !== normalizedInstallId)
|
|
480
|
-
) {
|
|
481
|
-
throw new Error("Insights database returned an invalid installation.");
|
|
482
|
-
}
|
|
483
|
-
return row === null ? null : toInstallationRow(row);
|
|
484
|
-
},
|
|
485
|
-
async pageInstallationsByCurrentUserId(
|
|
486
|
-
input: InsightsUserInstallationPageInput,
|
|
487
|
-
) {
|
|
488
|
-
const userId = requireString(
|
|
489
|
-
input.userId,
|
|
490
|
-
"user ID",
|
|
491
|
-
MAX_IDENTITY_LENGTH,
|
|
492
|
-
);
|
|
493
|
-
const limit = readLimit(input.limit);
|
|
494
|
-
const cursor =
|
|
495
|
-
input.cursor === undefined
|
|
496
|
-
? undefined
|
|
497
|
-
: readUserInstallationCursor(input.cursor, userId);
|
|
498
|
-
const databaseInput = {
|
|
499
|
-
userId,
|
|
500
|
-
...(cursor === undefined
|
|
501
|
-
? {}
|
|
502
|
-
: { afterInstallId: cursor.afterInstallId }),
|
|
503
|
-
limit: limit + 1,
|
|
504
|
-
};
|
|
505
|
-
const rows = await model.findInstallations(databaseInput);
|
|
506
|
-
assertInstallationRows(rows, databaseInput);
|
|
507
|
-
const pageRows = rows.slice(0, limit);
|
|
508
|
-
const last = pageRows.at(-1);
|
|
509
|
-
return {
|
|
510
|
-
data: pageRows.map(toInstallationRow),
|
|
511
|
-
nextCursor:
|
|
512
|
-
rows.length > limit && last
|
|
513
|
-
? encodeCursor({
|
|
514
|
-
afterInstallId: last.install_id,
|
|
515
|
-
kind: "user-installations",
|
|
516
|
-
userId,
|
|
517
|
-
version: 1,
|
|
518
|
-
})
|
|
519
|
-
: null,
|
|
520
|
-
};
|
|
521
|
-
},
|
|
522
|
-
async getReportingOverview(input) {
|
|
523
|
-
const scope = readScope(input);
|
|
524
|
-
const { window } = input;
|
|
525
|
-
if (!Object.hasOwn(WINDOW_MS, window)) {
|
|
526
|
-
throw new InsightsBadRequestError(
|
|
527
|
-
"Invalid reporting installation window.",
|
|
528
|
-
);
|
|
529
|
-
}
|
|
530
|
-
const beforeReceivedAtMs = Date.now();
|
|
531
|
-
const sinceMs = Math.max(0, beforeReceivedAtMs - WINDOW_MS[window]);
|
|
532
|
-
const measure = async (count: Promise<number>) => {
|
|
533
|
-
const value = await count;
|
|
534
|
-
if (!Number.isSafeInteger(value) || value < 0) {
|
|
535
|
-
throw new Error("Insights database returned an invalid count.");
|
|
536
|
-
}
|
|
537
|
-
return { count: value, measuredAtMs: Date.now() };
|
|
538
|
-
};
|
|
539
|
-
const bundleId =
|
|
540
|
-
input.bundleId === undefined
|
|
541
|
-
? undefined
|
|
542
|
-
: requireString(input.bundleId, "bundle ID", MAX_EVENT_ID_LENGTH);
|
|
543
|
-
const reporting = measure(
|
|
544
|
-
model.countInstallations({ ...scope, sinceMs }),
|
|
545
|
-
);
|
|
546
|
-
if (bundleId === undefined) {
|
|
547
|
-
return {
|
|
548
|
-
...scope,
|
|
549
|
-
window,
|
|
550
|
-
sinceMs,
|
|
551
|
-
beforeReceivedAtMs,
|
|
552
|
-
reportingInstallations: await reporting,
|
|
553
|
-
};
|
|
554
|
-
}
|
|
555
|
-
const countOutcome = (outcome: InsightsBundleSelection["outcome"]) =>
|
|
556
|
-
measure(
|
|
557
|
-
model.countEvents({
|
|
558
|
-
filter: bundleFilter({ ...scope, bundleId, outcome }),
|
|
559
|
-
sinceMs,
|
|
560
|
-
beforeReceivedAtMs,
|
|
561
|
-
}),
|
|
562
|
-
);
|
|
563
|
-
const [
|
|
564
|
-
reportingInstallations,
|
|
565
|
-
bundleInstallations,
|
|
566
|
-
appliedReports,
|
|
567
|
-
recoveredReports,
|
|
568
|
-
adoptedReports,
|
|
569
|
-
] = await Promise.all([
|
|
570
|
-
reporting,
|
|
571
|
-
measure(model.countInstallations({ ...scope, sinceMs, bundleId })),
|
|
572
|
-
countOutcome("applied"),
|
|
573
|
-
countOutcome("recovered"),
|
|
574
|
-
countOutcome("adopted"),
|
|
575
|
-
]);
|
|
576
|
-
return {
|
|
577
|
-
...scope,
|
|
578
|
-
window,
|
|
579
|
-
sinceMs,
|
|
580
|
-
beforeReceivedAtMs,
|
|
581
|
-
reportingInstallations,
|
|
582
|
-
bundle: {
|
|
583
|
-
bundleId,
|
|
584
|
-
reportingInstallations: bundleInstallations,
|
|
585
|
-
appliedReports,
|
|
586
|
-
recoveredReports,
|
|
587
|
-
adoptedReports,
|
|
588
|
-
},
|
|
589
|
-
};
|
|
590
|
-
},
|
|
591
|
-
});
|