@hot-updater/server 0.36.7 → 1.0.0-rc.1
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/adapters/databaseConstraintErrors.cjs +23 -0
- package/dist/adapters/databaseConstraintErrors.mjs +21 -0
- package/dist/adapters/databasePluginUtils.cjs +117 -0
- package/dist/adapters/databasePluginUtils.mjs +106 -0
- package/dist/adapters/drizzle.cjs +53 -176
- package/dist/adapters/drizzle.d.cts +6 -4
- package/dist/adapters/drizzle.d.mts +6 -4
- package/dist/adapters/drizzle.mjs +54 -177
- package/dist/adapters/drizzleCrud.cjs +250 -0
- package/dist/adapters/drizzleCrud.mjs +249 -0
- package/dist/adapters/drizzleLazyDB.cjs +84 -36
- package/dist/adapters/drizzleLazyDB.mjs +84 -36
- package/dist/adapters/drizzleQuery.cjs +68 -0
- package/dist/adapters/drizzleQuery.mjs +67 -0
- package/dist/adapters/kysely.cjs +18 -138
- package/dist/adapters/kysely.d.cts +3 -12
- package/dist/adapters/kysely.d.mts +3 -12
- package/dist/adapters/kysely.mjs +19 -139
- package/dist/adapters/kyselyCrud.cjs +254 -0
- package/dist/adapters/kyselyCrud.mjs +253 -0
- package/dist/adapters/kyselyQuery.cjs +56 -0
- package/dist/adapters/kyselyQuery.mjs +55 -0
- package/dist/adapters/mongodb.cjs +21 -174
- package/dist/adapters/mongodb.d.cts +3 -2
- package/dist/adapters/mongodb.d.mts +3 -2
- package/dist/adapters/mongodb.mjs +21 -174
- package/dist/adapters/mongodbCollections.cjs +36 -0
- package/dist/adapters/mongodbCollections.mjs +30 -0
- package/dist/adapters/mongodbQuery.cjs +77 -0
- package/dist/adapters/mongodbQuery.mjs +70 -0
- package/dist/adapters/mongodbReads.cjs +148 -0
- package/dist/adapters/mongodbReads.mjs +147 -0
- package/dist/adapters/mongodbWrites.cjs +134 -0
- package/dist/adapters/mongodbWrites.mjs +133 -0
- package/dist/adapters/prisma.cjs +205 -180
- package/dist/adapters/prisma.d.cts +3 -3
- package/dist/adapters/prisma.d.mts +3 -3
- package/dist/adapters/prisma.mjs +206 -181
- package/dist/adapters/prismaQuery.cjs +58 -0
- package/dist/adapters/prismaQuery.mjs +56 -0
- package/dist/adapters/prismaRows.cjs +198 -0
- package/dist/adapters/prismaRows.mjs +188 -0
- package/dist/apiKeys.cjs +139 -0
- package/dist/apiKeys.d.cts +50 -0
- package/dist/apiKeys.d.mts +50 -0
- package/dist/apiKeys.mjs +133 -0
- package/dist/createHotUpdaterCore.cjs +48 -26
- package/dist/createHotUpdaterCore.d.cts +49 -17
- package/dist/createHotUpdaterCore.d.mts +49 -17
- package/dist/createHotUpdaterCore.mjs +51 -29
- package/dist/db/createBundleDiff.cjs +45 -68
- package/dist/db/createBundleDiff.d.cts +3 -3
- package/dist/db/createBundleDiff.d.mts +3 -3
- package/dist/db/createBundleDiff.mjs +47 -68
- package/dist/db/databasePluginCore.cjs +138 -0
- package/dist/db/databasePluginCore.mjs +137 -0
- package/dist/db/fixedMigrator.cjs +36 -93
- package/dist/db/fixedMigrator.mjs +36 -93
- package/dist/db/fixedMigratorMongo.cjs +319 -0
- package/dist/db/fixedMigratorMongo.mjs +319 -0
- package/dist/db/fixedMigratorShared.cjs +23 -0
- package/dist/db/fixedMigratorShared.mjs +18 -0
- package/dist/db/mongoMigrationExecution.cjs +11 -0
- package/dist/db/mongoMigrationExecution.mjs +11 -0
- package/dist/db/releaseCatalog.cjs +66 -0
- package/dist/db/releaseCatalog.d.cts +17 -0
- package/dist/db/releaseCatalog.d.mts +17 -0
- package/dist/db/releaseCatalog.mjs +64 -0
- package/dist/db/schema/mongodb.cjs +14 -6
- package/dist/db/schema/mongodb.mjs +14 -6
- package/dist/db/schema/registry.cjs +0 -2
- package/dist/db/schema/registry.mjs +1 -2
- package/dist/db/schema/sql.cjs +31 -14
- package/dist/db/schema/sql.mjs +32 -13
- package/dist/db/schema/sqlOperations.cjs +4 -4
- package/dist/db/schema/sqlOperations.mjs +5 -5
- package/dist/db/schemaGenerators.cjs +52 -18
- package/dist/db/schemaGenerators.mjs +52 -18
- package/dist/db/schemaReadiness.cjs +4 -3
- package/dist/db/schemaReadiness.mjs +4 -3
- package/dist/db/sqlMigrationExecution.cjs +67 -0
- package/dist/db/sqlMigrationExecution.mjs +66 -0
- package/dist/db/types.cjs +2 -6
- package/dist/db/types.d.cts +60 -16
- package/dist/db/types.d.mts +60 -16
- package/dist/db/types.mjs +3 -6
- package/dist/db/updateArtifacts.cjs +114 -60
- package/dist/db/updateArtifacts.mjs +117 -62
- package/dist/handler.cjs +108 -282
- package/dist/handler.d.cts +3 -46
- package/dist/handler.d.mts +3 -46
- package/dist/handler.mjs +107 -281
- package/dist/handlerBundleRoutes.cjs +155 -0
- package/dist/handlerBundleRoutes.mjs +155 -0
- package/dist/handlerErrors.cjs +9 -0
- package/dist/handlerErrors.mjs +9 -0
- package/dist/handlerParameters.cjs +39 -0
- package/dist/handlerParameters.mjs +34 -0
- package/dist/handlerReleaseCatalogRoutes.cjs +111 -0
- package/dist/handlerReleaseCatalogRoutes.mjs +110 -0
- package/dist/handlerReleaseManagementRoutes.cjs +125 -0
- package/dist/handlerReleaseManagementRoutes.mjs +124 -0
- package/dist/handlerTypes.d.cts +63 -0
- package/dist/handlerTypes.d.mts +63 -0
- package/dist/handlerVersionRoutes.cjs +10 -0
- package/dist/handlerVersionRoutes.d.cts +4 -0
- package/dist/handlerVersionRoutes.d.mts +4 -0
- package/dist/handlerVersionRoutes.mjs +9 -0
- package/dist/index.cjs +10 -1
- package/dist/index.d.cts +9 -3
- package/dist/index.d.mts +9 -3
- package/dist/index.mjs +5 -2
- package/dist/insights/bounded/activeOverview.cjs +87 -0
- package/dist/insights/bounded/activeOverview.mjs +85 -0
- package/dist/insights/bounded/installationSearch.cjs +42 -0
- package/dist/insights/bounded/installationSearch.mjs +42 -0
- package/dist/insights/bounded/persistence.cjs +39 -0
- package/dist/insights/bounded/persistence.mjs +38 -0
- package/dist/insights/bounded/provider.cjs +170 -0
- package/dist/insights/bounded/provider.d.cts +7 -0
- package/dist/insights/bounded/provider.d.mts +7 -0
- package/dist/insights/bounded/provider.mjs +170 -0
- package/dist/insights/bounded/scan.cjs +144 -0
- package/dist/insights/bounded/scan.mjs +138 -0
- package/dist/insights/domain.d.cts +121 -0
- package/dist/insights/domain.d.mts +121 -0
- package/dist/insights/errors.cjs +22 -0
- package/dist/insights/errors.mjs +20 -0
- package/dist/insights/eventInput.cjs +111 -0
- package/dist/insights/eventInput.mjs +111 -0
- package/dist/insights/persistence.d.cts +6 -0
- package/dist/insights/persistence.d.mts +6 -0
- package/dist/insights/queryInput.cjs +58 -0
- package/dist/insights/queryInput.mjs +55 -0
- package/dist/insights/routes.cjs +63 -0
- package/dist/insights/routes.mjs +61 -0
- package/dist/insights/types.d.cts +17 -0
- package/dist/insights/types.d.mts +17 -0
- package/dist/node.cjs +19 -12
- package/dist/node.d.cts +15 -10
- package/dist/node.d.mts +15 -10
- package/dist/node.mjs +19 -13
- package/dist/package.cjs +1 -1
- package/dist/package.mjs +1 -1
- package/dist/schema/dsl.cjs +19 -2
- package/dist/schema/dsl.mjs +17 -3
- package/dist/schema/index.cjs +1 -8
- package/dist/schema/index.mjs +2 -8
- package/dist/schema/types.cjs +3 -1
- package/dist/schema/types.mjs +3 -2
- package/dist/schema/v1_0_0.cjs +364 -0
- package/dist/schema/v1_0_0.mjs +357 -0
- package/dist/storageAccess.cjs +69 -25
- package/dist/storageAccess.mjs +68 -25
- package/dist/types/index.d.cts +4 -3
- package/dist/types/index.d.mts +5 -4
- package/package.json +8 -7
- package/src/adapters/databaseConstraintErrors.ts +25 -0
- package/src/adapters/databasePluginTestDatabase.ts +106 -0
- package/src/adapters/databasePluginUtils.spec.ts +29 -0
- package/src/adapters/databasePluginUtils.ts +214 -0
- package/src/adapters/drizzle.spec.ts +208 -47
- package/src/adapters/drizzle.ts +106 -293
- package/src/adapters/drizzleCrud.ts +419 -0
- package/src/adapters/drizzleLazyDB.ts +206 -100
- package/src/adapters/drizzleQuery.ts +164 -0
- package/src/adapters/kysely.spec.ts +126 -88
- package/src/adapters/kysely.ts +76 -334
- package/src/adapters/kyselyCrud.ts +588 -0
- package/src/adapters/kyselyQuery.ts +128 -0
- package/src/adapters/mongodb.spec.ts +141 -0
- package/src/adapters/mongodb.ts +60 -288
- package/src/adapters/mongodbCollections.ts +62 -0
- package/src/adapters/mongodbQuery.ts +226 -0
- package/src/adapters/mongodbReads.ts +311 -0
- package/src/adapters/mongodbRows.spec.ts +64 -0
- package/src/adapters/mongodbRows.ts +118 -0
- package/src/adapters/mongodbTestClient.ts +342 -0
- package/src/adapters/mongodbTestFilter.ts +166 -0
- package/src/adapters/mongodbWrites.ts +260 -0
- package/src/adapters/prisma.spec.ts +196 -0
- package/src/adapters/prisma.ts +417 -292
- package/src/adapters/prismaQuery.ts +129 -0
- package/src/adapters/prismaRows.spec.ts +98 -0
- package/src/adapters/prismaRows.ts +301 -0
- package/src/adapters/prismaTestClient.ts +396 -0
- package/src/apiKeys.integration.spec.ts +192 -0
- package/src/apiKeys.spec.ts +162 -0
- package/src/apiKeys.ts +220 -0
- package/src/createHotUpdaterCore.ts +164 -100
- package/src/db/bundleRows.spec.ts +164 -0
- package/src/db/bundleRows.ts +10 -140
- package/src/db/createBundleDiff.spec.ts +172 -127
- package/src/db/createBundleDiff.ts +91 -110
- package/src/db/databasePluginCore.spec.ts +62 -0
- package/src/db/databasePluginCore.testFixtures.ts +76 -0
- package/src/db/databasePluginCore.ts +185 -0
- package/src/db/databasePluginUpdateCheck.bench.ts +107 -0
- package/src/db/fixedMigrator.spec.ts +184 -42
- package/src/db/fixedMigrator.ts +64 -205
- package/src/db/fixedMigratorMongo.spec.ts +192 -0
- package/src/db/fixedMigratorMongo.ts +425 -0
- package/src/db/fixedMigratorShared.ts +36 -0
- package/src/db/hotUpdaterSchema.ts +0 -1
- package/src/db/index.spec.ts +333 -1025
- package/src/db/mongoMigrationExecution.ts +23 -0
- package/src/db/node-sqlite.d.ts +25 -0
- package/src/db/releaseCatalog.ts +148 -0
- package/src/db/schema/mongodb.ts +20 -6
- package/src/db/schema/sql.ts +52 -11
- package/src/db/schema/sqlOperations.ts +5 -4
- package/src/db/schemaGenerators.ts +107 -23
- package/src/db/schemaReadiness.ts +2 -1
- package/src/db/sqlMigrationExecution.spec.ts +65 -0
- package/src/db/sqlMigrationExecution.ts +108 -0
- package/src/db/types.spec.ts +55 -0
- package/src/db/types.ts +129 -65
- package/src/db/updateArtifacts.spec.ts +359 -0
- package/src/db/updateArtifacts.ts +290 -126
- package/src/handler-standalone.integration.spec.ts +401 -364
- package/src/handler.spec.ts +137 -582
- package/src/handler.testFixtures.ts +30 -0
- package/src/handler.ts +218 -616
- package/src/handlerAuth.integration.spec.ts +33 -0
- package/src/handlerBundleRoutes.ts +259 -0
- package/src/handlerErrors.ts +7 -0
- package/src/handlerManagement.spec.ts +262 -0
- package/src/handlerParameters.ts +105 -0
- package/src/handlerReleaseCatalogRoutes.ts +154 -0
- package/src/handlerReleaseManagementRoutes.ts +213 -0
- package/src/handlerTypes.ts +96 -0
- package/src/handlerVersionRoutes.ts +12 -0
- package/src/index.ts +22 -2
- package/src/insights/bounded/activeOverview.spec.ts +189 -0
- package/src/insights/bounded/activeOverview.ts +148 -0
- package/src/insights/bounded/installationSearch.spec.ts +130 -0
- package/src/insights/bounded/installationSearch.ts +69 -0
- package/src/insights/bounded/persistence.ts +43 -0
- package/src/insights/bounded/provider.spec.ts +219 -0
- package/src/insights/bounded/provider.ts +229 -0
- package/src/insights/bounded/scan.ts +235 -0
- package/src/insights/domain.ts +139 -0
- package/src/insights/errors.ts +18 -0
- package/src/insights/eventInput.ts +168 -0
- package/src/insights/insights.integration.spec.ts +144 -0
- package/src/insights/persistence.ts +10 -0
- package/src/insights/queryInput.ts +102 -0
- package/src/insights/routes.ts +123 -0
- package/src/insights/types.ts +44 -0
- package/src/node.spec.ts +79 -10
- package/src/node.ts +20 -17
- package/src/releaseCatalogRoutes.integration.spec.ts +238 -0
- package/src/runtime.spec.ts +126 -959
- package/src/runtime.testFixtures.ts +71 -0
- package/src/schema/dsl-all-versions.spec.ts +26 -17
- package/src/schema/dsl.ts +41 -2
- package/src/schema/index.ts +3 -9
- package/src/schema/types.ts +9 -3
- package/src/schema/v1_0_0.spec.ts +146 -0
- package/src/schema/v1_0_0.ts +465 -0
- package/src/storageAccess.spec.ts +127 -32
- package/src/storageAccess.ts +106 -55
- package/src/types/index.ts +2 -1
- package/dist/db/bundleRows.cjs +0 -82
- package/dist/db/bundleRows.d.cts +0 -33
- package/dist/db/bundleRows.d.mts +0 -33
- package/dist/db/bundleRows.mjs +0 -79
- package/dist/db/pluginCore.cjs +0 -242
- package/dist/db/pluginCore.mjs +0 -241
- package/dist/db/schema/sqlMigrations.cjs +0 -74
- package/dist/db/schema/sqlMigrations.mjs +0 -73
- package/dist/db/schemaEnhancements.cjs +0 -20
- package/dist/db/schemaEnhancements.mjs +0 -19
- package/dist/route.cjs +0 -7
- package/dist/route.mjs +0 -7
- package/dist/schema/v0_21_0.cjs +0 -38
- package/dist/schema/v0_21_0.mjs +0 -37
- package/dist/schema/v0_29_0.cjs +0 -45
- package/dist/schema/v0_29_0.mjs +0 -44
- package/dist/schema/v0_31_0.cjs +0 -82
- package/dist/schema/v0_31_0.mjs +0 -80
- package/src/db/pluginCore.spec.ts +0 -1095
- package/src/db/pluginCore.ts +0 -475
- package/src/db/pluginUpdateCheck.bench.ts +0 -254
- package/src/db/schema/sqlMigrations.ts +0 -219
- package/src/db/schemaEnhancements.ts +0 -55
- package/src/route.ts +0 -7
- package/src/schema/v0_21_0.ts +0 -52
- package/src/schema/v0_29_0.ts +0 -62
- package/src/schema/v0_31_0.spec.ts +0 -73
- package/src/schema/v0_31_0.ts +0 -120
|
@@ -0,0 +1,63 @@
|
|
|
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
|
+
return value;
|
|
13
|
+
};
|
|
14
|
+
const run = async (operation) => {
|
|
15
|
+
try {
|
|
16
|
+
return await operation();
|
|
17
|
+
} catch (error) {
|
|
18
|
+
if (error instanceof require_errors.InsightsBadRequestError) return json({ error: error.message }, 400);
|
|
19
|
+
if (error instanceof require_errors.InsightsPayloadTooLargeError) return json({ error: error.message }, 413);
|
|
20
|
+
if (error instanceof require_errors.InsightsScanLimitExceededError) return json({ error: {
|
|
21
|
+
code: "INSIGHTS_SCAN_LIMIT_EXCEEDED",
|
|
22
|
+
limit: error.limit
|
|
23
|
+
} }, 503);
|
|
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
|
+
getBundleEventSummary: (params) => query(() => provider.getBundleEventSummary(requireParam(params, "id"))),
|
|
34
|
+
getBundleEventInsights: (params, request) => query(() => {
|
|
35
|
+
const input = require_queryInput.parseInsightsQuery(request);
|
|
36
|
+
return provider.getBundleEventInsights(requireParam(params, "id"), input.window, input.limit, input.offset);
|
|
37
|
+
}),
|
|
38
|
+
getBundleEventOverview: () => query(() => provider.getBundleEventOverview()),
|
|
39
|
+
getActiveInstallationOverview: (_params, request) => query(() => provider.getActiveInstallationOverview(require_queryInput.parseActiveInstallationInput(request))),
|
|
40
|
+
searchInstallations: (_params, request) => query(() => {
|
|
41
|
+
const input = require_queryInput.parseSearchInput(request);
|
|
42
|
+
return provider.searchInstallations(input.query, input.limit, input.offset);
|
|
43
|
+
}),
|
|
44
|
+
getInstallationHistory: (params, request) => query(() => {
|
|
45
|
+
const input = require_queryInput.parsePagination(request);
|
|
46
|
+
return provider.getInstallationHistory(requireParam(params, "installId"), input.limit, input.offset);
|
|
47
|
+
})
|
|
48
|
+
});
|
|
49
|
+
const registerInsightsClientRoutes = (add) => {
|
|
50
|
+
add("POST", "/events", "appendBundleEvent");
|
|
51
|
+
};
|
|
52
|
+
const registerInsightsAdminRoutes = (add) => {
|
|
53
|
+
add("GET", "/bundles/:id/events/summary", "getBundleEventSummary");
|
|
54
|
+
add("GET", "/bundles/:id/events/insights", "getBundleEventInsights");
|
|
55
|
+
add("GET", "/installations/overview", "getBundleEventOverview");
|
|
56
|
+
add("GET", "/installations/active", "getActiveInstallationOverview");
|
|
57
|
+
add("GET", "/installations", "searchInstallations");
|
|
58
|
+
add("GET", "/installations/:installId/events", "getInstallationHistory");
|
|
59
|
+
};
|
|
60
|
+
//#endregion
|
|
61
|
+
exports.createInsightsRouteHandlers = createInsightsRouteHandlers;
|
|
62
|
+
exports.registerInsightsAdminRoutes = registerInsightsAdminRoutes;
|
|
63
|
+
exports.registerInsightsClientRoutes = registerInsightsClientRoutes;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { InsightsBadRequestError, InsightsPayloadTooLargeError, InsightsScanLimitExceededError } from "./errors.mjs";
|
|
2
|
+
import { parseBundleEventRequest } from "./eventInput.mjs";
|
|
3
|
+
import { parseActiveInstallationInput, parseInsightsQuery, parsePagination, parseSearchInput } 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
|
+
return value;
|
|
13
|
+
};
|
|
14
|
+
const run = async (operation) => {
|
|
15
|
+
try {
|
|
16
|
+
return await operation();
|
|
17
|
+
} catch (error) {
|
|
18
|
+
if (error instanceof InsightsBadRequestError) return json({ error: error.message }, 400);
|
|
19
|
+
if (error instanceof InsightsPayloadTooLargeError) return json({ error: error.message }, 413);
|
|
20
|
+
if (error instanceof InsightsScanLimitExceededError) return json({ error: {
|
|
21
|
+
code: "INSIGHTS_SCAN_LIMIT_EXCEEDED",
|
|
22
|
+
limit: error.limit
|
|
23
|
+
} }, 503);
|
|
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
|
+
getBundleEventSummary: (params) => query(() => provider.getBundleEventSummary(requireParam(params, "id"))),
|
|
34
|
+
getBundleEventInsights: (params, request) => query(() => {
|
|
35
|
+
const input = parseInsightsQuery(request);
|
|
36
|
+
return provider.getBundleEventInsights(requireParam(params, "id"), input.window, input.limit, input.offset);
|
|
37
|
+
}),
|
|
38
|
+
getBundleEventOverview: () => query(() => provider.getBundleEventOverview()),
|
|
39
|
+
getActiveInstallationOverview: (_params, request) => query(() => provider.getActiveInstallationOverview(parseActiveInstallationInput(request))),
|
|
40
|
+
searchInstallations: (_params, request) => query(() => {
|
|
41
|
+
const input = parseSearchInput(request);
|
|
42
|
+
return provider.searchInstallations(input.query, input.limit, input.offset);
|
|
43
|
+
}),
|
|
44
|
+
getInstallationHistory: (params, request) => query(() => {
|
|
45
|
+
const input = parsePagination(request);
|
|
46
|
+
return provider.getInstallationHistory(requireParam(params, "installId"), input.limit, input.offset);
|
|
47
|
+
})
|
|
48
|
+
});
|
|
49
|
+
const registerInsightsClientRoutes = (add) => {
|
|
50
|
+
add("POST", "/events", "appendBundleEvent");
|
|
51
|
+
};
|
|
52
|
+
const registerInsightsAdminRoutes = (add) => {
|
|
53
|
+
add("GET", "/bundles/:id/events/summary", "getBundleEventSummary");
|
|
54
|
+
add("GET", "/bundles/:id/events/insights", "getBundleEventInsights");
|
|
55
|
+
add("GET", "/installations/overview", "getBundleEventOverview");
|
|
56
|
+
add("GET", "/installations/active", "getActiveInstallationOverview");
|
|
57
|
+
add("GET", "/installations", "searchInstallations");
|
|
58
|
+
add("GET", "/installations/:installId/events", "getInstallationHistory");
|
|
59
|
+
};
|
|
60
|
+
//#endregion
|
|
61
|
+
export { createInsightsRouteHandlers, registerInsightsAdminRoutes, registerInsightsClientRoutes };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ActiveInstallationInput, ActiveInstallationOverview, BundleEventInsightsResult, BundleEventInsightsWindow, BundleEventOverview, BundleEventSummary, BundleEventSummaryByBundle, CreateBundleEventRequest, InstallationHistoryRow, InstallationSearchRow, OffsetPaginationResult } from "./domain.cjs";
|
|
2
|
+
|
|
3
|
+
//#region src/insights/types.d.ts
|
|
4
|
+
type InsightsProvider = {
|
|
5
|
+
readonly mode: "bounded";
|
|
6
|
+
readonly maxMatchingRows: number;
|
|
7
|
+
appendBundleEvent(input: CreateBundleEventRequest): Promise<void>;
|
|
8
|
+
getBundleEventSummary(bundleId: string): Promise<BundleEventSummary>;
|
|
9
|
+
getBundleEventSummaries(bundleIds: readonly string[], window: BundleEventInsightsWindow): Promise<readonly BundleEventSummaryByBundle[]>;
|
|
10
|
+
getBundleEventInsights(bundleId: string, window: BundleEventInsightsWindow, limit: number, offset: number): Promise<BundleEventInsightsResult>;
|
|
11
|
+
getBundleEventOverview(): Promise<BundleEventOverview>;
|
|
12
|
+
getActiveInstallationOverview(input: ActiveInstallationInput): Promise<ActiveInstallationOverview>;
|
|
13
|
+
searchInstallations(query: string, limit: number, offset: number): Promise<OffsetPaginationResult<InstallationSearchRow>>;
|
|
14
|
+
getInstallationHistory(installId: string, limit: number, offset: number): Promise<OffsetPaginationResult<InstallationHistoryRow>>;
|
|
15
|
+
};
|
|
16
|
+
//#endregion
|
|
17
|
+
export { InsightsProvider };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ActiveInstallationInput, ActiveInstallationOverview, BundleEventInsightsResult, BundleEventInsightsWindow, BundleEventOverview, BundleEventSummary, BundleEventSummaryByBundle, CreateBundleEventRequest, InstallationHistoryRow, InstallationSearchRow, OffsetPaginationResult } from "./domain.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/insights/types.d.ts
|
|
4
|
+
type InsightsProvider = {
|
|
5
|
+
readonly mode: "bounded";
|
|
6
|
+
readonly maxMatchingRows: number;
|
|
7
|
+
appendBundleEvent(input: CreateBundleEventRequest): Promise<void>;
|
|
8
|
+
getBundleEventSummary(bundleId: string): Promise<BundleEventSummary>;
|
|
9
|
+
getBundleEventSummaries(bundleIds: readonly string[], window: BundleEventInsightsWindow): Promise<readonly BundleEventSummaryByBundle[]>;
|
|
10
|
+
getBundleEventInsights(bundleId: string, window: BundleEventInsightsWindow, limit: number, offset: number): Promise<BundleEventInsightsResult>;
|
|
11
|
+
getBundleEventOverview(): Promise<BundleEventOverview>;
|
|
12
|
+
getActiveInstallationOverview(input: ActiveInstallationInput): Promise<ActiveInstallationOverview>;
|
|
13
|
+
searchInstallations(query: string, limit: number, offset: number): Promise<OffsetPaginationResult<InstallationSearchRow>>;
|
|
14
|
+
getInstallationHistory(installId: string, limit: number, offset: number): Promise<OffsetPaginationResult<InstallationHistoryRow>>;
|
|
15
|
+
};
|
|
16
|
+
//#endregion
|
|
17
|
+
export { InsightsProvider };
|
package/dist/node.cjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_version = require("./version.cjs");
|
|
3
|
+
const require_handlerVersionRoutes = require("./handlerVersionRoutes.cjs");
|
|
3
4
|
//#region src/node.ts
|
|
4
5
|
/**
|
|
5
6
|
* Converts a Hot Updater handler to a Node.js-compatible middleware
|
|
@@ -12,33 +13,38 @@ const require_version = require("./version.cjs");
|
|
|
12
13
|
*
|
|
13
14
|
* const app = express();
|
|
14
15
|
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
16
|
+
* app.use(
|
|
17
|
+
* "/hot-updater/admin",
|
|
18
|
+
* bearerMiddleware,
|
|
19
|
+
* express.json({ limit: "1mb" }),
|
|
20
|
+
* toNodeHandler(hotUpdater.handlers.admin),
|
|
21
|
+
* );
|
|
22
|
+
* app.use(
|
|
23
|
+
* "/hot-updater",
|
|
24
|
+
* express.json({ limit: "1mb" }),
|
|
25
|
+
* toNodeHandler(hotUpdater.handlers.client),
|
|
26
|
+
* );
|
|
20
27
|
* ```
|
|
21
28
|
*/
|
|
22
|
-
function toNodeHandler(
|
|
29
|
+
function toNodeHandler(handler) {
|
|
23
30
|
return async (req, res) => {
|
|
24
31
|
try {
|
|
25
|
-
const url = `${req.protocol || "http"}://${req.get?.("host") || "localhost"}${req.url
|
|
32
|
+
const url = `${req.protocol || "http"}://${req.get?.("host") || "localhost"}${req.url ?? "/"}`;
|
|
26
33
|
const headers = new Headers();
|
|
27
34
|
for (const [key, value] of Object.entries(req.headers)) if (value) headers.set(key, Array.isArray(value) ? value.join(", ") : value);
|
|
28
35
|
let body;
|
|
29
36
|
if (req.method && req.method !== "GET" && req.method !== "HEAD" && req.body) body = JSON.stringify(req.body);
|
|
30
|
-
const
|
|
37
|
+
const response = await handler(new globalThis.Request(url, {
|
|
31
38
|
method: req.method || "GET",
|
|
32
39
|
headers,
|
|
33
40
|
body
|
|
34
|
-
});
|
|
35
|
-
const response = await hotUpdater.handler(webRequest);
|
|
41
|
+
}));
|
|
36
42
|
res.status(response.status);
|
|
37
43
|
response.headers.forEach((value, key) => {
|
|
38
44
|
res.setHeader(key, value);
|
|
39
45
|
});
|
|
40
|
-
const
|
|
41
|
-
if (
|
|
46
|
+
const responseBody = Buffer.from(await response.arrayBuffer());
|
|
47
|
+
if (responseBody.length > 0) res.send(responseBody);
|
|
42
48
|
else res.end();
|
|
43
49
|
} catch (error) {
|
|
44
50
|
console.error("Hot Updater handler error:", error);
|
|
@@ -48,5 +54,6 @@ function toNodeHandler(hotUpdater) {
|
|
|
48
54
|
};
|
|
49
55
|
}
|
|
50
56
|
//#endregion
|
|
57
|
+
exports.HOT_UPDATER_INFRASTRUCTURE_GENERATION = require_handlerVersionRoutes.HOT_UPDATER_INFRASTRUCTURE_GENERATION;
|
|
51
58
|
exports.HOT_UPDATER_SERVER_VERSION = require_version.HOT_UPDATER_SERVER_VERSION;
|
|
52
59
|
exports.toNodeHandler = toNodeHandler;
|
package/dist/node.d.cts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
+
import { HotUpdaterHandler } from "./handlerTypes.cjs";
|
|
1
2
|
import { HOT_UPDATER_SERVER_VERSION } from "./version.cjs";
|
|
3
|
+
import { HOT_UPDATER_INFRASTRUCTURE_GENERATION } from "./handlerVersionRoutes.cjs";
|
|
2
4
|
|
|
3
5
|
//#region src/node.d.ts
|
|
4
|
-
type HandlerHotUpdaterAPI = {
|
|
5
|
-
readonly handler: (request: Request) => Promise<Response>;
|
|
6
|
-
};
|
|
7
6
|
/**
|
|
8
7
|
* Converts a Hot Updater handler to a Node.js-compatible middleware
|
|
9
8
|
* Works with Express, Connect, and other frameworks using Node.js req/res
|
|
@@ -15,13 +14,19 @@ type HandlerHotUpdaterAPI = {
|
|
|
15
14
|
*
|
|
16
15
|
* const app = express();
|
|
17
16
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
17
|
+
* app.use(
|
|
18
|
+
* "/hot-updater/admin",
|
|
19
|
+
* bearerMiddleware,
|
|
20
|
+
* express.json({ limit: "1mb" }),
|
|
21
|
+
* toNodeHandler(hotUpdater.handlers.admin),
|
|
22
|
+
* );
|
|
23
|
+
* app.use(
|
|
24
|
+
* "/hot-updater",
|
|
25
|
+
* express.json({ limit: "1mb" }),
|
|
26
|
+
* toNodeHandler(hotUpdater.handlers.client),
|
|
27
|
+
* );
|
|
23
28
|
* ```
|
|
24
29
|
*/
|
|
25
|
-
declare function toNodeHandler(
|
|
30
|
+
declare function toNodeHandler(handler: HotUpdaterHandler): (req: any, res: any, next?: any) => Promise<void>;
|
|
26
31
|
//#endregion
|
|
27
|
-
export { HOT_UPDATER_SERVER_VERSION, toNodeHandler };
|
|
32
|
+
export { HOT_UPDATER_INFRASTRUCTURE_GENERATION, HOT_UPDATER_SERVER_VERSION, toNodeHandler };
|
package/dist/node.d.mts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
+
import { HotUpdaterHandler } from "./handlerTypes.mjs";
|
|
1
2
|
import { HOT_UPDATER_SERVER_VERSION } from "./version.mjs";
|
|
3
|
+
import { HOT_UPDATER_INFRASTRUCTURE_GENERATION } from "./handlerVersionRoutes.mjs";
|
|
2
4
|
|
|
3
5
|
//#region src/node.d.ts
|
|
4
|
-
type HandlerHotUpdaterAPI = {
|
|
5
|
-
readonly handler: (request: Request) => Promise<Response>;
|
|
6
|
-
};
|
|
7
6
|
/**
|
|
8
7
|
* Converts a Hot Updater handler to a Node.js-compatible middleware
|
|
9
8
|
* Works with Express, Connect, and other frameworks using Node.js req/res
|
|
@@ -15,13 +14,19 @@ type HandlerHotUpdaterAPI = {
|
|
|
15
14
|
*
|
|
16
15
|
* const app = express();
|
|
17
16
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
17
|
+
* app.use(
|
|
18
|
+
* "/hot-updater/admin",
|
|
19
|
+
* bearerMiddleware,
|
|
20
|
+
* express.json({ limit: "1mb" }),
|
|
21
|
+
* toNodeHandler(hotUpdater.handlers.admin),
|
|
22
|
+
* );
|
|
23
|
+
* app.use(
|
|
24
|
+
* "/hot-updater",
|
|
25
|
+
* express.json({ limit: "1mb" }),
|
|
26
|
+
* toNodeHandler(hotUpdater.handlers.client),
|
|
27
|
+
* );
|
|
23
28
|
* ```
|
|
24
29
|
*/
|
|
25
|
-
declare function toNodeHandler(
|
|
30
|
+
declare function toNodeHandler(handler: HotUpdaterHandler): (req: any, res: any, next?: any) => Promise<void>;
|
|
26
31
|
//#endregion
|
|
27
|
-
export { HOT_UPDATER_SERVER_VERSION, toNodeHandler };
|
|
32
|
+
export { HOT_UPDATER_INFRASTRUCTURE_GENERATION, HOT_UPDATER_SERVER_VERSION, toNodeHandler };
|
package/dist/node.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { HOT_UPDATER_SERVER_VERSION } from "./version.mjs";
|
|
2
|
+
import { HOT_UPDATER_INFRASTRUCTURE_GENERATION } from "./handlerVersionRoutes.mjs";
|
|
2
3
|
//#region src/node.ts
|
|
3
4
|
/**
|
|
4
5
|
* Converts a Hot Updater handler to a Node.js-compatible middleware
|
|
@@ -11,33 +12,38 @@ import { HOT_UPDATER_SERVER_VERSION } from "./version.mjs";
|
|
|
11
12
|
*
|
|
12
13
|
* const app = express();
|
|
13
14
|
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
15
|
+
* app.use(
|
|
16
|
+
* "/hot-updater/admin",
|
|
17
|
+
* bearerMiddleware,
|
|
18
|
+
* express.json({ limit: "1mb" }),
|
|
19
|
+
* toNodeHandler(hotUpdater.handlers.admin),
|
|
20
|
+
* );
|
|
21
|
+
* app.use(
|
|
22
|
+
* "/hot-updater",
|
|
23
|
+
* express.json({ limit: "1mb" }),
|
|
24
|
+
* toNodeHandler(hotUpdater.handlers.client),
|
|
25
|
+
* );
|
|
19
26
|
* ```
|
|
20
27
|
*/
|
|
21
|
-
function toNodeHandler(
|
|
28
|
+
function toNodeHandler(handler) {
|
|
22
29
|
return async (req, res) => {
|
|
23
30
|
try {
|
|
24
|
-
const url = `${req.protocol || "http"}://${req.get?.("host") || "localhost"}${req.url
|
|
31
|
+
const url = `${req.protocol || "http"}://${req.get?.("host") || "localhost"}${req.url ?? "/"}`;
|
|
25
32
|
const headers = new Headers();
|
|
26
33
|
for (const [key, value] of Object.entries(req.headers)) if (value) headers.set(key, Array.isArray(value) ? value.join(", ") : value);
|
|
27
34
|
let body;
|
|
28
35
|
if (req.method && req.method !== "GET" && req.method !== "HEAD" && req.body) body = JSON.stringify(req.body);
|
|
29
|
-
const
|
|
36
|
+
const response = await handler(new globalThis.Request(url, {
|
|
30
37
|
method: req.method || "GET",
|
|
31
38
|
headers,
|
|
32
39
|
body
|
|
33
|
-
});
|
|
34
|
-
const response = await hotUpdater.handler(webRequest);
|
|
40
|
+
}));
|
|
35
41
|
res.status(response.status);
|
|
36
42
|
response.headers.forEach((value, key) => {
|
|
37
43
|
res.setHeader(key, value);
|
|
38
44
|
});
|
|
39
|
-
const
|
|
40
|
-
if (
|
|
45
|
+
const responseBody = Buffer.from(await response.arrayBuffer());
|
|
46
|
+
if (responseBody.length > 0) res.send(responseBody);
|
|
41
47
|
else res.end();
|
|
42
48
|
} catch (error) {
|
|
43
49
|
console.error("Hot Updater handler error:", error);
|
|
@@ -47,4 +53,4 @@ function toNodeHandler(hotUpdater) {
|
|
|
47
53
|
};
|
|
48
54
|
}
|
|
49
55
|
//#endregion
|
|
50
|
-
export { HOT_UPDATER_SERVER_VERSION, toNodeHandler };
|
|
56
|
+
export { HOT_UPDATER_INFRASTRUCTURE_GENERATION, HOT_UPDATER_SERVER_VERSION, toNodeHandler };
|
package/dist/package.cjs
CHANGED
package/dist/package.mjs
CHANGED
package/dist/schema/dsl.cjs
CHANGED
|
@@ -13,6 +13,7 @@ const defaultValue = (value) => typeof value === "object" ? {
|
|
|
13
13
|
const columnSchema = (column) => ({
|
|
14
14
|
ormName: column.ormName,
|
|
15
15
|
type: column.type,
|
|
16
|
+
...column.providerCollations ? { providerCollations: column.providerCollations } : {},
|
|
16
17
|
...column.nullableValue ? { nullable: true } : {},
|
|
17
18
|
...column.primaryKeyValue ? { primaryKey: true } : {},
|
|
18
19
|
...column.default ? { default: column.default } : {}
|
|
@@ -21,6 +22,7 @@ const createColumn = (state) => ({
|
|
|
21
22
|
dsl: "column",
|
|
22
23
|
ormName: state.ormName,
|
|
23
24
|
type: state.type,
|
|
25
|
+
...state.providerCollations ? { providerCollations: state.providerCollations } : {},
|
|
24
26
|
...state.nullableValue ? { nullableValue: true } : {},
|
|
25
27
|
...state.primaryKeyValue ? { primaryKeyValue: true } : {},
|
|
26
28
|
...state.default ? { default: state.default } : {},
|
|
@@ -32,6 +34,10 @@ const createColumn = (state) => ({
|
|
|
32
34
|
...state,
|
|
33
35
|
primaryKeyValue: true
|
|
34
36
|
}),
|
|
37
|
+
collate: (providerCollations) => createColumn({
|
|
38
|
+
...state,
|
|
39
|
+
providerCollations
|
|
40
|
+
}),
|
|
35
41
|
defaultTo: (value) => createColumn({
|
|
36
42
|
...state,
|
|
37
43
|
default: defaultValue(value)
|
|
@@ -45,21 +51,29 @@ const column = (ormName, type) => createColumn({
|
|
|
45
51
|
const idColumn = (ormName, type) => column(ormName, type).primaryKey();
|
|
46
52
|
const uuid = (ormName) => column(ormName, "uuid");
|
|
47
53
|
const integer = (ormName) => column(ormName, "integer");
|
|
54
|
+
const float = (ormName) => column(ormName, "float");
|
|
48
55
|
const bool = (ormName) => column(ormName, "bool");
|
|
49
56
|
const json = (ormName) => column(ormName, "json");
|
|
50
57
|
const stringColumn = (ormName) => column(ormName, "string");
|
|
58
|
+
const largeString = (ormName) => column(ormName, "large-string");
|
|
51
59
|
const index = (name, columns, providers) => ({
|
|
52
60
|
name,
|
|
53
61
|
columns,
|
|
54
62
|
...providers ? { providers } : {}
|
|
55
63
|
});
|
|
56
|
-
const
|
|
64
|
+
const uniqueIndex = (name, columns, providers) => ({
|
|
65
|
+
name,
|
|
66
|
+
columns,
|
|
67
|
+
...providers ? { providers } : {},
|
|
68
|
+
unique: true
|
|
69
|
+
});
|
|
70
|
+
const foreignKey = (name, columns, referencedTable, referencedColumns, options = {}) => ({
|
|
57
71
|
name,
|
|
58
72
|
columns,
|
|
59
73
|
referencedTable,
|
|
60
74
|
referencedColumns,
|
|
61
75
|
onUpdate: "restrict",
|
|
62
|
-
onDelete: "cascade"
|
|
76
|
+
onDelete: options.onDelete ?? "cascade"
|
|
63
77
|
});
|
|
64
78
|
const check = (config) => config;
|
|
65
79
|
const relation = (config) => config;
|
|
@@ -73,14 +87,17 @@ const schema = (value) => withDsl({ ...value }, "schema");
|
|
|
73
87
|
exports.bool = bool;
|
|
74
88
|
exports.check = check;
|
|
75
89
|
exports.column = column;
|
|
90
|
+
exports.float = float;
|
|
76
91
|
exports.foreignKey = foreignKey;
|
|
77
92
|
exports.idColumn = idColumn;
|
|
78
93
|
exports.index = index;
|
|
79
94
|
exports.integer = integer;
|
|
80
95
|
exports.json = json;
|
|
96
|
+
exports.largeString = largeString;
|
|
81
97
|
exports.relation = relation;
|
|
82
98
|
exports.schema = schema;
|
|
83
99
|
exports.stringColumn = stringColumn;
|
|
84
100
|
exports.table = table;
|
|
101
|
+
exports.uniqueIndex = uniqueIndex;
|
|
85
102
|
exports.uuid = uuid;
|
|
86
103
|
exports.varchar = varchar;
|
package/dist/schema/dsl.mjs
CHANGED
|
@@ -13,6 +13,7 @@ const defaultValue = (value) => typeof value === "object" ? {
|
|
|
13
13
|
const columnSchema = (column) => ({
|
|
14
14
|
ormName: column.ormName,
|
|
15
15
|
type: column.type,
|
|
16
|
+
...column.providerCollations ? { providerCollations: column.providerCollations } : {},
|
|
16
17
|
...column.nullableValue ? { nullable: true } : {},
|
|
17
18
|
...column.primaryKeyValue ? { primaryKey: true } : {},
|
|
18
19
|
...column.default ? { default: column.default } : {}
|
|
@@ -21,6 +22,7 @@ const createColumn = (state) => ({
|
|
|
21
22
|
dsl: "column",
|
|
22
23
|
ormName: state.ormName,
|
|
23
24
|
type: state.type,
|
|
25
|
+
...state.providerCollations ? { providerCollations: state.providerCollations } : {},
|
|
24
26
|
...state.nullableValue ? { nullableValue: true } : {},
|
|
25
27
|
...state.primaryKeyValue ? { primaryKeyValue: true } : {},
|
|
26
28
|
...state.default ? { default: state.default } : {},
|
|
@@ -32,6 +34,10 @@ const createColumn = (state) => ({
|
|
|
32
34
|
...state,
|
|
33
35
|
primaryKeyValue: true
|
|
34
36
|
}),
|
|
37
|
+
collate: (providerCollations) => createColumn({
|
|
38
|
+
...state,
|
|
39
|
+
providerCollations
|
|
40
|
+
}),
|
|
35
41
|
defaultTo: (value) => createColumn({
|
|
36
42
|
...state,
|
|
37
43
|
default: defaultValue(value)
|
|
@@ -45,21 +51,29 @@ const column = (ormName, type) => createColumn({
|
|
|
45
51
|
const idColumn = (ormName, type) => column(ormName, type).primaryKey();
|
|
46
52
|
const uuid = (ormName) => column(ormName, "uuid");
|
|
47
53
|
const integer = (ormName) => column(ormName, "integer");
|
|
54
|
+
const float = (ormName) => column(ormName, "float");
|
|
48
55
|
const bool = (ormName) => column(ormName, "bool");
|
|
49
56
|
const json = (ormName) => column(ormName, "json");
|
|
50
57
|
const stringColumn = (ormName) => column(ormName, "string");
|
|
58
|
+
const largeString = (ormName) => column(ormName, "large-string");
|
|
51
59
|
const index = (name, columns, providers) => ({
|
|
52
60
|
name,
|
|
53
61
|
columns,
|
|
54
62
|
...providers ? { providers } : {}
|
|
55
63
|
});
|
|
56
|
-
const
|
|
64
|
+
const uniqueIndex = (name, columns, providers) => ({
|
|
65
|
+
name,
|
|
66
|
+
columns,
|
|
67
|
+
...providers ? { providers } : {},
|
|
68
|
+
unique: true
|
|
69
|
+
});
|
|
70
|
+
const foreignKey = (name, columns, referencedTable, referencedColumns, options = {}) => ({
|
|
57
71
|
name,
|
|
58
72
|
columns,
|
|
59
73
|
referencedTable,
|
|
60
74
|
referencedColumns,
|
|
61
75
|
onUpdate: "restrict",
|
|
62
|
-
onDelete: "cascade"
|
|
76
|
+
onDelete: options.onDelete ?? "cascade"
|
|
63
77
|
});
|
|
64
78
|
const check = (config) => config;
|
|
65
79
|
const relation = (config) => config;
|
|
@@ -70,4 +84,4 @@ const table = (ormName, columns, extras = {}) => withDsl({
|
|
|
70
84
|
}, "table");
|
|
71
85
|
const schema = (value) => withDsl({ ...value }, "schema");
|
|
72
86
|
//#endregion
|
|
73
|
-
export { bool, check, column, foreignKey, idColumn, index, integer, json, relation, schema, stringColumn, table, uuid, varchar };
|
|
87
|
+
export { bool, check, column, float, foreignKey, idColumn, index, integer, json, largeString, relation, schema, stringColumn, table, uniqueIndex, uuid, varchar };
|
package/dist/schema/index.cjs
CHANGED
|
@@ -1,13 +1,6 @@
|
|
|
1
1
|
require("./types.cjs");
|
|
2
2
|
require("./settings.cjs");
|
|
3
|
-
const require_v0_21_0 = require("./v0_21_0.cjs");
|
|
4
|
-
const require_v0_29_0 = require("./v0_29_0.cjs");
|
|
5
|
-
const require_v0_31_0 = require("./v0_31_0.cjs");
|
|
6
3
|
//#region src/schema/index.ts
|
|
7
|
-
const hotUpdaterSchemaVersions = [
|
|
8
|
-
require_v0_21_0.v0_21_0,
|
|
9
|
-
require_v0_29_0.v0_29_0,
|
|
10
|
-
require_v0_31_0.v0_31_0
|
|
11
|
-
];
|
|
4
|
+
const hotUpdaterSchemaVersions = [require("./v1_0_0.cjs").v1_0_0];
|
|
12
5
|
//#endregion
|
|
13
6
|
exports.hotUpdaterSchemaVersions = hotUpdaterSchemaVersions;
|
package/dist/schema/index.mjs
CHANGED
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
import "./types.mjs";
|
|
2
2
|
import "./settings.mjs";
|
|
3
|
-
import {
|
|
4
|
-
import { v0_29_0 } from "./v0_29_0.mjs";
|
|
5
|
-
import { v0_31_0 } from "./v0_31_0.mjs";
|
|
3
|
+
import { v1_0_0 } from "./v1_0_0.mjs";
|
|
6
4
|
//#region src/schema/index.ts
|
|
7
|
-
const hotUpdaterSchemaVersions = [
|
|
8
|
-
v0_21_0,
|
|
9
|
-
v0_29_0,
|
|
10
|
-
v0_31_0
|
|
11
|
-
];
|
|
5
|
+
const hotUpdaterSchemaVersions = [v1_0_0];
|
|
12
6
|
//#endregion
|
|
13
7
|
export { hotUpdaterSchemaVersions };
|
package/dist/schema/types.cjs
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
//#region src/schema/types.ts
|
|
2
|
-
const HOT_UPDATER_SCHEMA_VERSION = "0.
|
|
2
|
+
const HOT_UPDATER_SCHEMA_VERSION = "1.0.0";
|
|
3
|
+
const HOT_UPDATER_CORE_SCHEMA_KEY = "schema.core";
|
|
3
4
|
const HOT_UPDATER_SETTINGS_TABLE = "private_hot_updater_settings";
|
|
4
5
|
//#endregion
|
|
6
|
+
exports.HOT_UPDATER_CORE_SCHEMA_KEY = HOT_UPDATER_CORE_SCHEMA_KEY;
|
|
5
7
|
exports.HOT_UPDATER_SCHEMA_VERSION = HOT_UPDATER_SCHEMA_VERSION;
|
|
6
8
|
exports.HOT_UPDATER_SETTINGS_TABLE = HOT_UPDATER_SETTINGS_TABLE;
|
package/dist/schema/types.mjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
//#region src/schema/types.ts
|
|
2
|
-
const HOT_UPDATER_SCHEMA_VERSION = "0.
|
|
2
|
+
const HOT_UPDATER_SCHEMA_VERSION = "1.0.0";
|
|
3
|
+
const HOT_UPDATER_CORE_SCHEMA_KEY = "schema.core";
|
|
3
4
|
const HOT_UPDATER_SETTINGS_TABLE = "private_hot_updater_settings";
|
|
4
5
|
//#endregion
|
|
5
|
-
export { HOT_UPDATER_SCHEMA_VERSION, HOT_UPDATER_SETTINGS_TABLE };
|
|
6
|
+
export { HOT_UPDATER_CORE_SCHEMA_KEY, HOT_UPDATER_SCHEMA_VERSION, HOT_UPDATER_SETTINGS_TABLE };
|