@axium/server 0.19.2 → 0.19.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.
Files changed (37) hide show
  1. package/build/client/_app/immutable/chunks/{DC6rf2pV.js → BMO2uJEL.js} +1 -1
  2. package/build/client/_app/immutable/chunks/BMO2uJEL.js.br +0 -0
  3. package/build/client/_app/immutable/chunks/BMO2uJEL.js.gz +0 -0
  4. package/build/client/_app/immutable/entry/{app.BhR1OQ9M.js → app.BtDtVL8V.js} +2 -2
  5. package/build/client/_app/immutable/entry/app.BtDtVL8V.js.br +0 -0
  6. package/build/client/_app/immutable/entry/app.BtDtVL8V.js.gz +0 -0
  7. package/build/client/_app/immutable/entry/start.D7_oizIq.js +1 -0
  8. package/build/client/_app/immutable/entry/start.D7_oizIq.js.br +2 -0
  9. package/build/client/_app/immutable/entry/start.D7_oizIq.js.gz +0 -0
  10. package/build/client/_app/immutable/nodes/{1.CmApQ62q.js → 1.BMfCraPE.js} +1 -1
  11. package/build/client/_app/immutable/nodes/1.BMfCraPE.js.br +0 -0
  12. package/build/client/_app/immutable/nodes/1.BMfCraPE.js.gz +0 -0
  13. package/build/client/_app/version.json +1 -1
  14. package/build/client/_app/version.json.br +0 -0
  15. package/build/client/_app/version.json.gz +0 -0
  16. package/build/server/chunks/{1-Dvu-6EP-.js → 1-CIIjhTW-.js} +2 -2
  17. package/build/server/chunks/{1-Dvu-6EP-.js.map → 1-CIIjhTW-.js.map} +1 -1
  18. package/build/server/chunks/{hooks.server-w5bqOSE3.js → hooks.server-B8traf9Y.js} +54 -2
  19. package/build/server/chunks/hooks.server-B8traf9Y.js.map +1 -0
  20. package/build/server/index.js +2 -2
  21. package/build/server/index.js.map +1 -1
  22. package/build/server/manifest.js +2 -2
  23. package/build/server/manifest.js.map +1 -1
  24. package/dist/auth.js +1 -1
  25. package/dist/cli.js +0 -3
  26. package/dist/database.js +208 -132
  27. package/package.json +1 -1
  28. package/build/client/_app/immutable/chunks/DC6rf2pV.js.br +0 -0
  29. package/build/client/_app/immutable/chunks/DC6rf2pV.js.gz +0 -0
  30. package/build/client/_app/immutable/entry/app.BhR1OQ9M.js.br +0 -0
  31. package/build/client/_app/immutable/entry/app.BhR1OQ9M.js.gz +0 -0
  32. package/build/client/_app/immutable/entry/start.DVsnYbMe.js +0 -1
  33. package/build/client/_app/immutable/entry/start.DVsnYbMe.js.br +0 -2
  34. package/build/client/_app/immutable/entry/start.DVsnYbMe.js.gz +0 -0
  35. package/build/client/_app/immutable/nodes/1.CmApQ62q.js.br +0 -0
  36. package/build/client/_app/immutable/nodes/1.CmApQ62q.js.gz +0 -0
  37. package/build/server/chunks/hooks.server-w5bqOSE3.js.map +0 -1
