@terreno/api 57.2.0 → 57.4.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 (472) hide show
  1. package/.ai/skills/mongoose-schema-safety/SKILL.md +23 -10
  2. package/README.md +23 -7
  3. package/dist/actions.js +19 -7
  4. package/dist/adminTypes.d.ts +7 -0
  5. package/dist/adminTypes.js +6 -1
  6. package/dist/api.d.ts +14 -0
  7. package/dist/api.js +111 -60
  8. package/dist/audit/auditApp.d.ts +30 -0
  9. package/dist/audit/auditApp.js +155 -0
  10. package/dist/audit/auditEventModel.d.ts +29 -0
  11. package/dist/audit/auditEventModel.js +102 -0
  12. package/dist/audit/cloudTasksEnqueue.d.ts +32 -0
  13. package/dist/audit/cloudTasksEnqueue.js +162 -0
  14. package/dist/audit/diff.d.ts +10 -0
  15. package/dist/audit/diff.js +230 -0
  16. package/dist/audit/processQueue.d.ts +6 -0
  17. package/dist/audit/processQueue.js +101 -0
  18. package/dist/audit/rbacSink.d.ts +2 -0
  19. package/dist/audit/rbacSink.js +82 -0
  20. package/dist/audit/record.d.ts +56 -0
  21. package/dist/audit/record.js +373 -0
  22. package/dist/auth.d.ts +23 -10
  23. package/dist/auth.js +97 -32
  24. package/dist/authRecovery.d.ts +5 -0
  25. package/dist/authRecovery.js +350 -0
  26. package/dist/authTokens.d.ts +8 -0
  27. package/dist/authTokens.js +162 -0
  28. package/dist/betterAuth.d.ts +39 -0
  29. package/dist/betterAuthApp.d.ts +4 -0
  30. package/dist/betterAuthApp.js +26 -8
  31. package/dist/betterAuthSetup.d.ts +44 -2
  32. package/dist/betterAuthSetup.js +288 -18
  33. package/dist/collectionRegistry.d.ts +40 -0
  34. package/dist/collectionRegistry.js +97 -0
  35. package/dist/configurationApp.d.ts +11 -2
  36. package/dist/configurationApp.js +2 -4
  37. package/dist/docLoader.js +35 -6
  38. package/dist/expressServer.d.ts +26 -3
  39. package/dist/expressServer.js +79 -11
  40. package/dist/index.d.ts +42 -1
  41. package/dist/index.js +84 -2
  42. package/dist/mcp/auth.d.ts +1 -0
  43. package/dist/mcp/auth.js +47 -25
  44. package/dist/mcp/handlers.d.ts +1 -1
  45. package/dist/mcp/handlers.js +67 -233
  46. package/dist/mcp/query.d.ts +2 -15
  47. package/dist/mcp/query.js +8 -8
  48. package/dist/mcp/registry.d.ts +1 -5
  49. package/dist/mcp/registry.js +31 -20
  50. package/dist/mcp/schemaGenerator.d.ts +2 -7
  51. package/dist/mcp/schemaGenerator.js +41 -116
  52. package/dist/mcp/server.d.ts +1 -0
  53. package/dist/mcp/server.js +1 -0
  54. package/dist/mcp/serviceTokens.d.ts +16 -0
  55. package/dist/mcp/serviceTokens.js +345 -0
  56. package/dist/mcp/types.d.ts +2 -2
  57. package/dist/migrations/fixtures/all-down/20260910120000-one.d.ts +4 -0
  58. package/dist/migrations/fixtures/all-down/20260910120000-one.js +49 -0
  59. package/dist/migrations/fixtures/all-down/20260910120001-two.d.ts +4 -0
  60. package/dist/migrations/fixtures/all-down/20260910120001-two.js +49 -0
  61. package/dist/migrations/fixtures/bad-id/20260910120000-mismatch.d.ts +3 -0
  62. package/dist/migrations/fixtures/bad-id/20260910120000-mismatch.js +45 -0
  63. package/dist/migrations/fixtures/bad-name/not-a-migration.d.ts +3 -0
  64. package/dist/migrations/fixtures/bad-name/not-a-migration.js +45 -0
  65. package/dist/migrations/fixtures/missing-up/20260910120000-noup.d.ts +2 -0
  66. package/dist/migrations/fixtures/missing-up/20260910120000-noup.js +5 -0
  67. package/dist/migrations/fixtures/valid/20260910120000-alpha.d.ts +3 -0
  68. package/dist/migrations/fixtures/valid/20260910120000-alpha.js +45 -0
  69. package/dist/migrations/fixtures/valid/20260910120001-beta.d.ts +4 -0
  70. package/dist/migrations/fixtures/valid/20260910120001-beta.js +49 -0
  71. package/dist/migrations/generate.d.ts +17 -0
  72. package/dist/migrations/generate.js +277 -0
  73. package/dist/migrations/load.d.ts +20 -0
  74. package/dist/migrations/load.js +236 -0
  75. package/dist/migrations/lock.d.ts +13 -0
  76. package/dist/migrations/lock.js +145 -0
  77. package/dist/migrations/runner.d.ts +42 -0
  78. package/dist/migrations/runner.js +503 -0
  79. package/dist/migrations/schemaCatalog.d.ts +44 -0
  80. package/dist/migrations/schemaCatalog.js +326 -0
  81. package/dist/migrations/types.d.ts +87 -0
  82. package/dist/migrations/types.js +7 -0
  83. package/dist/models/mcpServiceToken.d.ts +3 -0
  84. package/dist/models/mcpServiceToken.js +208 -0
  85. package/dist/models/notification.d.ts +2 -0
  86. package/dist/models/notification.js +62 -0
  87. package/dist/models/notificationPreference.d.ts +2 -0
  88. package/dist/models/notificationPreference.js +49 -0
  89. package/dist/notifications/notificationService.d.ts +40 -0
  90. package/dist/notifications/notificationService.js +323 -0
  91. package/dist/notifications/notificationsApp.d.ts +18 -0
  92. package/dist/notifications/notificationsApp.js +250 -0
  93. package/dist/notifications/notificationsBeforeSend.d.ts +14 -0
  94. package/dist/notifications/notificationsBeforeSend.js +77 -0
  95. package/dist/openApi.d.ts +1 -7
  96. package/dist/openApi.js +7 -6
  97. package/dist/openApiBuilder.d.ts +19 -7
  98. package/dist/openApiBuilder.js +61 -8
  99. package/dist/openApiCompat.js +1 -1
  100. package/dist/openApiValidator.d.ts +13 -1
  101. package/dist/openApiValidator.js +200 -38
  102. package/dist/orgs/orgContext.d.ts +23 -0
  103. package/dist/orgs/orgContext.js +198 -0
  104. package/dist/orgs/orgPermissions.d.ts +4 -0
  105. package/dist/orgs/orgPermissions.js +77 -0
  106. package/dist/orgs/orgPlugin.d.ts +13 -0
  107. package/dist/orgs/orgPlugin.js +84 -0
  108. package/dist/orgs/organizationModel.d.ts +13 -0
  109. package/dist/orgs/organizationModel.js +301 -0
  110. package/dist/orgs/organizationSettings.d.ts +19 -0
  111. package/dist/orgs/organizationSettings.js +120 -0
  112. package/dist/orgs/orgsApp.d.ts +28 -0
  113. package/dist/orgs/orgsApp.js +678 -0
  114. package/dist/permissions.d.ts +7 -13
  115. package/dist/permissions.js +8 -31
  116. package/dist/plugins.d.ts +14 -1
  117. package/dist/plugins.js +17 -6
  118. package/dist/populate.d.ts +2 -2
  119. package/dist/populate.js +47 -42
  120. package/dist/rateLimit/applyTrustProxy.d.ts +3 -0
  121. package/dist/rateLimit/applyTrustProxy.js +17 -0
  122. package/dist/rateLimit/createStore.d.ts +2 -0
  123. package/dist/rateLimit/createStore.js +28 -0
  124. package/dist/rateLimit/memoryStore.d.ts +2 -0
  125. package/dist/rateLimit/memoryStore.js +108 -0
  126. package/dist/rateLimit/middleware.d.ts +3 -0
  127. package/dist/rateLimit/middleware.js +109 -0
  128. package/dist/rateLimit/mongoStore.d.ts +4 -0
  129. package/dist/rateLimit/mongoStore.js +123 -0
  130. package/dist/rateLimit/policies.d.ts +10 -0
  131. package/dist/rateLimit/policies.js +149 -0
  132. package/dist/rateLimit/redisStore.d.ts +4 -0
  133. package/dist/rateLimit/redisStore.js +156 -0
  134. package/dist/rateLimit/types.d.ts +54 -0
  135. package/dist/rateLimit/types.js +9 -0
  136. package/dist/rbac/access.js +35 -14
  137. package/dist/rbac/assertAllowed.d.ts +9 -0
  138. package/dist/rbac/assertAllowed.js +182 -0
  139. package/dist/rbac/membershipOrgAdminSource.d.ts +6 -0
  140. package/dist/rbac/membershipOrgAdminSource.js +122 -0
  141. package/dist/rbac/modelRouterAccess.d.ts +4 -0
  142. package/dist/rbac/modelRouterAccess.js +11 -4
  143. package/dist/rbac/permissionUtils.js +3 -2
  144. package/dist/rbac/resolve.js +65 -35
  145. package/dist/rbac/roleModel.d.ts +2 -5
  146. package/dist/rbac/roleModel.js +18 -4
  147. package/dist/rbac/routes.js +15 -6
  148. package/dist/rbac/statements.d.ts +10 -1
  149. package/dist/rbac/statements.js +19 -2
  150. package/dist/rbac/types.d.ts +5 -0
  151. package/dist/realtime/changeStreamWatcher.d.ts +10 -4
  152. package/dist/realtime/changeStreamWatcher.js +110 -64
  153. package/dist/realtime/deprecation.d.ts +13 -0
  154. package/dist/realtime/deprecation.js +33 -0
  155. package/dist/realtime/realtimeApp.d.ts +2 -1
  156. package/dist/realtime/realtimeApp.js +11 -11
  157. package/dist/realtime/registry.d.ts +0 -31
  158. package/dist/realtime/registry.js +44 -31
  159. package/dist/realtime/socketAuth.d.ts +5 -5
  160. package/dist/realtime/socketAuth.js +11 -1
  161. package/dist/realtime/socketUser.d.ts +5 -1
  162. package/dist/realtime/types.d.ts +14 -4
  163. package/dist/schemaMetadata.d.ts +56 -0
  164. package/dist/schemaMetadata.js +524 -0
  165. package/dist/seedRunner.d.ts +88 -0
  166. package/dist/seedRunner.js +627 -0
  167. package/dist/sync/adminBroadcastScope.d.ts +40 -0
  168. package/dist/sync/adminBroadcastScope.js +194 -0
  169. package/dist/sync/adminWindowAccess.d.ts +13 -0
  170. package/dist/sync/adminWindowAccess.js +96 -0
  171. package/dist/sync/adminWindowMutation.d.ts +88 -0
  172. package/dist/sync/adminWindowMutation.js +247 -0
  173. package/dist/sync/executors.d.ts +19 -3
  174. package/dist/sync/executors.js +194 -165
  175. package/dist/sync/loadHarness.js +28 -19
  176. package/dist/sync/models.js +26 -24
  177. package/dist/sync/mutationHandler.d.ts +14 -2
  178. package/dist/sync/mutationHandler.js +201 -76
  179. package/dist/sync/registrationSideEffects.d.ts +35 -0
  180. package/dist/sync/registrationSideEffects.js +151 -0
  181. package/dist/sync/registry.d.ts +2 -52
  182. package/dist/sync/registry.js +42 -187
  183. package/dist/sync/routes.d.ts +13 -0
  184. package/dist/sync/routes.js +116 -58
  185. package/dist/sync/scripts/compactTombstones.js +0 -2
  186. package/dist/sync/socketHandlers.d.ts +8 -2
  187. package/dist/sync/socketHandlers.js +144 -50
  188. package/dist/sync/streams.d.ts +2 -0
  189. package/dist/sync/streams.js +7 -1
  190. package/dist/sync/syncApp.d.ts +4 -3
  191. package/dist/sync/syncApp.js +5 -4
  192. package/dist/sync/syncBatch.d.ts +5 -2
  193. package/dist/sync/syncBatch.js +7 -6
  194. package/dist/sync/syncSeqPlugin.d.ts +1 -1
  195. package/dist/sync/syncSeqPlugin.js +20 -16
  196. package/dist/sync/types.d.ts +18 -0
  197. package/dist/terrenoApp.d.ts +48 -5
  198. package/dist/terrenoApp.js +157 -72
  199. package/dist/tests/createTestData.d.ts +1 -3
  200. package/dist/tests/createTestData.js +3 -5
  201. package/dist/tests/models.d.ts +3 -0
  202. package/dist/tests/models.js +15 -2
  203. package/dist/tests/testHelper.d.ts +0 -5
  204. package/dist/tests/testHelper.js +2 -9
  205. package/dist/types/authToken.d.ts +33 -0
  206. package/dist/types/authToken.js +2 -0
  207. package/dist/types/mcpServiceToken.d.ts +41 -0
  208. package/dist/types/mcpServiceToken.js +2 -0
  209. package/dist/types/membership.d.ts +23 -0
  210. package/dist/types/membership.js +2 -0
  211. package/dist/types/notification.d.ts +28 -0
  212. package/dist/types/notification.js +2 -0
  213. package/dist/types/notificationPreference.d.ts +20 -0
  214. package/dist/types/notificationPreference.js +2 -0
  215. package/dist/types/organization.d.ts +36 -0
  216. package/dist/types/organization.js +2 -0
  217. package/dist/webhooks/headerValue.d.ts +2 -0
  218. package/dist/webhooks/headerValue.js +14 -0
  219. package/dist/webhooks/idempotency/memoryStore.d.ts +10 -0
  220. package/dist/webhooks/idempotency/memoryStore.js +65 -0
  221. package/dist/webhooks/idempotency/mongoStore.d.ts +4 -0
  222. package/dist/webhooks/idempotency/mongoStore.js +150 -0
  223. package/dist/webhooks/idempotency/webhookReceipt.d.ts +17 -0
  224. package/dist/webhooks/idempotency/webhookReceipt.js +39 -0
  225. package/dist/webhooks/rawBody.d.ts +15 -0
  226. package/dist/webhooks/rawBody.js +23 -0
  227. package/dist/webhooks/timingSafeEqual.d.ts +4 -0
  228. package/dist/webhooks/timingSafeEqual.js +17 -0
  229. package/dist/webhooks/verifiers/hmac.d.ts +15 -0
  230. package/dist/webhooks/verifiers/hmac.js +49 -0
  231. package/dist/webhooks/verifiers/sendgrid.d.ts +10 -0
  232. package/dist/webhooks/verifiers/sendgrid.js +56 -0
  233. package/dist/webhooks/verifiers/stripe.d.ts +9 -0
  234. package/dist/webhooks/verifiers/stripe.js +99 -0
  235. package/dist/webhooks/verifiers/twilio.d.ts +9 -0
  236. package/dist/webhooks/verifiers/twilio.js +112 -0
  237. package/dist/webhooks/webhooksApp.d.ts +33 -0
  238. package/dist/webhooks/webhooksApp.js +195 -0
  239. package/package.json +32 -27
  240. package/src/__snapshots__/openApi.test.ts.snap +444 -36
  241. package/src/__snapshots__/openApiBuilder.test.ts.snap +24 -24
  242. package/src/__snapshots__/schemaMetadata.test.ts.snap +196 -0
  243. package/src/actions.ts +20 -13
  244. package/src/adminModelRouter.test.ts +133 -0
  245. package/src/adminTypes.ts +8 -0
  246. package/src/api.arrayOperations.test.ts +43 -31
  247. package/src/api.hooks.test.ts +38 -29
  248. package/src/api.query.test.ts +31 -31
  249. package/src/api.test.ts +133 -97
  250. package/src/api.ts +84 -27
  251. package/src/audit/auditApp.test.ts +243 -0
  252. package/src/audit/auditApp.ts +139 -0
  253. package/src/audit/auditEventModel.ts +156 -0
  254. package/src/audit/auditRouter.test.ts +456 -0
  255. package/src/audit/cloudTasksEnqueue.test.ts +124 -0
  256. package/src/audit/cloudTasksEnqueue.ts +104 -0
  257. package/src/audit/diff.ts +163 -0
  258. package/src/audit/processQueue.ts +69 -0
  259. package/src/audit/rbacSink.test.ts +86 -0
  260. package/src/audit/rbacSink.ts +42 -0
  261. package/src/audit/record.test.ts +402 -0
  262. package/src/audit/record.ts +328 -0
  263. package/src/auth.test.ts +108 -52
  264. package/src/auth.ts +98 -29
  265. package/src/authRecovery.test.ts +281 -0
  266. package/src/authRecovery.ts +279 -0
  267. package/src/authTokens.test.ts +94 -0
  268. package/src/authTokens.ts +118 -0
  269. package/src/authVerification.test.ts +293 -0
  270. package/src/betterAuth.ts +31 -0
  271. package/src/betterAuthApp.test.ts +1 -0
  272. package/src/betterAuthApp.ts +27 -9
  273. package/src/betterAuthSetup.test.ts +595 -38
  274. package/src/betterAuthSetup.ts +261 -5
  275. package/src/collectionRegistry.test.ts +164 -0
  276. package/src/collectionRegistry.ts +135 -0
  277. package/src/configurationApp.ts +13 -7
  278. package/src/docLoader.test.ts +45 -1
  279. package/src/docLoader.ts +37 -6
  280. package/src/express.d.ts +3 -0
  281. package/src/expressServer.test.ts +180 -68
  282. package/src/expressServer.ts +75 -19
  283. package/src/githubAuth.test.ts +60 -55
  284. package/src/index.ts +127 -0
  285. package/src/mcp/auth.test.ts +47 -0
  286. package/src/mcp/auth.ts +32 -11
  287. package/src/mcp/handlers.test.ts +275 -0
  288. package/src/mcp/handlers.ts +45 -172
  289. package/src/mcp/integration.test.ts +59 -9
  290. package/src/mcp/query.ts +5 -7
  291. package/src/mcp/registry.ts +29 -20
  292. package/src/mcp/schemaGenerator.test.ts +8 -0
  293. package/src/mcp/schemaGenerator.ts +49 -131
  294. package/src/mcp/server.ts +2 -0
  295. package/src/mcp/serviceTokens.test.ts +330 -0
  296. package/src/mcp/serviceTokens.ts +307 -0
  297. package/src/mcp/toolGenerator.test.ts +82 -1
  298. package/src/mcp/types.ts +2 -6
  299. package/src/migrations/cli.test.ts +376 -0
  300. package/src/migrations/cli.ts +283 -0
  301. package/src/migrations/fixtures/all-down/20260910120000-one.ts +6 -0
  302. package/src/migrations/fixtures/all-down/20260910120001-two.ts +6 -0
  303. package/src/migrations/fixtures/bad-id/20260910120000-mismatch.ts +4 -0
  304. package/src/migrations/fixtures/bad-name/not-a-migration.ts +4 -0
  305. package/src/migrations/fixtures/missing-up/20260910120000-noup.ts +2 -0
  306. package/src/migrations/fixtures/valid/20260910120000-alpha.ts +4 -0
  307. package/src/migrations/fixtures/valid/20260910120001-beta.ts +6 -0
  308. package/src/migrations/generate.test.ts +333 -0
  309. package/src/migrations/generate.ts +216 -0
  310. package/src/migrations/load.test.ts +103 -0
  311. package/src/migrations/load.ts +124 -0
  312. package/src/migrations/lock.test.ts +133 -0
  313. package/src/migrations/lock.ts +118 -0
  314. package/src/migrations/runner.test.ts +504 -0
  315. package/src/migrations/runner.ts +358 -0
  316. package/src/migrations/schemaCatalog.test.ts +159 -0
  317. package/src/migrations/schemaCatalog.ts +262 -0
  318. package/src/migrations/types.ts +94 -0
  319. package/src/models/mcpServiceToken.test.ts +129 -0
  320. package/src/models/mcpServiceToken.ts +158 -0
  321. package/src/models/notification.ts +68 -0
  322. package/src/models/notificationPreference.ts +62 -0
  323. package/src/notifications/notificationService.ts +254 -0
  324. package/src/notifications/notificationsApp.test.ts +505 -0
  325. package/src/notifications/notificationsApp.ts +200 -0
  326. package/src/notifications/notificationsBeforeSend.ts +51 -0
  327. package/src/openApi.test.ts +80 -65
  328. package/src/openApi.ts +2 -1
  329. package/src/openApiBuilder.test.ts +95 -7
  330. package/src/openApiBuilder.ts +60 -12
  331. package/src/openApiCompat.ts +1 -1
  332. package/src/openApiValidator.test.ts +270 -56
  333. package/src/openApiValidator.ts +219 -36
  334. package/src/orgs/orgAccessOptIn.test.ts +87 -0
  335. package/src/orgs/orgContext.test.ts +259 -0
  336. package/src/orgs/orgContext.ts +151 -0
  337. package/src/orgs/orgPermissions.test.ts +105 -0
  338. package/src/orgs/orgPermissions.ts +40 -0
  339. package/src/orgs/orgPlugin.test.ts +130 -0
  340. package/src/orgs/orgPlugin.ts +70 -0
  341. package/src/orgs/orgRbac.test.ts +267 -0
  342. package/src/orgs/orgSecurityDefects.test.ts +415 -0
  343. package/src/orgs/organizationModel.test.ts +205 -0
  344. package/src/orgs/organizationModel.ts +257 -0
  345. package/src/orgs/organizationSettings.test.ts +113 -0
  346. package/src/orgs/organizationSettings.ts +126 -0
  347. package/src/orgs/orgsApp.test.ts +382 -0
  348. package/src/orgs/orgsApp.ts +563 -0
  349. package/src/permissions.test.ts +62 -36
  350. package/src/permissions.ts +8 -30
  351. package/src/plugins.test.ts +14 -0
  352. package/src/plugins.ts +34 -9
  353. package/src/populate.test.ts +34 -0
  354. package/src/populate.ts +40 -29
  355. package/src/rateLimit/applyTrustProxy.ts +17 -0
  356. package/src/rateLimit/createStore.ts +25 -0
  357. package/src/rateLimit/memoryStore.ts +40 -0
  358. package/src/rateLimit/middleware.ts +79 -0
  359. package/src/rateLimit/mongoStore.test.ts +80 -0
  360. package/src/rateLimit/mongoStore.ts +77 -0
  361. package/src/rateLimit/policies.ts +130 -0
  362. package/src/rateLimit/rateLimit.test.ts +328 -0
  363. package/src/rateLimit/redisStore.ioredis.test.ts +29 -0
  364. package/src/rateLimit/redisStore.test.ts +114 -0
  365. package/src/rateLimit/redisStore.ts +86 -0
  366. package/src/rateLimit/types.ts +64 -0
  367. package/src/rbac/access.ts +16 -4
  368. package/src/rbac/assertAllowed.test.ts +325 -0
  369. package/src/rbac/assertAllowed.ts +157 -0
  370. package/src/rbac/backfillAdmins.test.ts +124 -0
  371. package/src/rbac/fieldViews.test.ts +89 -0
  372. package/src/rbac/membershipOrgAdminSource.ts +59 -0
  373. package/src/rbac/modelRouterAccess.test.ts +126 -0
  374. package/src/rbac/modelRouterAccess.ts +8 -2
  375. package/src/rbac/permissionUtils.test.ts +26 -5
  376. package/src/rbac/permissionUtils.ts +3 -2
  377. package/src/rbac/realtimeAccess.test.ts +109 -1
  378. package/src/rbac/resolve.test.ts +34 -2
  379. package/src/rbac/resolve.ts +31 -11
  380. package/src/rbac/roleManager.test.ts +169 -0
  381. package/src/rbac/roleModel.test.ts +34 -1
  382. package/src/rbac/roleModel.ts +17 -1
  383. package/src/rbac/routes.test.ts +233 -0
  384. package/src/rbac/routes.ts +16 -6
  385. package/src/rbac/statements.test.ts +19 -0
  386. package/src/rbac/statements.ts +19 -1
  387. package/src/rbac/types.ts +5 -0
  388. package/src/realtime/changeStreamWatcher.ts +73 -33
  389. package/src/realtime/deprecation.test.ts +60 -0
  390. package/src/realtime/deprecation.ts +33 -0
  391. package/src/realtime/realtime.test.ts +365 -189
  392. package/src/realtime/realtimeApp.ts +11 -11
  393. package/src/realtime/realtimeAppSetup.test.ts +32 -5
  394. package/src/realtime/registry.ts +48 -42
  395. package/src/realtime/sessionRevalidation.test.ts +57 -44
  396. package/src/realtime/socketAuth.test.ts +75 -23
  397. package/src/realtime/socketAuth.ts +17 -6
  398. package/src/realtime/socketUser.ts +5 -3
  399. package/src/realtime/types.ts +14 -4
  400. package/src/schemaMetadata.test.ts +419 -0
  401. package/src/schemaMetadata.ts +593 -0
  402. package/src/scrubAdminFields.test.ts +105 -0
  403. package/src/seedRunner.test.ts +591 -0
  404. package/src/seedRunner.ts +464 -0
  405. package/src/sync/adminBroadcastConfig.test.ts +96 -0
  406. package/src/sync/adminBroadcastScope.test.ts +155 -0
  407. package/src/sync/adminBroadcastScope.ts +123 -0
  408. package/src/sync/adminWindowAccess.test.ts +57 -0
  409. package/src/sync/adminWindowAccess.ts +32 -0
  410. package/src/sync/adminWindowMutation.test.ts +450 -0
  411. package/src/sync/adminWindowMutation.ts +283 -0
  412. package/src/sync/docMatchesMutationData.test.ts +16 -0
  413. package/src/sync/ensureSyncIndexes.test.ts +54 -15
  414. package/src/sync/executors.test.ts +40 -0
  415. package/src/sync/executors.ts +57 -18
  416. package/src/sync/integration.test.ts +15 -7
  417. package/src/sync/loadHarness.ts +28 -19
  418. package/src/sync/models.ts +32 -18
  419. package/src/sync/mutationHandler.test.ts +293 -17
  420. package/src/sync/mutationHandler.ts +180 -36
  421. package/src/sync/registrationSideEffects.test.ts +126 -0
  422. package/src/sync/registrationSideEffects.ts +131 -0
  423. package/src/sync/registry.ts +49 -171
  424. package/src/sync/routes.ts +55 -10
  425. package/src/sync/scripts/compactTombstones.ts +0 -2
  426. package/src/sync/sessionRevalidationIntegration.test.ts +12 -11
  427. package/src/sync/socketHandlers.ts +154 -58
  428. package/src/sync/streams.ts +6 -0
  429. package/src/sync/sync.test.ts +28 -25
  430. package/src/sync/syncApp.ts +5 -4
  431. package/src/sync/syncBatch.ts +10 -4
  432. package/src/sync/syncFrontier.test.ts +17 -15
  433. package/src/sync/syncPhaseC.test.ts +54 -43
  434. package/src/sync/syncRoutes.test.ts +347 -38
  435. package/src/sync/syncSeqPlugin.ts +66 -44
  436. package/src/sync/syncSocket.test.ts +341 -81
  437. package/src/sync/types.ts +20 -0
  438. package/src/terrenoApp.mcpServiceTokens.test.ts +173 -0
  439. package/src/terrenoApp.migrations.test.ts +114 -0
  440. package/src/terrenoApp.test.ts +41 -0
  441. package/src/terrenoApp.ts +181 -46
  442. package/src/tests/createTestData.ts +2 -2
  443. package/src/tests/models.ts +24 -3
  444. package/src/tests/testHelper.ts +1 -7
  445. package/src/types/authToken.ts +41 -0
  446. package/src/types/mcpServiceToken.ts +48 -0
  447. package/src/types/membership.ts +48 -0
  448. package/src/types/notification.ts +34 -0
  449. package/src/types/notificationPreference.ts +28 -0
  450. package/src/types/organization.ts +49 -0
  451. package/src/webhooks/headerValue.test.ts +22 -0
  452. package/src/webhooks/headerValue.ts +12 -0
  453. package/src/webhooks/idempotency/memoryStore.ts +34 -0
  454. package/src/webhooks/idempotency/mongoStore.test.ts +274 -0
  455. package/src/webhooks/idempotency/mongoStore.ts +83 -0
  456. package/src/webhooks/idempotency/webhookReceipt.ts +67 -0
  457. package/src/webhooks/rawBody.test.ts +107 -0
  458. package/src/webhooks/rawBody.ts +24 -0
  459. package/src/webhooks/timingSafeEqual.ts +16 -0
  460. package/src/webhooks/verifiers/hmac.test.ts +110 -0
  461. package/src/webhooks/verifiers/hmac.ts +54 -0
  462. package/src/webhooks/verifiers/providerVerifiers.test.ts +388 -0
  463. package/src/webhooks/verifiers/sendgrid.ts +59 -0
  464. package/src/webhooks/verifiers/stripe.ts +67 -0
  465. package/src/webhooks/verifiers/twilio.ts +69 -0
  466. package/src/webhooks/webhooksApp.test.ts +221 -0
  467. package/src/webhooks/webhooksApp.ts +144 -0
  468. package/tsconfig.json +1 -1
  469. package/tsconfig.typedoc.json +2 -1
  470. package/dist/vendor/wesleytodd-openapi/lib/convert-yaml.d.ts +0 -2
  471. package/dist/vendor/wesleytodd-openapi/lib/convert-yaml.js +0 -13
  472. package/src/vendor/wesleytodd-openapi/lib/convert-yaml.js +0 -13
