@hot-updater/plugin-core 1.0.0-rc.16 → 1.0.0-rc.17

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.
Files changed (51) hide show
  1. package/dist/database/adapter.cjs +9 -0
  2. package/dist/database/adapter.d.cts +34 -1
  3. package/dist/database/adapter.d.mts +34 -1
  4. package/dist/database/adapter.mjs +9 -1
  5. package/dist/{insightsDistinctSummary.mjs → database/distinct.cjs} +23 -10
  6. package/dist/database/distinct.d.cts +16 -0
  7. package/dist/database/distinct.d.mts +16 -0
  8. package/dist/{insightsDistinctSummary.cjs → database/distinct.mjs} +19 -14
  9. package/dist/database/memoryAdapter.cjs +13 -0
  10. package/dist/database/memoryAdapter.mjs +13 -0
  11. package/dist/database/verifyAdapter.cjs +7 -0
  12. package/dist/database/verifyAdapter.mjs +7 -0
  13. package/dist/databaseJsonValue.cjs +0 -2
  14. package/dist/databaseJsonValue.d.cts +3 -3
  15. package/dist/databaseJsonValue.d.mts +3 -3
  16. package/dist/databaseJsonValue.mjs +1 -2
  17. package/dist/index.cjs +0 -4
  18. package/dist/index.d.cts +5 -7
  19. package/dist/index.d.mts +5 -7
  20. package/dist/index.mjs +2 -3
  21. package/dist/internal.cjs +9 -16
  22. package/dist/internal.d.cts +6 -8
  23. package/dist/internal.d.mts +6 -8
  24. package/dist/internal.mjs +4 -5
  25. package/dist/types/databaseConfig.d.cts +29 -1
  26. package/dist/types/databaseConfig.d.mts +29 -1
  27. package/dist/types/databaseRows.d.cts +1 -53
  28. package/dist/types/databaseRows.d.mts +1 -53
  29. package/dist/types/index.d.cts +4 -5
  30. package/dist/types/index.d.mts +4 -5
  31. package/dist/types/internal.d.cts +3 -4
  32. package/dist/types/internal.d.mts +3 -4
  33. package/dist/types/models.d.cts +2 -12
  34. package/dist/types/models.d.mts +2 -12
  35. package/dist/types/public.d.cts +4 -5
  36. package/dist/types/public.d.mts +4 -5
  37. package/package.json +1 -1
  38. package/dist/bundleEventRow.cjs +0 -42
  39. package/dist/bundleEventRow.mjs +0 -41
  40. package/dist/insightsContract.cjs +0 -194
  41. package/dist/insightsContract.d.cts +0 -14
  42. package/dist/insightsContract.d.mts +0 -14
  43. package/dist/insightsContract.mjs +0 -190
  44. package/dist/insightsDistinctSummary.d.cts +0 -12
  45. package/dist/insightsDistinctSummary.d.mts +0 -12
  46. package/dist/insightsOverview.cjs +0 -139
  47. package/dist/insightsOverview.d.cts +0 -42
  48. package/dist/insightsOverview.d.mts +0 -42
  49. package/dist/insightsOverview.mjs +0 -134
  50. package/dist/types/insights.d.cts +0 -172
  51. package/dist/types/insights.d.mts +0 -172