@@ -10,10 +10,10 @@ return {
10
10
  assets: new Set(["icons/brands.svg","icons/light.svg","icons/regular.svg","icons/solid.svg","styles.css"]),
11
11
  mimeTypes: {".svg":"image/svg+xml",".css":"text/css"},
12
12
  _: {
13
- client: {start:"_app/immutable/entry/start.DVsnYbMe.js",app:"_app/immutable/entry/app.BhR1OQ9M.js",imports:["_app/immutable/entry/start.DVsnYbMe.js","_app/immutable/chunks/DC6rf2pV.js","_app/immutable/chunks/IgiyYk6u.js","_app/immutable/chunks/DCUM25og.js","_app/immutable/chunks/BYEtX5Az.js","_app/immutable/chunks/p-F-zYzk.js","_app/immutable/entry/app.BhR1OQ9M.js","_app/immutable/chunks/DCUM25og.js","_app/immutable/chunks/BYEtX5Az.js","_app/immutable/chunks/DsnmJJEf.js","_app/immutable/chunks/IgiyYk6u.js","_app/immutable/chunks/p-F-zYzk.js","_app/immutable/chunks/FWeOBoAM.js"],stylesheets:[],fonts:[],uses_env_dynamic_public:false},
13
+ client: {start:"_app/immutable/entry/start.D7_oizIq.js",app:"_app/immutable/entry/app.BtDtVL8V.js",imports:["_app/immutable/entry/start.D7_oizIq.js","_app/immutable/chunks/BMO2uJEL.js","_app/immutable/chunks/IgiyYk6u.js","_app/immutable/chunks/DCUM25og.js","_app/immutable/chunks/BYEtX5Az.js","_app/immutable/chunks/p-F-zYzk.js","_app/immutable/entry/app.BtDtVL8V.js","_app/immutable/chunks/DCUM25og.js","_app/immutable/chunks/BYEtX5Az.js","_app/immutable/chunks/DsnmJJEf.js","_app/immutable/chunks/IgiyYk6u.js","_app/immutable/chunks/p-F-zYzk.js","_app/immutable/chunks/FWeOBoAM.js"],stylesheets:[],fonts:[],uses_env_dynamic_public:false},
14
14
  nodes: [
15
15
  __memo(() => import('./chunks/0-BwO1RCtn.js')),
16
- __memo(() => import('./chunks/1-Dvu-6EP-.js')),
16
+ __memo(() => import('./chunks/1-CIIjhTW-.js')),
17
17
  __memo(() => import('./chunks/2-BwMXZ3uH.js')),
18
18
  __memo(() => import('./chunks/3-BI9EEPQX.js')),
19
19
  __memo(() => import('./chunks/4-B4PHWuxx.js')),
@@ -1 +1 @@
1
- {"version":3,"file":"manifest.js","sources":["../../.svelte-kit/adapter-node/manifest.js"],"sourcesContent":["export const manifest = (() => {\nfunction __memo(fn) {\n\tlet value;\n\treturn () => value ??= (value = fn());\n}\n\nreturn {\n\tappDir: \"_app\",\n\tappPath: \"_app\",\n\tassets: new Set([\"icons/brands.svg\",\"icons/light.svg\",\"icons/regular.svg\",\"icons/solid.svg\",\"styles.css\"]),\n\tmimeTypes: {\".svg\":\"image/svg+xml\",\".css\":\"text/css\"},\n\t_: {\n\t\tclient: {start:\"_app/immutable/entry/start.DVsnYbMe.js\",app:\"_app/immutable/entry/app.BhR1OQ9M.js\",imports:[\"_app/immutable/entry/start.DVsnYbMe.js\",\"_app/immutable/chunks/DC6rf2pV.js\",\"_app/immutable/chunks/IgiyYk6u.js\",\"_app/immutable/chunks/DCUM25og.js\",\"_app/immutable/chunks/BYEtX5Az.js\",\"_app/immutable/chunks/p-F-zYzk.js\",\"_app/immutable/entry/app.BhR1OQ9M.js\",\"_app/immutable/chunks/DCUM25og.js\",\"_app/immutable/chunks/BYEtX5Az.js\",\"_app/immutable/chunks/DsnmJJEf.js\",\"_app/immutable/chunks/IgiyYk6u.js\",\"_app/immutable/chunks/p-F-zYzk.js\",\"_app/immutable/chunks/FWeOBoAM.js\"],stylesheets:[],fonts:[],uses_env_dynamic_public:false},\n\t\tnodes: [\n\t\t\t__memo(() => import('./nodes/0.js')),\n\t\t\t__memo(() => import('./nodes/1.js')),\n\t\t\t__memo(() => import('./nodes/2.js')),\n\t\t\t__memo(() => import('./nodes/3.js')),\n\t\t\t__memo(() => import('./nodes/4.js')),\n\t\t\t__memo(() => import('./nodes/5.js')),\n\t\t\t__memo(() => import('./nodes/6.js'))\n\t\t],\n\t\troutes: [\n\t\t\t{\n\t\t\t\tid: \"/_axium/default\",\n\t\t\t\tpattern: /^\\/_axium\\/default\\/?$/,\n\t\t\t\tparams: [],\n\t\t\t\tpage: { layouts: [0,], errors: [1,], leaf: 2 },\n\t\t\t\tendpoint: null\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"/account\",\n\t\t\t\tpattern: /^\\/account\\/?$/,\n\t\t\t\tparams: [],\n\t\t\t\tpage: { layouts: [0,], errors: [1,], leaf: 3 },\n\t\t\t\tendpoint: null\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"/login\",\n\t\t\t\tpattern: /^\\/login\\/?$/,\n\t\t\t\tparams: [],\n\t\t\t\tpage: { layouts: [0,], errors: [1,], leaf: 4 },\n\t\t\t\tendpoint: null\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"/logout\",\n\t\t\t\tpattern: /^\\/logout\\/?$/,\n\t\t\t\tparams: [],\n\t\t\t\tpage: { layouts: [0,], errors: [1,], leaf: 5 },\n\t\t\t\tendpoint: null\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"/register\",\n\t\t\t\tpattern: /^\\/register\\/?$/,\n\t\t\t\tparams: [],\n\t\t\t\tpage: { layouts: [0,], errors: [1,], leaf: 6 },\n\t\t\t\tendpoint: null\n\t\t\t}\n\t\t],\n\t\tprerendered_routes: new Set([]),\n\t\tmatchers: async () => {\n\t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H,IAAI,EAAE,EAAE,WAAW;AACnB,IAAI,OAAO,EAAE,iBAAiB;AAC9B,IAAI,MAAM,EAAE,EAAE;AACd,IAAI,IAAI,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE;AAClD,IAAI,QAAQ,EAAE;AACd;AACA,GAAG;AACH,EAAE,kBAAkB,EAAE,IAAI,GAAG,CAAC,EAAE,CAAC;AACjC,EAAE,QAAQ,EAAE,YAAY;AACxB;AACA,GAAG,OAAO,IAAI;AACd,EAAE,CAAC;AACH,EAAE,aAAa,EAAE;AACjB;AACA;AACA,CAAC;;AAEW,MAAC,WAAW,GAAG,IAAI,GAAG,CAAC,EAAE;;AAEzB,MAAC,IAAI,GAAG;;;;"}
1
+ {"version":3,"file":"manifest.js","sources":["../../.svelte-kit/adapter-node/manifest.js"],"sourcesContent":["export const manifest = (() => {\nfunction __memo(fn) {\n\tlet value;\n\treturn () => value ??= (value = fn());\n}\n\nreturn {\n\tappDir: \"_app\",\n\tappPath: \"_app\",\n\tassets: new Set([\"icons/brands.svg\",\"icons/light.svg\",\"icons/regular.svg\",\"icons/solid.svg\",\"styles.css\"]),\n\tmimeTypes: {\".svg\":\"image/svg+xml\",\".css\":\"text/css\"},\n\t_: {\n\t\tclient: {start:\"_app/immutable/entry/start.D7_oizIq.js\",app:\"_app/immutable/entry/app.BtDtVL8V.js\",imports:[\"_app/immutable/entry/start.D7_oizIq.js\",\"_app/immutable/chunks/BMO2uJEL.js\",\"_app/immutable/chunks/IgiyYk6u.js\",\"_app/immutable/chunks/DCUM25og.js\",\"_app/immutable/chunks/BYEtX5Az.js\",\"_app/immutable/chunks/p-F-zYzk.js\",\"_app/immutable/entry/app.BtDtVL8V.js\",\"_app/immutable/chunks/DCUM25og.js\",\"_app/immutable/chunks/BYEtX5Az.js\",\"_app/immutable/chunks/DsnmJJEf.js\",\"_app/immutable/chunks/IgiyYk6u.js\",\"_app/immutable/chunks/p-F-zYzk.js\",\"_app/immutable/chunks/FWeOBoAM.js\"],stylesheets:[],fonts:[],uses_env_dynamic_public:false},\n\t\tnodes: [\n\t\t\t__memo(() => import('./nodes/0.js')),\n\t\t\t__memo(() => import('./nodes/1.js')),\n\t\t\t__memo(() => import('./nodes/2.js')),\n\t\t\t__memo(() => import('./nodes/3.js')),\n\t\t\t__memo(() => import('./nodes/4.js')),\n\t\t\t__memo(() => import('./nodes/5.js')),\n\t\t\t__memo(() => import('./nodes/6.js'))\n\t\t],\n\t\troutes: [\n\t\t\t{\n\t\t\t\tid: \"/_axium/default\",\n\t\t\t\tpattern: /^\\/_axium\\/default\\/?$/,\n\t\t\t\tparams: [],\n\t\t\t\tpage: { layouts: [0,], errors: [1,], leaf: 2 },\n\t\t\t\tendpoint: null\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"/account\",\n\t\t\t\tpattern: /^\\/account\\/?$/,\n\t\t\t\tparams: [],\n\t\t\t\tpage: { layouts: [0,], errors: [1,], leaf: 3 },\n\t\t\t\tendpoint: null\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"/login\",\n\t\t\t\tpattern: /^\\/login\\/?$/,\n\t\t\t\tparams: [],\n\t\t\t\tpage: { layouts: [0,], errors: [1,], leaf: 4 },\n\t\t\t\tendpoint: null\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"/logout\",\n\t\t\t\tpattern: /^\\/logout\\/?$/,\n\t\t\t\tparams: [],\n\t\t\t\tpage: { layouts: [0,], errors: [1,], leaf: 5 },\n\t\t\t\tendpoint: null\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"/register\",\n\t\t\t\tpattern: /^\\/register\\/?$/,\n\t\t\t\tparams: [],\n\t\t\t\tpage: { layouts: [0,], errors: [1,], leaf: 6 },\n\t\t\t\tendpoint: null\n\t\t\t}\n\t\t],\n\t\tprerendered_routes: new Set([]),\n\t\tmatchers: async () => {\n\t\t\t\n\t\t\treturn {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E,WAAW;AACnB,IAAI,OAAO,EAAE,iBAAiB;AAC9B,IAAI,MAAM,EAAE,EAAE;AACd,IAAI,IAAI,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE;AAClD,IAAI,QAAQ,EAAE;AACd;AACA,GAAG;AACH,EAAE,kBAAkB,EAAE,IAAI,GAAG,CAAC,EAAE,CAAC;AACjC,EAAE,QAAQ,EAAE,YAAY;AACxB;AACA,GAAG,OAAO,IAAI;AACd,EAAE,CAAC;AACH,EAAE,aAAa,EAAE;AACjB;AACA;AACA,CAAC;;AAEW,MAAC,WAAW,GAAG,IAAI,GAAG,CAAC,EAAE;;AAEzB,MAAC,IAAI,GAAG;;;;"}
package/dist/auth.js CHANGED
@@ -103,7 +103,7 @@ export async function checkAuthForUser(event, userId, sensitive = false) {
103
103
  return Object.assign(session, { accessor: session.user });
104
104
  }
105
105
  export async function checkAuthForItem(event, itemType, itemId, permission) {
106
- const token = getToken(event, true);
106
+ const token = getToken(event, false);
107
107
  if (!token)
108
108
  error(401, 'Missing token');
109
109
  const session = await getSessionAndUser(token).catch(() => null);
package/dist/cli.js CHANGED
@@ -150,9 +150,6 @@ axiumDB
150
150
  output.error('Unavailable');
151
151
  process.exitCode = 1;
152
152
  }
153
- finally {
154
- await db.database.destroy();
155
- }
156
153
  });
157
154
  axiumDB
158
155
  .command('drop')
package/dist/database.js CHANGED
@@ -1,3 +1,55 @@
1
+ var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
2
+ if (value !== null && value !== void 0) {
3
+ if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
4
+ var dispose, inner;
5
+ if (async) {
6
+ if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
7
+ dispose = value[Symbol.asyncDispose];
8
+ }
9
+ if (dispose === void 0) {
10
+ if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
11
+ dispose = value[Symbol.dispose];
12
+ if (async) inner = dispose;
13
+ }
14
+ if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
15
+ if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };
16
+ env.stack.push({ value: value, dispose: dispose, async: async });
17
+ }
18
+ else if (async) {
19
+ env.stack.push({ async: true });
20
+ }
21
+ return value;
22
+ };
23
+ var __disposeResources = (this && this.__disposeResources) || (function (SuppressedError) {
24
+ return function (env) {
25
+ function fail(e) {
26
+ env.error = env.hasError ? new SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
27
+ env.hasError = true;
28
+ }
29
+ var r, s = 0;
30
+ function next() {
31
+ while (r = env.stack.pop()) {
32
+ try {
33
+ if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);
34
+ if (r.dispose) {
35
+ var result = r.dispose.call(r.value);
36
+ if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
37
+ }
38
+ else s |= 1;
39
+ }
40
+ catch (e) {
41
+ fail(e);
42
+ }
43
+ }
44
+ if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
45
+ if (env.hasError) throw env.error;
46
+ }
47
+ return next();
48
+ };
49
+ })(typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
50
+ var e = new Error(message);
51
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
52
+ });
1
53
  import { Kysely, PostgresDialect, sql } from 'kysely';
