@axium/server 0.28.2 → 0.28.3

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.
@@ -487,7 +487,9 @@ export declare function getSchemaFiles(): Generator<[string, SchemaFile]>;
487
487
  */
488
488
  export declare function getFullSchema(opt?: {
489
489
  exclude?: string[];
490
- }): SchemaDecl;
490
+ }): SchemaDecl & {
491
+ versions: Record<string, number>;
492
+ };
491
493
  export declare const UpgradesInfo: z.ZodObject<{
492
494
  current: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodInt>>;
493
495
  upgrades: z.ZodDefault<z.ZodArray<z.ZodObject<{
package/dist/database.js CHANGED
@@ -326,11 +326,13 @@ export function* getSchemaFiles() {
326
326
  * Get the active schema
327
327
  */
328
328
  export function getFullSchema(opt = {}) {
329
- const fullSchema = { tables: {}, indexes: [] };
329
+ const fullSchema = { tables: {}, indexes: [], versions: {} };
330
330
  for (const [pluginName, file] of getSchemaFiles()) {
331
331
  if (opt.exclude?.includes(pluginName))
332
332
  continue;
333
+ file.latest ??= file.versions.length - 1;
333
334
  let currentSchema = { tables: {}, indexes: [] };
335
+ fullSchema.versions[pluginName] = file.latest;
334
336
  for (const [version, schema] of file.versions.entries()) {
335
337
  if (schema.delta)
336
338
  applyDeltaToSchema(currentSchema, schema);
package/dist/main.js CHANGED
@@ -55,7 +55,7 @@ import { apps } from '@axium/core';
55
55
  import { AuditFilter, severityNames } from '@axium/core/audit';
56
56
  import { formatDateRange } from '@axium/core/format';
57
57
  import { io, outputDaemonStatus, pluginText } from '@axium/core/node';
58
- import { _findPlugin, plugins } from '@axium/core/plugins';
58
+ import { _findPlugin, plugins, runIntegrations } from '@axium/core/plugins';
59
59
  import { Argument, Option, program } from 'commander';
60
60
  import { access } from 'node:fs/promises';
61
61
  import { join, resolve } from 'node:path/posix';
@@ -80,7 +80,8 @@ async function rlConfirm(question = 'Is this ok') {
80
80
  io.exit('Aborted.');
81
81
  }
82
82
  async function dbInitTables() {
83
- const schema = db.getFullSchema({ exclude: Object.keys(db.getUpgradeInfo().current) });
83
+ const info = db.getUpgradeInfo();
84
+ const schema = db.getFullSchema({ exclude: Object.keys(info.current) });
84
85
  const delta = db.computeDelta({ tables: {}, indexes: [] }, schema);
85
86
  if (db.deltaIsEmpty(delta))
86
87
  return;
@@ -88,6 +89,8 @@ async function dbInitTables() {
88
89
  console.log(text);
89
90
  await rlConfirm();
90
91
  await db.applyDelta(delta);
92
+ Object.assign(info.current, schema.versions);
93
+ db.setUpgradeInfo(info);
91
94
  }
92
95
  function configReplacer(opt) {
93
96
  return (key, value) => {
@@ -113,6 +116,7 @@ try {
113
116
  await config.loadDefaults(safe);
114
117
  if (configFromCLI)
115
118
  await config.load(configFromCLI, { safe });
119
+ await runIntegrations();
116
120
  program
117
121
  .version($pkg.version)
118
122
  .name('axium')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axium/server",
3
- "version": "0.28.2",
3
+ "version": "0.28.3",
4
4
  "author": "James Prevett <axium@jamespre.dev>",
5
5
  "funding": {
6
6
  "type": "individual",
@@ -6,9 +6,10 @@
6
6
  </script>
7
7
 
8
8
  <div id="admin-container">
9
- <div class="sidebar">
9
+ <div id="admin-sidebar">
10
10
  {#each data.tabs as { href, name, icon: i, active }}
11
- <a {href} class={['item', 'icon-text', active && 'active']}><Icon {i} /> {capitalize(name)}</a>
11
+ <a {href} class={['item', 'icon-text', active && 'active']}><Icon {i} /> <span class="sidebar-text">{capitalize(name)}</span></a
12
+ >
12
13
  {/each}
13
14
  </div>
14
15
 
@@ -24,7 +25,7 @@
24
25
  height: 100%;
25
26
  }
26
27
 
27
- .sidebar {
28
+ #admin-sidebar {
28
29
  grid-column: 1;
29
30
  width: 100%;
30
31
  display: inline-flex;
@@ -56,4 +57,37 @@
56
57
  overflow-x: hidden;
57
58
  overflow-y: scroll;
58
59
  }
60
+
61
+ @media (width < 700px) {
62
+ #admin-container {
63
+ grid-template-columns: 1fr;
64
+ }
65
+
66
+ #admin-content {
67
+ padding-bottom: 4em;
68
+ }
69
+
70
+ #admin-sidebar {
71
+ position: fixed;
72
+ grid-column: unset;
73
+ inset: auto 0 0;
74
+ border-radius: 1em;
75
+ display: flex;
76
+ flex-direction: row;
77
+ justify-content: space-around;
78
+ gap: 1em;
79
+ padding: 0.5em;
80
+ }
81
+
82
+ .sidebar-text {
83
+ display: none;
84
+ }
85
+
86
+ .item {
87
+ flex: 1 1 0;
88
+ border-radius: 1em;
89
+ padding: 1em;
90
+ justify-content: center;
91
+ }
92
+ }
59
93
  </style>