@terreno/api 57.20.0 → 58.0.0-beta.1

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 (183) hide show
  1. package/CHANGELOG.md +93 -0
  2. package/README.md +1 -1
  3. package/biome.jsonc +3 -2
  4. package/dist/api.d.ts +3 -16
  5. package/dist/api.js +0 -9
  6. package/dist/auth.d.ts +3 -2
  7. package/dist/auth.js +95 -5
  8. package/dist/authRecovery.d.ts +2 -1
  9. package/dist/authRecovery.js +35 -17
  10. package/dist/collectionRegistry.d.ts +3 -4
  11. package/dist/collectionRegistry.js +0 -1
  12. package/dist/consentApp.d.ts +1 -1
  13. package/dist/consentApp.js +58 -2
  14. package/dist/frameworkModelNames.d.ts +4 -0
  15. package/dist/frameworkModelNames.js +4 -0
  16. package/dist/index.d.ts +8 -5
  17. package/dist/index.js +14 -20
  18. package/dist/mcp/adminTracking.d.ts +28 -0
  19. package/dist/mcp/adminTracking.js +80 -0
  20. package/dist/mcp/auth.d.ts +6 -0
  21. package/dist/mcp/auth.js +12 -2
  22. package/dist/mcp/server.d.ts +8 -0
  23. package/dist/mcp/server.js +48 -4
  24. package/dist/mcp/serviceTokens.d.ts +21 -1
  25. package/dist/mcp/serviceTokens.js +159 -183
  26. package/dist/migrations/builtin/mcpServiceTokenStringIds.d.ts +18 -0
  27. package/dist/migrations/builtin/mcpServiceTokenStringIds.js +67 -0
  28. package/dist/models/mcpOAuthToken.js +27 -0
  29. package/dist/models/mcpRequestLog.d.ts +2 -0
  30. package/dist/models/mcpRequestLog.js +73 -0
  31. package/dist/models/mcpServiceToken.js +40 -4
  32. package/dist/models/mcpToolSetting.d.ts +2 -0
  33. package/dist/models/mcpToolSetting.js +119 -0
  34. package/dist/models/versionConfig.d.ts +2 -0
  35. package/dist/openApiBuilder.d.ts +4 -0
  36. package/dist/openApiBuilder.js +2 -0
  37. package/dist/rbac/auditModel.d.ts +2 -1
  38. package/dist/rbac/realtimeAccess.d.ts +5 -4
  39. package/dist/rbac/realtimeAccess.js +17 -64
  40. package/dist/realtime/changeStreamWatcher.d.ts +8 -63
  41. package/dist/realtime/changeStreamWatcher.js +32 -391
  42. package/dist/realtime/realtimeApp.d.ts +14 -27
  43. package/dist/realtime/realtimeApp.js +14 -220
  44. package/dist/realtime/types.d.ts +0 -64
  45. package/dist/sync/executors.js +14 -2
  46. package/dist/sync/socketHandlers.d.ts +1 -1
  47. package/dist/sync/socketHandlers.js +1 -1
  48. package/dist/terrenoApp.d.ts +19 -5
  49. package/dist/terrenoApp.js +21 -14
  50. package/dist/tests/models.d.ts +17 -22
  51. package/dist/tests/models.js +7 -1
  52. package/dist/tests/openApiResponseSchema.d.ts +39 -0
  53. package/dist/tests/openApiResponseSchema.js +56 -0
  54. package/dist/tests/testHelper.d.ts +6 -12
  55. package/dist/tests.d.ts +2 -0
  56. package/dist/tests.js +6 -1
  57. package/dist/types/mcpAdmin.d.ts +58 -0
  58. package/dist/types/mcpAdmin.js +2 -0
  59. package/dist/types/mcpOAuth.d.ts +2 -0
  60. package/dist/types/mcpServiceToken.d.ts +9 -4
  61. package/dist/versionCheckPlugin.d.ts +1 -1
  62. package/dist/versionCheckPlugin.js +25 -2
  63. package/e2e/smoke.ts +193 -0
  64. package/package.json +14 -8
  65. package/src/__snapshots__/openApi.test.ts.snap +4986 -2478
  66. package/src/__snapshots__/openApiBuilder.test.ts.snap +836 -0
  67. package/src/__tests__/openApiResponseSchema.test.ts +148 -0
  68. package/src/__tests__/versionCheckPlugin.test.ts +72 -0
  69. package/src/adminModelRouter.test.ts +8 -6
  70. package/src/api.arrayOperations.test.ts +31 -22
  71. package/src/api.hooks.test.ts +12 -11
  72. package/src/api.query.test.ts +2 -2
  73. package/src/api.test.ts +17 -14
  74. package/src/api.ts +3 -27
  75. package/src/audit/auditApp.test.ts +1 -1
  76. package/src/audit/cloudTasksEnqueue.test.ts +19 -14
  77. package/src/auth.test.ts +21 -7
  78. package/src/auth.ts +116 -5
  79. package/src/authOpenApi.test.ts +316 -0
  80. package/src/authRecovery.test.ts +10 -10
  81. package/src/authRecovery.ts +47 -19
  82. package/src/authVerification.test.ts +7 -7
  83. package/src/betterAuthFeatures.test.ts +3 -2
  84. package/src/betterAuthLinking.test.ts +3 -1
  85. package/src/betterAuthOAuthHandoff.test.ts +13 -5
  86. package/src/betterAuthSetup.test.ts +77 -51
  87. package/src/collectionRegistry.test.ts +4 -4
  88. package/src/collectionRegistry.ts +3 -5
  89. package/src/consentApp.test.ts +98 -0
  90. package/src/consentApp.ts +67 -2
  91. package/src/frameworkModelNames.test.ts +8 -0
  92. package/src/frameworkModelNames.ts +4 -0
  93. package/src/githubAuth.test.ts +11 -11
  94. package/src/index.ts +14 -28
  95. package/src/isolated/migrateCliConnect.isolated.ts +3 -2
  96. package/src/mcp/actionTools.test.ts +13 -7
  97. package/src/mcp/adminTracking.test.ts +272 -0
  98. package/src/mcp/adminTracking.ts +104 -0
  99. package/src/mcp/auth.test.ts +7 -3
  100. package/src/mcp/auth.ts +18 -2
  101. package/src/mcp/oauth.test.ts +13 -13
  102. package/src/mcp/server.ts +67 -4
  103. package/src/mcp/serviceTokens.sync.test.ts +230 -0
  104. package/src/mcp/serviceTokens.test.ts +114 -62
  105. package/src/mcp/serviceTokens.ts +193 -212
  106. package/src/mcp/toolGenerator.test.ts +9 -5
  107. package/src/migrations/builtin/mcpServiceTokenStringIds.test.ts +194 -0
  108. package/src/migrations/builtin/mcpServiceTokenStringIds.ts +121 -0
  109. package/src/migrations/cli.test.ts +15 -14
  110. package/src/migrations/cli.ts +1 -1
  111. package/src/migrations/generate.test.ts +2 -2
  112. package/src/migrations/load.test.ts +1 -1
  113. package/src/migrations/lock.test.ts +8 -3
  114. package/src/migrations/runner.test.ts +16 -5
  115. package/src/migrations/schemaCatalog.test.ts +4 -1
  116. package/src/models/mcpOAuthToken.test.ts +42 -0
  117. package/src/models/mcpOAuthToken.ts +32 -0
  118. package/src/models/mcpRequestLog.ts +81 -0
  119. package/src/models/mcpServiceToken.test.ts +75 -5
  120. package/src/models/mcpServiceToken.ts +61 -14
  121. package/src/models/mcpToolSetting.test.ts +69 -0
  122. package/src/models/mcpToolSetting.ts +138 -0
  123. package/src/models/versionConfig.ts +2 -0
  124. package/src/notifications/notificationsApp.test.ts +5 -8
  125. package/src/notifiers/slackWebApi.test.ts +30 -8
  126. package/src/openApi.test.ts +4 -4
  127. package/src/openApiBuilder.test.ts +34 -1
  128. package/src/openApiBuilder.ts +5 -0
  129. package/src/openApiValidator.test.ts +3 -3
  130. package/src/orgs/orgPermissions.test.ts +2 -2
  131. package/src/orgs/orgPlugin.test.ts +4 -3
  132. package/src/orgs/orgSecurityDefects.test.ts +3 -1
  133. package/src/orgs/organizationSettings.test.ts +1 -1
  134. package/src/orgs/orgsApp.test.ts +5 -3
  135. package/src/permissions.test.ts +2 -2
  136. package/src/rateLimit/rateLimit.test.ts +25 -10
  137. package/src/rateLimit/redisStore.ioredis.test.ts +3 -2
  138. package/src/rbac/assertAllowed.test.ts +1 -1
  139. package/src/rbac/auditModel.ts +10 -2
  140. package/src/rbac/realtimeAccess.test.ts +20 -171
  141. package/src/rbac/realtimeAccess.ts +17 -82
  142. package/src/rbac/routes.test.ts +1 -1
  143. package/src/rbac/userWriteGuards.test.ts +8 -5
  144. package/src/realtime/changeStreamWatcher.ts +43 -506
  145. package/src/realtime/realtime.test.ts +211 -2547
  146. package/src/realtime/realtimeApp.ts +16 -295
  147. package/src/realtime/types.ts +0 -72
  148. package/src/scrubAdminFields.test.ts +1 -1
  149. package/src/sync/adminWindowMutation.test.ts +4 -3
  150. package/src/sync/executors.test.ts +29 -1
  151. package/src/sync/executors.ts +23 -2
  152. package/src/sync/scripts/compactTombstones.test.ts +4 -3
  153. package/src/sync/socketHandlers.ts +1 -1
  154. package/src/sync/sync.test.ts +1 -1
  155. package/src/sync/syncPhaseC.test.ts +14 -11
  156. package/src/sync/syncRoutes.test.ts +8 -8
  157. package/src/sync/syncSeqPlugin.test.ts +1 -2
  158. package/src/sync/syncSocket.test.ts +78 -113
  159. package/src/terrenoApp.mcpServiceTokens.test.ts +16 -8
  160. package/src/terrenoApp.migrations.test.ts +8 -7
  161. package/src/terrenoApp.ts +38 -18
  162. package/src/tests/betterAuthStubs.ts +3 -2
  163. package/src/tests/bunSetup.ts +1 -1
  164. package/src/tests/models.ts +10 -0
  165. package/src/tests/openApiResponseSchema.ts +104 -0
  166. package/src/tests/testEnv.ts +7 -0
  167. package/src/tests.ts +8 -0
  168. package/src/types/mcpAdmin.ts +80 -0
  169. package/src/types/mcpOAuth.ts +5 -0
  170. package/src/types/mcpServiceToken.ts +12 -4
  171. package/src/versionCheckPlugin.ts +41 -2
  172. package/src/webhooks/verifiers/hmac.test.ts +1 -1
  173. package/tsconfig.typecheck.json +14 -0
  174. package/dist/realtime/deprecation.d.ts +0 -13
  175. package/dist/realtime/deprecation.js +0 -31
  176. package/dist/realtime/queryStore.d.ts +0 -37
  177. package/dist/realtime/queryStore.js +0 -103
  178. package/dist/realtime/registry.d.ts +0 -15
  179. package/dist/realtime/registry.js +0 -52
  180. package/src/realtime/deprecation.test.ts +0 -60
  181. package/src/realtime/deprecation.ts +0 -33
  182. package/src/realtime/queryStore.ts +0 -122
  183. package/src/realtime/registry.ts +0 -84