@@ -185,7 +185,6 @@ exports[`openApi gets the openapi.json 1`] = `
185
185
  "type": "string",
186
186
  },
187
187
  },
188
- "required": [],
189
188
  "type": "object",
190
189
  },
191
190
  "type": "array",
@@ -233,6 +232,11 @@ exports[`openApi gets the openapi.json 1`] = `
233
232
  "email": {
234
233
  "type": "string",
235
234
  },
235
+ "emailVerified": {
236
+ "default": false,
237
+ "description": "Whether the user has verified their email address",
238
+ "type": "boolean",
239
+ },
236
240
  "hash": {
237
241
  "type": "string",
238
242
  },
@@ -252,9 +256,22 @@ exports[`openApi gets the openapi.json 1`] = `
252
256
  },
253
257
  "type": "array",
254
258
  },
259
+ "roles": {
260
+ "default": [],
261
+ "description": "RBAC role names assigned to this user",
262
+ "items": {
263
+ "type": "string",
264
+ },
265
+ "type": "array",
266
+ },
255
267
  "salt": {
256
268
  "type": "string",
257
269
  },
270
+ "tokenEpoch": {
271
+ "default": 0,
272
+ "description": "Incremented on password reset to invalidate outstanding refresh tokens",
273
+ "type": "number",
274
+ },
258
275
  "updated": {
259
276
  "description": "When this document was last updated",
260
277
  "format": "date-time",
@@ -301,10 +318,10 @@ exports[`openApi gets the openapi.json 1`] = `
301
318
  },
