@vex-chat/spire 1.0.2 → 1.0.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.
Files changed (103) hide show
  1. package/CLA.md +38 -0
  2. package/LICENSE-COMMERCIAL +10 -0
  3. package/LICENSING.md +15 -0
  4. package/README.md +3 -2
  5. package/dist/ClientManager.d.ts +5 -0
  6. package/dist/ClientManager.js +5 -0
  7. package/dist/ClientManager.js.map +1 -1
  8. package/dist/Database.d.ts +5 -0
  9. package/dist/Database.js +5 -0
  10. package/dist/Database.js.map +1 -1
  11. package/dist/Spire.d.ts +5 -0
  12. package/dist/Spire.js +5 -11
  13. package/dist/Spire.js.map +1 -1
  14. package/dist/db/schema.d.ts +5 -0
  15. package/dist/db/schema.js +5 -0
  16. package/dist/db/schema.js.map +1 -1
  17. package/dist/index.d.ts +5 -0
  18. package/dist/index.js +5 -0
  19. package/dist/index.js.map +1 -1
  20. package/dist/middleware/validate.d.ts +5 -0
  21. package/dist/middleware/validate.js +5 -0
  22. package/dist/middleware/validate.js.map +1 -1
  23. package/dist/migrations/2026-04-06_initial-schema.d.ts +5 -0
  24. package/dist/migrations/2026-04-06_initial-schema.js +5 -0
  25. package/dist/migrations/2026-04-06_initial-schema.js.map +1 -1
  26. package/dist/migrations/2026-04-14_argon2id-password-hashing.d.ts +5 -0
  27. package/dist/migrations/2026-04-14_argon2id-password-hashing.js +5 -0
  28. package/dist/migrations/2026-04-14_argon2id-password-hashing.js.map +1 -1
  29. package/dist/run.d.ts +5 -0
  30. package/dist/run.js +5 -0
  31. package/dist/run.js.map +1 -1
  32. package/dist/server/avatar.d.ts +5 -0
  33. package/dist/server/avatar.js +5 -0
  34. package/dist/server/avatar.js.map +1 -1
  35. package/dist/server/errors.d.ts +5 -0
  36. package/dist/server/errors.js +5 -0
  37. package/dist/server/errors.js.map +1 -1
  38. package/dist/server/file.d.ts +5 -0
  39. package/dist/server/file.js +5 -0
  40. package/dist/server/file.js.map +1 -1
  41. package/dist/server/index.d.ts +5 -0
  42. package/dist/server/index.js +5 -0
  43. package/dist/server/index.js.map +1 -1
  44. package/dist/server/invite.d.ts +5 -0
  45. package/dist/server/invite.js +5 -0
  46. package/dist/server/invite.js.map +1 -1
  47. package/dist/server/openapi.d.ts +5 -0
  48. package/dist/server/openapi.js +5 -0
  49. package/dist/server/openapi.js.map +1 -1
  50. package/dist/server/permissions.d.ts +5 -0
  51. package/dist/server/permissions.js +5 -0
  52. package/dist/server/permissions.js.map +1 -1
  53. package/dist/server/rateLimit.d.ts +5 -0
  54. package/dist/server/rateLimit.js +5 -0
  55. package/dist/server/rateLimit.js.map +1 -1
  56. package/dist/server/user.d.ts +5 -0
  57. package/dist/server/user.js +5 -0
  58. package/dist/server/user.js.map +1 -1
  59. package/dist/server/utils.d.ts +5 -0
  60. package/dist/server/utils.js +5 -0
  61. package/dist/server/utils.js.map +1 -1
  62. package/dist/types/express.d.ts +5 -0
  63. package/dist/types/express.js +5 -0
  64. package/dist/types/express.js.map +1 -1
  65. package/dist/utils/createUint8UUID.d.ts +5 -0
  66. package/dist/utils/createUint8UUID.js +5 -0
  67. package/dist/utils/createUint8UUID.js.map +1 -1
  68. package/dist/utils/jwtSecret.d.ts +5 -0
  69. package/dist/utils/jwtSecret.js +5 -0
  70. package/dist/utils/jwtSecret.js.map +1 -1
  71. package/dist/utils/loadEnv.d.ts +5 -0
  72. package/dist/utils/loadEnv.js +5 -0
  73. package/dist/utils/loadEnv.js.map +1 -1
  74. package/dist/utils/msgpack.d.ts +5 -0
  75. package/dist/utils/msgpack.js +5 -0
  76. package/dist/utils/msgpack.js.map +1 -1
  77. package/package.json +8 -5
  78. package/src/ClientManager.ts +6 -0
  79. package/src/Database.ts +6 -0
  80. package/src/Spire.ts +6 -12
  81. package/src/__tests__/Database.spec.ts +6 -0
  82. package/src/ambient-modules.d.ts +6 -0
  83. package/src/db/schema.ts +6 -0
  84. package/src/index.ts +6 -0
  85. package/src/middleware/validate.ts +6 -0
  86. package/src/migrations/2026-04-06_initial-schema.ts +6 -0
  87. package/src/migrations/2026-04-14_argon2id-password-hashing.ts +6 -0
  88. package/src/run.ts +6 -0
  89. package/src/server/avatar.ts +6 -0
  90. package/src/server/errors.ts +6 -0
  91. package/src/server/file.ts +6 -0
  92. package/src/server/index.ts +6 -0
  93. package/src/server/invite.ts +6 -0
  94. package/src/server/openapi.ts +6 -0
  95. package/src/server/permissions.ts +6 -0
  96. package/src/server/rateLimit.ts +6 -0
  97. package/src/server/user.ts +6 -0
  98. package/src/server/utils.ts +6 -0
  99. package/src/types/express.ts +6 -0
  100. package/src/utils/createUint8UUID.ts +6 -0
  101. package/src/utils/jwtSecret.ts +6 -0
  102. package/src/utils/loadEnv.ts +6 -0
  103. package/src/utils/msgpack.ts +6 -0
