@hot-updater/server 1.0.0-rc.1 → 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 +10 -3
- package/dist/adapters/drizzle.d.cts +0 -1
- package/dist/adapters/drizzle.d.mts +0 -1
- package/dist/adapters/drizzle.mjs +11 -3
- 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 +24 -9
- package/dist/createHotUpdaterCore.d.cts +1 -1
- package/dist/createHotUpdaterCore.d.mts +1 -1
- package/dist/createHotUpdaterCore.mjs +23 -9
- 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.d.cts +1 -2
- package/dist/handler.d.mts +1 -2
- 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 +1 -1
- package/dist/index.d.cts +4 -4
- package/dist/index.d.mts +4 -4
- package/dist/index.mjs +1 -1
- package/dist/insights/domain.d.cts +37 -69
- package/dist/insights/domain.d.mts +37 -69
- package/dist/insights/errors.cjs +1 -8
- package/dist/insights/errors.mjs +2 -8
- package/dist/insights/eventInput.cjs +49 -5
- package/dist/insights/eventInput.mjs +48 -6
- 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 +78 -43
- package/dist/insights/queryInput.mjs +76 -40
- package/dist/insights/routes.cjs +20 -25
- package/dist/insights/routes.mjs +22 -27
- package/dist/insights/types.d.cts +27 -12
- package/dist/insights/types.d.mts +27 -12
- 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 +21 -3
- 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 +1 -1
- package/src/createHotUpdaterCore.ts +21 -7
- 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 +8 -0
- package/src/db/types.ts +10 -4
- package/src/handler-standalone.integration.spec.ts +5 -7
- package/src/index.ts +2 -2
- package/src/insights/domain.ts +39 -75
- package/src/insights/errors.ts +0 -7
- package/src/insights/eventInput.ts +60 -3
- package/src/insights/insights.integration.spec.ts +254 -17
- package/src/insights/provider.spec.ts +385 -0
- package/src/insights/provider.ts +591 -0
- package/src/insights/queryInput.ts +112 -73
- package/src/insights/routes.ts +37 -56
- package/src/insights/types.ts +47 -36
- 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/insights/bounded/activeOverview.cjs +0 -87
- package/dist/insights/bounded/activeOverview.mjs +0 -85
- package/dist/insights/bounded/installationSearch.cjs +0 -42
- package/dist/insights/bounded/installationSearch.mjs +0 -42
- package/dist/insights/bounded/persistence.cjs +0 -39
- package/dist/insights/bounded/persistence.mjs +0 -38
- package/dist/insights/bounded/provider.cjs +0 -170
- package/dist/insights/bounded/provider.d.cts +0 -7
- package/dist/insights/bounded/provider.d.mts +0 -7
- package/dist/insights/bounded/provider.mjs +0 -170
- package/dist/insights/bounded/scan.cjs +0 -144
- package/dist/insights/bounded/scan.mjs +0 -138
- package/dist/insights/persistence.d.cts +0 -6
- package/dist/insights/persistence.d.mts +0 -6
- package/src/insights/bounded/activeOverview.spec.ts +0 -189
- package/src/insights/bounded/activeOverview.ts +0 -148
- package/src/insights/bounded/installationSearch.spec.ts +0 -130
- package/src/insights/bounded/installationSearch.ts +0 -69
- package/src/insights/bounded/persistence.ts +0 -43
- package/src/insights/bounded/provider.spec.ts +0 -219
- package/src/insights/bounded/provider.ts +0 -229
- package/src/insights/bounded/scan.ts +0 -235
- package/src/insights/persistence.ts +0 -10
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
const require_v1_0_0 = require("../../schema/v1_0_0.cjs");
|
|
2
|
+
const require_sql = require("./sql.cjs");
|
|
3
|
+
//#region src/db/schema/insightsCollation.ts
|
|
4
|
+
const getInsightsCollationSql = (provider) => [require_v1_0_0.bundleEventsV100, require_v1_0_0.bundleInstallationsV100].flatMap((table) => table.columns.flatMap((column) => {
|
|
5
|
+
const collation = column.providerCollations?.[provider];
|
|
6
|
+
if (collation === void 0) return [];
|
|
7
|
+
if (provider === "mysql") return [`alter table ${table.ormName} modify column ${require_sql.sqlColumnDefinition(table, {
|
|
8
|
+
...column,
|
|
9
|
+
primaryKey: void 0
|
|
10
|
+
}, provider)}`];
|
|
11
|
+
return [`alter table ${table.ormName} alter column ${column.ormName} type ${require_sql.getSqlType(column.type, provider)} collate ${collation}`];
|
|
12
|
+
}));
|
|
13
|
+
//#endregion
|
|
14
|
+
exports.getInsightsCollationSql = getInsightsCollationSql;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { bundleEventsV100, bundleInstallationsV100 } from "../../schema/v1_0_0.mjs";
|
|
2
|
+
import { getSqlType, sqlColumnDefinition } from "./sql.mjs";
|
|
3
|
+
//#region src/db/schema/insightsCollation.ts
|
|
4
|
+
const getInsightsCollationSql = (provider) => [bundleEventsV100, bundleInstallationsV100].flatMap((table) => table.columns.flatMap((column) => {
|
|
5
|
+
const collation = column.providerCollations?.[provider];
|
|
6
|
+
if (collation === void 0) return [];
|
|
7
|
+
if (provider === "mysql") return [`alter table ${table.ormName} modify column ${sqlColumnDefinition(table, {
|
|
8
|
+
...column,
|
|
9
|
+
primaryKey: void 0
|
|
10
|
+
}, provider)}`];
|
|
11
|
+
return [`alter table ${table.ormName} alter column ${column.ormName} type ${getSqlType(column.type, provider)} collate ${collation}`];
|
|
12
|
+
}));
|
|
13
|
+
//#endregion
|
|
14
|
+
export { getInsightsCollationSql };
|
package/dist/db/schema/sql.cjs
CHANGED
|
@@ -83,19 +83,23 @@ const createTableStatement = (table, provider, relationMode = "foreign-keys") =>
|
|
|
83
83
|
];
|
|
84
84
|
return `create table ${table.ormName} (\n${lines.join(",\n")}\n)`;
|
|
85
85
|
};
|
|
86
|
-
const createForeignKeySqlStatements = (provider, relationMode = "foreign-keys") => {
|
|
86
|
+
const createForeignKeySqlStatements = (provider, relationMode = "foreign-keys", schema = require_registry.hotUpdaterSchema) => {
|
|
87
87
|
if (relationMode !== "foreign-keys" || provider === "sqlite") return [];
|
|
88
|
-
return
|
|
88
|
+
return schema.tables.flatMap((table) => (table.foreignKeys ?? []).map((foreignKey) => createForeignKeySql(table, foreignKey, provider)));
|
|
89
89
|
};
|
|
90
|
-
const createTableSql = (provider, relationMode = "foreign-keys") => [
|
|
91
|
-
...
|
|
92
|
-
...
|
|
93
|
-
...provider === "sqlite" ? [] :
|
|
94
|
-
...createForeignKeySqlStatements(provider, relationMode)
|
|
90
|
+
const createTableSql = (provider, relationMode = "foreign-keys", schema = require_registry.hotUpdaterSchema) => [
|
|
91
|
+
...schema.tables.map((table) => createTableStatement(table, provider, relationMode)),
|
|
92
|
+
...schema.tables.flatMap((table) => (table.indexes ?? []).filter((index) => require_registry.schemaIndexAppliesToProvider(index, provider)).map((index) => createIndexSql(table, index, provider))),
|
|
93
|
+
...provider === "sqlite" ? [] : schema.tables.flatMap((table) => (table.checks ?? []).map((check) => createCheckSql(table, check, provider))),
|
|
94
|
+
...createForeignKeySqlStatements(provider, relationMode, schema)
|
|
95
95
|
];
|
|
96
96
|
//#endregion
|
|
97
97
|
exports.createCheckSql = createCheckSql;
|
|
98
98
|
exports.createForeignKeySql = createForeignKeySql;
|
|
99
|
+
exports.createForeignKeySqlStatements = createForeignKeySqlStatements;
|
|
99
100
|
exports.createIndexSql = createIndexSql;
|
|
100
101
|
exports.createTableSql = createTableSql;
|
|
102
|
+
exports.createTableStatement = createTableStatement;
|
|
103
|
+
exports.getSqlType = getSqlType;
|
|
101
104
|
exports.hotUpdaterCreateTableOperations = hotUpdaterCreateTableOperations;
|
|
105
|
+
exports.sqlColumnDefinition = sqlColumnDefinition;
|
package/dist/db/schema/sql.mjs
CHANGED
|
@@ -83,15 +83,15 @@ const createTableStatement = (table, provider, relationMode = "foreign-keys") =>
|
|
|
83
83
|
];
|
|
84
84
|
return `create table ${table.ormName} (\n${lines.join(",\n")}\n)`;
|
|
85
85
|
};
|
|
86
|
-
const createForeignKeySqlStatements = (provider, relationMode = "foreign-keys") => {
|
|
86
|
+
const createForeignKeySqlStatements = (provider, relationMode = "foreign-keys", schema = hotUpdaterSchema) => {
|
|
87
87
|
if (relationMode !== "foreign-keys" || provider === "sqlite") return [];
|
|
88
|
-
return
|
|
88
|
+
return schema.tables.flatMap((table) => (table.foreignKeys ?? []).map((foreignKey) => createForeignKeySql(table, foreignKey, provider)));
|
|
89
89
|
};
|
|
90
|
-
const createTableSql = (provider, relationMode = "foreign-keys") => [
|
|
91
|
-
...
|
|
92
|
-
...
|
|
93
|
-
...provider === "sqlite" ? [] :
|
|
94
|
-
...createForeignKeySqlStatements(provider, relationMode)
|
|
90
|
+
const createTableSql = (provider, relationMode = "foreign-keys", schema = hotUpdaterSchema) => [
|
|
91
|
+
...schema.tables.map((table) => createTableStatement(table, provider, relationMode)),
|
|
92
|
+
...schema.tables.flatMap((table) => (table.indexes ?? []).filter((index) => schemaIndexAppliesToProvider(index, provider)).map((index) => createIndexSql(table, index, provider))),
|
|
93
|
+
...provider === "sqlite" ? [] : schema.tables.flatMap((table) => (table.checks ?? []).map((check) => createCheckSql(table, check, provider))),
|
|
94
|
+
...createForeignKeySqlStatements(provider, relationMode, schema)
|
|
95
95
|
];
|
|
96
96
|
//#endregion
|
|
97
|
-
export { createCheckSql, createForeignKeySql, createIndexSql, createTableSql, hotUpdaterCreateTableOperations };
|
|
97
|
+
export { createCheckSql, createForeignKeySql, createForeignKeySqlStatements, createIndexSql, createTableSql, createTableStatement, getSqlType, hotUpdaterCreateTableOperations, sqlColumnDefinition };
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
require("../schema/types.cjs");
|
|
2
2
|
const require_types$1 = require("./types.cjs");
|
|
3
3
|
const require_registry = require("./schema/registry.cjs");
|
|
4
|
+
const require_sql = require("./schema/sql.cjs");
|
|
5
|
+
const require_insightsCollation = require("./schema/insightsCollation.cjs");
|
|
4
6
|
//#region src/db/schemaGenerators.ts
|
|
5
7
|
const literal = (value) => JSON.stringify(value);
|
|
6
8
|
const varcharLength = (type) => Number(type.slice(8, -1));
|
|
@@ -55,17 +57,34 @@ const prismaRelationFields = (table, schema) => {
|
|
|
55
57
|
return lines;
|
|
56
58
|
};
|
|
57
59
|
const prismaIndexes = (table, provider) => (table.indexes ?? []).filter((index) => require_registry.schemaIndexAppliesToProvider(index, provider)).map((index) => `@@${index.unique ? "unique" : "index"}([${index.columns.join(", ")}], map: ${literal(index.name)})`);
|
|
58
|
-
const generatePrismaSchema = (provider, schema = require_registry.hotUpdaterSchema) =>
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
60
|
+
const generatePrismaSchema = (provider, schema = require_registry.hotUpdaterSchema) => {
|
|
61
|
+
const sqlProvider = require_types$1.getSQLProvider(provider);
|
|
62
|
+
const collationSql = sqlProvider ? require_insightsCollation.getInsightsCollationSql(sqlProvider) : [];
|
|
63
|
+
return (collationSql.length === 0 ? "" : [
|
|
64
|
+
"// Apply these statements in the initial Prisma SQL migration to preserve exact Insights identities and cursors:",
|
|
65
|
+
...collationSql.map((statement) => `// ${statement};`),
|
|
66
|
+
""
|
|
67
|
+
].join("\n")) + schema.tables.map((table) => {
|
|
68
|
+
const lines = [
|
|
69
|
+
...table.columns.map((column) => prismaField(column, provider)),
|
|
70
|
+
...prismaRelationFields(table, schema),
|
|
71
|
+
...prismaIndexes(table, provider)
|
|
72
|
+
];
|
|
73
|
+
return `model ${table.ormName} {\n${lines.map((line) => ` ${line}`).join("\n")}\n}`;
|
|
74
|
+
}).join("\n\n");
|
|
75
|
+
};
|
|
66
76
|
const drizzleImportSource = (provider) => provider === "sqlite" ? "drizzle-orm/sqlite-core" : provider === "mysql" ? "drizzle-orm/mysql-core" : "drizzle-orm/pg-core";
|
|
67
77
|
const drizzleTableFn = (provider) => provider === "sqlite" ? "sqliteTable" : provider === "mysql" ? "mysqlTable" : "pgTable";
|
|
68
78
|
const drizzleColumnFn = (column, provider) => {
|
|
79
|
+
const collation = column.providerCollations?.[provider];
|
|
80
|
+
if (collation !== void 0) {
|
|
81
|
+
const charset = provider === "mysql" ? ` character set ${collation === "ascii_bin" ? "ascii" : "utf8mb4"}` : "";
|
|
82
|
+
const dataType = `${require_sql.getSqlType(column.type, provider)}${charset} collate ${collation}`;
|
|
83
|
+
return {
|
|
84
|
+
code: `customType<{ data: string }>({ dataType: () => ${literal(dataType)} })(${literal(column.ormName)})`,
|
|
85
|
+
imports: ["customType"]
|
|
86
|
+
};
|
|
87
|
+
}
|
|
69
88
|
if (provider === "sqlite") {
|
|
70
89
|
if (column.type === "bool") return {
|
|
71
90
|
code: `integer(${literal(column.ormName)}, { mode: "boolean" })`,
|
|
@@ -227,7 +246,7 @@ ${lines.join(",\n")}
|
|
|
227
246
|
}))`;
|
|
228
247
|
};
|
|
229
248
|
const generateDrizzleSchema = (provider, schema = require_registry.hotUpdaterSchema) => {
|
|
230
|
-
const imports = new Set([drizzleTableFn(provider)]);
|
|
249
|
+
const imports = /* @__PURE__ */ new Set([drizzleTableFn(provider)]);
|
|
231
250
|
const body = [];
|
|
232
251
|
for (const table of schema.tables) {
|
|
233
252
|
body.push(drizzleTable(table, provider, imports));
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import "../schema/types.mjs";
|
|
2
2
|
import { getSQLProvider } from "./types.mjs";
|
|
3
3
|
import { getHotUpdaterSchemaVersion, hotUpdaterSchema, schemaIndexAppliesToProvider } from "./schema/registry.mjs";
|
|
4
|
+
import { getSqlType } from "./schema/sql.mjs";
|
|
5
|
+
import { getInsightsCollationSql } from "./schema/insightsCollation.mjs";
|
|
4
6
|
//#region src/db/schemaGenerators.ts
|
|
5
7
|
const literal = (value) => JSON.stringify(value);
|
|
6
8
|
const varcharLength = (type) => Number(type.slice(8, -1));
|
|
@@ -55,17 +57,34 @@ const prismaRelationFields = (table, schema) => {
|
|
|
55
57
|
return lines;
|
|
56
58
|
};
|
|
57
59
|
const prismaIndexes = (table, provider) => (table.indexes ?? []).filter((index) => schemaIndexAppliesToProvider(index, provider)).map((index) => `@@${index.unique ? "unique" : "index"}([${index.columns.join(", ")}], map: ${literal(index.name)})`);
|
|
58
|
-
const generatePrismaSchema = (provider, schema = hotUpdaterSchema) =>
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
60
|
+
const generatePrismaSchema = (provider, schema = hotUpdaterSchema) => {
|
|
61
|
+
const sqlProvider = getSQLProvider(provider);
|
|
62
|
+
const collationSql = sqlProvider ? getInsightsCollationSql(sqlProvider) : [];
|
|
63
|
+
return (collationSql.length === 0 ? "" : [
|
|
64
|
+
"// Apply these statements in the initial Prisma SQL migration to preserve exact Insights identities and cursors:",
|
|
65
|
+
...collationSql.map((statement) => `// ${statement};`),
|
|
66
|
+
""
|
|
67
|
+
].join("\n")) + schema.tables.map((table) => {
|
|
68
|
+
const lines = [
|
|
69
|
+
...table.columns.map((column) => prismaField(column, provider)),
|
|
70
|
+
...prismaRelationFields(table, schema),
|
|
71
|
+
...prismaIndexes(table, provider)
|
|
72
|
+
];
|
|
73
|
+
return `model ${table.ormName} {\n${lines.map((line) => ` ${line}`).join("\n")}\n}`;
|
|
74
|
+
}).join("\n\n");
|
|
75
|
+
};
|
|
66
76
|
const drizzleImportSource = (provider) => provider === "sqlite" ? "drizzle-orm/sqlite-core" : provider === "mysql" ? "drizzle-orm/mysql-core" : "drizzle-orm/pg-core";
|
|
67
77
|
const drizzleTableFn = (provider) => provider === "sqlite" ? "sqliteTable" : provider === "mysql" ? "mysqlTable" : "pgTable";
|
|
68
78
|
const drizzleColumnFn = (column, provider) => {
|
|
79
|
+
const collation = column.providerCollations?.[provider];
|
|
80
|
+
if (collation !== void 0) {
|
|
81
|
+
const charset = provider === "mysql" ? ` character set ${collation === "ascii_bin" ? "ascii" : "utf8mb4"}` : "";
|
|
82
|
+
const dataType = `${getSqlType(column.type, provider)}${charset} collate ${collation}`;
|
|
83
|
+
return {
|
|
84
|
+
code: `customType<{ data: string }>({ dataType: () => ${literal(dataType)} })(${literal(column.ormName)})`,
|
|
85
|
+
imports: ["customType"]
|
|
86
|
+
};
|
|
87
|
+
}
|
|
69
88
|
if (provider === "sqlite") {
|
|
70
89
|
if (column.type === "bool") return {
|
|
71
90
|
code: `integer(${literal(column.ormName)}, { mode: "boolean" })`,
|
|
@@ -227,7 +246,7 @@ ${lines.join(",\n")}
|
|
|
227
246
|
}))`;
|
|
228
247
|
};
|
|
229
248
|
const generateDrizzleSchema = (provider, schema = hotUpdaterSchema) => {
|
|
230
|
-
const imports = new Set([drizzleTableFn(provider)]);
|
|
249
|
+
const imports = /* @__PURE__ */ new Set([drizzleTableFn(provider)]);
|
|
231
250
|
const body = [];
|
|
232
251
|
for (const table of schema.tables) {
|
|
233
252
|
body.push(drizzleTable(table, provider, imports));
|
|
@@ -2,6 +2,8 @@ require("../schema/types.cjs");
|
|
|
2
2
|
const require_fixedMigratorShared = require("./fixedMigratorShared.cjs");
|
|
3
3
|
//#region src/db/schemaReadiness.ts
|
|
4
4
|
var HotUpdaterSchemaMigrationRequiredError = class extends Error {
|
|
5
|
+
adapterName;
|
|
6
|
+
currentVersion;
|
|
5
7
|
constructor(adapterName, currentVersion) {
|
|
6
8
|
super(currentVersion === void 0 ? `Hot Updater database schema is not initialized for ${adapterName}. Run \`hot-updater db migrate\` before using this adapter.` : require_fixedMigratorShared.unsupportedSchemaUpgradeMessage(currentVersion));
|
|
7
9
|
this.adapterName = adapterName;
|
|
@@ -2,6 +2,8 @@ import "../schema/types.mjs";
|
|
|
2
2
|
import { unsupportedSchemaUpgradeMessage } from "./fixedMigratorShared.mjs";
|
|
3
3
|
//#region src/db/schemaReadiness.ts
|
|
4
4
|
var HotUpdaterSchemaMigrationRequiredError = class extends Error {
|
|
5
|
+
adapterName;
|
|
6
|
+
currentVersion;
|
|
5
7
|
constructor(adapterName, currentVersion) {
|
|
6
8
|
super(currentVersion === void 0 ? `Hot Updater database schema is not initialized for ${adapterName}. Run \`hot-updater db migrate\` before using this adapter.` : unsupportedSchemaUpgradeMessage(currentVersion));
|
|
7
9
|
this.adapterName = adapterName;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
require("../_virtual/_rolldown/runtime.cjs");
|
|
2
1
|
let kysely = require("kysely");
|
|
3
2
|
//#region src/db/sqlMigrationExecution.ts
|
|
4
3
|
var SqliteMigrationForeignKeyError = class extends Error {
|
|
4
|
+
violations;
|
|
5
5
|
name = "SqliteMigrationForeignKeyError";
|
|
6
6
|
constructor(violations) {
|
|
7
7
|
super(`SQLite migration produced ${violations} foreign key violation(s).`);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { sql } from "kysely";
|
|
2
2
|
//#region src/db/sqlMigrationExecution.ts
|
|
3
3
|
var SqliteMigrationForeignKeyError = class extends Error {
|
|
4
|
+
violations;
|
|
4
5
|
name = "SqliteMigrationForeignKeyError";
|
|
5
6
|
constructor(violations) {
|
|
6
7
|
super(`SQLite migration produced ${violations} foreign key violation(s).`);
|
package/dist/db/types.cjs
CHANGED
|
@@ -9,7 +9,7 @@ const sqlProviders = [
|
|
|
9
9
|
const noSqlProviders = ["mongodb"];
|
|
10
10
|
[...sqlProviders, ...noSqlProviders];
|
|
11
11
|
function isDatabasePlugin(plugin) {
|
|
12
|
-
return typeof plugin === "object" && plugin !== null && "name" in plugin && typeof plugin.name === "string" && "models" in plugin && typeof plugin.models === "object" && plugin.models !== null && "bundles" in plugin.models && typeof plugin.models.bundles === "object" && plugin.models.bundles !== null && "findById" in plugin.models.bundles && typeof plugin.models.bundles.findById === "function" && "findMany" in plugin.models.bundles && typeof plugin.models.bundles.findMany === "function" && "count" in plugin.models.bundles && typeof plugin.models.bundles.count === "function" && "bundlePatches" in plugin.models && typeof plugin.models.bundlePatches === "object" && plugin.models.bundlePatches !== null && "findByBundleIds" in plugin.models.bundlePatches && typeof plugin.models.bundlePatches.findByBundleIds === "function" && "channels" in plugin.models && typeof plugin.models.channels === "object" && plugin.models.channels !== null && "insert" in plugin.models.channels && typeof plugin.models.channels.insert === "function" && "list" in plugin.models.channels && typeof plugin.models.channels.list === "function" && "delete" in plugin.models.channels && typeof plugin.models.channels.delete === "function" && "insights" in plugin.models && typeof plugin.models.insights === "object" && plugin.models.insights !== null && "
|
|
12
|
+
return typeof plugin === "object" && plugin !== null && "name" in plugin && typeof plugin.name === "string" && "models" in plugin && typeof plugin.models === "object" && plugin.models !== null && "bundles" in plugin.models && typeof plugin.models.bundles === "object" && plugin.models.bundles !== null && "findById" in plugin.models.bundles && typeof plugin.models.bundles.findById === "function" && "findMany" in plugin.models.bundles && typeof plugin.models.bundles.findMany === "function" && "count" in plugin.models.bundles && typeof plugin.models.bundles.count === "function" && "bundlePatches" in plugin.models && typeof plugin.models.bundlePatches === "object" && plugin.models.bundlePatches !== null && "findByBundleIds" in plugin.models.bundlePatches && typeof plugin.models.bundlePatches.findByBundleIds === "function" && "channels" in plugin.models && typeof plugin.models.channels === "object" && plugin.models.channels !== null && "insert" in plugin.models.channels && typeof plugin.models.channels.insert === "function" && "list" in plugin.models.channels && typeof plugin.models.channels.list === "function" && "delete" in plugin.models.channels && typeof plugin.models.channels.delete === "function" && "insights" in plugin.models && typeof plugin.models.insights === "object" && plugin.models.insights !== null && "record" in plugin.models.insights && typeof plugin.models.insights.record === "function" && "listEvents" in plugin.models.insights && typeof plugin.models.insights.listEvents === "function" && "findInstallations" in plugin.models.insights && typeof plugin.models.insights.findInstallations === "function" && "countEvents" in plugin.models.insights && typeof plugin.models.insights.countEvents === "function" && "countInstallations" in plugin.models.insights && typeof plugin.models.insights.countInstallations === "function" && "apiKeys" in plugin.models && typeof plugin.models.apiKeys === "object" && plugin.models.apiKeys !== null && "create" in plugin.models.apiKeys && typeof plugin.models.apiKeys.create === "function" && "findByHash" in plugin.models.apiKeys && typeof plugin.models.apiKeys.findByHash === "function" && "list" in plugin.models.apiKeys && typeof plugin.models.apiKeys.list === "function" && "revoke" in plugin.models.apiKeys && typeof plugin.models.apiKeys.revoke === "function" && "commit" in plugin && typeof plugin.commit === "function" && (!("dispose" in plugin) || plugin.dispose === void 0 || typeof plugin.dispose === "function");
|
|
13
13
|
}
|
|
14
14
|
function getSQLProvider(provider) {
|
|
15
15
|
if (!provider) return;
|
|
@@ -18,3 +18,5 @@ function getSQLProvider(provider) {
|
|
|
18
18
|
//#endregion
|
|
19
19
|
exports.getSQLProvider = getSQLProvider;
|
|
20
20
|
exports.isDatabasePlugin = isDatabasePlugin;
|
|
21
|
+
exports.noSqlProviders = noSqlProviders;
|
|
22
|
+
exports.sqlProviders = sqlProviders;
|
package/dist/db/types.d.cts
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { ReleaseCatalogRequest } from "./releaseCatalog.cjs";
|
|
2
2
|
import { PaginatedResult } from "../types/index.cjs";
|
|
3
|
-
import * as _$_hot_updater_core0 from "@hot-updater/core";
|
|
4
3
|
import { ArtifactInfo, Bundle } from "@hot-updater/core";
|
|
5
|
-
import * as _$_hot_updater_plugin_core0 from "@hot-updater/plugin-core";
|
|
6
4
|
import { ChannelDeleteInput, ChannelDeleteResult, ChannelInsertInput, ChannelInsertResult, ChannelRow, DatabaseCommit, DatabaseCommitResult, DatabasePlugin, ReleaseCatalogMutationPreflight, ReleaseCatalogMutationResult, ReleaseCatalogRebuildResult, ReleaseCatalogRow, ReleasePolicyPatch, ReleaseRow } from "@hot-updater/plugin-core";
|
|
7
|
-
|
|
8
5
|
//#region src/db/types.d.ts
|
|
9
6
|
declare const sqlProviders: readonly ["sqlite", "cockroachdb", "mysql", "postgresql", "mssql"];
|
|
10
7
|
declare const providers: readonly ["sqlite", "cockroachdb", "mysql", "postgresql", "mssql", "mongodb"];
|
|
@@ -69,7 +66,7 @@ type DatabaseAdapterWithCapabilities = DatabasePlugin & DatabaseAdapterCapabilit
|
|
|
69
66
|
type DatabasePlugin$1 = DatabaseAdapterWithCapabilities;
|
|
70
67
|
interface DatabaseAPI {
|
|
71
68
|
getBundleById(id: string): Promise<Bundle | null>;
|
|
72
|
-
getReleaseCatalog(input: ReleaseCatalogRequest): Promise<
|
|
69
|
+
getReleaseCatalog(input: ReleaseCatalogRequest): Promise<import("@hot-updater/core").ReleaseCatalog | null>;
|
|
73
70
|
getArtifactInfo(targetBundleId: string, currentBundleId: string): Promise<ArtifactInfo | null>;
|
|
74
71
|
getReleaseById(id: string): Promise<ReleaseRow | null>;
|
|
75
72
|
getReleasesByScope(input: {
|
|
@@ -111,11 +108,11 @@ interface DatabaseAPI {
|
|
|
111
108
|
getChannels(): Promise<readonly ChannelRow[]>;
|
|
112
109
|
insertChannel(input: ChannelInsertInput): Promise<ChannelInsertResult>;
|
|
113
110
|
deleteChannel(input: ChannelDeleteInput): Promise<ChannelDeleteResult>;
|
|
114
|
-
getBundles(options:
|
|
111
|
+
getBundles(options: import("@hot-updater/plugin-core").DatabaseBundleQueryOptions): Promise<PaginatedResult>;
|
|
115
112
|
insertBundle(bundle: Bundle): Promise<void>;
|
|
116
113
|
insertBundles(bundles: readonly Bundle[]): Promise<void>;
|
|
117
114
|
updateBundleById(bundleId: string, newBundle: Partial<Bundle>): Promise<void>;
|
|
118
115
|
deleteBundleById(bundleId: string): Promise<void>;
|
|
119
116
|
}
|
|
120
117
|
//#endregion
|
|
121
|
-
export { DatabaseAPI, DatabaseAdapterWithCapabilities, DatabasePlugin$1 as DatabasePlugin, Migrator, ORMProvider, ORMSQLProvider, RelationMode, SchemaGenerator };
|
|
118
|
+
export { DatabaseAPI, DatabaseAdapterCapabilities, DatabaseAdapterWithCapabilities, DatabasePlugin$1 as DatabasePlugin, MigrateOptions, MigrationOperation, MigrationResult, Migrator, ORMProvider, ORMSQLProvider, RelationMode, SchemaGenerator, providers, sqlProviders };
|
package/dist/db/types.d.mts
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { ReleaseCatalogRequest } from "./releaseCatalog.mjs";
|
|
2
2
|
import { PaginatedResult } from "../types/index.mjs";
|
|
3
|
-
import * as _$_hot_updater_plugin_core0 from "@hot-updater/plugin-core";
|
|
4
3
|
import { ChannelDeleteInput, ChannelDeleteResult, ChannelInsertInput, ChannelInsertResult, ChannelRow, DatabaseCommit, DatabaseCommitResult, DatabasePlugin, ReleaseCatalogMutationPreflight, ReleaseCatalogMutationResult, ReleaseCatalogRebuildResult, ReleaseCatalogRow, ReleasePolicyPatch, ReleaseRow } from "@hot-updater/plugin-core";
|
|
5
|
-
import * as _$_hot_updater_core0 from "@hot-updater/core";
|
|
6
4
|
import { ArtifactInfo, Bundle as Bundle$1 } from "@hot-updater/core";
|
|
7
|
-
|
|
8
5
|
//#region src/db/types.d.ts
|
|
9
6
|
declare const sqlProviders: readonly ["sqlite", "cockroachdb", "mysql", "postgresql", "mssql"];
|
|
10
7
|
declare const providers: readonly ["sqlite", "cockroachdb", "mysql", "postgresql", "mssql", "mongodb"];
|
|
@@ -69,7 +66,7 @@ type DatabaseAdapterWithCapabilities = DatabasePlugin & DatabaseAdapterCapabilit
|
|
|
69
66
|
type DatabasePlugin$1 = DatabaseAdapterWithCapabilities;
|
|
70
67
|
interface DatabaseAPI {
|
|
71
68
|
getBundleById(id: string): Promise<Bundle$1 | null>;
|
|
72
|
-
getReleaseCatalog(input: ReleaseCatalogRequest): Promise<
|
|
69
|
+
getReleaseCatalog(input: ReleaseCatalogRequest): Promise<import("@hot-updater/core").ReleaseCatalog | null>;
|
|
73
70
|
getArtifactInfo(targetBundleId: string, currentBundleId: string): Promise<ArtifactInfo | null>;
|
|
74
71
|
getReleaseById(id: string): Promise<ReleaseRow | null>;
|
|
75
72
|
getReleasesByScope(input: {
|
|
@@ -111,11 +108,11 @@ interface DatabaseAPI {
|
|
|
111
108
|
getChannels(): Promise<readonly ChannelRow[]>;
|
|
112
109
|
insertChannel(input: ChannelInsertInput): Promise<ChannelInsertResult>;
|
|
113
110
|
deleteChannel(input: ChannelDeleteInput): Promise<ChannelDeleteResult>;
|
|
114
|
-
getBundles(options:
|
|
111
|
+
getBundles(options: import("@hot-updater/plugin-core").DatabaseBundleQueryOptions): Promise<PaginatedResult>;
|
|
115
112
|
insertBundle(bundle: Bundle$1): Promise<void>;
|
|
116
113
|
insertBundles(bundles: readonly Bundle$1[]): Promise<void>;
|
|
117
114
|
updateBundleById(bundleId: string, newBundle: Partial<Bundle$1>): Promise<void>;
|
|
118
115
|
deleteBundleById(bundleId: string): Promise<void>;
|
|
119
116
|
}
|
|
120
117
|
//#endregion
|
|
121
|
-
export { DatabaseAPI, DatabaseAdapterWithCapabilities, DatabasePlugin$1 as DatabasePlugin, Migrator, ORMProvider, ORMSQLProvider, RelationMode, SchemaGenerator };
|
|
118
|
+
export { DatabaseAPI, DatabaseAdapterCapabilities, DatabaseAdapterWithCapabilities, DatabasePlugin$1 as DatabasePlugin, MigrateOptions, MigrationOperation, MigrationResult, Migrator, ORMProvider, ORMSQLProvider, RelationMode, SchemaGenerator, providers, sqlProviders };
|
package/dist/db/types.mjs
CHANGED
|
@@ -9,11 +9,11 @@ const sqlProviders = [
|
|
|
9
9
|
const noSqlProviders = ["mongodb"];
|
|
10
10
|
[...sqlProviders, ...noSqlProviders];
|
|
11
11
|
function isDatabasePlugin(plugin) {
|
|
12
|
-
return typeof plugin === "object" && plugin !== null && "name" in plugin && typeof plugin.name === "string" && "models" in plugin && typeof plugin.models === "object" && plugin.models !== null && "bundles" in plugin.models && typeof plugin.models.bundles === "object" && plugin.models.bundles !== null && "findById" in plugin.models.bundles && typeof plugin.models.bundles.findById === "function" && "findMany" in plugin.models.bundles && typeof plugin.models.bundles.findMany === "function" && "count" in plugin.models.bundles && typeof plugin.models.bundles.count === "function" && "bundlePatches" in plugin.models && typeof plugin.models.bundlePatches === "object" && plugin.models.bundlePatches !== null && "findByBundleIds" in plugin.models.bundlePatches && typeof plugin.models.bundlePatches.findByBundleIds === "function" && "channels" in plugin.models && typeof plugin.models.channels === "object" && plugin.models.channels !== null && "insert" in plugin.models.channels && typeof plugin.models.channels.insert === "function" && "list" in plugin.models.channels && typeof plugin.models.channels.list === "function" && "delete" in plugin.models.channels && typeof plugin.models.channels.delete === "function" && "insights" in plugin.models && typeof plugin.models.insights === "object" && plugin.models.insights !== null && "
|
|
12
|
+
return typeof plugin === "object" && plugin !== null && "name" in plugin && typeof plugin.name === "string" && "models" in plugin && typeof plugin.models === "object" && plugin.models !== null && "bundles" in plugin.models && typeof plugin.models.bundles === "object" && plugin.models.bundles !== null && "findById" in plugin.models.bundles && typeof plugin.models.bundles.findById === "function" && "findMany" in plugin.models.bundles && typeof plugin.models.bundles.findMany === "function" && "count" in plugin.models.bundles && typeof plugin.models.bundles.count === "function" && "bundlePatches" in plugin.models && typeof plugin.models.bundlePatches === "object" && plugin.models.bundlePatches !== null && "findByBundleIds" in plugin.models.bundlePatches && typeof plugin.models.bundlePatches.findByBundleIds === "function" && "channels" in plugin.models && typeof plugin.models.channels === "object" && plugin.models.channels !== null && "insert" in plugin.models.channels && typeof plugin.models.channels.insert === "function" && "list" in plugin.models.channels && typeof plugin.models.channels.list === "function" && "delete" in plugin.models.channels && typeof plugin.models.channels.delete === "function" && "insights" in plugin.models && typeof plugin.models.insights === "object" && plugin.models.insights !== null && "record" in plugin.models.insights && typeof plugin.models.insights.record === "function" && "listEvents" in plugin.models.insights && typeof plugin.models.insights.listEvents === "function" && "findInstallations" in plugin.models.insights && typeof plugin.models.insights.findInstallations === "function" && "countEvents" in plugin.models.insights && typeof plugin.models.insights.countEvents === "function" && "countInstallations" in plugin.models.insights && typeof plugin.models.insights.countInstallations === "function" && "apiKeys" in plugin.models && typeof plugin.models.apiKeys === "object" && plugin.models.apiKeys !== null && "create" in plugin.models.apiKeys && typeof plugin.models.apiKeys.create === "function" && "findByHash" in plugin.models.apiKeys && typeof plugin.models.apiKeys.findByHash === "function" && "list" in plugin.models.apiKeys && typeof plugin.models.apiKeys.list === "function" && "revoke" in plugin.models.apiKeys && typeof plugin.models.apiKeys.revoke === "function" && "commit" in plugin && typeof plugin.commit === "function" && (!("dispose" in plugin) || plugin.dispose === void 0 || typeof plugin.dispose === "function");
|
|
13
13
|
}
|
|
14
14
|
function getSQLProvider(provider) {
|
|
15
15
|
if (!provider) return;
|
|
16
16
|
return sqlProviders.includes(provider) ? provider : void 0;
|
|
17
17
|
}
|
|
18
18
|
//#endregion
|
|
19
|
-
export { getSQLProvider, isDatabasePlugin };
|
|
19
|
+
export { getSQLProvider, isDatabasePlugin, noSqlProviders, sqlProviders };
|
package/dist/handler.d.cts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { HandlerAPI, HotUpdaterHandler, HotUpdaterHandlers } from "./handlerTypes.cjs";
|
|
2
|
-
|
|
3
2
|
//#region src/handler.d.ts
|
|
4
3
|
declare function createHandlers(api: HandlerAPI): HotUpdaterHandlers;
|
|
5
4
|
//#endregion
|
|
6
|
-
export { createHandlers };
|
|
5
|
+
export { type HandlerAPI, type HotUpdaterHandler, type HotUpdaterHandlers, createHandlers };
|
package/dist/handler.d.mts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { HandlerAPI, HotUpdaterHandler, HotUpdaterHandlers } from "./handlerTypes.mjs";
|
|
2
|
-
|
|
3
2
|
//#region src/handler.d.ts
|
|
4
3
|
declare function createHandlers(api: HandlerAPI): HotUpdaterHandlers;
|
|
5
4
|
//#endregion
|
|
6
|
-
export { createHandlers };
|
|
5
|
+
export { type HandlerAPI, type HotUpdaterHandler, type HotUpdaterHandlers, createHandlers };
|
package/dist/handlerTypes.d.cts
CHANGED
|
@@ -2,7 +2,6 @@ import { ReleaseCatalogRequest } from "./db/releaseCatalog.cjs";
|
|
|
2
2
|
import { PaginatedResult } from "./types/index.cjs";
|
|
3
3
|
import { ArtifactInfo, Bundle, ReleaseCatalog } from "@hot-updater/core";
|
|
4
4
|
import { ChannelDeleteInput, ChannelDeleteResult, ChannelInsertInput, ChannelInsertResult, ChannelRow, DatabaseBundleQueryOptions, DatabaseCommit, DatabaseCommitResult, ReleaseCatalogMutationPreflight, ReleaseCatalogMutationResult, ReleaseCatalogRebuildResult, ReleaseCatalogRow, ReleasePolicyPatch, ReleaseRow } from "@hot-updater/plugin-core";
|
|
5
|
-
|
|
6
5
|
//#region src/handlerTypes.d.ts
|
|
7
6
|
interface HandlerAPI {
|
|
8
7
|
getReleaseCatalog?: (input: ReleaseCatalogRequest) => Promise<ReleaseCatalog | null>;
|
package/dist/handlerTypes.d.mts
CHANGED
|
@@ -2,7 +2,6 @@ import { ReleaseCatalogRequest } from "./db/releaseCatalog.mjs";
|
|
|
2
2
|
import { PaginatedResult } from "./types/index.mjs";
|
|
3
3
|
import { ChannelDeleteInput, ChannelDeleteResult, ChannelInsertInput, ChannelInsertResult, ChannelRow, DatabaseBundleQueryOptions, DatabaseCommit, DatabaseCommitResult, ReleaseCatalogMutationPreflight, ReleaseCatalogMutationResult, ReleaseCatalogRebuildResult, ReleaseCatalogRow, ReleasePolicyPatch, ReleaseRow } from "@hot-updater/plugin-core";
|
|
4
4
|
import { ArtifactInfo, Bundle as Bundle$1, ReleaseCatalog } from "@hot-updater/core";
|
|
5
|
-
|
|
6
5
|
//#region src/handlerTypes.d.ts
|
|
7
6
|
interface HandlerAPI {
|
|
8
7
|
getReleaseCatalog?: (input: ReleaseCatalogRequest) => Promise<ReleaseCatalog | null>;
|
package/dist/index.cjs
CHANGED
|
@@ -2,7 +2,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
2
2
|
const require_version = require("./version.cjs");
|
|
3
3
|
const require_handlerVersionRoutes = require("./handlerVersionRoutes.cjs");
|
|
4
4
|
const require_handler = require("./handler.cjs");
|
|
5
|
-
const require_provider = require("./insights/
|
|
5
|
+
const require_provider = require("./insights/provider.cjs");
|
|
6
6
|
const require_apiKeys = require("./apiKeys.cjs");
|
|
7
7
|
const require_createHotUpdaterCore = require("./createHotUpdaterCore.cjs");
|
|
8
8
|
exports.API_KEY_HEADER_NAME = require_apiKeys.API_KEY_HEADER_NAME;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { API_KEY_HEADER_NAME, ApiKeyManagementAPI, ApiKeyMetadata, CreatedApiKey, createApiKey, provisionApiKey, registerApiKey } from "./apiKeys.cjs";
|
|
2
2
|
import { HandlerAPI, HotUpdaterHandler, HotUpdaterHandlers } from "./handlerTypes.cjs";
|
|
3
|
-
import {
|
|
4
|
-
import { InsightsProvider } from "./insights/types.cjs";
|
|
3
|
+
import { ActiveInstallationWindow, CreateBundleEventRequest, CreateBundleEventRequestBase, CursorPage, EventCursorPage, EventHistoryRow, InsightsBundleSelection, InsightsCountMeasurement, InsightsScope, InstallationHistoryRow, InstallationRow, ReportingOverview } from "./insights/domain.cjs";
|
|
4
|
+
import { InsightsEventPageInput, InsightsInstallationEventPageInput, InsightsProvider, InsightsUserInstallationPageInput } from "./insights/types.cjs";
|
|
5
5
|
import { createHandlers } from "./handler.cjs";
|
|
6
6
|
import { ClientAccessPolicy, CreateHotUpdaterOptions, HotUpdaterAPI, RuntimeHotUpdaterAPI, createHotUpdater } from "./createHotUpdaterCore.cjs";
|
|
7
7
|
import { Bundle, ChannelsResponse, DataResponse, Paginated, PaginatedResult, PaginationInfo, PaginationOptions } from "./types/index.cjs";
|
|
8
8
|
import { HOT_UPDATER_SERVER_VERSION } from "./version.cjs";
|
|
9
|
-
import { createInsightsProvider } from "./insights/
|
|
9
|
+
import { createInsightsProvider } from "./insights/provider.cjs";
|
|
10
10
|
import { HOT_UPDATER_INFRASTRUCTURE_GENERATION } from "./handlerVersionRoutes.cjs";
|
|
11
|
-
export { API_KEY_HEADER_NAME,
|
|
11
|
+
export { API_KEY_HEADER_NAME, type ActiveInstallationWindow, type ApiKeyManagementAPI, type ApiKeyMetadata, type Bundle, ChannelsResponse, type ClientAccessPolicy, type CreateBundleEventRequest, type CreateBundleEventRequestBase, type CreateHotUpdaterOptions, type CreatedApiKey, type CursorPage, DataResponse, type EventCursorPage, type EventHistoryRow, HOT_UPDATER_INFRASTRUCTURE_GENERATION, HOT_UPDATER_SERVER_VERSION, type HandlerAPI, type HotUpdaterAPI, type HotUpdaterHandler, type HotUpdaterHandlers, type InsightsBundleSelection, type InsightsCountMeasurement, type InsightsEventPageInput, type InsightsInstallationEventPageInput, type InsightsProvider, type InsightsScope, type InsightsUserInstallationPageInput, type InstallationHistoryRow, type InstallationRow, Paginated, PaginatedResult, PaginationInfo, PaginationOptions, type ReportingOverview, type RuntimeHotUpdaterAPI, createApiKey, createHandlers, createHotUpdater, createInsightsProvider, provisionApiKey, registerApiKey };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { API_KEY_HEADER_NAME, ApiKeyManagementAPI, ApiKeyMetadata, CreatedApiKey, createApiKey, provisionApiKey, registerApiKey } from "./apiKeys.mjs";
|
|
2
2
|
import { HandlerAPI, HotUpdaterHandler, HotUpdaterHandlers } from "./handlerTypes.mjs";
|
|
3
|
-
import {
|
|
4
|
-
import { InsightsProvider } from "./insights/types.mjs";
|
|
3
|
+
import { ActiveInstallationWindow, CreateBundleEventRequest, CreateBundleEventRequestBase, CursorPage, EventCursorPage, EventHistoryRow, InsightsBundleSelection, InsightsCountMeasurement, InsightsScope, InstallationHistoryRow, InstallationRow, ReportingOverview } from "./insights/domain.mjs";
|
|
4
|
+
import { InsightsEventPageInput, InsightsInstallationEventPageInput, InsightsProvider, InsightsUserInstallationPageInput } from "./insights/types.mjs";
|
|
5
5
|
import { createHandlers } from "./handler.mjs";
|
|
6
6
|
import { ClientAccessPolicy, CreateHotUpdaterOptions, HotUpdaterAPI, RuntimeHotUpdaterAPI, createHotUpdater } from "./createHotUpdaterCore.mjs";
|
|
7
7
|
import { Bundle, ChannelsResponse, DataResponse, Paginated, PaginatedResult, PaginationInfo, PaginationOptions } from "./types/index.mjs";
|
|
8
8
|
import { HOT_UPDATER_SERVER_VERSION } from "./version.mjs";
|
|
9
|
-
import { createInsightsProvider } from "./insights/
|
|
9
|
+
import { createInsightsProvider } from "./insights/provider.mjs";
|
|
10
10
|
import { HOT_UPDATER_INFRASTRUCTURE_GENERATION } from "./handlerVersionRoutes.mjs";
|
|
11
|
-
export { API_KEY_HEADER_NAME,
|
|
11
|
+
export { API_KEY_HEADER_NAME, type ActiveInstallationWindow, type ApiKeyManagementAPI, type ApiKeyMetadata, type Bundle, ChannelsResponse, type ClientAccessPolicy, type CreateBundleEventRequest, type CreateBundleEventRequestBase, type CreateHotUpdaterOptions, type CreatedApiKey, type CursorPage, DataResponse, type EventCursorPage, type EventHistoryRow, HOT_UPDATER_INFRASTRUCTURE_GENERATION, HOT_UPDATER_SERVER_VERSION, type HandlerAPI, type HotUpdaterAPI, type HotUpdaterHandler, type HotUpdaterHandlers, type InsightsBundleSelection, type InsightsCountMeasurement, type InsightsEventPageInput, type InsightsInstallationEventPageInput, type InsightsProvider, type InsightsScope, type InsightsUserInstallationPageInput, type InstallationHistoryRow, type InstallationRow, Paginated, PaginatedResult, PaginationInfo, PaginationOptions, type ReportingOverview, type RuntimeHotUpdaterAPI, createApiKey, createHandlers, createHotUpdater, createInsightsProvider, provisionApiKey, registerApiKey };
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { HOT_UPDATER_SERVER_VERSION } from "./version.mjs";
|
|
2
2
|
import { HOT_UPDATER_INFRASTRUCTURE_GENERATION } from "./handlerVersionRoutes.mjs";
|
|
3
3
|
import { createHandlers } from "./handler.mjs";
|
|
4
|
-
import { createInsightsProvider } from "./insights/
|
|
4
|
+
import { createInsightsProvider } from "./insights/provider.mjs";
|
|
5
5
|
import { API_KEY_HEADER_NAME, createApiKey, provisionApiKey, registerApiKey } from "./apiKeys.mjs";
|
|
6
6
|
import { createHotUpdater } from "./createHotUpdaterCore.mjs";
|
|
7
7
|
export { API_KEY_HEADER_NAME, HOT_UPDATER_INFRASTRUCTURE_GENERATION, HOT_UPDATER_SERVER_VERSION, createApiKey, createHandlers, createHotUpdater, createInsightsProvider, provisionApiKey, registerApiKey };
|