302
319
  "userId": {
303
320
  "description": "The user who liked the item",
321
+ "format": "objectid",
304
322
  "type": "string",
305
323
  },
306
324
  },
307
- "required": [],
308
325
  "type": "object",
309
326
  },
310
327
  "type": "array",
@@ -347,6 +364,11 @@ exports[`openApi gets the openapi.json 1`] = `
347
364
  "email": {
348
365
  "type": "string",
349
366
  },
367
+ "emailVerified": {
368
+ "default": false,
369
+ "description": "Whether the user has verified their email address",
370
+ "type": "boolean",
371
+ },
350
372
  "hash": {
351
373
  "type": "string",
352
374
  },
@@ -366,9 +388,22 @@ exports[`openApi gets the openapi.json 1`] = `
366
388
  },
367
389
  "type": "array",
368
390
  },
391
+ "roles": {
392
+ "default": [],
393
+ "description": "RBAC role names assigned to this user",
394
+ "items": {
395
+ "type": "string",
396
+ },
397
+ "type": "array",
398
+ },
369
399
  "salt": {
370
400
  "type": "string",
371
401
  },
402
+ "tokenEpoch": {
403
+ "default": 0,
404
+ "description": "Incremented on password reset to invalidate outstanding refresh tokens",
405
+ "type": "number",
406
+ },
372
407
  "updated": {
373
408
  "description": "When this document was last updated",
374
409
  "format": "date-time",
@@ -520,7 +555,6 @@ exports[`openApi gets the openapi.json 1`] = `
520
555
  "type": "string",
521
556
  },
522
557
  },
523
- "required": [],
524
558
  "type": "object",
525
559
  },
526
560
  "type": "array",
@@ -568,6 +602,11 @@ exports[`openApi gets the openapi.json 1`] = `
568
602
  "email": {
569
603
  "type": "string",
570
604
  },
605
+ "emailVerified": {
606
+ "default": false,
607
+ "description": "Whether the user has verified their email address",
608
+ "type": "boolean",
609
+ },
571
610
  "hash": {
572
611
  "type": "string",
573
612
  },
@@ -587,9 +626,22 @@ exports[`openApi gets the openapi.json 1`] = `
587
626
  },
588
627
  "type": "array",
589
628
  },
629
+ "roles": {
630
+ "default": [],
631
+ "description": "RBAC role names assigned to this user",
632
+ "items": {
633
+ "type": "string",
634
+ },
635
+ "type": "array",
636
+ },
590
637
  "salt": {
591
638
  "type": "string",
592
639
  },
640
+ "tokenEpoch": {
641
+ "default": 0,
642
+ "description": "Incremented on password reset to invalidate outstanding refresh tokens",
643
+ "type": "number",
644
+ },
593
645
  "updated": {
594
646
  "description": "When this document was last updated",
595
647
  "format": "date-time",
@@ -636,10 +688,10 @@ exports[`openApi gets the openapi.json 1`] = `
636
688
  },
