@hot-updater/server 1.0.0-rc.0 → 1.0.0-rc.2
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/adapters/databaseConstraintErrors.cjs +0 -1
- package/dist/adapters/databasePluginUtils.cjs +0 -1
- package/dist/adapters/drizzle.cjs +11 -4
- package/dist/adapters/drizzle.d.cts +0 -1
- package/dist/adapters/drizzle.d.mts +0 -1
- package/dist/adapters/drizzle.mjs +12 -4
- package/dist/adapters/drizzleCrud.cjs +62 -1
- package/dist/adapters/drizzleCrud.mjs +61 -2
- package/dist/adapters/drizzleLazyDB.cjs +6 -1
- package/dist/adapters/drizzleLazyDB.mjs +6 -1
- package/dist/adapters/drizzleQuery.cjs +3 -2
- package/dist/adapters/drizzleQuery.mjs +3 -1
- package/dist/adapters/insightsTransaction.cjs +22 -0
- package/dist/adapters/insightsTransaction.mjs +22 -0
- package/dist/adapters/kysely.cjs +2 -1
- package/dist/adapters/kysely.d.cts +0 -1
- package/dist/adapters/kysely.d.mts +0 -1
- package/dist/adapters/kysely.mjs +3 -1
- package/dist/adapters/kyselyCrud.cjs +54 -3
- package/dist/adapters/kyselyCrud.mjs +54 -3
- package/dist/adapters/kyselyQuery.cjs +2 -2
- package/dist/adapters/kyselyQuery.mjs +2 -1
- package/dist/adapters/mongodb.cjs +27 -1
- package/dist/adapters/mongodb.d.cts +1 -1
- package/dist/adapters/mongodb.d.mts +1 -1
- package/dist/adapters/mongodb.mjs +28 -1
- package/dist/adapters/mongodbCollections.cjs +2 -0
- package/dist/adapters/mongodbCollections.mjs +2 -0
- package/dist/adapters/mongodbQuery.cjs +21 -4
- package/dist/adapters/mongodbQuery.mjs +21 -5
- package/dist/adapters/mongodbReads.cjs +91 -29
- package/dist/adapters/mongodbReads.mjs +92 -29
- package/dist/adapters/mongodbWrites.cjs +16 -2
- package/dist/adapters/mongodbWrites.mjs +18 -3
- package/dist/adapters/prisma.cjs +55 -7
- package/dist/adapters/prisma.d.cts +0 -1
- package/dist/adapters/prisma.d.mts +0 -1
- package/dist/adapters/prisma.mjs +56 -7
- package/dist/adapters/prismaQuery.cjs +0 -1
- package/dist/adapters/prismaRows.cjs +22 -1
- package/dist/adapters/prismaRows.mjs +22 -1
- package/dist/apiKeys.cjs +6 -2
- package/dist/apiKeys.d.cts +0 -1
- package/dist/apiKeys.d.mts +0 -1
- package/dist/apiKeys.mjs +3 -3
- package/dist/createHotUpdaterCore.cjs +27 -12
- package/dist/createHotUpdaterCore.d.cts +8 -8
- package/dist/createHotUpdaterCore.d.mts +8 -8
- package/dist/createHotUpdaterCore.mjs +26 -12
- package/dist/db/createBundleDiff.cjs +2 -2
- package/dist/db/createBundleDiff.d.cts +1 -5
- package/dist/db/createBundleDiff.d.mts +1 -5
- package/dist/db/databasePluginCore.cjs +0 -1
- package/dist/db/fixedMigrator.cjs +2 -2
- package/dist/db/fixedMigrator.mjs +2 -2
- package/dist/db/fixedMigratorMongo.cjs +6 -4
- package/dist/db/fixedMigratorMongo.mjs +6 -4
- package/dist/db/index.d.cts +0 -1
- package/dist/db/index.d.mts +0 -1
- package/dist/db/releaseCatalog.cjs +0 -1
- package/dist/db/releaseCatalog.d.cts +0 -1
- package/dist/db/releaseCatalog.d.mts +0 -1
- package/dist/db/schema/insightsCollation.cjs +14 -0
- package/dist/db/schema/insightsCollation.mjs +14 -0
- package/dist/db/schema/sql.cjs +11 -7
- package/dist/db/schema/sql.mjs +8 -8
- package/dist/db/schemaGenerators.cjs +28 -9
- package/dist/db/schemaGenerators.mjs +28 -9
- package/dist/db/schemaReadiness.cjs +2 -0
- package/dist/db/schemaReadiness.d.cts +1 -0
- package/dist/db/schemaReadiness.d.mts +1 -0
- package/dist/db/schemaReadiness.mjs +2 -0
- package/dist/db/sqlMigrationExecution.cjs +1 -1
- package/dist/db/sqlMigrationExecution.mjs +1 -0
- package/dist/db/types.cjs +3 -1
- package/dist/db/types.d.cts +3 -6
- package/dist/db/types.d.mts +3 -6
- package/dist/db/types.mjs +2 -2
- package/dist/db/updateArtifacts.cjs +0 -1
- package/dist/handler.cjs +5 -5
- package/dist/handler.d.cts +1 -2
- package/dist/handler.d.mts +1 -2
- package/dist/handler.mjs +5 -5
- package/dist/handlerReleaseCatalogRoutes.cjs +0 -1
- package/dist/handlerReleaseManagementRoutes.cjs +0 -1
- package/dist/handlerTypes.d.cts +0 -1
- package/dist/handlerTypes.d.mts +0 -1
- package/dist/handlerVersionRoutes.d.cts +1 -0
- package/dist/handlerVersionRoutes.d.mts +1 -0
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +4 -4
- package/dist/index.d.mts +4 -4
- package/dist/index.mjs +2 -2
- package/dist/insights/domain.d.cts +89 -0
- package/dist/insights/domain.d.mts +89 -0
- package/dist/insights/errors.cjs +15 -0
- package/dist/insights/errors.mjs +14 -0
- package/dist/{analytics → insights}/eventInput.cjs +58 -14
- package/dist/{analytics → insights}/eventInput.mjs +58 -16
- package/dist/insights/provider.cjs +314 -0
- package/dist/insights/provider.d.cts +6 -0
- package/dist/insights/provider.d.mts +6 -0
- package/dist/insights/provider.mjs +314 -0
- package/dist/insights/queryInput.cjs +93 -0
- package/dist/insights/queryInput.mjs +91 -0
- package/dist/insights/routes.cjs +58 -0
- package/dist/insights/routes.mjs +56 -0
- package/dist/insights/types.d.cts +32 -0
- package/dist/insights/types.d.mts +32 -0
- package/dist/node.d.cts +0 -1
- package/dist/node.d.mts +0 -1
- package/dist/package.cjs +1 -1
- package/dist/package.mjs +1 -1
- package/dist/schema/index.cjs +17 -3
- package/dist/schema/index.mjs +4 -4
- package/dist/schema/v1_0_0.cjs +72 -30
- package/dist/schema/v1_0_0.mjs +72 -31
- package/dist/storageAccess.cjs +0 -1
- package/dist/types/index.d.cts +0 -1
- package/dist/types/index.d.mts +0 -1
- package/package.json +7 -7
- package/src/adapters/databasePluginTestDatabase.ts +14 -0
- package/src/adapters/drizzle.spec.ts +99 -0
- package/src/adapters/drizzle.ts +22 -4
- package/src/adapters/drizzleCrud.ts +154 -2
- package/src/adapters/drizzleLazyDB.ts +17 -3
- package/src/adapters/insightsTransaction.ts +32 -0
- package/src/adapters/kysely.spec.ts +29 -0
- package/src/adapters/kysely.ts +10 -1
- package/src/adapters/kyselyCrud.ts +121 -0
- package/src/adapters/mongodb.integration.spec.ts +210 -0
- package/src/adapters/mongodb.spec.ts +69 -1
- package/src/adapters/mongodb.ts +66 -2
- package/src/adapters/mongodbCollections.ts +5 -0
- package/src/adapters/mongodbQuery.ts +32 -3
- package/src/adapters/mongodbReads.ts +69 -0
- package/src/adapters/mongodbTestClient.ts +41 -6
- package/src/adapters/mongodbTestFilter.ts +4 -1
- package/src/adapters/mongodbWrites.ts +27 -0
- package/src/adapters/prisma.spec.ts +97 -0
- package/src/adapters/prisma.ts +103 -3
- package/src/adapters/prismaRows.ts +37 -1
- package/src/adapters/prismaTestClient.ts +22 -5
- package/src/apiKeys.integration.spec.ts +3 -3
- package/src/createHotUpdaterCore.ts +30 -16
- package/src/db/databasePluginUpdateCheck.bench.ts +3 -0
- package/src/db/fixedMigrator.spec.ts +65 -0
- package/src/db/fixedMigratorMongo.spec.ts +56 -9
- package/src/db/fixedMigratorMongo.ts +10 -10
- package/src/db/index.spec.ts +8 -1
- package/src/db/schema/insightsCollation.ts +21 -0
- package/src/db/schema/sql.ts +8 -5
- package/src/db/schemaGenerators.ts +41 -13
- package/src/db/types.spec.ts +11 -3
- package/src/db/types.ts +13 -7
- package/src/handler-standalone.integration.spec.ts +6 -8
- package/src/handler.ts +12 -12
- package/src/index.ts +3 -3
- package/src/insights/domain.ts +103 -0
- package/src/insights/errors.ts +11 -0
- package/src/{analytics → insights}/eventInput.ts +71 -14
- package/src/insights/insights.integration.spec.ts +381 -0
- package/src/insights/provider.spec.ts +385 -0
- package/src/insights/provider.ts +591 -0
- package/src/insights/queryInput.ts +141 -0
- package/src/insights/routes.ts +104 -0
- package/src/insights/types.ts +55 -0
- package/src/schema/dsl-all-versions.spec.ts +3 -1
- package/src/schema/v1_0_0.spec.ts +77 -3
- package/src/schema/v1_0_0.ts +94 -30
- package/dist/analytics/bounded/activeOverview.cjs +0 -87
- package/dist/analytics/bounded/activeOverview.mjs +0 -85
- package/dist/analytics/bounded/installationSearch.cjs +0 -42
- package/dist/analytics/bounded/installationSearch.mjs +0 -42
- package/dist/analytics/bounded/persistence.cjs +0 -39
- package/dist/analytics/bounded/persistence.mjs +0 -38
- package/dist/analytics/bounded/provider.cjs +0 -170
- package/dist/analytics/bounded/provider.d.cts +0 -7
- package/dist/analytics/bounded/provider.d.mts +0 -7
- package/dist/analytics/bounded/provider.mjs +0 -170
- package/dist/analytics/bounded/scan.cjs +0 -144
- package/dist/analytics/bounded/scan.mjs +0 -138
- package/dist/analytics/domain.d.cts +0 -121
- package/dist/analytics/domain.d.mts +0 -121
- package/dist/analytics/errors.cjs +0 -22
- package/dist/analytics/errors.mjs +0 -20
- package/dist/analytics/persistence.d.cts +0 -6
- package/dist/analytics/persistence.d.mts +0 -6
- package/dist/analytics/queryInput.cjs +0 -58
- package/dist/analytics/queryInput.mjs +0 -55
- package/dist/analytics/routes.cjs +0 -63
- package/dist/analytics/routes.mjs +0 -61
- package/dist/analytics/types.d.cts +0 -17
- package/dist/analytics/types.d.mts +0 -17
- package/src/analytics/analytics.integration.spec.ts +0 -144
- package/src/analytics/bounded/activeOverview.spec.ts +0 -189
- package/src/analytics/bounded/activeOverview.ts +0 -148
- package/src/analytics/bounded/installationSearch.spec.ts +0 -130
- package/src/analytics/bounded/installationSearch.ts +0 -69
- package/src/analytics/bounded/persistence.ts +0 -43
- package/src/analytics/bounded/provider.spec.ts +0 -219
- package/src/analytics/bounded/provider.ts +0 -229
- package/src/analytics/bounded/scan.ts +0 -235
- package/src/analytics/domain.ts +0 -139
- package/src/analytics/errors.ts +0 -18
- package/src/analytics/persistence.ts +0 -10
- package/src/analytics/queryInput.ts +0 -102
- package/src/analytics/routes.ts +0 -123
- package/src/analytics/types.ts +0 -44
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
const require_errors = require("./errors.cjs");
|
|
2
|
+
//#region src/insights/queryInput.ts
|
|
3
|
+
const MAX_PAGE_LIMIT = 100;
|
|
4
|
+
const MAX_IDENTITY_LENGTH = 255;
|
|
5
|
+
const MAX_CURSOR_LENGTH = 8192;
|
|
6
|
+
const readSingle = (url, key) => {
|
|
7
|
+
const values = url.searchParams.getAll(key);
|
|
8
|
+
if (values.length > 1) throw new require_errors.InsightsBadRequestError(`Duplicate '${key}' query parameter.`);
|
|
9
|
+
return values[0];
|
|
10
|
+
};
|
|
11
|
+
const readPageLimit = (url) => {
|
|
12
|
+
const value = readSingle(url, "limit");
|
|
13
|
+
if (value === void 0) return void 0;
|
|
14
|
+
const limit = Number(value);
|
|
15
|
+
if (!Number.isSafeInteger(limit) || limit < 1 || limit > MAX_PAGE_LIMIT) throw new require_errors.InsightsBadRequestError("Invalid 'limit' query parameter.");
|
|
16
|
+
return limit;
|
|
17
|
+
};
|
|
18
|
+
const readCursor = (url) => {
|
|
19
|
+
const cursor = readSingle(url, "cursor");
|
|
20
|
+
if (cursor !== void 0 && (cursor.length === 0 || cursor.length > MAX_CURSOR_LENGTH)) throw new require_errors.InsightsBadRequestError("Invalid 'cursor' query parameter.");
|
|
21
|
+
return cursor;
|
|
22
|
+
};
|
|
23
|
+
const readId = (url, key, maximumLength = MAX_IDENTITY_LENGTH) => {
|
|
24
|
+
const value = readSingle(url, key);
|
|
25
|
+
if (value === void 0 || value.length === 0 || value.length > maximumLength) throw new require_errors.InsightsBadRequestError(`Invalid '${key}' query parameter.`);
|
|
26
|
+
return value;
|
|
27
|
+
};
|
|
28
|
+
const readTimestamp = (url, key) => {
|
|
29
|
+
const raw = readSingle(url, key);
|
|
30
|
+
if (raw === void 0) return void 0;
|
|
31
|
+
const value = Number(raw);
|
|
32
|
+
if (!raw.length || !Number.isSafeInteger(value) || value < 0) throw new require_errors.InsightsBadRequestError(`Invalid '${key}' query parameter.`);
|
|
33
|
+
return value;
|
|
34
|
+
};
|
|
35
|
+
const readScope = (url) => {
|
|
36
|
+
const platform = readSingle(url, "platform");
|
|
37
|
+
if (platform !== "ios" && platform !== "android") throw new require_errors.InsightsBadRequestError("Invalid 'platform' query parameter.");
|
|
38
|
+
return {
|
|
39
|
+
platform,
|
|
40
|
+
channel: readId(url, "channel", 1024)
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
const parseEventPageInput = (request) => {
|
|
44
|
+
const url = new URL(request.url);
|
|
45
|
+
const bundleFields = [
|
|
46
|
+
"bundleId",
|
|
47
|
+
"outcome",
|
|
48
|
+
"platform",
|
|
49
|
+
"channel"
|
|
50
|
+
];
|
|
51
|
+
let bundle;
|
|
52
|
+
if (bundleFields.some((key) => url.searchParams.has(key))) {
|
|
53
|
+
const outcome = readSingle(url, "outcome");
|
|
54
|
+
if (outcome !== "applied" && outcome !== "recovered" && outcome !== "adopted") throw new require_errors.InsightsBadRequestError("Invalid 'outcome' query parameter.");
|
|
55
|
+
bundle = {
|
|
56
|
+
...readScope(url),
|
|
57
|
+
bundleId: readId(url, "bundleId", 1024),
|
|
58
|
+
outcome
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
return {
|
|
62
|
+
beforeReceivedAtMs: readTimestamp(url, "beforeReceivedAtMs"),
|
|
63
|
+
sinceMs: readTimestamp(url, "sinceMs"),
|
|
64
|
+
cursor: readCursor(url),
|
|
65
|
+
limit: readPageLimit(url),
|
|
66
|
+
...bundle === void 0 ? {} : { bundle }
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
const parseUserInstallationPageInput = (request) => {
|
|
70
|
+
const url = new URL(request.url);
|
|
71
|
+
const cursor = readCursor(url);
|
|
72
|
+
const limit = readPageLimit(url);
|
|
73
|
+
return {
|
|
74
|
+
userId: readId(url, "userId"),
|
|
75
|
+
...cursor === void 0 ? {} : { cursor },
|
|
76
|
+
...limit === void 0 ? {} : { limit }
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
const parseReportingOverviewInput = (request) => {
|
|
80
|
+
const url = new URL(request.url);
|
|
81
|
+
const window = readSingle(url, "window") ?? "30d";
|
|
82
|
+
if (window !== "24h" && window !== "7d" && window !== "30d") throw new require_errors.InsightsBadRequestError("Invalid 'window' query parameter.");
|
|
83
|
+
const bundleId = readSingle(url, "bundleId");
|
|
84
|
+
return {
|
|
85
|
+
...readScope(url),
|
|
86
|
+
window,
|
|
87
|
+
...bundleId === void 0 ? {} : { bundleId: readId(url, "bundleId", 1024) }
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
//#endregion
|
|
91
|
+
exports.parseEventPageInput = parseEventPageInput;
|
|
92
|
+
exports.parseReportingOverviewInput = parseReportingOverviewInput;
|
|
93
|
+
exports.parseUserInstallationPageInput = parseUserInstallationPageInput;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { InsightsBadRequestError } from "./errors.mjs";
|
|
2
|
+
//#region src/insights/queryInput.ts
|
|
3
|
+
const MAX_PAGE_LIMIT = 100;
|
|
4
|
+
const MAX_IDENTITY_LENGTH = 255;
|
|
5
|
+
const MAX_CURSOR_LENGTH = 8192;
|
|
6
|
+
const readSingle = (url, key) => {
|
|
7
|
+
const values = url.searchParams.getAll(key);
|
|
8
|
+
if (values.length > 1) throw new InsightsBadRequestError(`Duplicate '${key}' query parameter.`);
|
|
9
|
+
return values[0];
|
|
10
|
+
};
|
|
11
|
+
const readPageLimit = (url) => {
|
|
12
|
+
const value = readSingle(url, "limit");
|
|
13
|
+
if (value === void 0) return void 0;
|
|
14
|
+
const limit = Number(value);
|
|
15
|
+
if (!Number.isSafeInteger(limit) || limit < 1 || limit > MAX_PAGE_LIMIT) throw new InsightsBadRequestError("Invalid 'limit' query parameter.");
|
|
16
|
+
return limit;
|
|
17
|
+
};
|
|
18
|
+
const readCursor = (url) => {
|
|
19
|
+
const cursor = readSingle(url, "cursor");
|
|
20
|
+
if (cursor !== void 0 && (cursor.length === 0 || cursor.length > MAX_CURSOR_LENGTH)) throw new InsightsBadRequestError("Invalid 'cursor' query parameter.");
|
|
21
|
+
return cursor;
|
|
22
|
+
};
|
|
23
|
+
const readId = (url, key, maximumLength = MAX_IDENTITY_LENGTH) => {
|
|
24
|
+
const value = readSingle(url, key);
|
|
25
|
+
if (value === void 0 || value.length === 0 || value.length > maximumLength) throw new InsightsBadRequestError(`Invalid '${key}' query parameter.`);
|
|
26
|
+
return value;
|
|
27
|
+
};
|
|
28
|
+
const readTimestamp = (url, key) => {
|
|
29
|
+
const raw = readSingle(url, key);
|
|
30
|
+
if (raw === void 0) return void 0;
|
|
31
|
+
const value = Number(raw);
|
|
32
|
+
if (!raw.length || !Number.isSafeInteger(value) || value < 0) throw new InsightsBadRequestError(`Invalid '${key}' query parameter.`);
|
|
33
|
+
return value;
|
|
34
|
+
};
|
|
35
|
+
const readScope = (url) => {
|
|
36
|
+
const platform = readSingle(url, "platform");
|
|
37
|
+
if (platform !== "ios" && platform !== "android") throw new InsightsBadRequestError("Invalid 'platform' query parameter.");
|
|
38
|
+
return {
|
|
39
|
+
platform,
|
|
40
|
+
channel: readId(url, "channel", 1024)
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
const parseEventPageInput = (request) => {
|
|
44
|
+
const url = new URL(request.url);
|
|
45
|
+
const bundleFields = [
|
|
46
|
+
"bundleId",
|
|
47
|
+
"outcome",
|
|
48
|
+
"platform",
|
|
49
|
+
"channel"
|
|
50
|
+
];
|
|
51
|
+
let bundle;
|
|
52
|
+
if (bundleFields.some((key) => url.searchParams.has(key))) {
|
|
53
|
+
const outcome = readSingle(url, "outcome");
|
|
54
|
+
if (outcome !== "applied" && outcome !== "recovered" && outcome !== "adopted") throw new InsightsBadRequestError("Invalid 'outcome' query parameter.");
|
|
55
|
+
bundle = {
|
|
56
|
+
...readScope(url),
|
|
57
|
+
bundleId: readId(url, "bundleId", 1024),
|
|
58
|
+
outcome
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
return {
|
|
62
|
+
beforeReceivedAtMs: readTimestamp(url, "beforeReceivedAtMs"),
|
|
63
|
+
sinceMs: readTimestamp(url, "sinceMs"),
|
|
64
|
+
cursor: readCursor(url),
|
|
65
|
+
limit: readPageLimit(url),
|
|
66
|
+
...bundle === void 0 ? {} : { bundle }
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
const parseUserInstallationPageInput = (request) => {
|
|
70
|
+
const url = new URL(request.url);
|
|
71
|
+
const cursor = readCursor(url);
|
|
72
|
+
const limit = readPageLimit(url);
|
|
73
|
+
return {
|
|
74
|
+
userId: readId(url, "userId"),
|
|
75
|
+
...cursor === void 0 ? {} : { cursor },
|
|
76
|
+
...limit === void 0 ? {} : { limit }
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
const parseReportingOverviewInput = (request) => {
|
|
80
|
+
const url = new URL(request.url);
|
|
81
|
+
const window = readSingle(url, "window") ?? "30d";
|
|
82
|
+
if (window !== "24h" && window !== "7d" && window !== "30d") throw new InsightsBadRequestError("Invalid 'window' query parameter.");
|
|
83
|
+
const bundleId = readSingle(url, "bundleId");
|
|
84
|
+
return {
|
|
85
|
+
...readScope(url),
|
|
86
|
+
window,
|
|
87
|
+
...bundleId === void 0 ? {} : { bundleId: readId(url, "bundleId", 1024) }
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
//#endregion
|
|
91
|
+
export { parseEventPageInput, parseReportingOverviewInput, parseUserInstallationPageInput };
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
const require_errors = require("./errors.cjs");
|
|
2
|
+
const require_eventInput = require("./eventInput.cjs");
|
|
3
|
+
const require_queryInput = require("./queryInput.cjs");
|
|
4
|
+
//#region src/insights/routes.ts
|
|
5
|
+
const json = (body, status) => Response.json(body, {
|
|
6
|
+
headers: { "cache-control": "private, no-store" },
|
|
7
|
+
status
|
|
8
|
+
});
|
|
9
|
+
const requireParam = (params, key) => {
|
|
10
|
+
const value = params[key];
|
|
11
|
+
if (value === void 0 || value.length === 0) throw new require_errors.InsightsBadRequestError(`Missing route parameter: ${key}`);
|
|
12
|
+
try {
|
|
13
|
+
return decodeURIComponent(value);
|
|
14
|
+
} catch {
|
|
15
|
+
throw new require_errors.InsightsBadRequestError(`Invalid route parameter: ${key}`);
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
const run = async (operation) => {
|
|
19
|
+
try {
|
|
20
|
+
return await operation();
|
|
21
|
+
} catch (error) {
|
|
22
|
+
if (error instanceof require_errors.InsightsBadRequestError) return json({ error: error.message }, 400);
|
|
23
|
+
if (error instanceof require_errors.InsightsPayloadTooLargeError) return json({ error: error.message }, 413);
|
|
24
|
+
throw error;
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
const query = (operation) => run(async () => json(await operation(), 200));
|
|
28
|
+
const createInsightsRouteHandlers = (provider) => ({
|
|
29
|
+
appendBundleEvent: async (_params, request) => run(async () => {
|
|
30
|
+
await provider.appendBundleEvent(await require_eventInput.parseBundleEventRequest(request));
|
|
31
|
+
return new Response(null, { status: 204 });
|
|
32
|
+
}),
|
|
33
|
+
getReportingOverview: (_params, request) => query(() => provider.getReportingOverview(require_queryInput.parseReportingOverviewInput(request))),
|
|
34
|
+
getInstallation: (params) => run(async () => {
|
|
35
|
+
const installation = await provider.getInstallation({ installId: requireParam(params, "installId") });
|
|
36
|
+
return installation === null ? json({ error: "Installation not found" }, 404) : json(installation, 200);
|
|
37
|
+
}),
|
|
38
|
+
listEvents: (_params, request) => query(() => provider.listEvents(require_queryInput.parseEventPageInput(request))),
|
|
39
|
+
listInstallationEvents: (params, request) => query(() => provider.listInstallationEvents({
|
|
40
|
+
...require_queryInput.parseEventPageInput(request),
|
|
41
|
+
installId: requireParam(params, "installId")
|
|
42
|
+
})),
|
|
43
|
+
pageInstallationsByCurrentUserId: (_params, request) => query(() => provider.pageInstallationsByCurrentUserId(require_queryInput.parseUserInstallationPageInput(request)))
|
|
44
|
+
});
|
|
45
|
+
const registerInsightsClientRoutes = (add) => {
|
|
46
|
+
add("POST", "/events", "appendBundleEvent");
|
|
47
|
+
};
|
|
48
|
+
const registerInsightsAdminRoutes = (add) => {
|
|
49
|
+
add("GET", "/events", "listEvents");
|
|
50
|
+
add("GET", "/overview", "getReportingOverview");
|
|
51
|
+
add("GET", "/installations", "pageInstallationsByCurrentUserId");
|
|
52
|
+
add("GET", "/installations/:installId/events", "listInstallationEvents");
|
|
53
|
+
add("GET", "/installations/:installId", "getInstallation");
|
|
54
|
+
};
|
|
55
|
+
//#endregion
|
|
56
|
+
exports.createInsightsRouteHandlers = createInsightsRouteHandlers;
|
|
57
|
+
exports.registerInsightsAdminRoutes = registerInsightsAdminRoutes;
|
|
58
|
+
exports.registerInsightsClientRoutes = registerInsightsClientRoutes;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { InsightsBadRequestError, InsightsPayloadTooLargeError } from "./errors.mjs";
|
|
2
|
+
import { parseBundleEventRequest } from "./eventInput.mjs";
|
|
3
|
+
import { parseEventPageInput, parseReportingOverviewInput, parseUserInstallationPageInput } from "./queryInput.mjs";
|
|
4
|
+
//#region src/insights/routes.ts
|
|
5
|
+
const json = (body, status) => Response.json(body, {
|
|
6
|
+
headers: { "cache-control": "private, no-store" },
|
|
7
|
+
status
|
|
8
|
+
});
|
|
9
|
+
const requireParam = (params, key) => {
|
|
10
|
+
const value = params[key];
|
|
11
|
+
if (value === void 0 || value.length === 0) throw new InsightsBadRequestError(`Missing route parameter: ${key}`);
|
|
12
|
+
try {
|
|
13
|
+
return decodeURIComponent(value);
|
|
14
|
+
} catch {
|
|
15
|
+
throw new InsightsBadRequestError(`Invalid route parameter: ${key}`);
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
const run = async (operation) => {
|
|
19
|
+
try {
|
|
20
|
+
return await operation();
|
|
21
|
+
} catch (error) {
|
|
22
|
+
if (error instanceof InsightsBadRequestError) return json({ error: error.message }, 400);
|
|
23
|
+
if (error instanceof InsightsPayloadTooLargeError) return json({ error: error.message }, 413);
|
|
24
|
+
throw error;
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
const query = (operation) => run(async () => json(await operation(), 200));
|
|
28
|
+
const createInsightsRouteHandlers = (provider) => ({
|
|
29
|
+
appendBundleEvent: async (_params, request) => run(async () => {
|
|
30
|
+
await provider.appendBundleEvent(await parseBundleEventRequest(request));
|
|
31
|
+
return new Response(null, { status: 204 });
|
|
32
|
+
}),
|
|
33
|
+
getReportingOverview: (_params, request) => query(() => provider.getReportingOverview(parseReportingOverviewInput(request))),
|
|
34
|
+
getInstallation: (params) => run(async () => {
|
|
35
|
+
const installation = await provider.getInstallation({ installId: requireParam(params, "installId") });
|
|
36
|
+
return installation === null ? json({ error: "Installation not found" }, 404) : json(installation, 200);
|
|
37
|
+
}),
|
|
38
|
+
listEvents: (_params, request) => query(() => provider.listEvents(parseEventPageInput(request))),
|
|
39
|
+
listInstallationEvents: (params, request) => query(() => provider.listInstallationEvents({
|
|
40
|
+
...parseEventPageInput(request),
|
|
41
|
+
installId: requireParam(params, "installId")
|
|
42
|
+
})),
|
|
43
|
+
pageInstallationsByCurrentUserId: (_params, request) => query(() => provider.pageInstallationsByCurrentUserId(parseUserInstallationPageInput(request)))
|
|
44
|
+
});
|
|
45
|
+
const registerInsightsClientRoutes = (add) => {
|
|
46
|
+
add("POST", "/events", "appendBundleEvent");
|
|
47
|
+
};
|
|
48
|
+
const registerInsightsAdminRoutes = (add) => {
|
|
49
|
+
add("GET", "/events", "listEvents");
|
|
50
|
+
add("GET", "/overview", "getReportingOverview");
|
|
51
|
+
add("GET", "/installations", "pageInstallationsByCurrentUserId");
|
|
52
|
+
add("GET", "/installations/:installId/events", "listInstallationEvents");
|
|
53
|
+
add("GET", "/installations/:installId", "getInstallation");
|
|
54
|
+
};
|
|
55
|
+
//#endregion
|
|
56
|
+
export { createInsightsRouteHandlers, registerInsightsAdminRoutes, registerInsightsClientRoutes };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ActiveInstallationWindow, CreateBundleEventRequest, CursorPage, EventCursorPage, EventHistoryRow, InsightsBundleSelection, InsightsScope, InstallationHistoryRow, InstallationRow, ReportingOverview } from "./domain.cjs";
|
|
2
|
+
//#region src/insights/types.d.ts
|
|
3
|
+
type InsightsEventPageInput = {
|
|
4
|
+
readonly beforeReceivedAtMs?: number;
|
|
5
|
+
readonly sinceMs?: number;
|
|
6
|
+
readonly bundle?: InsightsBundleSelection;
|
|
7
|
+
readonly cursor?: string;
|
|
8
|
+
readonly limit?: number;
|
|
9
|
+
};
|
|
10
|
+
type InsightsInstallationEventPageInput = Omit<InsightsEventPageInput, "bundle"> & {
|
|
11
|
+
readonly installId: string;
|
|
12
|
+
};
|
|
13
|
+
type InsightsUserInstallationPageInput = {
|
|
14
|
+
readonly userId: string;
|
|
15
|
+
readonly cursor?: string;
|
|
16
|
+
readonly limit?: number;
|
|
17
|
+
};
|
|
18
|
+
type InsightsProvider = {
|
|
19
|
+
appendBundleEvent(input: CreateBundleEventRequest): Promise<void>;
|
|
20
|
+
listEvents(input: InsightsEventPageInput): Promise<EventCursorPage<EventHistoryRow>>;
|
|
21
|
+
listInstallationEvents(input: InsightsInstallationEventPageInput): Promise<EventCursorPage<InstallationHistoryRow>>;
|
|
22
|
+
getInstallation(input: {
|
|
23
|
+
readonly installId: string;
|
|
24
|
+
}): Promise<InstallationRow | null>;
|
|
25
|
+
pageInstallationsByCurrentUserId(input: InsightsUserInstallationPageInput): Promise<CursorPage<InstallationRow>>;
|
|
26
|
+
getReportingOverview(input: InsightsScope & {
|
|
27
|
+
readonly window: ActiveInstallationWindow;
|
|
28
|
+
readonly bundleId?: string;
|
|
29
|
+
}): Promise<ReportingOverview>;
|
|
30
|
+
};
|
|
31
|
+
//#endregion
|
|
32
|
+
export { InsightsEventPageInput, InsightsInstallationEventPageInput, InsightsProvider, InsightsUserInstallationPageInput };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ActiveInstallationWindow, CreateBundleEventRequest, CursorPage, EventCursorPage, EventHistoryRow, InsightsBundleSelection, InsightsScope, InstallationHistoryRow, InstallationRow, ReportingOverview } from "./domain.mjs";
|
|
2
|
+
//#region src/insights/types.d.ts
|
|
3
|
+
type InsightsEventPageInput = {
|
|
4
|
+
readonly beforeReceivedAtMs?: number;
|
|
5
|
+
readonly sinceMs?: number;
|
|
6
|
+
readonly bundle?: InsightsBundleSelection;
|
|
7
|
+
readonly cursor?: string;
|
|
8
|
+
readonly limit?: number;
|
|
9
|
+
};
|
|
10
|
+
type InsightsInstallationEventPageInput = Omit<InsightsEventPageInput, "bundle"> & {
|
|
11
|
+
readonly installId: string;
|
|
12
|
+
};
|
|
13
|
+
type InsightsUserInstallationPageInput = {
|
|
14
|
+
readonly userId: string;
|
|
15
|
+
readonly cursor?: string;
|
|
16
|
+
readonly limit?: number;
|
|
17
|
+
};
|
|
18
|
+
type InsightsProvider = {
|
|
19
|
+
appendBundleEvent(input: CreateBundleEventRequest): Promise<void>;
|
|
20
|
+
listEvents(input: InsightsEventPageInput): Promise<EventCursorPage<EventHistoryRow>>;
|
|
21
|
+
listInstallationEvents(input: InsightsInstallationEventPageInput): Promise<EventCursorPage<InstallationHistoryRow>>;
|
|
22
|
+
getInstallation(input: {
|
|
23
|
+
readonly installId: string;
|
|
24
|
+
}): Promise<InstallationRow | null>;
|
|
25
|
+
pageInstallationsByCurrentUserId(input: InsightsUserInstallationPageInput): Promise<CursorPage<InstallationRow>>;
|
|
26
|
+
getReportingOverview(input: InsightsScope & {
|
|
27
|
+
readonly window: ActiveInstallationWindow;
|
|
28
|
+
readonly bundleId?: string;
|
|
29
|
+
}): Promise<ReportingOverview>;
|
|
30
|
+
};
|
|
31
|
+
//#endregion
|
|
32
|
+
export { InsightsEventPageInput, InsightsInstallationEventPageInput, InsightsProvider, InsightsUserInstallationPageInput };
|
package/dist/node.d.cts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { HotUpdaterHandler } from "./handlerTypes.cjs";
|
|
2
2
|
import { HOT_UPDATER_SERVER_VERSION } from "./version.cjs";
|
|
3
3
|
import { HOT_UPDATER_INFRASTRUCTURE_GENERATION } from "./handlerVersionRoutes.cjs";
|
|
4
|
-
|
|
5
4
|
//#region src/node.d.ts
|
|
6
5
|
/**
|
|
7
6
|
* Converts a Hot Updater handler to a Node.js-compatible middleware
|
package/dist/node.d.mts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { HotUpdaterHandler } from "./handlerTypes.mjs";
|
|
2
2
|
import { HOT_UPDATER_SERVER_VERSION } from "./version.mjs";
|
|
3
3
|
import { HOT_UPDATER_INFRASTRUCTURE_GENERATION } from "./handlerVersionRoutes.mjs";
|
|
4
|
-
|
|
5
4
|
//#region src/node.d.ts
|
|
6
5
|
/**
|
|
7
6
|
* Converts a Hot Updater handler to a Node.js-compatible middleware
|
package/dist/package.cjs
CHANGED
package/dist/package.mjs
CHANGED
package/dist/schema/index.cjs
CHANGED
|
@@ -1,6 +1,20 @@
|
|
|
1
|
-
require("./types.cjs");
|
|
2
|
-
require("./settings.cjs");
|
|
1
|
+
const require_types = require("./types.cjs");
|
|
2
|
+
const require_settings = require("./settings.cjs");
|
|
3
|
+
const require_v1_0_0 = require("./v1_0_0.cjs");
|
|
3
4
|
//#region src/schema/index.ts
|
|
4
|
-
const hotUpdaterSchemaVersions = [
|
|
5
|
+
const hotUpdaterSchemaVersions = [require_v1_0_0.v1_0_0];
|
|
5
6
|
//#endregion
|
|
7
|
+
exports.HOT_UPDATER_CORE_SCHEMA_KEY = require_types.HOT_UPDATER_CORE_SCHEMA_KEY;
|
|
8
|
+
exports.HOT_UPDATER_SCHEMA_VERSION = require_types.HOT_UPDATER_SCHEMA_VERSION;
|
|
9
|
+
exports.HOT_UPDATER_SETTINGS_TABLE = require_types.HOT_UPDATER_SETTINGS_TABLE;
|
|
10
|
+
exports.apiKeysV100 = require_v1_0_0.apiKeysV100;
|
|
11
|
+
exports.bundleEventsV100 = require_v1_0_0.bundleEventsV100;
|
|
12
|
+
exports.bundleInstallationsV100 = require_v1_0_0.bundleInstallationsV100;
|
|
13
|
+
exports.bundlePatchesV100 = require_v1_0_0.bundlePatchesV100;
|
|
14
|
+
exports.bundlesV100 = require_v1_0_0.bundlesV100;
|
|
15
|
+
exports.channelsV100 = require_v1_0_0.channelsV100;
|
|
16
|
+
exports.createSettingsTable = require_settings.createSettingsTable;
|
|
6
17
|
exports.hotUpdaterSchemaVersions = hotUpdaterSchemaVersions;
|
|
18
|
+
exports.releaseCatalogsV100 = require_v1_0_0.releaseCatalogsV100;
|
|
19
|
+
exports.releasesV100 = require_v1_0_0.releasesV100;
|
|
20
|
+
exports.v1_0_0 = require_v1_0_0.v1_0_0;
|
package/dist/schema/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import "./types.mjs";
|
|
2
|
-
import "./settings.mjs";
|
|
3
|
-
import { v1_0_0 } from "./v1_0_0.mjs";
|
|
1
|
+
import { HOT_UPDATER_CORE_SCHEMA_KEY, HOT_UPDATER_SCHEMA_VERSION, HOT_UPDATER_SETTINGS_TABLE } from "./types.mjs";
|
|
2
|
+
import { createSettingsTable } from "./settings.mjs";
|
|
3
|
+
import { apiKeysV100, bundleEventsV100, bundleInstallationsV100, bundlePatchesV100, bundlesV100, channelsV100, releaseCatalogsV100, releasesV100, v1_0_0 } from "./v1_0_0.mjs";
|
|
4
4
|
//#region src/schema/index.ts
|
|
5
5
|
const hotUpdaterSchemaVersions = [v1_0_0];
|
|
6
6
|
//#endregion
|
|
7
|
-
export { hotUpdaterSchemaVersions };
|
|
7
|
+
export { HOT_UPDATER_CORE_SCHEMA_KEY, HOT_UPDATER_SCHEMA_VERSION, HOT_UPDATER_SETTINGS_TABLE, apiKeysV100, bundleEventsV100, bundleInstallationsV100, bundlePatchesV100, bundlesV100, channelsV100, createSettingsTable, hotUpdaterSchemaVersions, releaseCatalogsV100, releasesV100, v1_0_0 };
|
package/dist/schema/v1_0_0.cjs
CHANGED
|
@@ -255,19 +255,30 @@ const releaseCatalogsV100 = require_dsl.table("release_catalogs", {
|
|
|
255
255
|
referencedColumns: ["id"]
|
|
256
256
|
})]
|
|
257
257
|
});
|
|
258
|
+
const insightsTextCollations = {
|
|
259
|
+
postgresql: "\"C\"",
|
|
260
|
+
mysql: "utf8mb4_0900_bin"
|
|
261
|
+
};
|
|
262
|
+
const insightsProviders = [
|
|
263
|
+
"postgresql",
|
|
264
|
+
"mysql",
|
|
265
|
+
"sqlite",
|
|
266
|
+
"cockroachdb",
|
|
267
|
+
"mongodb"
|
|
268
|
+
];
|
|
258
269
|
const bundleEventsV100 = require_dsl.table("bundle_events", {
|
|
259
270
|
id: require_dsl.idColumn("id", "uuid"),
|
|
260
|
-
type: require_dsl.
|
|
261
|
-
install_id: require_dsl.
|
|
262
|
-
user_id: require_dsl.
|
|
271
|
+
type: require_dsl.column("type", require_dsl.varchar(32)),
|
|
272
|
+
install_id: require_dsl.column("install_id", require_dsl.varchar(255)).collate(insightsTextCollations),
|
|
273
|
+
user_id: require_dsl.column("user_id", require_dsl.varchar(255)).collate(insightsTextCollations).nullable(),
|
|
263
274
|
username: require_dsl.stringColumn("username").nullable(),
|
|
264
275
|
from_release_id: require_dsl.uuid("from_release_id").nullable(),
|
|
265
276
|
from_bundle_id: require_dsl.uuid("from_bundle_id").nullable(),
|
|
266
277
|
to_release_id: require_dsl.uuid("to_release_id").nullable(),
|
|
267
278
|
to_bundle_id: require_dsl.uuid("to_bundle_id"),
|
|
268
|
-
platform: require_dsl.stringColumn("platform"),
|
|
279
|
+
platform: require_dsl.stringColumn("platform").collate(insightsTextCollations),
|
|
269
280
|
app_version: require_dsl.stringColumn("app_version"),
|
|
270
|
-
channel: require_dsl.stringColumn("channel"),
|
|
281
|
+
channel: require_dsl.stringColumn("channel").collate(insightsTextCollations),
|
|
271
282
|
cohort: require_dsl.stringColumn("cohort"),
|
|
272
283
|
update_strategy: require_dsl.stringColumn("update_strategy").nullable(),
|
|
273
284
|
fingerprint_hash: require_dsl.stringColumn("fingerprint_hash").nullable(),
|
|
@@ -278,43 +289,26 @@ const bundleEventsV100 = require_dsl.table("bundle_events", {
|
|
|
278
289
|
require_dsl.index("bundle_events_received_at_idx", ["received_at_ms", "id"]),
|
|
279
290
|
require_dsl.index("bundle_events_install_idx", [
|
|
280
291
|
"install_id",
|
|
281
|
-
"received_at_ms",
|
|
282
|
-
"id"
|
|
283
|
-
]),
|
|
284
|
-
require_dsl.index("bundle_events_user_id_idx", [
|
|
285
|
-
"user_id",
|
|
286
|
-
"received_at_ms",
|
|
287
|
-
"id"
|
|
288
|
-
]),
|
|
289
|
-
require_dsl.index("bundle_events_username_idx", [
|
|
290
|
-
"username",
|
|
291
|
-
"received_at_ms",
|
|
292
|
-
"id"
|
|
293
|
-
]),
|
|
294
|
-
require_dsl.index("bundle_events_to_bundle_idx", [
|
|
295
292
|
"type",
|
|
296
|
-
"to_bundle_id",
|
|
297
293
|
"received_at_ms",
|
|
298
294
|
"id"
|
|
299
295
|
]),
|
|
300
296
|
require_dsl.index("bundle_events_from_bundle_idx", [
|
|
301
297
|
"type",
|
|
298
|
+
"platform",
|
|
299
|
+
"channel",
|
|
302
300
|
"from_bundle_id",
|
|
303
301
|
"received_at_ms",
|
|
304
302
|
"id"
|
|
305
|
-
]),
|
|
306
|
-
require_dsl.index("
|
|
307
|
-
"type",
|
|
308
|
-
"to_release_id",
|
|
309
|
-
"received_at_ms",
|
|
310
|
-
"id"
|
|
311
|
-
]),
|
|
312
|
-
require_dsl.index("bundle_events_from_release_idx", [
|
|
303
|
+
], insightsProviders),
|
|
304
|
+
require_dsl.index("bundle_events_to_bundle_idx", [
|
|
313
305
|
"type",
|
|
314
|
-
"
|
|
306
|
+
"platform",
|
|
307
|
+
"channel",
|
|
308
|
+
"to_bundle_id",
|
|
315
309
|
"received_at_ms",
|
|
316
310
|
"id"
|
|
317
|
-
])
|
|
311
|
+
], insightsProviders)
|
|
318
312
|
],
|
|
319
313
|
checks: [
|
|
320
314
|
require_dsl.check({
|
|
@@ -339,6 +333,52 @@ const bundleEventsV100 = require_dsl.table("bundle_events", {
|
|
|
339
333
|
})
|
|
340
334
|
]
|
|
341
335
|
});
|
|
336
|
+
const bundleInstallationsV100 = require_dsl.table("bundle_installations", {
|
|
337
|
+
install_id: require_dsl.idColumn("install_id", require_dsl.varchar(255)).collate(insightsTextCollations),
|
|
338
|
+
id: require_dsl.uuid("id"),
|
|
339
|
+
user_id: require_dsl.column("user_id", require_dsl.varchar(255)).collate(insightsTextCollations).nullable(),
|
|
340
|
+
username: require_dsl.stringColumn("username").nullable(),
|
|
341
|
+
to_bundle_id: require_dsl.uuid("to_bundle_id"),
|
|
342
|
+
type: require_dsl.column("type", require_dsl.varchar(32)),
|
|
343
|
+
platform: require_dsl.stringColumn("platform").collate(insightsTextCollations),
|
|
344
|
+
app_version: require_dsl.stringColumn("app_version"),
|
|
345
|
+
channel: require_dsl.stringColumn("channel").collate(insightsTextCollations),
|
|
346
|
+
cohort: require_dsl.stringColumn("cohort"),
|
|
347
|
+
received_at_ms: require_dsl.float("received_at_ms")
|
|
348
|
+
}, {
|
|
349
|
+
indexes: [
|
|
350
|
+
require_dsl.index("bundle_installations_user_id_idx", ["user_id", "install_id"]),
|
|
351
|
+
require_dsl.index("bundle_installations_received_at_idx", ["received_at_ms"]),
|
|
352
|
+
require_dsl.index("bundle_installations_scope_idx", [
|
|
353
|
+
"platform",
|
|
354
|
+
"channel",
|
|
355
|
+
"received_at_ms"
|
|
356
|
+
], insightsProviders),
|
|
357
|
+
require_dsl.index("bundle_installations_bundle_idx", [
|
|
358
|
+
"platform",
|
|
359
|
+
"channel",
|
|
360
|
+
"to_bundle_id",
|
|
361
|
+
"received_at_ms"
|
|
362
|
+
], insightsProviders)
|
|
363
|
+
],
|
|
364
|
+
checks: [
|
|
365
|
+
require_dsl.check({
|
|
366
|
+
name: "bundle_installations_type_check",
|
|
367
|
+
expression: "type in ('UPDATE_APPLIED', 'RECOVERED', 'RELEASE_ADOPTED', 'UNCHANGED')",
|
|
368
|
+
sqliteInline: true
|
|
369
|
+
}),
|
|
370
|
+
require_dsl.check({
|
|
371
|
+
name: "bundle_installations_platform_check",
|
|
372
|
+
expression: "platform in ('ios', 'android')",
|
|
373
|
+
sqliteInline: true
|
|
374
|
+
}),
|
|
375
|
+
require_dsl.check({
|
|
376
|
+
name: "bundle_installations_received_at_check",
|
|
377
|
+
expression: "received_at_ms >= 0",
|
|
378
|
+
sqliteInline: true
|
|
379
|
+
})
|
|
380
|
+
]
|
|
381
|
+
});
|
|
342
382
|
const v1_0_0 = require_dsl.schema({
|
|
343
383
|
version: "1.0.0",
|
|
344
384
|
settingsTable: require_types.HOT_UPDATER_SETTINGS_TABLE,
|
|
@@ -349,6 +389,7 @@ const v1_0_0 = require_dsl.schema({
|
|
|
349
389
|
releasesV100,
|
|
350
390
|
releaseCatalogsV100,
|
|
351
391
|
bundleEventsV100,
|
|
392
|
+
bundleInstallationsV100,
|
|
352
393
|
apiKeysV100,
|
|
353
394
|
require_settings.createSettingsTable("1.0.0")
|
|
354
395
|
]
|
|
@@ -356,6 +397,7 @@ const v1_0_0 = require_dsl.schema({
|
|
|
356
397
|
//#endregion
|
|
357
398
|
exports.apiKeysV100 = apiKeysV100;
|
|
358
399
|
exports.bundleEventsV100 = bundleEventsV100;
|
|
400
|
+
exports.bundleInstallationsV100 = bundleInstallationsV100;
|
|
359
401
|
exports.bundlePatchesV100 = bundlePatchesV100;
|
|
360
402
|
exports.bundlesV100 = bundlesV100;
|
|
361
403
|
exports.channelsV100 = channelsV100;
|