package/package.json CHANGED
@@ -1,12 +1,15 @@
1
1
  {
2
2
  "name": "@vex-chat/spire",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "Vex server implementation in NodeJS.",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist",
8
8
  "src",
9
- "LICENSE"
9
+ "LICENSE",
10
+ "LICENSE-COMMERCIAL",
11
+ "LICENSING.md",
12
+ "CLA.md"
10
13
  ],
11
14
  "author": "Extra <extrahash@protonmail.com>",
12
15
  "license": "AGPL-3.0-or-later",
@@ -37,7 +40,6 @@
37
40
  "stress:llm-triage": "node --experimental-strip-types scripts/stress/stress-llm-triage.ts",
38
41
  "gen-spk": "node scripts/gen-spk.js",
39
42
  "docs": "node ./scripts/generate-docs.js",
40
- "license:check": "node scripts/fix-license-checker.mjs && npx @onebeyond/license-checker scan --allowOnly MIT MIT-0 ISC BSD-2-Clause BSD-3-Clause Apache-2.0 0BSD MPL-2.0 CC0-1.0 CC-BY-3.0 CC-BY-4.0 Unlicense BlueOak-1.0.0 Python-2.0 Zlib PSF-2.0 Artistic-2.0 AGPL-3.0-or-later WTFPL \"(MIT AND CC-BY-3.0)\" --ignoreRootPackageLicense --disableReport",
41
43
  "service:status-monitor": "node ./services/status-monitor/index.js",
42
44
  "service:status-monitor:clear-history": "node ./services/status-monitor/clear-history.js",
43
45
  "service:deploy-hook": "node ./services/deploy-hook/index.js",
@@ -45,7 +47,7 @@
45
47
  },