637
689
  "userId": {
638
690
  "description": "The user who liked the item",
691
+ "format": "objectid",
639
692
  "type": "string",
640
693
  },
641
694
  },
642
- "required": [],
643
695
  "type": "object",
644
696
  },
645
697
  "type": "array",
@@ -682,6 +734,11 @@ exports[`openApi gets the openapi.json 1`] = `
682
734
  "email": {
683
735
  "type": "string",
684
736
  },
737
+ "emailVerified": {
738
+ "default": false,
739
+ "description": "Whether the user has verified their email address",
740
+ "type": "boolean",
741
+ },
685
742
  "hash": {
686
743
  "type": "string",
687
744
  },
@@ -701,9 +758,22 @@ exports[`openApi gets the openapi.json 1`] = `
701
758
  },
702
759
  "type": "array",
703
760
  },
761
+ "roles": {
762
+ "default": [],
763
+ "description": "RBAC role names assigned to this user",
764
+ "items": {
765
+ "type": "string",
766
+ },
767
+ "type": "array",
768
+ },
704
769
  "salt": {
705
770
  "type": "string",
706
771
  },
772
+ "tokenEpoch": {
773
+ "default": 0,
774
+ "description": "Incremented on password reset to invalidate outstanding refresh tokens",
775
+ "type": "number",
776
+ },
707
777
  "updated": {
708
778
  "description": "When this document was last updated",
709
779
  "format": "date-time",
@@ -784,7 +854,6 @@ exports[`openApi gets the openapi.json 1`] = `
784
854
  "type": "string",
785
855
  },
786
856
  },
787
- "required": [],
788
857
  "type": "object",
789
858
  },
790
859
  "type": "array",
@@ -832,6 +901,11 @@ exports[`openApi gets the openapi.json 1`] = `
832
901
  "email": {
833
902
  "type": "string",
834
903
  },
904
+ "emailVerified": {
905
+ "default": false,
906
+ "description": "Whether the user has verified their email address",
907
+ "type": "boolean",
908
+ },
835
909
  "hash": {
836
910
  "type": "string",
837
911
  },
@@ -851,9 +925,22 @@ exports[`openApi gets the openapi.json 1`] = `
851
925
  },
852
926
  "type": "array",
853
927
  },
928
+ "roles": {
929
+ "default": [],
930
+ "description": "RBAC role names assigned to this user",
931
+ "items": {
932
+ "type": "string",
933
+ },
934
+ "type": "array",
935
+ },
854
936
  "salt": {
855
937
  "type": "string",
856
938
  },
939
+ "tokenEpoch": {
940
+ "default": 0,
941
+ "description": "Incremented on password reset to invalidate outstanding refresh tokens",
942
+ "type": "number",
943
+ },
857
944
  "updated": {
858
945
  "description": "When this document was last updated",
859
946
  "format": "date-time",
@@ -900,10 +987,10 @@ exports[`openApi gets the openapi.json 1`] = `
900
987
  },
