@terreno/api 57.19.2 → 57.21.0

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 (259) hide show
  1. package/CHANGELOG.md +443 -0
  2. package/biome.jsonc +1 -0
  3. package/dist/accountSecurity/accessActions.d.ts +38 -0
  4. package/dist/accountSecurity/accessActions.js +157 -0
  5. package/dist/accountSecurity/accountSecurityApp.d.ts +219 -0
  6. package/dist/accountSecurity/accountSecurityApp.js +438 -0
  7. package/dist/accountSecurity/accountSecurityService.d.ts +200 -0
  8. package/dist/accountSecurity/accountSecurityService.js +481 -0
  9. package/dist/accountSecurity/credentialActions.d.ts +16 -0
  10. package/dist/accountSecurity/credentialActions.js +189 -0
  11. package/dist/accountSecurity/membershipActions.d.ts +15 -0
  12. package/dist/accountSecurity/membershipActions.js +81 -0
  13. package/dist/accountSecurity/orgSecurityRoutes.d.ts +50 -0
  14. package/dist/accountSecurity/orgSecurityRoutes.js +149 -0
  15. package/dist/accountSecurity/securityEventHooks.d.ts +44 -0
  16. package/dist/accountSecurity/securityEventHooks.js +223 -0
  17. package/dist/accountSecurity/securityEvents.d.ts +162 -0
  18. package/dist/accountSecurity/securityEvents.js +114 -0
  19. package/dist/accountSecurity/securityNotifications.d.ts +125 -0
  20. package/dist/accountSecurity/securityNotifications.js +333 -0
  21. package/dist/api.d.ts +3 -3
  22. package/dist/api.js +38 -6
  23. package/dist/audit/auditEventModel.d.ts +5 -3
  24. package/dist/audit/auditEventModel.js +8 -6
  25. package/dist/audit/processQueue.js +4 -2
  26. package/dist/audit/record.d.ts +2 -2
  27. package/dist/audit/record.js +3 -0
  28. package/dist/authRecovery.js +29 -1
  29. package/dist/betterAuth.d.ts +179 -10
  30. package/dist/betterAuthApp.d.ts +15 -0
  31. package/dist/betterAuthApp.js +23 -0
  32. package/dist/betterAuthChallengeHeaders.d.ts +37 -0
  33. package/dist/betterAuthChallengeHeaders.js +180 -0
  34. package/dist/betterAuthFeatures.d.ts +54 -0
  35. package/dist/betterAuthFeatures.js +239 -0
  36. package/dist/betterAuthMethods.d.ts +73 -0
  37. package/dist/betterAuthMethods.js +55 -0
  38. package/dist/betterAuthOAuthHandoff.d.ts +10 -2
  39. package/dist/betterAuthOAuthHandoff.js +222 -24
  40. package/dist/betterAuthSetPassword.d.ts +33 -0
  41. package/dist/betterAuthSetPassword.js +166 -0
  42. package/dist/betterAuthSetup.d.ts +57 -8
  43. package/dist/betterAuthSetup.js +327 -36
  44. package/dist/consentApp.d.ts +9 -4
  45. package/dist/consentApp.js +344 -28
  46. package/dist/consentStatus.d.ts +60 -0
  47. package/dist/consentStatus.js +111 -0
  48. package/dist/errors.d.ts +6 -0
  49. package/dist/errors.js +41 -2
  50. package/dist/expressServer.js +3 -2
  51. package/dist/frameworkModelNames.d.ts +4 -0
  52. package/dist/frameworkModelNames.js +4 -0
  53. package/dist/index.d.ts +18 -2
  54. package/dist/index.js +29 -3
  55. package/dist/mcp/adminTracking.d.ts +28 -0
  56. package/dist/mcp/adminTracking.js +80 -0
  57. package/dist/mcp/auth.d.ts +6 -0
  58. package/dist/mcp/auth.js +12 -2
  59. package/dist/mcp/oauth.js +151 -11
  60. package/dist/mcp/oauthMetadata.d.ts +2 -1
  61. package/dist/mcp/oauthMetadata.js +7 -4
  62. package/dist/mcp/server.d.ts +8 -0
  63. package/dist/mcp/server.js +48 -4
  64. package/dist/models/consentResponse.js +51 -0
  65. package/dist/models/mcpOAuthClient.js +78 -2
  66. package/dist/models/mcpOAuthToken.js +55 -4
  67. package/dist/models/mcpRequestLog.d.ts +2 -0
  68. package/dist/models/mcpRequestLog.js +73 -0
  69. package/dist/models/mcpServiceToken.js +4 -0
  70. package/dist/models/mcpToolSetting.d.ts +2 -0
  71. package/dist/models/mcpToolSetting.js +119 -0
  72. package/dist/models/versionConfig.d.ts +2 -0
  73. package/dist/orgs/membershipGuards.d.ts +7 -0
  74. package/dist/orgs/membershipGuards.js +32 -0
  75. package/dist/orgs/orgsApp.d.ts +19 -1
  76. package/dist/orgs/orgsApp.js +55 -24
  77. package/dist/rateLimit/policies.js +8 -0
  78. package/dist/rbac/access.js +2 -1
  79. package/dist/rbac/auditModel.d.ts +2 -1
  80. package/dist/rbac/resolve.d.ts +9 -1
  81. package/dist/rbac/resolve.js +21 -16
  82. package/dist/rbac/roleManager.d.ts +6 -0
  83. package/dist/rbac/roleManager.js +8 -7
  84. package/dist/rbac/roleModel.d.ts +1 -0
  85. package/dist/rbac/roleModel.js +45 -3
  86. package/dist/rbac/statements.d.ts +2 -2
  87. package/dist/rbac/statements.js +10 -1
  88. package/dist/rbac/types.d.ts +6 -0
  89. package/dist/rbac/userWriteGuards.js +2 -1
  90. package/dist/schemaMetadata.js +8 -1
  91. package/dist/seedRunner.js +7 -2
  92. package/dist/terrenoApp.d.ts +16 -0
  93. package/dist/terrenoApp.js +18 -0
  94. package/dist/tests/models.d.ts +22 -22
  95. package/dist/tests/models.js +15 -1
  96. package/dist/tests/testHelper.d.ts +6 -12
  97. package/dist/tests.d.ts +1 -0
  98. package/dist/tests.js +3 -1
  99. package/dist/types/consentResponse.d.ts +8 -0
  100. package/dist/types/mcpAdmin.d.ts +58 -0
  101. package/dist/types/mcpAdmin.js +2 -0
  102. package/dist/types/mcpOAuth.d.ts +37 -2
  103. package/dist/types/mcpServiceToken.d.ts +2 -0
  104. package/e2e/smoke.ts +193 -0
  105. package/package.json +10 -5
  106. package/src/__snapshots__/openApi.test.ts.snap +288 -0
  107. package/src/__snapshots__/openApiBuilder.test.ts.snap +96 -0
  108. package/src/accountSecurity/accessActions.test.ts +723 -0
  109. package/src/accountSecurity/accessActions.ts +173 -0
  110. package/src/accountSecurity/accountSecurity.test.ts +947 -0
  111. package/src/accountSecurity/accountSecurityApp.ts +720 -0
  112. package/src/accountSecurity/accountSecurityService.ts +826 -0
  113. package/src/accountSecurity/credentialActions.test.ts +867 -0
  114. package/src/accountSecurity/credentialActions.ts +260 -0
  115. package/src/accountSecurity/membershipActions.ts +89 -0
  116. package/src/accountSecurity/orgSecurityRoutes.test.ts +841 -0
  117. package/src/accountSecurity/orgSecurityRoutes.ts +232 -0
  118. package/src/accountSecurity/securityEventHooks.ts +294 -0
  119. package/src/accountSecurity/securityEvents.ts +165 -0
  120. package/src/accountSecurity/securityNotifications.test.ts +1323 -0
  121. package/src/accountSecurity/securityNotifications.ts +516 -0
  122. package/src/adminModelRouter.test.ts +8 -6
  123. package/src/api.arrayOperations.test.ts +102 -22
  124. package/src/api.hooks.test.ts +12 -11
  125. package/src/api.query.test.ts +2 -2
  126. package/src/api.test.ts +8 -7
  127. package/src/api.ts +41 -10
  128. package/src/audit/auditApp.test.ts +1 -1
  129. package/src/audit/auditEventModel.ts +10 -7
  130. package/src/audit/cloudTasksEnqueue.test.ts +19 -14
  131. package/src/audit/processQueue.ts +4 -2
  132. package/src/audit/record.test.ts +15 -0
  133. package/src/audit/record.ts +10 -2
  134. package/src/auth.test.ts +21 -7
  135. package/src/authRecovery.test.ts +33 -10
  136. package/src/authRecovery.ts +34 -1
  137. package/src/authRecoveryBetterAuth.test.ts +169 -0
  138. package/src/authVerification.test.ts +7 -7
  139. package/src/betterAuth.ts +194 -8
  140. package/src/betterAuthApp.ts +32 -0
  141. package/src/betterAuthChallengeHeaders.test.ts +476 -0
  142. package/src/betterAuthChallengeHeaders.ts +227 -0
  143. package/src/betterAuthFeatures.test.ts +490 -0
  144. package/src/betterAuthFeatures.ts +283 -0
  145. package/src/betterAuthLinking.test.ts +846 -0
  146. package/src/betterAuthMethods.test.ts +138 -0
  147. package/src/betterAuthMethods.ts +98 -0
  148. package/src/betterAuthOAuthHandoff.test.ts +482 -69
  149. package/src/betterAuthOAuthHandoff.ts +293 -33
  150. package/src/betterAuthOAuthProxy.test.ts +421 -0
  151. package/src/betterAuthPasswordReset.test.ts +190 -0
  152. package/src/betterAuthSetPassword.test.ts +378 -0
  153. package/src/betterAuthSetPassword.ts +213 -0
  154. package/src/betterAuthSetup.test.ts +115 -57
  155. package/src/betterAuthSetup.ts +457 -38
  156. package/src/collectionRegistry.test.ts +4 -4
  157. package/src/consentApp.test.ts +869 -2
  158. package/src/consentApp.ts +438 -36
  159. package/src/consentStatus.test.ts +226 -0
  160. package/src/consentStatus.ts +171 -0
  161. package/src/errors.test.ts +81 -0
  162. package/src/errors.ts +50 -1
  163. package/src/expressServer.test.ts +29 -0
  164. package/src/expressServer.ts +3 -2
  165. package/src/frameworkModelNames.test.ts +8 -0
  166. package/src/frameworkModelNames.ts +4 -0
  167. package/src/githubAuth.test.ts +11 -11
  168. package/src/index.ts +38 -0
  169. package/src/isolated/migrateCliConnect.isolated.ts +3 -2
  170. package/src/mcp/actionTools.test.ts +11 -5
  171. package/src/mcp/adminTracking.test.ts +272 -0
  172. package/src/mcp/adminTracking.ts +104 -0
  173. package/src/mcp/auth.ts +18 -2
  174. package/src/mcp/oauth.test.ts +463 -2
  175. package/src/mcp/oauth.ts +184 -13
  176. package/src/mcp/oauthMetadata.ts +5 -2
  177. package/src/mcp/server.ts +67 -4
  178. package/src/mcp/serviceTokens.test.ts +2 -1
  179. package/src/mcp/toolGenerator.test.ts +9 -5
  180. package/src/migrations/cli.test.ts +15 -14
  181. package/src/migrations/cli.ts +1 -1
  182. package/src/migrations/generate.test.ts +2 -2
  183. package/src/migrations/load.test.ts +1 -1
  184. package/src/migrations/lock.test.ts +8 -3
  185. package/src/migrations/runner.test.ts +16 -5
  186. package/src/migrations/schemaCatalog.test.ts +4 -1
  187. package/src/models/consentResponse.ts +53 -0
  188. package/src/models/mcpOAuthClient.ts +100 -3
  189. package/src/models/mcpOAuthToken.test.ts +42 -0
  190. package/src/models/mcpOAuthToken.ts +62 -5
  191. package/src/models/mcpRequestLog.ts +81 -0
  192. package/src/models/mcpServiceToken.test.ts +23 -0
  193. package/src/models/mcpServiceToken.ts +10 -0
  194. package/src/models/mcpToolSetting.test.ts +69 -0
  195. package/src/models/mcpToolSetting.ts +138 -0
  196. package/src/models/versionConfig.ts +2 -0
  197. package/src/notifications/notificationsApp.test.ts +5 -8
  198. package/src/notifiers/slackWebApi.test.ts +30 -8
  199. package/src/openApi.test.ts +4 -4
  200. package/src/openApiValidator.test.ts +3 -3
  201. package/src/orgs/membershipGuards.ts +39 -0
  202. package/src/orgs/orgPermissions.test.ts +2 -2
  203. package/src/orgs/orgPlugin.test.ts +4 -3
  204. package/src/orgs/orgRbac.test.ts +1 -1
  205. package/src/orgs/orgSecurityDefects.test.ts +3 -1
  206. package/src/orgs/organizationSettings.test.ts +1 -1
  207. package/src/orgs/orgsApp.test.ts +104 -3
  208. package/src/orgs/orgsApp.ts +69 -28
  209. package/src/permissions.test.ts +2 -2
  210. package/src/rateLimit/policies.test.ts +53 -0
  211. package/src/rateLimit/policies.ts +8 -0
  212. package/src/rateLimit/redisStore.ioredis.test.ts +3 -2
  213. package/src/rbac/access.ts +4 -1
  214. package/src/rbac/assertAllowed.test.ts +1 -1
  215. package/src/rbac/auditModel.ts +10 -2
  216. package/src/rbac/realtimeAccess.test.ts +3 -2
  217. package/src/rbac/resolve.test.ts +65 -0
  218. package/src/rbac/resolve.ts +37 -17
  219. package/src/rbac/roleManager.test.ts +64 -0
  220. package/src/rbac/roleManager.ts +15 -6
  221. package/src/rbac/roleModel.test.ts +174 -1
  222. package/src/rbac/roleModel.ts +66 -3
  223. package/src/rbac/routes.test.ts +58 -0
  224. package/src/rbac/statements.test.ts +4 -1
  225. package/src/rbac/statements.ts +11 -1
  226. package/src/rbac/types.ts +6 -1
  227. package/src/rbac/userWriteGuards.test.ts +56 -5
  228. package/src/rbac/userWriteGuards.ts +5 -2
  229. package/src/realtime/realtime.test.ts +35 -31
  230. package/src/schemaMetadata.test.ts +39 -0
  231. package/src/schemaMetadata.ts +11 -1
  232. package/src/scrubAdminFields.test.ts +1 -1
  233. package/src/seedRunner.test.ts +56 -0
  234. package/src/seedRunner.ts +7 -2
  235. package/src/sync/adminWindowMutation.test.ts +4 -3
  236. package/src/sync/executors.test.ts +1 -1
  237. package/src/sync/scripts/compactTombstones.test.ts +4 -3
  238. package/src/sync/sync.test.ts +1 -1
  239. package/src/sync/syncPhaseC.test.ts +14 -11
  240. package/src/sync/syncRoutes.test.ts +8 -8
  241. package/src/sync/syncSeqPlugin.test.ts +1 -2
  242. package/src/sync/syncSocket.test.ts +5 -4
  243. package/src/terrenoApp.mcpServiceTokens.test.ts +2 -2
  244. package/src/terrenoApp.migrations.test.ts +8 -7
  245. package/src/terrenoApp.ts +34 -0
  246. package/src/tests/accountSecurityTestApp.ts +290 -0
  247. package/src/tests/betterAuthStubs.ts +189 -0
  248. package/src/tests/bunSetup.ts +1 -1
  249. package/src/tests/mockOidcProvider.ts +105 -0
  250. package/src/tests/models.ts +23 -0
  251. package/src/tests/softwareAuthenticator.ts +183 -0
  252. package/src/tests/testEnv.ts +7 -0
  253. package/src/tests.ts +1 -0
  254. package/src/types/consentResponse.ts +8 -0
  255. package/src/types/mcpAdmin.ts +80 -0
  256. package/src/types/mcpOAuth.ts +44 -3
  257. package/src/types/mcpServiceToken.ts +5 -0
  258. package/src/webhooks/verifiers/hmac.test.ts +1 -1
  259. package/tsconfig.typecheck.json +14 -0