46
48
  "devDependencies": {
47
49
  "@changesets/cli": "2.30.0",
48
- "@onebeyond/license-checker": "2.2.0",
50
+ "@socketsecurity/cli": "1.1.84",
49
51
  "@types/better-sqlite3": "7.6.13",
50
52
  "@types/cors": "2.8.19",
51
53
  "@types/express": "5.0.6",
@@ -55,7 +57,7 @@
55
57
  "@types/node": "25.6.0",
56
58
  "@types/uuid": "10.0.0",
57
59
  "@types/ws": "8.18.1",
58
- "@vex-chat/libvex": "5.1.0",
60
+ "@vex-chat/libvex": "5.2.0",
59
61
  "@vitest/eslint-plugin": "1.6.15",
60
62
  "axios": "1.15.0",
61
63
  "eslint": "10.2.0",
@@ -64,6 +66,7 @@
64
66
  "eslint-plugin-perfectionist": "5.8.0",
65
67
  "husky": "9.1.7",
66
68
  "lint-staged": "16.4.0",
69
+ "npm-package-json-lint": "10.2.1",
67
70
  "prettier": "3.8.2",
68
71
  "type-coverage": "2.29.7",
69
72
  "typedoc": "0.28.18",
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Copyright (c) 2020-2026 Vex Heavy Industries LLC
3
+ * Licensed under AGPL-3.0. See LICENSE for details.
4
+ * Commercial licenses available at vex.wtf
5
+ */
6
+
1
7
  import type { Database } from "./Database.ts";
2
8
  import type {
3
9
  BaseMsg,
package/src/Database.ts CHANGED
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Copyright (c) 2020-2026 Vex Heavy Industries LLC
3
+ * Licensed under AGPL-3.0. See LICENSE for details.
4
+ * Commercial licenses available at vex.wtf
5
+ */
6
+
1
7
  import type { ServerDatabase } from "./db/schema.ts";
2
8
  import type { SpireOptions } from "./Spire.ts";
3
9
  import type {
package/src/Spire.ts CHANGED
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Copyright (c) 2020-2026 Vex Heavy Industries LLC
3
+ * Licensed under AGPL-3.0. See LICENSE for details.
4
+ * Commercial licenses available at vex.wtf
5
+ */
6
+
1
7
  import type { ActionToken, BaseMsg, NotifyMsg, User } from "@vex-chat/types";
2
8
  import type { Server } from "http";
3
9
 
@@ -42,7 +48,6 @@ export const TOKEN_EXPIRY = 1000 * 60 * 10;
42
48
  export const JWT_EXPIRY = "7d";
43
49
  export const DEVICE_AUTH_JWT_EXPIRY = "1h";
44
50
  const DEVICE_CHALLENGE_EXPIRY = 1000 * 60; // 60 seconds
45
- const STATUS_LATENCY_BUDGET_MS = 250;
46
51
 
47
52
  // 3-19 chars long
48
53
  const usernameRegex = /^(\w{3,19})$/;
@@ -440,20 +445,9 @@ export class Spire extends EventEmitter {
440
445
  canaryEnv === "true" ||
441
446
  canaryEnv === "yes",
442
447
  checkDurationMs,
443
- commitSha: this.commitSha,
444
- dbHealthy,
445
- dbReady: this.dbReady,
446
- latencyBudgetMs: STATUS_LATENCY_BUDGET_MS,
447
- metrics: {
448
- requestsTotal: this.requestsTotal,
449
- },
450
448
  now: new Date(),
451
449
  ok,
452
- startedAt: this.startedAt.toISOString(),
453
- uptimeSeconds: Math.floor(process.uptime()),
454
450
  version: this.version,
455
- withinLatencyBudget:
456
- checkDurationMs <= STATUS_LATENCY_BUDGET_MS,
457
451
  });
458
452
  });
459
453
 
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Copyright (c) 2020-2026 Vex Heavy Industries LLC
3
+ * Licensed under AGPL-3.0. See LICENSE for details.
4
+ * Commercial licenses available at vex.wtf
5
+ */
6
+
1
7
  import type { SpireOptions } from "../Spire.ts";
