@hot-updater/plugin-core 1.0.0-rc.1 → 1.0.0-rc.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/_rolldown/runtime.cjs +1 -1
- package/dist/assetStorageLayout.cjs +4 -2
- package/dist/assetStorageLayout.d.cts +5 -24
- package/dist/assetStorageLayout.d.mts +5 -24
- package/dist/assetStorageLayout.mjs +4 -2
- package/dist/bundleStorageLayout.cjs +7 -0
- package/dist/bundleStorageLayout.d.cts +5 -1
- package/dist/bundleStorageLayout.d.mts +5 -1
- package/dist/bundleStorageLayout.mjs +7 -1
- package/dist/calculatePagination.d.cts +0 -1
- package/dist/calculatePagination.d.mts +0 -1
- package/dist/contentAddressedAssets.d.cts +1 -4
- package/dist/contentAddressedAssets.d.mts +1 -4
- package/dist/contentType.cjs +9 -0
- package/dist/contentType.d.cts +4 -0
- package/dist/contentType.d.mts +4 -0
- package/dist/contentType.mjs +7 -0
- package/dist/createDatabasePlugin.cjs +118 -42
- package/dist/createDatabasePlugin.d.cts +3 -1
- package/dist/createDatabasePlugin.d.mts +3 -1
- package/dist/createDatabasePlugin.mjs +118 -43
- package/dist/createStoragePlugin.d.cts +0 -1
- package/dist/createStoragePlugin.d.mts +0 -1
- package/dist/databaseClient.cjs +6 -1
- package/dist/databaseClient.d.cts +1 -2
- package/dist/databaseClient.d.mts +1 -2
- package/dist/databaseClient.mjs +6 -2
- package/dist/databaseClientReads.cjs +3 -1
- package/dist/databaseClientReads.mjs +3 -2
- package/dist/databaseClientUpdates.cjs +2 -4
- package/dist/databaseClientUpdates.d.cts +1 -1
- package/dist/databaseClientUpdates.d.mts +1 -1
- package/dist/databaseClientUpdates.mjs +2 -3
- package/dist/databaseJsonValue.cjs +4 -0
- package/dist/databaseJsonValue.d.cts +4 -2
- package/dist/databaseJsonValue.d.mts +4 -2
- package/dist/databaseJsonValue.mjs +2 -1
- package/dist/databaseMetadata.cjs +0 -1
- package/dist/databasePluginCrud.cjs +1 -0
- package/dist/databasePluginCrud.d.cts +4 -1
- package/dist/databasePluginCrud.d.mts +4 -1
- package/dist/databasePluginCrud.mjs +1 -1
- package/dist/databasePluginCrudValidation.d.cts +6 -1
- package/dist/databasePluginCrudValidation.d.mts +6 -1
- package/dist/databasePluginCrudValidationErrors.cjs +1 -0
- package/dist/databasePluginCrudValidationErrors.mjs +1 -0
- package/dist/databasePluginCrudValidationFields.cjs +24 -31
- package/dist/databasePluginCrudValidationFields.d.cts +1 -1
- package/dist/databasePluginCrudValidationFields.d.mts +1 -1
- package/dist/databasePluginCrudValidationFields.mjs +23 -32
- package/dist/databasePluginCrudValidationMutations.cjs +1 -1
- package/dist/databasePluginCrudValidationMutations.d.cts +1 -1
- package/dist/databasePluginCrudValidationMutations.d.mts +1 -1
- package/dist/databasePluginCrudValidationMutations.mjs +1 -1
- package/dist/databasePluginCrudValidationQueries.d.cts +2 -1
- package/dist/databasePluginCrudValidationQueries.d.mts +2 -1
- package/dist/databasePluginCrudValidationRows.cjs +2 -2
- package/dist/databasePluginCrudValidationRows.d.cts +1 -1
- package/dist/databasePluginCrudValidationRows.d.mts +1 -1
- package/dist/databasePluginCrudValidationRows.mjs +2 -2
- package/dist/databaseRows.cjs +0 -7
- package/dist/databaseRows.d.cts +2 -6
- package/dist/databaseRows.d.mts +2 -6
- package/dist/databaseRows.mjs +0 -6
- package/dist/index.cjs +8 -6
- package/dist/index.d.cts +7 -6
- package/dist/index.d.mts +7 -6
- package/dist/index.mjs +5 -4
- package/dist/insightsContract.cjs +192 -0
- package/dist/insightsContract.d.cts +9 -0
- package/dist/insightsContract.d.mts +9 -0
- package/dist/insightsContract.mjs +189 -0
- package/dist/insightsDistinctSummary.cjs +72 -0
- package/dist/insightsDistinctSummary.d.cts +12 -0
- package/dist/insightsDistinctSummary.d.mts +12 -0
- package/dist/insightsDistinctSummary.mjs +68 -0
- package/dist/insightsLatestQueries.cjs +53 -0
- package/dist/insightsLatestQueries.d.cts +13 -0
- package/dist/insightsLatestQueries.d.mts +13 -0
- package/dist/insightsLatestQueries.mjs +52 -0
- package/dist/insightsOverview.cjs +139 -0
- package/dist/insightsOverview.d.cts +40 -0
- package/dist/insightsOverview.d.mts +40 -0
- package/dist/insightsOverview.mjs +135 -0
- package/dist/internal.cjs +15 -0
- package/dist/internal.d.cts +7 -3
- package/dist/internal.d.mts +7 -3
- package/dist/internal.mjs +4 -1
- package/dist/node_modules/.pnpm/verkit@0.4.0/node_modules/verkit/dist/comparison-DenM3wCn.cjs +136 -0
- package/dist/node_modules/.pnpm/verkit@0.4.0/node_modules/verkit/dist/comparison-DenM3wCn.mjs +116 -0
- package/dist/node_modules/.pnpm/verkit@0.4.0/node_modules/verkit/dist/range-DvX-Y6iv.cjs +167 -0
- package/dist/node_modules/.pnpm/verkit@0.4.0/node_modules/verkit/dist/range-DvX-Y6iv.mjs +165 -0
- package/dist/node_modules/.pnpm/verkit@0.4.0/node_modules/verkit/dist/set-CC5YeoYX.cjs +42 -0
- package/dist/node_modules/.pnpm/verkit@0.4.0/node_modules/verkit/dist/set-CC5YeoYX.mjs +39 -0
- package/dist/node_modules/.pnpm/verkit@0.4.0/node_modules/verkit/dist/version-CQ98ZBpL.cjs +39 -0
- package/dist/node_modules/.pnpm/verkit@0.4.0/node_modules/verkit/dist/version-CQ98ZBpL.mjs +37 -0
- package/dist/paginateBundles.d.cts +1 -8
- package/dist/paginateBundles.d.mts +1 -8
- package/dist/parseStorageUri.d.cts +1 -5
- package/dist/parseStorageUri.d.mts +1 -5
- package/dist/queryBundles.d.cts +0 -1
- package/dist/queryBundles.d.mts +0 -1
- package/dist/releaseCatalogCompiler.cjs +15 -12
- package/dist/releaseCatalogCompiler.d.cts +0 -1
- package/dist/releaseCatalogCompiler.d.mts +0 -1
- package/dist/releaseCatalogCompiler.mjs +11 -7
- package/dist/releaseCatalogMutation.cjs +1 -1
- package/dist/releaseCatalogMutation.d.cts +1 -1
- package/dist/releaseCatalogMutation.d.mts +1 -1
- package/dist/releaseCatalogMutation.mjs +1 -0
- package/dist/releaseManagement.cjs +3 -2
- package/dist/releaseManagement.d.cts +1 -1
- package/dist/releaseManagement.d.mts +1 -1
- package/dist/releaseManagement.mjs +3 -1
- package/dist/remoteBundleSigning.cjs +4 -4
- package/dist/remoteBundleSigning.d.cts +2 -13
- package/dist/remoteBundleSigning.d.mts +2 -13
- package/dist/remoteBundleSigning.mjs +4 -4
- package/dist/requestBundleCache.d.cts +1 -2
- package/dist/requestBundleCache.d.mts +1 -2
- package/dist/semverSatisfies.cjs +4 -3
- package/dist/semverSatisfies.mjs +2 -1
- package/dist/storageDownloadPath.cjs +2 -1
- package/dist/storageDownloadPath.d.cts +1 -3
- package/dist/storageDownloadPath.d.mts +1 -3
- package/dist/storageDownloadPath.mjs +2 -1
- package/dist/types/database.d.cts +4 -3
- package/dist/types/database.d.mts +4 -3
- package/dist/types/databaseFields.cjs +1 -8
- package/dist/types/databaseFields.d.cts +2 -2
- package/dist/types/databaseFields.d.mts +2 -2
- package/dist/types/databaseFields.mjs +1 -8
- package/dist/types/databaseOperations.d.cts +17 -12
- package/dist/types/databaseOperations.d.mts +17 -12
- package/dist/types/databasePlugin.d.cts +159 -11
- package/dist/types/databasePlugin.d.mts +159 -11
- package/dist/types/databaseQuery.d.cts +2 -3
- package/dist/types/databaseQuery.d.mts +2 -3
- package/dist/types/databaseRows.d.cts +19 -17
- package/dist/types/databaseRows.d.mts +19 -17
- package/dist/types/index.d.cts +12 -20
- package/dist/types/index.d.mts +12 -20
- package/dist/types/internal.d.cts +4 -3
- package/dist/types/internal.d.mts +4 -3
- package/dist/types/public.d.cts +4 -3
- package/dist/types/public.d.mts +4 -3
- package/dist/types/utils.d.cts +1 -1
- package/dist/types/utils.d.mts +1 -1
- package/dist/uuidv7.cjs +7 -2
- package/dist/uuidv7.d.cts +0 -1
- package/dist/uuidv7.d.mts +0 -1
- package/dist/uuidv7.mjs +1 -1
- package/package.json +4 -4
- package/dist/compressionFormat.cjs +0 -55
- package/dist/compressionFormat.d.cts +0 -33
- package/dist/compressionFormat.d.mts +0 -33
- package/dist/compressionFormat.mjs +0 -51
- package/dist/node_modules/.pnpm/verkit@0.3.2/node_modules/verkit/dist/index.cjs +0 -345
- package/dist/node_modules/.pnpm/verkit@0.3.2/node_modules/verkit/dist/index.mjs +0 -341
|
@@ -4,9 +4,7 @@ declare const parseStorageDownloadPath: (path: string) => {
|
|
|
4
4
|
signature: string;
|
|
5
5
|
storageUri: string;
|
|
6
6
|
} | null;
|
|
7
|
-
declare const createStorageDownloadUrl: (signingKey: string) => ({
|
|
8
|
-
storageUri
|
|
9
|
-
}: {
|
|
7
|
+
declare const createStorageDownloadUrl: (signingKey: string) => ({ storageUri }: {
|
|
10
8
|
readonly storageUri: string;
|
|
11
9
|
}) => Promise<{
|
|
12
10
|
url: string;
|
|
@@ -39,7 +39,8 @@ const createStorageDownloadUrl = (signingKey) => {
|
|
|
39
39
|
name: "HMAC"
|
|
40
40
|
}, false, ["sign"]);
|
|
41
41
|
return async ({ storageUri }) => {
|
|
42
|
-
|
|
42
|
+
const signature = encodeBytes(new Uint8Array(await crypto.subtle.sign("HMAC", await key, new TextEncoder().encode(storageUri))));
|
|
43
|
+
return { url: createStorageDownloadPath(storageUri, signature) };
|
|
43
44
|
};
|
|
44
45
|
};
|
|
45
46
|
//#endregion
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { ApiKeyRow, BundleEventRow, BundleEventRowBase, BundlePatchRow, BundleRow, ChannelRow, DatabaseBundleMetadata, DatabaseField, DatabaseJsonObject, DatabaseJsonValue, DatabaseModel, DatabaseModelMap, DatabaseRow, ReleaseCatalogRow, ReleaseRow } from "./databaseRows.cjs";
|
|
2
|
-
import { ApiKeyModel, BundleModel, BundleModelQuery, BundlePatchModel, BundleRepository, BundleRepositoryChange, BundleRepositoryCommit, ChannelDeleteInput, ChannelDeleteResult, ChannelInsertInput, ChannelInsertResult, ChannelModel, DatabaseChange, DatabaseCommit, DatabaseCommitExpectation, DatabaseCommitResult, DatabaseModels, DatabasePlugin, InsightsModel,
|
|
1
|
+
import { ApiKeyRow, BundleEventRow, BundleEventRowBase, BundlePatchRow, BundleRow, ChannelRow, DatabaseBundleEventMetadata, DatabaseBundleMetadata, DatabaseField, DatabaseJsonObject, DatabaseJsonValue, DatabaseModel, DatabaseModelMap, DatabaseRow, ReleaseCatalogRow, ReleaseRow } from "./databaseRows.cjs";
|
|
2
|
+
import { ApiKeyModel, BundleModel, BundleModelQuery, BundlePatchModel, BundleRepository, BundleRepositoryChange, BundleRepositoryCommit, ChannelDeleteInput, ChannelDeleteResult, ChannelInsertInput, ChannelInsertResult, ChannelModel, DatabaseChange, DatabaseCommit, DatabaseCommitExpectation, DatabaseCommitResult, DatabaseModels, DatabasePlugin, InsightsBundleEventFilter, InsightsCountEventsInput, InsightsCountLatestEventsInput, InsightsCoverage, InsightsEventCursor, InsightsEventFilter, InsightsFindLatestEventsInput, InsightsGetAppUsageInput, InsightsGetAppUsageResult, InsightsGetReleaseActivityInput, InsightsGetReleaseActivityResult, InsightsListEventsInput, InsightsModel, InsightsRecordEventInput, InsightsScope, InsightsTimeRange, ReleaseActivityMetrics, ReleaseCatalogModel, ReleaseModel, ReleaseReference } from "./databasePlugin.cjs";
|
|
3
3
|
import { DatabaseDistinctFields, DatabaseDistinctOn, DatabaseOrderBy, DatabaseSelect, DatabaseSortBy, DatabaseSortClause, DatabaseSortNulls, DatabaseStringComparisonMode, DatabaseWhere, DatabaseWhereConnector, DatabaseWhereOperator, SelectedDatabaseRow } from "./databaseQuery.cjs";
|
|
4
|
-
import { ApiKeyRowUpdate, BundleRowUpdate, CountBundlesDatabaseImplementationInput, CountBundlesDatabaseInput, CountDatabaseImplementationInput, CountDatabaseInput, CountDatabaseModel, CreateDatabaseImplementationInput, CreateDatabaseInput, CreateDatabaseModel, DatabaseCapability, DatabaseDeleteModel, DatabaseFindOneModel, DatabaseImplementationResult, DatabaseModelCapabilities, DatabaseModelsWithCapability, DatabasePluginCrud, DatabasePluginImplementation, DatabaseRowUpdate, DeleteDatabaseImplementationInput, DeleteDatabaseInput, DeleteDatabaseModel, FindManyDatabaseImplementationInput, FindManyDatabaseInput, FindManyDatabaseModel, FindManyDatabasePluginInput, FindOneDatabaseImplementationInput, FindOneDatabaseInput, FindOneDatabaseModel, ReleaseCatalogRowUpdate, ReleaseRowUpdate, SelectedDatabaseInputRow, TransactionDatabasePluginImplementation, UpdateBundleDatabaseImplementationInput, UpdateBundleDatabaseInput, UpdateDatabaseImplementationInput, UpdateDatabaseInput, UpdateDatabaseModel } from "./databaseOperations.cjs";
|
|
4
|
+
import { ApiKeyRowUpdate, BundleRowUpdate, CountBundlesDatabaseImplementationInput, CountBundlesDatabaseInput, CountDatabaseImplementationInput, CountDatabaseInput, CountDatabaseModel, CreateDatabaseImplementationInput, CreateDatabaseInput, CreateDatabaseModel, DatabaseCapability, DatabaseDeleteModel, DatabaseFindOneModel, DatabaseImplementationResult, DatabaseModelCapabilities, DatabaseModelsWithCapability, DatabasePluginCrud, DatabasePluginImplementation, DatabaseRowUpdate, DeleteDatabaseImplementationInput, DeleteDatabaseInput, DeleteDatabaseModel, FindManyDatabaseImplementationInput, FindManyDatabaseInput, FindManyDatabaseModel, FindManyDatabasePluginInput, FindOneDatabaseImplementationInput, FindOneDatabaseInput, FindOneDatabaseModel, ReleaseCatalogRowUpdate, ReleaseRowUpdate, SelectedDatabaseInputRow, TransactionDatabasePluginImplementation, UpdateBundleDatabaseImplementationInput, UpdateBundleDatabaseInput, UpdateDatabaseImplementationInput, UpdateDatabaseInput, UpdateDatabaseModel } from "./databaseOperations.cjs";
|
|
5
|
+
export { ApiKeyModel, ApiKeyRow, ApiKeyRowUpdate, BundleEventRow, BundleEventRowBase, BundleModel, BundleModelQuery, BundlePatchModel, BundlePatchRow, BundleRepository, BundleRepositoryChange, BundleRepositoryCommit, BundleRow, BundleRowUpdate, ChannelDeleteInput, ChannelDeleteResult, ChannelInsertInput, ChannelInsertResult, ChannelModel, ChannelRow, CountBundlesDatabaseImplementationInput, CountBundlesDatabaseInput, CountDatabaseImplementationInput, CountDatabaseInput, CountDatabaseModel, CreateDatabaseImplementationInput, CreateDatabaseInput, CreateDatabaseModel, DatabaseBundleEventMetadata, DatabaseBundleMetadata, DatabaseCapability, DatabaseChange, DatabaseCommit, DatabaseCommitExpectation, DatabaseCommitResult, DatabaseDeleteModel, DatabaseDistinctFields, DatabaseDistinctOn, DatabaseField, DatabaseFindOneModel, DatabaseImplementationResult, DatabaseJsonObject, DatabaseJsonValue, DatabaseModel, DatabaseModelCapabilities, DatabaseModelMap, DatabaseModels, DatabaseModelsWithCapability, DatabaseOrderBy, DatabasePlugin, DatabasePluginCrud, DatabasePluginImplementation, DatabaseRow, DatabaseRowUpdate, DatabaseSelect, DatabaseSortBy, DatabaseSortClause, DatabaseSortNulls, DatabaseStringComparisonMode, DatabaseWhere, DatabaseWhereConnector, DatabaseWhereOperator, DeleteDatabaseImplementationInput, DeleteDatabaseInput, DeleteDatabaseModel, FindManyDatabaseImplementationInput, FindManyDatabaseInput, FindManyDatabaseModel, FindManyDatabasePluginInput, FindOneDatabaseImplementationInput, FindOneDatabaseInput, FindOneDatabaseModel, InsightsBundleEventFilter, InsightsCountEventsInput, InsightsCountLatestEventsInput, InsightsCoverage, InsightsEventCursor, InsightsEventFilter, InsightsFindLatestEventsInput, InsightsGetAppUsageInput, InsightsGetAppUsageResult, InsightsGetReleaseActivityInput, InsightsGetReleaseActivityResult, InsightsListEventsInput, InsightsModel, InsightsRecordEventInput, InsightsScope, InsightsTimeRange, ReleaseActivityMetrics, ReleaseCatalogModel, ReleaseCatalogRow, ReleaseCatalogRowUpdate, ReleaseModel, ReleaseReference, ReleaseRow, ReleaseRowUpdate, SelectedDatabaseInputRow, SelectedDatabaseRow, TransactionDatabasePluginImplementation, UpdateBundleDatabaseImplementationInput, UpdateBundleDatabaseInput, UpdateDatabaseImplementationInput, UpdateDatabaseInput, UpdateDatabaseModel };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { ApiKeyRow, BundleEventRow, BundleEventRowBase, BundlePatchRow, BundleRow, ChannelRow, DatabaseBundleMetadata, DatabaseField, DatabaseJsonObject, DatabaseJsonValue, DatabaseModel, DatabaseModelMap, DatabaseRow, ReleaseCatalogRow, ReleaseRow } from "./databaseRows.mjs";
|
|
2
|
-
import { ApiKeyModel, BundleModel, BundleModelQuery, BundlePatchModel, BundleRepository, BundleRepositoryChange, BundleRepositoryCommit, ChannelDeleteInput, ChannelDeleteResult, ChannelInsertInput, ChannelInsertResult, ChannelModel, DatabaseChange, DatabaseCommit, DatabaseCommitExpectation, DatabaseCommitResult, DatabaseModels, DatabasePlugin, InsightsModel,
|
|
1
|
+
import { ApiKeyRow, BundleEventRow, BundleEventRowBase, BundlePatchRow, BundleRow, ChannelRow, DatabaseBundleEventMetadata, DatabaseBundleMetadata, DatabaseField, DatabaseJsonObject, DatabaseJsonValue, DatabaseModel, DatabaseModelMap, DatabaseRow, ReleaseCatalogRow, ReleaseRow } from "./databaseRows.mjs";
|
|
2
|
+
import { ApiKeyModel, BundleModel, BundleModelQuery, BundlePatchModel, BundleRepository, BundleRepositoryChange, BundleRepositoryCommit, ChannelDeleteInput, ChannelDeleteResult, ChannelInsertInput, ChannelInsertResult, ChannelModel, DatabaseChange, DatabaseCommit, DatabaseCommitExpectation, DatabaseCommitResult, DatabaseModels, DatabasePlugin, InsightsBundleEventFilter, InsightsCountEventsInput, InsightsCountLatestEventsInput, InsightsCoverage, InsightsEventCursor, InsightsEventFilter, InsightsFindLatestEventsInput, InsightsGetAppUsageInput, InsightsGetAppUsageResult, InsightsGetReleaseActivityInput, InsightsGetReleaseActivityResult, InsightsListEventsInput, InsightsModel, InsightsRecordEventInput, InsightsScope, InsightsTimeRange, ReleaseActivityMetrics, ReleaseCatalogModel, ReleaseModel, ReleaseReference } from "./databasePlugin.mjs";
|
|
3
3
|
import { DatabaseDistinctFields, DatabaseDistinctOn, DatabaseOrderBy, DatabaseSelect, DatabaseSortBy, DatabaseSortClause, DatabaseSortNulls, DatabaseStringComparisonMode, DatabaseWhere, DatabaseWhereConnector, DatabaseWhereOperator, SelectedDatabaseRow } from "./databaseQuery.mjs";
|
|
4
|
-
import { ApiKeyRowUpdate, BundleRowUpdate, CountBundlesDatabaseImplementationInput, CountBundlesDatabaseInput, CountDatabaseImplementationInput, CountDatabaseInput, CountDatabaseModel, CreateDatabaseImplementationInput, CreateDatabaseInput, CreateDatabaseModel, DatabaseCapability, DatabaseDeleteModel, DatabaseFindOneModel, DatabaseImplementationResult, DatabaseModelCapabilities, DatabaseModelsWithCapability, DatabasePluginCrud, DatabasePluginImplementation, DatabaseRowUpdate, DeleteDatabaseImplementationInput, DeleteDatabaseInput, DeleteDatabaseModel, FindManyDatabaseImplementationInput, FindManyDatabaseInput, FindManyDatabaseModel, FindManyDatabasePluginInput, FindOneDatabaseImplementationInput, FindOneDatabaseInput, FindOneDatabaseModel, ReleaseCatalogRowUpdate, ReleaseRowUpdate, SelectedDatabaseInputRow, TransactionDatabasePluginImplementation, UpdateBundleDatabaseImplementationInput, UpdateBundleDatabaseInput, UpdateDatabaseImplementationInput, UpdateDatabaseInput, UpdateDatabaseModel } from "./databaseOperations.mjs";
|
|
4
|
+
import { ApiKeyRowUpdate, BundleRowUpdate, CountBundlesDatabaseImplementationInput, CountBundlesDatabaseInput, CountDatabaseImplementationInput, CountDatabaseInput, CountDatabaseModel, CreateDatabaseImplementationInput, CreateDatabaseInput, CreateDatabaseModel, DatabaseCapability, DatabaseDeleteModel, DatabaseFindOneModel, DatabaseImplementationResult, DatabaseModelCapabilities, DatabaseModelsWithCapability, DatabasePluginCrud, DatabasePluginImplementation, DatabaseRowUpdate, DeleteDatabaseImplementationInput, DeleteDatabaseInput, DeleteDatabaseModel, FindManyDatabaseImplementationInput, FindManyDatabaseInput, FindManyDatabaseModel, FindManyDatabasePluginInput, FindOneDatabaseImplementationInput, FindOneDatabaseInput, FindOneDatabaseModel, ReleaseCatalogRowUpdate, ReleaseRowUpdate, SelectedDatabaseInputRow, TransactionDatabasePluginImplementation, UpdateBundleDatabaseImplementationInput, UpdateBundleDatabaseInput, UpdateDatabaseImplementationInput, UpdateDatabaseInput, UpdateDatabaseModel } from "./databaseOperations.mjs";
|
|
5
|
+
export { ApiKeyModel, ApiKeyRow, ApiKeyRowUpdate, BundleEventRow, BundleEventRowBase, BundleModel, BundleModelQuery, BundlePatchModel, BundlePatchRow, BundleRepository, BundleRepositoryChange, BundleRepositoryCommit, BundleRow, BundleRowUpdate, ChannelDeleteInput, ChannelDeleteResult, ChannelInsertInput, ChannelInsertResult, ChannelModel, ChannelRow, CountBundlesDatabaseImplementationInput, CountBundlesDatabaseInput, CountDatabaseImplementationInput, CountDatabaseInput, CountDatabaseModel, CreateDatabaseImplementationInput, CreateDatabaseInput, CreateDatabaseModel, DatabaseBundleEventMetadata, DatabaseBundleMetadata, DatabaseCapability, DatabaseChange, DatabaseCommit, DatabaseCommitExpectation, DatabaseCommitResult, DatabaseDeleteModel, DatabaseDistinctFields, DatabaseDistinctOn, DatabaseField, DatabaseFindOneModel, DatabaseImplementationResult, DatabaseJsonObject, DatabaseJsonValue, DatabaseModel, DatabaseModelCapabilities, DatabaseModelMap, DatabaseModels, DatabaseModelsWithCapability, DatabaseOrderBy, DatabasePlugin, DatabasePluginCrud, DatabasePluginImplementation, DatabaseRow, DatabaseRowUpdate, DatabaseSelect, DatabaseSortBy, DatabaseSortClause, DatabaseSortNulls, DatabaseStringComparisonMode, DatabaseWhere, DatabaseWhereConnector, DatabaseWhereOperator, DeleteDatabaseImplementationInput, DeleteDatabaseInput, DeleteDatabaseModel, FindManyDatabaseImplementationInput, FindManyDatabaseInput, FindManyDatabaseModel, FindManyDatabasePluginInput, FindOneDatabaseImplementationInput, FindOneDatabaseInput, FindOneDatabaseModel, InsightsBundleEventFilter, InsightsCountEventsInput, InsightsCountLatestEventsInput, InsightsCoverage, InsightsEventCursor, InsightsEventFilter, InsightsFindLatestEventsInput, InsightsGetAppUsageInput, InsightsGetAppUsageResult, InsightsGetReleaseActivityInput, InsightsGetReleaseActivityResult, InsightsListEventsInput, InsightsModel, InsightsRecordEventInput, InsightsScope, InsightsTimeRange, ReleaseActivityMetrics, ReleaseCatalogModel, ReleaseCatalogRow, ReleaseCatalogRowUpdate, ReleaseModel, ReleaseReference, ReleaseRow, ReleaseRowUpdate, SelectedDatabaseInputRow, SelectedDatabaseRow, TransactionDatabasePluginImplementation, UpdateBundleDatabaseImplementationInput, UpdateBundleDatabaseInput, UpdateDatabaseImplementationInput, UpdateDatabaseInput, UpdateDatabaseModel };
|
|
@@ -3,10 +3,7 @@ const databaseFields = {
|
|
|
3
3
|
bundles: [
|
|
4
4
|
"id",
|
|
5
5
|
"platform",
|
|
6
|
-
"file_hash",
|
|
7
6
|
"git_commit_hash",
|
|
8
|
-
"storage_uri",
|
|
9
|
-
"archive_byte_size",
|
|
10
7
|
"metadata",
|
|
11
8
|
"manifest_storage_uri",
|
|
12
9
|
"manifest_file_hash",
|
|
@@ -64,7 +61,6 @@ const databaseFields = {
|
|
|
64
61
|
"type",
|
|
65
62
|
"install_id",
|
|
66
63
|
"user_id",
|
|
67
|
-
"username",
|
|
68
64
|
"from_bundle_id",
|
|
69
65
|
"from_release_id",
|
|
70
66
|
"to_release_id",
|
|
@@ -72,10 +68,7 @@ const databaseFields = {
|
|
|
72
68
|
"platform",
|
|
73
69
|
"app_version",
|
|
74
70
|
"channel",
|
|
75
|
-
"
|
|
76
|
-
"update_strategy",
|
|
77
|
-
"fingerprint_hash",
|
|
78
|
-
"sdk_version",
|
|
71
|
+
"metadata",
|
|
79
72
|
"received_at_ms"
|
|
80
73
|
],
|
|
81
74
|
api_keys: [
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
//#region src/types/databaseFields.d.ts
|
|
2
2
|
declare const databaseFields: {
|
|
3
|
-
readonly bundles: readonly ["id", "platform", "
|
|
3
|
+
readonly bundles: readonly ["id", "platform", "git_commit_hash", "metadata", "manifest_storage_uri", "manifest_file_hash", "asset_base_storage_uri"];
|
|
4
4
|
readonly bundle_patches: readonly ["id", "bundle_id", "base_bundle_id", "base_file_hash", "patch_file_hash", "patch_storage_uri", "byte_size", "order_index"];
|
|
5
5
|
readonly releases: readonly ["id", "revision", "scope_key", "channel_id", "platform", "kind", "bundle_id", "strategy", "target_app_version", "fingerprint_hash", "enabled", "should_force_update", "message", "rollout_cohort_count", "target_cohorts", "operation", "source_release_id", "created_at_ms", "updated_at_ms"];
|
|
6
6
|
readonly release_catalogs: readonly ["scope_key", "catalog_id", "strategy", "channel_id", "channel_key", "platform", "fingerprint_hash", "generation", "payload", "catalog_hash", "byte_size", "is_tombstone", "updated_at_ms"];
|
|
7
7
|
readonly channels: readonly ["id", "name"];
|
|
8
|
-
readonly bundle_events: readonly ["id", "type", "install_id", "user_id", "
|
|
8
|
+
readonly bundle_events: readonly ["id", "type", "install_id", "user_id", "from_bundle_id", "from_release_id", "to_release_id", "to_bundle_id", "platform", "app_version", "channel", "metadata", "received_at_ms"];
|
|
9
9
|
readonly api_keys: readonly ["id", "hash", "name", "prefix", "role", "created_at_ms", "revoked_at_ms"];
|
|
10
10
|
};
|
|
11
11
|
//#endregion
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
//#region src/types/databaseFields.d.ts
|
|
2
2
|
declare const databaseFields: {
|
|
3
|
-
readonly bundles: readonly ["id", "platform", "
|
|
3
|
+
readonly bundles: readonly ["id", "platform", "git_commit_hash", "metadata", "manifest_storage_uri", "manifest_file_hash", "asset_base_storage_uri"];
|
|
4
4
|
readonly bundle_patches: readonly ["id", "bundle_id", "base_bundle_id", "base_file_hash", "patch_file_hash", "patch_storage_uri", "byte_size", "order_index"];
|
|
5
5
|
readonly releases: readonly ["id", "revision", "scope_key", "channel_id", "platform", "kind", "bundle_id", "strategy", "target_app_version", "fingerprint_hash", "enabled", "should_force_update", "message", "rollout_cohort_count", "target_cohorts", "operation", "source_release_id", "created_at_ms", "updated_at_ms"];
|
|
6
6
|
readonly release_catalogs: readonly ["scope_key", "catalog_id", "strategy", "channel_id", "channel_key", "platform", "fingerprint_hash", "generation", "payload", "catalog_hash", "byte_size", "is_tombstone", "updated_at_ms"];
|
|
7
7
|
readonly channels: readonly ["id", "name"];
|
|
8
|
-
readonly bundle_events: readonly ["id", "type", "install_id", "user_id", "
|
|
8
|
+
readonly bundle_events: readonly ["id", "type", "install_id", "user_id", "from_bundle_id", "from_release_id", "to_release_id", "to_bundle_id", "platform", "app_version", "channel", "metadata", "received_at_ms"];
|
|
9
9
|
readonly api_keys: readonly ["id", "hash", "name", "prefix", "role", "created_at_ms", "revoked_at_ms"];
|
|
10
10
|
};
|
|
11
11
|
//#endregion
|
|
@@ -3,10 +3,7 @@ const databaseFields = {
|
|
|
3
3
|
bundles: [
|
|
4
4
|
"id",
|
|
5
5
|
"platform",
|
|
6
|
-
"file_hash",
|
|
7
6
|
"git_commit_hash",
|
|
8
|
-
"storage_uri",
|
|
9
|
-
"archive_byte_size",
|
|
10
7
|
"metadata",
|
|
11
8
|
"manifest_storage_uri",
|
|
12
9
|
"manifest_file_hash",
|
|
@@ -64,7 +61,6 @@ const databaseFields = {
|
|
|
64
61
|
"type",
|
|
65
62
|
"install_id",
|
|
66
63
|
"user_id",
|
|
67
|
-
"username",
|
|
68
64
|
"from_bundle_id",
|
|
69
65
|
"from_release_id",
|
|
70
66
|
"to_release_id",
|
|
@@ -72,10 +68,7 @@ const databaseFields = {
|
|
|
72
68
|
"platform",
|
|
73
69
|
"app_version",
|
|
74
70
|
"channel",
|
|
75
|
-
"
|
|
76
|
-
"update_strategy",
|
|
77
|
-
"fingerprint_hash",
|
|
78
|
-
"sdk_version",
|
|
71
|
+
"metadata",
|
|
79
72
|
"received_at_ms"
|
|
80
73
|
],
|
|
81
74
|
api_keys: [
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { ApiKeyRow, BundleRow, DatabaseModel, DatabaseRow, ReleaseCatalogRow, ReleaseRow } from "./databaseRows.cjs";
|
|
2
|
-
import { ChannelDeleteInput, ChannelDeleteResult, ChannelInsertInput, ChannelInsertResult, DatabaseCommit, DatabaseCommitResult } from "./databasePlugin.cjs";
|
|
2
|
+
import { ChannelDeleteInput, ChannelDeleteResult, ChannelInsertInput, ChannelInsertResult, DatabaseCommit, DatabaseCommitResult, InsightsModel, InsightsRecordEventInput } from "./databasePlugin.cjs";
|
|
3
3
|
import { DatabaseDistinctFields, DatabaseDistinctOn, DatabaseOrderBy, DatabaseSelect, DatabaseWhere, SelectedDatabaseRow } from "./databaseQuery.cjs";
|
|
4
|
-
|
|
5
4
|
//#region src/types/databaseOperations.d.ts
|
|
6
5
|
type DatabaseCapability = "create" | "update" | "delete" | "count" | "findOne" | "findMany";
|
|
7
6
|
type DatabaseModelCapabilities = {
|
|
@@ -49,7 +48,7 @@ type DatabaseModelCapabilities = {
|
|
|
49
48
|
readonly create: true;
|
|
50
49
|
readonly update: false;
|
|
51
50
|
readonly delete: false;
|
|
52
|
-
readonly count:
|
|
51
|
+
readonly count: true;
|
|
53
52
|
readonly findOne: false;
|
|
54
53
|
readonly findMany: true;
|
|
55
54
|
};
|
|
@@ -62,7 +61,7 @@ type DatabaseModelCapabilities = {
|
|
|
62
61
|
readonly findMany: true;
|
|
63
62
|
};
|
|
64
63
|
};
|
|
65
|
-
type DatabaseModelsWithCapability<TCapability extends DatabaseCapability> = { readonly [TModel in DatabaseModel]: DatabaseModelCapabilities[TModel][TCapability] extends true ? TModel : never }[DatabaseModel];
|
|
64
|
+
type DatabaseModelsWithCapability<TCapability extends DatabaseCapability> = { readonly [TModel in DatabaseModel]: DatabaseModelCapabilities[TModel][TCapability] extends true ? TModel : never; }[DatabaseModel];
|
|
66
65
|
type CreateDatabaseModel = DatabaseModelsWithCapability<"create">;
|
|
67
66
|
type UpdateDatabaseModel = DatabaseModelsWithCapability<"update">;
|
|
68
67
|
type DeleteDatabaseModel = DatabaseModelsWithCapability<"delete">;
|
|
@@ -135,19 +134,19 @@ interface DatabasePluginCrud {
|
|
|
135
134
|
findOne<TInput extends FindOneDatabaseImplementationInput>(input: TInput): Promise<SelectedDatabaseInputRow<TInput> | null>;
|
|
136
135
|
findMany<TInput extends FindManyDatabasePluginInput>(input: TInput): Promise<SelectedDatabaseInputRow<TInput>[]>;
|
|
137
136
|
}
|
|
138
|
-
type DatabaseImplementationResult = { readonly [TModel in DatabaseModel]: Partial<DatabaseRow<TModel
|
|
139
|
-
type CreateDatabaseImplementationInput = { readonly [TModel in CreateDatabaseModel]: CreateDatabaseInput<TModel, DatabaseSelect<TModel> | undefined
|
|
140
|
-
type UpdateDatabaseImplementationInput = { readonly [TModel in UpdateDatabaseModel]: UpdateDatabaseInput<TModel, DatabaseSelect<TModel> | undefined
|
|
141
|
-
type DeleteDatabaseImplementationInput = { readonly [TModel in DeleteDatabaseModel]: DeleteDatabaseInput<TModel
|
|
142
|
-
type CountDatabaseImplementationInput = { readonly [TModel in CountDatabaseModel]: CountDatabaseInput<TModel
|
|
137
|
+
type DatabaseImplementationResult = { readonly [TModel in DatabaseModel]: Partial<DatabaseRow<TModel>>; }[DatabaseModel];
|
|
138
|
+
type CreateDatabaseImplementationInput = { readonly [TModel in CreateDatabaseModel]: CreateDatabaseInput<TModel, DatabaseSelect<TModel> | undefined>; }[CreateDatabaseModel];
|
|
139
|
+
type UpdateDatabaseImplementationInput = { readonly [TModel in UpdateDatabaseModel]: UpdateDatabaseInput<TModel, DatabaseSelect<TModel> | undefined>; }[UpdateDatabaseModel];
|
|
140
|
+
type DeleteDatabaseImplementationInput = { readonly [TModel in DeleteDatabaseModel]: DeleteDatabaseInput<TModel>; }[DeleteDatabaseModel];
|
|
141
|
+
type CountDatabaseImplementationInput = { readonly [TModel in CountDatabaseModel]: CountDatabaseInput<TModel>; }[CountDatabaseModel];
|
|
143
142
|
type UpdateBundleDatabaseImplementationInput = UpdateDatabaseInput<"bundles", DatabaseSelect<"bundles"> | undefined>;
|
|
144
143
|
type CountBundlesDatabaseImplementationInput = CountDatabaseInput<"bundles">;
|
|
145
|
-
type FindOneDatabaseImplementationInput = { readonly [TModel in FindOneDatabaseModel]: FindOneDatabaseInput<TModel, DatabaseSelect<TModel> | undefined
|
|
144
|
+
type FindOneDatabaseImplementationInput = { readonly [TModel in FindOneDatabaseModel]: FindOneDatabaseInput<TModel, DatabaseSelect<TModel> | undefined>; }[FindOneDatabaseModel];
|
|
146
145
|
type FindManyDatabaseImplementationInput = { readonly [TModel in FindManyDatabaseModel]: Omit<FindManyDatabaseInput<TModel, DatabaseSelect<TModel> | undefined>, "limit" | "offset"> & {
|
|
147
146
|
readonly limit: number;
|
|
148
147
|
readonly offset: number;
|
|
149
|
-
} }[FindManyDatabaseModel];
|
|
150
|
-
type FindManyDatabasePluginInput = { readonly [TModel in FindManyDatabaseModel]: FindManyDatabaseInput<TModel, DatabaseSelect<TModel> | undefined
|
|
148
|
+
}; }[FindManyDatabaseModel];
|
|
149
|
+
type FindManyDatabasePluginInput = { readonly [TModel in FindManyDatabaseModel]: FindManyDatabaseInput<TModel, DatabaseSelect<TModel> | undefined>; }[FindManyDatabaseModel];
|
|
151
150
|
interface TransactionDatabasePluginImplementation {
|
|
152
151
|
create(input: CreateDatabaseImplementationInput): Promise<DatabaseImplementationResult>;
|
|
153
152
|
update(input: UpdateDatabaseImplementationInput): Promise<DatabaseImplementationResult | null>;
|
|
@@ -157,6 +156,12 @@ interface TransactionDatabasePluginImplementation {
|
|
|
157
156
|
findMany(input: FindManyDatabaseImplementationInput): Promise<readonly DatabaseImplementationResult[]>;
|
|
158
157
|
}
|
|
159
158
|
interface DatabasePluginImplementation {
|
|
159
|
+
findLatestInsightsEvents: InsightsModel["findLatestEvents"];
|
|
160
|
+
countLatestInsightsEvents: InsightsModel["countLatestEvents"];
|
|
161
|
+
/** Native immutable event insert; any private index is advanced atomically. */
|
|
162
|
+
recordInsights(input: InsightsRecordEventInput): Promise<void>;
|
|
163
|
+
getReleaseActivity: InsightsModel["getReleaseActivity"];
|
|
164
|
+
getAppUsage: InsightsModel["getAppUsage"];
|
|
160
165
|
create(input: CreateDatabaseImplementationInput): Promise<DatabaseImplementationResult>;
|
|
161
166
|
update(input: UpdateDatabaseImplementationInput): Promise<DatabaseImplementationResult | null>;
|
|
162
167
|
delete(input: DeleteDatabaseImplementationInput): Promise<void>;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { ApiKeyRow, BundleRow, DatabaseModel, DatabaseRow, ReleaseCatalogRow, ReleaseRow } from "./databaseRows.mjs";
|
|
2
|
-
import { ChannelDeleteInput, ChannelDeleteResult, ChannelInsertInput, ChannelInsertResult, DatabaseCommit, DatabaseCommitResult } from "./databasePlugin.mjs";
|
|
2
|
+
import { ChannelDeleteInput, ChannelDeleteResult, ChannelInsertInput, ChannelInsertResult, DatabaseCommit, DatabaseCommitResult, InsightsModel, InsightsRecordEventInput } from "./databasePlugin.mjs";
|
|
3
3
|
import { DatabaseDistinctFields, DatabaseDistinctOn, DatabaseOrderBy, DatabaseSelect, DatabaseWhere, SelectedDatabaseRow } from "./databaseQuery.mjs";
|
|
4
|
-
|
|
5
4
|
//#region src/types/databaseOperations.d.ts
|
|
6
5
|
type DatabaseCapability = "create" | "update" | "delete" | "count" | "findOne" | "findMany";
|
|
7
6
|
type DatabaseModelCapabilities = {
|
|
@@ -49,7 +48,7 @@ type DatabaseModelCapabilities = {
|
|
|
49
48
|
readonly create: true;
|
|
50
49
|
readonly update: false;
|
|
51
50
|
readonly delete: false;
|
|
52
|
-
readonly count:
|
|
51
|
+
readonly count: true;
|
|
53
52
|
readonly findOne: false;
|
|
54
53
|
readonly findMany: true;
|
|
55
54
|
};
|
|
@@ -62,7 +61,7 @@ type DatabaseModelCapabilities = {
|
|
|
62
61
|
readonly findMany: true;
|
|
63
62
|
};
|
|
64
63
|
};
|
|
65
|
-
type DatabaseModelsWithCapability<TCapability extends DatabaseCapability> = { readonly [TModel in DatabaseModel]: DatabaseModelCapabilities[TModel][TCapability] extends true ? TModel : never }[DatabaseModel];
|
|
64
|
+
type DatabaseModelsWithCapability<TCapability extends DatabaseCapability> = { readonly [TModel in DatabaseModel]: DatabaseModelCapabilities[TModel][TCapability] extends true ? TModel : never; }[DatabaseModel];
|
|
66
65
|
type CreateDatabaseModel = DatabaseModelsWithCapability<"create">;
|
|
67
66
|
type UpdateDatabaseModel = DatabaseModelsWithCapability<"update">;
|
|
68
67
|
type DeleteDatabaseModel = DatabaseModelsWithCapability<"delete">;
|
|
@@ -135,19 +134,19 @@ interface DatabasePluginCrud {
|
|
|
135
134
|
findOne<TInput extends FindOneDatabaseImplementationInput>(input: TInput): Promise<SelectedDatabaseInputRow<TInput> | null>;
|
|
136
135
|
findMany<TInput extends FindManyDatabasePluginInput>(input: TInput): Promise<SelectedDatabaseInputRow<TInput>[]>;
|
|
137
136
|
}
|
|
138
|
-
type DatabaseImplementationResult = { readonly [TModel in DatabaseModel]: Partial<DatabaseRow<TModel
|
|
139
|
-
type CreateDatabaseImplementationInput = { readonly [TModel in CreateDatabaseModel]: CreateDatabaseInput<TModel, DatabaseSelect<TModel> | undefined
|
|
140
|
-
type UpdateDatabaseImplementationInput = { readonly [TModel in UpdateDatabaseModel]: UpdateDatabaseInput<TModel, DatabaseSelect<TModel> | undefined
|
|
141
|
-
type DeleteDatabaseImplementationInput = { readonly [TModel in DeleteDatabaseModel]: DeleteDatabaseInput<TModel
|
|
142
|
-
type CountDatabaseImplementationInput = { readonly [TModel in CountDatabaseModel]: CountDatabaseInput<TModel
|
|
137
|
+
type DatabaseImplementationResult = { readonly [TModel in DatabaseModel]: Partial<DatabaseRow<TModel>>; }[DatabaseModel];
|
|
138
|
+
type CreateDatabaseImplementationInput = { readonly [TModel in CreateDatabaseModel]: CreateDatabaseInput<TModel, DatabaseSelect<TModel> | undefined>; }[CreateDatabaseModel];
|
|
139
|
+
type UpdateDatabaseImplementationInput = { readonly [TModel in UpdateDatabaseModel]: UpdateDatabaseInput<TModel, DatabaseSelect<TModel> | undefined>; }[UpdateDatabaseModel];
|
|
140
|
+
type DeleteDatabaseImplementationInput = { readonly [TModel in DeleteDatabaseModel]: DeleteDatabaseInput<TModel>; }[DeleteDatabaseModel];
|
|
141
|
+
type CountDatabaseImplementationInput = { readonly [TModel in CountDatabaseModel]: CountDatabaseInput<TModel>; }[CountDatabaseModel];
|
|
143
142
|
type UpdateBundleDatabaseImplementationInput = UpdateDatabaseInput<"bundles", DatabaseSelect<"bundles"> | undefined>;
|
|
144
143
|
type CountBundlesDatabaseImplementationInput = CountDatabaseInput<"bundles">;
|
|
145
|
-
type FindOneDatabaseImplementationInput = { readonly [TModel in FindOneDatabaseModel]: FindOneDatabaseInput<TModel, DatabaseSelect<TModel> | undefined
|
|
144
|
+
type FindOneDatabaseImplementationInput = { readonly [TModel in FindOneDatabaseModel]: FindOneDatabaseInput<TModel, DatabaseSelect<TModel> | undefined>; }[FindOneDatabaseModel];
|
|
146
145
|
type FindManyDatabaseImplementationInput = { readonly [TModel in FindManyDatabaseModel]: Omit<FindManyDatabaseInput<TModel, DatabaseSelect<TModel> | undefined>, "limit" | "offset"> & {
|
|
147
146
|
readonly limit: number;
|
|
148
147
|
readonly offset: number;
|
|
149
|
-
} }[FindManyDatabaseModel];
|
|
150
|
-
type FindManyDatabasePluginInput = { readonly [TModel in FindManyDatabaseModel]: FindManyDatabaseInput<TModel, DatabaseSelect<TModel> | undefined
|
|
148
|
+
}; }[FindManyDatabaseModel];
|
|
149
|
+
type FindManyDatabasePluginInput = { readonly [TModel in FindManyDatabaseModel]: FindManyDatabaseInput<TModel, DatabaseSelect<TModel> | undefined>; }[FindManyDatabaseModel];
|
|
151
150
|
interface TransactionDatabasePluginImplementation {
|
|
152
151
|
create(input: CreateDatabaseImplementationInput): Promise<DatabaseImplementationResult>;
|
|
153
152
|
update(input: UpdateDatabaseImplementationInput): Promise<DatabaseImplementationResult | null>;
|
|
@@ -157,6 +156,12 @@ interface TransactionDatabasePluginImplementation {
|
|
|
157
156
|
findMany(input: FindManyDatabaseImplementationInput): Promise<readonly DatabaseImplementationResult[]>;
|
|
158
157
|
}
|
|
159
158
|
interface DatabasePluginImplementation {
|
|
159
|
+
findLatestInsightsEvents: InsightsModel["findLatestEvents"];
|
|
160
|
+
countLatestInsightsEvents: InsightsModel["countLatestEvents"];
|
|
161
|
+
/** Native immutable event insert; any private index is advanced atomically. */
|
|
162
|
+
recordInsights(input: InsightsRecordEventInput): Promise<void>;
|
|
163
|
+
getReleaseActivity: InsightsModel["getReleaseActivity"];
|
|
164
|
+
getAppUsage: InsightsModel["getAppUsage"];
|
|
160
165
|
create(input: CreateDatabaseImplementationInput): Promise<DatabaseImplementationResult>;
|
|
161
166
|
update(input: UpdateDatabaseImplementationInput): Promise<DatabaseImplementationResult | null>;
|
|
162
167
|
delete(input: DeleteDatabaseImplementationInput): Promise<void>;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { ApiKeyRow, BundleEventRow, BundlePatchRow, BundleRow, ChannelRow, ReleaseCatalogRow, ReleaseRow } from "./databaseRows.cjs";
|
|
2
2
|
import { BundleRowUpdate, ReleaseRowUpdate } from "./databaseOperations.cjs";
|
|
3
3
|
import { DatabaseBundleQueryOrder, DatabaseBundleQueryWhere } from "./index.cjs";
|
|
4
|
-
|
|
5
4
|
//#region src/types/databasePlugin.d.ts
|
|
6
5
|
interface BundleModelQuery {
|
|
7
6
|
readonly where?: DatabaseBundleQueryWhere;
|
|
@@ -43,18 +42,171 @@ interface ReleaseCatalogModel {
|
|
|
43
42
|
readonly limit: number;
|
|
44
43
|
}): Promise<readonly ReleaseCatalogRow[]>;
|
|
45
44
|
}
|
|
46
|
-
interface
|
|
45
|
+
interface InsightsEventCursor {
|
|
47
46
|
readonly receivedAtMs: number;
|
|
48
47
|
readonly id: string;
|
|
49
48
|
}
|
|
50
|
-
interface
|
|
49
|
+
interface InsightsScope {
|
|
50
|
+
readonly platform: "ios" | "android";
|
|
51
|
+
readonly channel: string;
|
|
52
|
+
}
|
|
53
|
+
/** Raw event predicates; recovery is attributed to the source bundle. */
|
|
54
|
+
type InsightsBundleEventFilter = InsightsScope & ({
|
|
55
|
+
readonly type: "RECOVERED";
|
|
56
|
+
readonly fromBundleId: string;
|
|
57
|
+
} | {
|
|
58
|
+
readonly type: "UPDATE_DOWNLOADED" | "UPDATE_APPLIED" | "UNCHANGED";
|
|
59
|
+
readonly toBundleId: string;
|
|
60
|
+
});
|
|
61
|
+
type InsightsEventFilter = {
|
|
62
|
+
readonly kind: "all";
|
|
63
|
+
} | {
|
|
64
|
+
readonly kind: "installationMovement";
|
|
65
|
+
readonly installId: string;
|
|
66
|
+
} | ({
|
|
67
|
+
readonly kind: "bundle";
|
|
68
|
+
} & InsightsBundleEventFilter);
|
|
69
|
+
interface InsightsRecordEventInput {
|
|
70
|
+
readonly event: BundleEventRow;
|
|
71
|
+
}
|
|
72
|
+
interface InsightsListEventsInput {
|
|
73
|
+
readonly filter: InsightsEventFilter;
|
|
74
|
+
readonly sinceMs?: number;
|
|
51
75
|
readonly beforeReceivedAtMs: number;
|
|
52
|
-
readonly after?:
|
|
76
|
+
readonly after?: InsightsEventCursor;
|
|
53
77
|
readonly limit: number;
|
|
54
78
|
}
|
|
79
|
+
type InsightsFindLatestEventsInput = {
|
|
80
|
+
readonly installId: string;
|
|
81
|
+
} | {
|
|
82
|
+
readonly userId: string;
|
|
83
|
+
readonly afterInstallId?: string;
|
|
84
|
+
readonly limit: number;
|
|
85
|
+
};
|
|
86
|
+
interface InsightsCountLatestEventsInput extends InsightsScope {
|
|
87
|
+
readonly sinceMs: number;
|
|
88
|
+
/** Optional OR of one or two fixed predicates; count a matching event once. */
|
|
89
|
+
readonly bundle?: readonly {
|
|
90
|
+
readonly field: "from_bundle_id" | "to_bundle_id";
|
|
91
|
+
readonly value: string;
|
|
92
|
+
readonly types: readonly BundleEventRow["type"][];
|
|
93
|
+
}[];
|
|
94
|
+
}
|
|
95
|
+
interface InsightsCountEventsInput {
|
|
96
|
+
readonly filter: InsightsBundleEventFilter;
|
|
97
|
+
readonly sinceMs: number;
|
|
98
|
+
readonly beforeReceivedAtMs: number;
|
|
99
|
+
}
|
|
100
|
+
interface ReleaseReference {
|
|
101
|
+
readonly releaseId: string;
|
|
102
|
+
readonly platform: "ios" | "android";
|
|
103
|
+
readonly channel: string;
|
|
104
|
+
}
|
|
105
|
+
interface InsightsTimeRange {
|
|
106
|
+
/** Inclusive UTC Unix timestamp in milliseconds. */
|
|
107
|
+
readonly start: number;
|
|
108
|
+
/** Exclusive UTC Unix timestamp in milliseconds. */
|
|
109
|
+
readonly end: number;
|
|
110
|
+
}
|
|
111
|
+
type InsightsCoverage = {
|
|
112
|
+
readonly kind: "complete";
|
|
113
|
+
readonly sinceMs: number;
|
|
114
|
+
} | {
|
|
115
|
+
readonly kind: "partial";
|
|
116
|
+
readonly sinceMs: number | null;
|
|
117
|
+
};
|
|
118
|
+
interface ReleaseActivityMetrics {
|
|
119
|
+
readonly downloads: number;
|
|
120
|
+
readonly launches: number;
|
|
121
|
+
readonly failedLaunches: number;
|
|
122
|
+
/** Omitted for lifetime-only bundle-row reads. */
|
|
123
|
+
readonly uniqueUsers?: number;
|
|
124
|
+
/** Daily points, present only for period reads. */
|
|
125
|
+
readonly series?: readonly {
|
|
126
|
+
readonly startMs: number;
|
|
127
|
+
readonly launches: number;
|
|
128
|
+
readonly failedLaunches: number;
|
|
129
|
+
}[];
|
|
130
|
+
}
|
|
131
|
+
type InsightsGetReleaseActivityInput = {
|
|
132
|
+
readonly releases: readonly ReleaseReference[];
|
|
133
|
+
readonly timeRange?: InsightsTimeRange;
|
|
134
|
+
readonly scope?: never;
|
|
135
|
+
} | {
|
|
136
|
+
readonly scope: InsightsScope;
|
|
137
|
+
readonly timeRange: InsightsTimeRange;
|
|
138
|
+
readonly releases?: never;
|
|
139
|
+
};
|
|
140
|
+
interface InsightsGetReleaseActivityResult {
|
|
141
|
+
readonly coverage: InsightsCoverage;
|
|
142
|
+
readonly data: readonly {
|
|
143
|
+
readonly release?: ReleaseReference;
|
|
144
|
+
readonly scope?: InsightsScope;
|
|
145
|
+
readonly metrics: ReleaseActivityMetrics;
|
|
146
|
+
}[];
|
|
147
|
+
readonly measuredAtMs: number;
|
|
148
|
+
}
|
|
149
|
+
interface InsightsGetAppUsageInput {
|
|
150
|
+
readonly channel: string;
|
|
151
|
+
readonly platform: "all" | "ios" | "android";
|
|
152
|
+
readonly appVersion?: string;
|
|
153
|
+
readonly timeRange: InsightsTimeRange;
|
|
154
|
+
readonly intervalMs: number;
|
|
155
|
+
}
|
|
156
|
+
interface InsightsGetAppUsageResult {
|
|
157
|
+
readonly coverage: InsightsCoverage;
|
|
158
|
+
readonly activeInstallations: number;
|
|
159
|
+
readonly points: readonly {
|
|
160
|
+
readonly startMs: number;
|
|
161
|
+
readonly installations: number;
|
|
162
|
+
}[];
|
|
163
|
+
readonly appVersions: readonly string[];
|
|
164
|
+
readonly versions: readonly {
|
|
165
|
+
readonly name: string;
|
|
166
|
+
readonly installations: number;
|
|
167
|
+
}[];
|
|
168
|
+
readonly platforms: readonly {
|
|
169
|
+
readonly name: string;
|
|
170
|
+
readonly installations: number;
|
|
171
|
+
}[];
|
|
172
|
+
readonly bundleDistribution: readonly {
|
|
173
|
+
readonly appVersion: string;
|
|
174
|
+
readonly platform: "ios" | "android";
|
|
175
|
+
readonly releaseId: string | null;
|
|
176
|
+
readonly installations: number;
|
|
177
|
+
}[];
|
|
178
|
+
readonly measuredAtMs: number;
|
|
179
|
+
}
|
|
55
180
|
interface InsightsModel {
|
|
56
|
-
|
|
57
|
-
|
|
181
|
+
/**
|
|
182
|
+
* Persist the immutable event once. A private latest-event index, if used,
|
|
183
|
+
* advances atomically for a greater (received_at_ms, id). Duplicate event
|
|
184
|
+
* IDs are complete no-ops.
|
|
185
|
+
* Retry the identical prepared input after an ambiguous commit outcome.
|
|
186
|
+
*/
|
|
187
|
+
recordEvent(input: InsightsRecordEventInput): Promise<void>;
|
|
188
|
+
/**
|
|
189
|
+
* Descending (received_at_ms, id), in [sinceMs ?? 0, beforeReceivedAtMs).
|
|
190
|
+
* Apply filters and the exclusive cursor before limit (1..101). Return the
|
|
191
|
+
* complete matching prefix; native continuation pages must not truncate it.
|
|
192
|
+
*/
|
|
193
|
+
listEvents(input: InsightsListEventsInput): Promise<readonly BundleEventRow[]>;
|
|
194
|
+
/**
|
|
195
|
+
* Choose each installation's greatest (received_at_ms, id) before filtering.
|
|
196
|
+
* Exact installation lookup returns zero or one canonical event. User lookup
|
|
197
|
+
* returns current membership ordered by UTF-8 installation ID, exclusive
|
|
198
|
+
* afterInstallId and limit 1..101. Check lagging index candidates against
|
|
199
|
+
* canonical state; newly indexed associations may temporarily be absent.
|
|
200
|
+
*/
|
|
201
|
+
findLatestEvents(input: InsightsFindLatestEventsInput): Promise<readonly BundleEventRow[]>;
|
|
202
|
+
/** Count latest events once per installation, then apply the supplied predicates. */
|
|
203
|
+
countLatestEvents(input: InsightsCountLatestEventsInput): Promise<number>;
|
|
204
|
+
/** Count accepted reports in [sinceMs, beforeReceivedAtMs), across all pages. */
|
|
205
|
+
countEvents(input: InsightsCountEventsInput): Promise<number>;
|
|
206
|
+
/** Read maintained release/scope summaries without scanning raw events. */
|
|
207
|
+
getReleaseActivity(input: InsightsGetReleaseActivityInput): Promise<InsightsGetReleaseActivityResult>;
|
|
208
|
+
/** Read maintained App usage summaries and latest-report distribution. */
|
|
209
|
+
getAppUsage(input: InsightsGetAppUsageInput): Promise<InsightsGetAppUsageResult>;
|
|
58
210
|
}
|
|
59
211
|
interface ApiKeyModel {
|
|
60
212
|
create(row: ApiKeyRow): Promise<"created" | "existing">;
|
|
@@ -148,10 +300,6 @@ type DatabaseChange = {
|
|
|
148
300
|
readonly where: {
|
|
149
301
|
readonly id: string;
|
|
150
302
|
};
|
|
151
|
-
} | {
|
|
152
|
-
readonly model: "insights";
|
|
153
|
-
readonly operation: "insert";
|
|
154
|
-
readonly row: BundleEventRow;
|
|
155
303
|
} | {
|
|
156
304
|
readonly model: "apiKeys";
|
|
157
305
|
readonly operation: "insert";
|
|
@@ -237,4 +385,4 @@ interface DatabasePlugin {
|
|
|
237
385
|
dispose?: () => Promise<void>;
|
|
238
386
|
}
|
|
239
387
|
//#endregion
|
|
240
|
-
export { ApiKeyModel, BundleModel, BundleModelQuery, BundlePatchModel, BundleRepository, BundleRepositoryChange, BundleRepositoryCommit, ChannelDeleteInput, ChannelDeleteResult, ChannelInsertInput, ChannelInsertResult, ChannelModel, DatabaseChange, DatabaseCommit, DatabaseCommitExpectation, DatabaseCommitResult, DatabaseModels, DatabasePlugin, InsightsModel,
|
|
388
|
+
export { ApiKeyModel, BundleModel, BundleModelQuery, BundlePatchModel, BundleRepository, BundleRepositoryChange, BundleRepositoryCommit, ChannelDeleteInput, ChannelDeleteResult, ChannelInsertInput, ChannelInsertResult, ChannelModel, DatabaseChange, DatabaseCommit, DatabaseCommitExpectation, DatabaseCommitResult, DatabaseModels, DatabasePlugin, InsightsBundleEventFilter, InsightsCountEventsInput, InsightsCountLatestEventsInput, InsightsCoverage, InsightsEventCursor, InsightsEventFilter, InsightsFindLatestEventsInput, InsightsGetAppUsageInput, InsightsGetAppUsageResult, InsightsGetReleaseActivityInput, InsightsGetReleaseActivityResult, InsightsListEventsInput, InsightsModel, InsightsRecordEventInput, InsightsScope, InsightsTimeRange, ReleaseActivityMetrics, ReleaseCatalogModel, ReleaseModel, ReleaseReference };
|