package/e2e/smoke.ts ADDED
@@ -0,0 +1,193 @@
1
+ /**
2
+ * Real-process smoke for @terreno/api. Run `bun e2e/smoke.ts` after `bun run compile`.
3
+ *
4
+ * The smoke re-runs this file with `serve` as a child process: a minimal TerrenoApp built from
5
+ * the compiled package with one modelRouter model, on a free port, against `smokeMongoUri()`.
6
+ * The parent then checks over real HTTP that `/health` answers, a user can sign up, and that
7
+ * user can create and list a document. Exits non-zero on the first failed check.
8
+ */
9
+ import {
10
+ freePort,
11
+ type SpawnedProcess,
12
+ smokeMongoUri,
13
+ spawnUntilReady,
14
+ stopSmokeMongo,
15
+ } from "@terreno/test";
16
+ import type express from "express";
17
+ import {DateTime} from "luxon";
18
+ import type {Schema} from "mongoose";
19
+
20
+ const SERVE_ARG = "serve";
21
+
22
+ interface SmokeWidget {
23
+ _id: string;
24
+ name: string;
25
+ ownerId: string;
26
+ }
27
+
28
+ /**
29
+ * Child: the compiled API with auth, one owner-scoped model, and a health plugin. The API is
30
+ * imported here, not at the top, so the parent process never loads it.
31
+ */
32
+ const serve = async (): Promise<void> => {
33
+ const {createdUpdatedPlugin, logger, modelRouter, OwnerQueryFilter, Permissions, TerrenoApp} =
34
+ await import("@terreno/api");
35
+ const {default: mongoose} = await import("mongoose");
36
+ const {default: passportLocalMongoose} = await import("passport-local-mongoose");
37
+
38
+ const userSchema = new mongoose.Schema({
39
+ admin: {default: false, description: "Whether the user is an admin", type: Boolean},
40
+ email: {description: "Sign-in email", type: String},
41
+ name: {description: "Display name", type: String},
42
+ });
43
+ userSchema.plugin(passportLocalMongoose as unknown as (schema: Schema, options: object) => void, {
44
+ usernameCaseInsensitive: true,
45
+ usernameField: "email",
46
+ });
47
+ userSchema.plugin(createdUpdatedPlugin);
48
+ const User = mongoose.model("User", userSchema);
49
+
50
+ const widgetSchema = new mongoose.Schema({
51
+ name: {description: "Widget name", required: true, type: String},
52
+ ownerId: {description: "User who owns the widget", ref: "User", type: String},
53
+ });
54
+ widgetSchema.plugin(createdUpdatedPlugin);
55
+ const Widget = mongoose.model("Widget", widgetSchema);
56
+
57
+ const widgetRouter = modelRouter("/widgets", Widget, {
58
+ permissions: {
59
+ create: [Permissions.IsAuthenticated],
60
+ delete: [],
61
+ list: [Permissions.IsAuthenticated],
62
+ read: [Permissions.IsOwner],
63
+ update: [],
64
+ },
65
+ preCreate: (body, req) => {
66
+ const user = req.user as unknown as {_id: string};
67
+ return {...(body as {name: string}), ownerId: String(user._id)};
68
+ },
69
+ queryFilter: OwnerQueryFilter,
70
+ });
71
+
72
+ const healthPlugin = {
73
+ register: (app: express.Application): void => {
74
+ app.get("/health", (_req, res) => {
75
+ res.json({healthy: mongoose.connection.readyState === 1});
76
+ });
77
+ },
78
+ };
79
+
80
+ await mongoose.connect(process.env.MONGO_URI as string);
81
+ const app = new TerrenoApp({
82
+ loggingOptions: {logRequests: false},
83
+ userModel: User as unknown as ConstructorParameters<typeof TerrenoApp>[0]["userModel"],
84
+ })
85
+ .register(widgetRouter)
86
+ .register(healthPlugin);
87
+ app.start();
88
+ await app.whenReady();
89
+ logger.info(`[apiSmoke] serving on port ${process.env.PORT}`);
90
+ };
91
+
92
+ const expectStatus = async (res: Response, status: number, step: string): Promise<unknown> => {
93
+ const body = await res.text();
94
+ if (res.status !== status) {
95
+ throw new Error(`${step}: expected ${status}, got ${res.status}: ${body}`);
96
+ }
97
+ return body ? JSON.parse(body) : undefined;
98
+ };
99
+
100
+ /** Parent: boots the child and walks the happy path over HTTP. */
101
+ const run = async (): Promise<void> => {
102
+ const startedAt = DateTime.now();
103
+ const port = await freePort();
104
+ const baseUrl = `http://127.0.0.1:${port}`;
105
+ let server: SpawnedProcess | undefined;
106
+
107
+ try {
108
+ server = await spawnUntilReady({
109
+ cmd: [process.execPath, __filename, SERVE_ARG],
110
+ env: {
111
+ MONGO_URI: await smokeMongoUri({databaseName: "apiSmoke"}),
112
+ PORT: String(port),
113
+ REFRESH_TOKEN_SECRET: "api-smoke-refresh-secret",
114
+ SESSION_SECRET: "api-smoke-session-secret",
115
+ TOKEN_ISSUER: "api-smoke",
116
+ TOKEN_SECRET: "api-smoke-token-secret",
117
+ },
118
+ timeoutMs: 20000,
119
+ url: `${baseUrl}/health`,
120
+ });
121
+
122
+ const health = (await expectStatus(await fetch(`${baseUrl}/health`), 200, "GET /health")) as {
123
+ healthy: boolean;
124
+ };
125
+ if (!health.healthy) {
126
+ throw new Error("GET /health: server reports unhealthy");
127
+ }
128
+ console.info("✅ GET /health is healthy");
129
+
130
+ const email = `api-smoke-${startedAt.toMillis()}@example.com`;
131
+ const signup = (await expectStatus(
132
+ await fetch(`${baseUrl}/auth/signup`, {
133
+ body: JSON.stringify({email, password: "api-smoke-password-1"}),
134
+ headers: {"Content-Type": "application/json"},
135
+ method: "POST",
136
+ }),
137
+ 200,
138
+ "POST /auth/signup"
139
+ )) as {data: {token: string; userId: string}};
140
+ const headers = {
141
+ Authorization: `Bearer ${signup.data.token}`,
142
+ "Content-Type": "application/json",
143
+ };
144
+ console.info("✅ POST /auth/signup returns a token");
145
+
146
+ const created = (await expectStatus(
147
+ await fetch(`${baseUrl}/widgets`, {
148
+ body: JSON.stringify({name: "Smoke widget"}),
149
+ headers,
150
+ method: "POST",
151
+ }),
152
+ 201,
153
+ "POST /widgets"
154
+ )) as {data: SmokeWidget};
155
+ if (created.data.ownerId !== String(signup.data.userId)) {
156
+ throw new Error(`POST /widgets: ownerId ${created.data.ownerId} is not the new user`);
157
+ }
158
+ console.info("✅ POST /widgets creates an owned widget");
159
+
160
+ const listed = (await expectStatus(
161
+ await fetch(`${baseUrl}/widgets`, {headers}),
162
+ 200,
163
+ "GET /widgets"
164
+ )) as {data: SmokeWidget[]};
165
+ if (!listed.data.some((widget) => widget._id === created.data._id)) {
166
+ throw new Error("GET /widgets: the created widget is missing from the list");
167
+ }
168
+ console.info("✅ GET /widgets lists it");
169
+ } catch (error: unknown) {
170
+ if (server) {
171
+ console.error(`--- server output ---\n${server.output()}`);
172
+ }
173
+ throw error;
174
+ } finally {
175
+ await server?.stop();
176
+ await stopSmokeMongo();
177
+ }
178
+
179
+ console.info(`api smoke passed in ${DateTime.now().diff(startedAt).toMillis()} ms`);
180
+ };
181
+
182
+ const main = process.argv[2] === SERVE_ARG ? serve : run;
183
+ main().then(
184
+ () => {
185
+ if (main === run) {
186
+ process.exit(0);
187
+ }
188
+ },
189
+ (error: unknown) => {
190
+ console.error(`❌ ${error instanceof Error ? error.message : String(error)}`);
191
+ process.exit(1);
192
+ }
193
+ );
package/package.json CHANGED
@@ -8,10 +8,12 @@
8
8
  },