2
8
  import type { PreKeysWS } from "@vex-chat/types";
3
9
 
@@ -1 +1,7 @@
1
+ /**
2
+ * Copyright (c) 2020-2026 Vex Heavy Industries LLC
3
+ * Licensed under AGPL-3.0. See LICENSE for details.
4
+ * Commercial licenses available at vex.wtf
5
+ */
6
+
1
7
  declare module "ed2curve";
package/src/db/schema.ts CHANGED
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Copyright (c) 2020-2026 Vex Heavy Industries LLC
3
+ * Licensed under AGPL-3.0. See LICENSE for details.
4
+ * Commercial licenses available at vex.wtf
5
+ */
6
+
1
7
  import type { Insertable, Selectable, Updateable } from "kysely";
2
8
 
3
9
  // ── Table interfaces ────────────────────────────────────────────────────
package/src/index.ts CHANGED
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Copyright (c) 2020-2026 Vex Heavy Industries LLC
3
+ * Licensed under AGPL-3.0. See LICENSE for details.
4
+ * Commercial licenses available at vex.wtf
5
+ */
6
+
1
7
  import { Spire } from "./Spire.ts";
2
8
 
3
9
  export { Spire };
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Copyright (c) 2020-2026 Vex Heavy Industries LLC
3
+ * Licensed under AGPL-3.0. See LICENSE for details.
4
+ * Commercial licenses available at vex.wtf
5
+ */
6
+
1
7
  import type { NextFunction, Request, Response } from "express";
2
8
  import type { z } from "zod/v4";
3
9
 
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Copyright (c) 2020-2026 Vex Heavy Industries LLC
3
+ * Licensed under AGPL-3.0. See LICENSE for details.
4
+ * Commercial licenses available at vex.wtf
5
+ */
6
+
1
7
  import { type Kysely, sql } from "kysely";
2
8
 