@@ -72,6 +72,730 @@ exports[`OpenApiMiddlewareBuilder snapshot tests matches OpenAPI spec snapshot 1
72
72
  },
73
73
  "openapi": "3.0.0",
74
74
  "paths": {
75
+ "/auth/forgotPassword": {
76
+ "post": {
77
+ "description": "Always returns 202, whether or not an account exists for the email, so accounts cannot be probed.",
78
+ "requestBody": {
79
+ "content": {
80
+ "application/json": {
81
+ "schema": {
82
+ "properties": {
83
+ "email": {
84
+ "description": "The account's email address",
85
+ "type": "string",
86
+ },
87
+ },
88
+ "type": "object",
89
+ },
90
+ },
91
+ },
92
+ "required": true,
93
+ },
94
+ "responses": {
95
+ "202": {
96
+ "content": {
97
+ "application/json": {
98
+ "schema": {
99
+ "properties": {
100
+ "data": {
101
+ "properties": {
102
+ "ok": {
103
+ "type": "boolean",
104
+ },
105
+ },
106
+ "required": [
107
+ "ok",
108
+ ],
109
+ "type": "object",
110
+ },
111
+ },
112
+ "required": [
113
+ "data",
114
+ ],
115
+ "type": "object",
116
+ },
117
+ },
118
+ },
119
+ "description": "Accepted",
120
+ },
121
+ "400": {
122
+ "content": {
123
+ "application/json": {
124
+ "schema": {
125
+ "$ref": "#/components/schemas/APIError",
126
+ },
127
+ },
128
+ },
129
+ "description": "Bad request",
130
+ },
131
+ "401": {
132
+ "description": "The user must be authenticated",
133
+ },
134
+ "403": {
135
+ "content": {
136
+ "application/json": {
137
+ "schema": {
138
+ "$ref": "#/components/schemas/APIError",
139
+ },
140
+ },
141
+ },
142
+ "description": "The user is not allowed to perform this action on this document",
143
+ },
144
+ "404": {
145
+ "content": {
146
+ "application/json": {
147
+ "schema": {
148
+ "$ref": "#/components/schemas/APIError",
149
+ },
150
+ },
151
+ },
152
+ "description": "Document not found",
153
+ },
154
+ "405": {
155
+ "content": {
156
+ "application/json": {
157
+ "schema": {
158
+ "$ref": "#/components/schemas/APIError",
159
+ },
160
+ },
161
+ },
162
+ "description": "The user is not allowed to perform this action on any document",
163
+ },
164
+ },
165
+ "summary": "Request a password reset email",
166
+ "tags": [
167
+ "auth",
168
+ ],
169
+ },
170
+ },
171
+ "/auth/me": {
172
+ "get": {
173
+ "responses": {
174
+ "200": {
175
+ "content": {
176
+ "application/json": {
177
+ "schema": {
178
+ "properties": {
179
+ "data": {
180
+ "properties": {
181
+ "__t": {
182
+ "type": "string",
183
+ },
184
+ "_id": {
185
+ "type": "string",
186
+ },
187
+ "admin": {
188
+ "description": "Whether the user has admin privileges",
189
+ "type": "boolean",
190
+ },
191
+ "age": {
192
+ "description": "The user's age",
193
+ "type": "number",
194
+ },
195
+ "attempts": {
196
+ "type": "number",
197
+ },
198
+ "created": {
199
+ "description": "When this document was created",
200
+ "format": "date-time",
201
+ "type": "string",
202
+ },
203
+ "disabled": {
204
+ "description": "When a user is set to disable, all requests will return a 401",
205
+ "type": "boolean",
206
+ },
207
+ "email": {
208
+ "type": "string",
209
+ },
210
+ "emailVerified": {
211
+ "description": "Whether the user has verified their email address",
212
+ "type": "boolean",
213
+ },
214
+ "id": {
215
+ "description": "The user's id, the same value as _id",
216
+ "type": "string",
217
+ },
218
+ "last": {
219
+ "format": "date-time",
220
+ "type": "string",
221
+ },
222
+ "name": {
223
+ "description": "The user's display name",
224
+ "type": "string",
225
+ },
226
+ "organizationIds": {
227
+ "description": "Organization memberships",
228
+ "items": {
229
+ "type": "string",
230
+ },
231
+ "type": "array",
232
+ },
233
+ "roles": {
234
+ "description": "RBAC role names assigned to this user",
235
+ "items": {
236
+ "type": "string",
237
+ },
238
+ "type": "array",
239
+ },
240
+ "tokenEpoch": {
241
+ "description": "Incremented on password reset to invalidate outstanding refresh tokens",
242
+ "type": "number",
243
+ },
244
+ "updated": {
245
+ "description": "When this document was last updated",
246
+ "format": "date-time",
247
+ "type": "string",
248
+ },
249
+ "username": {
250
+ "description": "The user's username",
251
+ "type": "string",
252
+ },
253
+ },
254
+ "required": [
255
+ "_id",
256
+ "id",
257
+ ],
258
+ "type": "object",
259
+ },
260
+ },
261
+ "required": [
262
+ "data",
263
+ ],
264
+ "type": "object",
265
+ },
266
+ },
267
+ },
268
+ "description": "Success",
269
+ },
270
+ "400": {
271
+ "content": {
272
+ "application/json": {
273
+ "schema": {
274
+ "$ref": "#/components/schemas/APIError",
275
+ },
276
+ },
277
+ },
278
+ "description": "Bad request",
279
+ },
280
+ "401": {
281
+ "description": "The user must be authenticated",
282
+ },
283
+ "403": {
284
+ "content": {
285
+ "application/json": {
286
+ "schema": {
287
+ "$ref": "#/components/schemas/APIError",
288
+ },
289
+ },
290
+ },
291
+ "description": "The user is not allowed to perform this action on this document",
292
+ },
293
+ "404": {
294
+ "content": {
295
+ "application/json": {
296
+ "schema": {
297
+ "$ref": "#/components/schemas/APIError",
298
+ },
299
+ },
300
+ },
301
+ "description": "Document not found",
302
+ },
303
+ "405": {
304
+ "content": {
305
+ "application/json": {
306
+ "schema": {
307
+ "$ref": "#/components/schemas/APIError",
308
+ },
309
+ },
310
+ },
311
+ "description": "The user is not allowed to perform this action on any document",
312
+ },
313
+ },
314
+ "summary": "Get the current user",
315
+ "tags": [
316
+ "auth",
317
+ ],
318
+ },
319
+ "patch": {
320
+ "description": "Partial update of the current user. Privileged fields (admin, roles, organizationIds, emailVerified, tokenEpoch) are ignored.",
321
+ "requestBody": {
322
+ "content": {
323
+ "application/json": {
324
+ "schema": {
325
+ "properties": {
326
+ "__t": {
327
+ "type": "string",
328
+ },
329
+ "age": {
330
+ "description": "The user's age",
331
+ "type": "number",
332
+ },
333
+ "attempts": {
334
+ "type": "number",
335
+ },
336
+ "currentPassword": {
337
+ "description": "The current password; required to change the email. It is never stored.",
338
+ "type": "string",
339
+ },
340
+ "disabled": {
341
+ "description": "When a user is set to disable, all requests will return a 401",
342
+ "type": "boolean",
343
+ },
344
+ "email": {
345
+ "type": "string",
346
+ },
347
+ "last": {
348
+ "format": "date-time",
349
+ "type": "string",
350
+ },
351
+ "name": {
352
+ "description": "The user's display name",
353
+ "type": "string",
354
+ },
355
+ "username": {
356
+ "description": "The user's username",
357
+ "type": "string",
358
+ },
359
+ },
360
+ "type": "object",
361
+ },
362
+ },
363
+ },
364
+ "required": true,
365
+ },
366
+ "responses": {
367
+ "200": {
368
+ "content": {
369
+ "application/json": {
370
+ "schema": {
371
+ "properties": {
372
+ "data": {
373
+ "properties": {
374
+ "__t": {
375
+ "type": "string",
376
+ },
377
+ "_id": {
378
+ "type": "string",
379
+ },
380
+ "admin": {
381
+ "description": "Whether the user has admin privileges",
382
+ "type": "boolean",
383
+ },
384
+ "age": {
385
+ "description": "The user's age",
386
+ "type": "number",
387
+ },
388
+ "attempts": {
389
+ "type": "number",
390
+ },
391
+ "created": {
392
+ "description": "When this document was created",
393
+ "format": "date-time",
394
+ "type": "string",
395
+ },
396
+ "disabled": {
397
+ "description": "When a user is set to disable, all requests will return a 401",
398
+ "type": "boolean",
399
+ },
400
+ "email": {
401
+ "type": "string",
402
+ },
403
+ "emailVerified": {
404
+ "description": "Whether the user has verified their email address",
405
+ "type": "boolean",
406
+ },
407
+ "id": {
408
+ "description": "The user's id, the same value as _id",
409
+ "type": "string",
410
+ },
411
+ "last": {
412
+ "format": "date-time",
413
+ "type": "string",
414
+ },
415
+ "name": {
416
+ "description": "The user's display name",
417
+ "type": "string",
418
+ },
419
+ "organizationIds": {
420
+ "description": "Organization memberships",
421
+ "items": {
422
+ "type": "string",
423
+ },
424
+ "type": "array",
425
+ },
426
+ "roles": {
427
+ "description": "RBAC role names assigned to this user",
428
+ "items": {
429
+ "type": "string",
430
+ },
431
+ "type": "array",
432
+ },
433
+ "tokenEpoch": {
434
+ "description": "Incremented on password reset to invalidate outstanding refresh tokens",
435
+ "type": "number",
436
+ },
437
+ "updated": {
438
+ "description": "When this document was last updated",
439
+ "format": "date-time",
440
+ "type": "string",
441
+ },
442
+ "username": {
443
+ "description": "The user's username",
444
+ "type": "string",
445
+ },
446
+ },
447
+ "required": [
448
+ "_id",
449
+ "id",
450
+ ],
451
+ "type": "object",
452
+ },
453
+ },
454
+ "required": [
455
+ "data",
456
+ ],
457
+ "type": "object",
458
+ },
459
+ },
460
+ },
461
+ "description": "Success",
462
+ },
463
+ "400": {
464
+ "content": {
465
+ "application/json": {
466
+ "schema": {
467
+ "$ref": "#/components/schemas/APIError",
468
+ },
469
+ },
470
+ },
471
+ "description": "Bad request",
472
+ },
473
+ "401": {
474
+ "description": "The user must be authenticated",
475
+ },
476
+ "403": {
477
+ "content": {
478
+ "application/json": {
479
+ "schema": {
480
+ "$ref": "#/components/schemas/APIError",
481
+ },
482
+ },
483
+ },
484
+ "description": "The user is not allowed to perform this action on this document",
485
+ },
486
+ "404": {
487
+ "content": {
488
+ "application/json": {
489
+ "schema": {
490
+ "$ref": "#/components/schemas/APIError",
491
+ },
492
+ },
493
+ },
494
+ "description": "Document not found",
495
+ },
496
+ "405": {
497
+ "content": {
498
+ "application/json": {
499
+ "schema": {
500
+ "$ref": "#/components/schemas/APIError",
501
+ },
502
+ },
503
+ },
504
+ "description": "The user is not allowed to perform this action on any document",
505
+ },
506
+ },
507
+ "summary": "Update the current user",
508
+ "tags": [
509
+ "auth",
510
+ ],
511
+ },
512
+ },
513
+ "/auth/resetPassword": {
514
+ "post": {
515
+ "description": "Send \`token\` and either \`password\` or \`newPassword\`. Returns fresh tokens for the user.",
516
+ "requestBody": {
517
+ "content": {
518
+ "application/json": {
519
+ "schema": {
520
+ "properties": {
521
+ "newPassword": {
522
+ "description": "Alias for password",
523
+ "type": "string",
524
+ },
525
+ "password": {
526
+ "description": "The new password",
527
+ "type": "string",
528
+ },
529
+ "token": {
530
+ "description": "One-time reset token from the emailed link",
531
+ "type": "string",
532
+ },
533
+ },
534
+ "type": "object",
535
+ },
536
+ },
537
+ },
538
+ "required": true,
539
+ },
540
+ "responses": {
541
+ "200": {
542
+ "content": {
543
+ "application/json": {
544
+ "schema": {
545
+ "properties": {
546
+ "data": {
547
+ "properties": {
548
+ "refreshToken": {
549
+ "type": "string",
550
+ },
551
+ "token": {
552
+ "type": "string",
553
+ },
554
+ "userId": {
555
+ "type": "string",
556
+ },
557
+ },
558
+ "required": [
559
+ "refreshToken",
560
+ "token",
561
+ "userId",
562
+ ],
563
+ "type": "object",
564
+ },
565
+ },
566
+ "required": [
567
+ "data",
568
+ ],
569
+ "type": "object",
570
+ },
571
+ },
572
+ },
573
+ "description": "Success",
574
+ },
575
+ "400": {
576
+ "content": {
577
+ "application/json": {
578
+ "schema": {
579
+ "$ref": "#/components/schemas/APIError",
580
+ },
581
+ },
582
+ },
583
+ "description": "Bad request",
584
+ },
585
+ "401": {
586
+ "description": "The user must be authenticated",
587
+ },
588
+ "403": {
589
+ "content": {
590
+ "application/json": {
591
+ "schema": {
592
+ "$ref": "#/components/schemas/APIError",
593
+ },
594
+ },
595
+ },
596
+ "description": "The user is not allowed to perform this action on this document",
597
+ },
598
+ "404": {
599
+ "content": {
600
+ "application/json": {
601
+ "schema": {
602
+ "$ref": "#/components/schemas/APIError",
603
+ },
604
+ },
605
+ },
606
+ "description": "Document not found",
607
+ },
608
+ "405": {
609
+ "content": {
610
+ "application/json": {
611
+ "schema": {
612
+ "$ref": "#/components/schemas/APIError",
613
+ },
614
+ },
615
+ },
616
+ "description": "The user is not allowed to perform this action on any document",
617
+ },
618
+ },
619
+ "summary": "Reset password with a one-time token",
620
+ "tags": [
621
+ "auth",
622
+ ],
623
+ },
624
+ },
625
+ "/auth/sendVerification": {
626
+ "post": {
627
+ "responses": {
628
+ "202": {
629
+ "content": {
630
+ "application/json": {
631
+ "schema": {
632
+ "properties": {
633
+ "data": {
634
+ "properties": {
635
+ "ok": {
636
+ "type": "boolean",
637
+ },
638
+ },
639
+ "required": [
640
+ "ok",
641
+ ],
642
+ "type": "object",
643
+ },
644
+ },
645
+ "required": [
646
+ "data",
647
+ ],
648
+ "type": "object",
649
+ },
650
+ },
651
+ },
652
+ "description": "Accepted",
653
+ },
654
+ "400": {
655
+ "content": {
656
+ "application/json": {
657
+ "schema": {
658
+ "$ref": "#/components/schemas/APIError",
659
+ },
660
+ },
661
+ },
662
+ "description": "Bad request",
663
+ },
664
+ "401": {
665
+ "description": "The user must be authenticated",
666
+ },
667
+ "403": {
668
+ "content": {
669
+ "application/json": {
670
+ "schema": {
671
+ "$ref": "#/components/schemas/APIError",
672
+ },
673
+ },
674
+ },
675
+ "description": "The user is not allowed to perform this action on this document",
676
+ },
677
+ "404": {
678
+ "content": {
679
+ "application/json": {
680
+ "schema": {
681
+ "$ref": "#/components/schemas/APIError",
682
+ },
683
+ },
684
+ },
685
+ "description": "Document not found",
686
+ },
687
+ "405": {
688
+ "content": {
689
+ "application/json": {
690
+ "schema": {
691
+ "$ref": "#/components/schemas/APIError",
692
+ },
693
+ },
694
+ },
695
+ "description": "The user is not allowed to perform this action on any document",
696
+ },
697
+ },
698
+ "summary": "Send or resend an email verification link",
699
+ "tags": [
700
+ "auth",
701
+ ],
702
+ },
703
+ },
704
+ "/auth/verifyEmail": {
705
+ "post": {
706
+ "requestBody": {
707
+ "content": {
708
+ "application/json": {
709
+ "schema": {
710
+ "properties": {
711
+ "token": {
712
+ "description": "One-time verification token from the emailed link",
713
+ "type": "string",
714
+ },
715
+ },
716
+ "type": "object",
717
+ },
718
+ },
719
+ },
720
+ "required": true,
721
+ },
722
+ "responses": {
723
+ "200": {
724
+ "content": {
725
+ "application/json": {
726
+ "schema": {
727
+ "properties": {
728
+ "data": {
729
+ "properties": {
730
+ "ok": {
731
+ "type": "boolean",
732
+ },
733
+ },
734
+ "required": [
735
+ "ok",
736
+ ],
737
+ "type": "object",
738
+ },
739
+ },
740
+ "required": [
741
+ "data",
742
+ ],
743
+ "type": "object",
744
+ },
745
+ },
746
+ },
747
+ "description": "Success",
748
+ },
749
+ "400": {
750
+ "content": {
751
+ "application/json": {
752
+ "schema": {
753
+ "$ref": "#/components/schemas/APIError",
754
+ },
755
+ },
756
+ },
757
+ "description": "Bad request",
758
+ },
759
+ "401": {
760
+ "description": "The user must be authenticated",
761
+ },
762
+ "403": {
763
+ "content": {
764
+ "application/json": {
765
+ "schema": {
766
+ "$ref": "#/components/schemas/APIError",
767
+ },
768
+ },
769
+ },
770
+ "description": "The user is not allowed to perform this action on this document",
771
+ },
772
+ "404": {
773
+ "content": {
774
+ "application/json": {
775
+ "schema": {
776
+ "$ref": "#/components/schemas/APIError",
777
+ },
778
+ },
779
+ },
780
+ "description": "Document not found",
781
+ },
782
+ "405": {
783
+ "content": {
784
+ "application/json": {
785
+ "schema": {
786
+ "$ref": "#/components/schemas/APIError",
787
+ },
788
+ },
789
+ },
790
+ "description": "The user is not allowed to perform this action on any document",
791
+ },
792
+ },
793
+ "summary": "Verify email with a one-time token",
794
+ "tags": [
795
+ "auth",
796
+ ],
797
+ },
798
+ },
75
799
  "/food/": {
76
800
  "get": {
77
801
  "parameters": [
@@ -1685,6 +2409,118 @@ exports[`OpenApiMiddlewareBuilder snapshot tests matches OpenAPI spec snapshot 1
1685
2409
  ],