9
9
  "dependencies": {
10
10
  "@asteasolutions/zod-to-openapi": "^8.5.0",
11
+ "@better-auth/expo": "^1.6.25",
12
+ "@better-auth/passkey": "1.7.4",
11
13
  "@modelcontextprotocol/node": "^2.0.0",
12
14
  "@modelcontextprotocol/server": "^2.0.0",
13
15
  "@sentry/bun": "^10.39.0",
14
- "@terreno/test": "57.19.2",
16
+ "@terreno/test": "57.21.0",
15
17
  "@thream/socketio-jwt": "^3.1.4",
16
18
  "@types/qs": "^6.14.0",
17
19
  "ajv": "8.20.0",
@@ -36,6 +38,7 @@
36
38
  "passport-local": "^1.0.0",
37
39
  "path-to-regexp": "^8.4.2",
38
40
  "qs": "^6.15.0",
41
+ "reflect-metadata": "^0.2.2",
39
42
  "router": "^2.2.0",
40
43
  "serve-static": "^2.2.1",
41
44
  "socket.io": "^4.8.1",
@@ -48,7 +51,7 @@
48
51
  "devDependencies": {
49
52
  "@biomejs/biome": "^2.3.6",
50
53
  "@modelcontextprotocol/client": "^2.0.0",
51
- "@terreno/syncdb": "57.19.2",
54
+ "@terreno/syncdb": "57.21.0",
52
55
  "@types/bun": "^1.4.0",
53
56
  "@types/cors": "^2.8.17",
54
57
  "@types/express": "^5.0.6",
@@ -118,10 +121,11 @@
118
121
  "compile:watch": "bun tsc -w",
119
122
  "dev": "bun tsc -w",
120
123
  "docs": "bunx typedoc@0.28.19 --out docs src/index.ts",
121
- "lint": "biome check ./src",
122
- "lint:fix": "biome check --write ./src",
124
+ "lint": "biome check ./src ./e2e",
125
+ "lint:fix": "biome check --write ./src ./e2e",
123
126
  "lint:unsafefix": "biome check --fix --unsafe ./src",
124
127
  "load": "bun src/sync/loadHarness.ts",
128
+ "smoke": "bun e2e/smoke.ts",
125
129
  "test": "bun test --update-snapshots",
126
130
  "test:agent": "AGENT=1 bun test --only-failures",
127
131
  "test:cache:clean": "bun ./src/tests/mongoTestSetup.ts clean",
@@ -129,8 +133,9 @@
129
133
  "test:cache:status": "bun ./src/tests/mongoTestSetup.ts status",
130
134
  "test:ci": "bun test",
131
135
  "test:coverage": "bun run ../scripts/check-coverage.ts",
136
+ "typecheck": "tsc -p tsconfig.typecheck.json",
132
137
  "updateSnapshot": "bun test --update-snapshots"
133
138
  },
134
139
  "types": "dist/index.d.ts",
135
- "version": "57.19.2"
140
+ "version": "57.21.0"
136
141
  }