901
988
  "userId": {
902
989
  "description": "The user who liked the item",
990
+ "format": "objectid",
903
991
  "type": "string",
904
992
  },
905
993
  },
906
- "required": [],
907
994
  "type": "object",
908
995
  },
909
996
  "type": "array",
@@ -946,6 +1033,11 @@ exports[`openApi gets the openapi.json 1`] = `
946
1033
  "email": {
947
1034
  "type": "string",
948
1035
  },
1036
+ "emailVerified": {
1037
+ "default": false,
1038
+ "description": "Whether the user has verified their email address",
1039
+ "type": "boolean",
1040
+ },
949
1041
  "hash": {
950
1042
  "type": "string",
951
1043
  },
@@ -965,9 +1057,22 @@ exports[`openApi gets the openapi.json 1`] = `
965
1057
  },
966
1058
  "type": "array",
967
1059
  },
1060
+ "roles": {
1061
+ "default": [],
1062
+ "description": "RBAC role names assigned to this user",
1063
+ "items": {
1064
+ "type": "string",
1065
+ },
1066
+ "type": "array",
1067
+ },
968
1068
  "salt": {
969
1069
  "type": "string",
970
1070
  },
1071
+ "tokenEpoch": {
1072
+ "default": 0,
1073
+ "description": "Incremented on password reset to invalidate outstanding refresh tokens",
1074
+ "type": "number",
1075
+ },
971
1076
  "updated": {
972
1077
  "description": "When this document was last updated",
973
1078
  "format": "date-time",
@@ -1178,7 +1283,6 @@ exports[`openApi gets the openapi.json 1`] = `
1178
1283
  "type": "string",
1179
1284
  },
1180
1285
  },
1181
- "required": [],
1182
1286
  "type": "object",
1183
1287
  },
1184
1288
  "type": "array",
@@ -1226,6 +1330,11 @@ exports[`openApi gets the openapi.json 1`] = `
1226
1330
  "email": {
1227
1331
  "type": "string",
1228
1332
  },
1333
+ "emailVerified": {
1334
+ "default": false,
1335
+ "description": "Whether the user has verified their email address",
1336
+ "type": "boolean",
1337
+ },
1229
1338
  "hash": {
1230
1339
  "type": "string",
1231
1340
  },
@@ -1245,9 +1354,22 @@ exports[`openApi gets the openapi.json 1`] = `
1245
1354
  },
1246
1355
  "type": "array",
1247
1356
  },
1357
+ "roles": {
1358
+ "default": [],
1359
+ "description": "RBAC role names assigned to this user",
1360
+ "items": {
1361
+ "type": "string",
1362
+ },
1363
+ "type": "array",
1364
+ },
1248
1365
  "salt": {
1249
1366
  "type": "string",
1250
1367
  },
1368
+ "tokenEpoch": {
1369
+ "default": 0,
1370
+ "description": "Incremented on password reset to invalidate outstanding refresh tokens",
1371
+ "type": "number",
1372
+ },
1251
1373
  "updated": {
1252
1374
  "description": "When this document was last updated",
1253
1375
  "format": "date-time",
@@ -1294,10 +1416,10 @@ exports[`openApi gets the openapi.json 1`] = `
1294
1416
  },
1295
1417
  "userId": {
1296
1418
  "description": "The user who liked the item",
1419
+ "format": "objectid",
1297
1420
  "type": "string",
1298
1421
  },
1299
1422
  },
1300
- "required": [],
1301
1423
  "type": "object",
1302
1424
  },
1303
1425
  "type": "array",
@@ -1340,6 +1462,11 @@ exports[`openApi gets the openapi.json 1`] = `
1340
1462
  "email": {
1341
1463
  "type": "string",
1342
1464
  },
1465
+ "emailVerified": {
1466
+ "default": false,
1467
+ "description": "Whether the user has verified their email address",
1468
+ "type": "boolean",
1469
+ },
1343
1470
  "hash": {
1344
1471
  "type": "string",
1345
1472
  },
@@ -1359,9 +1486,22 @@ exports[`openApi gets the openapi.json 1`] = `
1359
1486
  },
1360
1487
  "type": "array",
1361
1488
  },
1489
+ "roles": {
1490
+ "default": [],
1491
+ "description": "RBAC role names assigned to this user",
1492
+ "items": {
1493
+ "type": "string",
1494
+ },
1495
+ "type": "array",
1496
+ },
1362
1497
  "salt": {
1363
1498
  "type": "string",
1364
1499
  },
1500
+ "tokenEpoch": {
1501
+ "default": 0,
1502
+ "description": "Incremented on password reset to invalidate outstanding refresh tokens",
1503
+ "type": "number",
1504
+ },
1365
1505
  "updated": {
1366
1506
  "description": "When this document was last updated",
1367
1507
  "format": "date-time",
@@ -1506,7 +1646,6 @@ exports[`openApi gets the openapi.json 1`] = `
1506
1646
  "type": "string",
1507
1647
  },
1508
1648
  },
1509
- "required": [],
1510
1649
  "type": "object",
1511
1650
  },
1512
1651
  "type": "array",
@@ -1554,6 +1693,11 @@ exports[`openApi gets the openapi.json 1`] = `
1554
1693
  "email": {
1555
1694
  "type": "string",
1556
1695
  },
1696
+ "emailVerified": {
1697
+ "default": false,
1698
+ "description": "Whether the user has verified their email address",
1699
+ "type": "boolean",
1700
+ },
1557
1701
  "hash": {
1558
1702
  "type": "string",
1559
1703
  },
@@ -1573,9 +1717,22 @@ exports[`openApi gets the openapi.json 1`] = `
1573
1717
  },
1574
1718
  "type": "array",
1575
1719
  },
1720
+ "roles": {
1721
+ "default": [],
1722
+ "description": "RBAC role names assigned to this user",
1723
+ "items": {
1724
+ "type": "string",
1725
+ },
1726
+ "type": "array",
1727
+ },
1576
1728
  "salt": {
1577
1729
  "type": "string",
1578
1730
  },
1731
+ "tokenEpoch": {
1732
+ "default": 0,
1733
+ "description": "Incremented on password reset to invalidate outstanding refresh tokens",
1734
+ "type": "number",
1735
+ },
1579
1736
  "updated": {
1580
1737
  "description": "When this document was last updated",
1581
1738
  "format": "date-time",
@@ -1622,10 +1779,10 @@ exports[`openApi gets the openapi.json 1`] = `
1622
1779
  },
1623
1780
  "userId": {
1624
1781
  "description": "The user who liked the item",
1782
+ "format": "objectid",
1625
1783
  "type": "string",
1626
1784
  },
1627
1785
  },
1628
- "required": [],
1629
1786
  "type": "object",
1630
1787
  },
1631
1788
  "type": "array",
@@ -1668,6 +1825,11 @@ exports[`openApi gets the openapi.json 1`] = `
1668
1825
  "email": {
1669
1826
  "type": "string",
1670
1827
  },
1828
+ "emailVerified": {
1829
+ "default": false,
1830
+ "description": "Whether the user has verified their email address",
1831
+ "type": "boolean",
1832
+ },
1671
1833
  "hash": {
1672
1834
  "type": "string",
1673
1835
  },
@@ -1687,9 +1849,22 @@ exports[`openApi gets the openapi.json 1`] = `
1687
1849
  },
1688
1850
  "type": "array",
1689
1851
  },
1852
+ "roles": {
1853
+ "default": [],
1854
+ "description": "RBAC role names assigned to this user",
1855
+ "items": {
1856
+ "type": "string",
1857
+ },
1858
+ "type": "array",
1859
+ },
1690
1860
  "salt": {
1691
1861
  "type": "string",
1692
1862
  },