1686
2410
  },
1687
2411
  },
2412
+ "/resetPassword": {
2413
+ "post": {
2414
+ "description": "Send \`token\` and either \`password\` or \`newPassword\`. Returns fresh tokens for the user.",
2415
+ "requestBody": {
2416
+ "content": {
2417
+ "application/json": {
2418
+ "schema": {
2419
+ "properties": {
2420
+ "newPassword": {
2421
+ "description": "Alias for password",
2422
+ "type": "string",
2423
+ },
2424
+ "password": {
2425
+ "description": "The new password",
2426
+ "type": "string",
2427
+ },
2428
+ "token": {
2429
+ "description": "One-time reset token from the emailed link",
2430
+ "type": "string",
2431
+ },
2432
+ },
2433
+ "type": "object",
2434
+ },
2435
+ },
2436
+ },
2437
+ "required": true,
2438
+ },
2439
+ "responses": {
2440
+ "200": {
2441
+ "content": {
2442
+ "application/json": {
2443
+ "schema": {
2444
+ "properties": {
2445
+ "data": {
2446
+ "properties": {
2447
+ "refreshToken": {
2448
+ "type": "string",
2449
+ },
2450
+ "token": {
2451
+ "type": "string",
2452
+ },
2453
+ "userId": {
2454
+ "type": "string",
2455
+ },
2456
+ },
2457
+ "required": [
2458
+ "refreshToken",
2459
+ "token",
2460
+ "userId",
2461
+ ],
2462
+ "type": "object",
2463
+ },
2464
+ },
2465
+ "required": [
2466
+ "data",
2467
+ ],
2468
+ "type": "object",
2469
+ },
2470
+ },
2471
+ },
2472
+ "description": "Success",
2473
+ },
2474
+ "400": {
2475
+ "content": {
2476
+ "application/json": {
2477
+ "schema": {
2478
+ "$ref": "#/components/schemas/APIError",
2479
+ },
2480
+ },
2481
+ },
2482
+ "description": "Bad request",
2483
+ },
2484
+ "401": {
2485
+ "description": "The user must be authenticated",
2486
+ },
2487
+ "403": {
2488
+ "content": {
2489
+ "application/json": {
2490
+ "schema": {
2491
+ "$ref": "#/components/schemas/APIError",
2492
+ },
2493
+ },
2494
+ },
2495
+ "description": "The user is not allowed to perform this action on this document",
2496
+ },
2497
+ "404": {
2498
+ "content": {
2499
+ "application/json": {
2500
+ "schema": {
2501
+ "$ref": "#/components/schemas/APIError",
2502
+ },
2503
+ },
2504
+ },
2505
+ "description": "Document not found",
2506
+ },
2507
+ "405": {
2508
+ "content": {
2509
+ "application/json": {
2510
+ "schema": {
2511
+ "$ref": "#/components/schemas/APIError",
2512
+ },
2513
+ },
2514
+ },
2515
+ "description": "The user is not allowed to perform this action on any document",
2516
+ },
2517
+ },
2518
+ "summary": "Reset password with a one-time token",
2519
+ "tags": [
2520
+ "auth",
2521
+ ],
2522
+ },
2523
+ },
1688
2524
  },
1689
2525
  }
1690
2526
  `;