@@ -168,6 +168,22 @@ exports[`openApi gets the openapi.json 1`] = `
168
168
  "_id": {
169
169
  "type": "string",
170
170
  },
171
+ "addendums": {
172
+ "description": "Extra details about this food category",
173
+ "items": {
174
+ "properties": {
175
+ "_id": {
176
+ "type": "string",
177
+ },
178
+ "text": {
179
+ "description": "The additional category detail",
180
+ "type": "string",
181
+ },
182
+ },
183
+ "type": "object",
184
+ },
185
+ "type": "array",
186
+ },
171
187
  "created": {
172
188
  "format": "date-time",
173
189
  "type": "string",
@@ -538,6 +554,22 @@ exports[`openApi gets the openapi.json 1`] = `
538
554
  "_id": {
539
555
  "type": "string",
540
556
  },
557
+ "addendums": {
558
+ "description": "Extra details about this food category",
559
+ "items": {
560
+ "properties": {
561
+ "_id": {
562
+ "type": "string",
563
+ },
564
+ "text": {
565
+ "description": "The additional category detail",
566
+ "type": "string",
567
+ },
568
+ },
569
+ "type": "object",
570
+ },
571
+ "type": "array",
572
+ },
541
573
  "created": {
542
574
  "format": "date-time",
543
575
  "type": "string",
@@ -837,6 +869,22 @@ exports[`openApi gets the openapi.json 1`] = `
837
869
  "_id": {
838
870
  "type": "string",
839
871
  },
872
+ "addendums": {
873
+ "description": "Extra details about this food category",
874
+ "items": {
875
+ "properties": {
876
+ "_id": {
877
+ "type": "string",
878
+ },
879
+ "text": {
880
+ "description": "The additional category detail",
881
+ "type": "string",
882
+ },
883
+ },
884
+ "type": "object",
885
+ },
886
+ "type": "array",
887
+ },
840
888
  "created": {
841
889
  "format": "date-time",
842
890
  "type": "string",
@@ -1266,6 +1314,22 @@ exports[`openApi gets the openapi.json 1`] = `
1266
1314
  "_id": {
1267
1315
  "type": "string",
1268
1316
  },
1317
+ "addendums": {
1318
+ "description": "Extra details about this food category",
1319
+ "items": {
1320
+ "properties": {
1321
+ "_id": {
1322
+ "type": "string",
1323
+ },
1324
+ "text": {
1325
+ "description": "The additional category detail",
1326
+ "type": "string",
1327
+ },
1328
+ },
1329
+ "type": "object",
1330
+ },
1331
+ "type": "array",
1332
+ },
1269
1333
  "created": {
1270
1334
  "format": "date-time",
1271
1335
  "type": "string",
@@ -1629,6 +1693,22 @@ exports[`openApi gets the openapi.json 1`] = `
1629
1693
  "_id": {
1630
1694
  "type": "string",
1631
1695
  },
1696
+ "addendums": {
1697
+ "description": "Extra details about this food category",
1698
+ "items": {
1699
+ "properties": {
1700
+ "_id": {
1701
+ "type": "string",
1702
+ },
1703
+ "text": {
1704
+ "description": "The additional category detail",
1705
+ "type": "string",
1706
+ },
1707
+ },
1708
+ "type": "object",
1709
+ },
1710
+ "type": "array",
1711
+ },
1632
1712
  "created": {
1633
1713
  "format": "date-time",
1634
1714
  "type": "string",
@@ -1928,6 +2008,22 @@ exports[`openApi gets the openapi.json 1`] = `
1928
2008
  "_id": {
1929
2009
  "type": "string",
1930
2010
  },
2011
+ "addendums": {
2012
+ "description": "Extra details about this food category",
2013
+ "items": {
2014
+ "properties": {
2015
+ "_id": {
2016
+ "type": "string",
2017
+ },
2018
+ "text": {
2019
+ "description": "The additional category detail",
2020
+ "type": "string",
2021
+ },
2022
+ },
2023
+ "type": "object",
2024
+ },
2025
+ "type": "array",
2026
+ },
1931
2027
  "created": {
1932
2028
  "format": "date-time",
1933
2029
  "type": "string",
@@ -2434,6 +2530,22 @@ exports[`openApi gets the openapi.json with custom endpoint 1`] = `
2434
2530
  "_id": {
2435
2531
  "type": "string",
2436
2532
  },
2533
+ "addendums": {
2534
+ "description": "Extra details about this food category",
2535
+ "items": {
2536
+ "properties": {
2537
+ "_id": {
2538
+ "type": "string",
2539
+ },
2540
+ "text": {
2541
+ "description": "The additional category detail",
2542
+ "type": "string",
2543
+ },
2544
+ },
2545
+ "type": "object",
2546
+ },
2547
+ "type": "array",
2548
+ },
2437
2549
  "created": {
2438
2550
  "format": "date-time",
2439
2551
  "type": "string",
@@ -2804,6 +2916,22 @@ exports[`openApi gets the openapi.json with custom endpoint 1`] = `
2804
2916
  "_id": {
2805
2917
  "type": "string",
2806
2918
  },
2919
+ "addendums": {
2920
+ "description": "Extra details about this food category",
2921
+ "items": {
2922
+ "properties": {
2923
+ "_id": {
2924
+ "type": "string",
2925
+ },
2926
+ "text": {
2927
+ "description": "The additional category detail",
2928
+ "type": "string",
2929
+ },
2930
+ },
2931
+ "type": "object",
2932
+ },
2933
+ "type": "array",
2934
+ },
2807
2935
  "created": {
2808
2936
  "format": "date-time",
2809
2937
  "type": "string",
@@ -3103,6 +3231,22 @@ exports[`openApi gets the openapi.json with custom endpoint 1`] = `
3103
3231
  "_id": {
3104
3232
  "type": "string",
3105
3233
  },
3234
+ "addendums": {
3235
+ "description": "Extra details about this food category",
3236
+ "items": {
3237
+ "properties": {
3238
+ "_id": {
3239
+ "type": "string",
3240
+ },
3241
+ "text": {
3242
+ "description": "The additional category detail",
3243
+ "type": "string",
3244
+ },
3245
+ },
3246
+ "type": "object",
3247
+ },
3248
+ "type": "array",
3249
+ },
3106
3250
  "created": {
3107
3251
  "format": "date-time",
3108
3252
  "type": "string",
@@ -3532,6 +3676,22 @@ exports[`openApi gets the openapi.json with custom endpoint 1`] = `
3532
3676
  "_id": {
3533
3677
  "type": "string",
3534
3678
  },
3679
+ "addendums": {
3680
+ "description": "Extra details about this food category",
3681
+ "items": {
3682
+ "properties": {
3683
+ "_id": {
3684
+ "type": "string",
3685
+ },
3686
+ "text": {
3687
+ "description": "The additional category detail",
3688
+ "type": "string",
3689
+ },
3690
+ },
3691
+ "type": "object",
3692
+ },
3693
+ "type": "array",
3694
+ },
3535
3695
  "created": {
3536
3696
  "format": "date-time",
3537
3697
  "type": "string",
@@ -3895,6 +4055,22 @@ exports[`openApi gets the openapi.json with custom endpoint 1`] = `
3895
4055
  "_id": {
3896
4056
  "type": "string",
3897
4057
  },
4058
+ "addendums": {
4059
+ "description": "Extra details about this food category",
4060
+ "items": {
4061
+ "properties": {
4062
+ "_id": {
4063
+ "type": "string",
4064
+ },
4065
+ "text": {
4066
+ "description": "The additional category detail",
4067
+ "type": "string",
4068
+ },
4069
+ },
4070
+ "type": "object",
4071
+ },
4072
+ "type": "array",
4073
+ },
3898
4074
  "created": {
3899
4075
  "format": "date-time",
3900
4076
  "type": "string",
@@ -4194,6 +4370,22 @@ exports[`openApi gets the openapi.json with custom endpoint 1`] = `
4194
4370
  "_id": {
4195
4371
  "type": "string",
4196
4372
  },
4373
+ "addendums": {
4374
+ "description": "Extra details about this food category",
4375
+ "items": {
4376
+ "properties": {
4377
+ "_id": {
4378
+ "type": "string",
4379
+ },
4380
+ "text": {
4381
+ "description": "The additional category detail",
4382
+ "type": "string",
4383
+ },
4384
+ },
4385
+ "type": "object",
4386
+ },
4387
+ "type": "array",
4388
+ },
4197
4389
  "created": {
4198
4390
  "format": "date-time",
4199
4391
  "type": "string",
@@ -4716,6 +4908,22 @@ exports[`openApi populate gets the openapi.json with populate 1`] = `
4716
4908
  "_id": {
4717
4909
  "type": "string",
4718
4910
  },
4911
+ "addendums": {
4912
+ "description": "Extra details about this food category",
4913
+ "items": {
4914
+ "properties": {
4915
+ "_id": {
4916
+ "type": "string",
4917
+ },
4918
+ "text": {
4919
+ "description": "The additional category detail",
4920
+ "type": "string",
4921
+ },
4922
+ },
4923
+ "type": "object",
4924
+ },
4925
+ "type": "array",
4926
+ },
4719
4927
  "created": {
4720
4928
  "format": "date-time",
4721
4929
  "type": "string",
@@ -4927,6 +5135,22 @@ exports[`openApi populate gets the openapi.json with populate 1`] = `
4927
5135
  "_id": {
4928
5136
  "type": "string",
4929
5137
  },
5138
+ "addendums": {
5139
+ "description": "Extra details about this food category",
5140
+ "items": {
5141
+ "properties": {
5142
+ "_id": {
5143
+ "type": "string",
5144
+ },
5145
+ "text": {
5146
+ "description": "The additional category detail",
5147
+ "type": "string",
5148
+ },
5149
+ },
5150
+ "type": "object",
5151
+ },
5152
+ "type": "array",
5153
+ },
4930
5154
  "created": {
4931
5155
  "format": "date-time",
4932
5156
  "type": "string",
@@ -5067,6 +5291,22 @@ exports[`openApi populate gets the openapi.json with populate 1`] = `
5067
5291
  "_id": {
5068
5292
  "type": "string",
5069
5293
  },
5294
+ "addendums": {
5295
+ "description": "Extra details about this food category",
5296
+ "items": {
5297
+ "properties": {
5298
+ "_id": {
5299
+ "type": "string",
5300
+ },
5301
+ "text": {
5302
+ "description": "The additional category detail",
5303
+ "type": "string",
5304
+ },
5305
+ },
5306
+ "type": "object",
5307
+ },
5308
+ "type": "array",
5309
+ },
5070
5310
  "created": {
5071
5311
  "format": "date-time",
5072
5312
  "type": "string",
@@ -5337,6 +5577,22 @@ exports[`openApi populate gets the openapi.json with populate 1`] = `
5337
5577
  "_id": {
5338
5578
  "type": "string",
5339
5579
  },
5580
+ "addendums": {
5581
+ "description": "Extra details about this food category",
5582
+ "items": {
5583
+ "properties": {
5584
+ "_id": {
5585
+ "type": "string",
5586
+ },
5587
+ "text": {
5588
+ "description": "The additional category detail",
5589
+ "type": "string",
5590
+ },
5591
+ },
5592
+ "type": "object",
5593
+ },
5594
+ "type": "array",
5595
+ },
5340
5596
  "created": {
5341
5597
  "format": "date-time",
5342
5598
  "type": "string",
@@ -5541,6 +5797,22 @@ exports[`openApi populate gets the openapi.json with populate 1`] = `
5541
5797
  "_id": {
5542
5798
  "type": "string",
5543
5799
  },
5800
+ "addendums": {
5801
+ "description": "Extra details about this food category",
5802
+ "items": {
5803
+ "properties": {
5804
+ "_id": {
5805
+ "type": "string",
5806
+ },
5807
+ "text": {
5808
+ "description": "The additional category detail",
5809
+ "type": "string",
5810
+ },
5811
+ },
5812
+ "type": "object",
5813
+ },
5814
+ "type": "array",
5815
+ },
5544
5816
  "created": {
5545
5817
  "format": "date-time",
5546
5818
  "type": "string",
@@ -5681,6 +5953,22 @@ exports[`openApi populate gets the openapi.json with populate 1`] = `
5681
5953
  "_id": {
5682
5954
  "type": "string",
5683
5955
  },
5956
+ "addendums": {
5957
+ "description": "Extra details about this food category",
5958
+ "items": {
5959
+ "properties": {
5960
+ "_id": {
5961
+ "type": "string",
5962
+ },
5963
+ "text": {
5964
+ "description": "The additional category detail",
5965
+ "type": "string",
5966
+ },
5967
+ },
5968
+ "type": "object",
5969
+ },
5970
+ "type": "array",
5971
+ },
5684
5972
  "created": {
5685
5973
  "format": "date-time",
5686
5974
  "type": "string",