1863
+ "tokenEpoch": {
1864
+ "default": 0,
1865
+ "description": "Incremented on password reset to invalidate outstanding refresh tokens",
1866
+ "type": "number",
1867
+ },
1693
1868
  "updated": {
1694
1869
  "description": "When this document was last updated",
1695
1870
  "format": "date-time",
@@ -1770,7 +1945,6 @@ exports[`openApi gets the openapi.json 1`] = `
1770
1945
  "type": "string",
1771
1946
  },
1772
1947
  },
1773
- "required": [],
1774
1948
  "type": "object",
1775
1949
  },
1776
1950
  "type": "array",
@@ -1818,6 +1992,11 @@ exports[`openApi gets the openapi.json 1`] = `
1818
1992
  "email": {
1819
1993
  "type": "string",
1820
1994
  },
1995
+ "emailVerified": {
1996
+ "default": false,
1997
+ "description": "Whether the user has verified their email address",
1998
+ "type": "boolean",
1999
+ },
1821
2000
  "hash": {
1822
2001
  "type": "string",
1823
2002
  },
@@ -1837,9 +2016,22 @@ exports[`openApi gets the openapi.json 1`] = `
1837
2016
  },
1838
2017
  "type": "array",
1839
2018
  },
2019
+ "roles": {
2020
+ "default": [],
2021
+ "description": "RBAC role names assigned to this user",
2022
+ "items": {
2023
+ "type": "string",
2024
+ },
2025
+ "type": "array",
2026
+ },
1840
2027
  "salt": {
1841
2028
  "type": "string",
1842
2029
  },
2030
+ "tokenEpoch": {
2031
+ "default": 0,
2032
+ "description": "Incremented on password reset to invalidate outstanding refresh tokens",
2033
+ "type": "number",
2034
+ },
1843
2035
  "updated": {
1844
2036
  "description": "When this document was last updated",
1845
2037
  "format": "date-time",
@@ -1886,10 +2078,10 @@ exports[`openApi gets the openapi.json 1`] = `
1886
2078
  },
1887
2079
  "userId": {
1888
2080
  "description": "The user who liked the item",
2081
+ "format": "objectid",
1889
2082
  "type": "string",
1890
2083
  },
1891
2084
  },
1892
- "required": [],
1893
2085
  "type": "object",
1894
2086
  },
1895
2087
  "type": "array",
@@ -1932,6 +2124,11 @@ exports[`openApi gets the openapi.json 1`] = `
1932
2124
  "email": {
1933
2125
  "type": "string",
1934
2126
  },
2127
+ "emailVerified": {
2128
+ "default": false,
2129
+ "description": "Whether the user has verified their email address",
2130
+ "type": "boolean",
2131
+ },
1935
2132
  "hash": {
1936
2133
  "type": "string",
1937
2134
  },
@@ -1951,9 +2148,22 @@ exports[`openApi gets the openapi.json 1`] = `
1951
2148
  },
1952
2149
  "type": "array",
1953
2150
  },
2151
+ "roles": {
2152
+ "default": [],
2153
+ "description": "RBAC role names assigned to this user",
2154
+ "items": {
2155
+ "type": "string",
2156
+ },
2157
+ "type": "array",
2158
+ },
1954
2159
  "salt": {
1955
2160
  "type": "string",
1956
2161
  },
2162
+ "tokenEpoch": {
2163
+ "default": 0,
2164
+ "description": "Incremented on password reset to invalidate outstanding refresh tokens",
2165
+ "type": "number",
2166
+ },
1957
2167
  "updated": {
1958
2168
  "description": "When this document was last updated",
1959
2169
  "format": "date-time",
@@ -2241,7 +2451,6 @@ exports[`openApi gets the openapi.json with custom endpoint 1`] = `
2241
2451
  "type": "string",
2242
2452
  },
2243
2453
  },
2244
- "required": [],
2245
2454
  "type": "object",
2246
2455
  },
2247
2456
  "type": "array",
@@ -2289,6 +2498,11 @@ exports[`openApi gets the openapi.json with custom endpoint 1`] = `
2289
2498
  "email": {
2290
2499
  "type": "string",
2291
2500
  },
2501
+ "emailVerified": {
2502
+ "default": false,
2503
+ "description": "Whether the user has verified their email address",
2504
+ "type": "boolean",
2505
+ },
2292
2506
  "hash": {
2293
2507
  "type": "string",
2294
2508
  },
@@ -2308,9 +2522,22 @@ exports[`openApi gets the openapi.json with custom endpoint 1`] = `
2308
2522
  },
2309
2523
  "type": "array",
2310
2524
  },
2525
+ "roles": {
2526
+ "default": [],
2527
+ "description": "RBAC role names assigned to this user",
2528
+ "items": {
2529
+ "type": "string",
2530
+ },
2531
+ "type": "array",
2532
+ },
2311
2533
  "salt": {
2312
2534
  "type": "string",
2313
2535
  },
2536
+ "tokenEpoch": {
2537
+ "default": 0,
2538
+ "description": "Incremented on password reset to invalidate outstanding refresh tokens",
2539
+ "type": "number",
2540
+ },
2314
2541
  "updated": {
2315
2542
  "description": "When this document was last updated",
2316
2543
  "format": "date-time",
@@ -2357,10 +2584,10 @@ exports[`openApi gets the openapi.json with custom endpoint 1`] = `
2357
2584
  },
2358
2585
  "userId": {
2359
2586
  "description": "The user who liked the item",
2587
+ "format": "objectid",
2360
2588
  "type": "string",
2361
2589
  },
2362
2590
  },
2363
- "required": [],
2364
2591
  "type": "object",
2365
2592
  },
2366
2593
  "type": "array",
@@ -2403,6 +2630,11 @@ exports[`openApi gets the openapi.json with custom endpoint 1`] = `
2403
2630
  "email": {
2404
2631
  "type": "string",
2405
2632
  },
2633
+ "emailVerified": {
2634
+ "default": false,
2635
+ "description": "Whether the user has verified their email address",
2636
+ "type": "boolean",
2637
+ },
2406
2638
  "hash": {
2407
2639
  "type": "string",
2408
2640
  },
@@ -2422,9 +2654,22 @@ exports[`openApi gets the openapi.json with custom endpoint 1`] = `
2422
2654
  },
2423
2655
  "type": "array",
2424
2656
  },
2657
+ "roles": {
2658
+ "default": [],
2659
+ "description": "RBAC role names assigned to this user",
2660
+ "items": {
2661
+ "type": "string",
2662
+ },
2663
+ "type": "array",
2664
+ },
2425
2665
  "salt": {
2426
2666
  "type": "string",
2427
2667
  },
2668
+ "tokenEpoch": {
2669
+ "default": 0,
2670
+ "description": "Incremented on password reset to invalidate outstanding refresh tokens",
2671
+ "type": "number",
2672
+ },
2428
2673
  "updated": {
2429
2674
  "description": "When this document was last updated",
2430
2675
  "format": "date-time",
@@ -2576,7 +2821,6 @@ exports[`openApi gets the openapi.json with custom endpoint 1`] = `
2576
2821
  "type": "string",
2577
2822
  },
2578
2823
  },
2579
- "required": [],
2580
2824
  "type": "object",
2581
2825
  },
2582
2826
  "type": "array",
@@ -2624,6 +2868,11 @@ exports[`openApi gets the openapi.json with custom endpoint 1`] = `
2624
2868
  "email": {
2625
2869
  "type": "string",
2626
2870
  },
2871
+ "emailVerified": {
2872
+ "default": false,
2873
+ "description": "Whether the user has verified their email address",
2874
+ "type": "boolean",
2875
+ },
2627
2876
  "hash": {
2628
2877
  "type": "string",
2629
2878
  },
@@ -2643,9 +2892,22 @@ exports[`openApi gets the openapi.json with custom endpoint 1`] = `
2643
2892
  },
2644
2893
  "type": "array",
2645
2894
  },
2895
+ "roles": {
2896
+ "default": [],
2897
+ "description": "RBAC role names assigned to this user",
2898
+ "items": {
2899
+ "type": "string",
2900
+ },
2901
+ "type": "array",
2902
+ },
2646
2903
  "salt": {
2647
2904
  "type": "string",
2648
2905
  },
2906
+ "tokenEpoch": {
2907
+ "default": 0,
2908
+ "description": "Incremented on password reset to invalidate outstanding refresh tokens",
2909
+ "type": "number",
2910
+ },
2649
2911
  "updated": {
2650
2912
  "description": "When this document was last updated",
2651
2913
  "format": "date-time",
@@ -2692,10 +2954,10 @@ exports[`openApi gets the openapi.json with custom endpoint 1`] = `
2692
2954
  },
2693
2955
  "userId": {
2694
2956
  "description": "The user who liked the item",
2957
+ "format": "objectid",
2695
2958
  "type": "string",
2696
2959
  },
2697
2960
  },
2698
- "required": [],
2699
2961
  "type": "object",
2700
2962
  },
2701
2963
  "type": "array",
@@ -2738,6 +3000,11 @@ exports[`openApi gets the openapi.json with custom endpoint 1`] = `
2738
3000
  "email": {
2739
3001
  "type": "string",
2740
3002
  },
3003
+ "emailVerified": {
3004
+ "default": false,
3005
+ "description": "Whether the user has verified their email address",
3006
+ "type": "boolean",
3007
+ },
2741
3008
  "hash": {
2742
3009
  "type": "string",
2743
3010
  },
@@ -2757,9 +3024,22 @@ exports[`openApi gets the openapi.json with custom endpoint 1`] = `
2757
3024
  },