package/dist/index.mjs CHANGED
@@ -6,13 +6,12 @@ import { BUNDLE_STORAGE_PREFIX, createBundleStorageKey, createStorageRootUriWith
6
6
  import { getContentType } from "./contentType.mjs";
7
7
  import { DatabaseBundleNotFoundError, DatabasePluginInputError, DatabaseRowReferencedError } from "./databaseErrors.mjs";
8
8
  import { assertStorageOperations, createStoragePlugin } from "./createStoragePlugin.mjs";
9
- import { isDatabaseBundleEventMetadata, isDatabaseMetadataObject } from "./databaseJsonValue.mjs";
9
+ import { 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";
13
13
  import { generateMinBundleId } from "./generateMinBundleId.mjs";
14
14
  import { createUUIDv7, createUUIDv7After, createUUIDv7WithSameTimestamp, extractTimestampFromUUIDv7, isUUIDv7 } from "./uuidv7.mjs";
15
- import { compareInsightsText, isInsightsMovementEvent } from "./insightsContract.mjs";
16
15
  import { ReleaseCatalogCompilationError, canonicalizeAppVersion, compileReleaseCatalog, projectCompiledCatalog, projectCompiledRollbackCatalog, referenceCompatibleReleases } from "./releaseCatalogCompiler.mjs";
17
16
  import { ReleaseManagementError } from "./releaseManagement.mjs";
18
17
  import { ReleaseCatalogMutationError } from "./releaseCatalogMutation.mjs";
@@ -20,4 +19,4 @@ import { REMOTE_BUNDLE_SIGNING_ALGORITHM, REMOTE_BUNDLE_SIGNING_PATH, REMOTE_BUN
20
19
  import { createStorageDownloadPath, createStorageDownloadUrl, parseStorageDownloadPath } from "./storageDownloadPath.mjs";
21
20
  import { isRemoteDatabase } from "./types/databaseConfig.mjs";
22
21
  import { supportedIosPlatforms } from "./types/index.mjs";
23
- export { BUNDLE_STORAGE_PREFIX, BundleRowHydrationError, BundleRowHydrationErrorReason, CONTENT_ADDRESSED_ASSET_PREFIX, DatabaseBundleNotFoundError, DatabasePluginInputError, DatabaseRowReferencedError, REMOTE_BUNDLE_SIGNING_ALGORITHM, REMOTE_BUNDLE_SIGNING_PATH, REMOTE_BUNDLE_SIGNING_PROTOCOL_VERSION, REMOTE_BUNDLE_SIGNING_TOKEN_HEADER, ReleaseCatalogCompilationError, ReleaseCatalogMutationError, ReleaseManagementError, assertStorageOperations, bundleToPatchRows, bundleToRow, canonicalizeAppVersion, compareInsightsText, compileReleaseCatalog, createBundleSigningHandler, createBundleStorageKey, createStorageDownloadPath, createStorageDownloadUrl, createStorageKeyBuilder, createStoragePlugin, createStorageRootUriWithPath, createStorageUri, createStorageUriWithRelativePath, createUUIDv7, createUUIDv7After, createUUIDv7WithSameTimestamp, extractTimestampFromUUIDv7, filterCompatibleAppVersions, generateMinBundleId, getBundleArchiveStorageUri, getContentAddressedAssetStoragePath, getContentType, getManifestAssetDownloadPath, getManifestAssetStoragePath, isBrotliManifestAssetPath, isContentAddressedAssetFileHash, isDatabaseBundleEventMetadata, isDatabaseMetadataObject, isInsightsMovementEvent, isRemoteDatabase, isUUIDv7, parseStorageDownloadPath, parseStorageUri, projectCompiledCatalog, projectCompiledRollbackCatalog, referenceCompatibleReleases, releaseRowToRelease, releaseToRow, remoteSigning, replaceStorageUriKeySuffix, resolveManifestAssetStorageFileHash, resolveManifestAssetStorageUri, rowToBundle, rowsToBundles, semverSatisfies, supportedIosPlatforms };
22
+ export { BUNDLE_STORAGE_PREFIX, BundleRowHydrationError, BundleRowHydrationErrorReason, CONTENT_ADDRESSED_ASSET_PREFIX, DatabaseBundleNotFoundError, DatabasePluginInputError, DatabaseRowReferencedError, REMOTE_BUNDLE_SIGNING_ALGORITHM, REMOTE_BUNDLE_SIGNING_PATH, REMOTE_BUNDLE_SIGNING_PROTOCOL_VERSION, REMOTE_BUNDLE_SIGNING_TOKEN_HEADER, ReleaseCatalogCompilationError, ReleaseCatalogMutationError, ReleaseManagementError, assertStorageOperations, bundleToPatchRows, bundleToRow, canonicalizeAppVersion, compileReleaseCatalog, createBundleSigningHandler, createBundleStorageKey, createStorageDownloadPath, createStorageDownloadUrl, createStorageKeyBuilder, createStoragePlugin, createStorageRootUriWithPath, createStorageUri, createStorageUriWithRelativePath, createUUIDv7, createUUIDv7After, createUUIDv7WithSameTimestamp, extractTimestampFromUUIDv7, filterCompatibleAppVersions, generateMinBundleId, getBundleArchiveStorageUri, getContentAddressedAssetStoragePath, getContentType, getManifestAssetDownloadPath, getManifestAssetStoragePath, isBrotliManifestAssetPath, isContentAddressedAssetFileHash, isDatabaseMetadataObject, isRemoteDatabase, isUUIDv7, parseStorageDownloadPath, parseStorageUri, projectCompiledCatalog, projectCompiledRollbackCatalog, referenceCompatibleReleases, releaseRowToRelease, releaseToRow, remoteSigning, replaceStorageUriKeySuffix, resolveManifestAssetStorageFileHash, resolveManifestAssetStorageUri, rowToBundle, rowsToBundles, semverSatisfies, supportedIosPlatforms };
package/dist/internal.cjs CHANGED
@@ -1,9 +1,8 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_databaseErrors = require("./databaseErrors.cjs");
3
- const require_insightsContract = require("./insightsContract.cjs");
4
- const require_insightsDistinctSummary = require("./insightsDistinctSummary.cjs");
5
- const require_insightsOverview = require("./insightsOverview.cjs");
3
+ const require_databaseJsonValue = require("./databaseJsonValue.cjs");
6
4
  const require_adapter = require("./database/adapter.cjs");
5
+ const require_distinct = require("./database/distinct.cjs");
7
6
  const require_values = require("./database/values.cjs");
8
7
  const require_memoryAdapter = require("./database/memoryAdapter.cjs");
9
8
  const require_verifyAdapter = require("./database/verifyAdapter.cjs");
@@ -14,31 +13,25 @@ exports.DatabaseAdapterContractError = require_verifyAdapter.DatabaseAdapterCont
14
13
  exports.DatabaseRowReferencedError = require_databaseErrors.DatabaseRowReferencedError;
15
14
  exports.DatabaseSchemaError = require_adapter.DatabaseSchemaError;
16
15
  exports.DatabaseValueError = require_values.DatabaseValueError;
17
- exports.addInsightsDistinct = require_insightsDistinctSummary.addInsightsDistinct;
18
- exports.assertBundleEventRow = require_insightsContract.assertBundleEventRow;
16
+ exports.addDistinct = require_distinct.addDistinct;
19
17
  exports.canonicalJson = require_values.canonicalJson;
20
18
  exports.compareKeyValues = require_values.compareKeyValues;
21
19
  exports.compareTuples = require_values.compareTuples;
22
20
  exports.compareUtf8 = require_values.compareUtf8;
23
- exports.countInsightsDistinct = require_insightsDistinctSummary.countInsightsDistinct;
21
+ exports.countDistinct = require_distinct.countDistinct;
24
22
  exports.createMemoryAdapter = require_memoryAdapter.createMemoryAdapter;
25
- exports.createValidatedInsightsModel = require_insightsContract.createValidatedInsightsModel;
26
- exports.currentInsightsReleaseId = require_insightsOverview.currentInsightsReleaseId;
27
- exports.emptyInsightsDistinct = require_insightsDistinctSummary.emptyInsightsDistinct;
23
+ exports.distinctRegister = require_distinct.distinctRegister;
24
+ exports.emptyDistinct = require_distinct.emptyDistinct;
25
+ exports.expiresAt = require_adapter.expiresAt;
28
26
  exports.findPhysicalColumn = require_adapter.findPhysicalColumn;
29
27
  exports.findPhysicalIndex = require_adapter.findPhysicalIndex;
30
- exports.getInsightsDistinctRegister = require_insightsDistinctSummary.getInsightsDistinctRegister;
31
28
  exports.indexEntries = require_values.indexEntries;
32
29
  exports.indexOrderColumns = require_adapter.indexOrderColumns;
33
30
  exports.indexOrderTuple = require_values.indexOrderTuple;
34
- exports.insightsDistributionIdentity = require_insightsOverview.insightsDistributionIdentity;
35
- exports.insightsKey = require_insightsOverview.insightsKey;
36
- exports.insightsOverviewDeltas = require_insightsOverview.insightsOverviewDeltas;
37
- exports.insightsOverviewId = require_insightsOverview.insightsOverviewId;
38
- exports.insightsOverviewValues = require_insightsOverview.insightsOverviewValues;
31
+ exports.isDatabaseJsonObject = require_databaseJsonValue.isDatabaseJsonObject;
39
32
  exports.isKeyValue = require_values.isKeyValue;
40
33
  exports.matchesQuery = require_values.matchesQuery;
41
- exports.mergeInsightsDistinct = require_insightsDistinctSummary.mergeInsightsDistinct;
34
+ exports.mergeDistinct = require_distinct.mergeDistinct;
42
35
  exports.normalizeStoredRow = require_values.normalizeStoredRow;
43
36
  exports.normalizeStoredValue = require_values.normalizeStoredValue;
44
37
  exports.rowKey = require_adapter.rowKey;
@@ -1,14 +1,12 @@
1
- import { DATABASE_MAX_MULTI_VALUES, DATABASE_MAX_QUERY_LIMIT, DATABASE_VERSION_COLUMN, DatabaseAdapter, DatabaseJson, DatabaseKey, DatabaseKeyValue, DatabaseSchemaError, DatabaseValue, PhysicalColumn, PhysicalColumnType, PhysicalIndex, PhysicalTable, QueryBound, QueryRequest, StoredRow, WriteGuard, WriteOp, WriteResult, findPhysicalColumn, findPhysicalIndex, indexOrderColumns, rowKey } from "./database/adapter.cjs";
2
- import { ApiKeyRow, BundleEventRow, BundleEventRowBase, BundlePatchRow, BundleRow, ChannelRow, DatabaseBundleEventMetadata, DatabaseBundleMetadata, DatabaseField, DatabaseJsonObject, DatabaseJsonValue, DatabaseModel, DatabaseModelMap, DatabaseRow, ReleaseCatalogRow, ReleaseRow } from "./types/databaseRows.cjs";
1
+ import { DATABASE_MAX_MULTI_VALUES, DATABASE_MAX_QUERY_LIMIT, 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";
2
+ import { BundlePatchRow, BundleRow, ChannelRow, DatabaseBundleMetadata, DatabaseJsonObject, DatabaseJsonValue, ReleaseCatalogRow, ReleaseRow } from "./types/databaseRows.cjs";
3
3
  import { BundleRowUpdate, ReleaseCatalogRowUpdate, ReleaseRowUpdate } from "./types/databaseOperations.cjs";
4
- import { InsightsBundleEventFilter, InsightsCountEventsInput, InsightsCountLatestEventsInput, InsightsCoverage, InsightsEventCursor, InsightsEventFilter, InsightsFindLatestEventsInput, InsightsGetAppUsageInput, InsightsGetAppUsageResult, InsightsGetReleaseActivityInput, InsightsGetReleaseActivityResult, InsightsListEventsInput, InsightsModel, InsightsRecordEventInput, InsightsScope, InsightsTimeRange, ReleaseActivityMetrics, ReleaseReference } from "./types/insights.cjs";
5
- import { ApiKeyModel, ChannelDeleteResult, ChannelInsertResult } from "./types/models.cjs";
4
+ import { ChannelDeleteResult, ChannelInsertResult } from "./types/models.cjs";
6
5
  import { DatabaseRowReferencedError } from "./databaseErrors.cjs";
7
- import { assertBundleEventRow, createValidatedInsightsModel } from "./insightsContract.cjs";
6
+ import { isDatabaseJsonObject } from "./databaseJsonValue.cjs";
8
7
  import "./types/internal.cjs";
9
- import { addInsightsDistinct, countInsightsDistinct, emptyInsightsDistinct, getInsightsDistinctRegister, mergeInsightsDistinct } from "./insightsDistinctSummary.cjs";
10
- import { InsightsOverviewDelta, InsightsOverviewIdentity, currentInsightsReleaseId, insightsDistributionIdentity, insightsKey, insightsOverviewDeltas, insightsOverviewId, insightsOverviewValues } from "./insightsOverview.cjs";
8
+ import { addDistinct, countDistinct, distinctRegister, emptyDistinct, mergeDistinct } from "./database/distinct.cjs";
11
9
  import { MemoryAdapterOptions, createMemoryAdapter } from "./database/memoryAdapter.cjs";
12
10
  import { DatabaseValueError, NormalizeOptions, canonicalJson, compareKeyValues, compareTuples, compareUtf8, indexEntries, indexOrderTuple, isKeyValue, matchesQuery, normalizeStoredRow, normalizeStoredValue } from "./database/values.cjs";
13
11
  import { DatabaseAdapterContractError, DatabaseReadCount, DatabaseReadMeter, VerifiedDatabaseAdapter, VerifyAdapterOptions, verifyAdapter } from "./database/verifyAdapter.cjs";
14
- export { type ApiKeyModel, type ApiKeyRow, type BundleEventRow, type BundleEventRowBase, type BundlePatchRow, type BundleRow, type BundleRowUpdate, type ChannelDeleteResult, type ChannelInsertResult, type ChannelRow, DATABASE_MAX_MULTI_VALUES, DATABASE_MAX_QUERY_LIMIT, DATABASE_VERSION_COLUMN, DatabaseAdapter, DatabaseAdapterContractError, type DatabaseBundleEventMetadata, type DatabaseBundleMetadata, type DatabaseField, DatabaseJson, type DatabaseJsonObject, type DatabaseJsonValue, DatabaseKey, DatabaseKeyValue, type DatabaseModel, type DatabaseModelMap, DatabaseReadCount, DatabaseReadMeter, type DatabaseRow, DatabaseRowReferencedError, DatabaseSchemaError, DatabaseValue, DatabaseValueError, type InsightsBundleEventFilter, type InsightsCountEventsInput, type InsightsCountLatestEventsInput, type InsightsCoverage, type InsightsEventCursor, type InsightsEventFilter, type InsightsFindLatestEventsInput, type InsightsGetAppUsageInput, type InsightsGetAppUsageResult, type InsightsGetReleaseActivityInput, type InsightsGetReleaseActivityResult, type InsightsListEventsInput, type InsightsModel, type InsightsOverviewDelta, type InsightsOverviewIdentity, type InsightsRecordEventInput, type InsightsScope, type InsightsTimeRange, MemoryAdapterOptions, NormalizeOptions, PhysicalColumn, PhysicalColumnType, PhysicalIndex, PhysicalTable, QueryBound, QueryRequest, type ReleaseActivityMetrics, type ReleaseCatalogRow, type ReleaseCatalogRowUpdate, type ReleaseReference, type ReleaseRow, type ReleaseRowUpdate, StoredRow, VerifiedDatabaseAdapter, VerifyAdapterOptions, WriteGuard, WriteOp, WriteResult, addInsightsDistinct, assertBundleEventRow, canonicalJson, compareKeyValues, compareTuples, compareUtf8, countInsightsDistinct, createMemoryAdapter, createValidatedInsightsModel, currentInsightsReleaseId, emptyInsightsDistinct, findPhysicalColumn, findPhysicalIndex, getInsightsDistinctRegister, indexEntries, indexOrderColumns, indexOrderTuple, insightsDistributionIdentity, insightsKey, insightsOverviewDeltas, insightsOverviewId, insightsOverviewValues, isKeyValue, matchesQuery, mergeInsightsDistinct, normalizeStoredRow, normalizeStoredValue, rowKey, verifyAdapter };
12
+ export { type BundlePatchRow, type BundleRow, type BundleRowUpdate, type ChannelDeleteResult, type ChannelInsertResult, type ChannelRow, DATABASE_MAX_MULTI_VALUES, DATABASE_MAX_QUERY_LIMIT, DATABASE_VERSION_COLUMN, DatabaseAdapter, DatabaseAdapterContractError, type DatabaseBundleMetadata, DatabaseJson, type DatabaseJsonObject, type DatabaseJsonValue, DatabaseKey, DatabaseKeyValue, DatabaseReadCount, DatabaseReadMeter, DatabaseRowReferencedError, DatabaseSchemaError, DatabaseValue, DatabaseValueError, MemoryAdapterOptions, NormalizeOptions, PhysicalColumn, PhysicalColumnType, PhysicalIndex, PhysicalRetention, PhysicalTable, QueryBound, QueryRequest, type ReleaseCatalogRow, type ReleaseCatalogRowUpdate, type ReleaseRow, type ReleaseRowUpdate, StoredRow, VerifiedDatabaseAdapter, VerifyAdapterOptions, WriteGuard, WriteOp, WriteResult, addDistinct, canonicalJson, compareKeyValues, compareTuples, compareUtf8, countDistinct, createMemoryAdapter, distinctRegister, emptyDistinct, expiresAt, findPhysicalColumn, findPhysicalIndex, indexEntries, indexOrderColumns, indexOrderTuple, isDatabaseJsonObject, isKeyValue, matchesQuery, mergeDistinct, normalizeStoredRow, normalizeStoredValue, rowKey, verifyAdapter };
@@ -1,14 +1,12 @@
1
- import { DATABASE_MAX_MULTI_VALUES, DATABASE_MAX_QUERY_LIMIT, DATABASE_VERSION_COLUMN, DatabaseAdapter, DatabaseJson, DatabaseKey, DatabaseKeyValue, DatabaseSchemaError, DatabaseValue, PhysicalColumn, PhysicalColumnType, PhysicalIndex, PhysicalTable, QueryBound, QueryRequest, StoredRow, WriteGuard, WriteOp, WriteResult, findPhysicalColumn, findPhysicalIndex, indexOrderColumns, rowKey } from "./database/adapter.mjs";
2
- import { ApiKeyRow, BundleEventRow, BundleEventRowBase, BundlePatchRow, BundleRow, ChannelRow, DatabaseBundleEventMetadata, DatabaseBundleMetadata, DatabaseField, DatabaseJsonObject, DatabaseJsonValue, DatabaseModel, DatabaseModelMap, DatabaseRow, ReleaseCatalogRow, ReleaseRow } from "./types/databaseRows.mjs";
1
+ import { DATABASE_MAX_MULTI_VALUES, DATABASE_MAX_QUERY_LIMIT, 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";
2
+ import { BundlePatchRow, BundleRow, ChannelRow, DatabaseBundleMetadata, DatabaseJsonObject, DatabaseJsonValue, ReleaseCatalogRow, ReleaseRow } from "./types/databaseRows.mjs";
3
3
  import { BundleRowUpdate, ReleaseCatalogRowUpdate, ReleaseRowUpdate } from "./types/databaseOperations.mjs";
4
- import { InsightsBundleEventFilter, InsightsCountEventsInput, InsightsCountLatestEventsInput, InsightsCoverage, InsightsEventCursor, InsightsEventFilter, InsightsFindLatestEventsInput, InsightsGetAppUsageInput, InsightsGetAppUsageResult, InsightsGetReleaseActivityInput, InsightsGetReleaseActivityResult, InsightsListEventsInput, InsightsModel, InsightsRecordEventInput, InsightsScope, InsightsTimeRange, ReleaseActivityMetrics, ReleaseReference } from "./types/insights.mjs";
5
- import { ApiKeyModel, ChannelDeleteResult, ChannelInsertResult } from "./types/models.mjs";
4
+ import { ChannelDeleteResult, ChannelInsertResult } from "./types/models.mjs";
6
5
  import { DatabaseRowReferencedError } from "./databaseErrors.mjs";
7
- import { assertBundleEventRow, createValidatedInsightsModel } from "./insightsContract.mjs";
6
+ import { isDatabaseJsonObject } from "./databaseJsonValue.mjs";
8
7
  import "./types/internal.mjs";
9
- import { addInsightsDistinct, countInsightsDistinct, emptyInsightsDistinct, getInsightsDistinctRegister, mergeInsightsDistinct } from "./insightsDistinctSummary.mjs";
10
- import { InsightsOverviewDelta, InsightsOverviewIdentity, currentInsightsReleaseId, insightsDistributionIdentity, insightsKey, insightsOverviewDeltas, insightsOverviewId, insightsOverviewValues } from "./insightsOverview.mjs";
8
+ import { addDistinct, countDistinct, distinctRegister, emptyDistinct, mergeDistinct } from "./database/distinct.mjs";
11
9
  import { MemoryAdapterOptions, createMemoryAdapter } from "./database/memoryAdapter.mjs";
12
10
  import { DatabaseValueError, NormalizeOptions, canonicalJson, compareKeyValues, compareTuples, compareUtf8, indexEntries, indexOrderTuple, isKeyValue, matchesQuery, normalizeStoredRow, normalizeStoredValue } from "./database/values.mjs";
13
11
  import { DatabaseAdapterContractError, DatabaseReadCount, DatabaseReadMeter, VerifiedDatabaseAdapter, VerifyAdapterOptions, verifyAdapter } from "./database/verifyAdapter.mjs";
14
- export { type ApiKeyModel, type ApiKeyRow, type BundleEventRow, type BundleEventRowBase, type BundlePatchRow, type BundleRow, type BundleRowUpdate, type ChannelDeleteResult, type ChannelInsertResult, type ChannelRow, DATABASE_MAX_MULTI_VALUES, DATABASE_MAX_QUERY_LIMIT, DATABASE_VERSION_COLUMN, DatabaseAdapter, DatabaseAdapterContractError, type DatabaseBundleEventMetadata, type DatabaseBundleMetadata, type DatabaseField, DatabaseJson, type DatabaseJsonObject, type DatabaseJsonValue, DatabaseKey, DatabaseKeyValue, type DatabaseModel, type DatabaseModelMap, DatabaseReadCount, DatabaseReadMeter, type DatabaseRow, DatabaseRowReferencedError, DatabaseSchemaError, DatabaseValue, DatabaseValueError, type InsightsBundleEventFilter, type InsightsCountEventsInput, type InsightsCountLatestEventsInput, type InsightsCoverage, type InsightsEventCursor, type InsightsEventFilter, type InsightsFindLatestEventsInput, type InsightsGetAppUsageInput, type InsightsGetAppUsageResult, type InsightsGetReleaseActivityInput, type InsightsGetReleaseActivityResult, type InsightsListEventsInput, type InsightsModel, type InsightsOverviewDelta, type InsightsOverviewIdentity, type InsightsRecordEventInput, type InsightsScope, type InsightsTimeRange, MemoryAdapterOptions, NormalizeOptions, PhysicalColumn, PhysicalColumnType, PhysicalIndex, PhysicalTable, QueryBound, QueryRequest, type ReleaseActivityMetrics, type ReleaseCatalogRow, type ReleaseCatalogRowUpdate, type ReleaseReference, type ReleaseRow, type ReleaseRowUpdate, StoredRow, VerifiedDatabaseAdapter, VerifyAdapterOptions, WriteGuard, WriteOp, WriteResult, addInsightsDistinct, assertBundleEventRow, canonicalJson, compareKeyValues, compareTuples, compareUtf8, countInsightsDistinct, createMemoryAdapter, createValidatedInsightsModel, currentInsightsReleaseId, emptyInsightsDistinct, findPhysicalColumn, findPhysicalIndex, getInsightsDistinctRegister, indexEntries, indexOrderColumns, indexOrderTuple, insightsDistributionIdentity, insightsKey, insightsOverviewDeltas, insightsOverviewId, insightsOverviewValues, isKeyValue, matchesQuery, mergeInsightsDistinct, normalizeStoredRow, normalizeStoredValue, rowKey, verifyAdapter };
12
+ export { type BundlePatchRow, type BundleRow, type BundleRowUpdate, type ChannelDeleteResult, type ChannelInsertResult, type ChannelRow, DATABASE_MAX_MULTI_VALUES, DATABASE_MAX_QUERY_LIMIT, DATABASE_VERSION_COLUMN, DatabaseAdapter, DatabaseAdapterContractError, type DatabaseBundleMetadata, DatabaseJson, type DatabaseJsonObject, type DatabaseJsonValue, DatabaseKey, DatabaseKeyValue, DatabaseReadCount, DatabaseReadMeter, DatabaseRowReferencedError, DatabaseSchemaError, DatabaseValue, DatabaseValueError, MemoryAdapterOptions, NormalizeOptions, PhysicalColumn, PhysicalColumnType, PhysicalIndex, PhysicalRetention, PhysicalTable, QueryBound, QueryRequest, type ReleaseCatalogRow, type ReleaseCatalogRowUpdate, type ReleaseRow, type ReleaseRowUpdate, StoredRow, VerifiedDatabaseAdapter, VerifyAdapterOptions, WriteGuard, WriteOp, WriteResult, addDistinct, canonicalJson, compareKeyValues, compareTuples, compareUtf8, countDistinct, createMemoryAdapter, distinctRegister, emptyDistinct, expiresAt, findPhysicalColumn, findPhysicalIndex, indexEntries, indexOrderColumns, indexOrderTuple, isDatabaseJsonObject, isKeyValue, matchesQuery, mergeDistinct, normalizeStoredRow, normalizeStoredValue, rowKey, verifyAdapter };
package/dist/internal.mjs CHANGED
@@ -1,9 +1,8 @@
1
1
  import { DatabaseRowReferencedError } from "./databaseErrors.mjs";
2
- import { assertBundleEventRow, createValidatedInsightsModel } from "./insightsContract.mjs";
3
- import { addInsightsDistinct, countInsightsDistinct, emptyInsightsDistinct, getInsightsDistinctRegister, mergeInsightsDistinct } from "./insightsDistinctSummary.mjs";
4
- import { currentInsightsReleaseId, insightsDistributionIdentity, insightsKey, insightsOverviewDeltas, insightsOverviewId, insightsOverviewValues } from "./insightsOverview.mjs";
5
- import { DATABASE_MAX_MULTI_VALUES, DATABASE_MAX_QUERY_LIMIT, DATABASE_VERSION_COLUMN, DatabaseSchemaError, findPhysicalColumn, findPhysicalIndex, indexOrderColumns, rowKey } from "./database/adapter.mjs";
2
+ import { isDatabaseJsonObject } from "./databaseJsonValue.mjs";
3
+ import { DATABASE_MAX_MULTI_VALUES, DATABASE_MAX_QUERY_LIMIT, DATABASE_VERSION_COLUMN, DatabaseSchemaError, expiresAt, findPhysicalColumn, findPhysicalIndex, indexOrderColumns, rowKey } from "./database/adapter.mjs";
4
+ import { addDistinct, countDistinct, distinctRegister, emptyDistinct, mergeDistinct } from "./database/distinct.mjs";
6
5
  import { DatabaseValueError, canonicalJson, compareKeyValues, compareTuples, compareUtf8, indexEntries, indexOrderTuple, isKeyValue, matchesQuery, normalizeStoredRow, normalizeStoredValue } from "./database/values.mjs";
7
6
  import { createMemoryAdapter } from "./database/memoryAdapter.mjs";
8
7
  import { DatabaseAdapterContractError, verifyAdapter } from "./database/verifyAdapter.mjs";
9
- export { DATABASE_MAX_MULTI_VALUES, DATABASE_MAX_QUERY_LIMIT, DATABASE_VERSION_COLUMN, DatabaseAdapterContractError, DatabaseRowReferencedError, DatabaseSchemaError, DatabaseValueError, addInsightsDistinct, assertBundleEventRow, canonicalJson, compareKeyValues, compareTuples, compareUtf8, countInsightsDistinct, createMemoryAdapter, createValidatedInsightsModel, currentInsightsReleaseId, emptyInsightsDistinct, findPhysicalColumn, findPhysicalIndex, getInsightsDistinctRegister, indexEntries, indexOrderColumns, indexOrderTuple, insightsDistributionIdentity, insightsKey, insightsOverviewDeltas, insightsOverviewId, insightsOverviewValues, isKeyValue, matchesQuery, mergeInsightsDistinct, normalizeStoredRow, normalizeStoredValue, rowKey, verifyAdapter };
8
+ export { DATABASE_MAX_MULTI_VALUES, DATABASE_MAX_QUERY_LIMIT, DATABASE_VERSION_COLUMN, DatabaseAdapterContractError, DatabaseRowReferencedError, DatabaseSchemaError, DatabaseValueError, addDistinct, canonicalJson, compareKeyValues, compareTuples, compareUtf8, countDistinct, createMemoryAdapter, distinctRegister, emptyDistinct, expiresAt, findPhysicalColumn, findPhysicalIndex, indexEntries, indexOrderColumns, indexOrderTuple, isDatabaseJsonObject, isKeyValue, matchesQuery, mergeDistinct, normalizeStoredRow, normalizeStoredValue, rowKey, verifyAdapter };
@@ -1,6 +1,32 @@
1
1
  import { DatabaseAdapter } from "../database/adapter.cjs";
2
2
  import { HotUpdaterCoreApi } from "../coreApi.cjs";
3
3
  //#region src/types/databaseConfig.d.ts
4
+ /**
5
+ * How changes to aggregates declared `batched` reach their rows: after the
6
+ * transaction that made them commits, merged with other transactions'
7
+ * changes into one write per aggregate row. Databases that bill each write
8
+ * (DynamoDB, Firestore) batch them.
9
+ */
10
+ interface AggregateBatching {
11
+ /**
12
+ * `"log"` (the default) writes each transaction's changes as one log row
13
+ * in that transaction, and a compaction merges pending log rows into the
14
+ * aggregates. It loses nothing and suits every runtime. `"memory"` keeps
15
+ * changes in the process until a timer flushes them. It writes no log
16
+ * rows, but a crash loses up to one window, and a runtime that freezes
17
+ * or drops the process between requests (Lambda, Cloud Functions,
18
+ * Workers) loses more, so use it only on a long-lived server.
19
+ */
20
+ readonly mode?: "log" | "memory";
21
+ /**
22
+ * How long changes wait before a compaction or a flush: `"log"` compacts
23
+ * after a commit once this has passed since the last compaction, 60
24
+ * seconds by default, and `"memory"` flushes this often, 15 seconds by
25
+ * default. A read that cannot compact (read-only credentials) shows
26
+ * aggregates that can leave out up to one window of the latest changes.
27
+ */
28
+ readonly windowMs?: number;
29
+ }
4
30
  /**
5
31
  * A database on Hot Updater's storage engine, as a provider's factory
6
32
  * returns it: the adapter that core and plugins run on.
@@ -14,6 +40,8 @@ interface EngineDatabase {
14
40
  * a committed write that changes what those routes answer.
15
41
  */
16
42
  readonly onCachedRoutesChange?: () => Promise<void>;
43
+ /** Batches aggregates declared `batched`; absent, they commit with each transaction. */
44
+ readonly aggregateBatching?: AggregateBatching;
17
45
  dispose?(): Promise<void>;
18
46
  }
19
47
  /** A self-hosted server's database, reached through its admin API. */
@@ -30,4 +58,4 @@ type ConfiguredDatabase = EngineDatabase | RemoteDatabase;
30
58
  /** Whether a configured database is a self-hosted server's. */
31
59
  declare const isRemoteDatabase: (database: ConfiguredDatabase) => database is RemoteDatabase;
32
60
  //#endregion
33
- export { ConfiguredDatabase, EngineDatabase, RemoteDatabase, isRemoteDatabase };
61
+ export { AggregateBatching, ConfiguredDatabase, EngineDatabase, RemoteDatabase, isRemoteDatabase };
@@ -1,6 +1,32 @@
1
1
  import { DatabaseAdapter } from "../database/adapter.mjs";
2
2
  import { HotUpdaterCoreApi } from "../coreApi.mjs";
3
3
  //#region src/types/databaseConfig.d.ts
4
+ /**
5
+ * How changes to aggregates declared `batched` reach their rows: after the
6
+ * transaction that made them commits, merged with other transactions'
7
+ * changes into one write per aggregate row. Databases that bill each write
8
+ * (DynamoDB, Firestore) batch them.
9
+ */
10
+ interface AggregateBatching {
11
+ /**
12
+ * `"log"` (the default) writes each transaction's changes as one log row
13
+ * in that transaction, and a compaction merges pending log rows into the
14
+ * aggregates. It loses nothing and suits every runtime. `"memory"` keeps
15
+ * changes in the process until a timer flushes them. It writes no log
16
+ * rows, but a crash loses up to one window, and a runtime that freezes
17
+ * or drops the process between requests (Lambda, Cloud Functions,
18
+ * Workers) loses more, so use it only on a long-lived server.
19
+ */
20
+ readonly mode?: "log" | "memory";
21
+ /**
22
+ * How long changes wait before a compaction or a flush: `"log"` compacts
23
+ * after a commit once this has passed since the last compaction, 60
24
+ * seconds by default, and `"memory"` flushes this often, 15 seconds by
25
+ * default. A read that cannot compact (read-only credentials) shows
26
+ * aggregates that can leave out up to one window of the latest changes.
27
+ */
28
+ readonly windowMs?: number;
29
+ }
4
30
  /**
5
31
  * A database on Hot Updater's storage engine, as a provider's factory
6
32
  * returns it: the adapter that core and plugins run on.
@@ -14,6 +40,8 @@ interface EngineDatabase {
14
40
  * a committed write that changes what those routes answer.
15
41
  */
16
42
  readonly onCachedRoutesChange?: () => Promise<void>;
43
+ /** Batches aggregates declared `batched`; absent, they commit with each transaction. */
44
+ readonly aggregateBatching?: AggregateBatching;
17
45
  dispose?(): Promise<void>;
18
46
  }
19
47
  /** A self-hosted server's database, reached through its admin API. */
@@ -30,4 +58,4 @@ type ConfiguredDatabase = EngineDatabase | RemoteDatabase;
30
58
  /** Whether a configured database is a self-hosted server's. */
31
59
  declare const isRemoteDatabase: (database: ConfiguredDatabase) => database is RemoteDatabase;
32
60
  //#endregion
33
- export { ConfiguredDatabase, EngineDatabase, RemoteDatabase, isRemoteDatabase };
61
+ export { AggregateBatching, ConfiguredDatabase, EngineDatabase, RemoteDatabase, isRemoteDatabase };
@@ -66,57 +66,5 @@ interface ChannelRow {
66
66
  readonly id: string;
67
67
  readonly name: string;
68
68
  }
69
- /** Ancillary report data; queryable identity and lifecycle fields stay on the row. */
70
- type DatabaseBundleEventMetadata = DatabaseJsonObject & {
71
- readonly username: string | null;
72
- readonly cohort: string;
73
- readonly update_strategy: "fingerprint" | "appVersion" | null;
74
- readonly fingerprint_hash: string | null;
75
- readonly sdk_version: string | null;
76
- };
77
- type BundleEventRowBase = {
78
- readonly id: string;
79
- readonly install_id: string;
80
- readonly user_id: string | null;
81
- readonly from_release_id: string | null;
82
- readonly to_release_id: string | null;
83
- readonly to_bundle_id: string;
84
- readonly platform: Platform;
85
- readonly app_version: string;
86
- readonly channel: string;
87
- readonly metadata: DatabaseBundleEventMetadata;
88
- readonly received_at_ms: number;
89
- };
90
- type BundleEventRow = BundleEventRowBase & ({
91
- readonly type: "UPDATE_DOWNLOADED";
92
- readonly from_bundle_id: string;
93
- } | {
94
- readonly type: "UPDATE_APPLIED" | "RECOVERED";
95
- readonly from_bundle_id: string;
96
- } | {
97
- readonly type: "UNCHANGED";
98
- readonly from_bundle_id: null;
99
- });
100
- interface ApiKeyRow {
101
- readonly id: string;
102
- readonly hash: string;
103
- readonly name: string;
104
- readonly prefix: string;
105
- readonly role: "client";
106
- readonly created_at_ms: number;
107
- readonly revoked_at_ms: number | null;
108
- }
109
- interface DatabaseModelMap {
110
- readonly bundles: BundleRow;
111
- readonly bundle_patches: BundlePatchRow;
112
- readonly releases: ReleaseRow;
113
- readonly release_catalogs: ReleaseCatalogRow;
114
- readonly channels: ChannelRow;
115
- readonly bundle_events: BundleEventRow;
116
- readonly api_keys: ApiKeyRow;
117
- }
118
- type DatabaseModel = keyof DatabaseModelMap;
119
- type DatabaseRow<TModel extends DatabaseModel> = DatabaseModelMap[TModel];
120
- type DatabaseField<TModel extends DatabaseModel> = Extract<keyof DatabaseRow<TModel>, string>;
121
69
  //#endregion
122
- export { ApiKeyRow, BundleEventRow, BundleEventRowBase, BundlePatchRow, BundleRow, ChannelRow, DatabaseBundleEventMetadata, DatabaseBundleMetadata, DatabaseField, DatabaseJsonObject, DatabaseJsonValue, DatabaseModel, DatabaseModelMap, DatabaseRow, ReleaseCatalogRow, ReleaseRow };
70
+ export { BundlePatchRow, BundleRow, ChannelRow, DatabaseBundleMetadata, DatabaseJsonObject, DatabaseJsonValue, ReleaseCatalogRow, ReleaseRow };
@@ -66,57 +66,5 @@ interface ChannelRow {
66
66
  readonly id: string;
67
67
  readonly name: string;
68
68
  }
69
- /** Ancillary report data; queryable identity and lifecycle fields stay on the row. */
70
- type DatabaseBundleEventMetadata = DatabaseJsonObject & {
71
- readonly username: string | null;
72
- readonly cohort: string;
73
- readonly update_strategy: "fingerprint" | "appVersion" | null;
74
- readonly fingerprint_hash: string | null;
75
- readonly sdk_version: string | null;
76
- };
77
- type BundleEventRowBase = {
78
- readonly id: string;
79
- readonly install_id: string;
80
- readonly user_id: string | null;
81
- readonly from_release_id: string | null;
82
- readonly to_release_id: string | null;
83
- readonly to_bundle_id: string;
84
- readonly platform: Platform;
85
- readonly app_version: string;
86
- readonly channel: string;
87
- readonly metadata: DatabaseBundleEventMetadata;
88
- readonly received_at_ms: number;
89
- };
90
- type BundleEventRow = BundleEventRowBase & ({
91
- readonly type: "UPDATE_DOWNLOADED";
92
- readonly from_bundle_id: string;
93
- } | {
94
- readonly type: "UPDATE_APPLIED" | "RECOVERED";
95
- readonly from_bundle_id: string;
96
- } | {
97
- readonly type: "UNCHANGED";
98
- readonly from_bundle_id: null;
99
- });
100
- interface ApiKeyRow {
101
- readonly id: string;
102
- readonly hash: string;
103
- readonly name: string;
104
- readonly prefix: string;
105
- readonly role: "client";
106
- readonly created_at_ms: number;
107
- readonly revoked_at_ms: number | null;
108
- }
109
- interface DatabaseModelMap {
110
- readonly bundles: BundleRow;
111
- readonly bundle_patches: BundlePatchRow;
112
- readonly releases: ReleaseRow;
113
- readonly release_catalogs: ReleaseCatalogRow;
114
- readonly channels: ChannelRow;
115
- readonly bundle_events: BundleEventRow;
116
- readonly api_keys: ApiKeyRow;
117
- }
118
- type DatabaseModel = keyof DatabaseModelMap;
119
- type DatabaseRow<TModel extends DatabaseModel> = DatabaseModelMap[TModel];
120
- type DatabaseField<TModel extends DatabaseModel> = Extract<keyof DatabaseRow<TModel>, string>;
121
69
  //#endregion
122
- export { ApiKeyRow, BundleEventRow, BundleEventRowBase, BundlePatchRow, BundleRow, ChannelRow, DatabaseBundleEventMetadata, DatabaseBundleMetadata, DatabaseField, DatabaseJsonObject, DatabaseJsonValue, DatabaseModel, DatabaseModelMap, DatabaseRow, ReleaseCatalogRow, ReleaseRow };
70
+ export { BundlePatchRow, BundleRow, ChannelRow, DatabaseBundleMetadata, DatabaseJsonObject, DatabaseJsonValue, ReleaseCatalogRow, ReleaseRow };
@@ -1,9 +1,8 @@
1
- import { ConfiguredDatabase, EngineDatabase, RemoteDatabase, isRemoteDatabase } from "./databaseConfig.cjs";
1
+ import { AggregateBatching, ConfiguredDatabase, EngineDatabase, RemoteDatabase, isRemoteDatabase } from "./databaseConfig.cjs";
2
2
  import { BuiltIns, HasMultipleCallSignatures, Primitive, RequiredDeep } from "./utils.cjs";
3
- import { ApiKeyRow, BundleEventRow, BundleEventRowBase, BundlePatchRow, BundleRow, ChannelRow, DatabaseBundleEventMetadata, DatabaseBundleMetadata, DatabaseJsonObject, DatabaseJsonValue, ReleaseCatalogRow, ReleaseRow } from "./databaseRows.cjs";
3
+ import { BundlePatchRow, BundleRow, ChannelRow, DatabaseBundleMetadata, DatabaseJsonObject, DatabaseJsonValue, ReleaseCatalogRow, ReleaseRow } from "./databaseRows.cjs";
4
4
  import { BundleRowUpdate, ReleaseCatalogRowUpdate, ReleaseRowUpdate } from "./databaseOperations.cjs";
5
- import { InsightsBundleEventFilter, InsightsCountEventsInput, InsightsCountLatestEventsInput, InsightsCoverage, InsightsEventCursor, InsightsEventFilter, InsightsFindLatestEventsInput, InsightsGetAppUsageInput, InsightsGetAppUsageResult, InsightsGetReleaseActivityInput, InsightsGetReleaseActivityResult, InsightsListEventsInput, InsightsModel, InsightsRecordEventInput, InsightsScope, InsightsTimeRange, ReleaseActivityMetrics, ReleaseReference } from "./insights.cjs";
6
- import { ApiKeyModel, ChannelDeleteResult, ChannelInsertResult } from "./models.cjs";
5
+ import { ChannelDeleteResult, ChannelInsertResult } from "./models.cjs";
7
6
  import "./public.cjs";
8
7
  import { Bundle as Bundle$1, Platform, Platform as Platform$1 } from "@hot-updater/core";
9
8
  //#region src/types/index.d.ts
@@ -420,4 +419,4 @@ interface NativeBuildOptions {
420
419
  scheme?: string;
421
420
  }
422
421
  //#endregion
423
- export { type ApiKeyModel, type ApiKeyRow, ApplePlatform, BasePluginArgs, BuildPlugin, BuildPluginConfig, BuiltIns, type Bundle$1 as Bundle, type BundleEventRow, type BundleEventRowBase, type BundlePatchRow, type BundleRow, type BundleRowUpdate, BundleSigningPlugin, type ChannelDeleteResult, type ChannelInsertResult, type ChannelRow, ConfigInput, type ConfiguredDatabase, type DatabaseBundleEventMetadata, type DatabaseBundleMetadata, type DatabaseJsonObject, type DatabaseJsonValue, type EngineDatabase, FingerprintExtraSources, HasMultipleCallSignatures, type InsightsBundleEventFilter, type InsightsCountEventsInput, type InsightsCountLatestEventsInput, type InsightsCoverage, type InsightsEventCursor, type InsightsEventFilter, type InsightsFindLatestEventsInput, type InsightsGetAppUsageInput, type InsightsGetAppUsageResult, type InsightsGetReleaseActivityInput, type InsightsGetReleaseActivityResult, type InsightsListEventsInput, type InsightsModel, type InsightsRecordEventInput, type InsightsScope, type InsightsTimeRange, IosBuildDestination, LocalSigningConfig, NativeBuildAndroidScheme, NativeBuildArgs, NativeBuildIosScheme, NativeBuildOptions, type Platform$1 as Platform, PlatformConfig, Primitive, type ReleaseActivityMetrics, type ReleaseCatalogRow, type ReleaseCatalogRowUpdate, type ReleaseReference, type ReleaseRow, type ReleaseRowUpdate, type RemoteDatabase, RequiredDeep, SigningConfig, StorageDeleteInput, StorageDeleteResult, StorageExistsInput, StorageExistsResult, StorageGetDownloadUrlInput, StorageGetDownloadUrlResult, StorageGetInput, StorageGetResult, StorageObject, StoragePlugin, StoragePutInput, StoragePutResult, isRemoteDatabase, supportedIosPlatforms };
422
+ export { type AggregateBatching, ApplePlatform, BasePluginArgs, BuildPlugin, BuildPluginConfig, BuiltIns, type Bundle$1 as Bundle, type BundlePatchRow, type BundleRow, type BundleRowUpdate, BundleSigningPlugin, type ChannelDeleteResult, type ChannelInsertResult, type ChannelRow, ConfigInput, type ConfiguredDatabase, type DatabaseBundleMetadata, type DatabaseJsonObject, type DatabaseJsonValue, type EngineDatabase, FingerprintExtraSources, HasMultipleCallSignatures, IosBuildDestination, LocalSigningConfig, NativeBuildAndroidScheme, NativeBuildArgs, NativeBuildIosScheme, NativeBuildOptions, type Platform$1 as Platform, PlatformConfig, Primitive, type ReleaseCatalogRow, type ReleaseCatalogRowUpdate, type ReleaseRow, type ReleaseRowUpdate, type RemoteDatabase, RequiredDeep, SigningConfig, StorageDeleteInput, StorageDeleteResult, StorageExistsInput, StorageExistsResult, StorageGetDownloadUrlInput, StorageGetDownloadUrlResult, StorageGetInput, StorageGetResult, StorageObject, StoragePlugin, StoragePutInput, StoragePutResult, isRemoteDatabase, supportedIosPlatforms };
@@ -1,9 +1,8 @@
1
- import { ConfiguredDatabase, EngineDatabase, RemoteDatabase, isRemoteDatabase } from "./databaseConfig.mjs";
1
+ import { AggregateBatching, ConfiguredDatabase, EngineDatabase, RemoteDatabase, isRemoteDatabase } from "./databaseConfig.mjs";
2
2
  import { BuiltIns, HasMultipleCallSignatures, Primitive, RequiredDeep } from "./utils.mjs";
3
- import { ApiKeyRow, BundleEventRow, BundleEventRowBase, BundlePatchRow, BundleRow, ChannelRow, DatabaseBundleEventMetadata, DatabaseBundleMetadata, DatabaseJsonObject, DatabaseJsonValue, ReleaseCatalogRow, ReleaseRow } from "./databaseRows.mjs";
3
+ import { BundlePatchRow, BundleRow, ChannelRow, DatabaseBundleMetadata, DatabaseJsonObject, DatabaseJsonValue, ReleaseCatalogRow, ReleaseRow } from "./databaseRows.mjs";
4
4
  import { BundleRowUpdate, ReleaseCatalogRowUpdate, ReleaseRowUpdate } from "./databaseOperations.mjs";
5
- import { InsightsBundleEventFilter, InsightsCountEventsInput, InsightsCountLatestEventsInput, InsightsCoverage, InsightsEventCursor, InsightsEventFilter, InsightsFindLatestEventsInput, InsightsGetAppUsageInput, InsightsGetAppUsageResult, InsightsGetReleaseActivityInput, InsightsGetReleaseActivityResult, InsightsListEventsInput, InsightsModel, InsightsRecordEventInput, InsightsScope, InsightsTimeRange, ReleaseActivityMetrics, ReleaseReference } from "./insights.mjs";
6
- import { ApiKeyModel, ChannelDeleteResult, ChannelInsertResult } from "./models.mjs";
5
+ import { ChannelDeleteResult, ChannelInsertResult } from "./models.mjs";
7
6
  import "./public.mjs";
8
7
  import { Bundle as Bundle$1, Platform, Platform as Platform$1 } from "@hot-updater/core";
9
8
  //#region src/types/index.d.ts
@@ -420,4 +419,4 @@ interface NativeBuildOptions {
420
419
  scheme?: string;
421
420
  }
422
421
  //#endregion
423
- export { type ApiKeyModel, type ApiKeyRow, ApplePlatform, BasePluginArgs, BuildPlugin, BuildPluginConfig, BuiltIns, type Bundle$1 as Bundle, type BundleEventRow, type BundleEventRowBase, type BundlePatchRow, type BundleRow, type BundleRowUpdate, BundleSigningPlugin, type ChannelDeleteResult, type ChannelInsertResult, type ChannelRow, ConfigInput, type ConfiguredDatabase, type DatabaseBundleEventMetadata, type DatabaseBundleMetadata, type DatabaseJsonObject, type DatabaseJsonValue, type EngineDatabase, FingerprintExtraSources, HasMultipleCallSignatures, type InsightsBundleEventFilter, type InsightsCountEventsInput, type InsightsCountLatestEventsInput, type InsightsCoverage, type InsightsEventCursor, type InsightsEventFilter, type InsightsFindLatestEventsInput, type InsightsGetAppUsageInput, type InsightsGetAppUsageResult, type InsightsGetReleaseActivityInput, type InsightsGetReleaseActivityResult, type InsightsListEventsInput, type InsightsModel, type InsightsRecordEventInput, type InsightsScope, type InsightsTimeRange, IosBuildDestination, LocalSigningConfig, NativeBuildAndroidScheme, NativeBuildArgs, NativeBuildIosScheme, NativeBuildOptions, type Platform$1 as Platform, PlatformConfig, Primitive, type ReleaseActivityMetrics, type ReleaseCatalogRow, type ReleaseCatalogRowUpdate, type ReleaseReference, type ReleaseRow, type ReleaseRowUpdate, type RemoteDatabase, RequiredDeep, SigningConfig, StorageDeleteInput, StorageDeleteResult, StorageExistsInput, StorageExistsResult, StorageGetDownloadUrlInput, StorageGetDownloadUrlResult, StorageGetInput, StorageGetResult, StorageObject, StoragePlugin, StoragePutInput, StoragePutResult, isRemoteDatabase, supportedIosPlatforms };
422
+ export { type AggregateBatching, ApplePlatform, BasePluginArgs, BuildPlugin, BuildPluginConfig, BuiltIns, type Bundle$1 as Bundle, type BundlePatchRow, type BundleRow, type BundleRowUpdate, BundleSigningPlugin, type ChannelDeleteResult, type ChannelInsertResult, type ChannelRow, ConfigInput, type ConfiguredDatabase, type DatabaseBundleMetadata, type DatabaseJsonObject, type DatabaseJsonValue, type EngineDatabase, FingerprintExtraSources, HasMultipleCallSignatures, IosBuildDestination, LocalSigningConfig, NativeBuildAndroidScheme, NativeBuildArgs, NativeBuildIosScheme, NativeBuildOptions, type Platform$1 as Platform, PlatformConfig, Primitive, type ReleaseCatalogRow, type ReleaseCatalogRowUpdate, type ReleaseRow, type ReleaseRowUpdate, type RemoteDatabase, RequiredDeep, SigningConfig, StorageDeleteInput, StorageDeleteResult, StorageExistsInput, StorageExistsResult, StorageGetDownloadUrlInput, StorageGetDownloadUrlResult, StorageGetInput, StorageGetResult, StorageObject, StoragePlugin, StoragePutInput, StoragePutResult, isRemoteDatabase, supportedIosPlatforms };
@@ -1,5 +1,4 @@
1
- import { ApiKeyRow, BundleEventRow, BundleEventRowBase, BundlePatchRow, BundleRow, ChannelRow, DatabaseBundleEventMetadata, DatabaseBundleMetadata, DatabaseField, DatabaseJsonObject, DatabaseJsonValue, DatabaseModel, DatabaseModelMap, DatabaseRow, ReleaseCatalogRow, ReleaseRow } from "./databaseRows.cjs";
1
+ import { BundlePatchRow, BundleRow, ChannelRow, DatabaseBundleMetadata, DatabaseJsonObject, DatabaseJsonValue, ReleaseCatalogRow, ReleaseRow } from "./databaseRows.cjs";
2
2
  import { BundleRowUpdate, ReleaseCatalogRowUpdate, ReleaseRowUpdate } from "./databaseOperations.cjs";
3
- import { InsightsBundleEventFilter, InsightsCountEventsInput, InsightsCountLatestEventsInput, InsightsCoverage, InsightsEventCursor, InsightsEventFilter, InsightsFindLatestEventsInput, InsightsGetAppUsageInput, InsightsGetAppUsageResult, InsightsGetReleaseActivityInput, InsightsGetReleaseActivityResult, InsightsListEventsInput, InsightsModel, InsightsRecordEventInput, InsightsScope, InsightsTimeRange, ReleaseActivityMetrics, ReleaseReference } from "./insights.cjs";
4
- import { ApiKeyModel, ChannelDeleteResult, ChannelInsertResult } from "./models.cjs";
5
- export { ApiKeyModel, ApiKeyRow, BundleEventRow, BundleEventRowBase, BundlePatchRow, BundleRow, BundleRowUpdate, ChannelDeleteResult, ChannelInsertResult, ChannelRow, DatabaseBundleEventMetadata, DatabaseBundleMetadata, DatabaseField, DatabaseJsonObject, DatabaseJsonValue, DatabaseModel, DatabaseModelMap, DatabaseRow, InsightsBundleEventFilter, InsightsCountEventsInput, InsightsCountLatestEventsInput, InsightsCoverage, InsightsEventCursor, InsightsEventFilter, InsightsFindLatestEventsInput, InsightsGetAppUsageInput, InsightsGetAppUsageResult, InsightsGetReleaseActivityInput, InsightsGetReleaseActivityResult, InsightsListEventsInput, InsightsModel, InsightsRecordEventInput, InsightsScope, InsightsTimeRange, ReleaseActivityMetrics, ReleaseCatalogRow, ReleaseCatalogRowUpdate, ReleaseReference, ReleaseRow, ReleaseRowUpdate };
3
+ import { ChannelDeleteResult, ChannelInsertResult } from "./models.cjs";
4
+ export { BundlePatchRow, BundleRow, BundleRowUpdate, ChannelDeleteResult, ChannelInsertResult, ChannelRow, DatabaseBundleMetadata, DatabaseJsonObject, DatabaseJsonValue, ReleaseCatalogRow, ReleaseCatalogRowUpdate, ReleaseRow, ReleaseRowUpdate };
@@ -1,5 +1,4 @@
1
- import { ApiKeyRow, BundleEventRow, BundleEventRowBase, BundlePatchRow, BundleRow, ChannelRow, DatabaseBundleEventMetadata, DatabaseBundleMetadata, DatabaseField, DatabaseJsonObject, DatabaseJsonValue, DatabaseModel, DatabaseModelMap, DatabaseRow, ReleaseCatalogRow, ReleaseRow } from "./databaseRows.mjs";
1
+ import { BundlePatchRow, BundleRow, ChannelRow, DatabaseBundleMetadata, DatabaseJsonObject, DatabaseJsonValue, ReleaseCatalogRow, ReleaseRow } from "./databaseRows.mjs";
2
2
  import { BundleRowUpdate, ReleaseCatalogRowUpdate, ReleaseRowUpdate } from "./databaseOperations.mjs";
3
- import { InsightsBundleEventFilter, InsightsCountEventsInput, InsightsCountLatestEventsInput, InsightsCoverage, InsightsEventCursor, InsightsEventFilter, InsightsFindLatestEventsInput, InsightsGetAppUsageInput, InsightsGetAppUsageResult, InsightsGetReleaseActivityInput, InsightsGetReleaseActivityResult, InsightsListEventsInput, InsightsModel, InsightsRecordEventInput, InsightsScope, InsightsTimeRange, ReleaseActivityMetrics, ReleaseReference } from "./insights.mjs";
4
- import { ApiKeyModel, ChannelDeleteResult, ChannelInsertResult } from "./models.mjs";
5
- export { ApiKeyModel, ApiKeyRow, BundleEventRow, BundleEventRowBase, BundlePatchRow, BundleRow, BundleRowUpdate, ChannelDeleteResult, ChannelInsertResult, ChannelRow, DatabaseBundleEventMetadata, DatabaseBundleMetadata, DatabaseField, DatabaseJsonObject, DatabaseJsonValue, DatabaseModel, DatabaseModelMap, DatabaseRow, InsightsBundleEventFilter, InsightsCountEventsInput, InsightsCountLatestEventsInput, InsightsCoverage, InsightsEventCursor, InsightsEventFilter, InsightsFindLatestEventsInput, InsightsGetAppUsageInput, InsightsGetAppUsageResult, InsightsGetReleaseActivityInput, InsightsGetReleaseActivityResult, InsightsListEventsInput, InsightsModel, InsightsRecordEventInput, InsightsScope, InsightsTimeRange, ReleaseActivityMetrics, ReleaseCatalogRow, ReleaseCatalogRowUpdate, ReleaseReference, ReleaseRow, ReleaseRowUpdate };
3
+ import { ChannelDeleteResult, ChannelInsertResult } from "./models.mjs";
4
+ export { BundlePatchRow, BundleRow, BundleRowUpdate, ChannelDeleteResult, ChannelInsertResult, ChannelRow, DatabaseBundleMetadata, DatabaseJsonObject, DatabaseJsonValue, ReleaseCatalogRow, ReleaseCatalogRowUpdate, ReleaseRow, ReleaseRowUpdate };
@@ -1,15 +1,5 @@
1
- import { ApiKeyRow, ChannelRow } from "./databaseRows.cjs";
1
+ import { ChannelRow } from "./databaseRows.cjs";
2
2
  //#region src/types/models.d.ts
3
- /** The api-keys plugin's storage: key rows by id and by hash. */
4
- interface ApiKeyModel {
5
- create(row: ApiKeyRow): Promise<"created" | "existing">;
6
- findByHash(hash: string): Promise<ApiKeyRow | null>;
7
- list(): Promise<readonly ApiKeyRow[]>;
8
- revoke(input: {
9
- readonly id: string;
10
- readonly revokedAtMs: number;
11
- }): Promise<ApiKeyRow | null>;
12
- }
13
3
  interface ChannelInsertResult {
14
4
  readonly row: ChannelRow;
15
5
  readonly inserted: boolean;
@@ -21,4 +11,4 @@ type ChannelDeleteResult = {
21
11
  readonly reason: "not_found" | "not_empty";
22
12
  };
23
13
  //#endregion
24
- export { ApiKeyModel, ChannelDeleteResult, ChannelInsertResult };
14
+ export { ChannelDeleteResult, ChannelInsertResult };
@@ -1,15 +1,5 @@
1
- import { ApiKeyRow, ChannelRow } from "./databaseRows.mjs";
1
+ import { ChannelRow } from "./databaseRows.mjs";
2
2
  //#region src/types/models.d.ts
3
- /** The api-keys plugin's storage: key rows by id and by hash. */
4
- interface ApiKeyModel {
5
- create(row: ApiKeyRow): Promise<"created" | "existing">;
6
- findByHash(hash: string): Promise<ApiKeyRow | null>;
7
- list(): Promise<readonly ApiKeyRow[]>;
8
- revoke(input: {
9
- readonly id: string;
10
- readonly revokedAtMs: number;
11
- }): Promise<ApiKeyRow | null>;
12
- }
13
3
  interface ChannelInsertResult {
14
4
  readonly row: ChannelRow;
15
5
  readonly inserted: boolean;
@@ -21,4 +11,4 @@ type ChannelDeleteResult = {
21
11
  readonly reason: "not_found" | "not_empty";
22
12
  };
23
13
  //#endregion
24
- export { ApiKeyModel, ChannelDeleteResult, ChannelInsertResult };
14
+ export { ChannelDeleteResult, ChannelInsertResult };
@@ -1,6 +1,5 @@
1
- import { ConfiguredDatabase, EngineDatabase, RemoteDatabase, isRemoteDatabase } from "./databaseConfig.cjs";
2
- import { ApiKeyRow, BundleEventRow, BundleEventRowBase, BundlePatchRow, BundleRow, ChannelRow, DatabaseBundleEventMetadata, DatabaseBundleMetadata, DatabaseJsonObject, DatabaseJsonValue, ReleaseCatalogRow, ReleaseRow } from "./databaseRows.cjs";
1
+ import { AggregateBatching, ConfiguredDatabase, EngineDatabase, RemoteDatabase, isRemoteDatabase } from "./databaseConfig.cjs";
2
+ import { BundlePatchRow, BundleRow, ChannelRow, DatabaseBundleMetadata, DatabaseJsonObject, DatabaseJsonValue, ReleaseCatalogRow, ReleaseRow } from "./databaseRows.cjs";
3
3
  import { BundleRowUpdate, ReleaseCatalogRowUpdate, ReleaseRowUpdate } from "./databaseOperations.cjs";
4
- import { InsightsBundleEventFilter, InsightsCountEventsInput, InsightsCountLatestEventsInput, InsightsCoverage, InsightsEventCursor, InsightsEventFilter, InsightsFindLatestEventsInput, InsightsGetAppUsageInput, InsightsGetAppUsageResult, InsightsGetReleaseActivityInput, InsightsGetReleaseActivityResult, InsightsListEventsInput, InsightsModel, InsightsRecordEventInput, InsightsScope, InsightsTimeRange, ReleaseActivityMetrics, ReleaseReference } from "./insights.cjs";
5
- import { ApiKeyModel, ChannelDeleteResult, ChannelInsertResult } from "./models.cjs";
6
- export { type ApiKeyModel, type ApiKeyRow, type BundleEventRow, type BundleEventRowBase, type BundlePatchRow, type BundleRow, type BundleRowUpdate, type ChannelDeleteResult, type ChannelInsertResult, type ChannelRow, type ConfiguredDatabase, type DatabaseBundleEventMetadata, type DatabaseBundleMetadata, type DatabaseJsonObject, type DatabaseJsonValue, type EngineDatabase, type InsightsBundleEventFilter, type InsightsCountEventsInput, type InsightsCountLatestEventsInput, type InsightsCoverage, type InsightsEventCursor, type InsightsEventFilter, type InsightsFindLatestEventsInput, type InsightsGetAppUsageInput, type InsightsGetAppUsageResult, type InsightsGetReleaseActivityInput, type InsightsGetReleaseActivityResult, type InsightsListEventsInput, type InsightsModel, type InsightsRecordEventInput, type InsightsScope, type InsightsTimeRange, type ReleaseActivityMetrics, type ReleaseCatalogRow, type ReleaseCatalogRowUpdate, type ReleaseReference, type ReleaseRow, type ReleaseRowUpdate, type RemoteDatabase, isRemoteDatabase };
4
+ import { ChannelDeleteResult, ChannelInsertResult } from "./models.cjs";
5
+ export { type AggregateBatching, type BundlePatchRow, type BundleRow, type BundleRowUpdate, type ChannelDeleteResult, type ChannelInsertResult, type ChannelRow, type ConfiguredDatabase, type DatabaseBundleMetadata, type DatabaseJsonObject, type DatabaseJsonValue, type EngineDatabase, type ReleaseCatalogRow, type ReleaseCatalogRowUpdate, type ReleaseRow, type ReleaseRowUpdate, type RemoteDatabase, isRemoteDatabase };
@@ -1,6 +1,5 @@
1
- import { ConfiguredDatabase, EngineDatabase, RemoteDatabase, isRemoteDatabase } from "./databaseConfig.mjs";
2
- import { ApiKeyRow, BundleEventRow, BundleEventRowBase, BundlePatchRow, BundleRow, ChannelRow, DatabaseBundleEventMetadata, DatabaseBundleMetadata, DatabaseJsonObject, DatabaseJsonValue, ReleaseCatalogRow, ReleaseRow } from "./databaseRows.mjs";
1
+ import { AggregateBatching, ConfiguredDatabase, EngineDatabase, RemoteDatabase, isRemoteDatabase } from "./databaseConfig.mjs";
2
+ import { BundlePatchRow, BundleRow, ChannelRow, DatabaseBundleMetadata, DatabaseJsonObject, DatabaseJsonValue, ReleaseCatalogRow, ReleaseRow } from "./databaseRows.mjs";
3
3
  import { BundleRowUpdate, ReleaseCatalogRowUpdate, ReleaseRowUpdate } from "./databaseOperations.mjs";
4
- import { InsightsBundleEventFilter, InsightsCountEventsInput, InsightsCountLatestEventsInput, InsightsCoverage, InsightsEventCursor, InsightsEventFilter, InsightsFindLatestEventsInput, InsightsGetAppUsageInput, InsightsGetAppUsageResult, InsightsGetReleaseActivityInput, InsightsGetReleaseActivityResult, InsightsListEventsInput, InsightsModel, InsightsRecordEventInput, InsightsScope, InsightsTimeRange, ReleaseActivityMetrics, ReleaseReference } from "./insights.mjs";
5
- import { ApiKeyModel, ChannelDeleteResult, ChannelInsertResult } from "./models.mjs";
6
- export { type ApiKeyModel, type ApiKeyRow, type BundleEventRow, type BundleEventRowBase, type BundlePatchRow, type BundleRow, type BundleRowUpdate, type ChannelDeleteResult, type ChannelInsertResult, type ChannelRow, type ConfiguredDatabase, type DatabaseBundleEventMetadata, type DatabaseBundleMetadata, type DatabaseJsonObject, type DatabaseJsonValue, type EngineDatabase, type InsightsBundleEventFilter, type InsightsCountEventsInput, type InsightsCountLatestEventsInput, type InsightsCoverage, type InsightsEventCursor, type InsightsEventFilter, type InsightsFindLatestEventsInput, type InsightsGetAppUsageInput, type InsightsGetAppUsageResult, type InsightsGetReleaseActivityInput, type InsightsGetReleaseActivityResult, type InsightsListEventsInput, type InsightsModel, type InsightsRecordEventInput, type InsightsScope, type InsightsTimeRange, type ReleaseActivityMetrics, type ReleaseCatalogRow, type ReleaseCatalogRowUpdate, type ReleaseReference, type ReleaseRow, type ReleaseRowUpdate, type RemoteDatabase, isRemoteDatabase };
4
+ import { ChannelDeleteResult, ChannelInsertResult } from "./models.mjs";
5
+ export { type AggregateBatching, type BundlePatchRow, type BundleRow, type BundleRowUpdate, type ChannelDeleteResult, type ChannelInsertResult, type ChannelRow, type ConfiguredDatabase, type DatabaseBundleMetadata, type DatabaseJsonObject, type DatabaseJsonValue, type EngineDatabase, type ReleaseCatalogRow, type ReleaseCatalogRowUpdate, type ReleaseRow, type ReleaseRowUpdate, type RemoteDatabase, isRemoteDatabase };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hot-updater/plugin-core",
3
- "version": "1.0.0-rc.16",
3
+ "version": "1.0.0-rc.17",
4
4
  "type": "module",
5
5
  "description": "React Native OTA solution for self-hosted",
6
6
  "sideEffects": false,
@@ -1,42 +0,0 @@
1
- const require_databaseErrors = require("./databaseErrors.cjs");
2
- const require_databaseJsonValue = require("./databaseJsonValue.cjs");
3
- //#region src/bundleEventRow.ts
4
- const isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
5
- const isIdentity = (value) => typeof value === "string" && value.length > 0 && value.length <= 255;
6
- const isTextOrNull = (value) => value === null || typeof value === "string";
7
- /** Each bundle event field and what it holds. */
8
- const BUNDLE_EVENT_FIELDS = {
9
- id: (value) => typeof value === "string",
10
- type: (value) => value === "UPDATE_DOWNLOADED" || value === "UPDATE_APPLIED" || value === "RECOVERED" || value === "UNCHANGED",
11
- install_id: isIdentity,
12
- user_id: (value) => value === null || isIdentity(value),
13
- from_bundle_id: isTextOrNull,
14
- from_release_id: isTextOrNull,
15
- to_release_id: isTextOrNull,
16
- to_bundle_id: (value) => typeof value === "string",
17
- platform: (value) => value === "ios" || value === "android",
18
- app_version: (value) => typeof value === "string",
19
- channel: (value) => typeof value === "string",
20
- metadata: require_databaseJsonValue.isDatabaseBundleEventMetadata,
21
- received_at_ms: (value) => typeof value === "number" && Number.isSafeInteger(value) && value >= 0
22
- };
23
- const updateStrategyOf = (row) => isRecord(row.metadata) ? row.metadata.update_strategy : void 0;
24
- /**
25
- * A movement names the bundle it left and how the device updates; an
26
- * unchanged report names neither.
27
- */
28
- const hasEventInvariants = (row) => (row.type === "UPDATE_DOWNLOADED" || row.type === "UPDATE_APPLIED" || row.type === "RECOVERED") && typeof row.from_bundle_id === "string" && (updateStrategyOf(row) === "fingerprint" || updateStrategyOf(row) === "appVersion") || row.type === "UNCHANGED" && row.from_bundle_id === null && updateStrategyOf(row) === null;
29
- /**
30
- * Throws unless `row` has exactly the bundle event fields, each of its type,
31
- * and the invariants of its event type: `invalid-field` for an unknown field,
32
- * `invalid-data` for anything else.
33
- */
34
- const validateBundleEventFields = (row) => {
35
- if (!isRecord(row)) throw new require_databaseErrors.DatabasePluginInputError("invalid-data");
36
- for (const field of Object.keys(row)) if (!Object.hasOwn(BUNDLE_EVENT_FIELDS, field)) throw new require_databaseErrors.DatabasePluginInputError("invalid-field");
37
- for (const [field, valid] of Object.entries(BUNDLE_EVENT_FIELDS)) if (!Object.hasOwn(row, field) || !valid(row[field])) throw new require_databaseErrors.DatabasePluginInputError("invalid-data");
38
- if (!hasEventInvariants(row)) throw new require_databaseErrors.DatabasePluginInputError("invalid-data");
39
- };
40
- //#endregion
41
- exports.isRecord = isRecord;
42
- exports.validateBundleEventFields = validateBundleEventFields;