@hot-updater/server 1.0.0-rc.14 → 1.0.0-rc.16
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/adapters/drizzle.cjs +35 -74
- package/dist/adapters/drizzle.d.cts +13 -5
- package/dist/adapters/drizzle.d.mts +13 -5
- package/dist/adapters/drizzle.mjs +34 -75
- 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 +25 -31
- package/dist/adapters/kysely.d.cts +10 -6
- package/dist/adapters/kysely.d.mts +10 -6
- package/dist/adapters/kysely.mjs +25 -32
- package/dist/adapters/kyselyExecutor.cjs +32 -0
- package/dist/adapters/kyselyExecutor.d.cts +12 -0
- package/dist/adapters/kyselyExecutor.d.mts +12 -0
- package/dist/adapters/kyselyExecutor.mjs +32 -0
- package/dist/adapters/mongodb.cjs +28 -62
- package/dist/adapters/mongodb.d.cts +10 -5
- package/dist/adapters/mongodb.d.mts +10 -5
- package/dist/adapters/mongodb.mjs +28 -63
- package/dist/adapters/mongodbAdapter.cjs +174 -0
- package/dist/adapters/mongodbAdapter.d.cts +9 -0
- package/dist/adapters/mongodbAdapter.d.mts +9 -0
- package/dist/adapters/mongodbAdapter.mjs +173 -0
- package/dist/adapters/prisma.cjs +38 -257
- package/dist/adapters/prisma.d.cts +12 -7
- package/dist/adapters/prisma.d.mts +12 -7
- package/dist/adapters/prisma.mjs +38 -257
- package/dist/adapters/prismaExecutor.cjs +64 -0
- package/dist/adapters/prismaExecutor.mjs +64 -0
- package/dist/adapters/sqlProviders.cjs +9 -0
- package/dist/adapters/sqlProviders.mjs +9 -0
- package/dist/apiKeys.cjs +2 -6
- package/dist/apiKeys.d.cts +1 -23
- package/dist/apiKeys.d.mts +1 -23
- package/dist/apiKeys.mjs +2 -6
- package/dist/assembly/assemblePlugins.cjs +147 -0
- package/dist/assembly/assemblePlugins.d.cts +12 -0
- package/dist/assembly/assemblePlugins.d.mts +12 -0
- package/dist/assembly/assemblePlugins.mjs +146 -0
- package/dist/assembly/databasePlugins.cjs +23 -0
- package/dist/assembly/databasePlugins.d.cts +43 -0
- package/dist/assembly/databasePlugins.d.mts +43 -0
- package/dist/assembly/databasePlugins.mjs +22 -0
- package/dist/core/api.cjs +91 -0
- package/dist/core/api.d.cts +65 -0
- package/dist/core/api.d.mts +65 -0
- package/dist/core/api.mjs +87 -0
- package/dist/core/baseCandidates.cjs +71 -0
- package/dist/core/baseCandidates.d.cts +17 -0
- package/dist/core/baseCandidates.d.mts +17 -0
- package/dist/core/baseCandidates.mjs +69 -0
- package/dist/core/operations.cjs +350 -0
- package/dist/core/operations.mjs +350 -0
- package/dist/core/reads.cjs +273 -0
- package/dist/core/reads.d.cts +48 -0
- package/dist/core/reads.d.mts +48 -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/schema.cjs +279 -0
- package/dist/core/schema.d.cts +307 -0
- package/dist/core/schema.d.mts +307 -0
- package/dist/core/schema.mjs +277 -0
- package/dist/core/writes.cjs +96 -0
- package/dist/core/writes.mjs +91 -0
- package/dist/createHotUpdaterCore.cjs +58 -75
- package/dist/createHotUpdaterCore.d.cts +52 -44
- package/dist/createHotUpdaterCore.d.mts +52 -44
- package/dist/createHotUpdaterCore.mjs +59 -75
- package/dist/database/cursor.cjs +44 -0
- package/dist/database/cursor.d.cts +7 -0
- package/dist/database/cursor.d.mts +7 -0
- package/dist/database/cursor.mjs +40 -0
- package/dist/database/database.cjs +44 -0
- package/dist/database/database.d.cts +123 -0
- package/dist/database/database.d.mts +123 -0
- package/dist/database/database.mjs +44 -0
- package/dist/database/definitions.d.cts +68 -0
- package/dist/database/definitions.d.mts +68 -0
- package/dist/database/engine.cjs +37 -0
- package/dist/database/engine.d.cts +40 -0
- package/dist/database/engine.d.mts +40 -0
- package/dist/database/engine.mjs +37 -0
- package/dist/database/engineAggregates.cjs +115 -0
- package/dist/database/engineAggregates.mjs +112 -0
- package/dist/database/engineReads.cjs +180 -0
- package/dist/database/engineReads.d.cts +35 -0
- package/dist/database/engineReads.d.mts +35 -0
- package/dist/database/engineReads.mjs +179 -0
- package/dist/database/engineTransaction.cjs +403 -0
- package/dist/database/engineTransaction.d.cts +26 -0
- package/dist/database/engineTransaction.d.mts +26 -0
- package/dist/database/engineTransaction.mjs +402 -0
- package/dist/database/errors.cjs +27 -0
- package/dist/database/errors.d.cts +21 -0
- package/dist/database/errors.d.mts +21 -0
- package/dist/database/errors.mjs +24 -0
- package/dist/database/fence.cjs +124 -0
- package/dist/database/fence.d.cts +42 -0
- package/dist/database/fence.d.mts +42 -0
- package/dist/database/fence.mjs +116 -0
- package/dist/database/index.cjs +127 -0
- package/dist/database/index.d.cts +17 -0
- package/dist/database/index.d.mts +17 -0
- package/dist/database/index.mjs +15 -0
- package/dist/database/kv/kvAdapter.cjs +273 -0
- package/dist/database/kv/kvAdapter.d.cts +101 -0
- package/dist/database/kv/kvAdapter.d.mts +101 -0
- package/dist/database/kv/kvAdapter.mjs +272 -0
- package/dist/database/resolveSchema.cjs +196 -0
- package/dist/database/resolveSchema.d.cts +42 -0
- package/dist/database/resolveSchema.d.mts +42 -0
- package/dist/database/resolveSchema.mjs +193 -0
- package/dist/database/schema.cjs +21 -0
- package/dist/database/schema.d.cts +61 -0
- package/dist/database/schema.d.mts +61 -0
- package/dist/database/schema.mjs +20 -0
- package/dist/database/sql/sqlAdapter.cjs +282 -0
- package/dist/database/sql/sqlAdapter.d.cts +46 -0
- package/dist/database/sql/sqlAdapter.d.mts +46 -0
- package/dist/database/sql/sqlAdapter.mjs +279 -0
- package/dist/database/sql/sqlSchema.cjs +115 -0
- package/dist/database/sql/sqlSchema.d.cts +8 -0
- package/dist/database/sql/sqlSchema.d.mts +8 -0
- package/dist/database/sql/sqlSchema.mjs +111 -0
- package/dist/db/builtInDatabase.cjs +104 -0
- package/dist/db/builtInDatabase.d.cts +38 -0
- package/dist/db/builtInDatabase.d.mts +38 -0
- package/dist/db/builtInDatabase.mjs +97 -0
- package/dist/db/createBundleDiff.cjs +4 -4
- package/dist/db/createBundleDiff.d.cts +3 -2
- package/dist/db/createBundleDiff.d.mts +3 -2
- package/dist/db/createBundleDiff.mjs +5 -5
- package/dist/db/engineDrizzleSchema.cjs +54 -0
- package/dist/db/engineDrizzleSchema.mjs +54 -0
- package/dist/db/engineMigrator.cjs +53 -0
- package/dist/db/engineMigrator.mjs +53 -0
- package/dist/db/enginePrismaSchema.cjs +85 -0
- package/dist/db/enginePrismaSchema.d.cts +5 -0
- package/dist/db/enginePrismaSchema.d.mts +5 -0
- package/dist/db/enginePrismaSchema.mjs +84 -0
- package/dist/db/engineSql.cjs +26 -0
- package/dist/db/engineSql.d.cts +17 -0
- package/dist/db/engineSql.d.mts +17 -0
- package/dist/db/engineSql.mjs +25 -0
- package/dist/db/engineSqlMigrator.cjs +66 -0
- package/dist/db/engineSqlMigrator.mjs +66 -0
- package/dist/db/fixedMigratorShared.cjs +0 -11
- package/dist/db/fixedMigratorShared.mjs +1 -8
- package/dist/db/index.cjs +23 -8
- package/dist/db/index.d.cts +10 -3
- package/dist/db/index.d.mts +10 -3
- package/dist/db/index.mjs +16 -8
- package/dist/db/releaseCatalog.cjs +20 -43
- package/dist/db/releaseCatalog.d.cts +2 -2
- package/dist/db/releaseCatalog.d.mts +2 -2
- package/dist/db/releaseCatalog.mjs +20 -44
- package/dist/db/schemaSettings.cjs +63 -0
- package/dist/db/schemaSettings.d.cts +12 -0
- package/dist/db/schemaSettings.d.mts +12 -0
- package/dist/db/schemaSettings.mjs +62 -0
- package/dist/db/settingsMigrator.cjs +92 -0
- package/dist/db/settingsMigrator.mjs +89 -0
- package/dist/db/types.cjs +1 -12
- package/dist/db/types.d.cts +26 -66
- package/dist/db/types.d.mts +26 -66
- package/dist/db/types.mjs +2 -11
- package/dist/db/updateArtifacts.cjs +38 -67
- package/dist/db/updateArtifacts.mjs +40 -69
- package/dist/handler.cjs +72 -43
- package/dist/handler.d.cts +3 -5
- package/dist/handler.d.mts +3 -5
- package/dist/handler.mjs +73 -43
- package/dist/handlerAdminRoutes.cjs +375 -0
- package/dist/handlerAdminRoutes.mjs +373 -0
- package/dist/handlerParameters.cjs +6 -11
- package/dist/handlerParameters.mjs +6 -10
- package/dist/handlerReleaseCatalogRoutes.cjs +11 -13
- package/dist/handlerReleaseCatalogRoutes.mjs +11 -13
- 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 +4 -7
- package/dist/index.d.cts +8 -7
- package/dist/index.d.mts +8 -7
- package/dist/index.mjs +4 -4
- package/dist/insights/domain.d.cts +12 -0
- package/dist/insights/domain.d.mts +12 -0
- package/dist/insights/errors.cjs +34 -0
- package/dist/insights/errors.mjs +34 -1
- package/dist/insights/eventInput.cjs +14 -19
- package/dist/insights/eventInput.mjs +15 -20
- package/dist/insights/provider.cjs +47 -23
- package/dist/insights/provider.mjs +47 -24
- package/dist/insights/routes.cjs +79 -14
- package/dist/insights/routes.mjs +77 -14
- package/dist/node.d.cts +1 -1
- package/dist/node.d.mts +1 -1
- package/dist/package.cjs +1 -1
- package/dist/package.mjs +1 -1
- package/dist/plugins/api-keys/index.cjs +50 -0
- package/dist/plugins/api-keys/index.d.cts +85 -0
- package/dist/plugins/api-keys/index.d.mts +85 -0
- package/dist/plugins/api-keys/index.mjs +47 -0
- package/dist/plugins/api-keys/model.cjs +58 -0
- package/dist/plugins/api-keys/model.d.cts +8 -0
- package/dist/plugins/api-keys/model.d.mts +8 -0
- package/dist/plugins/api-keys/model.mjs +58 -0
- package/dist/plugins/api-keys/schema.cjs +38 -0
- package/dist/plugins/api-keys/schema.d.cts +44 -0
- package/dist/plugins/api-keys/schema.d.mts +44 -0
- package/dist/plugins/api-keys/schema.mjs +39 -0
- package/dist/plugins/builtIn.cjs +7 -0
- package/dist/plugins/builtIn.mjs +6 -0
- package/dist/plugins/definePlugin.cjs +5 -0
- package/dist/plugins/definePlugin.d.cts +73 -0
- package/dist/plugins/definePlugin.d.mts +73 -0
- package/dist/plugins/definePlugin.mjs +5 -0
- package/dist/plugins/index.cjs +17 -0
- package/dist/plugins/index.d.cts +9 -0
- package/dist/plugins/index.d.mts +9 -0
- package/dist/plugins/index.mjs +7 -0
- package/dist/plugins/insights/index.cjs +48 -0
- package/dist/plugins/insights/index.d.cts +295 -0
- package/dist/plugins/insights/index.d.mts +295 -0
- package/dist/plugins/insights/index.mjs +44 -0
- package/dist/plugins/insights/model.cjs +17 -0
- package/dist/plugins/insights/model.d.cts +10 -0
- package/dist/plugins/insights/model.d.mts +10 -0
- package/dist/plugins/insights/model.mjs +17 -0
- package/dist/plugins/insights/reads.cjs +471 -0
- package/dist/plugins/insights/reads.mjs +466 -0
- package/dist/plugins/insights/recordEvent.cjs +135 -0
- package/dist/plugins/insights/recordEvent.d.cts +13 -0
- package/dist/plugins/insights/recordEvent.d.mts +13 -0
- package/dist/plugins/insights/recordEvent.mjs +132 -0
- package/dist/plugins/insights/schema.cjs +347 -0
- package/dist/plugins/insights/schema.d.cts +258 -0
- package/dist/plugins/insights/schema.d.mts +258 -0
- package/dist/plugins/insights/schema.mjs +344 -0
- package/dist/types/index.d.cts +2 -28
- package/dist/types/index.d.mts +2 -28
- package/package.json +28 -5
- package/src/adapters/drizzle.conformance.integration.spec.ts +34 -0
- package/src/adapters/drizzle.readBudgets.integration.spec.ts +41 -0
- package/src/adapters/drizzle.spec.ts +270 -399
- package/src/adapters/drizzle.ts +48 -140
- package/src/adapters/drizzleExecutor.ts +166 -0
- package/src/adapters/kysely.conformance.integration.spec.ts +36 -0
- package/src/adapters/kysely.readBudgets.integration.spec.ts +42 -0
- package/src/adapters/kysely.spec.ts +204 -171
- package/src/adapters/kysely.ts +32 -93
- package/src/adapters/kyselyExecutor.ts +53 -0
- package/src/adapters/mongodb.integration.spec.ts +143 -446
- package/src/adapters/mongodb.readBudgets.integration.spec.ts +61 -0
- package/src/adapters/mongodb.ts +36 -123
- package/src/adapters/mongodbAdapter.ts +293 -0
- package/src/adapters/prisma.conformance.integration.spec.ts +36 -0
- package/src/adapters/prisma.integration.spec.ts +138 -0
- package/src/adapters/prisma.readBudgets.integration.spec.ts +40 -0
- package/src/adapters/prisma.spec.ts +216 -433
- package/src/adapters/prisma.ts +60 -524
- package/src/adapters/prismaExecutor.ts +107 -0
- package/src/adapters/prismaTestClients.ts +175 -0
- package/src/adapters/sqlProviders.ts +14 -0
- package/src/apiKeys.integration.spec.ts +19 -119
- package/src/apiKeys.spec.ts +39 -35
- package/src/apiKeys.ts +2 -8
- package/src/assembly/assemblePlugins.ts +269 -0
- package/src/assembly/assembly.spec.ts +325 -0
- package/src/assembly/assembly.types.spec.ts +155 -0
- package/src/assembly/builtInRoutes.spec.ts +213 -0
- package/src/assembly/databasePlugins.spec.ts +71 -0
- package/src/assembly/databasePlugins.ts +96 -0
- package/src/core/api.ts +139 -0
- package/src/core/baseCandidates.spec.ts +378 -0
- package/src/core/baseCandidates.ts +136 -0
- package/src/core/index.ts +44 -0
- package/src/core/operations.spec.ts +415 -0
- package/src/core/operations.ts +551 -0
- package/src/core/reads.spec.ts +300 -0
- package/src/core/reads.ts +417 -0
- package/src/core/releases.spec.ts +308 -0
- package/src/core/releases.ts +345 -0
- package/src/core/schema.ts +173 -0
- package/src/core/writes.ts +160 -0
- package/src/createHotUpdaterCore.ts +191 -181
- package/src/database/cursor.ts +65 -0
- package/src/database/database.ts +335 -0
- package/src/database/database.types.spec.ts +135 -0
- package/src/database/definitions.ts +72 -0
- package/src/database/engine.ts +62 -0
- package/src/database/engineAggregates.spec.ts +539 -0
- package/src/database/engineAggregates.ts +193 -0
- package/src/database/engineReads.spec.ts +219 -0
- package/src/database/engineReads.ts +302 -0
- package/src/database/engineTransaction.spec.ts +710 -0
- package/src/database/engineTransaction.ts +588 -0
- package/src/database/errors.ts +30 -0
- package/src/database/fence.spec.ts +223 -0
- package/src/database/fence.ts +171 -0
- package/src/database/index.ts +154 -0
- package/src/database/kv/kvAdapter.conformance.integration.spec.ts +17 -0
- package/src/database/kv/kvAdapter.readBudgets.integration.spec.ts +17 -0
- package/src/database/kv/kvAdapter.spec.ts +468 -0
- package/src/database/kv/kvAdapter.ts +450 -0
- package/src/database/kv/kvTestStore.ts +91 -0
- package/src/database/memory.readBudgets.integration.spec.ts +13 -0
- package/src/database/resolveSchema.spec.ts +230 -0
- package/src/database/resolveSchema.ts +372 -0
- package/src/database/schema.ts +169 -0
- package/src/database/schema.types.spec.ts +94 -0
- package/src/database/sql/docker-compose.yml +36 -0
- package/src/database/sql/sqlAdapter.integration.spec.ts +148 -0
- package/src/database/sql/sqlAdapter.readBudgets.integration.spec.ts +109 -0
- package/src/database/sql/sqlAdapter.spec.ts +255 -0
- package/src/database/sql/sqlAdapter.ts +532 -0
- package/src/database/sql/sqlSchema.ts +205 -0
- package/src/database/sql/sqlTestExecutors.ts +183 -0
- package/src/databaseTestSuite.spec.ts +39 -0
- package/src/db/builtInDatabase.ts +149 -0
- package/src/db/bundleRows.spec.ts +3 -3
- package/src/db/createBundleDiff.spec.ts +43 -29
- package/src/db/createBundleDiff.ts +13 -7
- package/src/db/engineDrizzleSchema.ts +72 -0
- package/src/db/engineMigrator.ts +105 -0
- package/src/db/enginePrismaSchema.ts +147 -0
- package/src/db/engineSql.spec.ts +129 -0
- package/src/db/engineSql.ts +48 -0
- package/src/db/engineSqlMigrator.ts +116 -0
- package/src/db/fixedMigratorShared.ts +1 -20
- package/src/db/index.spec.ts +116 -829
- package/src/db/index.ts +43 -14
- package/src/db/pluginTables.spec.ts +218 -0
- package/src/db/releaseCatalog.ts +48 -90
- package/src/db/schemaSettings.ts +104 -0
- package/src/db/settingsMigrator.spec.ts +65 -0
- package/src/db/settingsMigrator.ts +152 -0
- package/src/db/types.ts +25 -171
- package/src/db/updateArtifacts.spec.ts +170 -294
- package/src/db/updateArtifacts.ts +74 -142
- package/src/db/updateCheck.bench.ts +47 -0
- package/src/handler-standalone.integration.spec.ts +204 -410
- package/src/handler.spec.ts +134 -51
- package/src/handler.testFixtures.ts +14 -19
- package/src/handler.ts +163 -75
- package/src/handlerAdminRoutes.spec.ts +183 -0
- package/src/handlerAdminRoutes.ts +536 -0
- package/src/handlerAuth.integration.spec.ts +3 -3
- package/src/handlerManagement.spec.ts +136 -196
- package/src/handlerReleaseCatalogRoutes.ts +15 -17
- package/src/handlerTypes.ts +3 -80
- package/src/handlerVersionRoutes.ts +20 -7
- package/src/index.ts +5 -12
- package/src/insights/domain.ts +12 -0
- package/src/insights/errors.spec.ts +48 -0
- package/src/insights/errors.ts +51 -0
- package/src/insights/eventInput.ts +27 -24
- package/src/insights/insights.integration.spec.ts +228 -78
- package/src/insights/provider.spec.ts +203 -25
- package/src/insights/provider.ts +88 -32
- package/src/insights/routes.ts +95 -20
- package/src/lintRules.spec.ts +76 -0
- package/src/plugins/api-keys/apiKeysPlugin.spec.ts +172 -0
- package/src/plugins/api-keys/index.ts +66 -0
- package/src/plugins/api-keys/model.ts +69 -0
- package/src/plugins/api-keys/schema.ts +22 -0
- package/src/plugins/builtIn.ts +5 -0
- package/src/plugins/definePlugin.ts +100 -0
- package/src/plugins/index.ts +55 -0
- package/src/plugins/insights/index.ts +86 -0
- package/src/plugins/insights/insightsRollout.integration.spec.ts +187 -0
- package/src/plugins/insights/model.spec.ts +66 -0
- package/src/plugins/insights/model.ts +19 -0
- package/src/plugins/insights/reads.spec.ts +725 -0
- package/src/plugins/insights/reads.ts +707 -0
- package/src/plugins/insights/recordEvent.spec.ts +443 -0
- package/src/plugins/insights/recordEvent.ts +238 -0
- package/src/plugins/insights/schema.ts +229 -0
- package/src/plugins/pluginTestHarness.spec.ts +56 -0
- package/src/readBudgets.testFixtures.ts +15 -0
- package/src/releaseCatalogRoutes.integration.spec.ts +47 -92
- package/src/runtime.spec.ts +91 -77
- package/src/runtime.testFixtures.ts +28 -44
- package/src/runtimeBundles.integration.spec.ts +112 -0
- package/src/testUtilsMutation.integration.spec.ts +215 -0
- package/src/testUtilsPackage.integration.spec.ts +176 -0
- package/src/types/index.ts +0 -32
- package/dist/adapters/databaseConstraintErrors.cjs +0 -22
- package/dist/adapters/databaseConstraintErrors.mjs +0 -21
- package/dist/adapters/databasePluginUtils.cjs +0 -130
- package/dist/adapters/databasePluginUtils.mjs +0 -118
- package/dist/adapters/drizzleCrud.cjs +0 -340
- package/dist/adapters/drizzleCrud.mjs +0 -337
- package/dist/adapters/drizzleLazyDB.cjs +0 -103
- package/dist/adapters/drizzleLazyDB.mjs +0 -103
- package/dist/adapters/drizzleQuery.cjs +0 -69
- package/dist/adapters/drizzleQuery.mjs +0 -69
- package/dist/adapters/kyselyCrud.cjs +0 -293
- package/dist/adapters/kyselyCrud.mjs +0 -292
- 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 -90
- package/dist/adapters/mongodbQuery.mjs +0 -83
- package/dist/adapters/mongodbReads.cjs +0 -206
- package/dist/adapters/mongodbReads.mjs +0 -206
- package/dist/adapters/mongodbWrites.cjs +0 -133
- package/dist/adapters/mongodbWrites.mjs +0 -133
- package/dist/adapters/prismaInsights.cjs +0 -99
- package/dist/adapters/prismaInsights.mjs +0 -97
- package/dist/adapters/prismaQuery.cjs +0 -57
- package/dist/adapters/prismaQuery.mjs +0 -56
- package/dist/adapters/prismaRows.cjs +0 -197
- package/dist/adapters/prismaRows.mjs +0 -188
- 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/mongoMigrationExecution.cjs +0 -11
- package/dist/db/mongoMigrationExecution.mjs +0 -11
- 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 -276
- package/dist/db/schemaGenerators.mjs +0 -274
- 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/handlerBundleRoutes.cjs +0 -155
- package/dist/handlerBundleRoutes.mjs +0 -155
- package/dist/handlerReleaseManagementRoutes.cjs +0 -124
- package/dist/handlerReleaseManagementRoutes.mjs +0 -124
- 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 -393
- package/dist/schema/v1_0_0.mjs +0 -385
- package/src/adapters/databaseConstraintErrors.ts +0 -25
- package/src/adapters/databasePluginTestDatabase.ts +0 -116
- package/src/adapters/databasePluginUtils.spec.ts +0 -29
- package/src/adapters/databasePluginUtils.ts +0 -238
- package/src/adapters/drizzleCrud.ts +0 -610
- package/src/adapters/drizzleLazyDB.ts +0 -284
- package/src/adapters/drizzleQuery.ts +0 -164
- package/src/adapters/kyselyCrud.ts +0 -696
- package/src/adapters/kyselyInsights.spec.ts +0 -168
- package/src/adapters/kyselyQuery.ts +0 -128
- package/src/adapters/mongodb.spec.ts +0 -230
- package/src/adapters/mongodbCollections.ts +0 -78
- package/src/adapters/mongodbQuery.ts +0 -245
- package/src/adapters/mongodbReads.ts +0 -387
- package/src/adapters/mongodbRows.spec.ts +0 -64
- package/src/adapters/mongodbRows.ts +0 -118
- package/src/adapters/mongodbTestClient.ts +0 -443
- package/src/adapters/mongodbTestFilter.ts +0 -170
- package/src/adapters/mongodbWrites.ts +0 -261
- package/src/adapters/prismaInsights.ts +0 -190
- package/src/adapters/prismaQuery.ts +0 -129
- package/src/adapters/prismaRows.spec.ts +0 -98
- package/src/adapters/prismaRows.ts +0 -308
- package/src/adapters/prismaTestClient.ts +0 -478
- package/src/calculatePagination.ts +0 -34
- 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 -117
- package/src/db/fixedMigrator.spec.ts +0 -294
- package/src/db/fixedMigrator.ts +0 -147
- package/src/db/fixedMigratorMongo.spec.ts +0 -253
- package/src/db/fixedMigratorMongo.ts +0 -425
- package/src/db/hotUpdaterSchema.ts +0 -5
- package/src/db/mongoMigrationExecution.ts +0 -23
- 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 -495
- 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/handlerBundleRoutes.ts +0 -259
- package/src/handlerReleaseManagementRoutes.ts +0 -213
- package/src/schema/dsl-all-versions.spec.ts +0 -35
- 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 -511
package/dist/handlerTypes.d.mts
CHANGED
|
@@ -1,62 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { PaginatedResult } from "./types/index.mjs";
|
|
3
|
-
import { ChannelDeleteInput, ChannelDeleteResult, ChannelInsertInput, ChannelInsertResult, ChannelRow, DatabaseBundleQueryOptions, DatabaseCommit, DatabaseCommitResult, ReleaseCatalogMutationPreflight, ReleaseCatalogMutationResult, ReleaseCatalogRebuildResult, ReleaseCatalogRow, ReleasePolicyPatch, ReleaseRow } from "@hot-updater/plugin-core";
|
|
4
|
-
import { ArtifactInfo, Bundle as Bundle$1, ReleaseCatalog } from "@hot-updater/core";
|
|
1
|
+
import "./core/api.mjs";
|
|
5
2
|
//#region src/handlerTypes.d.ts
|
|
6
|
-
interface HandlerAPI {
|
|
7
|
-
getReleaseCatalog?: (input: ReleaseCatalogRequest) => Promise<ReleaseCatalog | null>;
|
|
8
|
-
getArtifactInfo?: (targetBundleId: string, currentBundleId: string) => Promise<ArtifactInfo | null>;
|
|
9
|
-
getReleaseById?: (id: string) => Promise<ReleaseRow | null>;
|
|
10
|
-
getReleasesByScope?: (input: {
|
|
11
|
-
readonly scopeKey: string;
|
|
12
|
-
readonly afterReleaseId?: string;
|
|
13
|
-
readonly limit: number;
|
|
14
|
-
}) => Promise<readonly ReleaseRow[]>;
|
|
15
|
-
getReleases?: (input: {
|
|
16
|
-
readonly afterReleaseId?: string;
|
|
17
|
-
readonly beforeReleaseId?: string;
|
|
18
|
-
readonly bundleId?: string;
|
|
19
|
-
readonly channelId?: string;
|
|
20
|
-
readonly enabled?: boolean;
|
|
21
|
-
readonly platform?: "ios" | "android";
|
|
22
|
-
readonly targetAppVersion?: string;
|
|
23
|
-
readonly limit: number;
|
|
24
|
-
}) => Promise<readonly ReleaseRow[]>;
|
|
25
|
-
getReleaseCatalogByScopeKey?: (scopeKey: string) => Promise<ReleaseCatalogRow | null>;
|
|
26
|
-
getReleaseCatalogs?: (input: {
|
|
27
|
-
readonly afterScopeKey?: string;
|
|
28
|
-
readonly limit: number;
|
|
29
|
-
}) => Promise<readonly ReleaseCatalogRow[]>;
|
|
30
|
-
updateReleasePolicy?: (input: {
|
|
31
|
-
readonly expectedRevision?: number;
|
|
32
|
-
readonly patch: ReleasePolicyPatch;
|
|
33
|
-
readonly releaseId: string;
|
|
34
|
-
}) => Promise<ReleaseCatalogMutationResult>;
|
|
35
|
-
preflightReleasePolicy?: (input: {
|
|
36
|
-
readonly expectedRevision?: number;
|
|
37
|
-
readonly patch: ReleasePolicyPatch;
|
|
38
|
-
readonly releaseId: string;
|
|
39
|
-
}) => Promise<ReleaseCatalogMutationPreflight>;
|
|
40
|
-
deleteRelease?: (input: {
|
|
41
|
-
readonly expectedRevision?: number;
|
|
42
|
-
readonly releaseId: string;
|
|
43
|
-
}) => Promise<ReleaseCatalogMutationResult>;
|
|
44
|
-
rebuildReleaseCatalog?: (scopeKey: string) => Promise<ReleaseCatalogRebuildResult>;
|
|
45
|
-
commitDatabase?: (input: DatabaseCommit) => Promise<DatabaseCommitResult>;
|
|
46
|
-
getBundleById: (id: string) => Promise<Bundle$1 | null>;
|
|
47
|
-
getBundles: (options: DatabaseBundleQueryOptions) => Promise<PaginatedResult>;
|
|
48
|
-
insertBundle: (bundle: Bundle$1) => Promise<void>;
|
|
49
|
-
insertBundles?: (bundles: readonly Bundle$1[]) => Promise<void>;
|
|
50
|
-
updateBundleById: (bundleId: string, bundle: Partial<Bundle$1>) => Promise<void>;
|
|
51
|
-
deleteBundleById: (bundleId: string) => Promise<void>;
|
|
52
|
-
getChannels: () => Promise<readonly ChannelRow[]>;
|
|
53
|
-
insertChannel: (input: ChannelInsertInput) => Promise<ChannelInsertResult>;
|
|
54
|
-
deleteChannel: (input: ChannelDeleteInput) => Promise<ChannelDeleteResult>;
|
|
55
|
-
}
|
|
56
3
|
type HotUpdaterHandler = (request: Request) => Promise<Response>;
|
|
57
4
|
interface HotUpdaterHandlers {
|
|
58
5
|
readonly client: HotUpdaterHandler;
|
|
59
6
|
readonly admin: HotUpdaterHandler;
|
|
60
7
|
}
|
|
61
8
|
//#endregion
|
|
62
|
-
export {
|
|
9
|
+
export { HotUpdaterHandler, HotUpdaterHandlers };
|
|
@@ -1,10 +1,26 @@
|
|
|
1
1
|
const require_version = require("./version.cjs");
|
|
2
2
|
//#region src/handlerVersionRoutes.ts
|
|
3
3
|
const HOT_UPDATER_INFRASTRUCTURE_GENERATION = 1;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
/**
|
|
5
|
+
* `/version` on both mounts. The admin mount also lists the ids of the
|
|
6
|
+
* plugins the server runs, sorted, so a console shows only the features they
|
|
7
|
+
* serve; apps never learn which plugins a server runs.
|
|
8
|
+
*/
|
|
9
|
+
const createVersionRouteHandlers = (plugins = []) => {
|
|
10
|
+
const version = {
|
|
11
|
+
adminProtocol: 2,
|
|
12
|
+
infrastructureGeneration: 1,
|
|
13
|
+
version: require_version.HOT_UPDATER_SERVER_VERSION
|
|
14
|
+
};
|
|
15
|
+
const adminVersion = {
|
|
16
|
+
...version,
|
|
17
|
+
plugins: [...plugins].sort()
|
|
18
|
+
};
|
|
19
|
+
return {
|
|
20
|
+
version: async () => Response.json(version),
|
|
21
|
+
adminVersion: async () => Response.json(adminVersion)
|
|
22
|
+
};
|
|
23
|
+
};
|
|
8
24
|
//#endregion
|
|
9
25
|
exports.HOT_UPDATER_INFRASTRUCTURE_GENERATION = HOT_UPDATER_INFRASTRUCTURE_GENERATION;
|
|
10
26
|
exports.createVersionRouteHandlers = createVersionRouteHandlers;
|
|
@@ -1,9 +1,25 @@
|
|
|
1
1
|
import { HOT_UPDATER_SERVER_VERSION } from "./version.mjs";
|
|
2
2
|
//#region src/handlerVersionRoutes.ts
|
|
3
3
|
const HOT_UPDATER_INFRASTRUCTURE_GENERATION = 1;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
/**
|
|
5
|
+
* `/version` on both mounts. The admin mount also lists the ids of the
|
|
6
|
+
* plugins the server runs, sorted, so a console shows only the features they
|
|
7
|
+
* serve; apps never learn which plugins a server runs.
|
|
8
|
+
*/
|
|
9
|
+
const createVersionRouteHandlers = (plugins = []) => {
|
|
10
|
+
const version = {
|
|
11
|
+
adminProtocol: 2,
|
|
12
|
+
infrastructureGeneration: 1,
|
|
13
|
+
version: HOT_UPDATER_SERVER_VERSION
|
|
14
|
+
};
|
|
15
|
+
const adminVersion = {
|
|
16
|
+
...version,
|
|
17
|
+
plugins: [...plugins].sort()
|
|
18
|
+
};
|
|
19
|
+
return {
|
|
20
|
+
version: async () => Response.json(version),
|
|
21
|
+
adminVersion: async () => Response.json(adminVersion)
|
|
22
|
+
};
|
|
23
|
+
};
|
|
8
24
|
//#endregion
|
|
9
25
|
export { HOT_UPDATER_INFRASTRUCTURE_GENERATION, createVersionRouteHandlers };
|
package/dist/index.cjs
CHANGED
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_version = require("./version.cjs");
|
|
3
|
-
const require_handlerVersionRoutes = require("./handlerVersionRoutes.cjs");
|
|
4
|
-
const require_handler = require("./handler.cjs");
|
|
5
2
|
const require_provider = require("./insights/provider.cjs");
|
|
6
3
|
const require_apiKeys = require("./apiKeys.cjs");
|
|
4
|
+
const require_assemblePlugins = require("./assembly/assemblePlugins.cjs");
|
|
5
|
+
const require_version = require("./version.cjs");
|
|
6
|
+
const require_handlerVersionRoutes = require("./handlerVersionRoutes.cjs");
|
|
7
7
|
const require_createHotUpdaterCore = require("./createHotUpdaterCore.cjs");
|
|
8
8
|
exports.API_KEY_HEADER_NAME = require_apiKeys.API_KEY_HEADER_NAME;
|
|
9
9
|
exports.HOT_UPDATER_INFRASTRUCTURE_GENERATION = require_handlerVersionRoutes.HOT_UPDATER_INFRASTRUCTURE_GENERATION;
|
|
10
10
|
exports.HOT_UPDATER_SERVER_VERSION = require_version.HOT_UPDATER_SERVER_VERSION;
|
|
11
|
-
exports.
|
|
12
|
-
exports.createHandlers = require_handler.createHandlers;
|
|
11
|
+
exports.HotUpdaterConfigError = require_assemblePlugins.HotUpdaterConfigError;
|
|
13
12
|
exports.createHotUpdater = require_createHotUpdaterCore.createHotUpdater;
|
|
14
13
|
exports.createInsightsProvider = require_provider.createInsightsProvider;
|
|
15
|
-
exports.provisionApiKey = require_apiKeys.provisionApiKey;
|
|
16
|
-
exports.registerApiKey = require_apiKeys.registerApiKey;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { HOT_UPDATER_SERVER_VERSION } from "./version.cjs";
|
|
2
|
+
import { HotUpdaterConfigError } from "./assembly/assemblePlugins.cjs";
|
|
3
|
+
import { HotUpdaterHandler, HotUpdaterHandlers } from "./handlerTypes.cjs";
|
|
4
|
+
import "./handler.cjs";
|
|
3
5
|
import { ActiveInstallationWindow, CreateBundleEventRequest, CreateBundleEventRequestBase, CursorPage, EventCursorPage, EventHistoryRow, InsightsBundleSelection, InsightsCountMeasurement, InsightsScope, InstallationHistoryRow, InstallationRow, ReportingOverview } from "./insights/domain.cjs";
|
|
4
6
|
import { InsightsEventPageInput, InsightsInstallationEventPageInput, InsightsProvider, InsightsUserInstallationPageInput } from "./insights/types.cjs";
|
|
5
|
-
import { createHandlers } from "./handler.cjs";
|
|
6
|
-
import { ClientAccessPolicy, CreateHotUpdaterOptions, HotUpdaterAPI, RuntimeHotUpdaterAPI, createHotUpdater } from "./createHotUpdaterCore.cjs";
|
|
7
|
-
import { Bundle, ChannelsResponse, DataResponse, Paginated, PaginatedResult, PaginationInfo, PaginationOptions } from "./types/index.cjs";
|
|
8
|
-
import { HOT_UPDATER_SERVER_VERSION } from "./version.cjs";
|
|
9
7
|
import { createInsightsProvider } from "./insights/provider.cjs";
|
|
8
|
+
import { API_KEY_HEADER_NAME, ApiKeyManagementAPI, ApiKeyMetadata, CreatedApiKey } from "./apiKeys.cjs";
|
|
9
|
+
import { ClientAccessPolicy, ClientAccessRule, CreateHotUpdaterOptions, HotUpdaterAPI, RemovedClientAccess, RuntimeHotUpdaterAPI, createHotUpdater } from "./createHotUpdaterCore.cjs";
|
|
10
|
+
import { Bundle } from "./types/index.cjs";
|
|
10
11
|
import { HOT_UPDATER_INFRASTRUCTURE_GENERATION } from "./handlerVersionRoutes.cjs";
|
|
11
|
-
export { API_KEY_HEADER_NAME, type ActiveInstallationWindow, type ApiKeyManagementAPI, type ApiKeyMetadata, type Bundle,
|
|
12
|
+
export { API_KEY_HEADER_NAME, type ActiveInstallationWindow, type ApiKeyManagementAPI, type ApiKeyMetadata, type Bundle, type ClientAccessPolicy, type ClientAccessRule, type CreateBundleEventRequest, type CreateBundleEventRequestBase, type CreateHotUpdaterOptions, type CreatedApiKey, type CursorPage, type EventCursorPage, type EventHistoryRow, HOT_UPDATER_INFRASTRUCTURE_GENERATION, HOT_UPDATER_SERVER_VERSION, type HotUpdaterAPI, HotUpdaterConfigError, type HotUpdaterHandler, type HotUpdaterHandlers, type InsightsBundleSelection, type InsightsCountMeasurement, type InsightsEventPageInput, type InsightsInstallationEventPageInput, type InsightsProvider, type InsightsScope, type InsightsUserInstallationPageInput, type InstallationHistoryRow, type InstallationRow, type RemovedClientAccess, type ReportingOverview, type RuntimeHotUpdaterAPI, createHotUpdater, createInsightsProvider };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { HOT_UPDATER_SERVER_VERSION } from "./version.mjs";
|
|
2
|
+
import { HotUpdaterConfigError } from "./assembly/assemblePlugins.mjs";
|
|
3
|
+
import { HotUpdaterHandler, HotUpdaterHandlers } from "./handlerTypes.mjs";
|
|
4
|
+
import "./handler.mjs";
|
|
3
5
|
import { ActiveInstallationWindow, CreateBundleEventRequest, CreateBundleEventRequestBase, CursorPage, EventCursorPage, EventHistoryRow, InsightsBundleSelection, InsightsCountMeasurement, InsightsScope, InstallationHistoryRow, InstallationRow, ReportingOverview } from "./insights/domain.mjs";
|
|
4
6
|
import { InsightsEventPageInput, InsightsInstallationEventPageInput, InsightsProvider, InsightsUserInstallationPageInput } from "./insights/types.mjs";
|
|
5
|
-
import { createHandlers } from "./handler.mjs";
|
|
6
|
-
import { ClientAccessPolicy, CreateHotUpdaterOptions, HotUpdaterAPI, RuntimeHotUpdaterAPI, createHotUpdater } from "./createHotUpdaterCore.mjs";
|
|
7
|
-
import { Bundle, ChannelsResponse, DataResponse, Paginated, PaginatedResult, PaginationInfo, PaginationOptions } from "./types/index.mjs";
|
|
8
|
-
import { HOT_UPDATER_SERVER_VERSION } from "./version.mjs";
|
|
9
7
|
import { createInsightsProvider } from "./insights/provider.mjs";
|
|
8
|
+
import { API_KEY_HEADER_NAME, ApiKeyManagementAPI, ApiKeyMetadata, CreatedApiKey } from "./apiKeys.mjs";
|
|
9
|
+
import { ClientAccessPolicy, ClientAccessRule, CreateHotUpdaterOptions, HotUpdaterAPI, RemovedClientAccess, RuntimeHotUpdaterAPI, createHotUpdater } from "./createHotUpdaterCore.mjs";
|
|
10
|
+
import { Bundle } from "./types/index.mjs";
|
|
10
11
|
import { HOT_UPDATER_INFRASTRUCTURE_GENERATION } from "./handlerVersionRoutes.mjs";
|
|
11
|
-
export { API_KEY_HEADER_NAME, type ActiveInstallationWindow, type ApiKeyManagementAPI, type ApiKeyMetadata, type Bundle,
|
|
12
|
+
export { API_KEY_HEADER_NAME, type ActiveInstallationWindow, type ApiKeyManagementAPI, type ApiKeyMetadata, type Bundle, type ClientAccessPolicy, type ClientAccessRule, type CreateBundleEventRequest, type CreateBundleEventRequestBase, type CreateHotUpdaterOptions, type CreatedApiKey, type CursorPage, type EventCursorPage, type EventHistoryRow, HOT_UPDATER_INFRASTRUCTURE_GENERATION, HOT_UPDATER_SERVER_VERSION, type HotUpdaterAPI, HotUpdaterConfigError, type HotUpdaterHandler, type HotUpdaterHandlers, type InsightsBundleSelection, type InsightsCountMeasurement, type InsightsEventPageInput, type InsightsInstallationEventPageInput, type InsightsProvider, type InsightsScope, type InsightsUserInstallationPageInput, type InstallationHistoryRow, type InstallationRow, type RemovedClientAccess, type ReportingOverview, type RuntimeHotUpdaterAPI, createHotUpdater, createInsightsProvider };
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { createInsightsProvider } from "./insights/provider.mjs";
|
|
2
|
+
import { API_KEY_HEADER_NAME } from "./apiKeys.mjs";
|
|
3
|
+
import { HotUpdaterConfigError } from "./assembly/assemblePlugins.mjs";
|
|
1
4
|
import { HOT_UPDATER_SERVER_VERSION } from "./version.mjs";
|
|
2
5
|
import { HOT_UPDATER_INFRASTRUCTURE_GENERATION } from "./handlerVersionRoutes.mjs";
|
|
3
|
-
import { createHandlers } from "./handler.mjs";
|
|
4
|
-
import { createInsightsProvider } from "./insights/provider.mjs";
|
|
5
|
-
import { API_KEY_HEADER_NAME, createApiKey, provisionApiKey, registerApiKey } from "./apiKeys.mjs";
|
|
6
6
|
import { createHotUpdater } from "./createHotUpdaterCore.mjs";
|
|
7
|
-
export { API_KEY_HEADER_NAME, HOT_UPDATER_INFRASTRUCTURE_GENERATION, HOT_UPDATER_SERVER_VERSION,
|
|
7
|
+
export { API_KEY_HEADER_NAME, HOT_UPDATER_INFRASTRUCTURE_GENERATION, HOT_UPDATER_SERVER_VERSION, HotUpdaterConfigError, createHotUpdater, createInsightsProvider };
|
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
//#region src/insights/domain.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* The body of `POST /events`. Fields the server does not know are ignored, so
|
|
4
|
+
* a newer client's report still records on an older server.
|
|
5
|
+
*/
|
|
2
6
|
type CreateBundleEventRequestBase = {
|
|
7
|
+
/**
|
|
8
|
+
* The report's idempotency key: a canonical lowercase UUIDv7 that the
|
|
9
|
+
* client creates once per report and repeats on every retry. The server
|
|
10
|
+
* stores the report under it, so a retried report counts once, and a
|
|
11
|
+
* report under an ID already stored changes nothing. Without it, the
|
|
12
|
+
* server creates the ID, and a retry counts as another report.
|
|
13
|
+
*/
|
|
14
|
+
readonly eventId?: string;
|
|
3
15
|
readonly installId: string;
|
|
4
16
|
readonly toBundleId: string;
|
|
5
17
|
readonly userId?: string;
|
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
//#region src/insights/domain.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* The body of `POST /events`. Fields the server does not know are ignored, so
|
|
4
|
+
* a newer client's report still records on an older server.
|
|
5
|
+
*/
|
|
2
6
|
type CreateBundleEventRequestBase = {
|
|
7
|
+
/**
|
|
8
|
+
* The report's idempotency key: a canonical lowercase UUIDv7 that the
|
|
9
|
+
* client creates once per report and repeats on every retry. The server
|
|
10
|
+
* stores the report under it, so a retried report counts once, and a
|
|
11
|
+
* report under an ID already stored changes nothing. Without it, the
|
|
12
|
+
* server creates the ID, and a retry counts as another report.
|
|
13
|
+
*/
|
|
14
|
+
readonly eventId?: string;
|
|
3
15
|
readonly installId: string;
|
|
4
16
|
readonly toBundleId: string;
|
|
5
17
|
readonly userId?: string;
|
package/dist/insights/errors.cjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
const require_errors = require("../database/errors.cjs");
|
|
1
2
|
//#region src/insights/errors.ts
|
|
2
3
|
var InsightsBadRequestError = class extends Error {
|
|
3
4
|
name = "InsightsBadRequestError";
|
|
@@ -10,6 +11,39 @@ var InsightsPayloadTooLargeError = class extends Error {
|
|
|
10
11
|
this.maximumBytes = maximumBytes;
|
|
11
12
|
}
|
|
12
13
|
};
|
|
14
|
+
/** Error names the AWS SDKs give a throttled request, as their retry strategy classifies them. */
|
|
15
|
+
const THROTTLING_NAMES = /* @__PURE__ */ new Set([
|
|
16
|
+
"ProvisionedThroughputExceededException",
|
|
17
|
+
"RequestLimitExceeded",
|
|
18
|
+
"RequestThrottled",
|
|
19
|
+
"RequestThrottledException",
|
|
20
|
+
"SlowDown",
|
|
21
|
+
"ThrottledException",
|
|
22
|
+
"Throttling",
|
|
23
|
+
"ThrottlingException",
|
|
24
|
+
"TooManyRequestsException"
|
|
25
|
+
]);
|
|
26
|
+
/** gRPC's RESOURCE_EXHAUSTED, the status Firestore throttles a request with. */
|
|
27
|
+
const RESOURCE_EXHAUSTED = 8;
|
|
28
|
+
/**
|
|
29
|
+
* Whether the database is busy rather than broken, so the same request can
|
|
30
|
+
* succeed later: a transaction ran out of retries, or the backend throttled
|
|
31
|
+
* a request. Writes already retry transient failures, throttled ones
|
|
32
|
+
* included, until the budget runs out. A throttled read throws the backend's
|
|
33
|
+
* own error, so it is recognized by what the backends call it: a name the
|
|
34
|
+
* AWS SDKs retry as throttling, HTTP 429, or gRPC's RESOURCE_EXHAUSTED.
|
|
35
|
+
*/
|
|
36
|
+
const isDatabaseBusyError = (error) => {
|
|
37
|
+
if (error instanceof require_errors.DatabaseConflictError) return true;
|
|
38
|
+
if (typeof error !== "object" || error === null) return false;
|
|
39
|
+
const { name, code, message, status, statusCode, $metadata } = error;
|
|
40
|
+
return typeof name === "string" && THROTTLING_NAMES.has(name) || [
|
|
41
|
+
status,
|
|
42
|
+
statusCode,
|
|
43
|
+
$metadata?.httpStatusCode
|
|
44
|
+
].includes(429) || code === RESOURCE_EXHAUSTED && typeof message === "string" && message.includes("RESOURCE_EXHAUSTED");
|
|
45
|
+
};
|
|
13
46
|
//#endregion
|
|
14
47
|
exports.InsightsBadRequestError = InsightsBadRequestError;
|
|
15
48
|
exports.InsightsPayloadTooLargeError = InsightsPayloadTooLargeError;
|
|
49
|
+
exports.isDatabaseBusyError = isDatabaseBusyError;
|
package/dist/insights/errors.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DatabaseConflictError } from "../database/errors.mjs";
|
|
1
2
|
//#region src/insights/errors.ts
|
|
2
3
|
var InsightsBadRequestError = class extends Error {
|
|
3
4
|
name = "InsightsBadRequestError";
|
|
@@ -10,5 +11,37 @@ var InsightsPayloadTooLargeError = class extends Error {
|
|
|
10
11
|
this.maximumBytes = maximumBytes;
|
|
11
12
|
}
|
|
12
13
|
};
|
|
14
|
+
/** Error names the AWS SDKs give a throttled request, as their retry strategy classifies them. */
|
|
15
|
+
const THROTTLING_NAMES = /* @__PURE__ */ new Set([
|
|
16
|
+
"ProvisionedThroughputExceededException",
|
|
17
|
+
"RequestLimitExceeded",
|
|
18
|
+
"RequestThrottled",
|
|
19
|
+
"RequestThrottledException",
|
|
20
|
+
"SlowDown",
|
|
21
|
+
"ThrottledException",
|
|
22
|
+
"Throttling",
|
|
23
|
+
"ThrottlingException",
|
|
24
|
+
"TooManyRequestsException"
|
|
25
|
+
]);
|
|
26
|
+
/** gRPC's RESOURCE_EXHAUSTED, the status Firestore throttles a request with. */
|
|
27
|
+
const RESOURCE_EXHAUSTED = 8;
|
|
28
|
+
/**
|
|
29
|
+
* Whether the database is busy rather than broken, so the same request can
|
|
30
|
+
* succeed later: a transaction ran out of retries, or the backend throttled
|
|
31
|
+
* a request. Writes already retry transient failures, throttled ones
|
|
32
|
+
* included, until the budget runs out. A throttled read throws the backend's
|
|
33
|
+
* own error, so it is recognized by what the backends call it: a name the
|
|
34
|
+
* AWS SDKs retry as throttling, HTTP 429, or gRPC's RESOURCE_EXHAUSTED.
|
|
35
|
+
*/
|
|
36
|
+
const isDatabaseBusyError = (error) => {
|
|
37
|
+
if (error instanceof DatabaseConflictError) return true;
|
|
38
|
+
if (typeof error !== "object" || error === null) return false;
|
|
39
|
+
const { name, code, message, status, statusCode, $metadata } = error;
|
|
40
|
+
return typeof name === "string" && THROTTLING_NAMES.has(name) || [
|
|
41
|
+
status,
|
|
42
|
+
statusCode,
|
|
43
|
+
$metadata?.httpStatusCode
|
|
44
|
+
].includes(429) || code === RESOURCE_EXHAUSTED && typeof message === "string" && message.includes("RESOURCE_EXHAUSTED");
|
|
45
|
+
};
|
|
13
46
|
//#endregion
|
|
14
|
-
export { InsightsBadRequestError, InsightsPayloadTooLargeError };
|
|
47
|
+
export { InsightsBadRequestError, InsightsPayloadTooLargeError, isDatabaseBusyError };
|
|
@@ -4,23 +4,6 @@ let _hot_updater_plugin_core = require("@hot-updater/plugin-core");
|
|
|
4
4
|
const MAX_EVENT_STRING_LENGTH = 1024;
|
|
5
5
|
const MAX_IDENTITY_LENGTH = 255;
|
|
6
6
|
const EVENT_BODY_MAX_BYTES = 16384;
|
|
7
|
-
const eventKeys = /* @__PURE__ */ new Set([
|
|
8
|
-
"type",
|
|
9
|
-
"installId",
|
|
10
|
-
"toBundleId",
|
|
11
|
-
"userId",
|
|
12
|
-
"username",
|
|
13
|
-
"platform",
|
|
14
|
-
"appVersion",
|
|
15
|
-
"channel",
|
|
16
|
-
"cohort",
|
|
17
|
-
"fingerprintHash",
|
|
18
|
-
"fromBundleId",
|
|
19
|
-
"fromReleaseId",
|
|
20
|
-
"toReleaseId",
|
|
21
|
-
"updateStrategy",
|
|
22
|
-
"sdkVersion"
|
|
23
|
-
]);
|
|
24
7
|
function isRecord(value) {
|
|
25
8
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
26
9
|
}
|
|
@@ -38,6 +21,16 @@ function requireIdentityField(payload, key) {
|
|
|
38
21
|
if (value.length > MAX_IDENTITY_LENGTH) throw new require_errors.InsightsBadRequestError(`Invalid event field: ${key}`);
|
|
39
22
|
return value;
|
|
40
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* The report's idempotency key, when the client sends one: it creates the
|
|
26
|
+
* UUIDv7 once and repeats it on every retry of that report.
|
|
27
|
+
*/
|
|
28
|
+
function readEventId(payload) {
|
|
29
|
+
const value = payload.eventId;
|
|
30
|
+
if (value === void 0) return void 0;
|
|
31
|
+
if (!(0, _hot_updater_plugin_core.isUUIDv7)(value)) throw new require_errors.InsightsBadRequestError("Invalid event field: eventId");
|
|
32
|
+
return value;
|
|
33
|
+
}
|
|
41
34
|
async function readBoundedText(request) {
|
|
42
35
|
const contentLength = request.headers.get("content-length");
|
|
43
36
|
const declaredByteLength = Number(contentLength);
|
|
@@ -69,10 +62,12 @@ async function parseJson(request) {
|
|
|
69
62
|
}
|
|
70
63
|
}
|
|
71
64
|
function requireEvent(payload) {
|
|
72
|
-
if (!isRecord(payload)
|
|
65
|
+
if (!isRecord(payload)) throw new require_errors.InsightsBadRequestError("Invalid event payload");
|
|
73
66
|
const platform = requireStringField(payload, "platform");
|
|
74
67
|
if (platform !== "ios" && platform !== "android") throw new require_errors.InsightsBadRequestError("Invalid event field: platform");
|
|
68
|
+
const eventId = readEventId(payload);
|
|
75
69
|
const base = {
|
|
70
|
+
...eventId === void 0 ? {} : { eventId },
|
|
76
71
|
installId: requireIdentityField(payload, "installId"),
|
|
77
72
|
toBundleId: requireStringField(payload, "toBundleId"),
|
|
78
73
|
...payload.userId === void 0 ? {} : { userId: requireIdentityField(payload, "userId") },
|
|
@@ -120,7 +115,7 @@ function createBundleEventRow(input) {
|
|
|
120
115
|
app_version: input.appVersion,
|
|
121
116
|
channel: input.channel,
|
|
122
117
|
from_release_id: input.fromReleaseId,
|
|
123
|
-
id: (0, _hot_updater_plugin_core.createUUIDv7)(),
|
|
118
|
+
id: input.eventId ?? (0, _hot_updater_plugin_core.createUUIDv7)(),
|
|
124
119
|
install_id: input.installId,
|
|
125
120
|
platform: input.platform,
|
|
126
121
|
received_at_ms: Date.now(),
|
|
@@ -1,26 +1,9 @@
|
|
|
1
1
|
import { InsightsBadRequestError, InsightsPayloadTooLargeError } from "./errors.mjs";
|
|
2
|
-
import { createUUIDv7 } from "@hot-updater/plugin-core";
|
|
2
|
+
import { createUUIDv7, isUUIDv7 } from "@hot-updater/plugin-core";
|
|
3
3
|
//#region src/insights/eventInput.ts
|
|
4
4
|
const MAX_EVENT_STRING_LENGTH = 1024;
|
|
5
5
|
const MAX_IDENTITY_LENGTH = 255;
|
|
6
6
|
const EVENT_BODY_MAX_BYTES = 16384;
|
|
7
|
-
const eventKeys = /* @__PURE__ */ new Set([
|
|
8
|
-
"type",
|
|
9
|
-
"installId",
|
|
10
|
-
"toBundleId",
|
|
11
|
-
"userId",
|
|
12
|
-
"username",
|
|
13
|
-
"platform",
|
|
14
|
-
"appVersion",
|
|
15
|
-
"channel",
|
|
16
|
-
"cohort",
|
|
17
|
-
"fingerprintHash",
|
|
18
|
-
"fromBundleId",
|
|
19
|
-
"fromReleaseId",
|
|
20
|
-
"toReleaseId",
|
|
21
|
-
"updateStrategy",
|
|
22
|
-
"sdkVersion"
|
|
23
|
-
]);
|
|
24
7
|
function isRecord(value) {
|
|
25
8
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
26
9
|
}
|
|
@@ -38,6 +21,16 @@ function requireIdentityField(payload, key) {
|
|
|
38
21
|
if (value.length > MAX_IDENTITY_LENGTH) throw new InsightsBadRequestError(`Invalid event field: ${key}`);
|
|
39
22
|
return value;
|
|
40
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* The report's idempotency key, when the client sends one: it creates the
|
|
26
|
+
* UUIDv7 once and repeats it on every retry of that report.
|
|
27
|
+
*/
|
|
28
|
+
function readEventId(payload) {
|
|
29
|
+
const value = payload.eventId;
|
|
30
|
+
if (value === void 0) return void 0;
|
|
31
|
+
if (!isUUIDv7(value)) throw new InsightsBadRequestError("Invalid event field: eventId");
|
|
32
|
+
return value;
|
|
33
|
+
}
|
|
41
34
|
async function readBoundedText(request) {
|
|
42
35
|
const contentLength = request.headers.get("content-length");
|
|
43
36
|
const declaredByteLength = Number(contentLength);
|
|
@@ -69,10 +62,12 @@ async function parseJson(request) {
|
|
|
69
62
|
}
|
|
70
63
|
}
|
|
71
64
|
function requireEvent(payload) {
|
|
72
|
-
if (!isRecord(payload)
|
|
65
|
+
if (!isRecord(payload)) throw new InsightsBadRequestError("Invalid event payload");
|
|
73
66
|
const platform = requireStringField(payload, "platform");
|
|
74
67
|
if (platform !== "ios" && platform !== "android") throw new InsightsBadRequestError("Invalid event field: platform");
|
|
68
|
+
const eventId = readEventId(payload);
|
|
75
69
|
const base = {
|
|
70
|
+
...eventId === void 0 ? {} : { eventId },
|
|
76
71
|
installId: requireIdentityField(payload, "installId"),
|
|
77
72
|
toBundleId: requireStringField(payload, "toBundleId"),
|
|
78
73
|
...payload.userId === void 0 ? {} : { userId: requireIdentityField(payload, "userId") },
|
|
@@ -120,7 +115,7 @@ function createBundleEventRow(input) {
|
|
|
120
115
|
app_version: input.appVersion,
|
|
121
116
|
channel: input.channel,
|
|
122
117
|
from_release_id: input.fromReleaseId,
|
|
123
|
-
id: createUUIDv7(),
|
|
118
|
+
id: input.eventId ?? createUUIDv7(),
|
|
124
119
|
install_id: input.installId,
|
|
125
120
|
platform: input.platform,
|
|
126
121
|
received_at_ms: Date.now(),
|
|
@@ -7,11 +7,20 @@ const MAX_PAGE_LIMIT = 100;
|
|
|
7
7
|
const MAX_EVENT_ID_LENGTH = 1024;
|
|
8
8
|
const MAX_IDENTITY_LENGTH = 255;
|
|
9
9
|
const MAX_CURSOR_LENGTH = 8192;
|
|
10
|
+
const HOUR_MS = 36e5;
|
|
10
11
|
const WINDOW_MS = {
|
|
11
12
|
"24h": 864e5,
|
|
12
13
|
"7d": 6048e5,
|
|
13
14
|
"30d": 2592e6
|
|
14
15
|
};
|
|
16
|
+
/**
|
|
17
|
+
* The longest receipt range, `[sinceMs, beforeReceivedAtMs)`, of a global or
|
|
18
|
+
* bundle event list, and the range one covers without `sinceMs`: raw events
|
|
19
|
+
* are listed inside a time range, as analytics products list them. It is a
|
|
20
|
+
* duration, so a range that ends mid-day touches 91 UTC days. Installation
|
|
21
|
+
* history is one index range and reads back to `sinceMs`.
|
|
22
|
+
*/
|
|
23
|
+
const EVENT_LIST_RANGE_MS = 2160 * HOUR_MS;
|
|
15
24
|
const isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
16
25
|
const requireString = (value, label, maximumLength) => {
|
|
17
26
|
if (typeof value !== "string" || value.length === 0 || value.length > maximumLength || new TextDecoder("utf-8", { ignoreBOM: true }).decode(new TextEncoder().encode(value)) !== value) throw new require_errors.InsightsBadRequestError(`Invalid ${label}.`);
|
|
@@ -160,36 +169,50 @@ const toInstallationRow = (row) => ({
|
|
|
160
169
|
userId: row.user_id,
|
|
161
170
|
username: row.metadata.username
|
|
162
171
|
});
|
|
172
|
+
/**
|
|
173
|
+
* Where a list without `sinceMs` starts: 90 days before its cutoff for the
|
|
174
|
+
* global and bundle lists, at the first event for installation history.
|
|
175
|
+
*/
|
|
176
|
+
const defaultEventStart = (filter, beforeReceivedAtMs) => filter.kind === "installationMovement" ? 0 : Math.max(0, beforeReceivedAtMs - EVENT_LIST_RANGE_MS);
|
|
177
|
+
/** Whether a cursor's row lies inside the list's range. */
|
|
178
|
+
const isInsideBounds = ({ after }, bounds) => after.receivedAtMs >= bounds.sinceMs && after.receivedAtMs < bounds.beforeReceivedAtMs;
|
|
179
|
+
/** A page's range: its cursor's, which the request may repeat but not change. */
|
|
180
|
+
const readEventBounds = (input, cursor, filter) => {
|
|
181
|
+
const beforeReceivedAtMs = cursor?.beforeReceivedAtMs ?? (input.beforeReceivedAtMs === void 0 ? Date.now() : requireTimestamp(input.beforeReceivedAtMs, "event cutoff"));
|
|
182
|
+
if (cursor !== void 0 && input.beforeReceivedAtMs !== void 0 && input.beforeReceivedAtMs !== beforeReceivedAtMs) throw new require_errors.InsightsBadRequestError("Insights cursor does not match the requested event cutoff.");
|
|
183
|
+
const sinceMs = cursor?.sinceMs ?? (input.sinceMs === void 0 ? defaultEventStart(filter, beforeReceivedAtMs) : requireTimestamp(input.sinceMs, "event start"));
|
|
184
|
+
const bounds = {
|
|
185
|
+
beforeReceivedAtMs,
|
|
186
|
+
sinceMs
|
|
187
|
+
};
|
|
188
|
+
if (sinceMs > beforeReceivedAtMs || input.sinceMs !== void 0 && input.sinceMs !== sinceMs || cursor !== void 0 && !isInsideBounds(cursor, bounds)) throw new require_errors.InsightsBadRequestError("Insights cursor or range does not match the requested event start.");
|
|
189
|
+
if (filter.kind !== "installationMovement" && beforeReceivedAtMs - sinceMs > 7776e6) throw new require_errors.InsightsBadRequestError("Insights event lists cover at most 90 days: send a sinceMs no more than 90 days before beforeReceivedAtMs.");
|
|
190
|
+
return bounds;
|
|
191
|
+
};
|
|
163
192
|
const pageEventRows = async (model, input, filter, map) => {
|
|
164
193
|
const limit = readLimit(input.limit);
|
|
165
194
|
const cursor = input.cursor === void 0 ? void 0 : readEventCursor(input.cursor, filter);
|
|
166
|
-
const
|
|
167
|
-
|
|
168
|
-
const sinceMs = cursor?.sinceMs ?? (input.sinceMs === void 0 ? 0 : requireTimestamp(input.sinceMs, "event start"));
|
|
169
|
-
if (sinceMs > beforeReceivedAtMs || input.sinceMs !== void 0 && input.sinceMs !== sinceMs || cursor !== void 0 && (cursor.after.receivedAtMs < sinceMs || cursor.after.receivedAtMs >= beforeReceivedAtMs)) throw new require_errors.InsightsBadRequestError("Insights cursor or range does not match the requested event start.");
|
|
170
|
-
const databaseInput = {
|
|
195
|
+
const bounds = readEventBounds(input, cursor, filter);
|
|
196
|
+
const query = {
|
|
171
197
|
filter,
|
|
172
|
-
|
|
173
|
-
beforeReceivedAtMs,
|
|
198
|
+
...bounds,
|
|
174
199
|
...cursor === void 0 ? {} : { after: cursor.after },
|
|
175
|
-
limit
|
|
200
|
+
limit
|
|
176
201
|
};
|
|
177
|
-
const rows = await model.listEvents(
|
|
178
|
-
assertEventRows(rows,
|
|
179
|
-
const
|
|
180
|
-
const last = pageRows.at(-1);
|
|
202
|
+
const rows = await model.listEvents(query);
|
|
203
|
+
assertEventRows(rows, query);
|
|
204
|
+
const last = rows.at(-1);
|
|
181
205
|
return {
|
|
182
|
-
beforeReceivedAtMs,
|
|
183
|
-
data:
|
|
184
|
-
nextCursor: rows.length
|
|
206
|
+
beforeReceivedAtMs: bounds.beforeReceivedAtMs,
|
|
207
|
+
data: rows.map(map),
|
|
208
|
+
nextCursor: rows.length === limit && last ? encodeCursor({
|
|
185
209
|
after: {
|
|
186
210
|
id: last.id,
|
|
187
211
|
receivedAtMs: last.received_at_ms
|
|
188
212
|
},
|
|
189
|
-
|
|
213
|
+
...bounds,
|
|
190
214
|
kind: "events",
|
|
191
215
|
filter,
|
|
192
|
-
sinceMs,
|
|
193
216
|
version: 2
|
|
194
217
|
}) : null
|
|
195
218
|
};
|
|
@@ -236,15 +259,14 @@ const createInsightsProvider = (model) => Object.freeze({
|
|
|
236
259
|
const databaseInput = {
|
|
237
260
|
userId,
|
|
238
261
|
...cursor === void 0 ? {} : { afterInstallId: cursor.afterInstallId },
|
|
239
|
-
limit
|
|
262
|
+
limit
|
|
240
263
|
};
|
|
241
264
|
const rows = await model.findLatestEvents(databaseInput);
|
|
242
265
|
assertInstallationRows(rows, databaseInput);
|
|
243
|
-
const
|
|
244
|
-
const last = pageRows.at(-1);
|
|
266
|
+
const last = rows.at(-1);
|
|
245
267
|
return {
|
|
246
|
-
data:
|
|
247
|
-
nextCursor: rows.length
|
|
268
|
+
data: rows.map(toInstallationRow),
|
|
269
|
+
nextCursor: rows.length === limit && last ? encodeCursor({
|
|
248
270
|
afterInstallId: last.install_id,
|
|
249
271
|
kind: "user-installations",
|
|
250
272
|
userId,
|
|
@@ -256,7 +278,8 @@ const createInsightsProvider = (model) => Object.freeze({
|
|
|
256
278
|
const scope = readScope(input);
|
|
257
279
|
const { window } = input;
|
|
258
280
|
if (!Object.hasOwn(WINDOW_MS, window)) throw new require_errors.InsightsBadRequestError("Invalid reporting installation window.");
|
|
259
|
-
const
|
|
281
|
+
const now = Date.now();
|
|
282
|
+
const beforeReceivedAtMs = now - now % HOUR_MS + (now % HOUR_MS === 0 ? 0 : HOUR_MS);
|
|
260
283
|
const sinceMs = Math.max(0, beforeReceivedAtMs - WINDOW_MS[window]);
|
|
261
284
|
const measure = async (count) => {
|
|
262
285
|
const value = await count;
|
|
@@ -329,4 +352,5 @@ const createInsightsProvider = (model) => Object.freeze({
|
|
|
329
352
|
}
|
|
330
353
|
});
|
|
331
354
|
//#endregion
|
|
355
|
+
exports.EVENT_LIST_RANGE_MS = EVENT_LIST_RANGE_MS;
|
|
332
356
|
exports.createInsightsProvider = createInsightsProvider;
|