2758
3025
  "type": "array",
2759
3026
  },
3027
+ "roles": {
3028
+ "default": [],
3029
+ "description": "RBAC role names assigned to this user",
3030
+ "items": {
3031
+ "type": "string",
3032
+ },
3033
+ "type": "array",
3034
+ },
2760
3035
  "salt": {
2761
3036
  "type": "string",
2762
3037
  },
3038
+ "tokenEpoch": {
3039
+ "default": 0,
3040
+ "description": "Incremented on password reset to invalidate outstanding refresh tokens",
3041
+ "type": "number",
3042
+ },
2763
3043
  "updated": {
2764
3044
  "description": "When this document was last updated",
2765
3045
  "format": "date-time",
@@ -2840,7 +3120,6 @@ exports[`openApi gets the openapi.json with custom endpoint 1`] = `
2840
3120
  "type": "string",
2841
3121
  },
2842
3122
  },
2843
- "required": [],
2844
3123
  "type": "object",
2845
3124
  },
2846
3125
  "type": "array",
@@ -2888,6 +3167,11 @@ exports[`openApi gets the openapi.json with custom endpoint 1`] = `
2888
3167
  "email": {
2889
3168
  "type": "string",
2890
3169
  },
3170
+ "emailVerified": {
3171
+ "default": false,
3172
+ "description": "Whether the user has verified their email address",
3173
+ "type": "boolean",
3174
+ },
2891
3175
  "hash": {
2892
3176
  "type": "string",
2893
3177
  },
@@ -2907,9 +3191,22 @@ exports[`openApi gets the openapi.json with custom endpoint 1`] = `
2907
3191
  },
2908
3192
  "type": "array",
2909
3193
  },
3194
+ "roles": {
3195
+ "default": [],
3196
+ "description": "RBAC role names assigned to this user",
3197
+ "items": {
3198
+ "type": "string",
3199
+ },
3200
+ "type": "array",
3201
+ },
2910
3202
  "salt": {
2911
3203
  "type": "string",
2912
3204
  },
3205
+ "tokenEpoch": {
3206
+ "default": 0,
3207
+ "description": "Incremented on password reset to invalidate outstanding refresh tokens",
3208
+ "type": "number",
3209
+ },
2913
3210
  "updated": {
2914
3211
  "description": "When this document was last updated",
2915
3212
  "format": "date-time",
@@ -2956,10 +3253,10 @@ exports[`openApi gets the openapi.json with custom endpoint 1`] = `
2956
3253
  },
2957
3254
  "userId": {
2958
3255
  "description": "The user who liked the item",
3256
+ "format": "objectid",
2959
3257
  "type": "string",
2960
3258
  },
2961
3259
  },
2962
- "required": [],
2963
3260
  "type": "object",
2964
3261
  },
2965
3262
  "type": "array",
@@ -3002,6 +3299,11 @@ exports[`openApi gets the openapi.json with custom endpoint 1`] = `
3002
3299
  "email": {
3003
3300
  "type": "string",
3004
3301
  },
3302
+ "emailVerified": {
3303
+ "default": false,
3304
+ "description": "Whether the user has verified their email address",
3305
+ "type": "boolean",
3306
+ },
3005
3307
  "hash": {
3006
3308
  "type": "string",
3007
3309
  },
@@ -3021,9 +3323,22 @@ exports[`openApi gets the openapi.json with custom endpoint 1`] = `
3021
3323
  },
3022
3324
  "type": "array",
3023
3325
  },
3326
+ "roles": {
3327
+ "default": [],
3328
+ "description": "RBAC role names assigned to this user",
3329
+ "items": {
3330
+ "type": "string",
3331
+ },
3332
+ "type": "array",
3333
+ },
3024
3334
  "salt": {
3025
3335
  "type": "string",
3026
3336
  },
3337
+ "tokenEpoch": {
3338
+ "default": 0,
3339
+ "description": "Incremented on password reset to invalidate outstanding refresh tokens",
3340
+ "type": "number",
3341
+ },
3027
3342
  "updated": {
3028
3343
  "description": "When this document was last updated",
3029
3344
  "format": "date-time",
@@ -3234,7 +3549,6 @@ exports[`openApi gets the openapi.json with custom endpoint 1`] = `
3234
3549
  "type": "string",
3235
3550
  },
3236
3551
  },
3237
- "required": [],
3238
3552
  "type": "object",
3239
3553
  },
3240
3554
  "type": "array",
@@ -3282,6 +3596,11 @@ exports[`openApi gets the openapi.json with custom endpoint 1`] = `
3282
3596
  "email": {
3283
3597
  "type": "string",
3284
3598
  },
3599
+ "emailVerified": {
3600
+ "default": false,
3601
+ "description": "Whether the user has verified their email address",
3602
+ "type": "boolean",
3603
+ },
3285
3604
  "hash": {
3286
3605
  "type": "string",
3287
3606
  },
@@ -3301,9 +3620,22 @@ exports[`openApi gets the openapi.json with custom endpoint 1`] = `
3301
3620
  },
3302
3621
  "type": "array",
3303
3622
  },
3623
+ "roles": {
3624
+ "default": [],
3625
+ "description": "RBAC role names assigned to this user",
3626
+ "items": {
3627
+ "type": "string",
3628
+ },
3629
+ "type": "array",
3630
+ },
3304
3631
  "salt": {
3305
3632
  "type": "string",
3306
3633
  },
3634
+ "tokenEpoch": {
3635
+ "default": 0,
3636
+ "description": "Incremented on password reset to invalidate outstanding refresh tokens",
3637
+ "type": "number",
3638
+ },
3307
3639
  "updated": {
3308
3640
  "description": "When this document was last updated",
3309
3641
  "format": "date-time",
@@ -3350,10 +3682,10 @@ exports[`openApi gets the openapi.json with custom endpoint 1`] = `
3350
3682
  },
3351
3683
  "userId": {
3352
3684
  "description": "The user who liked the item",
3685
+ "format": "objectid",
3353
3686
  "type": "string",
3354
3687
  },
3355
3688
  },
3356
- "required": [],
3357
3689
  "type": "object",
3358
3690
  },
3359
3691
  "type": "array",
@@ -3396,6 +3728,11 @@ exports[`openApi gets the openapi.json with custom endpoint 1`] = `
3396
3728
  "email": {
3397
3729
  "type": "string",
3398
3730
  },
3731
+ "emailVerified": {
3732
+ "default": false,
3733
+ "description": "Whether the user has verified their email address",
3734
+ "type": "boolean",
3735
+ },
3399
3736
  "hash": {
3400
3737
  "type": "string",
3401
3738
  },
@@ -3415,9 +3752,22 @@ exports[`openApi gets the openapi.json with custom endpoint 1`] = `
3415
3752
  },
3416
3753
  "type": "array",
3417
3754
  },
3755
+ "roles": {
3756
+ "default": [],
3757
+ "description": "RBAC role names assigned to this user",
3758
+ "items": {
3759
+ "type": "string",
3760
+ },
3761
+ "type": "array",
3762
+ },
3418
3763
  "salt": {
3419
3764
  "type": "string",
3420
3765
  },
3766
+ "tokenEpoch": {
3767
+ "default": 0,
3768
+ "description": "Incremented on password reset to invalidate outstanding refresh tokens",
3769
+ "type": "number",
3770
+ },
3421
3771
  "updated": {
3422
3772
  "description": "When this document was last updated",
3423
3773
  "format": "date-time",
@@ -3562,7 +3912,6 @@ exports[`openApi gets the openapi.json with custom endpoint 1`] = `
3562
3912
  "type": "string",
3563
3913
  },
3564
3914
  },
3565
- "required": [],
3566
3915
  "type": "object",
3567
3916
  },
3568
3917
  "type": "array",
@@ -3610,6 +3959,11 @@ exports[`openApi gets the openapi.json with custom endpoint 1`] = `
3610
3959
  "email": {
3611
3960
  "type": "string",
3612
3961
  },
3962
+ "emailVerified": {
3963
+ "default": false,
3964
+ "description": "Whether the user has verified their email address",
3965
+ "type": "boolean",
3966
+ },
3613
3967
  "hash": {
3614
3968
  "type": "string",
3615
3969
  },
@@ -3629,9 +3983,22 @@ exports[`openApi gets the openapi.json with custom endpoint 1`] = `
3629
3983
  },
3630
3984
  "type": "array",
3631
3985
  },
3986
+ "roles": {
3987
+ "default": [],
3988
+ "description": "RBAC role names assigned to this user",
3989
+ "items": {
3990
+ "type": "string",
3991
+ },
3992
+ "type": "array",
3993
+ },
3632
3994
  "salt": {
3633
3995
  "type": "string",
3634
3996
  },
3997
+ "tokenEpoch": {
3998
+ "default": 0,
3999
+ "description": "Incremented on password reset to invalidate outstanding refresh tokens",
4000
+ "type": "number",
4001
+ },
3635
4002
  "updated": {
3636
4003
  "description": "When this document was last updated",
3637
4004
  "format": "date-time",
@@ -3678,10 +4045,10 @@ exports[`openApi gets the openapi.json with custom endpoint 1`] = `
3678
4045
  },
