@axium/server 0.36.2 → 0.36.4
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/api/admin.js +3 -2
- package/dist/config.js +2 -2
- package/dist/database.js +1 -1
- package/package.json +1 -1
package/dist/api/admin.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AuditFilter, Severity, UserAdminChange } from '@axium/core';
|
|
2
|
-
import { errorText, writeJSON } from '@axium/core/node/io';
|
|
2
|
+
import { debug, errorText, writeJSON } from '@axium/core/node/io';
|
|
3
3
|
import { getVersionInfo } from '@axium/core/node/packages';
|
|
4
4
|
import { _findPlugin, plugins, PluginUpdate, serverConfigs } from '@axium/core/plugins';
|
|
5
5
|
import { jsonObjectFrom } from 'kysely/helpers/postgres';
|
|
@@ -72,8 +72,9 @@ addRoute({
|
|
|
72
72
|
if (!plugin._configPath)
|
|
73
73
|
error(503, 'Plugin configuration path is not set');
|
|
74
74
|
plugin.config ||= {};
|
|
75
|
+
debug('Updating plugin config:', name);
|
|
75
76
|
const parsed = await schema.parseAsync(config).catch(e => error(400, errorText(e)));
|
|
76
|
-
deepAssign(plugin.config, parsed);
|
|
77
|
+
deepAssign(plugin.config, parsed, true);
|
|
77
78
|
mkdirSync(dirname(plugin._configPath), { recursive: true });
|
|
78
79
|
writeJSON(plugin._configPath, plugin.config);
|
|
79
80
|
}
|
package/dist/config.js
CHANGED
|
@@ -173,7 +173,7 @@ export const ConfigFile = z
|
|
|
173
173
|
* Update the current config
|
|
174
174
|
*/
|
|
175
175
|
export function setConfig(other) {
|
|
176
|
-
deepAssign(config, other);
|
|
176
|
+
deepAssign(config, other, true);
|
|
177
177
|
logger.detach(io);
|
|
178
178
|
if (config.log.console)
|
|
179
179
|
logger.attach(io, { output: config.log.level });
|
|
@@ -239,7 +239,7 @@ export async function loadConfig(path, options = {}) {
|
|
|
239
239
|
continue;
|
|
240
240
|
try {
|
|
241
241
|
const data = io.readJSON(configPath, serverConfig.schema.partial());
|
|
242
|
-
deepAssign(plugin.config, data);
|
|
242
|
+
deepAssign(plugin.config, data, true);
|
|
243
243
|
io.debug(`Loaded config for plugin ${plugin.name} from ${configPath}`);
|
|
244
244
|
}
|
|
245
245
|
catch (e) {
|
package/dist/database.js
CHANGED
|
@@ -695,7 +695,7 @@ function columnFromSchema(column, allowPK) {
|
|
|
695
695
|
if (column.onDelete)
|
|
696
696
|
col = col.onDelete(column.onDelete);
|
|
697
697
|
if ('default' in column)
|
|
698
|
-
col = col.defaultTo(
|
|
698
|
+
col = col.defaultTo(column.default);
|
|
699
699
|
if (column.check)
|
|
700
700
|
col = col.check(sql.raw(column.check));
|
|
701
701
|
return col;
|