3
9
  export async function down(db: Kysely<unknown>): Promise<void> {
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Copyright (c) 2020-2026 Vex Heavy Industries LLC
3
+ * Licensed under AGPL-3.0. See LICENSE for details.
4
+ * Commercial licenses available at vex.wtf
5
+ */
6
+
1
7
  import { type Kysely, sql } from "kysely";
2
8
 
3
9
  export async function down(db: Kysely<unknown>): Promise<void> {
package/src/run.ts CHANGED
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Copyright (c) 2020-2026 Vex Heavy Industries LLC
3
+ * Licensed under AGPL-3.0. See LICENSE for details.
4
+ * Commercial licenses available at vex.wtf
5
+ */
6
+
1
7
  import type { SpireOptions } from "./Spire.ts";
2
8
 
3
9
  import { Spire } from "./Spire.ts";
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Copyright (c) 2020-2026 Vex Heavy Industries LLC
3
+ * Licensed under AGPL-3.0. See LICENSE for details.
4
+ * Commercial licenses available at vex.wtf
5
+ */
6
+
1
7
  import * as fs from "node:fs";
2
8
  import * as fsp from "node:fs/promises";
3
9
 
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Copyright (c) 2020-2026 Vex Heavy Industries LLC
3
+ * Licensed under AGPL-3.0. See LICENSE for details.
4
+ * Commercial licenses available at vex.wtf
5
+ */
6
+
1
7
  /**
2
8
  * Centralized HTTP error handling.
3
9
  *
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Copyright (c) 2020-2026 Vex Heavy Industries LLC
3
+ * Licensed under AGPL-3.0. See LICENSE for details.
4
+ * Commercial licenses available at vex.wtf
5
+ */
6
+
1
7
  import type { Database } from "../Database.ts";
2
8
  import type { FileSQL } from "@vex-chat/types";
3
9
 
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Copyright (c) 2020-2026 Vex Heavy Industries LLC
3
+ * Licensed under AGPL-3.0. See LICENSE for details.
4
+ * Commercial licenses available at vex.wtf
5
+ */
6
+
1
7
  import type { Database } from "../Database.ts";
2
8
  import type { Emoji } from "@vex-chat/types";
3
9
 
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Copyright (c) 2020-2026 Vex Heavy Industries LLC
3
+ * Licensed under AGPL-3.0. See LICENSE for details.
4
+ * Commercial licenses available at vex.wtf
5
+ */
6
+
1
7
  import type { Database } from "../Database.ts";
2
8
  import type { TokenScopes } from "@vex-chat/types";
3
9
 
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Copyright (c) 2020-2026 Vex Heavy Industries LLC
3
+ * Licensed under AGPL-3.0. See LICENSE for details.
4
+ * Commercial licenses available at vex.wtf
5
+ */
6
+
1
7
  /**
2
8
  * API documentation endpoints (development only).
3
9
  *
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Copyright (c) 2020-2026 Vex Heavy Industries LLC
3
+ * Licensed under AGPL-3.0. See LICENSE for details.
4
+ * Commercial licenses available at vex.wtf
5
+ */
6
+
1
7
  import type { Permission } from "@vex-chat/types";
2
8
 
3
9
  /**
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Copyright (c) 2020-2026 Vex Heavy Industries LLC
3
+ * Licensed under AGPL-3.0. See LICENSE for details.
4
+ * Commercial licenses available at vex.wtf
5
+ */
6
+
1
7
  import type { Request } from "express";
2
8
 
3
9
  import { timingSafeEqual } from "node:crypto";
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Copyright (c) 2020-2026 Vex Heavy Industries LLC
3
+ * Licensed under AGPL-3.0. See LICENSE for details.
4
+ * Commercial licenses available at vex.wtf
5
+ */
6
+
1
7
  import type { Database } from "../Database.ts";
2
8
 
3
9
  import express from "express";
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Copyright (c) 2020-2026 Vex Heavy Industries LLC
3
+ * Licensed under AGPL-3.0. See LICENSE for details.
4
+ * Commercial licenses available at vex.wtf
5
+ */
6
+
1
7
  import type { Device, User, UserRecord } from "@vex-chat/types";
2
8
  import type { Request } from "express";
3
9
 
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Copyright (c) 2020-2026 Vex Heavy Industries LLC
3
+ * Licensed under AGPL-3.0. See LICENSE for details.
4
+ * Commercial licenses available at vex.wtf
5
+ */
6
+
1
7
  import type { Device, User } from "@vex-chat/types";
2
8
 
3
9
  /**
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Copyright (c) 2020-2026 Vex Heavy Industries LLC
3
+ * Licensed under AGPL-3.0. See LICENSE for details.
4
+ * Commercial licenses available at vex.wtf
5
+ */
6
+
1
7
  import { parse as uuidParse } from "uuid";
2
8
 
3
9
  export function createUint8UUID(): Uint8Array {
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Copyright (c) 2020-2026 Vex Heavy Industries LLC
3
+ * Licensed under AGPL-3.0. See LICENSE for details.
4
+ * Commercial licenses available at vex.wtf
5
+ */
6
+
1
7
  /**
2
8
  * Returns the dedicated JWT HMAC signing secret.
3
9
  *
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Copyright (c) 2020-2026 Vex Heavy Industries LLC
3
+ * Licensed under AGPL-3.0. See LICENSE for details.
4
+ * Commercial licenses available at vex.wtf
5
+ */
6
+
1
7
  import { config } from "dotenv";
2
8
 
3
9
  /* Populate process.env with vars from .env and verify required vars are present. */
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Copyright (c) 2020-2026 Vex Heavy Industries LLC
3
+ * Licensed under AGPL-3.0. See LICENSE for details.
4
+ * Commercial licenses available at vex.wtf
5
+ */
6
+
1
7
  import { Packr } from "msgpackr";
2
8
 
3
9
  // Standard msgpack encoder/decoder configured for broad compatibility.