@hot-updater/plugin-core 1.0.0-rc.17 → 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/README.md +33 -0
- package/dist/baseCandidateKey.cjs +50 -0
- package/dist/baseCandidateKey.d.cts +27 -0
- package/dist/baseCandidateKey.d.mts +27 -0
- package/dist/baseCandidateKey.mjs +49 -0
- package/dist/createStorageAdapter.cjs +8 -0
- package/dist/createStorageAdapter.d.cts +9 -0
- package/dist/createStorageAdapter.d.mts +9 -0
- package/dist/createStorageAdapter.mjs +7 -0
- package/dist/database/adapter.cjs +20 -5
- package/dist/database/adapter.d.cts +25 -8
- package/dist/database/adapter.d.mts +25 -8
- package/dist/database/adapter.mjs +21 -4
- package/dist/database/distinct.cjs +12 -6
- package/dist/database/distinct.d.cts +13 -11
- package/dist/database/distinct.d.mts +13 -11
- package/dist/database/distinct.mjs +13 -6
- package/dist/database/memoryAdapter.cjs +2 -10
- package/dist/database/memoryAdapter.d.cts +2 -4
- package/dist/database/memoryAdapter.d.mts +2 -4
- package/dist/database/memoryAdapter.mjs +2 -10
- package/dist/database/values.cjs +5 -1
- package/dist/database/values.d.cts +8 -21
- package/dist/database/values.d.mts +8 -21
- package/dist/database/values.mjs +5 -1
- package/dist/database/verifyAdapter.cjs +1 -0
- package/dist/database/verifyAdapter.d.cts +8 -0
- package/dist/database/verifyAdapter.d.mts +8 -0
- package/dist/database/verifyAdapter.mjs +1 -0
- package/dist/databaseErrors.cjs +4 -4
- package/dist/databaseErrors.d.cts +6 -6
- package/dist/databaseErrors.d.mts +6 -6
- package/dist/databaseErrors.mjs +4 -4
- package/dist/databaseJsonValue.cjs +6 -0
- package/dist/databaseJsonValue.d.cts +6 -0
- package/dist/databaseJsonValue.d.mts +6 -0
- package/dist/databaseJsonValue.mjs +6 -0
- package/dist/databaseMetadata.cjs +3 -3
- package/dist/databaseMetadata.mjs +3 -3
- package/dist/databaseRows.cjs +6 -6
- package/dist/databaseRows.d.cts +1 -1
- package/dist/databaseRows.d.mts +1 -1
- package/dist/databaseRows.mjs +1 -1
- package/dist/engine/core/schema.cjs +279 -0
- package/dist/engine/core/schema.d.cts +312 -0
- package/dist/engine/core/schema.d.mts +312 -0
- package/dist/engine/core/schema.mjs +277 -0
- package/dist/engine/createEngine.cjs +72 -0
- package/dist/engine/createEngine.d.cts +45 -0
- package/dist/engine/createEngine.d.mts +45 -0
- package/dist/engine/createEngine.mjs +72 -0
- package/dist/engine/database/aggregateBatching.cjs +627 -0
- package/dist/engine/database/aggregateBatching.mjs +626 -0
- package/dist/engine/database/cursor.cjs +42 -0
- package/dist/engine/database/cursor.mjs +38 -0
- package/dist/engine/database/database.cjs +68 -0
- package/dist/engine/database/database.mjs +68 -0
- package/dist/engine/database/engine.cjs +37 -0
- package/dist/engine/database/engine.mjs +37 -0
- package/dist/engine/database/engineAggregates.cjs +120 -0
- package/dist/engine/database/engineAggregates.mjs +117 -0
- package/dist/engine/database/engineReads.cjs +182 -0
- package/dist/engine/database/engineReads.d.cts +10 -0
- package/dist/engine/database/engineReads.d.mts +10 -0
- package/dist/engine/database/engineReads.mjs +181 -0
- package/dist/engine/database/engineTransaction.cjs +399 -0
- package/dist/engine/database/engineTransaction.d.cts +18 -0
- package/dist/engine/database/engineTransaction.d.mts +18 -0
- package/dist/engine/database/engineTransaction.mjs +398 -0
- package/dist/engine/database/fence.cjs +156 -0
- package/dist/engine/database/fence.d.cts +41 -0
- package/dist/engine/database/fence.d.mts +41 -0
- package/dist/engine/database/fence.mjs +149 -0
- package/dist/engine/database/kv/kvAdapter.cjs +293 -0
- package/dist/engine/database/kv/kvAdapter.d.cts +116 -0
- package/dist/engine/database/kv/kvAdapter.d.mts +116 -0
- package/dist/engine/database/kv/kvAdapter.mjs +292 -0
- package/dist/engine/database/readMeter.cjs +80 -0
- package/dist/engine/database/readMeter.d.cts +34 -0
- package/dist/engine/database/readMeter.d.mts +34 -0
- package/dist/engine/database/readMeter.mjs +79 -0
- package/dist/engine/database/resolveSchema.cjs +197 -0
- package/dist/engine/database/resolveSchema.d.cts +35 -0
- package/dist/engine/database/resolveSchema.d.mts +35 -0
- package/dist/engine/database/resolveSchema.mjs +195 -0
- package/dist/engine/database/retention.cjs +100 -0
- package/dist/engine/database/retention.mjs +98 -0
- package/dist/engine/database/sql/sqlAdapter.cjs +290 -0
- package/dist/engine/database/sql/sqlAdapter.d.cts +45 -0
- package/dist/engine/database/sql/sqlAdapter.d.mts +45 -0
- package/dist/engine/database/sql/sqlAdapter.mjs +288 -0
- package/dist/engine/database/sql/sqlSchema.cjs +175 -0
- package/dist/engine/database/sql/sqlSchema.d.cts +45 -0
- package/dist/engine/database/sql/sqlSchema.d.mts +45 -0
- package/dist/engine/database/sql/sqlSchema.mjs +169 -0
- package/dist/engine/db/coreDatabase.cjs +94 -0
- package/dist/engine/db/coreDatabase.d.cts +78 -0
- package/dist/engine/db/coreDatabase.d.mts +78 -0
- package/dist/engine/db/coreDatabase.mjs +86 -0
- package/dist/engine/db/engineMigrator.cjs +53 -0
- package/dist/engine/db/engineMigrator.mjs +53 -0
- package/dist/engine/db/engineSql.cjs +26 -0
- package/dist/engine/db/engineSql.d.cts +16 -0
- package/dist/engine/db/engineSql.d.mts +16 -0
- package/dist/engine/db/engineSql.mjs +25 -0
- package/dist/engine/db/engineSqlMigrator.cjs +67 -0
- package/dist/engine/db/engineSqlMigrator.d.cts +21 -0
- package/dist/engine/db/engineSqlMigrator.d.mts +21 -0
- package/dist/engine/db/engineSqlMigrator.mjs +67 -0
- package/dist/engine/db/fixedMigratorShared.cjs +12 -0
- package/dist/engine/db/fixedMigratorShared.mjs +11 -0
- package/dist/engine/db/schemaSettings.cjs +63 -0
- package/dist/engine/db/schemaSettings.d.cts +7 -0
- package/dist/engine/db/schemaSettings.d.mts +7 -0
- package/dist/engine/db/schemaSettings.mjs +62 -0
- package/dist/engine/db/settingsMigrator.cjs +94 -0
- package/dist/engine/db/settingsMigrator.d.cts +25 -0
- package/dist/engine/db/settingsMigrator.d.mts +25 -0
- package/dist/engine/db/settingsMigrator.mjs +91 -0
- package/dist/engine/db/types.d.cts +78 -0
- package/dist/engine/db/types.d.mts +78 -0
- package/dist/index.cjs +86 -7
- package/dist/index.d.cts +36 -6
- package/dist/index.d.mts +36 -6
- package/dist/index.mjs +26 -4
- package/dist/node_modules/.pnpm/verkit@0.4.0/node_modules/verkit/dist/comparison-DenM3wCn.cjs +0 -5
- package/dist/node_modules/.pnpm/verkit@0.4.0/node_modules/verkit/dist/comparison-DenM3wCn.mjs +1 -5
- package/dist/node_modules/.pnpm/verkit@0.4.0/node_modules/verkit/dist/range-DvX-Y6iv.cjs +8 -0
- package/dist/node_modules/.pnpm/verkit@0.4.0/node_modules/verkit/dist/range-DvX-Y6iv.mjs +9 -2
- package/dist/node_modules/.pnpm/verkit@0.4.0/node_modules/verkit/dist/set-CC5YeoYX.cjs +4 -0
- package/dist/node_modules/.pnpm/verkit@0.4.0/node_modules/verkit/dist/set-CC5YeoYX.mjs +4 -1
- package/dist/node_modules/.pnpm/verkit@0.4.0/node_modules/verkit/dist/version-CQ98ZBpL.cjs +0 -5
- package/dist/node_modules/.pnpm/verkit@0.4.0/node_modules/verkit/dist/version-CQ98ZBpL.mjs +2 -6
- package/dist/releaseCatalogCompiler.cjs +26 -25
- package/dist/releaseCatalogCompiler.d.cts +1 -2
- package/dist/releaseCatalogCompiler.d.mts +2 -3
- package/dist/releaseCatalogCompiler.mjs +3 -7
- package/dist/remoteBundleSigning.d.cts +2 -2
- package/dist/remoteBundleSigning.d.mts +2 -2
- package/dist/serverPlugin/busy.cjs +36 -0
- package/dist/serverPlugin/busy.d.cts +12 -0
- package/dist/serverPlugin/busy.d.mts +12 -0
- package/dist/serverPlugin/busy.mjs +36 -0
- package/dist/serverPlugin/configError.cjs +7 -0
- package/dist/serverPlugin/configError.d.cts +7 -0
- package/dist/serverPlugin/configError.d.mts +7 -0
- package/dist/serverPlugin/configError.mjs +7 -0
- package/dist/serverPlugin/coreReads.d.cts +48 -0
- package/dist/serverPlugin/coreReads.d.mts +48 -0
- package/dist/serverPlugin/databaseHandle.d.cts +105 -0
- package/dist/serverPlugin/databaseHandle.d.mts +105 -0
- package/dist/serverPlugin/definePlugin.cjs +5 -0
- package/dist/serverPlugin/definePlugin.d.cts +130 -0
- package/dist/serverPlugin/definePlugin.d.mts +130 -0
- package/dist/serverPlugin/definePlugin.mjs +5 -0
- package/dist/serverPlugin/definitions.d.cts +76 -0
- package/dist/serverPlugin/definitions.d.mts +76 -0
- package/dist/serverPlugin/errors.cjs +37 -0
- package/dist/serverPlugin/errors.d.cts +29 -0
- package/dist/serverPlugin/errors.d.mts +29 -0
- package/dist/serverPlugin/errors.mjs +32 -0
- package/dist/serverPlugin/schema.cjs +24 -0
- package/dist/serverPlugin/schema.d.cts +90 -0
- package/dist/serverPlugin/schema.d.mts +90 -0
- package/dist/serverPlugin/schema.mjs +23 -0
- package/dist/types/databaseConfig.cjs +1 -1
- package/dist/types/databaseConfig.d.cts +8 -1
- package/dist/types/databaseConfig.d.mts +8 -1
- package/dist/types/databaseConfig.mjs +1 -1
- package/dist/types/databaseRows.d.cts +1 -1
- package/dist/types/databaseRows.d.mts +1 -1
- package/dist/types/index.d.cts +26 -14
- package/dist/types/index.d.mts +26 -14
- package/dist/types/public.d.cts +1 -1
- package/dist/types/public.d.mts +1 -1
- package/dist/uuidv7.cjs +3 -3
- package/dist/uuidv7.d.cts +1 -1
- package/dist/uuidv7.d.mts +1 -1
- package/dist/uuidv7.mjs +1 -1
- package/package.json +10 -7
- package/dist/createStoragePlugin.cjs +0 -8
- package/dist/createStoragePlugin.d.cts +0 -9
- package/dist/createStoragePlugin.d.mts +0 -9
- package/dist/createStoragePlugin.mjs +0 -7
- package/dist/internal.cjs +0 -38
- package/dist/internal.d.cts +0 -12
- package/dist/internal.d.mts +0 -12
- package/dist/internal.mjs +0 -8
- package/dist/types/internal.d.cts +0 -4
- package/dist/types/internal.d.mts +0 -4
package/dist/index.d.cts
CHANGED
|
@@ -3,19 +3,29 @@ import { createStorageUriWithRelativePath, getManifestAssetDownloadPath, getMani
|
|
|
3
3
|
import { CONTENT_ADDRESSED_ASSET_PREFIX, getContentAddressedAssetStoragePath, isContentAddressedAssetFileHash } from "./contentAddressedAssets.cjs";
|
|
4
4
|
import { getContentType } from "./contentType.cjs";
|
|
5
5
|
import { CatalogVersionBound, CompiledCatalogSegment, CompiledReleaseCatalog, ReleaseCatalogCompilation, ReleaseCatalogCompilationError, ReleaseCatalogCompilerDiagnostics, canonicalizeAppVersion, compileReleaseCatalog, projectCompiledCatalog, projectCompiledRollbackCatalog, referenceCompatibleReleases } from "./releaseCatalogCompiler.cjs";
|
|
6
|
+
import { BundlePatchRow, BundleRow, ChannelRow, DatabaseBundleMetadata, DatabaseJsonObject, DatabaseJsonValue, ReleaseCatalogRow, ReleaseRow } from "./types/databaseRows.cjs";
|
|
7
|
+
import { CoreReads, ReleaseCatalogRequest } from "./serverPlugin/coreReads.cjs";
|
|
8
|
+
import { DATABASE_VERSION_COLUMN, DatabaseAdapter, DatabaseJson, DatabaseKey, DatabaseKeyValue, DatabaseSchemaError, DatabaseValue, PhysicalColumn, PhysicalColumnType, PhysicalIndex, PhysicalRetention, PhysicalTable, QueryBound, QueryRequest, StoredRow, WriteGuard, WriteOp, WriteResult, expiresAt, findPhysicalColumn, findPhysicalIndex, indexOrderColumns, rowKey } from "./database/adapter.cjs";
|
|
9
|
+
import { FieldDefinition, FieldReference, FieldType, IndexDefinition, ReferenceAction } from "./serverPlugin/definitions.cjs";
|
|
10
|
+
import { AggregateDefinition, DerivedDefinition, DerivedFields, FieldValue, ModelDefinition, ModuleSchema, RetentionDefinition, RowOf, TableDefinition, defineAggregate, defineTable } from "./serverPlugin/schema.cjs";
|
|
11
|
+
import { AggregateChanges, AggregateIdentity, AggregateRow, CreateRow, EngineColumns, FindAggregatesModel, FindManyModel, HotUpdaterDatabase, HotUpdaterTransaction, KeyLookup, Lookup, Page, ReadOptions, ReadRow, TableRow, UpdateSet } from "./serverPlugin/databaseHandle.cjs";
|
|
12
|
+
import { AnyHotUpdaterPlugin, ClientAuth, CoreReader, HotUpdaterPlugin, PluginApis, PluginCli, PluginClientCredential, PluginClientPlugin, PluginContext, PluginEndpoint, PluginEndpointMethod, PluginInstance, PluginProvides, definePlugin } from "./serverPlugin/definePlugin.cjs";
|
|
13
|
+
import { ConstraintReason, DatabaseAmbiguousCommitError, DatabaseConflictError, DatabaseConstraintError, DatabaseCursorError, DatabaseQueryError, DatabaseTransactionError } from "./serverPlugin/errors.cjs";
|
|
14
|
+
import { ResolvedModel, ResolvedSchema } from "./engine/database/resolveSchema.cjs";
|
|
15
|
+
import { EngineReadCount } from "./engine/database/engineReads.cjs";
|
|
16
|
+
import { RetryOptions } from "./engine/database/engineTransaction.cjs";
|
|
6
17
|
import { AggregateBatching, ConfiguredDatabase, EngineDatabase, RemoteDatabase, isRemoteDatabase } from "./types/databaseConfig.cjs";
|
|
7
18
|
import { BuiltIns, HasMultipleCallSignatures, Primitive, RequiredDeep } from "./types/utils.cjs";
|
|
8
|
-
import { BundlePatchRow, BundleRow, ChannelRow, DatabaseBundleMetadata, DatabaseJsonObject, DatabaseJsonValue, ReleaseCatalogRow, ReleaseRow } from "./types/databaseRows.cjs";
|
|
9
19
|
import { BundleRowUpdate, ReleaseCatalogRowUpdate, ReleaseRowUpdate } from "./types/databaseOperations.cjs";
|
|
10
20
|
import { ChannelDeleteResult, ChannelInsertResult } from "./types/models.cjs";
|
|
11
|
-
import { ApplePlatform,
|
|
21
|
+
import { ApplePlatform, BuildAdapter, BuildAdapterArgs, BuildAdapterConfig, Bundle, BundleSigningAdapter, ConfigInput, FingerprintExtraSources, IosBuildDestination, LocalSigningConfig, NativeBuildAndroidScheme, NativeBuildArgs, NativeBuildIosScheme, NativeBuildOptions, Platform, PlatformConfig, SigningConfig, StorageAdapter, StorageDeleteInput, StorageDeleteResult, StorageExistsInput, StorageExistsResult, StorageGetDownloadUrlInput, StorageGetDownloadUrlResult, StorageGetInput, StorageGetResult, StorageObject, StoragePutInput, StoragePutResult, supportedIosPlatforms } from "./types/index.cjs";
|
|
12
22
|
import { ReleaseCatalogMutationError, ReleaseCatalogMutationPreflight, ReleaseCatalogMutationResult, ReleaseCatalogRebuildPreflight, ReleaseCatalogRebuildResult, ReleaseCatalogScope } from "./releaseCatalogMutation.cjs";
|
|
13
23
|
import { PromoteReleaseResult, ReleaseManagementError, ReleasePolicyPatch } from "./releaseManagement.cjs";
|
|
14
24
|
import { BundleDeployment, BundleDetail, DeployReleasePolicy, Deployment, HotUpdaterCoreApi, KeysetInput, ReleaseFilter, ReleaseTarget, StoredBundleDeployment } from "./coreApi.cjs";
|
|
15
|
-
import {
|
|
25
|
+
import { DatabaseAdapterInputError, DatabaseAdapterInputErrorCode, DatabaseBundleNotFoundError, DatabaseRowReferencedError } from "./databaseErrors.cjs";
|
|
16
26
|
import { createStorageKeyBuilder } from "./createStorageKeyBuilder.cjs";
|
|
17
|
-
import {
|
|
18
|
-
import { isDatabaseMetadataObject } from "./databaseJsonValue.cjs";
|
|
27
|
+
import { CreateStorageAdapterOptions, StorageAdapterWith, StorageOperation, assertStorageOperations, createStorageAdapter } from "./createStorageAdapter.cjs";
|
|
28
|
+
import { isDatabaseJsonObject, isDatabaseMetadataObject } from "./databaseJsonValue.cjs";
|
|
19
29
|
import { BundleRowHydrationError, BundleRowHydrationErrorReason, bundleToPatchRows, bundleToRow, releaseRowToRelease, releaseToRow, rowToBundle, rowsToBundles } from "./databaseRows.cjs";
|
|
20
30
|
import { filterCompatibleAppVersions } from "./filterCompatibleAppVersions.cjs";
|
|
21
31
|
import { generateMinBundleId } from "./generateMinBundleId.cjs";
|
|
@@ -24,4 +34,24 @@ import { BundleSigningHandlerOptions, REMOTE_BUNDLE_SIGNING_ALGORITHM, REMOTE_BU
|
|
|
24
34
|
import { semverSatisfies } from "./semverSatisfies.cjs";
|
|
25
35
|
import { createStorageDownloadPath, createStorageDownloadUrl, parseStorageDownloadPath } from "./storageDownloadPath.cjs";
|
|
26
36
|
import { createUUIDv7, createUUIDv7After, createUUIDv7WithSameTimestamp, extractTimestampFromUUIDv7, isUUIDv7 } from "./uuidv7.cjs";
|
|
27
|
-
|
|
37
|
+
import { isDatabaseBusyError } from "./serverPlugin/busy.cjs";
|
|
38
|
+
import { addDistinct, countDistinct, mergeDistinct } from "./database/distinct.cjs";
|
|
39
|
+
import { HotUpdaterConfigError } from "./serverPlugin/configError.cjs";
|
|
40
|
+
import { BaseCandidateQuery, BaseCandidateTarget, parseBaseCandidateKey, targetBaseCandidateKey } from "./baseCandidateKey.cjs";
|
|
41
|
+
import { MemoryAdapterOptions, createMemoryAdapter } from "./database/memoryAdapter.cjs";
|
|
42
|
+
import { NormalizeOptions, compareUtf8, normalizeStoredRow } from "./database/values.cjs";
|
|
43
|
+
import { DatabaseAdapterContractError, DatabaseReadCount, DatabaseReadMeter, VerifiedDatabaseAdapter, VerifyAdapterOptions, verifyAdapter } from "./database/verifyAdapter.cjs";
|
|
44
|
+
import { CoreSchema } from "./engine/core/schema.cjs";
|
|
45
|
+
import { HotUpdaterSchemaMigrationRequiredError, SETTINGS_TABLE, SchemaSettings } from "./engine/database/fence.cjs";
|
|
46
|
+
import { DatabaseTooling, MigrateOptions, MigrationResult, Migrator, SchemaGenerator, ToolingDatabase, ToolingTarget } from "./engine/db/types.cjs";
|
|
47
|
+
import { EngineDatabaseOptions, PluginTables, aggregateBatchingTables, coreSchema, coreSettings, coreTarget, createEngineDatabase, migrateCoreSchema, toolingTargetOf } from "./engine/db/coreDatabase.cjs";
|
|
48
|
+
import { Engine, EngineOptions, createEngine } from "./engine/createEngine.cjs";
|
|
49
|
+
import { KeyValueStore, KvAdapterOptions, KvCondition, KvItem, KvKey, KvOp, KvRange, createKvAdapter, encodeKvKey } from "./engine/database/kv/kvAdapter.cjs";
|
|
50
|
+
import { MeteredDatabase, ReadMeasurement, meterReads } from "./engine/database/readMeter.cjs";
|
|
51
|
+
import { SqlColumnShape, SqlDialect, SqlTableShape, createTableStatements, isMultiIndex, quoteSql, sqlTableShapes } from "./engine/database/sql/sqlSchema.cjs";
|
|
52
|
+
import { SqlAdapterOptions, SqlConnection, SqlExecutor, SqlResult, SqlStatement, WRITE_GUARD_TABLE, createSqlAdapter } from "./engine/database/sql/sqlAdapter.cjs";
|
|
53
|
+
import { EngineSqlOptions, generateEngineSql } from "./engine/db/engineSql.cjs";
|
|
54
|
+
import { EngineSqlMigratorOptions, createEngineSqlMigrator } from "./engine/db/engineSqlMigrator.cjs";
|
|
55
|
+
import { writeSchemaSettings } from "./engine/db/schemaSettings.cjs";
|
|
56
|
+
import { createSettingsMigrator } from "./engine/db/settingsMigrator.cjs";
|
|
57
|
+
export { type AggregateBatching, type AggregateChanges, type AggregateDefinition, type AggregateIdentity, type AggregateRow, type AnyHotUpdaterPlugin, ApplePlatform, BUNDLE_STORAGE_PREFIX, type BaseCandidateQuery, type BaseCandidateTarget, BuildAdapter, BuildAdapterArgs, BuildAdapterConfig, BuiltIns, type Bundle, type BundleDeployment, type BundleDetail, type BundlePatchRow, type BundleRow, BundleRowHydrationError, BundleRowHydrationErrorReason, type BundleRowUpdate, BundleSigningAdapter, BundleSigningHandlerOptions, CONTENT_ADDRESSED_ASSET_PREFIX, CatalogVersionBound, type ChannelDeleteResult, type ChannelInsertResult, type ChannelRow, type ClientAuth, CompiledCatalogSegment, CompiledReleaseCatalog, ConfigInput, type ConfiguredDatabase, type ConstraintReason, type CoreReader, type CoreReads, type CoreSchema, type CreateRow, CreateStorageAdapterOptions, CreateStorageUriInput, DATABASE_VERSION_COLUMN, type DatabaseAdapter, DatabaseAdapterContractError, DatabaseAdapterInputError, type DatabaseAdapterInputErrorCode, DatabaseAmbiguousCommitError, type DatabaseBundleMetadata, DatabaseBundleNotFoundError, DatabaseConflictError, DatabaseConstraintError, DatabaseCursorError, type DatabaseJson, type DatabaseJsonObject, type DatabaseJsonValue, type DatabaseKey, type DatabaseKeyValue, DatabaseQueryError, type DatabaseReadCount, type DatabaseReadMeter, DatabaseRowReferencedError, DatabaseSchemaError, type DatabaseTooling, DatabaseTransactionError, type DatabaseValue, type DeployReleasePolicy, type Deployment, type DerivedDefinition, type DerivedFields, type Engine, type EngineColumns, type EngineDatabase, type EngineDatabaseOptions, type EngineOptions, type EngineReadCount, type EngineSqlMigratorOptions, type EngineSqlOptions, type FieldDefinition, type FieldReference, type FieldType, type FieldValue, type FindAggregatesModel, type FindManyModel, FingerprintExtraSources, HasMultipleCallSignatures, HotUpdaterConfigError, type HotUpdaterCoreApi, type HotUpdaterDatabase, type HotUpdaterPlugin, HotUpdaterSchemaMigrationRequiredError, type HotUpdaterTransaction, type IndexDefinition, IosBuildDestination, type KeyLookup, type KeyValueStore, type KeysetInput, type KvAdapterOptions, type KvCondition, type KvItem, type KvKey, type KvOp, type KvRange, LocalSigningConfig, type Lookup, type MemoryAdapterOptions, type MeteredDatabase, type MigrateOptions, type MigrationResult, type Migrator, type ModelDefinition, type ModuleSchema, NativeBuildAndroidScheme, NativeBuildArgs, NativeBuildIosScheme, NativeBuildOptions, type NormalizeOptions, type Page, ParsedStorageUri, type PhysicalColumn, type PhysicalColumnType, type PhysicalIndex, type PhysicalRetention, type PhysicalTable, type Platform, PlatformConfig, type PluginApis, type PluginCli, type PluginClientCredential, type PluginClientPlugin, type PluginContext, type PluginEndpoint, type PluginEndpointMethod, type PluginInstance, type PluginProvides, type PluginTables, Primitive, PromoteReleaseResult, type QueryBound, type QueryRequest, REMOTE_BUNDLE_SIGNING_ALGORITHM, REMOTE_BUNDLE_SIGNING_PATH, REMOTE_BUNDLE_SIGNING_PROTOCOL_VERSION, REMOTE_BUNDLE_SIGNING_TOKEN_HEADER, type ReadMeasurement, type ReadOptions, type ReadRow, type ReferenceAction, ReleaseCatalogCompilation, ReleaseCatalogCompilationError, ReleaseCatalogCompilerDiagnostics, ReleaseCatalogMutationError, ReleaseCatalogMutationPreflight, ReleaseCatalogMutationResult, ReleaseCatalogRebuildPreflight, ReleaseCatalogRebuildResult, type ReleaseCatalogRequest, type ReleaseCatalogRow, type ReleaseCatalogRowUpdate, ReleaseCatalogScope, type ReleaseFilter, ReleaseManagementError, ReleasePolicyPatch, type ReleaseRow, type ReleaseRowUpdate, type ReleaseTarget, type RemoteDatabase, RemoteSigningOptions, RequiredDeep, type ResolvedModel, type ResolvedSchema, type RetentionDefinition, type RetryOptions, type RowOf, SETTINGS_TABLE, type SchemaGenerator, type SchemaSettings, SigningConfig, type SqlAdapterOptions, type SqlColumnShape, type SqlConnection, type SqlDialect, type SqlExecutor, type SqlResult, type SqlStatement, type SqlTableShape, StorageAdapter, StorageAdapterWith, StorageDeleteInput, StorageDeleteResult, StorageExistsInput, StorageExistsResult, StorageGetDownloadUrlInput, StorageGetDownloadUrlResult, StorageGetInput, StorageGetResult, StorageObject, StorageOperation, StoragePutInput, StoragePutResult, type StoredBundleDeployment, type StoredRow, type TableDefinition, type TableRow, type ToolingDatabase, type ToolingTarget, type UpdateSet, type VerifiedDatabaseAdapter, type VerifyAdapterOptions, WRITE_GUARD_TABLE, type WriteGuard, type WriteOp, type WriteResult, addDistinct, aggregateBatchingTables, assertStorageOperations, bundleToPatchRows, bundleToRow, canonicalizeAppVersion, compareUtf8, compileReleaseCatalog, coreSchema, coreSettings, coreTarget, countDistinct, createBundleSigningHandler, createBundleStorageKey, createEngine, createEngineDatabase, createEngineSqlMigrator, createKvAdapter, createMemoryAdapter, createSettingsMigrator, createSqlAdapter, createStorageAdapter, createStorageDownloadPath, createStorageDownloadUrl, createStorageKeyBuilder, createStorageRootUriWithPath, createStorageUri, createStorageUriWithRelativePath, createTableStatements, createUUIDv7, createUUIDv7After, createUUIDv7WithSameTimestamp, defineAggregate, definePlugin, defineTable, encodeKvKey, expiresAt, extractTimestampFromUUIDv7, filterCompatibleAppVersions, findPhysicalColumn, findPhysicalIndex, generateEngineSql, generateMinBundleId, getBundleArchiveStorageUri, getContentAddressedAssetStoragePath, getContentType, getManifestAssetDownloadPath, getManifestAssetStoragePath, indexOrderColumns, isBrotliManifestAssetPath, isContentAddressedAssetFileHash, isDatabaseBusyError, isDatabaseJsonObject, isDatabaseMetadataObject, isMultiIndex, isRemoteDatabase, isUUIDv7, mergeDistinct, meterReads, migrateCoreSchema, normalizeStoredRow, parseBaseCandidateKey, parseStorageDownloadPath, parseStorageUri, projectCompiledCatalog, projectCompiledRollbackCatalog, quoteSql, referenceCompatibleReleases, releaseRowToRelease, releaseToRow, remoteSigning, replaceStorageUriKeySuffix, resolveManifestAssetStorageFileHash, resolveManifestAssetStorageUri, rowKey, rowToBundle, rowsToBundles, semverSatisfies, sqlTableShapes, supportedIosPlatforms, targetBaseCandidateKey, toolingTargetOf, verifyAdapter, writeSchemaSettings };
|
package/dist/index.d.mts
CHANGED
|
@@ -3,19 +3,29 @@ import { createStorageUriWithRelativePath, getManifestAssetDownloadPath, getMani
|
|
|
3
3
|
import { CONTENT_ADDRESSED_ASSET_PREFIX, getContentAddressedAssetStoragePath, isContentAddressedAssetFileHash } from "./contentAddressedAssets.mjs";
|
|
4
4
|
import { getContentType } from "./contentType.mjs";
|
|
5
5
|
import { CatalogVersionBound, CompiledCatalogSegment, CompiledReleaseCatalog, ReleaseCatalogCompilation, ReleaseCatalogCompilationError, ReleaseCatalogCompilerDiagnostics, canonicalizeAppVersion, compileReleaseCatalog, projectCompiledCatalog, projectCompiledRollbackCatalog, referenceCompatibleReleases } from "./releaseCatalogCompiler.mjs";
|
|
6
|
+
import { BundlePatchRow, BundleRow, ChannelRow, DatabaseBundleMetadata, DatabaseJsonObject, DatabaseJsonValue, ReleaseCatalogRow, ReleaseRow } from "./types/databaseRows.mjs";
|
|
7
|
+
import { CoreReads, ReleaseCatalogRequest } from "./serverPlugin/coreReads.mjs";
|
|
8
|
+
import { DATABASE_VERSION_COLUMN, DatabaseAdapter, DatabaseJson, DatabaseKey, DatabaseKeyValue, DatabaseSchemaError, DatabaseValue, PhysicalColumn, PhysicalColumnType, PhysicalIndex, PhysicalRetention, PhysicalTable, QueryBound, QueryRequest, StoredRow, WriteGuard, WriteOp, WriteResult, expiresAt, findPhysicalColumn, findPhysicalIndex, indexOrderColumns, rowKey } from "./database/adapter.mjs";
|
|
9
|
+
import { FieldDefinition, FieldReference, FieldType, IndexDefinition, ReferenceAction } from "./serverPlugin/definitions.mjs";
|
|
10
|
+
import { AggregateDefinition, DerivedDefinition, DerivedFields, FieldValue, ModelDefinition, ModuleSchema, RetentionDefinition, RowOf, TableDefinition, defineAggregate, defineTable } from "./serverPlugin/schema.mjs";
|
|
11
|
+
import { AggregateChanges, AggregateIdentity, AggregateRow, CreateRow, EngineColumns, FindAggregatesModel, FindManyModel, HotUpdaterDatabase, HotUpdaterTransaction, KeyLookup, Lookup, Page, ReadOptions, ReadRow, TableRow, UpdateSet } from "./serverPlugin/databaseHandle.mjs";
|
|
12
|
+
import { AnyHotUpdaterPlugin, ClientAuth, CoreReader, HotUpdaterPlugin, PluginApis, PluginCli, PluginClientCredential, PluginClientPlugin, PluginContext, PluginEndpoint, PluginEndpointMethod, PluginInstance, PluginProvides, definePlugin } from "./serverPlugin/definePlugin.mjs";
|
|
13
|
+
import { ConstraintReason, DatabaseAmbiguousCommitError, DatabaseConflictError, DatabaseConstraintError, DatabaseCursorError, DatabaseQueryError, DatabaseTransactionError } from "./serverPlugin/errors.mjs";
|
|
14
|
+
import { ResolvedModel, ResolvedSchema } from "./engine/database/resolveSchema.mjs";
|
|
15
|
+
import { EngineReadCount } from "./engine/database/engineReads.mjs";
|
|
16
|
+
import { RetryOptions } from "./engine/database/engineTransaction.mjs";
|
|
6
17
|
import { AggregateBatching, ConfiguredDatabase, EngineDatabase, RemoteDatabase, isRemoteDatabase } from "./types/databaseConfig.mjs";
|
|
7
18
|
import { BuiltIns, HasMultipleCallSignatures, Primitive, RequiredDeep } from "./types/utils.mjs";
|
|
8
|
-
import { BundlePatchRow, BundleRow, ChannelRow, DatabaseBundleMetadata, DatabaseJsonObject, DatabaseJsonValue, ReleaseCatalogRow, ReleaseRow } from "./types/databaseRows.mjs";
|
|
9
19
|
import { BundleRowUpdate, ReleaseCatalogRowUpdate, ReleaseRowUpdate } from "./types/databaseOperations.mjs";
|
|
10
20
|
import { ChannelDeleteResult, ChannelInsertResult } from "./types/models.mjs";
|
|
11
|
-
import { ApplePlatform,
|
|
21
|
+
import { ApplePlatform, BuildAdapter, BuildAdapterArgs, BuildAdapterConfig, Bundle, BundleSigningAdapter, ConfigInput, FingerprintExtraSources, IosBuildDestination, LocalSigningConfig, NativeBuildAndroidScheme, NativeBuildArgs, NativeBuildIosScheme, NativeBuildOptions, Platform, PlatformConfig, SigningConfig, StorageAdapter, StorageDeleteInput, StorageDeleteResult, StorageExistsInput, StorageExistsResult, StorageGetDownloadUrlInput, StorageGetDownloadUrlResult, StorageGetInput, StorageGetResult, StorageObject, StoragePutInput, StoragePutResult, supportedIosPlatforms } from "./types/index.mjs";
|
|
12
22
|
import { ReleaseCatalogMutationError, ReleaseCatalogMutationPreflight, ReleaseCatalogMutationResult, ReleaseCatalogRebuildPreflight, ReleaseCatalogRebuildResult, ReleaseCatalogScope } from "./releaseCatalogMutation.mjs";
|
|
13
23
|
import { PromoteReleaseResult, ReleaseManagementError, ReleasePolicyPatch } from "./releaseManagement.mjs";
|
|
14
24
|
import { BundleDeployment, BundleDetail, DeployReleasePolicy, Deployment, HotUpdaterCoreApi, KeysetInput, ReleaseFilter, ReleaseTarget, StoredBundleDeployment } from "./coreApi.mjs";
|
|
15
|
-
import {
|
|
25
|
+
import { DatabaseAdapterInputError, DatabaseAdapterInputErrorCode, DatabaseBundleNotFoundError, DatabaseRowReferencedError } from "./databaseErrors.mjs";
|
|
16
26
|
import { createStorageKeyBuilder } from "./createStorageKeyBuilder.mjs";
|
|
17
|
-
import {
|
|
18
|
-
import { isDatabaseMetadataObject } from "./databaseJsonValue.mjs";
|
|
27
|
+
import { CreateStorageAdapterOptions, StorageAdapterWith, StorageOperation, assertStorageOperations, createStorageAdapter } from "./createStorageAdapter.mjs";
|
|
28
|
+
import { isDatabaseJsonObject, isDatabaseMetadataObject } from "./databaseJsonValue.mjs";
|
|
19
29
|
import { BundleRowHydrationError, BundleRowHydrationErrorReason, bundleToPatchRows, bundleToRow, releaseRowToRelease, releaseToRow, rowToBundle, rowsToBundles } from "./databaseRows.mjs";
|
|
20
30
|
import { filterCompatibleAppVersions } from "./filterCompatibleAppVersions.mjs";
|
|
21
31
|
import { generateMinBundleId } from "./generateMinBundleId.mjs";
|
|
@@ -24,4 +34,24 @@ import { BundleSigningHandlerOptions, REMOTE_BUNDLE_SIGNING_ALGORITHM, REMOTE_BU
|
|
|
24
34
|
import { semverSatisfies } from "./semverSatisfies.mjs";
|
|
25
35
|
import { createStorageDownloadPath, createStorageDownloadUrl, parseStorageDownloadPath } from "./storageDownloadPath.mjs";
|
|
26
36
|
import { createUUIDv7, createUUIDv7After, createUUIDv7WithSameTimestamp, extractTimestampFromUUIDv7, isUUIDv7 } from "./uuidv7.mjs";
|
|
27
|
-
|
|
37
|
+
import { isDatabaseBusyError } from "./serverPlugin/busy.mjs";
|
|
38
|
+
import { addDistinct, countDistinct, mergeDistinct } from "./database/distinct.mjs";
|
|
39
|
+
import { HotUpdaterConfigError } from "./serverPlugin/configError.mjs";
|
|
40
|
+
import { BaseCandidateQuery, BaseCandidateTarget, parseBaseCandidateKey, targetBaseCandidateKey } from "./baseCandidateKey.mjs";
|
|
41
|
+
import { MemoryAdapterOptions, createMemoryAdapter } from "./database/memoryAdapter.mjs";
|
|
42
|
+
import { NormalizeOptions, compareUtf8, normalizeStoredRow } from "./database/values.mjs";
|
|
43
|
+
import { DatabaseAdapterContractError, DatabaseReadCount, DatabaseReadMeter, VerifiedDatabaseAdapter, VerifyAdapterOptions, verifyAdapter } from "./database/verifyAdapter.mjs";
|
|
44
|
+
import { CoreSchema } from "./engine/core/schema.mjs";
|
|
45
|
+
import { HotUpdaterSchemaMigrationRequiredError, SETTINGS_TABLE, SchemaSettings } from "./engine/database/fence.mjs";
|
|
46
|
+
import { DatabaseTooling, MigrateOptions, MigrationResult, Migrator, SchemaGenerator, ToolingDatabase, ToolingTarget } from "./engine/db/types.mjs";
|
|
47
|
+
import { EngineDatabaseOptions, PluginTables, aggregateBatchingTables, coreSchema, coreSettings, coreTarget, createEngineDatabase, migrateCoreSchema, toolingTargetOf } from "./engine/db/coreDatabase.mjs";
|
|
48
|
+
import { Engine, EngineOptions, createEngine } from "./engine/createEngine.mjs";
|
|
49
|
+
import { KeyValueStore, KvAdapterOptions, KvCondition, KvItem, KvKey, KvOp, KvRange, createKvAdapter, encodeKvKey } from "./engine/database/kv/kvAdapter.mjs";
|
|
50
|
+
import { MeteredDatabase, ReadMeasurement, meterReads } from "./engine/database/readMeter.mjs";
|
|
51
|
+
import { SqlColumnShape, SqlDialect, SqlTableShape, createTableStatements, isMultiIndex, quoteSql, sqlTableShapes } from "./engine/database/sql/sqlSchema.mjs";
|
|
52
|
+
import { SqlAdapterOptions, SqlConnection, SqlExecutor, SqlResult, SqlStatement, WRITE_GUARD_TABLE, createSqlAdapter } from "./engine/database/sql/sqlAdapter.mjs";
|
|
53
|
+
import { EngineSqlOptions, generateEngineSql } from "./engine/db/engineSql.mjs";
|
|
54
|
+
import { EngineSqlMigratorOptions, createEngineSqlMigrator } from "./engine/db/engineSqlMigrator.mjs";
|
|
55
|
+
import { writeSchemaSettings } from "./engine/db/schemaSettings.mjs";
|
|
56
|
+
import { createSettingsMigrator } from "./engine/db/settingsMigrator.mjs";
|
|
57
|
+
export { type AggregateBatching, type AggregateChanges, type AggregateDefinition, type AggregateIdentity, type AggregateRow, type AnyHotUpdaterPlugin, ApplePlatform, BUNDLE_STORAGE_PREFIX, type BaseCandidateQuery, type BaseCandidateTarget, BuildAdapter, BuildAdapterArgs, BuildAdapterConfig, BuiltIns, type Bundle, type BundleDeployment, type BundleDetail, type BundlePatchRow, type BundleRow, BundleRowHydrationError, BundleRowHydrationErrorReason, type BundleRowUpdate, BundleSigningAdapter, BundleSigningHandlerOptions, CONTENT_ADDRESSED_ASSET_PREFIX, CatalogVersionBound, type ChannelDeleteResult, type ChannelInsertResult, type ChannelRow, type ClientAuth, CompiledCatalogSegment, CompiledReleaseCatalog, ConfigInput, type ConfiguredDatabase, type ConstraintReason, type CoreReader, type CoreReads, type CoreSchema, type CreateRow, CreateStorageAdapterOptions, CreateStorageUriInput, DATABASE_VERSION_COLUMN, type DatabaseAdapter, DatabaseAdapterContractError, DatabaseAdapterInputError, type DatabaseAdapterInputErrorCode, DatabaseAmbiguousCommitError, type DatabaseBundleMetadata, DatabaseBundleNotFoundError, DatabaseConflictError, DatabaseConstraintError, DatabaseCursorError, type DatabaseJson, type DatabaseJsonObject, type DatabaseJsonValue, type DatabaseKey, type DatabaseKeyValue, DatabaseQueryError, type DatabaseReadCount, type DatabaseReadMeter, DatabaseRowReferencedError, DatabaseSchemaError, type DatabaseTooling, DatabaseTransactionError, type DatabaseValue, type DeployReleasePolicy, type Deployment, type DerivedDefinition, type DerivedFields, type Engine, type EngineColumns, type EngineDatabase, type EngineDatabaseOptions, type EngineOptions, type EngineReadCount, type EngineSqlMigratorOptions, type EngineSqlOptions, type FieldDefinition, type FieldReference, type FieldType, type FieldValue, type FindAggregatesModel, type FindManyModel, FingerprintExtraSources, HasMultipleCallSignatures, HotUpdaterConfigError, type HotUpdaterCoreApi, type HotUpdaterDatabase, type HotUpdaterPlugin, HotUpdaterSchemaMigrationRequiredError, type HotUpdaterTransaction, type IndexDefinition, IosBuildDestination, type KeyLookup, type KeyValueStore, type KeysetInput, type KvAdapterOptions, type KvCondition, type KvItem, type KvKey, type KvOp, type KvRange, LocalSigningConfig, type Lookup, type MemoryAdapterOptions, type MeteredDatabase, type MigrateOptions, type MigrationResult, type Migrator, type ModelDefinition, type ModuleSchema, NativeBuildAndroidScheme, NativeBuildArgs, NativeBuildIosScheme, NativeBuildOptions, type NormalizeOptions, type Page, ParsedStorageUri, type PhysicalColumn, type PhysicalColumnType, type PhysicalIndex, type PhysicalRetention, type PhysicalTable, type Platform, PlatformConfig, type PluginApis, type PluginCli, type PluginClientCredential, type PluginClientPlugin, type PluginContext, type PluginEndpoint, type PluginEndpointMethod, type PluginInstance, type PluginProvides, type PluginTables, Primitive, PromoteReleaseResult, type QueryBound, type QueryRequest, REMOTE_BUNDLE_SIGNING_ALGORITHM, REMOTE_BUNDLE_SIGNING_PATH, REMOTE_BUNDLE_SIGNING_PROTOCOL_VERSION, REMOTE_BUNDLE_SIGNING_TOKEN_HEADER, type ReadMeasurement, type ReadOptions, type ReadRow, type ReferenceAction, ReleaseCatalogCompilation, ReleaseCatalogCompilationError, ReleaseCatalogCompilerDiagnostics, ReleaseCatalogMutationError, ReleaseCatalogMutationPreflight, ReleaseCatalogMutationResult, ReleaseCatalogRebuildPreflight, ReleaseCatalogRebuildResult, type ReleaseCatalogRequest, type ReleaseCatalogRow, type ReleaseCatalogRowUpdate, ReleaseCatalogScope, type ReleaseFilter, ReleaseManagementError, ReleasePolicyPatch, type ReleaseRow, type ReleaseRowUpdate, type ReleaseTarget, type RemoteDatabase, RemoteSigningOptions, RequiredDeep, type ResolvedModel, type ResolvedSchema, type RetentionDefinition, type RetryOptions, type RowOf, SETTINGS_TABLE, type SchemaGenerator, type SchemaSettings, SigningConfig, type SqlAdapterOptions, type SqlColumnShape, type SqlConnection, type SqlDialect, type SqlExecutor, type SqlResult, type SqlStatement, type SqlTableShape, StorageAdapter, StorageAdapterWith, StorageDeleteInput, StorageDeleteResult, StorageExistsInput, StorageExistsResult, StorageGetDownloadUrlInput, StorageGetDownloadUrlResult, StorageGetInput, StorageGetResult, StorageObject, StorageOperation, StoragePutInput, StoragePutResult, type StoredBundleDeployment, type StoredRow, type TableDefinition, type TableRow, type ToolingDatabase, type ToolingTarget, type UpdateSet, type VerifiedDatabaseAdapter, type VerifyAdapterOptions, WRITE_GUARD_TABLE, type WriteGuard, type WriteOp, type WriteResult, addDistinct, aggregateBatchingTables, assertStorageOperations, bundleToPatchRows, bundleToRow, canonicalizeAppVersion, compareUtf8, compileReleaseCatalog, coreSchema, coreSettings, coreTarget, countDistinct, createBundleSigningHandler, createBundleStorageKey, createEngine, createEngineDatabase, createEngineSqlMigrator, createKvAdapter, createMemoryAdapter, createSettingsMigrator, createSqlAdapter, createStorageAdapter, createStorageDownloadPath, createStorageDownloadUrl, createStorageKeyBuilder, createStorageRootUriWithPath, createStorageUri, createStorageUriWithRelativePath, createTableStatements, createUUIDv7, createUUIDv7After, createUUIDv7WithSameTimestamp, defineAggregate, definePlugin, defineTable, encodeKvKey, expiresAt, extractTimestampFromUUIDv7, filterCompatibleAppVersions, findPhysicalColumn, findPhysicalIndex, generateEngineSql, generateMinBundleId, getBundleArchiveStorageUri, getContentAddressedAssetStoragePath, getContentType, getManifestAssetDownloadPath, getManifestAssetStoragePath, indexOrderColumns, isBrotliManifestAssetPath, isContentAddressedAssetFileHash, isDatabaseBusyError, isDatabaseJsonObject, isDatabaseMetadataObject, isMultiIndex, isRemoteDatabase, isUUIDv7, mergeDistinct, meterReads, migrateCoreSchema, normalizeStoredRow, parseBaseCandidateKey, parseStorageDownloadPath, parseStorageUri, projectCompiledCatalog, projectCompiledRollbackCatalog, quoteSql, referenceCompatibleReleases, releaseRowToRelease, releaseToRow, remoteSigning, replaceStorageUriKeySuffix, resolveManifestAssetStorageFileHash, resolveManifestAssetStorageUri, rowKey, rowToBundle, rowsToBundles, semverSatisfies, sqlTableShapes, supportedIosPlatforms, targetBaseCandidateKey, toolingTargetOf, verifyAdapter, writeSchemaSettings };
|
package/dist/index.mjs
CHANGED
|
@@ -4,9 +4,9 @@ import { createStorageUri, parseStorageUri } from "./parseStorageUri.mjs";
|
|
|
4
4
|
import { createStorageUriWithRelativePath, getManifestAssetDownloadPath, getManifestAssetStoragePath, isBrotliManifestAssetPath, replaceStorageUriKeySuffix, resolveManifestAssetStorageFileHash, resolveManifestAssetStorageUri } from "./assetStorageLayout.mjs";
|
|
5
5
|
import { BUNDLE_STORAGE_PREFIX, createBundleStorageKey, createStorageRootUriWithPath, getBundleArchiveStorageUri } from "./bundleStorageLayout.mjs";
|
|
6
6
|
import { getContentType } from "./contentType.mjs";
|
|
7
|
-
import {
|
|
8
|
-
import { assertStorageOperations,
|
|
9
|
-
import { isDatabaseMetadataObject } from "./databaseJsonValue.mjs";
|
|
7
|
+
import { DatabaseAdapterInputError, DatabaseBundleNotFoundError, DatabaseRowReferencedError } from "./databaseErrors.mjs";
|
|
8
|
+
import { assertStorageOperations, createStorageAdapter } from "./createStorageAdapter.mjs";
|
|
9
|
+
import { isDatabaseJsonObject, isDatabaseMetadataObject } from "./databaseJsonValue.mjs";
|
|
10
10
|
import { BundleRowHydrationError, BundleRowHydrationErrorReason, bundleToPatchRows, bundleToRow, releaseRowToRelease, releaseToRow, rowToBundle, rowsToBundles } from "./databaseRows.mjs";
|
|
11
11
|
import { semverSatisfies } from "./semverSatisfies.mjs";
|
|
12
12
|
import { filterCompatibleAppVersions } from "./filterCompatibleAppVersions.mjs";
|
|
@@ -19,4 +19,26 @@ import { REMOTE_BUNDLE_SIGNING_ALGORITHM, REMOTE_BUNDLE_SIGNING_PATH, REMOTE_BUN
|
|
|
19
19
|
import { createStorageDownloadPath, createStorageDownloadUrl, parseStorageDownloadPath } from "./storageDownloadPath.mjs";
|
|
20
20
|
import { isRemoteDatabase } from "./types/databaseConfig.mjs";
|
|
21
21
|
import { supportedIosPlatforms } from "./types/index.mjs";
|
|
22
|
-
|
|
22
|
+
import { definePlugin } from "./serverPlugin/definePlugin.mjs";
|
|
23
|
+
import { defineAggregate, defineTable } from "./serverPlugin/schema.mjs";
|
|
24
|
+
import { DatabaseAmbiguousCommitError, DatabaseConflictError, DatabaseConstraintError, DatabaseCursorError, DatabaseQueryError, DatabaseTransactionError } from "./serverPlugin/errors.mjs";
|
|
25
|
+
import { isDatabaseBusyError } from "./serverPlugin/busy.mjs";
|
|
26
|
+
import { addDistinct, countDistinct, mergeDistinct } from "./database/distinct.mjs";
|
|
27
|
+
import { HotUpdaterConfigError } from "./serverPlugin/configError.mjs";
|
|
28
|
+
import { parseBaseCandidateKey, targetBaseCandidateKey } from "./baseCandidateKey.mjs";
|
|
29
|
+
import { DATABASE_VERSION_COLUMN, DatabaseSchemaError, expiresAt, findPhysicalColumn, findPhysicalIndex, indexOrderColumns, rowKey } from "./database/adapter.mjs";
|
|
30
|
+
import { compareUtf8, normalizeStoredRow } from "./database/values.mjs";
|
|
31
|
+
import { createMemoryAdapter } from "./database/memoryAdapter.mjs";
|
|
32
|
+
import { DatabaseAdapterContractError, verifyAdapter } from "./database/verifyAdapter.mjs";
|
|
33
|
+
import { HotUpdaterSchemaMigrationRequiredError, SETTINGS_TABLE } from "./engine/database/fence.mjs";
|
|
34
|
+
import { meterReads } from "./engine/database/readMeter.mjs";
|
|
35
|
+
import { writeSchemaSettings } from "./engine/db/schemaSettings.mjs";
|
|
36
|
+
import { createTableStatements, isMultiIndex, quoteSql, sqlTableShapes } from "./engine/database/sql/sqlSchema.mjs";
|
|
37
|
+
import { generateEngineSql } from "./engine/db/engineSql.mjs";
|
|
38
|
+
import { createSettingsMigrator } from "./engine/db/settingsMigrator.mjs";
|
|
39
|
+
import { aggregateBatchingTables, coreSchema, coreSettings, coreTarget, createEngineDatabase, migrateCoreSchema, toolingTargetOf } from "./engine/db/coreDatabase.mjs";
|
|
40
|
+
import { createEngine } from "./engine/createEngine.mjs";
|
|
41
|
+
import { createKvAdapter, encodeKvKey } from "./engine/database/kv/kvAdapter.mjs";
|
|
42
|
+
import { WRITE_GUARD_TABLE, createSqlAdapter } from "./engine/database/sql/sqlAdapter.mjs";
|
|
43
|
+
import { createEngineSqlMigrator } from "./engine/db/engineSqlMigrator.mjs";
|
|
44
|
+
export { BUNDLE_STORAGE_PREFIX, BundleRowHydrationError, BundleRowHydrationErrorReason, CONTENT_ADDRESSED_ASSET_PREFIX, DATABASE_VERSION_COLUMN, DatabaseAdapterContractError, DatabaseAdapterInputError, DatabaseAmbiguousCommitError, DatabaseBundleNotFoundError, DatabaseConflictError, DatabaseConstraintError, DatabaseCursorError, DatabaseQueryError, DatabaseRowReferencedError, DatabaseSchemaError, DatabaseTransactionError, HotUpdaterConfigError, HotUpdaterSchemaMigrationRequiredError, REMOTE_BUNDLE_SIGNING_ALGORITHM, REMOTE_BUNDLE_SIGNING_PATH, REMOTE_BUNDLE_SIGNING_PROTOCOL_VERSION, REMOTE_BUNDLE_SIGNING_TOKEN_HEADER, ReleaseCatalogCompilationError, ReleaseCatalogMutationError, ReleaseManagementError, SETTINGS_TABLE, WRITE_GUARD_TABLE, addDistinct, aggregateBatchingTables, assertStorageOperations, bundleToPatchRows, bundleToRow, canonicalizeAppVersion, compareUtf8, compileReleaseCatalog, coreSchema, coreSettings, coreTarget, countDistinct, createBundleSigningHandler, createBundleStorageKey, createEngine, createEngineDatabase, createEngineSqlMigrator, createKvAdapter, createMemoryAdapter, createSettingsMigrator, createSqlAdapter, createStorageAdapter, createStorageDownloadPath, createStorageDownloadUrl, createStorageKeyBuilder, createStorageRootUriWithPath, createStorageUri, createStorageUriWithRelativePath, createTableStatements, createUUIDv7, createUUIDv7After, createUUIDv7WithSameTimestamp, defineAggregate, definePlugin, defineTable, encodeKvKey, expiresAt, extractTimestampFromUUIDv7, filterCompatibleAppVersions, findPhysicalColumn, findPhysicalIndex, generateEngineSql, generateMinBundleId, getBundleArchiveStorageUri, getContentAddressedAssetStoragePath, getContentType, getManifestAssetDownloadPath, getManifestAssetStoragePath, indexOrderColumns, isBrotliManifestAssetPath, isContentAddressedAssetFileHash, isDatabaseBusyError, isDatabaseJsonObject, isDatabaseMetadataObject, isMultiIndex, isRemoteDatabase, isUUIDv7, mergeDistinct, meterReads, migrateCoreSchema, normalizeStoredRow, parseBaseCandidateKey, parseStorageDownloadPath, parseStorageUri, projectCompiledCatalog, projectCompiledRollbackCatalog, quoteSql, referenceCompatibleReleases, releaseRowToRelease, releaseToRow, remoteSigning, replaceStorageUriKeySuffix, resolveManifestAssetStorageFileHash, resolveManifestAssetStorageUri, rowKey, rowToBundle, rowsToBundles, semverSatisfies, sqlTableShapes, supportedIosPlatforms, targetBaseCandidateKey, toolingTargetOf, verifyAdapter, writeSchemaSettings };
|
package/dist/node_modules/.pnpm/verkit@0.4.0/node_modules/verkit/dist/comparison-DenM3wCn.cjs
CHANGED
|
@@ -42,10 +42,6 @@ function formatComparableVersion(version) {
|
|
|
42
42
|
const base = `${version.major}.${version.minor}.${version.patch}`;
|
|
43
43
|
return version.prerelease?.length ? `${base}-${version.prerelease.join(".")}` : base;
|
|
44
44
|
}
|
|
45
|
-
function formatFullVersion(version) {
|
|
46
|
-
const comparable = formatComparableVersion(version);
|
|
47
|
-
return version.build?.length ? `${comparable}+${version.build.join(".")}` : comparable;
|
|
48
|
-
}
|
|
49
45
|
function parse(version, options = {}) {
|
|
50
46
|
if (typeof version !== "string") return version;
|
|
51
47
|
if (version.length > 256) throw new TypeError(`Version exceeds the maximum length of 256 characters`);
|
|
@@ -126,7 +122,6 @@ exports.S = tryParse;
|
|
|
126
122
|
exports.T = COERCE_FULL;
|
|
127
123
|
exports._ = compareIdentifiers;
|
|
128
124
|
exports.a = compareParsed;
|
|
129
|
-
exports.b = formatFullVersion;
|
|
130
125
|
exports.i = compareMainParsed;
|
|
131
126
|
exports.j = PRERELEASE;
|
|
132
127
|
exports.k = LONE_TILDE;
|
package/dist/node_modules/.pnpm/verkit@0.4.0/node_modules/verkit/dist/comparison-DenM3wCn.mjs
CHANGED
|
@@ -42,10 +42,6 @@ function formatComparableVersion(version) {
|
|
|
42
42
|
const base = `${version.major}.${version.minor}.${version.patch}`;
|
|
43
43
|
return version.prerelease?.length ? `${base}-${version.prerelease.join(".")}` : base;
|
|
44
44
|
}
|
|
45
|
-
function formatFullVersion(version) {
|
|
46
|
-
const comparable = formatComparableVersion(version);
|
|
47
|
-
return version.build?.length ? `${comparable}+${version.build.join(".")}` : comparable;
|
|
48
|
-
}
|
|
49
45
|
function parse(version, options = {}) {
|
|
50
46
|
if (typeof version !== "string") return version;
|
|
51
47
|
if (version.length > 256) throw new TypeError(`Version exceeds the maximum length of 256 characters`);
|
|
@@ -113,4 +109,4 @@ function compare(left, right, options = {}) {
|
|
|
113
109
|
return compareParsed(parse(left, options), parse(right, options));
|
|
114
110
|
}
|
|
115
111
|
//#endregion
|
|
116
|
-
export { LOOSE_PLAIN as A, BUILD as C, GREATER_LESS_THAN as D, FULL_PLAIN as E, safeRegex as F, PRERELEASE_LOOSE as M, XRANGE_PLAIN as N, LONE_CARET as O, XRANGE_PLAIN_LOOSE as P, tryParse as S, COERCE_FULL as T, compareIdentifiers as _, compareParsed as a,
|
|
112
|
+
export { LOOSE_PLAIN as A, BUILD as C, GREATER_LESS_THAN as D, FULL_PLAIN as E, safeRegex as F, PRERELEASE_LOOSE as M, XRANGE_PLAIN as N, LONE_CARET as O, XRANGE_PLAIN_LOOSE as P, tryParse as S, COERCE_FULL as T, compareIdentifiers as _, compareParsed as a, compareMainParsed as i, PRERELEASE as j, LONE_TILDE as k, compare as t, COERCE as w, parse as x, formatComparableVersion as y };
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
const require_comparison_DenM3wCn = require("./comparison-DenM3wCn.cjs");
|
|
2
2
|
const require_set_CC5YeoYX = require("./set-CC5YeoYX.cjs");
|
|
3
3
|
//#region ../../node_modules/.pnpm/verkit@0.4.0/node_modules/verkit/dist/range-DvX-Y6iv.js
|
|
4
|
+
function formatRange(range) {
|
|
5
|
+
return range.sets.map((set) => set.map(require_set_CC5YeoYX.o).join(" ")).join("||");
|
|
6
|
+
}
|
|
4
7
|
const BUILD_STRIP = new RegExp(require_comparison_DenM3wCn.C, "g");
|
|
5
8
|
const BUILD_SAFE = require_comparison_DenM3wCn.F(require_comparison_DenM3wCn.C);
|
|
6
9
|
const STRICT_HYPHEN = require_comparison_DenM3wCn.F(String.raw`^\s*(${require_comparison_DenM3wCn.N})\s+-\s+(${require_comparison_DenM3wCn.N})\s*$`);
|
|
@@ -157,6 +160,10 @@ function testRangeVersion(range, version) {
|
|
|
157
160
|
const parsed = require_comparison_DenM3wCn.S(version, range.options);
|
|
158
161
|
return parsed ? testParsedRange(range, parsed) : false;
|
|
159
162
|
}
|
|
163
|
+
function normalizeRange(range, options = {}) {
|
|
164
|
+
const parsed = tryParseRange(range, options);
|
|
165
|
+
return parsed ? formatRange(parsed) || "*" : null;
|
|
166
|
+
}
|
|
160
167
|
function satisfies(version, range, options = {}) {
|
|
161
168
|
const parsed = tryParseRange(range, options);
|
|
162
169
|
return parsed ? testRangeVersion(parsed, version) : false;
|
|
@@ -164,4 +171,5 @@ function satisfies(version, range, options = {}) {
|
|
|
164
171
|
//#endregion
|
|
165
172
|
exports.f = satisfies;
|
|
166
173
|
exports.h = tryParseRange;
|
|
174
|
+
exports.l = normalizeRange;
|
|
167
175
|
exports.m = parseRange;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { A as LOOSE_PLAIN, C as BUILD, D as GREATER_LESS_THAN, F as safeRegex, N as XRANGE_PLAIN, O as LONE_CARET, P as XRANGE_PLAIN_LOOSE, S as tryParse, k as LONE_TILDE } from "./comparison-DenM3wCn.mjs";
|
|
2
|
-
import { r as testComparatorSet, s as parseComparator } from "./set-CC5YeoYX.mjs";
|
|
2
|
+
import { o as formatComparator, r as testComparatorSet, s as parseComparator } from "./set-CC5YeoYX.mjs";
|
|
3
3
|
//#region ../../node_modules/.pnpm/verkit@0.4.0/node_modules/verkit/dist/range-DvX-Y6iv.js
|
|
4
|
+
function formatRange(range) {
|
|
5
|
+
return range.sets.map((set) => set.map(formatComparator).join(" ")).join("||");
|
|
6
|
+
}
|
|
4
7
|
const BUILD_STRIP = new RegExp(BUILD, "g");
|
|
5
8
|
const BUILD_SAFE = safeRegex(BUILD);
|
|
6
9
|
const STRICT_HYPHEN = safeRegex(String.raw`^\s*(${XRANGE_PLAIN})\s+-\s+(${XRANGE_PLAIN})\s*$`);
|
|
@@ -157,9 +160,13 @@ function testRangeVersion(range, version) {
|
|
|
157
160
|
const parsed = tryParse(version, range.options);
|
|
158
161
|
return parsed ? testParsedRange(range, parsed) : false;
|
|
159
162
|
}
|
|
163
|
+
function normalizeRange(range, options = {}) {
|
|
164
|
+
const parsed = tryParseRange(range, options);
|
|
165
|
+
return parsed ? formatRange(parsed) || "*" : null;
|
|
166
|
+
}
|
|
160
167
|
function satisfies(version, range, options = {}) {
|
|
161
168
|
const parsed = tryParseRange(range, options);
|
|
162
169
|
return parsed ? testRangeVersion(parsed, version) : false;
|
|
163
170
|
}
|
|
164
171
|
//#endregion
|
|
165
|
-
export { satisfies as f, tryParseRange as h, parseRange as m };
|
|
172
|
+
export { satisfies as f, tryParseRange as h, normalizeRange as l, parseRange as m };
|
|
@@ -2,6 +2,9 @@ const require_comparison_DenM3wCn = require("./comparison-DenM3wCn.cjs");
|
|
|
2
2
|
//#region ../../node_modules/.pnpm/verkit@0.4.0/node_modules/verkit/dist/set-CC5YeoYX.js
|
|
3
3
|
const STRICT_COMPARATOR = require_comparison_DenM3wCn.F(String.raw`^${require_comparison_DenM3wCn.D}\s*(${require_comparison_DenM3wCn.E})$|^$`);
|
|
4
4
|
const LOOSE_COMPARATOR = require_comparison_DenM3wCn.F(String.raw`^${require_comparison_DenM3wCn.D}\s*(${require_comparison_DenM3wCn.A})$|^$`);
|
|
5
|
+
function formatComparator(comparator) {
|
|
6
|
+
return comparator.version ? `${comparator.operator}${require_comparison_DenM3wCn.y(comparator.version)}` : "";
|
|
7
|
+
}
|
|
5
8
|
function parseComparator(comparator, options = {}) {
|
|
6
9
|
if (typeof comparator !== "string") return comparator;
|
|
7
10
|
const normalized = comparator.trim().replaceAll(/\s+/g, " ");
|
|
@@ -37,6 +40,7 @@ function testComparatorSet(set, version, options) {
|
|
|
37
40
|
}
|
|
38
41
|
//#endregion
|
|
39
42
|
exports.a = testParsedComparator;
|
|
43
|
+
exports.o = formatComparator;
|
|
40
44
|
exports.r = testComparatorSet;
|
|
41
45
|
exports.s = parseComparator;
|
|
42
46
|
exports.t = comparatorAllowsPrerelease;
|
|
@@ -2,6 +2,9 @@ import { A as LOOSE_PLAIN, D as GREATER_LESS_THAN, E as FULL_PLAIN, F as safeReg
|
|
|
2
2
|
//#region ../../node_modules/.pnpm/verkit@0.4.0/node_modules/verkit/dist/set-CC5YeoYX.js
|
|
3
3
|
const STRICT_COMPARATOR = safeRegex(String.raw`^${GREATER_LESS_THAN}\s*(${FULL_PLAIN})$|^$`);
|
|
4
4
|
const LOOSE_COMPARATOR = safeRegex(String.raw`^${GREATER_LESS_THAN}\s*(${LOOSE_PLAIN})$|^$`);
|
|
5
|
+
function formatComparator(comparator) {
|
|
6
|
+
return comparator.version ? `${comparator.operator}${formatComparableVersion(comparator.version)}` : "";
|
|
7
|
+
}
|
|
5
8
|
function parseComparator(comparator, options = {}) {
|
|
6
9
|
if (typeof comparator !== "string") return comparator;
|
|
7
10
|
const normalized = comparator.trim().replaceAll(/\s+/g, " ");
|
|
@@ -36,4 +39,4 @@ function testComparatorSet(set, version, options) {
|
|
|
36
39
|
return !version.prerelease?.length || !!options.includePrerelease || set.some((comparator) => comparatorAllowsPrerelease(comparator, version));
|
|
37
40
|
}
|
|
38
41
|
//#endregion
|
|
39
|
-
export { testParsedComparator as a, testComparatorSet as r, parseComparator as s, comparatorAllowsPrerelease as t };
|
|
42
|
+
export { testParsedComparator as a, formatComparator as o, testComparatorSet as r, parseComparator as s, comparatorAllowsPrerelease as t };
|
|
@@ -4,10 +4,6 @@ const COERCE_EXACT = require_comparison_DenM3wCn.F(require_comparison_DenM3wCn.w
|
|
|
4
4
|
const COERCE_FULL_EXACT = require_comparison_DenM3wCn.F(require_comparison_DenM3wCn.T);
|
|
5
5
|
require_comparison_DenM3wCn.F(`^${require_comparison_DenM3wCn.j}$`);
|
|
6
6
|
require_comparison_DenM3wCn.F(`^${require_comparison_DenM3wCn.M}$`);
|
|
7
|
-
function normalizeFull(version, options = {}) {
|
|
8
|
-
const parsed = require_comparison_DenM3wCn.S(version, options);
|
|
9
|
-
return parsed ? require_comparison_DenM3wCn.b(parsed) : null;
|
|
10
|
-
}
|
|
11
7
|
function normalize(version, options = {}) {
|
|
12
8
|
const parsed = require_comparison_DenM3wCn.S(version, options);
|
|
13
9
|
return parsed ? require_comparison_DenM3wCn.y(parsed) : null;
|
|
@@ -34,6 +30,5 @@ function coerce(value, options = {}) {
|
|
|
34
30
|
return require_comparison_DenM3wCn.S(`${major}.${minor}.${patch}${prerelease}${build}`, options);
|
|
35
31
|
}
|
|
36
32
|
//#endregion
|
|
37
|
-
exports.m = normalizeFull;
|
|
38
33
|
exports.n = coerce;
|
|
39
34
|
exports.p = normalize;
|
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
import { F as safeRegex, M as PRERELEASE_LOOSE, S as tryParse, T as COERCE_FULL,
|
|
1
|
+
import { F as safeRegex, M as PRERELEASE_LOOSE, S as tryParse, T as COERCE_FULL, j as PRERELEASE, w as COERCE, y as formatComparableVersion } from "./comparison-DenM3wCn.mjs";
|
|
2
2
|
//#region ../../node_modules/.pnpm/verkit@0.4.0/node_modules/verkit/dist/version-CQ98ZBpL.js
|
|
3
3
|
const COERCE_EXACT = safeRegex(COERCE);
|
|
4
4
|
const COERCE_FULL_EXACT = safeRegex(COERCE_FULL);
|
|
5
5
|
safeRegex(`^${PRERELEASE}$`);
|
|
6
6
|
safeRegex(`^${PRERELEASE_LOOSE}$`);
|
|
7
|
-
function normalizeFull(version, options = {}) {
|
|
8
|
-
const parsed = tryParse(version, options);
|
|
9
|
-
return parsed ? formatFullVersion(parsed) : null;
|
|
10
|
-
}
|
|
11
7
|
function normalize(version, options = {}) {
|
|
12
8
|
const parsed = tryParse(version, options);
|
|
13
9
|
return parsed ? formatComparableVersion(parsed) : null;
|
|
@@ -34,4 +30,4 @@ function coerce(value, options = {}) {
|
|
|
34
30
|
return tryParse(`${major}.${minor}.${patch}${prerelease}${build}`, options);
|
|
35
31
|
}
|
|
36
32
|
//#endregion
|
|
37
|
-
export {
|
|
33
|
+
export { coerce as n, normalize as p };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const require_comparison_DenM3wCn = require("./node_modules/.pnpm/verkit@0.4.0/node_modules/verkit/dist/comparison-DenM3wCn.cjs");
|
|
2
2
|
const require_range_DvX_Y6iv = require("./node_modules/.pnpm/verkit@0.4.0/node_modules/verkit/dist/range-DvX-Y6iv.cjs");
|
|
3
3
|
const require_version_CQ98ZBpL = require("./node_modules/.pnpm/verkit@0.4.0/node_modules/verkit/dist/version-CQ98ZBpL.cjs");
|
|
4
|
-
let
|
|
4
|
+
let _hot_updater_protocol = require("@hot-updater/protocol");
|
|
5
5
|
//#region src/releaseCatalogCompiler.ts
|
|
6
6
|
var ReleaseCatalogCompilationError = class extends Error {
|
|
7
7
|
code;
|
|
@@ -105,19 +105,19 @@ function validateReleases(releases, strategy) {
|
|
|
105
105
|
const enabled = releases.filter((release) => release.enabled).sort((left, right) => right.id.localeCompare(left.id));
|
|
106
106
|
const seenIds = /* @__PURE__ */ new Set();
|
|
107
107
|
for (const release of enabled) {
|
|
108
|
-
if (!(0,
|
|
108
|
+
if (!(0, _hot_updater_protocol.isUUIDv7)(release.id)) throw new ReleaseCatalogCompilationError("INVALID_RELEASE", `Release ${release.id} must use a canonical lowercase UUIDv7 ID`);
|
|
109
109
|
if (seenIds.has(release.id)) throw new ReleaseCatalogCompilationError("INVALID_RELEASE", `Duplicate Release ID: ${release.id}`);
|
|
110
110
|
seenIds.add(release.id);
|
|
111
111
|
if (release.strategy !== strategy) throw new ReleaseCatalogCompilationError("INVALID_RELEASE", `Release ${release.id} has the wrong strategy`);
|
|
112
112
|
if (release.kind === "BUNDLE" && release.bundleId === null || release.kind === "EMBEDDED" && release.bundleId !== null) throw new ReleaseCatalogCompilationError("INVALID_RELEASE", `Release ${release.id} has an invalid kind/Bundle combination`);
|
|
113
|
-
if (release.targetCohorts.length >
|
|
113
|
+
if (release.targetCohorts.length > _hot_updater_protocol.MAX_TARGET_COHORTS_PER_RELEASE) throw new ReleaseCatalogCompilationError("TARGET_COHORT_LIMIT", `Release ${release.id} exceeds ${_hot_updater_protocol.MAX_TARGET_COHORTS_PER_RELEASE} target cohorts`);
|
|
114
114
|
if (strategy === "APP_VERSION" && (release.targetAppVersion === null || release.fingerprintHash !== null)) throw new ReleaseCatalogCompilationError("INVALID_RELEASE", `Release ${release.id} has an invalid app-version target`);
|
|
115
115
|
if (strategy === "FINGERPRINT" && (release.fingerprintHash === null || release.targetAppVersion !== null)) throw new ReleaseCatalogCompilationError("INVALID_RELEASE", `Release ${release.id} has an invalid fingerprint target`);
|
|
116
116
|
}
|
|
117
117
|
return enabled.filter((release) => release.kind === "BUNDLE");
|
|
118
118
|
}
|
|
119
119
|
function collectFrontierReleaseIds(releases) {
|
|
120
|
-
if (releases.every((release) => (0,
|
|
120
|
+
if (releases.every((release) => (0, _hot_updater_protocol.normalizeRolloutCohortCount)(release.rolloutCohortCount) >= _hot_updater_protocol.NUMERIC_COHORT_SIZE)) {
|
|
121
121
|
const retained = /* @__PURE__ */ new Set();
|
|
122
122
|
const bundleIds = /* @__PURE__ */ new Set();
|
|
123
123
|
let embedded = false;
|
|
@@ -142,11 +142,11 @@ function collectFrontierReleaseIds(releases) {
|
|
|
142
142
|
...[...explicitTargetCohorts].sort(),
|
|
143
143
|
"release-catalog-non-targeted-cohort"
|
|
144
144
|
].map((cohort) => {
|
|
145
|
-
const normalized = cohort === void 0 ? void 0 : (0,
|
|
145
|
+
const normalized = cohort === void 0 ? void 0 : (0, _hot_updater_protocol.normalizeCohortValue)(cohort);
|
|
146
146
|
return {
|
|
147
|
-
isCustom: normalized !== void 0 && (0,
|
|
147
|
+
isCustom: normalized !== void 0 && (0, _hot_updater_protocol.isCustomCohort)(normalized),
|
|
148
148
|
normalized,
|
|
149
|
-
numeric: normalized === void 0 ? null : (0,
|
|
149
|
+
numeric: normalized === void 0 ? null : (0, _hot_updater_protocol.getNumericCohortValue)(normalized),
|
|
150
150
|
bundleIds: /* @__PURE__ */ new Set(),
|
|
151
151
|
embedded: false,
|
|
152
152
|
complete: false
|
|
@@ -165,11 +165,11 @@ function collectFrontierReleaseIds(releases) {
|
|
|
165
165
|
const retained = /* @__PURE__ */ new Set();
|
|
166
166
|
let incompleteStateCount = cohortStates.length;
|
|
167
167
|
for (const release of releases) {
|
|
168
|
-
const rolloutCohortCount = (0,
|
|
168
|
+
const rolloutCohortCount = (0, _hot_updater_protocol.normalizeRolloutCohortCount)(release.rolloutCohortCount);
|
|
169
169
|
const eligibleStateIndexes = /* @__PURE__ */ new Set();
|
|
170
|
-
if (rolloutCohortCount >=
|
|
171
|
-
else if (rolloutCohortCount > 0) for (const numericCohort of (0,
|
|
172
|
-
for (const targetCohort of new Set(release.targetCohorts.map(
|
|
170
|
+
if (rolloutCohortCount >= _hot_updater_protocol.NUMERIC_COHORT_SIZE) for (const index of fullRolloutStateIndexes) eligibleStateIndexes.add(index);
|
|
171
|
+
else if (rolloutCohortCount > 0) for (const numericCohort of (0, _hot_updater_protocol.getRolledOutNumericCohorts)(release.id, rolloutCohortCount)) for (const index of stateIndexesByCohort.get(String(numericCohort)) ?? []) eligibleStateIndexes.add(index);
|
|
172
|
+
for (const targetCohort of new Set(release.targetCohorts.map(_hot_updater_protocol.normalizeCohortValue))) for (const index of stateIndexesByCohort.get(targetCohort) ?? []) eligibleStateIndexes.add(index);
|
|
173
173
|
for (const index of eligibleStateIndexes) {
|
|
174
174
|
const state = cohortStates[index];
|
|
175
175
|
if (state.complete) continue;
|
|
@@ -286,8 +286,8 @@ function compileAppVersion(releases) {
|
|
|
286
286
|
}))).filter((segment) => segment.releaseIndexes.length > 0 || segment.rollbackReleaseIndexes.length > 0);
|
|
287
287
|
return {
|
|
288
288
|
envelope: {
|
|
289
|
-
fallbackPolicy:
|
|
290
|
-
schemaVersion:
|
|
289
|
+
fallbackPolicy: _hot_updater_protocol.RELEASE_CATALOG_FALLBACK_POLICY,
|
|
290
|
+
schemaVersion: _hot_updater_protocol.RELEASE_CATALOG_SCHEMA_VERSION,
|
|
291
291
|
segments,
|
|
292
292
|
strategy: "APP_VERSION"
|
|
293
293
|
},
|
|
@@ -299,10 +299,10 @@ function compileFingerprint(releases) {
|
|
|
299
299
|
const retainedReleases = releases;
|
|
300
300
|
return {
|
|
301
301
|
envelope: {
|
|
302
|
-
fallbackPolicy:
|
|
302
|
+
fallbackPolicy: _hot_updater_protocol.RELEASE_CATALOG_FALLBACK_POLICY,
|
|
303
303
|
releaseIndexes: retainedReleases.map((release, index) => retainedIds.has(release.id) ? index : -1).filter((index) => index >= 0),
|
|
304
304
|
rollbackReleaseIndexes: retainedReleases.map((_, index) => index),
|
|
305
|
-
schemaVersion:
|
|
305
|
+
schemaVersion: _hot_updater_protocol.RELEASE_CATALOG_SCHEMA_VERSION,
|
|
306
306
|
strategy: "FINGERPRINT"
|
|
307
307
|
},
|
|
308
308
|
retainedReleases
|
|
@@ -321,7 +321,7 @@ function canonicalStringify(value) {
|
|
|
321
321
|
async function compileReleaseCatalog(input) {
|
|
322
322
|
const releases = validateReleases(input.releases, input.strategy);
|
|
323
323
|
const targetCohorts = new Set(releases.flatMap((release) => release.targetCohorts));
|
|
324
|
-
if (targetCohorts.size >
|
|
324
|
+
if (targetCohorts.size > _hot_updater_protocol.MAX_DISTINCT_TARGET_COHORTS_PER_SCOPE) throw new ReleaseCatalogCompilationError("DISTINCT_TARGET_COHORT_LIMIT", `Scope exceeds ${_hot_updater_protocol.MAX_DISTINCT_TARGET_COHORTS_PER_SCOPE} distinct target cohorts`);
|
|
325
325
|
const { envelope, retainedReleases } = input.strategy === "APP_VERSION" ? compileAppVersion(releases) : compileFingerprint(releases);
|
|
326
326
|
const payload = {
|
|
327
327
|
...envelope,
|
|
@@ -329,7 +329,7 @@ async function compileReleaseCatalog(input) {
|
|
|
329
329
|
};
|
|
330
330
|
const canonicalPayload = canonicalStringify(payload);
|
|
331
331
|
const byteSize = new TextEncoder().encode(canonicalPayload).byteLength;
|
|
332
|
-
if (byteSize >
|
|
332
|
+
if (byteSize > _hot_updater_protocol.MAX_COMPILED_CATALOG_BYTES) throw new ReleaseCatalogCompilationError("CATALOG_OVERSIZE", `Compiled Release catalog is ${byteSize} bytes; maximum is ${_hot_updater_protocol.MAX_COMPILED_CATALOG_BYTES}`);
|
|
333
333
|
return {
|
|
334
334
|
byteSize,
|
|
335
335
|
canonicalPayload,
|
|
@@ -355,15 +355,11 @@ function versionInSegment(version, segment) {
|
|
|
355
355
|
}
|
|
356
356
|
return true;
|
|
357
357
|
}
|
|
358
|
-
function canonicalizeAppVersion(appVersion) {
|
|
359
|
-
const version = require_version_CQ98ZBpL.n(appVersion);
|
|
360
|
-
return version ? require_version_CQ98ZBpL.m(version) : null;
|
|
361
|
-
}
|
|
362
358
|
function projectCompiledCatalog(catalog, appVersion) {
|
|
363
359
|
let indexes;
|
|
364
360
|
if (catalog.strategy === "FINGERPRINT") indexes = catalog.releaseIndexes;
|
|
365
361
|
else {
|
|
366
|
-
const canonicalVersion = appVersion && canonicalizeAppVersion(appVersion);
|
|
362
|
+
const canonicalVersion = appVersion && (0, _hot_updater_protocol.canonicalizeAppVersion)(appVersion);
|
|
367
363
|
if (!canonicalVersion) return [];
|
|
368
364
|
indexes = catalog.segments.find((segment) => versionInSegment(canonicalVersion, segment))?.releaseIndexes ?? [];
|
|
369
365
|
}
|
|
@@ -373,7 +369,7 @@ function projectCompiledRollbackCatalog(catalog, appVersion) {
|
|
|
373
369
|
let indexes;
|
|
374
370
|
if (catalog.strategy === "FINGERPRINT") indexes = catalog.rollbackReleaseIndexes ?? catalog.releaseIndexes;
|
|
375
371
|
else {
|
|
376
|
-
const canonicalVersion = appVersion && canonicalizeAppVersion(appVersion);
|
|
372
|
+
const canonicalVersion = appVersion && (0, _hot_updater_protocol.canonicalizeAppVersion)(appVersion);
|
|
377
373
|
if (!canonicalVersion) return [];
|
|
378
374
|
const segment = catalog.segments.find((candidate) => versionInSegment(canonicalVersion, candidate));
|
|
379
375
|
indexes = segment?.rollbackReleaseIndexes ?? segment?.releaseIndexes ?? [];
|
|
@@ -381,13 +377,18 @@ function projectCompiledRollbackCatalog(catalog, appVersion) {
|
|
|
381
377
|
return indexes.map((index) => catalog.releaseDescriptors[index]);
|
|
382
378
|
}
|
|
383
379
|
function referenceCompatibleReleases(releases, appVersion) {
|
|
384
|
-
const canonicalVersion = canonicalizeAppVersion(appVersion);
|
|
380
|
+
const canonicalVersion = (0, _hot_updater_protocol.canonicalizeAppVersion)(appVersion);
|
|
385
381
|
if (!canonicalVersion) return [];
|
|
386
382
|
return releases.filter((release) => release.enabled && release.targetAppVersion !== null && require_range_DvX_Y6iv.f(canonicalVersion, release.targetAppVersion));
|
|
387
383
|
}
|
|
388
384
|
//#endregion
|
|
389
385
|
exports.ReleaseCatalogCompilationError = ReleaseCatalogCompilationError;
|
|
390
|
-
exports
|
|
386
|
+
Object.defineProperty(exports, "canonicalizeAppVersion", {
|
|
387
|
+
enumerable: true,
|
|
388
|
+
get: function() {
|
|
389
|
+
return _hot_updater_protocol.canonicalizeAppVersion;
|
|
390
|
+
}
|
|
391
|
+
});
|
|
391
392
|
exports.compileReleaseCatalog = compileReleaseCatalog;
|
|
392
393
|
exports.projectCompiledCatalog = projectCompiledCatalog;
|
|
393
394
|
exports.projectCompiledRollbackCatalog = projectCompiledRollbackCatalog;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RELEASE_CATALOG_FALLBACK_POLICY, RELEASE_CATALOG_SCHEMA_VERSION, Release, ReleaseCatalogDescriptor, ReleaseStrategy } from "@hot-updater/
|
|
1
|
+
import { RELEASE_CATALOG_FALLBACK_POLICY, RELEASE_CATALOG_SCHEMA_VERSION, Release, ReleaseCatalogDescriptor, ReleaseStrategy, canonicalizeAppVersion } from "@hot-updater/protocol";
|
|
2
2
|
//#region src/releaseCatalogCompiler.d.ts
|
|
3
3
|
interface CatalogVersionBound {
|
|
4
4
|
readonly version: string;
|
|
@@ -46,7 +46,6 @@ declare function compileReleaseCatalog(input: {
|
|
|
46
46
|
readonly strategy: ReleaseStrategy;
|
|
47
47
|
readonly releases: readonly Release[];
|
|
48
48
|
}): Promise<ReleaseCatalogCompilation>;
|
|
49
|
-
declare function canonicalizeAppVersion(appVersion: string): string | null;
|
|
50
49
|
declare function projectCompiledCatalog(catalog: CompiledReleaseCatalog, appVersion?: string): readonly ReleaseCatalogDescriptor[];
|
|
51
50
|
declare function projectCompiledRollbackCatalog(catalog: CompiledReleaseCatalog, appVersion?: string): readonly ReleaseCatalogDescriptor[];
|
|
52
51
|
declare function referenceCompatibleReleases(releases: readonly Release[], appVersion: string): readonly Release[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RELEASE_CATALOG_FALLBACK_POLICY, RELEASE_CATALOG_SCHEMA_VERSION, Release, ReleaseCatalogDescriptor, ReleaseStrategy } from "@hot-updater/
|
|
1
|
+
import { RELEASE_CATALOG_FALLBACK_POLICY, RELEASE_CATALOG_SCHEMA_VERSION, Release, ReleaseCatalogDescriptor, ReleaseStrategy, canonicalizeAppVersion as canonicalizeAppVersion$1 } from "@hot-updater/protocol";
|
|
2
2
|
//#region src/releaseCatalogCompiler.d.ts
|
|
3
3
|
interface CatalogVersionBound {
|
|
4
4
|
readonly version: string;
|
|
@@ -46,9 +46,8 @@ declare function compileReleaseCatalog(input: {
|
|
|
46
46
|
readonly strategy: ReleaseStrategy;
|
|
47
47
|
readonly releases: readonly Release[];
|
|
48
48
|
}): Promise<ReleaseCatalogCompilation>;
|
|
49
|
-
declare function canonicalizeAppVersion(appVersion: string): string | null;
|
|
50
49
|
declare function projectCompiledCatalog(catalog: CompiledReleaseCatalog, appVersion?: string): readonly ReleaseCatalogDescriptor[];
|
|
51
50
|
declare function projectCompiledRollbackCatalog(catalog: CompiledReleaseCatalog, appVersion?: string): readonly ReleaseCatalogDescriptor[];
|
|
52
51
|
declare function referenceCompatibleReleases(releases: readonly Release[], appVersion: string): readonly Release[];
|
|
53
52
|
//#endregion
|
|
54
|
-
export { CatalogVersionBound, CompiledCatalogSegment, CompiledReleaseCatalog, ReleaseCatalogCompilation, ReleaseCatalogCompilationError, ReleaseCatalogCompilerDiagnostics, canonicalizeAppVersion, compileReleaseCatalog, projectCompiledCatalog, projectCompiledRollbackCatalog, referenceCompatibleReleases };
|
|
53
|
+
export { CatalogVersionBound, CompiledCatalogSegment, CompiledReleaseCatalog, ReleaseCatalogCompilation, ReleaseCatalogCompilationError, ReleaseCatalogCompilerDiagnostics, canonicalizeAppVersion$1 as canonicalizeAppVersion, compileReleaseCatalog, projectCompiledCatalog, projectCompiledRollbackCatalog, referenceCompatibleReleases };
|