2
54
  import { jsonObjectFrom } from 'kysely/helpers/postgres';
3
55
  import { randomBytes } from 'node:crypto';
@@ -99,118 +151,130 @@ export async function createIndex(table, column, mod) {
99
151
  await query.execute().then(io.done).catch(warnExists);
100
152
  }
101
153
  export async function init(opt) {
102
- if (!config.db.password) {
103
- config.save({ db: { password: randomBytes(32).toString('base64') } }, true);
104
- io.debug('Generated password and wrote to global config');
105
- }
106
- await io.run('Checking for sudo', 'which sudo');
107
- await io.run('Checking for psql', 'which psql');
108
- await _sql('CREATE DATABASE axium', 'Creating database').catch(async (error) => {
109
- if (error != 'database "axium" already exists')
110
- throw error;
111
- if (shouldRecreate(opt))
112
- return;
113
- await _sql('DROP DATABASE axium', 'Dropping database');
114
- await _sql('CREATE DATABASE axium', 'Re-creating database');
115
- });
116
- const createQuery = `CREATE USER axium WITH ENCRYPTED PASSWORD '${config.db.password}' LOGIN`;
117
- await _sql(createQuery, 'Creating user').catch(async (error) => {
118
- if (error != 'role "axium" already exists')
119
- throw error;
120
- if (shouldRecreate(opt))
121
- return;
122
- await _sql('REVOKE ALL PRIVILEGES ON SCHEMA public FROM axium', 'Revoking schema privileges');
123
- await _sql('DROP USER axium', 'Dropping user');
124
- await _sql(createQuery, 'Re-creating user');
125
- });
126
- await _sql('GRANT ALL PRIVILEGES ON DATABASE axium TO axium', 'Granting database privileges');
127
- await _sql('GRANT ALL PRIVILEGES ON SCHEMA public TO axium', 'Granting schema privileges');
128
- await _sql('ALTER DATABASE axium OWNER TO axium', 'Setting database owner');
129
- await getHBA(opt)
130
- .then(([content, writeBack]) => {
131
- io.start('Checking for Axium HBA configuration');
132
- if (content.includes(pgHba))
133
- throw 'already exists.';
134
- io.done();
135
- io.start('Adding Axium HBA configuration');
136
- const newContent = content.replace(/^local\s+all\s+all.*$/m, `$&\n${pgHba}`);
154
+ const env_1 = { stack: [], error: void 0, hasError: false };
155
+ try {
156
+ if (!config.db.password) {
157
+ config.save({ db: { password: randomBytes(32).toString('base64') } }, true);
158
+ io.debug('Generated password and wrote to global config');
159
+ }
160
+ await io.run('Checking for sudo', 'which sudo');
161
+ await io.run('Checking for psql', 'which psql');
162
+ await _sql('CREATE DATABASE axium', 'Creating database').catch(async (error) => {
163
+ if (error != 'database "axium" already exists')
164
+ throw error;
165
+ if (shouldRecreate(opt))
166
+ return;
167
+ await _sql('DROP DATABASE axium', 'Dropping database');
168
+ await _sql('CREATE DATABASE axium', 'Re-creating database');
169
+ });
170
+ const createQuery = `CREATE USER axium WITH ENCRYPTED PASSWORD '${config.db.password}' LOGIN`;
171
+ await _sql(createQuery, 'Creating user').catch(async (error) => {
172
+ if (error != 'role "axium" already exists')
173
+ throw error;
174
+ if (shouldRecreate(opt))
175
+ return;
176
+ await _sql('REVOKE ALL PRIVILEGES ON SCHEMA public FROM axium', 'Revoking schema privileges');
177
+ await _sql('DROP USER axium', 'Dropping user');
178
+ await _sql(createQuery, 'Re-creating user');
179
+ });
180
+ await _sql('GRANT ALL PRIVILEGES ON DATABASE axium TO axium', 'Granting database privileges');
181
+ await _sql('GRANT ALL PRIVILEGES ON SCHEMA public TO axium', 'Granting schema privileges');
182
+ await _sql('ALTER DATABASE axium OWNER TO axium', 'Setting database owner');
183
+ await getHBA(opt)
184
+ .then(([content, writeBack]) => {
185
+ io.start('Checking for Axium HBA configuration');
186
+ if (content.includes(pgHba))
187
+ throw 'already exists.';
188
+ io.done();
189
+ io.start('Adding Axium HBA configuration');
190
+ const newContent = content.replace(/^local\s+all\s+all.*$/m, `$&\n${pgHba}`);
191
+ io.done();
192
+ writeBack(newContent);
193
+ })
194
+ .catch(io.warn);
195
+ await _sql('SELECT pg_reload_conf()', 'Reloading configuration');
196
+ io.start('Connecting to database');
197
+ const _ = __addDisposableResource(env_1, connect(), true);
137
198
  io.done();
138
- writeBack(newContent);
139
- })
140
- .catch(io.warn);
141
- await _sql('SELECT pg_reload_conf()', 'Reloading configuration');
142
- io.start('Connecting to database');
143
- connect();
144
- io.done();
145
- function maybeCheck(table) {
146
- return (e) => {
147
- warnExists(e);
148
- if (opt.check)
149
- return checkTableTypes(table, expectedTypes[table], opt);
150
- };
199
+ function maybeCheck(table) {
200
+ return (e) => {
201
+ warnExists(e);
202
+ if (opt.check)
203
+ return checkTableTypes(table, expectedTypes[table], opt);
204
+ };
205
+ }
206
+ io.start('Creating table users');
207
+ await database.schema
208
+ .createTable('users')
209
+ .addColumn('id', 'uuid', col => col.primaryKey().defaultTo(sql `gen_random_uuid()`))
210
+ .addColumn('name', 'text')
211
+ .addColumn('email', 'text', col => col.unique().notNull())
212
+ .addColumn('emailVerified', 'timestamptz')
213
+ .addColumn('image', 'text')
214
+ .addColumn('isAdmin', 'boolean', col => col.notNull().defaultTo(false))
215
+ .addColumn('roles', sql `text[]`, col => col.notNull().defaultTo(sql `'{}'::text[]`))
216
+ .addColumn('tags', sql `text[]`, col => col.notNull().defaultTo(sql `'{}'::text[]`))
217
+ .addColumn('preferences', 'jsonb', col => col.notNull().defaultTo('{}'))
218
+ .addColumn('registeredAt', 'timestamptz', col => col.notNull().defaultTo(sql `now()`))
219
+ .execute()
220
+ .then(io.done)
221
+ .catch(maybeCheck('users'));
222
+ io.start('Creating table sessions');
223
+ await database.schema
224
+ .createTable('sessions')
225
+ .addColumn('id', 'uuid', col => col.primaryKey().defaultTo(sql `gen_random_uuid()`))
226
+ .addColumn('userId', 'uuid', col => col.references('users.id').onDelete('cascade').notNull())
227
+ .addColumn('token', 'text', col => col.notNull().unique())
228
+ .addColumn('created', 'timestamptz', col => col.notNull())
229
+ .addColumn('expires', 'timestamptz', col => col.notNull())
230
+ .addColumn('elevated', 'boolean', col => col.notNull())
231
+ .execute()
232
+ .then(io.done)
233
+ .catch(maybeCheck('sessions'));
234
+ await createIndex('sessions', 'id');
235
+ io.start('Creating table verifications');
236
+ await database.schema
237
+ .createTable('verifications')
238
+ .addColumn('userId', 'uuid', col => col.references('users.id').onDelete('cascade').notNull())
239
+ .addColumn('token', 'text', col => col.notNull().unique())
240
+ .addColumn('expires', 'timestamptz', col => col.notNull())
241
+ .addColumn('role', 'text', col => col.notNull())
242
+ .execute()
243
+ .then(io.done)
244
+ .catch(maybeCheck('verifications'));
245
+ io.start('Creating table passkeys');
246
+ await database.schema
247
+ .createTable('passkeys')
248
+ .addColumn('id', 'text', col => col.primaryKey().notNull())
249
+ .addColumn('name', 'text')
250
+ .addColumn('createdAt', 'timestamptz', col => col.notNull().defaultTo(sql `now()`))
251
+ .addColumn('userId', 'uuid', col => col.notNull().references('users.id').onDelete('cascade').notNull())
252
+ .addColumn('publicKey', 'bytea', col => col.notNull())
253
+ .addColumn('counter', 'integer', col => col.notNull())
254
+ .addColumn('deviceType', 'text', col => col.notNull())
255
+ .addColumn('backedUp', 'boolean', col => col.notNull())
256
+ .addColumn('transports', sql `text[]`)
257
+ .execute()
258
+ .then(io.done)
259
+ .catch(maybeCheck('passkeys'));
260
+ await createIndex('passkeys', 'userId');
261
+ io.start('Creating schema acl');
262
+ await database.schema.createSchema('acl').execute().then(io.done).catch(warnExists);
263
+ for (const plugin of plugins) {
264
+ if (!plugin.hooks.db_init)
265
+ continue;
266
+ io.plugin(plugin.name);
267
+ await plugin.hooks.db_init(opt);
268
+ }
151
269
  }
152
- io.start('Creating table users');
153
- await database.schema
154
- .createTable('users')
155
- .addColumn('id', 'uuid', col => col.primaryKey().defaultTo(sql `gen_random_uuid()`))
156
- .addColumn('name', 'text')
157
- .addColumn('email', 'text', col => col.unique().notNull())
158
- .addColumn('emailVerified', 'timestamptz')
159
- .addColumn('image', 'text')
160
- .addColumn('isAdmin', 'boolean', col => col.notNull().defaultTo(false))
161
- .addColumn('roles', sql `text[]`, col => col.notNull().defaultTo(sql `'{}'::text[]`))
162
- .addColumn('tags', sql `text[]`, col => col.notNull().defaultTo(sql `'{}'::text[]`))
163
- .addColumn('preferences', 'jsonb', col => col.notNull().defaultTo('{}'))
164
- .addColumn('registeredAt', 'timestamptz', col => col.notNull().defaultTo(sql `now()`))
165
- .execute()
166
- .then(io.done)
167
- .catch(maybeCheck('users'));
168
- io.start('Creating table sessions');
169
- await database.schema
170
- .createTable('sessions')
171
- .addColumn('id', 'uuid', col => col.primaryKey().defaultTo(sql `gen_random_uuid()`))
172
- .addColumn('userId', 'uuid', col => col.references('users.id').onDelete('cascade').notNull())
173
- .addColumn('token', 'text', col => col.notNull().unique())
174
- .addColumn('created', 'timestamptz', col => col.notNull())
175
- .addColumn('expires', 'timestamptz', col => col.notNull())
176
- .addColumn('elevated', 'boolean', col => col.notNull())
177
- .execute()
178
- .then(io.done)
179
- .catch(maybeCheck('sessions'));
180
- await createIndex('sessions', 'id');
181
- io.start('Creating table verifications');
182
- await database.schema
183
- .createTable('verifications')
184
- .addColumn('userId', 'uuid', col => col.references('users.id').onDelete('cascade').notNull())
185
- .addColumn('token', 'text', col => col.notNull().unique())
186
- .addColumn('expires', 'timestamptz', col => col.notNull())
187
- .addColumn('role', 'text', col => col.notNull())
188
- .execute()
189
- .then(io.done)
190
- .catch(maybeCheck('verifications'));
191
- io.start('Creating table passkeys');
192
- await database.schema
193
- .createTable('passkeys')
194
- .addColumn('id', 'text', col => col.primaryKey().notNull())
195
- .addColumn('name', 'text')
196
- .addColumn('createdAt', 'timestamptz', col => col.notNull().defaultTo(sql `now()`))
197
- .addColumn('userId', 'uuid', col => col.notNull().references('users.id').onDelete('cascade').notNull())
198
- .addColumn('publicKey', 'bytea', col => col.notNull())
199
- .addColumn('counter', 'integer', col => col.notNull())
200
- .addColumn('deviceType', 'text', col => col.notNull())
201
- .addColumn('backedUp', 'boolean', col => col.notNull())
202
- .addColumn('transports', sql `text[]`)
203
- .execute()
204
- .then(io.done)
205
- .catch(maybeCheck('passkeys'));
206
- await createIndex('passkeys', 'userId');
207
- io.start('Creating schema acl');
208
- await database.schema.createSchema('acl').execute().then(io.done).catch(warnExists);
209
- for (const plugin of plugins) {
210
- if (!plugin.hooks.db_init)
211
- continue;
212
- io.plugin(plugin.name);
213
- await plugin.hooks.db_init(opt);
270
+ catch (e_1) {
271
+ env_1.error = e_1;
272
+ env_1.hasError = true;
273
+ }
274
+ finally {
275
+ const result_1 = __disposeResources(env_1);
276
+ if (result_1)
277
+ await result_1;
214
278
  }
215
279
  }
216
280
  export const expectedTypes = {
@@ -298,29 +362,41 @@ export async function checkTableTypes(tableName, types, opt) {
298
362
  io.warn(unchecked);
299
363
  }
300
364
  export async function check(opt) {
301
- await io.run('Checking for sudo', 'which sudo');
302
- await io.run('Checking for psql', 'which psql');
303
- await _sql(`SELECT 1 FROM pg_database WHERE datname = 'axium'`, 'Checking for database').then(throwUnlessRows);
304
- await _sql(`SELECT 1 FROM pg_roles WHERE rolname = 'axium'`, 'Checking for user').then(throwUnlessRows);
305
- io.start('Connecting to database');
306
- connect();
307
- io.done();
308
- io.start('Getting table metadata');
309
- opt._metadata = await database.introspection.getTables();
310
- const tables = Object.fromEntries(opt._metadata.map(t => [t.name, t]));
311
- io.done();
312
- for (const table of Object.keys(expectedTypes)) {
313
- await checkTableTypes(table, expectedTypes[table], opt);
314
- delete tables[table];
315
- }
316
- io.start('Checking for extra tables');
317
- const unchecked = Object.keys(tables).join(', ');
318
- if (!unchecked.length)
365
+ const env_2 = { stack: [], error: void 0, hasError: false };
366
+ try {
367
+ await io.run('Checking for sudo', 'which sudo');
368
+ await io.run('Checking for psql', 'which psql');
369
+ await _sql(`SELECT 1 FROM pg_database WHERE datname = 'axium'`, 'Checking for database').then(throwUnlessRows);
370
+ await _sql(`SELECT 1 FROM pg_roles WHERE rolname = 'axium'`, 'Checking for user').then(throwUnlessRows);
371
+ io.start('Connecting to database');
372
+ const _ = __addDisposableResource(env_2, connect(), true);
319
373
  io.done();
320
- else if (opt.strict)
321
- throw unchecked;
322
- else
323
- io.warn(unchecked);
374
+ io.start('Getting table metadata');
375
+ opt._metadata = await database.introspection.getTables();
376
+ const tables = Object.fromEntries(opt._metadata.map(t => [t.name, t]));
377
+ io.done();
378
+ for (const table of Object.keys(expectedTypes)) {
379
+ await checkTableTypes(table, expectedTypes[table], opt);
380
+ delete tables[table];
381
+ }
382
+ io.start('Checking for extra tables');
383
+ const unchecked = Object.keys(tables).join(', ');
384
+ if (!unchecked.length)
385
+ io.done();
386
+ else if (opt.strict)
387
+ throw unchecked;
388
+ else
389
+ io.warn(unchecked);
390
+ }
391
+ catch (e_2) {
392
+ env_2.error = e_2;
393
+ env_2.hasError = true;
394
+ }
395
+ finally {
396
+ const result_2 = __disposeResources(env_2);
397
+ if (result_2)
398
+ await result_2;
399
+ }
324
400
  }
325
401
  export async function clean(opt) {
326
402
  const now = new Date();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axium/server",
3
- "version": "0.19.2",
3
+ "version": "0.19.4",
4
4
  "author": "James Prevett <axium@jamespre.dev> (https://jamespre.dev)",
5
5
  "funding": {
6
6
  "type": "individual",
@@ -1 +0,0 @@
1
- import{l as o,a as r}from"../chunks/DC6rf2pV.js";export{o as load_css,r as start};
@@ -1,2 +0,0 @@
1
- )�import{l as o,a as r}from"../chunks/DC6rf2pV.js";export{o as load_css,r as start};
2
-