3679
4046
  "userId": {
3680
4047
  "description": "The user who liked the item",
4048
+ "format": "objectid",
3681
4049
  "type": "string",
3682
4050
  },
3683
4051
  },
3684
- "required": [],
3685
4052
  "type": "object",
3686
4053
  },
3687
4054
  "type": "array",
@@ -3724,6 +4091,11 @@ exports[`openApi gets the openapi.json with custom endpoint 1`] = `
3724
4091
  "email": {
3725
4092
  "type": "string",
3726
4093
  },
4094
+ "emailVerified": {
4095
+ "default": false,
4096
+ "description": "Whether the user has verified their email address",
4097
+ "type": "boolean",
4098
+ },
3727
4099
  "hash": {
3728
4100
  "type": "string",
3729
4101
  },
@@ -3743,9 +4115,22 @@ exports[`openApi gets the openapi.json with custom endpoint 1`] = `
3743
4115
  },
3744
4116
  "type": "array",
3745
4117
  },
4118
+ "roles": {
4119
+ "default": [],
4120
+ "description": "RBAC role names assigned to this user",
4121
+ "items": {
4122
+ "type": "string",
4123
+ },
4124
+ "type": "array",
4125
+ },
3746
4126
  "salt": {
3747
4127
  "type": "string",
3748
4128
  },
4129
+ "tokenEpoch": {
4130
+ "default": 0,
4131
+ "description": "Incremented on password reset to invalidate outstanding refresh tokens",
4132
+ "type": "number",
4133
+ },
3749
4134
  "updated": {
3750
4135
  "description": "When this document was last updated",
3751
4136
  "format": "date-time",
@@ -3826,7 +4211,6 @@ exports[`openApi gets the openapi.json with custom endpoint 1`] = `
3826
4211
  "type": "string",
3827
4212
  },
3828
4213
  },
3829
- "required": [],
3830
4214
  "type": "object",
3831
4215
  },
3832
4216
  "type": "array",
@@ -3874,6 +4258,11 @@ exports[`openApi gets the openapi.json with custom endpoint 1`] = `
3874
4258
  "email": {
3875
4259
  "type": "string",
3876
4260
  },
4261
+ "emailVerified": {
4262
+ "default": false,
4263
+ "description": "Whether the user has verified their email address",
4264
+ "type": "boolean",
4265
+ },
3877
4266
  "hash": {
3878
4267
  "type": "string",
3879
4268
  },
@@ -3893,9 +4282,22 @@ exports[`openApi gets the openapi.json with custom endpoint 1`] = `
3893
4282
  },
3894
4283
  "type": "array",
3895
4284
  },
4285
+ "roles": {
4286
+ "default": [],
4287
+ "description": "RBAC role names assigned to this user",
4288
+ "items": {
4289
+ "type": "string",
4290
+ },
4291
+ "type": "array",
4292
+ },
3896
4293
  "salt": {
3897
4294
  "type": "string",
3898
4295
  },
4296
+ "tokenEpoch": {
4297
+ "default": 0,
4298
+ "description": "Incremented on password reset to invalidate outstanding refresh tokens",
4299
+ "type": "number",
4300
+ },
3899
4301
  "updated": {
3900
4302
  "description": "When this document was last updated",
3901
4303
  "format": "date-time",
@@ -3942,10 +4344,10 @@ exports[`openApi gets the openapi.json with custom endpoint 1`] = `
3942
4344
  },
3943
4345
  "userId": {
3944
4346
  "description": "The user who liked the item",
4347
+ "format": "objectid",
3945
4348
  "type": "string",
3946
4349
  },
3947
4350
  },
3948
- "required": [],
3949
4351
  "type": "object",
3950
4352
  },
3951
4353
  "type": "array",
@@ -3988,6 +4390,11 @@ exports[`openApi gets the openapi.json with custom endpoint 1`] = `
3988
4390
  "email": {
3989
4391
  "type": "string",
3990
4392
  },
4393
+ "emailVerified": {
4394
+ "default": false,
4395
+ "description": "Whether the user has verified their email address",
4396
+ "type": "boolean",
4397
+ },
3991
4398
  "hash": {
3992
4399
  "type": "string",
3993
4400
  },
@@ -4007,9 +4414,22 @@ exports[`openApi gets the openapi.json with custom endpoint 1`] = `
4007
4414
  },
4008
4415
  "type": "array",
4009
4416
  },
4417
+ "roles": {
4418
+ "default": [],
4419
+ "description": "RBAC role names assigned to this user",
4420
+ "items": {
4421
+ "type": "string",
4422
+ },
4423
+ "type": "array",
4424
+ },
4010
4425
  "salt": {
4011
4426
  "type": "string",
4012
4427
  },
4428
+ "tokenEpoch": {
4429
+ "default": 0,
4430
+ "description": "Incremented on password reset to invalidate outstanding refresh tokens",
4431
+ "type": "number",
4432
+ },
4013
4433
  "updated": {
4014
4434
  "description": "When this document was last updated",
4015
4435
  "format": "date-time",
@@ -4313,7 +4733,6 @@ exports[`openApi populate gets the openapi.json with populate 1`] = `
4313
4733
  "type": "string",
4314
4734
  },
4315
4735
  },
4316
- "required": [],
4317
4736
  "type": "object",
4318
4737
  },
4319
4738
  "type": "array",
@@ -4366,7 +4785,6 @@ exports[`openApi populate gets the openapi.json with populate 1`] = `
4366
4785
  "$ref": "#/components/schemas/LimitedUser",
4367
4786
  },
4368
4787
  },
4369
- "required": [],
4370
4788
  "type": "object",
4371
4789
  },
4372
4790
  "type": "array",
@@ -4526,7 +4944,6 @@ exports[`openApi populate gets the openapi.json with populate 1`] = `
4526
4944
  "type": "string",
4527
4945
  },
4528
4946
  },
4529
- "required": [],
4530
4947
  "type": "object",
4531
4948
  },
4532
4949
  "type": "array",
@@ -4579,7 +4996,6 @@ exports[`openApi populate gets the openapi.json with populate 1`] = `
4579
4996
  "$ref": "#/components/schemas/LimitedUser",
4580
4997
  },
4581
4998
  },
4582
- "required": [],
4583
4999
  "type": "object",
4584
5000
  },
4585
5001
  "type": "array",
@@ -4668,7 +5084,6 @@ exports[`openApi populate gets the openapi.json with populate 1`] = `
4668
5084
  "type": "string",
4669
5085
  },
4670
5086
  },
4671
- "required": [],
4672
5087
  "type": "object",
4673
5088
  },
4674
5089
  "type": "array",
@@ -4721,7 +5136,6 @@ exports[`openApi populate gets the openapi.json with populate 1`] = `
4721
5136
  "$ref": "#/components/schemas/LimitedUser",
4722
5137
  },
4723
5138
  },
4724
- "required": [],
4725
5139
  "type": "object",
4726
5140
  },
4727
5141
  "type": "array",
@@ -4940,7 +5354,6 @@ exports[`openApi populate gets the openapi.json with populate 1`] = `
4940
5354
  "type": "string",
4941
5355
  },
4942
5356
  },
4943
- "required": [],
4944
5357
  "type": "object",
4945
5358
  },
4946
5359
  "type": "array",
@@ -4993,7 +5406,6 @@ exports[`openApi populate gets the openapi.json with populate 1`] = `
4993
5406
  "$ref": "#/components/schemas/LimitedUser",
4994
5407
  },
4995
5408
  },
4996
- "required": [],
4997
5409
  "type": "object",
4998
5410
  },
4999
5411
  "type": "array",
@@ -5146,7 +5558,6 @@ exports[`openApi populate gets the openapi.json with populate 1`] = `
5146
5558
  "type": "string",
5147
5559
  },
5148
5560
  },
5149
- "required": [],
5150
5561
  "type": "object",
5151
5562
  },
5152
5563
  "type": "array",
@@ -5199,7 +5610,6 @@ exports[`openApi populate gets the openapi.json with populate 1`] = `
5199
5610
  "$ref": "#/components/schemas/LimitedUser",
5200
5611
  },
5201
5612
  },
5202
- "required": [],
5203
5613
  "type": "object",
5204
5614
  },
5205
5615
  "type": "array",
@@ -5288,7 +5698,6 @@ exports[`openApi populate gets the openapi.json with populate 1`] = `
5288
5698
  "type": "string",
5289
5699
  },
5290
5700
  },
5291
- "required": [],
5292
5701
  "type": "object",
5293
5702
  },
5294
5703
  "type": "array",
@@ -5341,7 +5750,6 @@ exports[`openApi populate gets the openapi.json with populate 1`] = `
5341
5750
  "$ref": "#/components/schemas/LimitedUser",
5342
5751
  },
5343
5752
  },
5344
- "required": [],
5345
5753
  "type": "object",
5346
5754
  },
5347
5755
  "type": "array",