@hot-updater/plugin-core 1.0.0-rc.15 → 1.0.0-rc.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundleEventRow.cjs +42 -0
- package/dist/bundleEventRow.mjs +41 -0
- package/dist/coreApi.d.cts +131 -0
- package/dist/coreApi.d.mts +131 -0
- package/dist/database/adapter.cjs +37 -0
- package/dist/database/adapter.d.cts +150 -0
- package/dist/database/adapter.d.mts +150 -0
- package/dist/database/adapter.mjs +30 -0
- package/dist/database/memoryAdapter.cjs +102 -0
- package/dist/database/memoryAdapter.d.cts +16 -0
- package/dist/database/memoryAdapter.d.mts +16 -0
- package/dist/database/memoryAdapter.mjs +102 -0
- package/dist/database/values.cjs +110 -0
- package/dist/database/values.d.cts +30 -0
- package/dist/database/values.d.mts +30 -0
- package/dist/database/values.mjs +100 -0
- package/dist/database/verifyAdapter.cjs +129 -0
- package/dist/database/verifyAdapter.d.cts +29 -0
- package/dist/database/verifyAdapter.d.mts +29 -0
- package/dist/database/verifyAdapter.mjs +128 -0
- package/dist/databaseErrors.cjs +30 -0
- package/dist/databaseErrors.d.cts +21 -0
- package/dist/databaseErrors.d.mts +21 -0
- package/dist/databaseErrors.mjs +28 -0
- package/dist/databaseMetadata.cjs +2 -2
- package/dist/databaseMetadata.mjs +1 -1
- package/dist/index.cjs +10 -36
- package/dist/index.d.cts +13 -17
- package/dist/index.d.mts +13 -17
- package/dist/index.mjs +8 -14
- package/dist/insightsContract.cjs +26 -24
- package/dist/insightsContract.d.cts +6 -1
- package/dist/insightsContract.d.mts +6 -1
- package/dist/insightsContract.mjs +6 -5
- package/dist/insightsDistinctSummary.cjs +2 -1
- package/dist/insightsDistinctSummary.mjs +2 -1
- package/dist/insightsOverview.cjs +4 -4
- package/dist/insightsOverview.d.cts +3 -1
- package/dist/insightsOverview.d.mts +3 -1
- package/dist/insightsOverview.mjs +4 -5
- package/dist/internal.cjs +32 -8
- package/dist/internal.d.cts +11 -10
- package/dist/internal.d.mts +11 -10
- package/dist/internal.mjs +8 -5
- package/dist/releaseCatalogCompiler.cjs +1 -1
- package/dist/releaseCatalogCompiler.mjs +2 -2
- package/dist/releaseCatalogMutation.cjs +0 -292
- package/dist/releaseCatalogMutation.d.cts +4 -45
- package/dist/releaseCatalogMutation.d.mts +4 -45
- package/dist/releaseCatalogMutation.mjs +1 -288
- package/dist/releaseManagement.cjs +0 -221
- package/dist/releaseManagement.d.cts +4 -28
- package/dist/releaseManagement.d.mts +4 -28
- package/dist/releaseManagement.mjs +1 -216
- package/dist/types/databaseConfig.cjs +5 -0
- package/dist/types/databaseConfig.d.cts +33 -0
- package/dist/types/databaseConfig.d.mts +33 -0
- package/dist/types/databaseConfig.mjs +5 -0
- package/dist/types/databaseOperations.d.cts +5 -174
- package/dist/types/databaseOperations.d.mts +5 -174
- package/dist/types/index.cjs +2 -0
- package/dist/types/index.d.cts +8 -73
- package/dist/types/index.d.mts +8 -73
- package/dist/types/index.mjs +2 -1
- package/dist/types/insights.d.cts +172 -0
- package/dist/types/insights.d.mts +172 -0
- package/dist/types/internal.d.cts +4 -7
- package/dist/types/internal.d.mts +4 -7
- package/dist/types/models.d.cts +24 -0
- package/dist/types/models.d.mts +24 -0
- package/dist/types/public.d.cts +4 -2
- package/dist/types/public.d.mts +4 -2
- package/package.json +1 -1
- package/dist/calculatePagination.cjs +0 -25
- package/dist/calculatePagination.d.cts +0 -12
- package/dist/calculatePagination.d.mts +0 -12
- package/dist/calculatePagination.mjs +0 -25
- package/dist/createDatabasePlugin.cjs +0 -875
- package/dist/createDatabasePlugin.d.cts +0 -28
- package/dist/createDatabasePlugin.d.mts +0 -28
- package/dist/createDatabasePlugin.mjs +0 -871
- package/dist/databaseClient.cjs +0 -117
- package/dist/databaseClient.d.cts +0 -32
- package/dist/databaseClient.d.mts +0 -32
- package/dist/databaseClient.mjs +0 -114
- package/dist/databaseClientReads.cjs +0 -115
- package/dist/databaseClientReads.mjs +0 -113
- package/dist/databaseClientUpdates.cjs +0 -37
- package/dist/databaseClientUpdates.d.cts +0 -11
- package/dist/databaseClientUpdates.d.mts +0 -11
- package/dist/databaseClientUpdates.mjs +0 -35
- package/dist/databasePluginCrud.cjs +0 -87
- package/dist/databasePluginCrud.d.cts +0 -4
- package/dist/databasePluginCrud.d.mts +0 -4
- package/dist/databasePluginCrud.mjs +0 -86
- package/dist/databasePluginCrudValidation.d.cts +0 -6
- package/dist/databasePluginCrudValidation.d.mts +0 -6
- package/dist/databasePluginCrudValidationErrors.cjs +0 -11
- package/dist/databasePluginCrudValidationErrors.d.cts +0 -9
- package/dist/databasePluginCrudValidationErrors.d.mts +0 -9
- package/dist/databasePluginCrudValidationErrors.mjs +0 -11
- package/dist/databasePluginCrudValidationFields.cjs +0 -284
- package/dist/databasePluginCrudValidationFields.d.cts +0 -1
- package/dist/databasePluginCrudValidationFields.d.mts +0 -1
- package/dist/databasePluginCrudValidationFields.mjs +0 -272
- package/dist/databasePluginCrudValidationMutations.cjs +0 -88
- package/dist/databasePluginCrudValidationMutations.d.cts +0 -1
- package/dist/databasePluginCrudValidationMutations.d.mts +0 -1
- package/dist/databasePluginCrudValidationMutations.mjs +0 -82
- package/dist/databasePluginCrudValidationQueries.cjs +0 -103
- package/dist/databasePluginCrudValidationQueries.d.cts +0 -2
- package/dist/databasePluginCrudValidationQueries.d.mts +0 -2
- package/dist/databasePluginCrudValidationQueries.mjs +0 -97
- package/dist/databasePluginCrudValidationRows.cjs +0 -55
- package/dist/databasePluginCrudValidationRows.d.cts +0 -1
- package/dist/databasePluginCrudValidationRows.d.mts +0 -1
- package/dist/databasePluginCrudValidationRows.mjs +0 -53
- package/dist/databasePluginTransaction.cjs +0 -7
- package/dist/databasePluginTransaction.mjs +0 -7
- package/dist/insightsLatestQueries.cjs +0 -53
- package/dist/insightsLatestQueries.d.cts +0 -13
- package/dist/insightsLatestQueries.d.mts +0 -13
- package/dist/insightsLatestQueries.mjs +0 -52
- package/dist/paginateBundles.cjs +0 -53
- package/dist/paginateBundles.d.cts +0 -13
- package/dist/paginateBundles.d.mts +0 -13
- package/dist/paginateBundles.mjs +0 -53
- package/dist/queryBundles.cjs +0 -34
- package/dist/queryBundles.d.cts +0 -9
- package/dist/queryBundles.d.mts +0 -9
- package/dist/queryBundles.mjs +0 -32
- package/dist/requestBundleCache.cjs +0 -22
- package/dist/requestBundleCache.d.cts +0 -8
- package/dist/requestBundleCache.d.mts +0 -8
- package/dist/requestBundleCache.mjs +0 -22
- package/dist/types/database.d.cts +0 -5
- package/dist/types/database.d.mts +0 -5
- package/dist/types/databaseFields.cjs +0 -85
- package/dist/types/databaseFields.d.cts +0 -12
- package/dist/types/databaseFields.d.mts +0 -12
- package/dist/types/databaseFields.mjs +0 -85
- package/dist/types/databasePlugin.d.cts +0 -388
- package/dist/types/databasePlugin.d.mts +0 -388
- package/dist/types/databaseQuery.d.cts +0 -46
- package/dist/types/databaseQuery.d.mts +0 -46
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
//#region src/requestBundleCache.ts
|
|
2
|
-
const createRequestBundleResolver = () => {
|
|
3
|
-
const entries = /* @__PURE__ */ new Map();
|
|
4
|
-
const pendingLoads = /* @__PURE__ */ new Map();
|
|
5
|
-
return { async getById(bundleId, loadBundleById) {
|
|
6
|
-
if (entries.has(bundleId)) return entries.get(bundleId) ?? null;
|
|
7
|
-
const pending = pendingLoads.get(bundleId);
|
|
8
|
-
if (pending) return pending;
|
|
9
|
-
const load = loadBundleById().then((bundle) => {
|
|
10
|
-
pendingLoads.delete(bundleId);
|
|
11
|
-
if (!entries.has(bundleId)) entries.set(bundleId, bundle);
|
|
12
|
-
return entries.get(bundleId) ?? null;
|
|
13
|
-
}, (error) => {
|
|
14
|
-
pendingLoads.delete(bundleId);
|
|
15
|
-
throw error;
|
|
16
|
-
});
|
|
17
|
-
pendingLoads.set(bundleId, load);
|
|
18
|
-
return load;
|
|
19
|
-
} };
|
|
20
|
-
};
|
|
21
|
-
//#endregion
|
|
22
|
-
export { createRequestBundleResolver };
|
|
@@ -1,5 +0,0 @@
|
|
|
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
|
-
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";
|
|
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,5 +0,0 @@
|
|
|
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
|
-
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";
|
|
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,85 +0,0 @@
|
|
|
1
|
-
//#region src/types/databaseFields.ts
|
|
2
|
-
const databaseFields = {
|
|
3
|
-
bundles: [
|
|
4
|
-
"id",
|
|
5
|
-
"platform",
|
|
6
|
-
"git_commit_hash",
|
|
7
|
-
"metadata",
|
|
8
|
-
"manifest_storage_uri",
|
|
9
|
-
"manifest_file_hash",
|
|
10
|
-
"asset_base_storage_uri"
|
|
11
|
-
],
|
|
12
|
-
bundle_patches: [
|
|
13
|
-
"id",
|
|
14
|
-
"bundle_id",
|
|
15
|
-
"base_bundle_id",
|
|
16
|
-
"base_file_hash",
|
|
17
|
-
"patch_file_hash",
|
|
18
|
-
"patch_storage_uri",
|
|
19
|
-
"byte_size",
|
|
20
|
-
"order_index"
|
|
21
|
-
],
|
|
22
|
-
releases: [
|
|
23
|
-
"id",
|
|
24
|
-
"revision",
|
|
25
|
-
"scope_key",
|
|
26
|
-
"channel_id",
|
|
27
|
-
"platform",
|
|
28
|
-
"kind",
|
|
29
|
-
"bundle_id",
|
|
30
|
-
"strategy",
|
|
31
|
-
"target_app_version",
|
|
32
|
-
"fingerprint_hash",
|
|
33
|
-
"enabled",
|
|
34
|
-
"should_force_update",
|
|
35
|
-
"message",
|
|
36
|
-
"rollout_cohort_count",
|
|
37
|
-
"target_cohorts",
|
|
38
|
-
"operation",
|
|
39
|
-
"source_release_id",
|
|
40
|
-
"created_at_ms",
|
|
41
|
-
"updated_at_ms"
|
|
42
|
-
],
|
|
43
|
-
release_catalogs: [
|
|
44
|
-
"scope_key",
|
|
45
|
-
"catalog_id",
|
|
46
|
-
"strategy",
|
|
47
|
-
"channel_id",
|
|
48
|
-
"channel_key",
|
|
49
|
-
"platform",
|
|
50
|
-
"fingerprint_hash",
|
|
51
|
-
"generation",
|
|
52
|
-
"payload",
|
|
53
|
-
"catalog_hash",
|
|
54
|
-
"byte_size",
|
|
55
|
-
"is_tombstone",
|
|
56
|
-
"updated_at_ms"
|
|
57
|
-
],
|
|
58
|
-
channels: ["id", "name"],
|
|
59
|
-
bundle_events: [
|
|
60
|
-
"id",
|
|
61
|
-
"type",
|
|
62
|
-
"install_id",
|
|
63
|
-
"user_id",
|
|
64
|
-
"from_bundle_id",
|
|
65
|
-
"from_release_id",
|
|
66
|
-
"to_release_id",
|
|
67
|
-
"to_bundle_id",
|
|
68
|
-
"platform",
|
|
69
|
-
"app_version",
|
|
70
|
-
"channel",
|
|
71
|
-
"metadata",
|
|
72
|
-
"received_at_ms"
|
|
73
|
-
],
|
|
74
|
-
api_keys: [
|
|
75
|
-
"id",
|
|
76
|
-
"hash",
|
|
77
|
-
"name",
|
|
78
|
-
"prefix",
|
|
79
|
-
"role",
|
|
80
|
-
"created_at_ms",
|
|
81
|
-
"revoked_at_ms"
|
|
82
|
-
]
|
|
83
|
-
};
|
|
84
|
-
//#endregion
|
|
85
|
-
exports.databaseFields = databaseFields;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
//#region src/types/databaseFields.d.ts
|
|
2
|
-
declare const databaseFields: {
|
|
3
|
-
readonly bundles: readonly ["id", "platform", "git_commit_hash", "metadata", "manifest_storage_uri", "manifest_file_hash", "asset_base_storage_uri"];
|
|
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
|
-
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
|
-
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
|
-
readonly channels: readonly ["id", "name"];
|
|
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
|
-
readonly api_keys: readonly ["id", "hash", "name", "prefix", "role", "created_at_ms", "revoked_at_ms"];
|
|
10
|
-
};
|
|
11
|
-
//#endregion
|
|
12
|
-
export { databaseFields };
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
//#region src/types/databaseFields.d.ts
|
|
2
|
-
declare const databaseFields: {
|
|
3
|
-
readonly bundles: readonly ["id", "platform", "git_commit_hash", "metadata", "manifest_storage_uri", "manifest_file_hash", "asset_base_storage_uri"];
|
|
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
|
-
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
|
-
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
|
-
readonly channels: readonly ["id", "name"];
|
|
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
|
-
readonly api_keys: readonly ["id", "hash", "name", "prefix", "role", "created_at_ms", "revoked_at_ms"];
|
|
10
|
-
};
|
|
11
|
-
//#endregion
|
|
12
|
-
export { databaseFields };
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
//#region src/types/databaseFields.ts
|
|
2
|
-
const databaseFields = {
|
|
3
|
-
bundles: [
|
|
4
|
-
"id",
|
|
5
|
-
"platform",
|
|
6
|
-
"git_commit_hash",
|
|
7
|
-
"metadata",
|
|
8
|
-
"manifest_storage_uri",
|
|
9
|
-
"manifest_file_hash",
|
|
10
|
-
"asset_base_storage_uri"
|
|
11
|
-
],
|
|
12
|
-
bundle_patches: [
|
|
13
|
-
"id",
|
|
14
|
-
"bundle_id",
|
|
15
|
-
"base_bundle_id",
|
|
16
|
-
"base_file_hash",
|
|
17
|
-
"patch_file_hash",
|
|
18
|
-
"patch_storage_uri",
|
|
19
|
-
"byte_size",
|
|
20
|
-
"order_index"
|
|
21
|
-
],
|
|
22
|
-
releases: [
|
|
23
|
-
"id",
|
|
24
|
-
"revision",
|
|
25
|
-
"scope_key",
|
|
26
|
-
"channel_id",
|
|
27
|
-
"platform",
|
|
28
|
-
"kind",
|
|
29
|
-
"bundle_id",
|
|
30
|
-
"strategy",
|
|
31
|
-
"target_app_version",
|
|
32
|
-
"fingerprint_hash",
|
|
33
|
-
"enabled",
|
|
34
|
-
"should_force_update",
|
|
35
|
-
"message",
|
|
36
|
-
"rollout_cohort_count",
|
|
37
|
-
"target_cohorts",
|
|
38
|
-
"operation",
|
|
39
|
-
"source_release_id",
|
|
40
|
-
"created_at_ms",
|
|
41
|
-
"updated_at_ms"
|
|
42
|
-
],
|
|
43
|
-
release_catalogs: [
|
|
44
|
-
"scope_key",
|
|
45
|
-
"catalog_id",
|
|
46
|
-
"strategy",
|
|
47
|
-
"channel_id",
|
|
48
|
-
"channel_key",
|
|
49
|
-
"platform",
|
|
50
|
-
"fingerprint_hash",
|
|
51
|
-
"generation",
|
|
52
|
-
"payload",
|
|
53
|
-
"catalog_hash",
|
|
54
|
-
"byte_size",
|
|
55
|
-
"is_tombstone",
|
|
56
|
-
"updated_at_ms"
|
|
57
|
-
],
|
|
58
|
-
channels: ["id", "name"],
|
|
59
|
-
bundle_events: [
|
|
60
|
-
"id",
|
|
61
|
-
"type",
|
|
62
|
-
"install_id",
|
|
63
|
-
"user_id",
|
|
64
|
-
"from_bundle_id",
|
|
65
|
-
"from_release_id",
|
|
66
|
-
"to_release_id",
|
|
67
|
-
"to_bundle_id",
|
|
68
|
-
"platform",
|
|
69
|
-
"app_version",
|
|
70
|
-
"channel",
|
|
71
|
-
"metadata",
|
|
72
|
-
"received_at_ms"
|
|
73
|
-
],
|
|
74
|
-
api_keys: [
|
|
75
|
-
"id",
|
|
76
|
-
"hash",
|
|
77
|
-
"name",
|
|
78
|
-
"prefix",
|
|
79
|
-
"role",
|
|
80
|
-
"created_at_ms",
|
|
81
|
-
"revoked_at_ms"
|
|
82
|
-
]
|
|
83
|
-
};
|
|
84
|
-
//#endregion
|
|
85
|
-
export { databaseFields };
|
|
@@ -1,388 +0,0 @@
|
|
|
1
|
-
import { ApiKeyRow, BundleEventRow, BundlePatchRow, BundleRow, ChannelRow, ReleaseCatalogRow, ReleaseRow } from "./databaseRows.cjs";
|
|
2
|
-
import { BundleRowUpdate, ReleaseRowUpdate } from "./databaseOperations.cjs";
|
|
3
|
-
import { DatabaseBundleQueryOrder, DatabaseBundleQueryWhere } from "./index.cjs";
|
|
4
|
-
//#region src/types/databasePlugin.d.ts
|
|
5
|
-
interface BundleModelQuery {
|
|
6
|
-
readonly where?: DatabaseBundleQueryWhere;
|
|
7
|
-
readonly limit: number;
|
|
8
|
-
readonly offset: number;
|
|
9
|
-
readonly orderBy: DatabaseBundleQueryOrder;
|
|
10
|
-
}
|
|
11
|
-
interface BundleModel {
|
|
12
|
-
findById(id: string): Promise<BundleRow | null>;
|
|
13
|
-
findMany(query: BundleModelQuery): Promise<readonly BundleRow[]>;
|
|
14
|
-
count(where?: DatabaseBundleQueryWhere): Promise<number>;
|
|
15
|
-
}
|
|
16
|
-
interface BundlePatchModel {
|
|
17
|
-
findByBundleIds(bundleIds: readonly string[]): Promise<readonly BundlePatchRow[]>;
|
|
18
|
-
}
|
|
19
|
-
interface ReleaseModel {
|
|
20
|
-
findById(id: string): Promise<ReleaseRow | null>;
|
|
21
|
-
findMany(input: {
|
|
22
|
-
readonly afterReleaseId?: string;
|
|
23
|
-
readonly beforeReleaseId?: string;
|
|
24
|
-
readonly bundleId?: string;
|
|
25
|
-
readonly channelId?: string;
|
|
26
|
-
readonly enabled?: boolean;
|
|
27
|
-
readonly platform?: "ios" | "android";
|
|
28
|
-
readonly targetAppVersion?: string;
|
|
29
|
-
readonly limit: number;
|
|
30
|
-
}): Promise<readonly ReleaseRow[]>;
|
|
31
|
-
findManyByScope(input: {
|
|
32
|
-
readonly scopeKey: string;
|
|
33
|
-
readonly afterReleaseId?: string;
|
|
34
|
-
readonly limit: number;
|
|
35
|
-
readonly consistency: "strong";
|
|
36
|
-
}): Promise<readonly ReleaseRow[]>;
|
|
37
|
-
}
|
|
38
|
-
interface ReleaseCatalogModel {
|
|
39
|
-
findByScopeKey(scopeKey: string): Promise<ReleaseCatalogRow | null>;
|
|
40
|
-
findMany(input: {
|
|
41
|
-
readonly afterScopeKey?: string;
|
|
42
|
-
readonly limit: number;
|
|
43
|
-
}): Promise<readonly ReleaseCatalogRow[]>;
|
|
44
|
-
}
|
|
45
|
-
interface InsightsEventCursor {
|
|
46
|
-
readonly receivedAtMs: number;
|
|
47
|
-
readonly id: string;
|
|
48
|
-
}
|
|
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;
|
|
75
|
-
readonly beforeReceivedAtMs: number;
|
|
76
|
-
readonly after?: InsightsEventCursor;
|
|
77
|
-
readonly limit: number;
|
|
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
|
-
}
|
|
180
|
-
interface InsightsModel {
|
|
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>;
|
|
210
|
-
}
|
|
211
|
-
interface ApiKeyModel {
|
|
212
|
-
create(row: ApiKeyRow): Promise<"created" | "existing">;
|
|
213
|
-
findByHash(hash: string): Promise<ApiKeyRow | null>;
|
|
214
|
-
list(): Promise<readonly ApiKeyRow[]>;
|
|
215
|
-
revoke(input: {
|
|
216
|
-
readonly id: string;
|
|
217
|
-
readonly revokedAtMs: number;
|
|
218
|
-
}): Promise<ApiKeyRow | null>;
|
|
219
|
-
}
|
|
220
|
-
interface ChannelInsertInput {
|
|
221
|
-
readonly row: ChannelRow;
|
|
222
|
-
readonly onConflict: "returnExisting";
|
|
223
|
-
}
|
|
224
|
-
interface ChannelInsertResult {
|
|
225
|
-
readonly row: ChannelRow;
|
|
226
|
-
readonly inserted: boolean;
|
|
227
|
-
}
|
|
228
|
-
interface ChannelDeleteInput {
|
|
229
|
-
readonly id: string;
|
|
230
|
-
}
|
|
231
|
-
type ChannelDeleteResult = {
|
|
232
|
-
readonly deleted: true;
|
|
233
|
-
} | {
|
|
234
|
-
readonly deleted: false;
|
|
235
|
-
readonly reason: "not_found" | "not_empty";
|
|
236
|
-
};
|
|
237
|
-
interface ChannelModel {
|
|
238
|
-
insert(input: ChannelInsertInput): Promise<ChannelInsertResult>;
|
|
239
|
-
list(input: {}): Promise<{
|
|
240
|
-
readonly channels: readonly ChannelRow[];
|
|
241
|
-
}>;
|
|
242
|
-
delete(input: ChannelDeleteInput): Promise<ChannelDeleteResult>;
|
|
243
|
-
}
|
|
244
|
-
type DatabaseChange = {
|
|
245
|
-
readonly model: "bundles";
|
|
246
|
-
readonly operation: "insert";
|
|
247
|
-
readonly row: BundleRow;
|
|
248
|
-
} | {
|
|
249
|
-
readonly model: "bundles";
|
|
250
|
-
readonly operation: "update";
|
|
251
|
-
readonly where: {
|
|
252
|
-
readonly id: string;
|
|
253
|
-
};
|
|
254
|
-
readonly update: BundleRowUpdate;
|
|
255
|
-
} | {
|
|
256
|
-
readonly model: "bundles";
|
|
257
|
-
readonly operation: "delete";
|
|
258
|
-
readonly where: {
|
|
259
|
-
readonly id: string;
|
|
260
|
-
};
|
|
261
|
-
} | {
|
|
262
|
-
readonly model: "bundlePatches";
|
|
263
|
-
readonly operation: "insert";
|
|
264
|
-
readonly row: BundlePatchRow;
|
|
265
|
-
} | {
|
|
266
|
-
readonly model: "bundlePatches";
|
|
267
|
-
readonly operation: "delete";
|
|
268
|
-
readonly where: {
|
|
269
|
-
readonly bundleId: string;
|
|
270
|
-
};
|
|
271
|
-
} | {
|
|
272
|
-
readonly model: "releases";
|
|
273
|
-
readonly operation: "insert";
|
|
274
|
-
readonly row: ReleaseRow;
|
|
275
|
-
} | {
|
|
276
|
-
readonly model: "releases";
|
|
277
|
-
readonly operation: "update";
|
|
278
|
-
readonly where: {
|
|
279
|
-
readonly id: string;
|
|
280
|
-
};
|
|
281
|
-
readonly update: ReleaseRowUpdate;
|
|
282
|
-
} | {
|
|
283
|
-
readonly model: "releases";
|
|
284
|
-
readonly operation: "delete";
|
|
285
|
-
readonly where: {
|
|
286
|
-
readonly id: string;
|
|
287
|
-
};
|
|
288
|
-
} | {
|
|
289
|
-
readonly model: "releaseCatalogs";
|
|
290
|
-
readonly operation: "put";
|
|
291
|
-
readonly row: ReleaseCatalogRow;
|
|
292
|
-
} | {
|
|
293
|
-
readonly model: "channels";
|
|
294
|
-
readonly operation: "insert";
|
|
295
|
-
readonly row: ChannelRow;
|
|
296
|
-
readonly onConflict: "ignore";
|
|
297
|
-
} | {
|
|
298
|
-
readonly model: "channels";
|
|
299
|
-
readonly operation: "delete";
|
|
300
|
-
readonly where: {
|
|
301
|
-
readonly id: string;
|
|
302
|
-
};
|
|
303
|
-
} | {
|
|
304
|
-
readonly model: "apiKeys";
|
|
305
|
-
readonly operation: "insert";
|
|
306
|
-
readonly row: ApiKeyRow;
|
|
307
|
-
readonly onConflict: "ignore";
|
|
308
|
-
} | {
|
|
309
|
-
readonly model: "apiKeys";
|
|
310
|
-
readonly operation: "update";
|
|
311
|
-
readonly where: {
|
|
312
|
-
readonly id: string;
|
|
313
|
-
};
|
|
314
|
-
readonly update: {
|
|
315
|
-
readonly revokedAtMs: number;
|
|
316
|
-
};
|
|
317
|
-
};
|
|
318
|
-
type DatabaseCommitExpectation = {
|
|
319
|
-
readonly model: "releases";
|
|
320
|
-
readonly id: string;
|
|
321
|
-
readonly revision: number | null;
|
|
322
|
-
} | {
|
|
323
|
-
readonly model: "releaseCatalogs";
|
|
324
|
-
readonly scopeKey: string;
|
|
325
|
-
readonly generation: number | null;
|
|
326
|
-
};
|
|
327
|
-
interface DatabaseCommit {
|
|
328
|
-
readonly changes: readonly DatabaseChange[];
|
|
329
|
-
readonly expectations?: readonly DatabaseCommitExpectation[];
|
|
330
|
-
}
|
|
331
|
-
type BundleRepositoryBundleChange = Extract<DatabaseChange, {
|
|
332
|
-
readonly model: "bundles" | "bundlePatches";
|
|
333
|
-
}>;
|
|
334
|
-
type BundleRepositoryChannelChange = Extract<DatabaseChange, {
|
|
335
|
-
readonly model: "channels";
|
|
336
|
-
}>;
|
|
337
|
-
type BundleRepositoryChange = BundleRepositoryBundleChange | BundleRepositoryChannelChange;
|
|
338
|
-
/**
|
|
339
|
-
* The atomic envelopes supported by a bundle-management repository.
|
|
340
|
-
*
|
|
341
|
-
* Bundle and patch changes form one aggregate commit. Channel lifecycle is a
|
|
342
|
-
* separate single-change commit because the standalone HTTP boundary cannot
|
|
343
|
-
* atomically combine a Channel write with a bundle aggregate write.
|
|
344
|
-
*/
|
|
345
|
-
type BundleRepositoryCommit = {
|
|
346
|
-
readonly changes: readonly BundleRepositoryBundleChange[];
|
|
347
|
-
} | {
|
|
348
|
-
readonly changes: readonly [BundleRepositoryChannelChange];
|
|
349
|
-
};
|
|
350
|
-
type DatabaseCommitResult = {
|
|
351
|
-
readonly committed: true;
|
|
352
|
-
} | {
|
|
353
|
-
readonly committed: false;
|
|
354
|
-
readonly conflict: {
|
|
355
|
-
readonly changeIndex: number;
|
|
356
|
-
readonly reason: "not_found" | "referenced";
|
|
357
|
-
} | {
|
|
358
|
-
readonly changeIndex: -1;
|
|
359
|
-
readonly reason: "version_conflict";
|
|
360
|
-
readonly model: "releases" | "releaseCatalogs";
|
|
361
|
-
readonly key: string;
|
|
362
|
-
readonly expectedVersion: number | null;
|
|
363
|
-
readonly actualVersion: number | null;
|
|
364
|
-
};
|
|
365
|
-
};
|
|
366
|
-
interface DatabaseModels {
|
|
367
|
-
readonly bundles: BundleModel;
|
|
368
|
-
readonly bundlePatches: BundlePatchModel;
|
|
369
|
-
readonly releases: ReleaseModel;
|
|
370
|
-
readonly releaseCatalogs: ReleaseCatalogModel;
|
|
371
|
-
readonly channels: ChannelModel;
|
|
372
|
-
readonly insights: InsightsModel;
|
|
373
|
-
readonly apiKeys: ApiKeyModel;
|
|
374
|
-
}
|
|
375
|
-
interface BundleRepository {
|
|
376
|
-
readonly name: string;
|
|
377
|
-
readonly models: Pick<DatabaseModels, "bundles" | "bundlePatches" | "channels" | "releaseCatalogs" | "releases">;
|
|
378
|
-
commit(input: DatabaseCommit): Promise<DatabaseCommitResult>;
|
|
379
|
-
dispose?: () => Promise<void>;
|
|
380
|
-
}
|
|
381
|
-
interface DatabasePlugin {
|
|
382
|
-
readonly name: string;
|
|
383
|
-
readonly models: DatabaseModels;
|
|
384
|
-
commit(input: DatabaseCommit): Promise<DatabaseCommitResult>;
|
|
385
|
-
dispose?: () => Promise<void>;
|
|
386
|
-
}
|
|
387
|
-
//#endregion
|
|
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 };
|