@crowi/api-contract 2.0.0-alpha.11 → 2.0.0-alpha.13
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.
- package/dist/generated/openapi.d.mts +1184 -4
- package/dist/generated/openapi.d.ts +1184 -4
- package/dist/generated/openapi.js.map +1 -1
- package/dist/index.d.mts +5422 -1335
- package/dist/index.d.ts +5422 -1335
- package/dist/index.js +1072 -538
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +972 -470
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -78,6 +78,8 @@ __export(index_exports, {
|
|
|
78
78
|
CommentInvalidRequestErrorSchema: () => CommentInvalidRequestErrorSchema,
|
|
79
79
|
CommentNotFoundErrorSchema: () => CommentNotFoundErrorSchema,
|
|
80
80
|
CommentSchema: () => CommentSchema,
|
|
81
|
+
ConfigReadinessIssueSchema: () => ConfigReadinessIssueSchema,
|
|
82
|
+
ConfigReadinessResponseSchema: () => ConfigReadinessResponseSchema,
|
|
81
83
|
ConfirmEmailChangeRequestSchema: () => ConfirmEmailChangeRequestSchema,
|
|
82
84
|
ConfirmEmailChangeResponseSchema: () => ConfirmEmailChangeResponseSchema,
|
|
83
85
|
ConflictErrorSchema: () => ConflictErrorSchema,
|
|
@@ -88,6 +90,8 @@ __export(index_exports, {
|
|
|
88
90
|
CreateAdminResponseSchema: () => CreateAdminResponseSchema,
|
|
89
91
|
CreateDraftRequestSchema: () => CreateDraftRequestSchema,
|
|
90
92
|
CreateDraftResponseSchema: () => CreateDraftResponseSchema,
|
|
93
|
+
CreateLinkGrantRequestSchema: () => CreateLinkGrantRequestSchema,
|
|
94
|
+
CreateLinkGrantResponseSchema: () => CreateLinkGrantResponseSchema,
|
|
91
95
|
CreatePageRequestSchema: () => CreatePageRequestSchema,
|
|
92
96
|
CrowiCodeSidecarSchema: () => CrowiCodeSidecarSchema,
|
|
93
97
|
CrowiDiagramNodeSchema: () => CrowiDiagramNodeSchema,
|
|
@@ -123,6 +127,14 @@ __export(index_exports, {
|
|
|
123
127
|
EditAdminUserRequestSchema: () => EditAdminUserRequestSchema,
|
|
124
128
|
EncryptionNotConfiguredErrorSchema: () => EncryptionNotConfiguredErrorSchema,
|
|
125
129
|
ErrorCodeSchema: () => ErrorCodeSchema,
|
|
130
|
+
FederatedHandoffRequestSchema: () => FederatedHandoffRequestSchema,
|
|
131
|
+
FederatedHandoffResponseSchema: () => FederatedHandoffResponseSchema,
|
|
132
|
+
FederatedProviderSchema: () => FederatedProviderSchema,
|
|
133
|
+
FederatedRegistrationActiveResultSchema: () => FederatedRegistrationActiveResultSchema,
|
|
134
|
+
FederatedRegistrationApprovalResultSchema: () => FederatedRegistrationApprovalResultSchema,
|
|
135
|
+
FederatedRegistrationResultSchema: () => FederatedRegistrationResultSchema,
|
|
136
|
+
FederatedRegistrationSnapshotSchema: () => FederatedRegistrationSnapshotSchema,
|
|
137
|
+
FederatedRegistrationSubmitRequestSchema: () => FederatedRegistrationSubmitRequestSchema,
|
|
126
138
|
ForbiddenErrorSchema: () => ForbiddenErrorSchema,
|
|
127
139
|
ForgotPasswordRequestSchema: () => ForgotPasswordRequestSchema,
|
|
128
140
|
ForgotPasswordResponseSchema: () => ForgotPasswordResponseSchema,
|
|
@@ -164,6 +176,7 @@ __export(index_exports, {
|
|
|
164
176
|
LanguageSchema: () => LanguageSchema,
|
|
165
177
|
LikerSchema: () => LikerSchema,
|
|
166
178
|
LikersResponseSchema: () => LikersResponseSchema,
|
|
179
|
+
LinkedAuthProviderListResponseSchema: () => LinkedAuthProviderListResponseSchema,
|
|
167
180
|
ListAccessTokensResponseSchema: () => ListAccessTokensResponseSchema,
|
|
168
181
|
ListAdminUsersRequestSchema: () => ListAdminUsersRequestSchema,
|
|
169
182
|
ListAdminUsersResponseSchema: () => ListAdminUsersResponseSchema,
|
|
@@ -235,6 +248,7 @@ __export(index_exports, {
|
|
|
235
248
|
PluginFieldSchema: () => PluginFieldSchema,
|
|
236
249
|
PluginInfoSchema: () => PluginInfoSchema,
|
|
237
250
|
PluginNotFoundErrorSchema: () => PluginNotFoundErrorSchema,
|
|
251
|
+
PluginReadinessFieldSchema: () => PluginReadinessFieldSchema,
|
|
238
252
|
PresenceClientMessageSchema: () => PresenceClientMessageSchema,
|
|
239
253
|
PresenceCommentChangedMessageSchema: () => PresenceCommentChangedMessageSchema,
|
|
240
254
|
PresenceHeartbeatMessageSchema: () => PresenceHeartbeatMessageSchema,
|
|
@@ -247,6 +261,7 @@ __export(index_exports, {
|
|
|
247
261
|
PreviewPageRequestSchema: () => PreviewPageRequestSchema,
|
|
248
262
|
PreviewPageResponseSchema: () => PreviewPageResponseSchema,
|
|
249
263
|
ProfileErrorResponseSchema: () => ProfileErrorResponseSchema,
|
|
264
|
+
ProviderListResponseSchema: () => ProviderListResponseSchema,
|
|
250
265
|
RENDERED_AST_NODE_DEFS: () => RENDERED_AST_NODE_DEFS,
|
|
251
266
|
RecentlyViewedPagesResponseSchema: () => RecentlyViewedPagesResponseSchema,
|
|
252
267
|
ReencryptResponseSchema: () => ReencryptResponseSchema,
|
|
@@ -295,6 +310,8 @@ __export(index_exports, {
|
|
|
295
310
|
SendTestMailErrorSchema: () => SendTestMailErrorSchema,
|
|
296
311
|
SendTestMailRequestSchema: () => SendTestMailRequestSchema,
|
|
297
312
|
SendTestMailResponseSchema: () => SendTestMailResponseSchema,
|
|
313
|
+
SenderProofSchema: () => SenderProofSchema,
|
|
314
|
+
SenderPublicJwkSchema: () => SenderPublicJwkSchema,
|
|
298
315
|
SensitiveConfigEntrySchema: () => SensitiveConfigEntrySchema,
|
|
299
316
|
ServiceUnavailableErrorSchema: () => ServiceUnavailableErrorSchema,
|
|
300
317
|
SetPageGrantRequestSchema: () => SetPageGrantRequestSchema,
|
|
@@ -315,6 +332,7 @@ __export(index_exports, {
|
|
|
315
332
|
TokenRequestSchema: () => TokenRequestSchema,
|
|
316
333
|
TokenResponseSchema: () => TokenResponseSchema,
|
|
317
334
|
UPLOAD_ALLOWED_MIME: () => UPLOAD_ALLOWED_MIME,
|
|
335
|
+
UnlinkAuthProviderErrorSchema: () => UnlinkAuthProviderErrorSchema,
|
|
318
336
|
UpdateAdminUserEmailRequestSchema: () => UpdateAdminUserEmailRequestSchema,
|
|
319
337
|
UpdateAppSettingsRequestSchema: () => UpdateAppSettingsRequestSchema,
|
|
320
338
|
UpdateAppSettingsResponseSchema: () => UpdateAppSettingsResponseSchema,
|
|
@@ -346,6 +364,7 @@ __export(index_exports, {
|
|
|
346
364
|
UserStatusErrorSchema: () => UserStatusErrorSchema,
|
|
347
365
|
UserStatusSchema: () => UserStatusSchema,
|
|
348
366
|
UserSubpagesRequestSchema: () => UserSubpagesRequestSchema,
|
|
367
|
+
UsernameSchema: () => UsernameSchema,
|
|
349
368
|
ValidationErrorSchema: () => ValidationErrorSchema,
|
|
350
369
|
WS_CLOSE_CODES: () => WS_CLOSE_CODES,
|
|
351
370
|
WatchStatusResponseSchema: () => WatchStatusResponseSchema,
|
|
@@ -377,6 +396,7 @@ __export(index_exports, {
|
|
|
377
396
|
autocompleteUsersRoute: () => autocompleteUsersRoute,
|
|
378
397
|
backlinkRoutes: () => backlinkRoutes,
|
|
379
398
|
bookmarkRoutes: () => bookmarkRoutes,
|
|
399
|
+
callbackFederatedProviderRoute: () => callbackFederatedProviderRoute,
|
|
380
400
|
cancelDraftRoute: () => cancelDraftRoute,
|
|
381
401
|
claimPageLinkAccessRoute: () => claimPageLinkAccessRoute,
|
|
382
402
|
clearRenderCacheAllRoute: () => clearRenderCacheAllRoute,
|
|
@@ -386,6 +406,7 @@ __export(index_exports, {
|
|
|
386
406
|
confirmEmailChangeRoute: () => confirmEmailChangeRoute,
|
|
387
407
|
createAccessTokenRoute: () => createAccessTokenRoute,
|
|
388
408
|
createAdminRoute: () => createAdminRoute,
|
|
409
|
+
createAuthProviderLinkGrantRoute: () => createAuthProviderLinkGrantRoute,
|
|
389
410
|
createClient: () => createClient,
|
|
390
411
|
createDraftRoute: () => createDraftRoute,
|
|
391
412
|
createPageRoute: () => createPageRoute,
|
|
@@ -401,6 +422,9 @@ __export(index_exports, {
|
|
|
401
422
|
draftRoutes: () => draftRoutes,
|
|
402
423
|
editUserRoute: () => editUserRoute,
|
|
403
424
|
emailChangeRoutes: () => emailChangeRoutes,
|
|
425
|
+
federatedAuthRoutes: () => federatedAuthRoutes,
|
|
426
|
+
federatedHandoffRoute: () => federatedHandoffRoute,
|
|
427
|
+
federatedRegistrationRoutes: () => federatedRegistrationRoutes,
|
|
404
428
|
forgotPasswordRoute: () => forgotPasswordRoute,
|
|
405
429
|
getAppInfoRoute: () => getAppInfoRoute,
|
|
406
430
|
getAppSettingsRoute: () => getAppSettingsRoute,
|
|
@@ -410,12 +434,14 @@ __export(index_exports, {
|
|
|
410
434
|
getBacklinksRoute: () => getBacklinksRoute,
|
|
411
435
|
getBookmarkRoute: () => getBookmarkRoute,
|
|
412
436
|
getCryptoStatusRoute: () => getCryptoStatusRoute,
|
|
437
|
+
getFederatedRegistrationRoute: () => getFederatedRegistrationRoute,
|
|
413
438
|
getInstallerStatusRoute: () => getInstallerStatusRoute,
|
|
414
439
|
getLikersRoute: () => getLikersRoute,
|
|
415
440
|
getMailSettingsRoute: () => getMailSettingsRoute,
|
|
416
441
|
getNotificationsTokenRoute: () => getNotificationsTokenRoute,
|
|
417
442
|
getPageRoute: () => getPageRoute,
|
|
418
443
|
getPluginConfigRoute: () => getPluginConfigRoute,
|
|
444
|
+
getPluginReadinessRoute: () => getPluginReadinessRoute,
|
|
419
445
|
getPresenceTokenRoute: () => getPresenceTokenRoute,
|
|
420
446
|
getProfileRoute: () => getProfileRoute,
|
|
421
447
|
getRevisionRoute: () => getRevisionRoute,
|
|
@@ -442,6 +468,8 @@ __export(index_exports, {
|
|
|
442
468
|
listAttachmentsRoute: () => listAttachmentsRoute,
|
|
443
469
|
listCommentsRoute: () => listCommentsRoute,
|
|
444
470
|
listDraftsRoute: () => listDraftsRoute,
|
|
471
|
+
listFederatedProvidersRoute: () => listFederatedProvidersRoute,
|
|
472
|
+
listLinkedAuthProvidersRoute: () => listLinkedAuthProvidersRoute,
|
|
445
473
|
listMembersRoute: () => listMembersRoute,
|
|
446
474
|
listMyBookmarksRoute: () => listMyBookmarksRoute,
|
|
447
475
|
listNotificationsRoute: () => listNotificationsRoute,
|
|
@@ -450,6 +478,7 @@ __export(index_exports, {
|
|
|
450
478
|
listPluginsRoute: () => listPluginsRoute,
|
|
451
479
|
listRevisionsRoute: () => listRevisionsRoute,
|
|
452
480
|
listUsersRoute: () => listUsersRoute,
|
|
481
|
+
logoutFederatedRegistrationRoute: () => logoutFederatedRegistrationRoute,
|
|
453
482
|
makeAdminRoute: () => makeAdminRoute,
|
|
454
483
|
markAllAsReadRoute: () => markAllAsReadRoute,
|
|
455
484
|
meRoutes: () => meRoutes,
|
|
@@ -486,7 +515,9 @@ __export(index_exports, {
|
|
|
486
515
|
sendTestMailRoute: () => sendTestMailRoute,
|
|
487
516
|
setPageGrantRoute: () => setPageGrantRoute,
|
|
488
517
|
setWatchStatusRoute: () => setWatchStatusRoute,
|
|
518
|
+
startFederatedProviderRoute: () => startFederatedProviderRoute,
|
|
489
519
|
stripKnownHtmlTags: () => stripKnownHtmlTags,
|
|
520
|
+
submitFederatedRegistrationRoute: () => submitFederatedRegistrationRoute,
|
|
490
521
|
suspendUserRoute: () => suspendUserRoute,
|
|
491
522
|
tokenAuthRoutes: () => tokenAuthRoutes,
|
|
492
523
|
tokenLoginRoute: () => tokenLoginRoute,
|
|
@@ -496,6 +527,7 @@ __export(index_exports, {
|
|
|
496
527
|
tokenRegisterRoute: () => tokenRegisterRoute,
|
|
497
528
|
tokenRoute: () => tokenRoute,
|
|
498
529
|
unlikePageRoute: () => unlikePageRoute,
|
|
530
|
+
unlinkAuthProviderRoute: () => unlinkAuthProviderRoute,
|
|
499
531
|
unwrapRenderedAst: () => unwrapRenderedAst,
|
|
500
532
|
updateAppSettingsRoute: () => updateAppSettingsRoute,
|
|
501
533
|
updateAuthSettingsRoute: () => updateAuthSettingsRoute,
|
|
@@ -517,7 +549,7 @@ __export(index_exports, {
|
|
|
517
549
|
module.exports = __toCommonJS(index_exports);
|
|
518
550
|
|
|
519
551
|
// src/client.ts
|
|
520
|
-
var
|
|
552
|
+
var import_zod_openapi79 = require("@hono/zod-openapi");
|
|
521
553
|
var import_client = require("hono/client");
|
|
522
554
|
|
|
523
555
|
// src/contracts/admin/app.ts
|
|
@@ -623,8 +655,12 @@ var ERROR_CODES = [
|
|
|
623
655
|
"INVALID_CREDENTIALS",
|
|
624
656
|
"REFRESH_TOKEN_REQUIRED",
|
|
625
657
|
"REGISTRATION_CLOSED",
|
|
658
|
+
// --- federated sign-in (RFC-0014) ---
|
|
659
|
+
"FEDERATED_HANDOFF_INVALID",
|
|
660
|
+
"FEDERATED_HANDOFF_CONSUMED",
|
|
626
661
|
// --- admin subsystems ---
|
|
627
662
|
"ENCRYPTION_NOT_CONFIGURED",
|
|
663
|
+
"MAIL_FROM_NOT_CONFIGURED",
|
|
628
664
|
"MAIL_TEST_FAILED",
|
|
629
665
|
"PLUGIN_NOT_FOUND",
|
|
630
666
|
"PLUGIN_CONFIG_VALIDATION_FAILED"
|
|
@@ -905,10 +941,16 @@ var SendTestMailResponseSchema = import_zod_openapi7.z.object({
|
|
|
905
941
|
to: import_zod_openapi7.z.string()
|
|
906
942
|
});
|
|
907
943
|
var SendTestMailErrorSchema = import_zod_openapi7.z.object({
|
|
908
|
-
error: import_zod_openapi7.z.
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
944
|
+
error: import_zod_openapi7.z.discriminatedUnion("code", [
|
|
945
|
+
import_zod_openapi7.z.object({
|
|
946
|
+
code: import_zod_openapi7.z.literal("MAIL_FROM_NOT_CONFIGURED"),
|
|
947
|
+
message: import_zod_openapi7.z.literal("The mail sender address is not configured.")
|
|
948
|
+
}),
|
|
949
|
+
import_zod_openapi7.z.object({
|
|
950
|
+
code: import_zod_openapi7.z.literal("MAIL_TEST_FAILED"),
|
|
951
|
+
message: import_zod_openapi7.z.enum(["Failed to send the test email. Check the active mail sender configuration.", "No email address on the calling user"])
|
|
952
|
+
})
|
|
953
|
+
])
|
|
912
954
|
});
|
|
913
955
|
var MailSettingsValidationErrorSchema = import_zod_openapi7.z.object({
|
|
914
956
|
bodyResult: import_zod_openapi7.z.object({
|
|
@@ -1021,7 +1063,7 @@ var sendTestMailRoute = (0, import_zod_openapi8.createRoute)({
|
|
|
1021
1063
|
content: { "application/json": { schema: AdminRequiredErrorSchema } }
|
|
1022
1064
|
},
|
|
1023
1065
|
502: {
|
|
1024
|
-
description: "Test mail dispatch failed (
|
|
1066
|
+
description: "Test mail dispatch failed (mail dispatch failure \u2014 e.g. sender/transport error, or the mail sender address is not configured)",
|
|
1025
1067
|
content: { "application/json": { schema: SendTestMailErrorSchema } }
|
|
1026
1068
|
}
|
|
1027
1069
|
}
|
|
@@ -1167,6 +1209,21 @@ var ClearRenderCacheResponseSchema = import_zod_openapi9.z.object({
|
|
|
1167
1209
|
/** Number of cache rows removed. */
|
|
1168
1210
|
removedCount: import_zod_openapi9.z.number().int().min(0)
|
|
1169
1211
|
});
|
|
1212
|
+
var PluginReadinessFieldSchema = import_zod_openapi9.z.object({
|
|
1213
|
+
name: import_zod_openapi9.z.string(),
|
|
1214
|
+
configured: import_zod_openapi9.z.literal(false)
|
|
1215
|
+
});
|
|
1216
|
+
var ConfigReadinessIssueSchema = import_zod_openapi9.z.object({
|
|
1217
|
+
/** Stable id — `plugin:<name>` or a core declaration id (e.g. `core:mail`). */
|
|
1218
|
+
id: import_zod_openapi9.z.string(),
|
|
1219
|
+
source: import_zod_openapi9.z.enum(["plugin", "core"]),
|
|
1220
|
+
label: import_zod_openapi9.z.string(),
|
|
1221
|
+
href: import_zod_openapi9.z.string(),
|
|
1222
|
+
fields: import_zod_openapi9.z.array(PluginReadinessFieldSchema)
|
|
1223
|
+
});
|
|
1224
|
+
var ConfigReadinessResponseSchema = import_zod_openapi9.z.object({
|
|
1225
|
+
issues: import_zod_openapi9.z.array(ConfigReadinessIssueSchema)
|
|
1226
|
+
});
|
|
1170
1227
|
|
|
1171
1228
|
// src/contracts/admin/plugins.ts
|
|
1172
1229
|
var PluginNameQuerySchema = import_zod_openapi10.z.object({ name: import_zod_openapi10.z.string() });
|
|
@@ -1298,6 +1355,27 @@ var clearRenderCacheAllRoute = (0, import_zod_openapi10.createRoute)({
|
|
|
1298
1355
|
}
|
|
1299
1356
|
}
|
|
1300
1357
|
});
|
|
1358
|
+
var getPluginReadinessRoute = (0, import_zod_openapi10.createRoute)({
|
|
1359
|
+
method: "get",
|
|
1360
|
+
path: "/admin/plugins/readiness",
|
|
1361
|
+
tags: ["admin.plugins"],
|
|
1362
|
+
security: [{ bearerAuth: [] }],
|
|
1363
|
+
summary: "List active plugins and core config missing required readiness fields",
|
|
1364
|
+
responses: {
|
|
1365
|
+
200: {
|
|
1366
|
+
description: "Readiness issues for active plugins and core config (empty when everything is configured)",
|
|
1367
|
+
content: { "application/json": { schema: ConfigReadinessResponseSchema } }
|
|
1368
|
+
},
|
|
1369
|
+
401: {
|
|
1370
|
+
description: "Authentication required",
|
|
1371
|
+
content: { "application/json": { schema: AuthenticationRequiredErrorSchema } }
|
|
1372
|
+
},
|
|
1373
|
+
403: {
|
|
1374
|
+
description: "Admin permission required",
|
|
1375
|
+
content: { "application/json": { schema: AdminRequiredErrorSchema } }
|
|
1376
|
+
}
|
|
1377
|
+
}
|
|
1378
|
+
});
|
|
1301
1379
|
var clearRenderCachePluginRoute = (0, import_zod_openapi10.createRoute)({
|
|
1302
1380
|
method: "post",
|
|
1303
1381
|
path: "/admin/plugins/render-cache/clear-plugin",
|
|
@@ -1337,6 +1415,7 @@ var adminPluginsRoutes = {
|
|
|
1337
1415
|
listPluginsRoute,
|
|
1338
1416
|
getPluginConfigRoute,
|
|
1339
1417
|
updatePluginConfigRoute,
|
|
1418
|
+
getPluginReadinessRoute,
|
|
1340
1419
|
clearRenderCacheAllRoute,
|
|
1341
1420
|
clearRenderCachePluginRoute
|
|
1342
1421
|
};
|
|
@@ -3889,29 +3968,35 @@ var draftRoutes = {
|
|
|
3889
3968
|
};
|
|
3890
3969
|
|
|
3891
3970
|
// src/contracts/installer.ts
|
|
3892
|
-
var
|
|
3971
|
+
var import_zod_openapi42 = require("@hono/zod-openapi");
|
|
3893
3972
|
|
|
3894
3973
|
// src/schemas/installer.ts
|
|
3974
|
+
var import_zod_openapi41 = require("@hono/zod-openapi");
|
|
3975
|
+
|
|
3976
|
+
// src/schemas/username.ts
|
|
3895
3977
|
var import_zod_openapi40 = require("@hono/zod-openapi");
|
|
3896
|
-
var
|
|
3897
|
-
|
|
3898
|
-
|
|
3899
|
-
var
|
|
3900
|
-
|
|
3901
|
-
|
|
3902
|
-
|
|
3903
|
-
|
|
3904
|
-
|
|
3978
|
+
var UsernameSchema = import_zod_openapi40.z.string().min(1).max(64).regex(/^[A-Za-z0-9_-]+$/, "username may only contain letters, digits, hyphens, and underscores");
|
|
3979
|
+
|
|
3980
|
+
// src/schemas/installer.ts
|
|
3981
|
+
var InstallerStatusResponseSchema = import_zod_openapi41.z.object({
|
|
3982
|
+
status: import_zod_openapi41.z.enum(["installer_required", "already_installed"])
|
|
3983
|
+
});
|
|
3984
|
+
var CreateAdminRequestSchema = import_zod_openapi41.z.object({
|
|
3985
|
+
registerForm: import_zod_openapi41.z.object({
|
|
3986
|
+
username: UsernameSchema,
|
|
3987
|
+
name: import_zod_openapi41.z.string().min(1),
|
|
3988
|
+
email: import_zod_openapi41.z.string().email(),
|
|
3989
|
+
password: import_zod_openapi41.z.string().min(6).regex(/^[\x20-\x7F]{6,}$/, "password must be 6+ printable ASCII characters")
|
|
3905
3990
|
})
|
|
3906
3991
|
});
|
|
3907
|
-
var CreateAdminResponseSchema =
|
|
3908
|
-
status:
|
|
3909
|
-
message:
|
|
3910
|
-
errors:
|
|
3992
|
+
var CreateAdminResponseSchema = import_zod_openapi41.z.object({
|
|
3993
|
+
status: import_zod_openapi41.z.enum(["ok", "error"]),
|
|
3994
|
+
message: import_zod_openapi41.z.string().optional(),
|
|
3995
|
+
errors: import_zod_openapi41.z.array(import_zod_openapi41.z.string()).optional()
|
|
3911
3996
|
});
|
|
3912
3997
|
|
|
3913
3998
|
// src/contracts/installer.ts
|
|
3914
|
-
var getInstallerStatusRoute = (0,
|
|
3999
|
+
var getInstallerStatusRoute = (0, import_zod_openapi42.createRoute)({
|
|
3915
4000
|
method: "get",
|
|
3916
4001
|
path: "/installer",
|
|
3917
4002
|
tags: ["installer"],
|
|
@@ -3935,7 +4020,7 @@ var getInstallerStatusRoute = (0, import_zod_openapi41.createRoute)({
|
|
|
3935
4020
|
}
|
|
3936
4021
|
}
|
|
3937
4022
|
});
|
|
3938
|
-
var createAdminRoute = (0,
|
|
4023
|
+
var createAdminRoute = (0, import_zod_openapi42.createRoute)({
|
|
3939
4024
|
method: "post",
|
|
3940
4025
|
path: "/installer/createAdmin",
|
|
3941
4026
|
tags: ["installer"],
|
|
@@ -3979,88 +4064,101 @@ var createAdminRoute = (0, import_zod_openapi41.createRoute)({
|
|
|
3979
4064
|
var installerRoutes = { getInstallerStatusRoute, createAdminRoute };
|
|
3980
4065
|
|
|
3981
4066
|
// src/contracts/me.ts
|
|
3982
|
-
var
|
|
4067
|
+
var import_zod_openapi44 = require("@hono/zod-openapi");
|
|
3983
4068
|
|
|
3984
4069
|
// src/schemas/me.ts
|
|
3985
|
-
var
|
|
3986
|
-
var LanguageSchema =
|
|
3987
|
-
var ThemeSchema =
|
|
3988
|
-
var UserProfileResponseSchema =
|
|
3989
|
-
id:
|
|
3990
|
-
username:
|
|
3991
|
-
name:
|
|
3992
|
-
email:
|
|
4070
|
+
var import_zod_openapi43 = require("@hono/zod-openapi");
|
|
4071
|
+
var LanguageSchema = import_zod_openapi43.z.enum(["en", "ja"]);
|
|
4072
|
+
var ThemeSchema = import_zod_openapi43.z.enum(["system", "light", "dark"]);
|
|
4073
|
+
var UserProfileResponseSchema = import_zod_openapi43.z.object({
|
|
4074
|
+
id: import_zod_openapi43.z.string(),
|
|
4075
|
+
username: import_zod_openapi43.z.string(),
|
|
4076
|
+
name: import_zod_openapi43.z.string(),
|
|
4077
|
+
email: import_zod_openapi43.z.string().email(),
|
|
3993
4078
|
lang: LanguageSchema,
|
|
3994
4079
|
theme: ThemeSchema,
|
|
3995
|
-
image:
|
|
3996
|
-
introduction:
|
|
3997
|
-
hasPassword:
|
|
3998
|
-
createdAt:
|
|
4080
|
+
image: import_zod_openapi43.z.string().nullable(),
|
|
4081
|
+
introduction: import_zod_openapi43.z.string().optional(),
|
|
4082
|
+
hasPassword: import_zod_openapi43.z.boolean(),
|
|
4083
|
+
createdAt: import_zod_openapi43.z.string(),
|
|
4084
|
+
/**
|
|
4085
|
+
* True when the account has at least one linked federated identity
|
|
4086
|
+
* (`UserIdentity` row). The email address on a federated account is
|
|
4087
|
+
* fixed to the value the identity provider verified — `PUT /me`
|
|
4088
|
+
* refuses a change and returns `EMAIL_LOCKED_BY_FEDERATED_IDENTITY`
|
|
4089
|
+
* when this is true and a different email is submitted. The web uses
|
|
4090
|
+
* this to disable the email field and point to the Security tab.
|
|
4091
|
+
*
|
|
4092
|
+
* Always reflects the account's current state — on `GET /me` and on
|
|
4093
|
+
* every 200 from `PUT /me`, including a `PUT` that changed only name /
|
|
4094
|
+
* lang.
|
|
4095
|
+
*/
|
|
4096
|
+
federated: import_zod_openapi43.z.boolean(),
|
|
3999
4097
|
/**
|
|
4000
4098
|
* True when the profile update requested a new email that is awaiting
|
|
4001
4099
|
* confirmation: the stored `email` is unchanged and a confirmation
|
|
4002
4100
|
* link was sent to the new address.
|
|
4003
4101
|
*/
|
|
4004
|
-
emailChangePending:
|
|
4102
|
+
emailChangePending: import_zod_openapi43.z.boolean().optional()
|
|
4005
4103
|
});
|
|
4006
|
-
var UpdateProfileRequestSchema =
|
|
4007
|
-
userForm:
|
|
4008
|
-
name:
|
|
4009
|
-
email:
|
|
4104
|
+
var UpdateProfileRequestSchema = import_zod_openapi43.z.object({
|
|
4105
|
+
userForm: import_zod_openapi43.z.object({
|
|
4106
|
+
name: import_zod_openapi43.z.string().min(1, "Name is required"),
|
|
4107
|
+
email: import_zod_openapi43.z.string().email("Invalid email format"),
|
|
4010
4108
|
lang: LanguageSchema
|
|
4011
4109
|
})
|
|
4012
4110
|
});
|
|
4013
|
-
var UpdateThemeRequestSchema =
|
|
4111
|
+
var UpdateThemeRequestSchema = import_zod_openapi43.z.object({
|
|
4014
4112
|
theme: ThemeSchema
|
|
4015
4113
|
});
|
|
4016
|
-
var ThemeUpdateResponseSchema =
|
|
4017
|
-
status:
|
|
4114
|
+
var ThemeUpdateResponseSchema = import_zod_openapi43.z.object({
|
|
4115
|
+
status: import_zod_openapi43.z.literal("ok"),
|
|
4018
4116
|
theme: ThemeSchema
|
|
4019
4117
|
});
|
|
4020
|
-
var PictureUploadResponseSchema =
|
|
4021
|
-
status:
|
|
4022
|
-
url:
|
|
4023
|
-
message:
|
|
4118
|
+
var PictureUploadResponseSchema = import_zod_openapi43.z.object({
|
|
4119
|
+
status: import_zod_openapi43.z.boolean(),
|
|
4120
|
+
url: import_zod_openapi43.z.string().optional(),
|
|
4121
|
+
message: import_zod_openapi43.z.string().optional()
|
|
4024
4122
|
});
|
|
4025
|
-
var SuccessResponseSchema =
|
|
4026
|
-
status:
|
|
4027
|
-
message:
|
|
4123
|
+
var SuccessResponseSchema = import_zod_openapi43.z.object({
|
|
4124
|
+
status: import_zod_openapi43.z.literal("ok"),
|
|
4125
|
+
message: import_zod_openapi43.z.string().optional()
|
|
4028
4126
|
});
|
|
4029
|
-
var ProfileErrorResponseSchema =
|
|
4030
|
-
status:
|
|
4127
|
+
var ProfileErrorResponseSchema = import_zod_openapi43.z.object({
|
|
4128
|
+
status: import_zod_openapi43.z.literal("error"),
|
|
4031
4129
|
/** Stable code so the web can localize the message (e.g. EMAIL_TAKEN). */
|
|
4032
|
-
code:
|
|
4033
|
-
message:
|
|
4034
|
-
errors:
|
|
4130
|
+
code: import_zod_openapi43.z.string().optional(),
|
|
4131
|
+
message: import_zod_openapi43.z.string().optional(),
|
|
4132
|
+
errors: import_zod_openapi43.z.array(import_zod_openapi43.z.string()).optional()
|
|
4035
4133
|
});
|
|
4036
4134
|
var PASSWORD_REGEX = /^(?=.*[a-zA-Z])(?=.*\d)(?=.*[!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?`~])[a-zA-Z\d!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?`~]+$/;
|
|
4037
|
-
var UpdatePasswordRequestSchema =
|
|
4038
|
-
oldPassword:
|
|
4039
|
-
newPassword:
|
|
4040
|
-
newPasswordConfirm:
|
|
4135
|
+
var UpdatePasswordRequestSchema = import_zod_openapi43.z.object({
|
|
4136
|
+
oldPassword: import_zod_openapi43.z.string().optional(),
|
|
4137
|
+
newPassword: import_zod_openapi43.z.string().min(8, "Password must be at least 8 characters").max(100, "Password must be at most 100 characters").regex(PASSWORD_REGEX, "Password must contain at least one letter, one digit, and one special character"),
|
|
4138
|
+
newPasswordConfirm: import_zod_openapi43.z.string()
|
|
4041
4139
|
}).refine((data) => data.newPassword === data.newPasswordConfirm, {
|
|
4042
4140
|
message: "Passwords do not match",
|
|
4043
4141
|
path: ["newPasswordConfirm"]
|
|
4044
4142
|
});
|
|
4045
|
-
var PasswordUpdateSuccessSchema =
|
|
4046
|
-
status:
|
|
4047
|
-
message:
|
|
4048
|
-
accessToken:
|
|
4049
|
-
refreshToken:
|
|
4143
|
+
var PasswordUpdateSuccessSchema = import_zod_openapi43.z.object({
|
|
4144
|
+
status: import_zod_openapi43.z.literal("ok"),
|
|
4145
|
+
message: import_zod_openapi43.z.string(),
|
|
4146
|
+
accessToken: import_zod_openapi43.z.string(),
|
|
4147
|
+
refreshToken: import_zod_openapi43.z.string(),
|
|
4050
4148
|
/** Access-token lifetime in seconds. */
|
|
4051
|
-
expiresIn:
|
|
4149
|
+
expiresIn: import_zod_openapi43.z.number()
|
|
4052
4150
|
});
|
|
4053
|
-
var PasswordErrorResponseSchema =
|
|
4054
|
-
status:
|
|
4055
|
-
message:
|
|
4056
|
-
errors:
|
|
4151
|
+
var PasswordErrorResponseSchema = import_zod_openapi43.z.object({
|
|
4152
|
+
status: import_zod_openapi43.z.literal("error"),
|
|
4153
|
+
message: import_zod_openapi43.z.string(),
|
|
4154
|
+
errors: import_zod_openapi43.z.array(import_zod_openapi43.z.string()).optional()
|
|
4057
4155
|
});
|
|
4058
|
-
var RecentlyViewedPagesResponseSchema =
|
|
4059
|
-
pages:
|
|
4156
|
+
var RecentlyViewedPagesResponseSchema = import_zod_openapi43.z.object({
|
|
4157
|
+
pages: import_zod_openapi43.z.array(PageSchema)
|
|
4060
4158
|
});
|
|
4061
4159
|
|
|
4062
4160
|
// src/contracts/me.ts
|
|
4063
|
-
var getProfileRoute = (0,
|
|
4161
|
+
var getProfileRoute = (0, import_zod_openapi44.createRoute)({
|
|
4064
4162
|
method: "get",
|
|
4065
4163
|
path: "/me",
|
|
4066
4164
|
tags: ["me"],
|
|
@@ -4077,7 +4175,7 @@ var getProfileRoute = (0, import_zod_openapi43.createRoute)({
|
|
|
4077
4175
|
}
|
|
4078
4176
|
}
|
|
4079
4177
|
});
|
|
4080
|
-
var updateProfileRoute = (0,
|
|
4178
|
+
var updateProfileRoute = (0, import_zod_openapi44.createRoute)({
|
|
4081
4179
|
method: "put",
|
|
4082
4180
|
path: "/me",
|
|
4083
4181
|
tags: ["me"],
|
|
@@ -4103,7 +4201,7 @@ var updateProfileRoute = (0, import_zod_openapi43.createRoute)({
|
|
|
4103
4201
|
}
|
|
4104
4202
|
}
|
|
4105
4203
|
});
|
|
4106
|
-
var updateThemeRoute = (0,
|
|
4204
|
+
var updateThemeRoute = (0, import_zod_openapi44.createRoute)({
|
|
4107
4205
|
method: "patch",
|
|
4108
4206
|
path: "/me/theme",
|
|
4109
4207
|
tags: ["me"],
|
|
@@ -4129,7 +4227,7 @@ var updateThemeRoute = (0, import_zod_openapi43.createRoute)({
|
|
|
4129
4227
|
}
|
|
4130
4228
|
}
|
|
4131
4229
|
});
|
|
4132
|
-
var uploadPictureRoute = (0,
|
|
4230
|
+
var uploadPictureRoute = (0, import_zod_openapi44.createRoute)({
|
|
4133
4231
|
method: "post",
|
|
4134
4232
|
path: "/me/picture",
|
|
4135
4233
|
tags: ["me"],
|
|
@@ -4139,8 +4237,8 @@ var uploadPictureRoute = (0, import_zod_openapi43.createRoute)({
|
|
|
4139
4237
|
body: {
|
|
4140
4238
|
content: {
|
|
4141
4239
|
"multipart/form-data": {
|
|
4142
|
-
schema:
|
|
4143
|
-
file:
|
|
4240
|
+
schema: import_zod_openapi44.z.object({
|
|
4241
|
+
file: import_zod_openapi44.z.any().optional().describe("Profile picture file")
|
|
4144
4242
|
})
|
|
4145
4243
|
}
|
|
4146
4244
|
}
|
|
@@ -4161,7 +4259,7 @@ var uploadPictureRoute = (0, import_zod_openapi43.createRoute)({
|
|
|
4161
4259
|
}
|
|
4162
4260
|
}
|
|
4163
4261
|
});
|
|
4164
|
-
var deletePictureRoute = (0,
|
|
4262
|
+
var deletePictureRoute = (0, import_zod_openapi44.createRoute)({
|
|
4165
4263
|
method: "delete",
|
|
4166
4264
|
path: "/me/picture",
|
|
4167
4265
|
tags: ["me"],
|
|
@@ -4182,7 +4280,7 @@ var deletePictureRoute = (0, import_zod_openapi43.createRoute)({
|
|
|
4182
4280
|
}
|
|
4183
4281
|
}
|
|
4184
4282
|
});
|
|
4185
|
-
var updatePasswordRoute = (0,
|
|
4283
|
+
var updatePasswordRoute = (0, import_zod_openapi44.createRoute)({
|
|
4186
4284
|
method: "put",
|
|
4187
4285
|
path: "/me/password",
|
|
4188
4286
|
tags: ["me"],
|
|
@@ -4208,7 +4306,7 @@ var updatePasswordRoute = (0, import_zod_openapi43.createRoute)({
|
|
|
4208
4306
|
}
|
|
4209
4307
|
}
|
|
4210
4308
|
});
|
|
4211
|
-
var recentlyViewedPagesRoute = (0,
|
|
4309
|
+
var recentlyViewedPagesRoute = (0, import_zod_openapi44.createRoute)({
|
|
4212
4310
|
method: "get",
|
|
4213
4311
|
path: "/me/recently-viewed-pages",
|
|
4214
4312
|
tags: ["me"],
|
|
@@ -4240,43 +4338,43 @@ var meRoutes = {
|
|
|
4240
4338
|
};
|
|
4241
4339
|
|
|
4242
4340
|
// src/contracts/access-token.ts
|
|
4243
|
-
var
|
|
4341
|
+
var import_zod_openapi46 = require("@hono/zod-openapi");
|
|
4244
4342
|
|
|
4245
4343
|
// src/schemas/access-token.ts
|
|
4246
|
-
var
|
|
4247
|
-
var AccessTokenSchema =
|
|
4248
|
-
id:
|
|
4249
|
-
name:
|
|
4250
|
-
scopes:
|
|
4344
|
+
var import_zod_openapi45 = require("@hono/zod-openapi");
|
|
4345
|
+
var AccessTokenSchema = import_zod_openapi45.z.object({
|
|
4346
|
+
id: import_zod_openapi45.z.string(),
|
|
4347
|
+
name: import_zod_openapi45.z.string(),
|
|
4348
|
+
scopes: import_zod_openapi45.z.array(import_zod_openapi45.z.string()),
|
|
4251
4349
|
/** ISO-8601 expiry, or `null` for a non-expiring token. */
|
|
4252
|
-
expiresAt:
|
|
4350
|
+
expiresAt: import_zod_openapi45.z.string().nullable(),
|
|
4253
4351
|
/** ISO-8601 of last successful use, or `null` if never used. */
|
|
4254
|
-
lastUsedAt:
|
|
4255
|
-
createdAt:
|
|
4352
|
+
lastUsedAt: import_zod_openapi45.z.string().nullable(),
|
|
4353
|
+
createdAt: import_zod_openapi45.z.string()
|
|
4256
4354
|
});
|
|
4257
|
-
var ListAccessTokensResponseSchema =
|
|
4258
|
-
accessTokens:
|
|
4355
|
+
var ListAccessTokensResponseSchema = import_zod_openapi45.z.object({
|
|
4356
|
+
accessTokens: import_zod_openapi45.z.array(AccessTokenSchema)
|
|
4259
4357
|
});
|
|
4260
|
-
var CreateAccessTokenRequestSchema =
|
|
4261
|
-
name:
|
|
4262
|
-
scopes:
|
|
4263
|
-
expiresAt:
|
|
4358
|
+
var CreateAccessTokenRequestSchema = import_zod_openapi45.z.object({
|
|
4359
|
+
name: import_zod_openapi45.z.string().min(1, "Name is required").max(200),
|
|
4360
|
+
scopes: import_zod_openapi45.z.array(import_zod_openapi45.z.string()).min(1, "At least one scope is required"),
|
|
4361
|
+
expiresAt: import_zod_openapi45.z.string().datetime().nullable().optional()
|
|
4264
4362
|
});
|
|
4265
4363
|
var CreateAccessTokenResponseSchema = AccessTokenSchema.extend({
|
|
4266
|
-
token:
|
|
4267
|
-
});
|
|
4268
|
-
var InvalidScopeErrorSchema =
|
|
4269
|
-
error:
|
|
4270
|
-
code:
|
|
4271
|
-
message:
|
|
4272
|
-
details:
|
|
4273
|
-
invalidScopes:
|
|
4364
|
+
token: import_zod_openapi45.z.string()
|
|
4365
|
+
});
|
|
4366
|
+
var InvalidScopeErrorSchema = import_zod_openapi45.z.object({
|
|
4367
|
+
error: import_zod_openapi45.z.object({
|
|
4368
|
+
code: import_zod_openapi45.z.literal("INVALID_SCOPE"),
|
|
4369
|
+
message: import_zod_openapi45.z.string(),
|
|
4370
|
+
details: import_zod_openapi45.z.object({
|
|
4371
|
+
invalidScopes: import_zod_openapi45.z.array(import_zod_openapi45.z.string())
|
|
4274
4372
|
}).optional()
|
|
4275
4373
|
})
|
|
4276
4374
|
});
|
|
4277
4375
|
|
|
4278
4376
|
// src/contracts/access-token.ts
|
|
4279
|
-
var listAccessTokensRoute = (0,
|
|
4377
|
+
var listAccessTokensRoute = (0, import_zod_openapi46.createRoute)({
|
|
4280
4378
|
method: "get",
|
|
4281
4379
|
path: "/me/access-tokens",
|
|
4282
4380
|
tags: ["me"],
|
|
@@ -4301,7 +4399,7 @@ var listAccessTokensRoute = (0, import_zod_openapi45.createRoute)({
|
|
|
4301
4399
|
}
|
|
4302
4400
|
}
|
|
4303
4401
|
});
|
|
4304
|
-
var createAccessTokenRoute = (0,
|
|
4402
|
+
var createAccessTokenRoute = (0, import_zod_openapi46.createRoute)({
|
|
4305
4403
|
method: "post",
|
|
4306
4404
|
path: "/me/access-tokens",
|
|
4307
4405
|
tags: ["me"],
|
|
@@ -4335,14 +4433,14 @@ var createAccessTokenRoute = (0, import_zod_openapi45.createRoute)({
|
|
|
4335
4433
|
}
|
|
4336
4434
|
}
|
|
4337
4435
|
});
|
|
4338
|
-
var deleteAccessTokenRoute = (0,
|
|
4436
|
+
var deleteAccessTokenRoute = (0, import_zod_openapi46.createRoute)({
|
|
4339
4437
|
method: "delete",
|
|
4340
4438
|
path: "/me/access-tokens/{id}",
|
|
4341
4439
|
tags: ["me"],
|
|
4342
4440
|
security: [{ bearerAuth: [] }],
|
|
4343
4441
|
summary: "Revoke a personal access token",
|
|
4344
4442
|
request: {
|
|
4345
|
-
params:
|
|
4443
|
+
params: import_zod_openapi46.z.object({ id: import_zod_openapi46.z.string() })
|
|
4346
4444
|
},
|
|
4347
4445
|
responses: {
|
|
4348
4446
|
200: {
|
|
@@ -4374,13 +4472,13 @@ var accessTokenRoutes = {
|
|
|
4374
4472
|
};
|
|
4375
4473
|
|
|
4376
4474
|
// src/contracts/oauth.ts
|
|
4377
|
-
var
|
|
4475
|
+
var import_zod_openapi49 = require("@hono/zod-openapi");
|
|
4378
4476
|
|
|
4379
4477
|
// src/schemas/oauth-endpoints.ts
|
|
4380
|
-
var
|
|
4478
|
+
var import_zod_openapi48 = require("@hono/zod-openapi");
|
|
4381
4479
|
|
|
4382
4480
|
// src/schemas/oauth.ts
|
|
4383
|
-
var
|
|
4481
|
+
var import_zod_openapi47 = require("@hono/zod-openapi");
|
|
4384
4482
|
var SCOPES = [
|
|
4385
4483
|
// umbrella
|
|
4386
4484
|
"read",
|
|
@@ -4448,11 +4546,11 @@ function scopeSatisfies(required, granted) {
|
|
|
4448
4546
|
return false;
|
|
4449
4547
|
}
|
|
4450
4548
|
var InsufficientScopeErrorSchema = ApiErrorSchema.extend({
|
|
4451
|
-
error:
|
|
4452
|
-
code:
|
|
4453
|
-
message:
|
|
4454
|
-
details:
|
|
4455
|
-
requiredScope:
|
|
4549
|
+
error: import_zod_openapi47.z.object({
|
|
4550
|
+
code: import_zod_openapi47.z.literal("INSUFFICIENT_SCOPE"),
|
|
4551
|
+
message: import_zod_openapi47.z.string(),
|
|
4552
|
+
details: import_zod_openapi47.z.object({
|
|
4553
|
+
requiredScope: import_zod_openapi47.z.string()
|
|
4456
4554
|
}).optional()
|
|
4457
4555
|
})
|
|
4458
4556
|
});
|
|
@@ -4471,102 +4569,102 @@ var OAUTH_ERROR_CODES = [
|
|
|
4471
4569
|
"slow_down",
|
|
4472
4570
|
"expired_token"
|
|
4473
4571
|
];
|
|
4474
|
-
var OAuthErrorSchema =
|
|
4475
|
-
error:
|
|
4476
|
-
error_description:
|
|
4477
|
-
});
|
|
4478
|
-
var AuthorizeRequestSchema =
|
|
4479
|
-
client_id:
|
|
4480
|
-
redirect_uri:
|
|
4481
|
-
scope:
|
|
4482
|
-
code_challenge:
|
|
4483
|
-
code_challenge_method:
|
|
4484
|
-
state:
|
|
4485
|
-
});
|
|
4486
|
-
var AuthorizeResponseSchema =
|
|
4487
|
-
redirectUri:
|
|
4488
|
-
});
|
|
4489
|
-
var TokenRequestSchema =
|
|
4490
|
-
|
|
4491
|
-
grant_type:
|
|
4492
|
-
code:
|
|
4493
|
-
code_verifier:
|
|
4494
|
-
redirect_uri:
|
|
4495
|
-
client_id:
|
|
4572
|
+
var OAuthErrorSchema = import_zod_openapi48.z.object({
|
|
4573
|
+
error: import_zod_openapi48.z.enum(OAUTH_ERROR_CODES),
|
|
4574
|
+
error_description: import_zod_openapi48.z.string().optional()
|
|
4575
|
+
});
|
|
4576
|
+
var AuthorizeRequestSchema = import_zod_openapi48.z.object({
|
|
4577
|
+
client_id: import_zod_openapi48.z.string().min(1),
|
|
4578
|
+
redirect_uri: import_zod_openapi48.z.string().min(1),
|
|
4579
|
+
scope: import_zod_openapi48.z.string().min(1),
|
|
4580
|
+
code_challenge: import_zod_openapi48.z.string().min(1),
|
|
4581
|
+
code_challenge_method: import_zod_openapi48.z.literal("S256"),
|
|
4582
|
+
state: import_zod_openapi48.z.string().optional()
|
|
4583
|
+
});
|
|
4584
|
+
var AuthorizeResponseSchema = import_zod_openapi48.z.object({
|
|
4585
|
+
redirectUri: import_zod_openapi48.z.string()
|
|
4586
|
+
});
|
|
4587
|
+
var TokenRequestSchema = import_zod_openapi48.z.discriminatedUnion("grant_type", [
|
|
4588
|
+
import_zod_openapi48.z.object({
|
|
4589
|
+
grant_type: import_zod_openapi48.z.literal("authorization_code"),
|
|
4590
|
+
code: import_zod_openapi48.z.string().min(1),
|
|
4591
|
+
code_verifier: import_zod_openapi48.z.string().min(1),
|
|
4592
|
+
redirect_uri: import_zod_openapi48.z.string().min(1),
|
|
4593
|
+
client_id: import_zod_openapi48.z.string().min(1)
|
|
4496
4594
|
}),
|
|
4497
|
-
|
|
4498
|
-
grant_type:
|
|
4499
|
-
refresh_token:
|
|
4500
|
-
client_id:
|
|
4501
|
-
scope:
|
|
4595
|
+
import_zod_openapi48.z.object({
|
|
4596
|
+
grant_type: import_zod_openapi48.z.literal("refresh_token"),
|
|
4597
|
+
refresh_token: import_zod_openapi48.z.string().min(1),
|
|
4598
|
+
client_id: import_zod_openapi48.z.string().min(1),
|
|
4599
|
+
scope: import_zod_openapi48.z.string().optional()
|
|
4502
4600
|
}),
|
|
4503
4601
|
// RFC 8628 §3.4 — device authorization grant. The client polls with the
|
|
4504
4602
|
// opaque `device_code` returned by `/oauth/device/authorize`.
|
|
4505
|
-
|
|
4506
|
-
grant_type:
|
|
4507
|
-
device_code:
|
|
4508
|
-
client_id:
|
|
4603
|
+
import_zod_openapi48.z.object({
|
|
4604
|
+
grant_type: import_zod_openapi48.z.literal("urn:ietf:params:oauth:grant-type:device_code"),
|
|
4605
|
+
device_code: import_zod_openapi48.z.string().min(1),
|
|
4606
|
+
client_id: import_zod_openapi48.z.string().min(1)
|
|
4509
4607
|
})
|
|
4510
4608
|
]);
|
|
4511
4609
|
var DEVICE_CODE_GRANT_TYPE = "urn:ietf:params:oauth:grant-type:device_code";
|
|
4512
|
-
var TokenResponseSchema =
|
|
4513
|
-
access_token:
|
|
4514
|
-
token_type:
|
|
4515
|
-
expires_in:
|
|
4516
|
-
refresh_token:
|
|
4517
|
-
scope:
|
|
4518
|
-
});
|
|
4519
|
-
var RevokeRequestSchema =
|
|
4520
|
-
token:
|
|
4521
|
-
token_type_hint:
|
|
4522
|
-
});
|
|
4523
|
-
var RevokeResponseSchema =
|
|
4524
|
-
var DeviceAuthorizeRequestSchema =
|
|
4525
|
-
client_id:
|
|
4526
|
-
scope:
|
|
4527
|
-
});
|
|
4528
|
-
var DeviceAuthorizeResponseSchema =
|
|
4529
|
-
device_code:
|
|
4530
|
-
user_code:
|
|
4531
|
-
verification_uri:
|
|
4532
|
-
verification_uri_complete:
|
|
4533
|
-
expires_in:
|
|
4534
|
-
interval:
|
|
4535
|
-
});
|
|
4536
|
-
var DeviceVerifyRequestSchema =
|
|
4537
|
-
user_code:
|
|
4538
|
-
action:
|
|
4539
|
-
});
|
|
4540
|
-
var DeviceVerifyResponseSchema =
|
|
4541
|
-
status:
|
|
4542
|
-
});
|
|
4543
|
-
var DeviceInfoResponseSchema =
|
|
4544
|
-
client_id:
|
|
4545
|
-
scopes:
|
|
4546
|
-
});
|
|
4547
|
-
var ClientInfoResponseSchema =
|
|
4548
|
-
clientId:
|
|
4549
|
-
name:
|
|
4550
|
-
firstParty:
|
|
4551
|
-
trusted:
|
|
4610
|
+
var TokenResponseSchema = import_zod_openapi48.z.object({
|
|
4611
|
+
access_token: import_zod_openapi48.z.string(),
|
|
4612
|
+
token_type: import_zod_openapi48.z.literal("Bearer"),
|
|
4613
|
+
expires_in: import_zod_openapi48.z.number(),
|
|
4614
|
+
refresh_token: import_zod_openapi48.z.string(),
|
|
4615
|
+
scope: import_zod_openapi48.z.string()
|
|
4616
|
+
});
|
|
4617
|
+
var RevokeRequestSchema = import_zod_openapi48.z.object({
|
|
4618
|
+
token: import_zod_openapi48.z.string().min(1),
|
|
4619
|
+
token_type_hint: import_zod_openapi48.z.string().optional()
|
|
4620
|
+
});
|
|
4621
|
+
var RevokeResponseSchema = import_zod_openapi48.z.object({});
|
|
4622
|
+
var DeviceAuthorizeRequestSchema = import_zod_openapi48.z.object({
|
|
4623
|
+
client_id: import_zod_openapi48.z.string().min(1),
|
|
4624
|
+
scope: import_zod_openapi48.z.string().min(1)
|
|
4625
|
+
});
|
|
4626
|
+
var DeviceAuthorizeResponseSchema = import_zod_openapi48.z.object({
|
|
4627
|
+
device_code: import_zod_openapi48.z.string(),
|
|
4628
|
+
user_code: import_zod_openapi48.z.string(),
|
|
4629
|
+
verification_uri: import_zod_openapi48.z.string(),
|
|
4630
|
+
verification_uri_complete: import_zod_openapi48.z.string(),
|
|
4631
|
+
expires_in: import_zod_openapi48.z.number(),
|
|
4632
|
+
interval: import_zod_openapi48.z.number()
|
|
4633
|
+
});
|
|
4634
|
+
var DeviceVerifyRequestSchema = import_zod_openapi48.z.object({
|
|
4635
|
+
user_code: import_zod_openapi48.z.string().min(1),
|
|
4636
|
+
action: import_zod_openapi48.z.enum(["approve", "deny"])
|
|
4637
|
+
});
|
|
4638
|
+
var DeviceVerifyResponseSchema = import_zod_openapi48.z.object({
|
|
4639
|
+
status: import_zod_openapi48.z.enum(["approved", "denied"])
|
|
4640
|
+
});
|
|
4641
|
+
var DeviceInfoResponseSchema = import_zod_openapi48.z.object({
|
|
4642
|
+
client_id: import_zod_openapi48.z.string(),
|
|
4643
|
+
scopes: import_zod_openapi48.z.array(import_zod_openapi48.z.string())
|
|
4644
|
+
});
|
|
4645
|
+
var ClientInfoResponseSchema = import_zod_openapi48.z.object({
|
|
4646
|
+
clientId: import_zod_openapi48.z.string(),
|
|
4647
|
+
name: import_zod_openapi48.z.string(),
|
|
4648
|
+
firstParty: import_zod_openapi48.z.boolean(),
|
|
4649
|
+
trusted: import_zod_openapi48.z.boolean()
|
|
4552
4650
|
});
|
|
4553
4651
|
var GRANT_TYPES_SUPPORTED = ["authorization_code", "refresh_token", DEVICE_CODE_GRANT_TYPE];
|
|
4554
|
-
var DiscoveryResponseSchema =
|
|
4555
|
-
issuer:
|
|
4556
|
-
authorization_endpoint:
|
|
4557
|
-
token_endpoint:
|
|
4558
|
-
revocation_endpoint:
|
|
4559
|
-
device_authorization_endpoint:
|
|
4560
|
-
scopes_supported:
|
|
4561
|
-
response_types_supported:
|
|
4562
|
-
grant_types_supported:
|
|
4563
|
-
code_challenge_methods_supported:
|
|
4564
|
-
token_endpoint_auth_methods_supported:
|
|
4652
|
+
var DiscoveryResponseSchema = import_zod_openapi48.z.object({
|
|
4653
|
+
issuer: import_zod_openapi48.z.string(),
|
|
4654
|
+
authorization_endpoint: import_zod_openapi48.z.string(),
|
|
4655
|
+
token_endpoint: import_zod_openapi48.z.string(),
|
|
4656
|
+
revocation_endpoint: import_zod_openapi48.z.string(),
|
|
4657
|
+
device_authorization_endpoint: import_zod_openapi48.z.string().optional(),
|
|
4658
|
+
scopes_supported: import_zod_openapi48.z.array(import_zod_openapi48.z.string()),
|
|
4659
|
+
response_types_supported: import_zod_openapi48.z.array(import_zod_openapi48.z.string()),
|
|
4660
|
+
grant_types_supported: import_zod_openapi48.z.array(import_zod_openapi48.z.string()),
|
|
4661
|
+
code_challenge_methods_supported: import_zod_openapi48.z.array(import_zod_openapi48.z.string()),
|
|
4662
|
+
token_endpoint_auth_methods_supported: import_zod_openapi48.z.array(import_zod_openapi48.z.string())
|
|
4565
4663
|
});
|
|
4566
4664
|
var DISCOVERY_SCOPES_SUPPORTED = ISSUABLE_SCOPES;
|
|
4567
4665
|
|
|
4568
4666
|
// src/contracts/oauth.ts
|
|
4569
|
-
var authorizeRoute = (0,
|
|
4667
|
+
var authorizeRoute = (0, import_zod_openapi49.createRoute)({
|
|
4570
4668
|
method: "post",
|
|
4571
4669
|
path: "/oauth/authorize",
|
|
4572
4670
|
tags: ["oauth"],
|
|
@@ -4596,7 +4694,7 @@ var authorizeRoute = (0, import_zod_openapi48.createRoute)({
|
|
|
4596
4694
|
}
|
|
4597
4695
|
}
|
|
4598
4696
|
});
|
|
4599
|
-
var tokenRoute = (0,
|
|
4697
|
+
var tokenRoute = (0, import_zod_openapi49.createRoute)({
|
|
4600
4698
|
method: "post",
|
|
4601
4699
|
path: "/oauth/token",
|
|
4602
4700
|
tags: ["oauth"],
|
|
@@ -4628,7 +4726,7 @@ var tokenRoute = (0, import_zod_openapi48.createRoute)({
|
|
|
4628
4726
|
}
|
|
4629
4727
|
}
|
|
4630
4728
|
});
|
|
4631
|
-
var revokeRoute = (0,
|
|
4729
|
+
var revokeRoute = (0, import_zod_openapi49.createRoute)({
|
|
4632
4730
|
method: "post",
|
|
4633
4731
|
path: "/oauth/revoke",
|
|
4634
4732
|
tags: ["oauth"],
|
|
@@ -4648,7 +4746,7 @@ var revokeRoute = (0, import_zod_openapi48.createRoute)({
|
|
|
4648
4746
|
}
|
|
4649
4747
|
}
|
|
4650
4748
|
});
|
|
4651
|
-
var discoveryRoute = (0,
|
|
4749
|
+
var discoveryRoute = (0, import_zod_openapi49.createRoute)({
|
|
4652
4750
|
method: "get",
|
|
4653
4751
|
path: "/.well-known/oauth-authorization-server",
|
|
4654
4752
|
tags: ["oauth"],
|
|
@@ -4660,7 +4758,7 @@ var discoveryRoute = (0, import_zod_openapi48.createRoute)({
|
|
|
4660
4758
|
}
|
|
4661
4759
|
}
|
|
4662
4760
|
});
|
|
4663
|
-
var deviceAuthorizeRoute = (0,
|
|
4761
|
+
var deviceAuthorizeRoute = (0, import_zod_openapi49.createRoute)({
|
|
4664
4762
|
method: "post",
|
|
4665
4763
|
path: "/oauth/device/authorize",
|
|
4666
4764
|
tags: ["oauth"],
|
|
@@ -4688,7 +4786,7 @@ var deviceAuthorizeRoute = (0, import_zod_openapi48.createRoute)({
|
|
|
4688
4786
|
}
|
|
4689
4787
|
}
|
|
4690
4788
|
});
|
|
4691
|
-
var deviceInfoRoute = (0,
|
|
4789
|
+
var deviceInfoRoute = (0, import_zod_openapi49.createRoute)({
|
|
4692
4790
|
method: "get",
|
|
4693
4791
|
path: "/oauth/device",
|
|
4694
4792
|
tags: ["oauth"],
|
|
@@ -4697,7 +4795,7 @@ var deviceInfoRoute = (0, import_zod_openapi48.createRoute)({
|
|
|
4697
4795
|
// scopes so the web consent screen can show them before approval. Reveals
|
|
4698
4796
|
// no secret. Unknown / expired / non-pending → 404 (PHASE4-Q9 option A).
|
|
4699
4797
|
request: {
|
|
4700
|
-
query:
|
|
4798
|
+
query: import_zod_openapi49.z.object({ user_code: import_zod_openapi49.z.string().min(1) })
|
|
4701
4799
|
},
|
|
4702
4800
|
responses: {
|
|
4703
4801
|
200: {
|
|
@@ -4710,7 +4808,7 @@ var deviceInfoRoute = (0, import_zod_openapi48.createRoute)({
|
|
|
4710
4808
|
}
|
|
4711
4809
|
}
|
|
4712
4810
|
});
|
|
4713
|
-
var deviceVerifyRoute = (0,
|
|
4811
|
+
var deviceVerifyRoute = (0, import_zod_openapi49.createRoute)({
|
|
4714
4812
|
method: "post",
|
|
4715
4813
|
path: "/oauth/device/verify",
|
|
4716
4814
|
tags: ["oauth"],
|
|
@@ -4740,7 +4838,7 @@ var deviceVerifyRoute = (0, import_zod_openapi48.createRoute)({
|
|
|
4740
4838
|
}
|
|
4741
4839
|
}
|
|
4742
4840
|
});
|
|
4743
|
-
var clientInfoRoute = (0,
|
|
4841
|
+
var clientInfoRoute = (0, import_zod_openapi49.createRoute)({
|
|
4744
4842
|
method: "get",
|
|
4745
4843
|
path: "/oauth/client-info",
|
|
4746
4844
|
tags: ["oauth"],
|
|
@@ -4751,7 +4849,7 @@ var clientInfoRoute = (0, import_zod_openapi48.createRoute)({
|
|
|
4751
4849
|
// no redirectUris/allowedScopes — mirroring deviceInfoRoute's own
|
|
4752
4850
|
// non-secret-lookup shape. Unknown client_id → 404.
|
|
4753
4851
|
request: {
|
|
4754
|
-
query:
|
|
4852
|
+
query: import_zod_openapi49.z.object({ client_id: import_zod_openapi49.z.string().min(1) })
|
|
4755
4853
|
},
|
|
4756
4854
|
responses: {
|
|
4757
4855
|
200: {
|
|
@@ -4776,24 +4874,24 @@ var oauthRoutes = {
|
|
|
4776
4874
|
};
|
|
4777
4875
|
|
|
4778
4876
|
// src/contracts/notification.ts
|
|
4779
|
-
var
|
|
4877
|
+
var import_zod_openapi51 = require("@hono/zod-openapi");
|
|
4780
4878
|
|
|
4781
4879
|
// src/schemas/notification.ts
|
|
4782
|
-
var
|
|
4783
|
-
var NotificationStatusSchema =
|
|
4880
|
+
var import_zod_openapi50 = require("@hono/zod-openapi");
|
|
4881
|
+
var NotificationStatusSchema = import_zod_openapi50.z.enum(["UNREAD", "UNOPENED", "OPENED"]);
|
|
4784
4882
|
var NotificationStatusEnum = {
|
|
4785
4883
|
UNREAD: "UNREAD",
|
|
4786
4884
|
UNOPENED: "UNOPENED",
|
|
4787
4885
|
OPENED: "OPENED"
|
|
4788
4886
|
};
|
|
4789
|
-
var NotificationActionSchema =
|
|
4887
|
+
var NotificationActionSchema = import_zod_openapi50.z.enum(["COMMENT", "LIKE", "MENTION", "UPDATE"]);
|
|
4790
4888
|
var NotificationActionEnum = {
|
|
4791
4889
|
COMMENT: "COMMENT",
|
|
4792
4890
|
LIKE: "LIKE",
|
|
4793
4891
|
MENTION: "MENTION",
|
|
4794
4892
|
UPDATE: "UPDATE"
|
|
4795
4893
|
};
|
|
4796
|
-
var NotificationTargetModelSchema =
|
|
4894
|
+
var NotificationTargetModelSchema = import_zod_openapi50.z.enum(["Page"]);
|
|
4797
4895
|
var NotificationTargetModelEnum = {
|
|
4798
4896
|
PAGE: "Page"
|
|
4799
4897
|
};
|
|
@@ -4802,71 +4900,71 @@ var PageRefSchema = PageSchema.pick({
|
|
|
4802
4900
|
path: true,
|
|
4803
4901
|
status: true
|
|
4804
4902
|
});
|
|
4805
|
-
var NotificationSchema =
|
|
4806
|
-
_id:
|
|
4807
|
-
user:
|
|
4903
|
+
var NotificationSchema = import_zod_openapi50.z.object({
|
|
4904
|
+
_id: import_zod_openapi50.z.string(),
|
|
4905
|
+
user: import_zod_openapi50.z.string(),
|
|
4808
4906
|
targetModel: NotificationTargetModelSchema,
|
|
4809
4907
|
target: PageRefSchema,
|
|
4810
4908
|
action: NotificationActionSchema,
|
|
4811
4909
|
status: NotificationStatusSchema,
|
|
4812
|
-
actionUsers:
|
|
4813
|
-
createdAt:
|
|
4910
|
+
actionUsers: import_zod_openapi50.z.array(UserPublicSchema),
|
|
4911
|
+
createdAt: import_zod_openapi50.z.string()
|
|
4814
4912
|
});
|
|
4815
|
-
var ListNotificationsRequestSchema =
|
|
4816
|
-
limit:
|
|
4817
|
-
offset:
|
|
4913
|
+
var ListNotificationsRequestSchema = import_zod_openapi50.z.object({
|
|
4914
|
+
limit: import_zod_openapi50.z.coerce.number().optional().default(10),
|
|
4915
|
+
offset: import_zod_openapi50.z.coerce.number().optional().default(0)
|
|
4818
4916
|
});
|
|
4819
|
-
var ListNotificationsResponseSchema =
|
|
4820
|
-
notifications:
|
|
4917
|
+
var ListNotificationsResponseSchema = import_zod_openapi50.z.object({
|
|
4918
|
+
notifications: import_zod_openapi50.z.array(NotificationSchema),
|
|
4821
4919
|
pager: PagerSchema
|
|
4822
4920
|
});
|
|
4823
|
-
var MarkAllAsReadResponseSchema =
|
|
4824
|
-
ok:
|
|
4921
|
+
var MarkAllAsReadResponseSchema = import_zod_openapi50.z.object({
|
|
4922
|
+
ok: import_zod_openapi50.z.literal(true)
|
|
4825
4923
|
});
|
|
4826
|
-
var OpenNotificationParamSchema =
|
|
4827
|
-
id:
|
|
4924
|
+
var OpenNotificationParamSchema = import_zod_openapi50.z.object({
|
|
4925
|
+
id: import_zod_openapi50.z.string()
|
|
4828
4926
|
});
|
|
4829
|
-
var OpenNotificationResponseSchema =
|
|
4927
|
+
var OpenNotificationResponseSchema = import_zod_openapi50.z.object({
|
|
4830
4928
|
notification: NotificationSchema
|
|
4831
4929
|
});
|
|
4832
|
-
var NotificationStatusResponseSchema =
|
|
4833
|
-
count:
|
|
4930
|
+
var NotificationStatusResponseSchema = import_zod_openapi50.z.object({
|
|
4931
|
+
count: import_zod_openapi50.z.number()
|
|
4834
4932
|
});
|
|
4835
|
-
var NotificationNotFoundErrorSchema =
|
|
4836
|
-
error:
|
|
4837
|
-
code:
|
|
4838
|
-
message:
|
|
4933
|
+
var NotificationNotFoundErrorSchema = import_zod_openapi50.z.object({
|
|
4934
|
+
error: import_zod_openapi50.z.object({
|
|
4935
|
+
code: import_zod_openapi50.z.literal("NOTIFICATION_NOT_FOUND"),
|
|
4936
|
+
message: import_zod_openapi50.z.literal("Notification not found")
|
|
4839
4937
|
})
|
|
4840
4938
|
});
|
|
4841
|
-
var NotificationsTokenResponseSchema =
|
|
4842
|
-
token:
|
|
4843
|
-
selfUserId:
|
|
4844
|
-
expiresAt:
|
|
4939
|
+
var NotificationsTokenResponseSchema = import_zod_openapi50.z.object({
|
|
4940
|
+
token: import_zod_openapi50.z.string(),
|
|
4941
|
+
selfUserId: import_zod_openapi50.z.string(),
|
|
4942
|
+
expiresAt: import_zod_openapi50.z.string()
|
|
4845
4943
|
});
|
|
4846
|
-
var NotificationsTokenPayloadSchema =
|
|
4847
|
-
selfUserId:
|
|
4944
|
+
var NotificationsTokenPayloadSchema = import_zod_openapi50.z.object({
|
|
4945
|
+
selfUserId: import_zod_openapi50.z.string(),
|
|
4848
4946
|
// Random UUID mixed into every signed token so two tokens minted
|
|
4849
4947
|
// within the same second still produce byte-different JWT strings.
|
|
4850
4948
|
// The browser uses the token as a React effect dependency to drive
|
|
4851
4949
|
// the WebSocket reconnect — without `jti`, the iat/exp pair is
|
|
4852
4950
|
// identical at second granularity and the dep stays stable.
|
|
4853
|
-
jti:
|
|
4854
|
-
iat:
|
|
4855
|
-
exp:
|
|
4951
|
+
jti: import_zod_openapi50.z.string().uuid(),
|
|
4952
|
+
iat: import_zod_openapi50.z.number().int(),
|
|
4953
|
+
exp: import_zod_openapi50.z.number().int()
|
|
4856
4954
|
});
|
|
4857
|
-
var NotificationsChangedMessageSchema =
|
|
4858
|
-
type:
|
|
4955
|
+
var NotificationsChangedMessageSchema = import_zod_openapi50.z.object({
|
|
4956
|
+
type: import_zod_openapi50.z.literal("changed")
|
|
4859
4957
|
});
|
|
4860
4958
|
var NotificationsServerMessageSchema = NotificationsChangedMessageSchema;
|
|
4861
4959
|
|
|
4862
4960
|
// src/contracts/notification.ts
|
|
4863
|
-
var NotificationInvalidRequestErrorSchema =
|
|
4864
|
-
error:
|
|
4865
|
-
code:
|
|
4866
|
-
message:
|
|
4961
|
+
var NotificationInvalidRequestErrorSchema = import_zod_openapi51.z.object({
|
|
4962
|
+
error: import_zod_openapi51.z.object({
|
|
4963
|
+
code: import_zod_openapi51.z.literal("INVALID_REQUEST"),
|
|
4964
|
+
message: import_zod_openapi51.z.string()
|
|
4867
4965
|
})
|
|
4868
4966
|
});
|
|
4869
|
-
var listNotificationsRoute = (0,
|
|
4967
|
+
var listNotificationsRoute = (0, import_zod_openapi51.createRoute)({
|
|
4870
4968
|
method: "get",
|
|
4871
4969
|
path: "/notifications",
|
|
4872
4970
|
tags: ["notification"],
|
|
@@ -4890,7 +4988,7 @@ var listNotificationsRoute = (0, import_zod_openapi50.createRoute)({
|
|
|
4890
4988
|
}
|
|
4891
4989
|
}
|
|
4892
4990
|
});
|
|
4893
|
-
var markAllAsReadRoute = (0,
|
|
4991
|
+
var markAllAsReadRoute = (0, import_zod_openapi51.createRoute)({
|
|
4894
4992
|
method: "post",
|
|
4895
4993
|
path: "/notifications/read",
|
|
4896
4994
|
tags: ["notification"],
|
|
@@ -4911,7 +5009,7 @@ var markAllAsReadRoute = (0, import_zod_openapi50.createRoute)({
|
|
|
4911
5009
|
}
|
|
4912
5010
|
}
|
|
4913
5011
|
});
|
|
4914
|
-
var getUnreadCountRoute = (0,
|
|
5012
|
+
var getUnreadCountRoute = (0, import_zod_openapi51.createRoute)({
|
|
4915
5013
|
method: "get",
|
|
4916
5014
|
path: "/notifications/status",
|
|
4917
5015
|
tags: ["notification"],
|
|
@@ -4932,7 +5030,7 @@ var getUnreadCountRoute = (0, import_zod_openapi50.createRoute)({
|
|
|
4932
5030
|
}
|
|
4933
5031
|
}
|
|
4934
5032
|
});
|
|
4935
|
-
var openNotificationRoute = (0,
|
|
5033
|
+
var openNotificationRoute = (0, import_zod_openapi51.createRoute)({
|
|
4936
5034
|
method: "post",
|
|
4937
5035
|
path: "/notifications/{id}/open",
|
|
4938
5036
|
tags: ["notification"],
|
|
@@ -4964,7 +5062,7 @@ var openNotificationRoute = (0, import_zod_openapi50.createRoute)({
|
|
|
4964
5062
|
}
|
|
4965
5063
|
}
|
|
4966
5064
|
});
|
|
4967
|
-
var getNotificationsTokenRoute = (0,
|
|
5065
|
+
var getNotificationsTokenRoute = (0, import_zod_openapi51.createRoute)({
|
|
4968
5066
|
method: "get",
|
|
4969
5067
|
path: "/notifications/token",
|
|
4970
5068
|
tags: ["notification"],
|
|
@@ -4999,11 +5097,11 @@ var notificationRoutes = {
|
|
|
4999
5097
|
};
|
|
5000
5098
|
|
|
5001
5099
|
// src/contracts/page-collab.ts
|
|
5002
|
-
var
|
|
5003
|
-
var PageIdPathParamsSchema2 =
|
|
5004
|
-
id:
|
|
5100
|
+
var import_zod_openapi52 = require("@hono/zod-openapi");
|
|
5101
|
+
var PageIdPathParamsSchema2 = import_zod_openapi52.z.object({
|
|
5102
|
+
id: import_zod_openapi52.z.string().openapi({ description: "Page id (24-char hex ObjectId)", example: "507f1f77bcf86cd799439011" })
|
|
5005
5103
|
});
|
|
5006
|
-
var getYjsTokenRoute = (0,
|
|
5104
|
+
var getYjsTokenRoute = (0, import_zod_openapi52.createRoute)({
|
|
5007
5105
|
method: "get",
|
|
5008
5106
|
path: "/pages/{id}/yjs-token",
|
|
5009
5107
|
tags: ["page-collab"],
|
|
@@ -5040,26 +5138,26 @@ var pageCollabRoutes = {
|
|
|
5040
5138
|
};
|
|
5041
5139
|
|
|
5042
5140
|
// src/contracts/page.ts
|
|
5043
|
-
var
|
|
5044
|
-
var PageBadRequestErrorSchema =
|
|
5045
|
-
error:
|
|
5046
|
-
code:
|
|
5047
|
-
message:
|
|
5141
|
+
var import_zod_openapi53 = require("@hono/zod-openapi");
|
|
5142
|
+
var PageBadRequestErrorSchema = import_zod_openapi53.z.object({
|
|
5143
|
+
error: import_zod_openapi53.z.object({
|
|
5144
|
+
code: import_zod_openapi53.z.string(),
|
|
5145
|
+
message: import_zod_openapi53.z.string()
|
|
5048
5146
|
})
|
|
5049
5147
|
});
|
|
5050
|
-
var DeletePageRequestSchema =
|
|
5051
|
-
page_id:
|
|
5052
|
-
revision_id:
|
|
5053
|
-
completely:
|
|
5148
|
+
var DeletePageRequestSchema = import_zod_openapi53.z.object({
|
|
5149
|
+
page_id: import_zod_openapi53.z.string(),
|
|
5150
|
+
revision_id: import_zod_openapi53.z.string().optional(),
|
|
5151
|
+
completely: import_zod_openapi53.z.boolean().optional()
|
|
5054
5152
|
});
|
|
5055
|
-
var RevertDeletedPageRequestSchema =
|
|
5056
|
-
page_id:
|
|
5153
|
+
var RevertDeletedPageRequestSchema = import_zod_openapi53.z.object({
|
|
5154
|
+
page_id: import_zod_openapi53.z.string()
|
|
5057
5155
|
});
|
|
5058
|
-
var PageIdBodySchema =
|
|
5059
|
-
page_id:
|
|
5156
|
+
var PageIdBodySchema = import_zod_openapi53.z.object({
|
|
5157
|
+
page_id: import_zod_openapi53.z.string()
|
|
5060
5158
|
});
|
|
5061
|
-
var PageResponseSchema =
|
|
5062
|
-
var getPageRoute = (0,
|
|
5159
|
+
var PageResponseSchema = import_zod_openapi53.z.object({ page: PageSchema });
|
|
5160
|
+
var getPageRoute = (0, import_zod_openapi53.createRoute)({
|
|
5063
5161
|
method: "get",
|
|
5064
5162
|
path: "/pages",
|
|
5065
5163
|
tags: ["page"],
|
|
@@ -5096,7 +5194,7 @@ var getPageRoute = (0, import_zod_openapi52.createRoute)({
|
|
|
5096
5194
|
}
|
|
5097
5195
|
}
|
|
5098
5196
|
});
|
|
5099
|
-
var listPagesRoute = (0,
|
|
5197
|
+
var listPagesRoute = (0, import_zod_openapi53.createRoute)({
|
|
5100
5198
|
method: "get",
|
|
5101
5199
|
path: "/pages/list",
|
|
5102
5200
|
tags: ["page"],
|
|
@@ -5116,7 +5214,7 @@ var listPagesRoute = (0, import_zod_openapi52.createRoute)({
|
|
|
5116
5214
|
}
|
|
5117
5215
|
}
|
|
5118
5216
|
});
|
|
5119
|
-
var listPageChildrenRoute = (0,
|
|
5217
|
+
var listPageChildrenRoute = (0, import_zod_openapi53.createRoute)({
|
|
5120
5218
|
method: "get",
|
|
5121
5219
|
path: "/pages/children",
|
|
5122
5220
|
tags: ["page"],
|
|
@@ -5136,7 +5234,7 @@ var listPageChildrenRoute = (0, import_zod_openapi52.createRoute)({
|
|
|
5136
5234
|
}
|
|
5137
5235
|
}
|
|
5138
5236
|
});
|
|
5139
|
-
var createPageRoute = (0,
|
|
5237
|
+
var createPageRoute = (0, import_zod_openapi53.createRoute)({
|
|
5140
5238
|
method: "post",
|
|
5141
5239
|
path: "/pages",
|
|
5142
5240
|
tags: ["page"],
|
|
@@ -5162,7 +5260,7 @@ var createPageRoute = (0, import_zod_openapi52.createRoute)({
|
|
|
5162
5260
|
}
|
|
5163
5261
|
}
|
|
5164
5262
|
});
|
|
5165
|
-
var updatePageRoute = (0,
|
|
5263
|
+
var updatePageRoute = (0, import_zod_openapi53.createRoute)({
|
|
5166
5264
|
method: "put",
|
|
5167
5265
|
path: "/pages",
|
|
5168
5266
|
tags: ["page"],
|
|
@@ -5196,7 +5294,7 @@ var updatePageRoute = (0, import_zod_openapi52.createRoute)({
|
|
|
5196
5294
|
}
|
|
5197
5295
|
}
|
|
5198
5296
|
});
|
|
5199
|
-
var setPageGrantRoute = (0,
|
|
5297
|
+
var setPageGrantRoute = (0, import_zod_openapi53.createRoute)({
|
|
5200
5298
|
method: "put",
|
|
5201
5299
|
path: "/pages/grant",
|
|
5202
5300
|
tags: ["page"],
|
|
@@ -5226,7 +5324,7 @@ var setPageGrantRoute = (0, import_zod_openapi52.createRoute)({
|
|
|
5226
5324
|
}
|
|
5227
5325
|
}
|
|
5228
5326
|
});
|
|
5229
|
-
var seenPageRoute = (0,
|
|
5327
|
+
var seenPageRoute = (0, import_zod_openapi53.createRoute)({
|
|
5230
5328
|
method: "post",
|
|
5231
5329
|
path: "/pages/seen",
|
|
5232
5330
|
tags: ["page"],
|
|
@@ -5256,7 +5354,7 @@ var seenPageRoute = (0, import_zod_openapi52.createRoute)({
|
|
|
5256
5354
|
}
|
|
5257
5355
|
}
|
|
5258
5356
|
});
|
|
5259
|
-
var getSeenUsersRoute = (0,
|
|
5357
|
+
var getSeenUsersRoute = (0, import_zod_openapi53.createRoute)({
|
|
5260
5358
|
method: "get",
|
|
5261
5359
|
path: "/pages/seen-users",
|
|
5262
5360
|
tags: ["page"],
|
|
@@ -5284,7 +5382,7 @@ var getSeenUsersRoute = (0, import_zod_openapi52.createRoute)({
|
|
|
5284
5382
|
}
|
|
5285
5383
|
}
|
|
5286
5384
|
});
|
|
5287
|
-
var likePageRoute = (0,
|
|
5385
|
+
var likePageRoute = (0, import_zod_openapi53.createRoute)({
|
|
5288
5386
|
method: "post",
|
|
5289
5387
|
path: "/pages/like",
|
|
5290
5388
|
tags: ["page"],
|
|
@@ -5314,7 +5412,7 @@ var likePageRoute = (0, import_zod_openapi52.createRoute)({
|
|
|
5314
5412
|
}
|
|
5315
5413
|
}
|
|
5316
5414
|
});
|
|
5317
|
-
var unlikePageRoute = (0,
|
|
5415
|
+
var unlikePageRoute = (0, import_zod_openapi53.createRoute)({
|
|
5318
5416
|
method: "post",
|
|
5319
5417
|
path: "/pages/unlike",
|
|
5320
5418
|
tags: ["page"],
|
|
@@ -5344,7 +5442,7 @@ var unlikePageRoute = (0, import_zod_openapi52.createRoute)({
|
|
|
5344
5442
|
}
|
|
5345
5443
|
}
|
|
5346
5444
|
});
|
|
5347
|
-
var claimPageLinkAccessRoute = (0,
|
|
5445
|
+
var claimPageLinkAccessRoute = (0, import_zod_openapi53.createRoute)({
|
|
5348
5446
|
method: "post",
|
|
5349
5447
|
path: "/pages/link-access",
|
|
5350
5448
|
tags: ["page"],
|
|
@@ -5372,7 +5470,7 @@ var claimPageLinkAccessRoute = (0, import_zod_openapi52.createRoute)({
|
|
|
5372
5470
|
description: "The caller has no access to the page (isGrantedFor is false) or lacks scope / is a non-web session \u2014 403 is about the caller lacking access, never about the page grant type per se",
|
|
5373
5471
|
content: {
|
|
5374
5472
|
"application/json": {
|
|
5375
|
-
schema:
|
|
5473
|
+
schema: import_zod_openapi53.z.union([PageNotGrantedErrorSchema, InsufficientScopeErrorSchema])
|
|
5376
5474
|
}
|
|
5377
5475
|
}
|
|
5378
5476
|
},
|
|
@@ -5390,7 +5488,7 @@ var claimPageLinkAccessRoute = (0, import_zod_openapi52.createRoute)({
|
|
|
5390
5488
|
}
|
|
5391
5489
|
}
|
|
5392
5490
|
});
|
|
5393
|
-
var getWatchStatusRoute = (0,
|
|
5491
|
+
var getWatchStatusRoute = (0, import_zod_openapi53.createRoute)({
|
|
5394
5492
|
method: "get",
|
|
5395
5493
|
path: "/pages/watch",
|
|
5396
5494
|
tags: ["page"],
|
|
@@ -5418,7 +5516,7 @@ var getWatchStatusRoute = (0, import_zod_openapi52.createRoute)({
|
|
|
5418
5516
|
}
|
|
5419
5517
|
}
|
|
5420
5518
|
});
|
|
5421
|
-
var setWatchStatusRoute = (0,
|
|
5519
|
+
var setWatchStatusRoute = (0, import_zod_openapi53.createRoute)({
|
|
5422
5520
|
method: "put",
|
|
5423
5521
|
path: "/pages/watch",
|
|
5424
5522
|
tags: ["page"],
|
|
@@ -5448,7 +5546,7 @@ var setWatchStatusRoute = (0, import_zod_openapi52.createRoute)({
|
|
|
5448
5546
|
}
|
|
5449
5547
|
}
|
|
5450
5548
|
});
|
|
5451
|
-
var deletePageRoute = (0,
|
|
5549
|
+
var deletePageRoute = (0, import_zod_openapi53.createRoute)({
|
|
5452
5550
|
method: "delete",
|
|
5453
5551
|
path: "/pages",
|
|
5454
5552
|
tags: ["page"],
|
|
@@ -5482,7 +5580,7 @@ var deletePageRoute = (0, import_zod_openapi52.createRoute)({
|
|
|
5482
5580
|
}
|
|
5483
5581
|
}
|
|
5484
5582
|
});
|
|
5485
|
-
var revertDeletedPageRoute = (0,
|
|
5583
|
+
var revertDeletedPageRoute = (0, import_zod_openapi53.createRoute)({
|
|
5486
5584
|
method: "post",
|
|
5487
5585
|
path: "/pages/revert",
|
|
5488
5586
|
tags: ["page"],
|
|
@@ -5512,7 +5610,7 @@ var revertDeletedPageRoute = (0, import_zod_openapi52.createRoute)({
|
|
|
5512
5610
|
}
|
|
5513
5611
|
}
|
|
5514
5612
|
});
|
|
5515
|
-
var revertToRevisionRoute = (0,
|
|
5613
|
+
var revertToRevisionRoute = (0, import_zod_openapi53.createRoute)({
|
|
5516
5614
|
method: "post",
|
|
5517
5615
|
path: "/pages/revert-to-revision",
|
|
5518
5616
|
tags: ["page"],
|
|
@@ -5542,7 +5640,7 @@ var revertToRevisionRoute = (0, import_zod_openapi52.createRoute)({
|
|
|
5542
5640
|
}
|
|
5543
5641
|
}
|
|
5544
5642
|
});
|
|
5545
|
-
var renamePageRoute = (0,
|
|
5643
|
+
var renamePageRoute = (0, import_zod_openapi53.createRoute)({
|
|
5546
5644
|
method: "post",
|
|
5547
5645
|
path: "/pages/rename",
|
|
5548
5646
|
tags: ["page"],
|
|
@@ -5562,7 +5660,7 @@ var renamePageRoute = (0, import_zod_openapi52.createRoute)({
|
|
|
5562
5660
|
description: "PAGE_INVALID_NAME / PAGE_EXISTS / PAGE_RENAME_FAILED / PAGE_RENAME_TREE_FAILED",
|
|
5563
5661
|
content: {
|
|
5564
5662
|
"application/json": {
|
|
5565
|
-
schema:
|
|
5663
|
+
schema: import_zod_openapi53.z.union([PageBadRequestErrorSchema, RenameTreeErrorSchema])
|
|
5566
5664
|
}
|
|
5567
5665
|
}
|
|
5568
5666
|
},
|
|
@@ -5580,7 +5678,7 @@ var renamePageRoute = (0, import_zod_openapi52.createRoute)({
|
|
|
5580
5678
|
}
|
|
5581
5679
|
}
|
|
5582
5680
|
});
|
|
5583
|
-
var renameSubtreeRoute = (0,
|
|
5681
|
+
var renameSubtreeRoute = (0, import_zod_openapi53.createRoute)({
|
|
5584
5682
|
method: "post",
|
|
5585
5683
|
path: "/pages/rename-subtree",
|
|
5586
5684
|
tags: ["page"],
|
|
@@ -5600,7 +5698,7 @@ var renameSubtreeRoute = (0, import_zod_openapi52.createRoute)({
|
|
|
5600
5698
|
description: "PAGE_INVALID_NAME / PAGE_RENAME_TREE_FAILED (collisions, nothing to move, or partial failure)",
|
|
5601
5699
|
content: {
|
|
5602
5700
|
"application/json": {
|
|
5603
|
-
schema:
|
|
5701
|
+
schema: import_zod_openapi53.z.union([PageBadRequestErrorSchema, RenameTreeErrorSchema])
|
|
5604
5702
|
}
|
|
5605
5703
|
}
|
|
5606
5704
|
},
|
|
@@ -5650,20 +5748,20 @@ var pageRoutes = {
|
|
|
5650
5748
|
};
|
|
5651
5749
|
|
|
5652
5750
|
// src/contracts/page-preview.ts
|
|
5653
|
-
var
|
|
5751
|
+
var import_zod_openapi55 = require("@hono/zod-openapi");
|
|
5654
5752
|
|
|
5655
5753
|
// src/schemas/page-preview.ts
|
|
5656
|
-
var
|
|
5657
|
-
var PreviewPageRequestSchema =
|
|
5658
|
-
body:
|
|
5754
|
+
var import_zod_openapi54 = require("@hono/zod-openapi");
|
|
5755
|
+
var PreviewPageRequestSchema = import_zod_openapi54.z.object({
|
|
5756
|
+
body: import_zod_openapi54.z.string()
|
|
5659
5757
|
});
|
|
5660
|
-
var PreviewPageResponseSchema =
|
|
5758
|
+
var PreviewPageResponseSchema = import_zod_openapi54.z.object({
|
|
5661
5759
|
renderedAst: RenderedAstValueSchema.optional(),
|
|
5662
5760
|
renderedAstArtifactKey: RenderedAstArtifactKeySchema.optional()
|
|
5663
5761
|
});
|
|
5664
5762
|
|
|
5665
5763
|
// src/contracts/page-preview.ts
|
|
5666
|
-
var previewPageRoute = (0,
|
|
5764
|
+
var previewPageRoute = (0, import_zod_openapi55.createRoute)({
|
|
5667
5765
|
method: "post",
|
|
5668
5766
|
path: "/pages/preview",
|
|
5669
5767
|
tags: ["page-preview"],
|
|
@@ -5701,80 +5799,80 @@ var pagePreviewRoutes = {
|
|
|
5701
5799
|
};
|
|
5702
5800
|
|
|
5703
5801
|
// src/contracts/presence.ts
|
|
5704
|
-
var
|
|
5802
|
+
var import_zod_openapi57 = require("@hono/zod-openapi");
|
|
5705
5803
|
|
|
5706
5804
|
// src/schemas/presence.ts
|
|
5707
|
-
var
|
|
5708
|
-
var PresenceTokenResponseSchema =
|
|
5709
|
-
token:
|
|
5710
|
-
pageId:
|
|
5711
|
-
selfUserId:
|
|
5712
|
-
expiresAt:
|
|
5713
|
-
});
|
|
5714
|
-
var PresenceTokenPayloadSchema =
|
|
5715
|
-
userId:
|
|
5716
|
-
pageId:
|
|
5717
|
-
iat:
|
|
5718
|
-
exp:
|
|
5719
|
-
});
|
|
5720
|
-
var PresenceViewerSchema =
|
|
5721
|
-
userId:
|
|
5722
|
-
username:
|
|
5723
|
-
displayName:
|
|
5724
|
-
avatarUrl:
|
|
5725
|
-
isEditing:
|
|
5726
|
-
joinedAt:
|
|
5727
|
-
});
|
|
5728
|
-
var PresenceHeartbeatMessageSchema =
|
|
5729
|
-
type:
|
|
5805
|
+
var import_zod_openapi56 = require("@hono/zod-openapi");
|
|
5806
|
+
var PresenceTokenResponseSchema = import_zod_openapi56.z.object({
|
|
5807
|
+
token: import_zod_openapi56.z.string(),
|
|
5808
|
+
pageId: import_zod_openapi56.z.string(),
|
|
5809
|
+
selfUserId: import_zod_openapi56.z.string(),
|
|
5810
|
+
expiresAt: import_zod_openapi56.z.string()
|
|
5811
|
+
});
|
|
5812
|
+
var PresenceTokenPayloadSchema = import_zod_openapi56.z.object({
|
|
5813
|
+
userId: import_zod_openapi56.z.string(),
|
|
5814
|
+
pageId: import_zod_openapi56.z.string(),
|
|
5815
|
+
iat: import_zod_openapi56.z.number().int(),
|
|
5816
|
+
exp: import_zod_openapi56.z.number().int()
|
|
5817
|
+
});
|
|
5818
|
+
var PresenceViewerSchema = import_zod_openapi56.z.object({
|
|
5819
|
+
userId: import_zod_openapi56.z.string(),
|
|
5820
|
+
username: import_zod_openapi56.z.string(),
|
|
5821
|
+
displayName: import_zod_openapi56.z.string(),
|
|
5822
|
+
avatarUrl: import_zod_openapi56.z.string().nullable(),
|
|
5823
|
+
isEditing: import_zod_openapi56.z.boolean(),
|
|
5824
|
+
joinedAt: import_zod_openapi56.z.number().int()
|
|
5825
|
+
});
|
|
5826
|
+
var PresenceHeartbeatMessageSchema = import_zod_openapi56.z.object({
|
|
5827
|
+
type: import_zod_openapi56.z.literal("heartbeat")
|
|
5730
5828
|
});
|
|
5731
5829
|
var PresenceClientMessageSchema = PresenceHeartbeatMessageSchema;
|
|
5732
|
-
var PresenceViewersMessageSchema =
|
|
5733
|
-
type:
|
|
5734
|
-
viewers:
|
|
5735
|
-
generation:
|
|
5736
|
-
});
|
|
5737
|
-
var PresencePageUpdatedMessageSchema =
|
|
5738
|
-
type:
|
|
5739
|
-
pageId:
|
|
5740
|
-
revisionId:
|
|
5741
|
-
editorUserId:
|
|
5742
|
-
editorDisplayName:
|
|
5743
|
-
});
|
|
5744
|
-
var PresenceCommentChangedMessageSchema =
|
|
5745
|
-
type:
|
|
5746
|
-
pageId:
|
|
5747
|
-
changeType:
|
|
5748
|
-
commentId:
|
|
5749
|
-
actorUserId:
|
|
5750
|
-
});
|
|
5751
|
-
var PresenceServerMessageSchema =
|
|
5830
|
+
var PresenceViewersMessageSchema = import_zod_openapi56.z.object({
|
|
5831
|
+
type: import_zod_openapi56.z.literal("viewers"),
|
|
5832
|
+
viewers: import_zod_openapi56.z.array(PresenceViewerSchema),
|
|
5833
|
+
generation: import_zod_openapi56.z.number().int()
|
|
5834
|
+
});
|
|
5835
|
+
var PresencePageUpdatedMessageSchema = import_zod_openapi56.z.object({
|
|
5836
|
+
type: import_zod_openapi56.z.literal("page-updated"),
|
|
5837
|
+
pageId: import_zod_openapi56.z.string(),
|
|
5838
|
+
revisionId: import_zod_openapi56.z.string(),
|
|
5839
|
+
editorUserId: import_zod_openapi56.z.string(),
|
|
5840
|
+
editorDisplayName: import_zod_openapi56.z.string()
|
|
5841
|
+
});
|
|
5842
|
+
var PresenceCommentChangedMessageSchema = import_zod_openapi56.z.object({
|
|
5843
|
+
type: import_zod_openapi56.z.literal("comment-changed"),
|
|
5844
|
+
pageId: import_zod_openapi56.z.string(),
|
|
5845
|
+
changeType: import_zod_openapi56.z.enum(["added", "removed"]),
|
|
5846
|
+
commentId: import_zod_openapi56.z.string(),
|
|
5847
|
+
actorUserId: import_zod_openapi56.z.string().optional()
|
|
5848
|
+
});
|
|
5849
|
+
var PresenceServerMessageSchema = import_zod_openapi56.z.discriminatedUnion("type", [
|
|
5752
5850
|
PresenceViewersMessageSchema,
|
|
5753
5851
|
PresencePageUpdatedMessageSchema,
|
|
5754
5852
|
PresenceCommentChangedMessageSchema
|
|
5755
5853
|
]);
|
|
5756
|
-
var LikerSchema =
|
|
5757
|
-
id:
|
|
5758
|
-
username:
|
|
5759
|
-
displayName:
|
|
5760
|
-
avatarUrl:
|
|
5761
|
-
likedAt:
|
|
5762
|
-
});
|
|
5763
|
-
var LikersResponseSchema =
|
|
5764
|
-
users:
|
|
5765
|
-
totalCount:
|
|
5766
|
-
});
|
|
5767
|
-
var GetLikersRequestSchema =
|
|
5854
|
+
var LikerSchema = import_zod_openapi56.z.object({
|
|
5855
|
+
id: import_zod_openapi56.z.string(),
|
|
5856
|
+
username: import_zod_openapi56.z.string(),
|
|
5857
|
+
displayName: import_zod_openapi56.z.string(),
|
|
5858
|
+
avatarUrl: import_zod_openapi56.z.string().nullable(),
|
|
5859
|
+
likedAt: import_zod_openapi56.z.string().nullable()
|
|
5860
|
+
});
|
|
5861
|
+
var LikersResponseSchema = import_zod_openapi56.z.object({
|
|
5862
|
+
users: import_zod_openapi56.z.array(LikerSchema),
|
|
5863
|
+
totalCount: import_zod_openapi56.z.number().int().nonnegative()
|
|
5864
|
+
});
|
|
5865
|
+
var GetLikersRequestSchema = import_zod_openapi56.z.object({
|
|
5768
5866
|
// Optional cap on returned `users`. `totalCount` always reflects the
|
|
5769
5867
|
// full count regardless of `limit`. Omit for the full list.
|
|
5770
|
-
limit:
|
|
5868
|
+
limit: import_zod_openapi56.z.coerce.number().int().positive().optional()
|
|
5771
5869
|
});
|
|
5772
5870
|
|
|
5773
5871
|
// src/contracts/presence.ts
|
|
5774
|
-
var PageIdPathParamsSchema3 =
|
|
5775
|
-
id:
|
|
5872
|
+
var PageIdPathParamsSchema3 = import_zod_openapi57.z.object({
|
|
5873
|
+
id: import_zod_openapi57.z.string().openapi({ description: "Page id (24-char hex ObjectId)", example: "507f1f77bcf86cd799439011" })
|
|
5776
5874
|
});
|
|
5777
|
-
var getPresenceTokenRoute = (0,
|
|
5875
|
+
var getPresenceTokenRoute = (0, import_zod_openapi57.createRoute)({
|
|
5778
5876
|
method: "get",
|
|
5779
5877
|
path: "/pages/{id}/presence-token",
|
|
5780
5878
|
tags: ["presence"],
|
|
@@ -5806,7 +5904,7 @@ var getPresenceTokenRoute = (0, import_zod_openapi56.createRoute)({
|
|
|
5806
5904
|
}
|
|
5807
5905
|
}
|
|
5808
5906
|
});
|
|
5809
|
-
var getLikersRoute = (0,
|
|
5907
|
+
var getLikersRoute = (0, import_zod_openapi57.createRoute)({
|
|
5810
5908
|
method: "get",
|
|
5811
5909
|
path: "/pages/{id}/likers",
|
|
5812
5910
|
tags: ["presence"],
|
|
@@ -5845,50 +5943,50 @@ var presenceRoutes = {
|
|
|
5845
5943
|
};
|
|
5846
5944
|
|
|
5847
5945
|
// src/contracts/revision.ts
|
|
5848
|
-
var
|
|
5946
|
+
var import_zod_openapi59 = require("@hono/zod-openapi");
|
|
5849
5947
|
|
|
5850
5948
|
// src/schemas/revision.ts
|
|
5851
|
-
var
|
|
5852
|
-
var RevisionMetaSchema =
|
|
5853
|
-
_id:
|
|
5854
|
-
path:
|
|
5949
|
+
var import_zod_openapi58 = require("@hono/zod-openapi");
|
|
5950
|
+
var RevisionMetaSchema = import_zod_openapi58.z.object({
|
|
5951
|
+
_id: import_zod_openapi58.z.string(),
|
|
5952
|
+
path: import_zod_openapi58.z.string(),
|
|
5855
5953
|
author: PageUserSchema.nullable().optional(),
|
|
5856
5954
|
savedBy: PageUserSchema.nullable().optional(),
|
|
5857
|
-
contributors:
|
|
5955
|
+
contributors: import_zod_openapi58.z.array(PageUserSchema).optional(),
|
|
5858
5956
|
// RFC-0010 — edit channel. `web` (browser / collab editor) vs the API
|
|
5859
5957
|
// token paths (`oauth` / `pat`). Absent on pre-RFC-0010 revisions. The
|
|
5860
5958
|
// history UI shows an "app" chip for the token paths.
|
|
5861
|
-
editVia:
|
|
5862
|
-
createdAt:
|
|
5959
|
+
editVia: import_zod_openapi58.z.enum(["web", "oauth", "pat"]).optional(),
|
|
5960
|
+
createdAt: import_zod_openapi58.z.string()
|
|
5863
5961
|
});
|
|
5864
|
-
var ListRevisionsRequestSchema =
|
|
5865
|
-
limit:
|
|
5866
|
-
offset:
|
|
5962
|
+
var ListRevisionsRequestSchema = import_zod_openapi58.z.object({
|
|
5963
|
+
limit: import_zod_openapi58.z.coerce.number().int().positive().max(200).optional().default(50),
|
|
5964
|
+
offset: import_zod_openapi58.z.coerce.number().int().min(0).optional().default(0)
|
|
5867
5965
|
});
|
|
5868
|
-
var ListRevisionsResponseSchema =
|
|
5869
|
-
revisions:
|
|
5966
|
+
var ListRevisionsResponseSchema = import_zod_openapi58.z.object({
|
|
5967
|
+
revisions: import_zod_openapi58.z.array(RevisionMetaSchema),
|
|
5870
5968
|
pager: PagerSchema
|
|
5871
5969
|
});
|
|
5872
|
-
var GetRevisionResponseSchema =
|
|
5970
|
+
var GetRevisionResponseSchema = import_zod_openapi58.z.object({
|
|
5873
5971
|
revision: RevisionSchema
|
|
5874
5972
|
});
|
|
5875
|
-
var GetRevisionsRequestSchema =
|
|
5876
|
-
ids:
|
|
5973
|
+
var GetRevisionsRequestSchema = import_zod_openapi58.z.object({
|
|
5974
|
+
ids: import_zod_openapi58.z.string().min(1, "ids is required")
|
|
5877
5975
|
});
|
|
5878
|
-
var GetRevisionsResponseSchema =
|
|
5879
|
-
revisions:
|
|
5976
|
+
var GetRevisionsResponseSchema = import_zod_openapi58.z.object({
|
|
5977
|
+
revisions: import_zod_openapi58.z.array(RevisionSchema)
|
|
5880
5978
|
});
|
|
5881
|
-
var RevisionInvalidRequestErrorSchema =
|
|
5882
|
-
error:
|
|
5883
|
-
code:
|
|
5884
|
-
message:
|
|
5979
|
+
var RevisionInvalidRequestErrorSchema = import_zod_openapi58.z.object({
|
|
5980
|
+
error: import_zod_openapi58.z.object({
|
|
5981
|
+
code: import_zod_openapi58.z.literal("INVALID_REQUEST"),
|
|
5982
|
+
message: import_zod_openapi58.z.string()
|
|
5885
5983
|
})
|
|
5886
5984
|
});
|
|
5887
5985
|
|
|
5888
5986
|
// src/contracts/revision.ts
|
|
5889
|
-
var PageIdParamSchema =
|
|
5890
|
-
var RevisionIdParamSchema =
|
|
5891
|
-
var listRevisionsRoute = (0,
|
|
5987
|
+
var PageIdParamSchema = import_zod_openapi59.z.object({ page_id: import_zod_openapi59.z.string() });
|
|
5988
|
+
var RevisionIdParamSchema = import_zod_openapi59.z.object({ id: import_zod_openapi59.z.string() });
|
|
5989
|
+
var listRevisionsRoute = (0, import_zod_openapi59.createRoute)({
|
|
5892
5990
|
method: "get",
|
|
5893
5991
|
path: "/pages/{page_id}/revisions",
|
|
5894
5992
|
tags: ["revision"],
|
|
@@ -5917,7 +6015,7 @@ var listRevisionsRoute = (0, import_zod_openapi58.createRoute)({
|
|
|
5917
6015
|
}
|
|
5918
6016
|
}
|
|
5919
6017
|
});
|
|
5920
|
-
var getRevisionsRoute = (0,
|
|
6018
|
+
var getRevisionsRoute = (0, import_zod_openapi59.createRoute)({
|
|
5921
6019
|
method: "get",
|
|
5922
6020
|
path: "/pages/revisions",
|
|
5923
6021
|
tags: ["revision"],
|
|
@@ -5945,7 +6043,7 @@ var getRevisionsRoute = (0, import_zod_openapi58.createRoute)({
|
|
|
5945
6043
|
}
|
|
5946
6044
|
}
|
|
5947
6045
|
});
|
|
5948
|
-
var getRevisionRoute = (0,
|
|
6046
|
+
var getRevisionRoute = (0, import_zod_openapi59.createRoute)({
|
|
5949
6047
|
method: "get",
|
|
5950
6048
|
path: "/pages/revisions/{id}",
|
|
5951
6049
|
tags: ["revision"],
|
|
@@ -5983,39 +6081,39 @@ var revisionRoutes = {
|
|
|
5983
6081
|
};
|
|
5984
6082
|
|
|
5985
6083
|
// src/contracts/admin-crypto.ts
|
|
5986
|
-
var
|
|
6084
|
+
var import_zod_openapi61 = require("@hono/zod-openapi");
|
|
5987
6085
|
|
|
5988
6086
|
// src/schemas/admin-crypto.ts
|
|
5989
|
-
var
|
|
5990
|
-
var SensitiveConfigEntrySchema =
|
|
5991
|
-
ns:
|
|
5992
|
-
key:
|
|
5993
|
-
present:
|
|
5994
|
-
encrypted:
|
|
6087
|
+
var import_zod_openapi60 = require("@hono/zod-openapi");
|
|
6088
|
+
var SensitiveConfigEntrySchema = import_zod_openapi60.z.object({
|
|
6089
|
+
ns: import_zod_openapi60.z.string(),
|
|
6090
|
+
key: import_zod_openapi60.z.string(),
|
|
6091
|
+
present: import_zod_openapi60.z.boolean(),
|
|
6092
|
+
encrypted: import_zod_openapi60.z.boolean()
|
|
5995
6093
|
});
|
|
5996
|
-
var CryptoStatusResponseSchema =
|
|
6094
|
+
var CryptoStatusResponseSchema = import_zod_openapi60.z.object({
|
|
5997
6095
|
/** False when CROWI_ENCRYPTION_KEY is not configured — UI shows a setup hint. */
|
|
5998
|
-
encryptionConfigured:
|
|
5999
|
-
unencryptedCount:
|
|
6000
|
-
encryptedCount:
|
|
6001
|
-
entries:
|
|
6096
|
+
encryptionConfigured: import_zod_openapi60.z.boolean(),
|
|
6097
|
+
unencryptedCount: import_zod_openapi60.z.number().int().min(0),
|
|
6098
|
+
encryptedCount: import_zod_openapi60.z.number().int().min(0),
|
|
6099
|
+
entries: import_zod_openapi60.z.array(SensitiveConfigEntrySchema)
|
|
6002
6100
|
});
|
|
6003
|
-
var ReencryptResponseSchema =
|
|
6004
|
-
rewritten:
|
|
6101
|
+
var ReencryptResponseSchema = import_zod_openapi60.z.object({
|
|
6102
|
+
rewritten: import_zod_openapi60.z.number().int().min(0),
|
|
6005
6103
|
/** Already encrypted, skipped on this run. */
|
|
6006
|
-
alreadyEncrypted:
|
|
6104
|
+
alreadyEncrypted: import_zod_openapi60.z.number().int().min(0),
|
|
6007
6105
|
/** Sensitive registry entries that had no row in the DB at all. */
|
|
6008
|
-
missing:
|
|
6106
|
+
missing: import_zod_openapi60.z.number().int().min(0)
|
|
6009
6107
|
});
|
|
6010
|
-
var EncryptionNotConfiguredErrorSchema =
|
|
6011
|
-
error:
|
|
6012
|
-
code:
|
|
6013
|
-
message:
|
|
6108
|
+
var EncryptionNotConfiguredErrorSchema = import_zod_openapi60.z.object({
|
|
6109
|
+
error: import_zod_openapi60.z.object({
|
|
6110
|
+
code: import_zod_openapi60.z.literal("ENCRYPTION_NOT_CONFIGURED"),
|
|
6111
|
+
message: import_zod_openapi60.z.string()
|
|
6014
6112
|
})
|
|
6015
6113
|
});
|
|
6016
6114
|
|
|
6017
6115
|
// src/contracts/admin-crypto.ts
|
|
6018
|
-
var getCryptoStatusRoute = (0,
|
|
6116
|
+
var getCryptoStatusRoute = (0, import_zod_openapi61.createRoute)({
|
|
6019
6117
|
method: "get",
|
|
6020
6118
|
path: "/admin/crypto/status",
|
|
6021
6119
|
tags: ["adminCrypto"],
|
|
@@ -6040,7 +6138,7 @@ var getCryptoStatusRoute = (0, import_zod_openapi60.createRoute)({
|
|
|
6040
6138
|
}
|
|
6041
6139
|
}
|
|
6042
6140
|
});
|
|
6043
|
-
var reencryptAllRoute = (0,
|
|
6141
|
+
var reencryptAllRoute = (0, import_zod_openapi61.createRoute)({
|
|
6044
6142
|
method: "post",
|
|
6045
6143
|
path: "/admin/crypto/reencrypt",
|
|
6046
6144
|
tags: ["adminCrypto"],
|
|
@@ -6075,37 +6173,37 @@ var adminCryptoRoutes = {
|
|
|
6075
6173
|
};
|
|
6076
6174
|
|
|
6077
6175
|
// src/contracts/search.ts
|
|
6078
|
-
var
|
|
6176
|
+
var import_zod_openapi63 = require("@hono/zod-openapi");
|
|
6079
6177
|
|
|
6080
6178
|
// src/schemas/search.ts
|
|
6081
|
-
var
|
|
6082
|
-
var SearchPageTypeSchema =
|
|
6083
|
-
var SearchPagesRequestSchema =
|
|
6084
|
-
q:
|
|
6085
|
-
tree:
|
|
6179
|
+
var import_zod_openapi62 = require("@hono/zod-openapi");
|
|
6180
|
+
var SearchPageTypeSchema = import_zod_openapi62.z.enum(["portal", "public", "user"]);
|
|
6181
|
+
var SearchPagesRequestSchema = import_zod_openapi62.z.object({
|
|
6182
|
+
q: import_zod_openapi62.z.string().min(1),
|
|
6183
|
+
tree: import_zod_openapi62.z.string().optional(),
|
|
6086
6184
|
type: SearchPageTypeSchema.optional(),
|
|
6087
|
-
page:
|
|
6088
|
-
limit:
|
|
6089
|
-
});
|
|
6090
|
-
var SearchHitSchema =
|
|
6091
|
-
pageId:
|
|
6092
|
-
path:
|
|
6093
|
-
score:
|
|
6094
|
-
snippet:
|
|
6095
|
-
bookmarkCount:
|
|
6185
|
+
page: import_zod_openapi62.z.coerce.number().int().min(1).default(1),
|
|
6186
|
+
limit: import_zod_openapi62.z.coerce.number().int().min(1).max(100).default(50)
|
|
6187
|
+
});
|
|
6188
|
+
var SearchHitSchema = import_zod_openapi62.z.object({
|
|
6189
|
+
pageId: import_zod_openapi62.z.string(),
|
|
6190
|
+
path: import_zod_openapi62.z.string(),
|
|
6191
|
+
score: import_zod_openapi62.z.number().optional(),
|
|
6192
|
+
snippet: import_zod_openapi62.z.string().optional(),
|
|
6193
|
+
bookmarkCount: import_zod_openapi62.z.number(),
|
|
6096
6194
|
page: PageSchema
|
|
6097
6195
|
});
|
|
6098
|
-
var SearchPagesResponseSchema =
|
|
6099
|
-
meta:
|
|
6100
|
-
took:
|
|
6101
|
-
total:
|
|
6102
|
-
results:
|
|
6196
|
+
var SearchPagesResponseSchema = import_zod_openapi62.z.object({
|
|
6197
|
+
meta: import_zod_openapi62.z.object({
|
|
6198
|
+
took: import_zod_openapi62.z.number().optional(),
|
|
6199
|
+
total: import_zod_openapi62.z.number(),
|
|
6200
|
+
results: import_zod_openapi62.z.number()
|
|
6103
6201
|
}),
|
|
6104
|
-
data:
|
|
6202
|
+
data: import_zod_openapi62.z.array(SearchHitSchema)
|
|
6105
6203
|
});
|
|
6106
6204
|
|
|
6107
6205
|
// src/contracts/search.ts
|
|
6108
|
-
var searchPagesRoute = (0,
|
|
6206
|
+
var searchPagesRoute = (0, import_zod_openapi63.createRoute)({
|
|
6109
6207
|
method: "get",
|
|
6110
6208
|
path: "/search",
|
|
6111
6209
|
tags: ["search"],
|
|
@@ -6142,56 +6240,56 @@ var searchRoutes = {
|
|
|
6142
6240
|
};
|
|
6143
6241
|
|
|
6144
6242
|
// src/contracts/token-auth.ts
|
|
6145
|
-
var
|
|
6243
|
+
var import_zod_openapi65 = require("@hono/zod-openapi");
|
|
6146
6244
|
|
|
6147
6245
|
// src/schemas/auth.ts
|
|
6148
|
-
var
|
|
6149
|
-
var TokenAuthLoginRequestSchema =
|
|
6150
|
-
email:
|
|
6151
|
-
password:
|
|
6152
|
-
});
|
|
6153
|
-
var TokenAuthResponseSchema =
|
|
6154
|
-
accessToken:
|
|
6155
|
-
refreshToken:
|
|
6156
|
-
expiresIn:
|
|
6246
|
+
var import_zod_openapi64 = require("@hono/zod-openapi");
|
|
6247
|
+
var TokenAuthLoginRequestSchema = import_zod_openapi64.z.object({
|
|
6248
|
+
email: import_zod_openapi64.z.string().email(),
|
|
6249
|
+
password: import_zod_openapi64.z.string().min(6)
|
|
6250
|
+
});
|
|
6251
|
+
var TokenAuthResponseSchema = import_zod_openapi64.z.object({
|
|
6252
|
+
accessToken: import_zod_openapi64.z.string(),
|
|
6253
|
+
refreshToken: import_zod_openapi64.z.string(),
|
|
6254
|
+
expiresIn: import_zod_openapi64.z.number(),
|
|
6157
6255
|
// seconds until expiration
|
|
6158
|
-
user:
|
|
6159
|
-
id:
|
|
6160
|
-
username:
|
|
6161
|
-
email:
|
|
6162
|
-
name:
|
|
6163
|
-
image:
|
|
6164
|
-
admin:
|
|
6256
|
+
user: import_zod_openapi64.z.object({
|
|
6257
|
+
id: import_zod_openapi64.z.string(),
|
|
6258
|
+
username: import_zod_openapi64.z.string(),
|
|
6259
|
+
email: import_zod_openapi64.z.string().email(),
|
|
6260
|
+
name: import_zod_openapi64.z.string(),
|
|
6261
|
+
image: import_zod_openapi64.z.string().optional(),
|
|
6262
|
+
admin: import_zod_openapi64.z.boolean().optional()
|
|
6165
6263
|
})
|
|
6166
6264
|
});
|
|
6167
|
-
var RefreshTokenRequestSchema =
|
|
6168
|
-
refreshToken:
|
|
6265
|
+
var RefreshTokenRequestSchema = import_zod_openapi64.z.object({
|
|
6266
|
+
refreshToken: import_zod_openapi64.z.string()
|
|
6169
6267
|
});
|
|
6170
|
-
var TokenAuthRegisterRequestSchema =
|
|
6171
|
-
username:
|
|
6172
|
-
name:
|
|
6173
|
-
email:
|
|
6174
|
-
password:
|
|
6268
|
+
var TokenAuthRegisterRequestSchema = import_zod_openapi64.z.object({
|
|
6269
|
+
username: UsernameSchema,
|
|
6270
|
+
name: import_zod_openapi64.z.string(),
|
|
6271
|
+
email: import_zod_openapi64.z.string().email(),
|
|
6272
|
+
password: import_zod_openapi64.z.string().min(6)
|
|
6175
6273
|
});
|
|
6176
|
-
var RegisterPendingResponseSchema =
|
|
6177
|
-
status:
|
|
6274
|
+
var RegisterPendingResponseSchema = import_zod_openapi64.z.object({
|
|
6275
|
+
status: import_zod_openapi64.z.enum(["confirmation_required", "approval_required"])
|
|
6178
6276
|
});
|
|
6179
6277
|
|
|
6180
6278
|
// src/contracts/token-auth.ts
|
|
6181
|
-
var TokenLogoutResponseSchema =
|
|
6182
|
-
var TokenMeResponseSchema =
|
|
6183
|
-
user:
|
|
6184
|
-
id:
|
|
6185
|
-
username:
|
|
6186
|
-
email:
|
|
6187
|
-
name:
|
|
6188
|
-
image:
|
|
6189
|
-
status:
|
|
6190
|
-
admin:
|
|
6191
|
-
createdAt:
|
|
6279
|
+
var TokenLogoutResponseSchema = import_zod_openapi65.z.object({ message: import_zod_openapi65.z.string() });
|
|
6280
|
+
var TokenMeResponseSchema = import_zod_openapi65.z.object({
|
|
6281
|
+
user: import_zod_openapi65.z.object({
|
|
6282
|
+
id: import_zod_openapi65.z.string(),
|
|
6283
|
+
username: import_zod_openapi65.z.string(),
|
|
6284
|
+
email: import_zod_openapi65.z.string().email(),
|
|
6285
|
+
name: import_zod_openapi65.z.string(),
|
|
6286
|
+
image: import_zod_openapi65.z.string().optional(),
|
|
6287
|
+
status: import_zod_openapi65.z.number(),
|
|
6288
|
+
admin: import_zod_openapi65.z.boolean().optional(),
|
|
6289
|
+
createdAt: import_zod_openapi65.z.string()
|
|
6192
6290
|
})
|
|
6193
6291
|
});
|
|
6194
|
-
var tokenLoginRoute = (0,
|
|
6292
|
+
var tokenLoginRoute = (0, import_zod_openapi65.createRoute)({
|
|
6195
6293
|
method: "post",
|
|
6196
6294
|
path: "/auth/login",
|
|
6197
6295
|
tags: ["tokenAuth"],
|
|
@@ -6228,7 +6326,7 @@ var tokenLoginRoute = (0, import_zod_openapi64.createRoute)({
|
|
|
6228
6326
|
}
|
|
6229
6327
|
}
|
|
6230
6328
|
});
|
|
6231
|
-
var tokenRegisterRoute = (0,
|
|
6329
|
+
var tokenRegisterRoute = (0, import_zod_openapi65.createRoute)({
|
|
6232
6330
|
method: "post",
|
|
6233
6331
|
path: "/auth/register",
|
|
6234
6332
|
tags: ["tokenAuth"],
|
|
@@ -6269,7 +6367,7 @@ var tokenRegisterRoute = (0, import_zod_openapi64.createRoute)({
|
|
|
6269
6367
|
}
|
|
6270
6368
|
}
|
|
6271
6369
|
});
|
|
6272
|
-
var tokenRefreshRoute = (0,
|
|
6370
|
+
var tokenRefreshRoute = (0, import_zod_openapi65.createRoute)({
|
|
6273
6371
|
method: "post",
|
|
6274
6372
|
path: "/auth/refresh",
|
|
6275
6373
|
tags: ["tokenAuth"],
|
|
@@ -6306,7 +6404,7 @@ var tokenRefreshRoute = (0, import_zod_openapi64.createRoute)({
|
|
|
6306
6404
|
}
|
|
6307
6405
|
}
|
|
6308
6406
|
});
|
|
6309
|
-
var tokenLogoutRoute = (0,
|
|
6407
|
+
var tokenLogoutRoute = (0, import_zod_openapi65.createRoute)({
|
|
6310
6408
|
method: "post",
|
|
6311
6409
|
path: "/auth/logout",
|
|
6312
6410
|
tags: ["tokenAuth"],
|
|
@@ -6316,7 +6414,7 @@ var tokenLogoutRoute = (0, import_zod_openapi64.createRoute)({
|
|
|
6316
6414
|
body: {
|
|
6317
6415
|
content: {
|
|
6318
6416
|
"application/json": {
|
|
6319
|
-
schema:
|
|
6417
|
+
schema: import_zod_openapi65.z.object({ refreshToken: import_zod_openapi65.z.string().optional() })
|
|
6320
6418
|
}
|
|
6321
6419
|
}
|
|
6322
6420
|
}
|
|
@@ -6336,7 +6434,7 @@ var tokenLogoutRoute = (0, import_zod_openapi64.createRoute)({
|
|
|
6336
6434
|
}
|
|
6337
6435
|
}
|
|
6338
6436
|
});
|
|
6339
|
-
var tokenMeRoute = (0,
|
|
6437
|
+
var tokenMeRoute = (0, import_zod_openapi65.createRoute)({
|
|
6340
6438
|
method: "get",
|
|
6341
6439
|
path: "/auth/me",
|
|
6342
6440
|
tags: ["tokenAuth"],
|
|
@@ -6365,23 +6463,404 @@ var tokenAuthRoutes = {
|
|
|
6365
6463
|
tokenMeRoute
|
|
6366
6464
|
};
|
|
6367
6465
|
|
|
6368
|
-
// src/contracts/
|
|
6466
|
+
// src/contracts/federated-auth.ts
|
|
6467
|
+
var import_zod_openapi67 = require("@hono/zod-openapi");
|
|
6468
|
+
|
|
6469
|
+
// src/schemas/federated-auth.ts
|
|
6369
6470
|
var import_zod_openapi66 = require("@hono/zod-openapi");
|
|
6471
|
+
var FederatedProviderSchema = import_zod_openapi66.z.object({
|
|
6472
|
+
name: import_zod_openapi66.z.string(),
|
|
6473
|
+
buttonLabel: import_zod_openapi66.z.string(),
|
|
6474
|
+
iconUrl: import_zod_openapi66.z.string().optional()
|
|
6475
|
+
});
|
|
6476
|
+
var ProviderListResponseSchema = import_zod_openapi66.z.object({
|
|
6477
|
+
providers: import_zod_openapi66.z.array(FederatedProviderSchema)
|
|
6478
|
+
});
|
|
6479
|
+
var SenderPublicJwkSchema = import_zod_openapi66.z.object({
|
|
6480
|
+
kty: import_zod_openapi66.z.literal("EC"),
|
|
6481
|
+
crv: import_zod_openapi66.z.literal("P-256"),
|
|
6482
|
+
x: import_zod_openapi66.z.string(),
|
|
6483
|
+
y: import_zod_openapi66.z.string()
|
|
6484
|
+
});
|
|
6485
|
+
var SenderProofSchema = import_zod_openapi66.z.object({
|
|
6486
|
+
publicJwk: SenderPublicJwkSchema,
|
|
6487
|
+
/** base64url ES256 signature over the canonical handoff message. */
|
|
6488
|
+
signature: import_zod_openapi66.z.string()
|
|
6489
|
+
});
|
|
6490
|
+
var FederatedHandoffRequestSchema = import_zod_openapi66.z.object({
|
|
6491
|
+
code: import_zod_openapi66.z.string(),
|
|
6492
|
+
proof: SenderProofSchema
|
|
6493
|
+
});
|
|
6494
|
+
var FederatedHandoffResponseSchema = TokenAuthResponseSchema;
|
|
6495
|
+
var LinkedAuthProviderListResponseSchema = import_zod_openapi66.z.object({
|
|
6496
|
+
identities: import_zod_openapi66.z.array(import_zod_openapi66.z.object({ provider: import_zod_openapi66.z.string() }))
|
|
6497
|
+
});
|
|
6498
|
+
var CreateLinkGrantRequestSchema = import_zod_openapi66.z.object({
|
|
6499
|
+
/** RFC 7638 thumbprint of the P-256 public key this browser will use at `/start` — binds the grant to this browser (AC-2). */
|
|
6500
|
+
handoffChallenge: import_zod_openapi66.z.string().min(1)
|
|
6501
|
+
});
|
|
6502
|
+
var CreateLinkGrantResponseSchema = import_zod_openapi66.z.object({
|
|
6503
|
+
linkGrant: import_zod_openapi66.z.string()
|
|
6504
|
+
});
|
|
6505
|
+
var UnlinkAuthProviderErrorSchema = import_zod_openapi66.z.object({
|
|
6506
|
+
error: import_zod_openapi66.z.object({
|
|
6507
|
+
code: import_zod_openapi66.z.enum(["FEDERATED_UNLINK_DISABLED", "PASSWORD_REQUIRED"]),
|
|
6508
|
+
message: import_zod_openapi66.z.string()
|
|
6509
|
+
})
|
|
6510
|
+
});
|
|
6511
|
+
|
|
6512
|
+
// src/contracts/federated-auth.ts
|
|
6513
|
+
var ContinuePathSchema = import_zod_openapi67.z.string().regex(/^\/(?!\/)[^\\\x00-\x1F\x7F]*$/, 'continue must be a local path starting with a single "/" and contain no backslash or control characters').max(2e3, "continue must be at most 2000 characters");
|
|
6514
|
+
var listFederatedProvidersRoute = (0, import_zod_openapi67.createRoute)({
|
|
6515
|
+
method: "get",
|
|
6516
|
+
path: "/auth/providers",
|
|
6517
|
+
tags: ["federatedAuth"],
|
|
6518
|
+
summary: "List enabled OAuth2/OIDC federated sign-in providers",
|
|
6519
|
+
responses: {
|
|
6520
|
+
200: {
|
|
6521
|
+
description: "Enabled providers, in name order",
|
|
6522
|
+
content: { "application/json": { schema: ProviderListResponseSchema } }
|
|
6523
|
+
},
|
|
6524
|
+
500: {
|
|
6525
|
+
description: "Internal server error",
|
|
6526
|
+
content: { "application/json": { schema: InternalServerErrorSchema } }
|
|
6527
|
+
}
|
|
6528
|
+
}
|
|
6529
|
+
});
|
|
6530
|
+
var startFederatedProviderRoute = (0, import_zod_openapi67.createRoute)({
|
|
6531
|
+
method: "get",
|
|
6532
|
+
path: "/auth/providers/{name}/start",
|
|
6533
|
+
tags: ["federatedAuth"],
|
|
6534
|
+
summary: "Top-level navigation that redirects the browser to the named provider",
|
|
6535
|
+
request: {
|
|
6536
|
+
params: import_zod_openapi67.z.object({ name: import_zod_openapi67.z.string() }),
|
|
6537
|
+
query: import_zod_openapi67.z.object({
|
|
6538
|
+
continue: ContinuePathSchema,
|
|
6539
|
+
/** base64url(JSON) of the sender's P-256 public JWK. */
|
|
6540
|
+
handoff_jwk: import_zod_openapi67.z.string().min(1),
|
|
6541
|
+
/** base64url ES256 signature over the start canonical message. */
|
|
6542
|
+
handoff_proof: import_zod_openapi67.z.string().min(1),
|
|
6543
|
+
/**
|
|
6544
|
+
* RFC-0014 phase 3 — `'1'` switches this start into LINK mode: the
|
|
6545
|
+
* request must carry a web-session JWT, and the flow attaches the
|
|
6546
|
+
* resulting identity to that session's user instead of signing
|
|
6547
|
+
* anyone in. Absent (the ordinary sign-in start) the route stays
|
|
6548
|
+
* fully public.
|
|
6549
|
+
*/
|
|
6550
|
+
link: import_zod_openapi67.z.literal("1").optional(),
|
|
6551
|
+
/** The opaque id from `POST /auth/providers/{name}/link-grants`. Required when `link=1`, ignored otherwise. */
|
|
6552
|
+
link_grant: import_zod_openapi67.z.string().min(1).optional()
|
|
6553
|
+
})
|
|
6554
|
+
},
|
|
6555
|
+
responses: {
|
|
6556
|
+
302: { description: "Redirect to the provider authorization endpoint" },
|
|
6557
|
+
400: {
|
|
6558
|
+
description: "Malformed continue / sender proof, or an invalid/expired/mismatched link grant",
|
|
6559
|
+
content: { "application/json": { schema: ApiErrorSchema } }
|
|
6560
|
+
},
|
|
6561
|
+
401: {
|
|
6562
|
+
description: "link=1 without a web-session JWT \u2014 never downgraded to the public sign-in start",
|
|
6563
|
+
content: { "application/json": { schema: ApiErrorSchema } }
|
|
6564
|
+
},
|
|
6565
|
+
403: {
|
|
6566
|
+
description: "link=1 with a non-web credential (PAT / OAuth access token)",
|
|
6567
|
+
content: { "application/json": { schema: ApiErrorSchema } }
|
|
6568
|
+
},
|
|
6569
|
+
404: {
|
|
6570
|
+
description: "Unknown, unconfigured, or credential-kind provider",
|
|
6571
|
+
content: { "application/json": { schema: ApiErrorSchema } }
|
|
6572
|
+
},
|
|
6573
|
+
500: {
|
|
6574
|
+
description: "Internal server error",
|
|
6575
|
+
content: { "application/json": { schema: InternalServerErrorSchema } }
|
|
6576
|
+
}
|
|
6577
|
+
}
|
|
6578
|
+
});
|
|
6579
|
+
var listLinkedAuthProvidersRoute = (0, import_zod_openapi67.createRoute)({
|
|
6580
|
+
method: "get",
|
|
6581
|
+
path: "/auth/providers/identities",
|
|
6582
|
+
tags: ["federatedAuth"],
|
|
6583
|
+
summary: "List the provider slugs the current user has linked",
|
|
6584
|
+
responses: {
|
|
6585
|
+
200: {
|
|
6586
|
+
description: "Linked provider slugs, in name order",
|
|
6587
|
+
content: { "application/json": { schema: LinkedAuthProviderListResponseSchema } }
|
|
6588
|
+
},
|
|
6589
|
+
401: {
|
|
6590
|
+
description: "Authentication required",
|
|
6591
|
+
content: { "application/json": { schema: AuthenticationRequiredErrorSchema } }
|
|
6592
|
+
},
|
|
6593
|
+
500: {
|
|
6594
|
+
description: "Internal server error",
|
|
6595
|
+
content: { "application/json": { schema: InternalServerErrorSchema } }
|
|
6596
|
+
}
|
|
6597
|
+
}
|
|
6598
|
+
});
|
|
6599
|
+
var createAuthProviderLinkGrantRoute = (0, import_zod_openapi67.createRoute)({
|
|
6600
|
+
method: "post",
|
|
6601
|
+
path: "/auth/providers/{name}/link-grants",
|
|
6602
|
+
tags: ["federatedAuth"],
|
|
6603
|
+
summary: "Mint a short-lived, opaque grant that authorizes ONE link start for the current web session",
|
|
6604
|
+
request: {
|
|
6605
|
+
params: import_zod_openapi67.z.object({ name: import_zod_openapi67.z.string() }),
|
|
6606
|
+
body: { content: { "application/json": { schema: CreateLinkGrantRequestSchema } } }
|
|
6607
|
+
},
|
|
6608
|
+
responses: {
|
|
6609
|
+
200: {
|
|
6610
|
+
description: "Opaque single-use grant id",
|
|
6611
|
+
content: { "application/json": { schema: CreateLinkGrantResponseSchema } }
|
|
6612
|
+
},
|
|
6613
|
+
401: {
|
|
6614
|
+
description: "Authentication required",
|
|
6615
|
+
content: { "application/json": { schema: AuthenticationRequiredErrorSchema } }
|
|
6616
|
+
},
|
|
6617
|
+
403: {
|
|
6618
|
+
description: "Non-web credential (PAT / OAuth access token)",
|
|
6619
|
+
content: { "application/json": { schema: ApiErrorSchema } }
|
|
6620
|
+
},
|
|
6621
|
+
404: {
|
|
6622
|
+
description: "Unknown, unconfigured, or credential-kind provider",
|
|
6623
|
+
content: { "application/json": { schema: ApiErrorSchema } }
|
|
6624
|
+
},
|
|
6625
|
+
500: {
|
|
6626
|
+
description: "Internal server error",
|
|
6627
|
+
content: { "application/json": { schema: InternalServerErrorSchema } }
|
|
6628
|
+
}
|
|
6629
|
+
}
|
|
6630
|
+
});
|
|
6631
|
+
var unlinkAuthProviderRoute = (0, import_zod_openapi67.createRoute)({
|
|
6632
|
+
method: "delete",
|
|
6633
|
+
path: "/auth/providers/{name}/identity",
|
|
6634
|
+
tags: ["federatedAuth"],
|
|
6635
|
+
summary: "Disconnect the current user's identity for this provider",
|
|
6636
|
+
request: {
|
|
6637
|
+
params: import_zod_openapi67.z.object({ name: import_zod_openapi67.z.string() })
|
|
6638
|
+
},
|
|
6639
|
+
responses: {
|
|
6640
|
+
204: { description: "Identity removed" },
|
|
6641
|
+
401: {
|
|
6642
|
+
description: "Authentication required",
|
|
6643
|
+
content: { "application/json": { schema: AuthenticationRequiredErrorSchema } }
|
|
6644
|
+
},
|
|
6645
|
+
403: {
|
|
6646
|
+
description: "Non-web credential (PAT / OAuth access token)",
|
|
6647
|
+
content: { "application/json": { schema: ApiErrorSchema } }
|
|
6648
|
+
},
|
|
6649
|
+
404: {
|
|
6650
|
+
description: "No identity linked for this provider",
|
|
6651
|
+
content: { "application/json": { schema: ApiErrorSchema } }
|
|
6652
|
+
},
|
|
6653
|
+
409: {
|
|
6654
|
+
description: "Refused: password auth is disabled instance-wide, or this user has no password set",
|
|
6655
|
+
content: { "application/json": { schema: UnlinkAuthProviderErrorSchema } }
|
|
6656
|
+
},
|
|
6657
|
+
500: {
|
|
6658
|
+
description: "Internal server error",
|
|
6659
|
+
content: { "application/json": { schema: InternalServerErrorSchema } }
|
|
6660
|
+
}
|
|
6661
|
+
}
|
|
6662
|
+
});
|
|
6663
|
+
var callbackFederatedProviderRoute = (0, import_zod_openapi67.createRoute)({
|
|
6664
|
+
method: "get",
|
|
6665
|
+
path: "/auth/providers/{name}/callback",
|
|
6666
|
+
tags: ["federatedAuth"],
|
|
6667
|
+
summary: "Provider redirect target; completes the OAuth2/OIDC exchange",
|
|
6668
|
+
request: {
|
|
6669
|
+
params: import_zod_openapi67.z.object({ name: import_zod_openapi67.z.string() }),
|
|
6670
|
+
query: import_zod_openapi67.z.object({
|
|
6671
|
+
code: import_zod_openapi67.z.string().optional(),
|
|
6672
|
+
state: import_zod_openapi67.z.string().optional(),
|
|
6673
|
+
error: import_zod_openapi67.z.string().optional()
|
|
6674
|
+
})
|
|
6675
|
+
},
|
|
6676
|
+
responses: {
|
|
6677
|
+
302: {
|
|
6678
|
+
description: "Redirect to the trusted web login/complete page on success, or back to the trusted web /login on failure"
|
|
6679
|
+
},
|
|
6680
|
+
404: {
|
|
6681
|
+
description: "Unknown or unconfigured provider (also used when trusted origins cannot be resolved)",
|
|
6682
|
+
content: { "application/json": { schema: ApiErrorSchema } }
|
|
6683
|
+
},
|
|
6684
|
+
500: {
|
|
6685
|
+
description: "Internal server error",
|
|
6686
|
+
content: { "application/json": { schema: InternalServerErrorSchema } }
|
|
6687
|
+
}
|
|
6688
|
+
}
|
|
6689
|
+
});
|
|
6690
|
+
var federatedHandoffRoute = (0, import_zod_openapi67.createRoute)({
|
|
6691
|
+
method: "post",
|
|
6692
|
+
path: "/auth/handoff",
|
|
6693
|
+
tags: ["federatedAuth"],
|
|
6694
|
+
summary: "Exchange a sender-constrained federated handoff code for session tokens",
|
|
6695
|
+
request: {
|
|
6696
|
+
body: { content: { "application/json": { schema: FederatedHandoffRequestSchema } } }
|
|
6697
|
+
},
|
|
6698
|
+
responses: {
|
|
6699
|
+
200: {
|
|
6700
|
+
description: "Session tokens \u2014 same shape as POST /auth/login",
|
|
6701
|
+
content: { "application/json": { schema: FederatedHandoffResponseSchema } }
|
|
6702
|
+
},
|
|
6703
|
+
401: {
|
|
6704
|
+
description: "Invalid / expired handoff code, or sender proof did not verify",
|
|
6705
|
+
content: { "application/json": { schema: ApiErrorSchema } }
|
|
6706
|
+
},
|
|
6707
|
+
409: {
|
|
6708
|
+
description: "Handoff code already consumed",
|
|
6709
|
+
content: { "application/json": { schema: ApiErrorSchema } }
|
|
6710
|
+
},
|
|
6711
|
+
500: {
|
|
6712
|
+
description: "Internal server error",
|
|
6713
|
+
content: { "application/json": { schema: InternalServerErrorSchema } }
|
|
6714
|
+
}
|
|
6715
|
+
}
|
|
6716
|
+
});
|
|
6717
|
+
var federatedAuthRoutes = {
|
|
6718
|
+
listFederatedProvidersRoute,
|
|
6719
|
+
startFederatedProviderRoute,
|
|
6720
|
+
callbackFederatedProviderRoute,
|
|
6721
|
+
federatedHandoffRoute,
|
|
6722
|
+
listLinkedAuthProvidersRoute,
|
|
6723
|
+
createAuthProviderLinkGrantRoute,
|
|
6724
|
+
unlinkAuthProviderRoute
|
|
6725
|
+
};
|
|
6726
|
+
|
|
6727
|
+
// src/contracts/federated-registration.ts
|
|
6728
|
+
var import_zod_openapi69 = require("@hono/zod-openapi");
|
|
6729
|
+
|
|
6730
|
+
// src/schemas/federated-registration.ts
|
|
6731
|
+
var import_zod_openapi68 = require("@hono/zod-openapi");
|
|
6732
|
+
var FederatedRegistrationSnapshotSchema = import_zod_openapi68.z.object({
|
|
6733
|
+
/** IdP-verified email, prefilled read-only on the registration screen. */
|
|
6734
|
+
email: import_zod_openapi68.z.string().email(),
|
|
6735
|
+
/** Driver slug, e.g. `'google'`. */
|
|
6736
|
+
provider: import_zod_openapi68.z.string(),
|
|
6737
|
+
/** Human-friendly provider name (the driver's `buttonLabel`), e.g. `'Google'`. */
|
|
6738
|
+
providerLabel: import_zod_openapi68.z.string(),
|
|
6739
|
+
/**
|
|
6740
|
+
* This grant's registration has already been submitted and is waiting
|
|
6741
|
+
* for an administrator (Restricted mode). The screen must show that
|
|
6742
|
+
* state instead of the username form.
|
|
6743
|
+
*
|
|
6744
|
+
* Deliberately narrow: it is not a general status field, and it never
|
|
6745
|
+
* distinguishes unknown / expired / cancelled / completed grants (those
|
|
6746
|
+
* are all the same 404 — AC-2). It exists because a submitted
|
|
6747
|
+
* registration is still readable by its own grant, and re-offering an
|
|
6748
|
+
* editable username there invites a change that cannot be applied — the
|
|
6749
|
+
* second submit is refused and the typed value silently discarded.
|
|
6750
|
+
*/
|
|
6751
|
+
approvalPending: import_zod_openapi68.z.boolean()
|
|
6752
|
+
});
|
|
6753
|
+
var FederatedRegistrationSubmitRequestSchema = import_zod_openapi68.z.object({
|
|
6754
|
+
username: UsernameSchema
|
|
6755
|
+
});
|
|
6756
|
+
var FederatedRegistrationActiveResultSchema = import_zod_openapi68.z.object({
|
|
6757
|
+
status: import_zod_openapi68.z.literal("active"),
|
|
6758
|
+
code: import_zod_openapi68.z.string()
|
|
6759
|
+
});
|
|
6760
|
+
var FederatedRegistrationApprovalResultSchema = import_zod_openapi68.z.object({
|
|
6761
|
+
status: import_zod_openapi68.z.literal("approval_required")
|
|
6762
|
+
});
|
|
6763
|
+
var FederatedRegistrationResultSchema = import_zod_openapi68.z.discriminatedUnion("status", [
|
|
6764
|
+
FederatedRegistrationActiveResultSchema,
|
|
6765
|
+
FederatedRegistrationApprovalResultSchema
|
|
6766
|
+
]);
|
|
6767
|
+
|
|
6768
|
+
// src/contracts/federated-registration.ts
|
|
6769
|
+
var TokenParamSchema = import_zod_openapi69.z.object({ token: import_zod_openapi69.z.string().min(1) });
|
|
6770
|
+
var getFederatedRegistrationRoute = (0, import_zod_openapi69.createRoute)({
|
|
6771
|
+
method: "get",
|
|
6772
|
+
path: "/auth/federated-registration/{token}",
|
|
6773
|
+
tags: ["federatedRegistration"],
|
|
6774
|
+
summary: "Read-only snapshot (email/provider/providerLabel) for a pending federated registration",
|
|
6775
|
+
request: {
|
|
6776
|
+
params: TokenParamSchema
|
|
6777
|
+
},
|
|
6778
|
+
responses: {
|
|
6779
|
+
200: {
|
|
6780
|
+
description: "Pending registration snapshot",
|
|
6781
|
+
content: { "application/json": { schema: FederatedRegistrationSnapshotSchema } }
|
|
6782
|
+
},
|
|
6783
|
+
404: {
|
|
6784
|
+
description: "Grant is unknown, expired, or cancelled",
|
|
6785
|
+
content: { "application/json": { schema: ApiErrorSchema } }
|
|
6786
|
+
},
|
|
6787
|
+
500: {
|
|
6788
|
+
description: "Internal server error",
|
|
6789
|
+
content: { "application/json": { schema: InternalServerErrorSchema } }
|
|
6790
|
+
}
|
|
6791
|
+
}
|
|
6792
|
+
});
|
|
6793
|
+
var submitFederatedRegistrationRoute = (0, import_zod_openapi69.createRoute)({
|
|
6794
|
+
method: "post",
|
|
6795
|
+
path: "/auth/federated-registration/{token}",
|
|
6796
|
+
tags: ["federatedRegistration"],
|
|
6797
|
+
summary: "Submit the chosen username; provisions the User (JIT) and activates or queues approval",
|
|
6798
|
+
request: {
|
|
6799
|
+
params: TokenParamSchema,
|
|
6800
|
+
body: { content: { "application/json": { schema: FederatedRegistrationSubmitRequestSchema } } }
|
|
6801
|
+
},
|
|
6802
|
+
responses: {
|
|
6803
|
+
200: {
|
|
6804
|
+
description: "Open: account is active \u2014 a Phase 1 handoff code, redeemed via POST /auth/handoff. Restricted: awaiting admin approval.",
|
|
6805
|
+
content: { "application/json": { schema: FederatedRegistrationResultSchema } }
|
|
6806
|
+
},
|
|
6807
|
+
400: {
|
|
6808
|
+
description: "Username fails the shared username contract",
|
|
6809
|
+
content: { "application/json": { schema: ApiErrorSchema } }
|
|
6810
|
+
},
|
|
6811
|
+
404: {
|
|
6812
|
+
description: "Grant is unknown, expired, or cancelled",
|
|
6813
|
+
content: { "application/json": { schema: ApiErrorSchema } }
|
|
6814
|
+
},
|
|
6815
|
+
409: {
|
|
6816
|
+
description: "Username/email already taken, or the identity is already linked to a different user",
|
|
6817
|
+
content: { "application/json": { schema: ApiErrorSchema } }
|
|
6818
|
+
},
|
|
6819
|
+
500: {
|
|
6820
|
+
description: "Internal server error",
|
|
6821
|
+
content: { "application/json": { schema: InternalServerErrorSchema } }
|
|
6822
|
+
}
|
|
6823
|
+
}
|
|
6824
|
+
});
|
|
6825
|
+
var logoutFederatedRegistrationRoute = (0, import_zod_openapi69.createRoute)({
|
|
6826
|
+
method: "post",
|
|
6827
|
+
path: "/auth/federated-registration/{token}/logout",
|
|
6828
|
+
tags: ["federatedRegistration"],
|
|
6829
|
+
summary: "Cancel a pending federated registration and invalidate the grant",
|
|
6830
|
+
request: {
|
|
6831
|
+
params: TokenParamSchema
|
|
6832
|
+
},
|
|
6833
|
+
responses: {
|
|
6834
|
+
204: { description: "Grant cancelled (or was already inactive) \u2014 idempotent" },
|
|
6835
|
+
500: {
|
|
6836
|
+
description: "Internal server error",
|
|
6837
|
+
content: { "application/json": { schema: InternalServerErrorSchema } }
|
|
6838
|
+
}
|
|
6839
|
+
}
|
|
6840
|
+
});
|
|
6841
|
+
var federatedRegistrationRoutes = {
|
|
6842
|
+
getFederatedRegistrationRoute,
|
|
6843
|
+
submitFederatedRegistrationRoute,
|
|
6844
|
+
logoutFederatedRegistrationRoute
|
|
6845
|
+
};
|
|
6846
|
+
|
|
6847
|
+
// src/contracts/invite-accept.ts
|
|
6848
|
+
var import_zod_openapi71 = require("@hono/zod-openapi");
|
|
6370
6849
|
|
|
6371
6850
|
// src/schemas/invite-accept.ts
|
|
6372
|
-
var
|
|
6373
|
-
var InviteAcceptRequestSchema =
|
|
6374
|
-
token:
|
|
6375
|
-
username:
|
|
6376
|
-
name:
|
|
6377
|
-
password:
|
|
6851
|
+
var import_zod_openapi70 = require("@hono/zod-openapi");
|
|
6852
|
+
var InviteAcceptRequestSchema = import_zod_openapi70.z.object({
|
|
6853
|
+
token: import_zod_openapi70.z.string(),
|
|
6854
|
+
username: UsernameSchema,
|
|
6855
|
+
name: import_zod_openapi70.z.string().min(1),
|
|
6856
|
+
password: import_zod_openapi70.z.string().min(6)
|
|
6378
6857
|
});
|
|
6379
|
-
var InvitePreviewResponseSchema =
|
|
6380
|
-
email:
|
|
6858
|
+
var InvitePreviewResponseSchema = import_zod_openapi70.z.object({
|
|
6859
|
+
email: import_zod_openapi70.z.string().email()
|
|
6381
6860
|
});
|
|
6382
6861
|
|
|
6383
6862
|
// src/contracts/invite-accept.ts
|
|
6384
|
-
var invitePreviewRoute = (0,
|
|
6863
|
+
var invitePreviewRoute = (0, import_zod_openapi71.createRoute)({
|
|
6385
6864
|
method: "get",
|
|
6386
6865
|
path: "/invite/accept",
|
|
6387
6866
|
tags: ["inviteAccept"],
|
|
@@ -6408,7 +6887,7 @@ var invitePreviewRoute = (0, import_zod_openapi66.createRoute)({
|
|
|
6408
6887
|
}
|
|
6409
6888
|
}
|
|
6410
6889
|
});
|
|
6411
|
-
var acceptInviteRoute = (0,
|
|
6890
|
+
var acceptInviteRoute = (0, import_zod_openapi71.createRoute)({
|
|
6412
6891
|
method: "post",
|
|
6413
6892
|
path: "/invite/accept",
|
|
6414
6893
|
tags: ["inviteAccept"],
|
|
@@ -6451,23 +6930,23 @@ var inviteAcceptRoutes = {
|
|
|
6451
6930
|
};
|
|
6452
6931
|
|
|
6453
6932
|
// src/contracts/password-reset.ts
|
|
6454
|
-
var
|
|
6933
|
+
var import_zod_openapi73 = require("@hono/zod-openapi");
|
|
6455
6934
|
|
|
6456
6935
|
// src/schemas/password-reset.ts
|
|
6457
|
-
var
|
|
6458
|
-
var ForgotPasswordRequestSchema =
|
|
6459
|
-
email:
|
|
6936
|
+
var import_zod_openapi72 = require("@hono/zod-openapi");
|
|
6937
|
+
var ForgotPasswordRequestSchema = import_zod_openapi72.z.object({
|
|
6938
|
+
email: import_zod_openapi72.z.string().email()
|
|
6460
6939
|
});
|
|
6461
|
-
var ForgotPasswordResponseSchema =
|
|
6462
|
-
ok:
|
|
6940
|
+
var ForgotPasswordResponseSchema = import_zod_openapi72.z.object({
|
|
6941
|
+
ok: import_zod_openapi72.z.literal(true)
|
|
6463
6942
|
});
|
|
6464
|
-
var ResetPasswordRequestSchema =
|
|
6465
|
-
token:
|
|
6466
|
-
password:
|
|
6943
|
+
var ResetPasswordRequestSchema = import_zod_openapi72.z.object({
|
|
6944
|
+
token: import_zod_openapi72.z.string(),
|
|
6945
|
+
password: import_zod_openapi72.z.string().min(6)
|
|
6467
6946
|
});
|
|
6468
6947
|
|
|
6469
6948
|
// src/contracts/password-reset.ts
|
|
6470
|
-
var forgotPasswordRoute = (0,
|
|
6949
|
+
var forgotPasswordRoute = (0, import_zod_openapi73.createRoute)({
|
|
6471
6950
|
method: "post",
|
|
6472
6951
|
path: "/auth/forgot-password",
|
|
6473
6952
|
tags: ["passwordReset"],
|
|
@@ -6492,7 +6971,7 @@ var forgotPasswordRoute = (0, import_zod_openapi68.createRoute)({
|
|
|
6492
6971
|
}
|
|
6493
6972
|
}
|
|
6494
6973
|
});
|
|
6495
|
-
var validateResetTokenRoute = (0,
|
|
6974
|
+
var validateResetTokenRoute = (0, import_zod_openapi73.createRoute)({
|
|
6496
6975
|
method: "get",
|
|
6497
6976
|
path: "/auth/reset-password",
|
|
6498
6977
|
tags: ["passwordReset"],
|
|
@@ -6515,7 +6994,7 @@ var validateResetTokenRoute = (0, import_zod_openapi68.createRoute)({
|
|
|
6515
6994
|
}
|
|
6516
6995
|
}
|
|
6517
6996
|
});
|
|
6518
|
-
var selfResetPasswordRoute = (0,
|
|
6997
|
+
var selfResetPasswordRoute = (0, import_zod_openapi73.createRoute)({
|
|
6519
6998
|
method: "post",
|
|
6520
6999
|
path: "/auth/reset-password",
|
|
6521
7000
|
tags: ["passwordReset"],
|
|
@@ -6555,19 +7034,19 @@ var passwordResetRoutes = {
|
|
|
6555
7034
|
};
|
|
6556
7035
|
|
|
6557
7036
|
// src/contracts/activation.ts
|
|
6558
|
-
var
|
|
7037
|
+
var import_zod_openapi75 = require("@hono/zod-openapi");
|
|
6559
7038
|
|
|
6560
7039
|
// src/schemas/activation.ts
|
|
6561
|
-
var
|
|
6562
|
-
var ActivateRequestSchema =
|
|
6563
|
-
token:
|
|
7040
|
+
var import_zod_openapi74 = require("@hono/zod-openapi");
|
|
7041
|
+
var ActivateRequestSchema = import_zod_openapi74.z.object({
|
|
7042
|
+
token: import_zod_openapi74.z.string()
|
|
6564
7043
|
});
|
|
6565
|
-
var ActivateValidationResponseSchema =
|
|
6566
|
-
ok:
|
|
7044
|
+
var ActivateValidationResponseSchema = import_zod_openapi74.z.object({
|
|
7045
|
+
ok: import_zod_openapi74.z.literal(true)
|
|
6567
7046
|
});
|
|
6568
7047
|
|
|
6569
7048
|
// src/contracts/activation.ts
|
|
6570
|
-
var validateActivationTokenRoute = (0,
|
|
7049
|
+
var validateActivationTokenRoute = (0, import_zod_openapi75.createRoute)({
|
|
6571
7050
|
method: "get",
|
|
6572
7051
|
path: "/auth/activate",
|
|
6573
7052
|
tags: ["activation"],
|
|
@@ -6590,7 +7069,7 @@ var validateActivationTokenRoute = (0, import_zod_openapi70.createRoute)({
|
|
|
6590
7069
|
}
|
|
6591
7070
|
}
|
|
6592
7071
|
});
|
|
6593
|
-
var activateAccountRoute = (0,
|
|
7072
|
+
var activateAccountRoute = (0, import_zod_openapi75.createRoute)({
|
|
6594
7073
|
method: "post",
|
|
6595
7074
|
path: "/auth/activate",
|
|
6596
7075
|
tags: ["activation"],
|
|
@@ -6625,21 +7104,21 @@ var activationRoutes = {
|
|
|
6625
7104
|
};
|
|
6626
7105
|
|
|
6627
7106
|
// src/contracts/email-change.ts
|
|
6628
|
-
var
|
|
7107
|
+
var import_zod_openapi77 = require("@hono/zod-openapi");
|
|
6629
7108
|
|
|
6630
7109
|
// src/schemas/email-change.ts
|
|
6631
|
-
var
|
|
6632
|
-
var ConfirmEmailChangeRequestSchema =
|
|
6633
|
-
token:
|
|
7110
|
+
var import_zod_openapi76 = require("@hono/zod-openapi");
|
|
7111
|
+
var ConfirmEmailChangeRequestSchema = import_zod_openapi76.z.object({
|
|
7112
|
+
token: import_zod_openapi76.z.string()
|
|
6634
7113
|
});
|
|
6635
|
-
var ConfirmEmailChangeResponseSchema =
|
|
6636
|
-
ok:
|
|
7114
|
+
var ConfirmEmailChangeResponseSchema = import_zod_openapi76.z.object({
|
|
7115
|
+
ok: import_zod_openapi76.z.literal(true),
|
|
6637
7116
|
/** The newly-confirmed email address. */
|
|
6638
|
-
email:
|
|
7117
|
+
email: import_zod_openapi76.z.string().email()
|
|
6639
7118
|
});
|
|
6640
7119
|
|
|
6641
7120
|
// src/contracts/email-change.ts
|
|
6642
|
-
var validateEmailChangeTokenRoute = (0,
|
|
7121
|
+
var validateEmailChangeTokenRoute = (0, import_zod_openapi77.createRoute)({
|
|
6643
7122
|
method: "get",
|
|
6644
7123
|
path: "/auth/confirm-email-change",
|
|
6645
7124
|
tags: ["emailChange"],
|
|
@@ -6662,7 +7141,7 @@ var validateEmailChangeTokenRoute = (0, import_zod_openapi72.createRoute)({
|
|
|
6662
7141
|
}
|
|
6663
7142
|
}
|
|
6664
7143
|
});
|
|
6665
|
-
var confirmEmailChangeRoute = (0,
|
|
7144
|
+
var confirmEmailChangeRoute = (0, import_zod_openapi77.createRoute)({
|
|
6666
7145
|
method: "post",
|
|
6667
7146
|
path: "/auth/confirm-email-change",
|
|
6668
7147
|
tags: ["emailChange"],
|
|
@@ -6701,9 +7180,9 @@ var emailChangeRoutes = {
|
|
|
6701
7180
|
};
|
|
6702
7181
|
|
|
6703
7182
|
// src/contracts/user.ts
|
|
6704
|
-
var
|
|
6705
|
-
var UsernameParamSchema =
|
|
6706
|
-
var getUserPageRoute = (0,
|
|
7183
|
+
var import_zod_openapi78 = require("@hono/zod-openapi");
|
|
7184
|
+
var UsernameParamSchema = import_zod_openapi78.z.object({ username: import_zod_openapi78.z.string() });
|
|
7185
|
+
var getUserPageRoute = (0, import_zod_openapi78.createRoute)({
|
|
6707
7186
|
method: "get",
|
|
6708
7187
|
path: "/user/{username}",
|
|
6709
7188
|
tags: ["user"],
|
|
@@ -6731,7 +7210,7 @@ var getUserPageRoute = (0, import_zod_openapi73.createRoute)({
|
|
|
6731
7210
|
}
|
|
6732
7211
|
}
|
|
6733
7212
|
});
|
|
6734
|
-
var getUserBookmarksRoute = (0,
|
|
7213
|
+
var getUserBookmarksRoute = (0, import_zod_openapi78.createRoute)({
|
|
6735
7214
|
method: "get",
|
|
6736
7215
|
path: "/user/{username}/bookmarks",
|
|
6737
7216
|
tags: ["user"],
|
|
@@ -6760,7 +7239,7 @@ var getUserBookmarksRoute = (0, import_zod_openapi73.createRoute)({
|
|
|
6760
7239
|
}
|
|
6761
7240
|
}
|
|
6762
7241
|
});
|
|
6763
|
-
var getUserPagesRoute = (0,
|
|
7242
|
+
var getUserPagesRoute = (0, import_zod_openapi78.createRoute)({
|
|
6764
7243
|
method: "get",
|
|
6765
7244
|
path: "/user/{username}/pages",
|
|
6766
7245
|
tags: ["user"],
|
|
@@ -6789,7 +7268,7 @@ var getUserPagesRoute = (0, import_zod_openapi73.createRoute)({
|
|
|
6789
7268
|
}
|
|
6790
7269
|
}
|
|
6791
7270
|
});
|
|
6792
|
-
var getUserSubpagesRoute = (0,
|
|
7271
|
+
var getUserSubpagesRoute = (0, import_zod_openapi78.createRoute)({
|
|
6793
7272
|
method: "get",
|
|
6794
7273
|
path: "/user/{username}/subpages",
|
|
6795
7274
|
tags: ["user"],
|
|
@@ -6826,7 +7305,7 @@ var getUserSubpagesRoute = (0, import_zod_openapi73.createRoute)({
|
|
|
6826
7305
|
}
|
|
6827
7306
|
}
|
|
6828
7307
|
});
|
|
6829
|
-
var listMembersRoute = (0,
|
|
7308
|
+
var listMembersRoute = (0, import_zod_openapi78.createRoute)({
|
|
6830
7309
|
method: "get",
|
|
6831
7310
|
path: "/users",
|
|
6832
7311
|
tags: ["user"],
|
|
@@ -6872,6 +7351,13 @@ var stubTokens = {
|
|
|
6872
7351
|
expiresIn: 0,
|
|
6873
7352
|
user: stubUser
|
|
6874
7353
|
};
|
|
7354
|
+
var stubProviderList = { providers: [] };
|
|
7355
|
+
var stubFederatedRegistrationSnapshot = {
|
|
7356
|
+
email: "stub@example.com",
|
|
7357
|
+
provider: "",
|
|
7358
|
+
providerLabel: "",
|
|
7359
|
+
approvalPending: false
|
|
7360
|
+
};
|
|
6875
7361
|
var stubProfile = {
|
|
6876
7362
|
id: "",
|
|
6877
7363
|
username: "",
|
|
@@ -6881,7 +7367,8 @@ var stubProfile = {
|
|
|
6881
7367
|
theme: "system",
|
|
6882
7368
|
image: null,
|
|
6883
7369
|
hasPassword: false,
|
|
6884
|
-
createdAt: ""
|
|
7370
|
+
createdAt: "",
|
|
7371
|
+
federated: false
|
|
6885
7372
|
};
|
|
6886
7373
|
var stubAccessToken = {
|
|
6887
7374
|
id: "",
|
|
@@ -7120,8 +7607,9 @@ var stubPendingUsersCount = { count: 0 };
|
|
|
7120
7607
|
var stubListPlugins = { plugins: [] };
|
|
7121
7608
|
var stubPluginConfig = { name: "", fields: [], values: {} };
|
|
7122
7609
|
var stubUpdatePluginConfig = { ok: true, hotReloaded: false, reconfigureFailed: false };
|
|
7610
|
+
var stubPluginReadiness = { issues: [] };
|
|
7123
7611
|
var stubClearRenderCache = { ok: true, clearedAt: "", removedCount: 0 };
|
|
7124
|
-
var appAuthMeUserChain = new
|
|
7612
|
+
var appAuthMeUserChain = new import_zod_openapi79.OpenAPIHono().openapi(
|
|
7125
7613
|
appRoutes.getAppInfoRoute,
|
|
7126
7614
|
(c) => c.json(
|
|
7127
7615
|
{
|
|
@@ -7155,31 +7643,33 @@ var appAuthMeUserChain = new import_zod_openapi74.OpenAPIHono().openapi(
|
|
|
7155
7643
|
meRoutes.updatePasswordRoute,
|
|
7156
7644
|
(c) => c.json({ status: "ok", message: "", accessToken: "", refreshToken: "", expiresIn: 0 }, 200)
|
|
7157
7645
|
).openapi(meRoutes.recentlyViewedPagesRoute, (c) => c.json({ pages: [] }, 200)).openapi(accessTokenRoutes.listAccessTokensRoute, (c) => c.json({ accessTokens: [] }, 200)).openapi(accessTokenRoutes.createAccessTokenRoute, (c) => c.json(stubCreateAccessToken, 201)).openapi(accessTokenRoutes.deleteAccessTokenRoute, (c) => c.json(stubAccessToken, 200)).openapi(userRoutes.getUserPageRoute, (c) => c.json(stubUserPage, 200)).openapi(userRoutes.getUserBookmarksRoute, (c) => c.json(stubUserBookmarks, 200)).openapi(userRoutes.getUserPagesRoute, (c) => c.json(stubUserPages, 200)).openapi(userRoutes.getUserSubpagesRoute, (c) => c.json(stubUserPages, 200)).openapi(userRoutes.listMembersRoute, (c) => c.json(stubListUsers, 200));
|
|
7158
|
-
var bookmarkBacklinkCommentRevisionChain = new
|
|
7159
|
-
var pageChain = new
|
|
7160
|
-
var lateContractApp = new
|
|
7161
|
-
var adminSettingsContractApp = new
|
|
7162
|
-
var adminUsersPluginsContractApp = new
|
|
7163
|
-
var oauthContractApp = new
|
|
7646
|
+
var bookmarkBacklinkCommentRevisionChain = new import_zod_openapi79.OpenAPIHono().openapi(bookmarkRoutes.getBookmarkRoute, (c) => c.json(stubBookmarkResponse, 200)).openapi(bookmarkRoutes.listMyBookmarksRoute, (c) => c.json(stubListMyBookmarks, 200)).openapi(bookmarkRoutes.addBookmarkRoute, (c) => c.json(stubBookmarkResponse, 200)).openapi(bookmarkRoutes.removeBookmarkRoute, (c) => c.json(stubRemoveBookmark, 200)).openapi(backlinkRoutes.getBacklinksRoute, (c) => c.json(stubBacklinks, 200)).openapi(commentRoutes.listCommentsRoute, (c) => c.json(stubListComments, 200)).openapi(commentRoutes.addCommentRoute, (c) => c.json(stubAddComment, 200)).openapi(commentRoutes.deleteCommentRoute, (c) => c.json(stubDeleteComment, 200)).openapi(revisionRoutes.listRevisionsRoute, (c) => c.json(stubListRevisions, 200)).openapi(revisionRoutes.getRevisionsRoute, (c) => c.json(stubGetRevisions, 200)).openapi(revisionRoutes.getRevisionRoute, (c) => c.json(stubGetRevision, 200));
|
|
7647
|
+
var pageChain = new import_zod_openapi79.OpenAPIHono().openapi(pageRoutes.getPageRoute, (c) => c.json(stubPageWithRevision, 200)).openapi(pageRoutes.listPagesRoute, (c) => c.json(stubListPages, 200)).openapi(pageRoutes.listPageChildrenRoute, (c) => c.json(stubListPageChildren, 200)).openapi(pageRoutes.createPageRoute, (c) => c.json(stubPageResponse, 200)).openapi(pageRoutes.updatePageRoute, (c) => c.json(stubPageResponse, 200)).openapi(pageRoutes.setPageGrantRoute, (c) => c.json(stubPageResponse, 200)).openapi(pageRoutes.seenPageRoute, (c) => c.json(stubSeenUsers, 200)).openapi(pageRoutes.getSeenUsersRoute, (c) => c.json(stubSeenUsers, 200)).openapi(pageRoutes.likePageRoute, (c) => c.json(stubPageResponse, 200)).openapi(pageRoutes.unlikePageRoute, (c) => c.json(stubPageResponse, 200)).openapi(pageRoutes.claimPageLinkAccessRoute, (c) => c.json({ ...stubPageWithRevision, granted: false }, 200)).openapi(pageRoutes.getWatchStatusRoute, (c) => c.json(stubWatchStatus, 200)).openapi(pageRoutes.setWatchStatusRoute, (c) => c.json(stubWatchStatus, 200)).openapi(pageRoutes.deletePageRoute, (c) => c.json(stubPageResponse, 200)).openapi(pageRoutes.revertDeletedPageRoute, (c) => c.json(stubPageResponse, 200)).openapi(pageRoutes.revertToRevisionRoute, (c) => c.json(stubPageResponse, 200)).openapi(pageRoutes.renamePageRoute, (c) => c.json({ ...stubPageResponse, renamed_count: 1 }, 200)).openapi(pageRoutes.renameSubtreeRoute, (c) => c.json({ renamed_count: 0 }, 200)).openapi(pagePreviewRoutes.previewPageRoute, (c) => c.json(stubPreview, 200)).openapi(pageCollabRoutes.getYjsTokenRoute, (c) => c.json(stubWsToken, 200)).openapi(presenceRoutes.getPresenceTokenRoute, (c) => c.json(stubPresenceToken, 200)).openapi(presenceRoutes.getLikersRoute, (c) => c.json(stubLikers, 200));
|
|
7648
|
+
var lateContractApp = new import_zod_openapi79.OpenAPIHono().openapi(draftRoutes.createDraftRoute, (c) => c.json(stubCreateDraft, 201)).openapi(draftRoutes.listDraftsRoute, (c) => c.json(stubListDrafts, 200)).openapi(draftRoutes.cancelDraftRoute, (c) => c.json(stubCreateDraft, 200)).openapi(autocompleteRoutes.autocompleteUsersRoute, (c) => c.json(stubAutocomplete, 200)).openapi(autocompleteRoutes.autocompletePagesRoute, (c) => c.json(stubAutocomplete, 200)).openapi(attachmentRoutes.getAttachmentUsageRoute, (c) => c.json(stubAttachmentUsage, 200)).openapi(attachmentRoutes.listAttachmentsRoute, (c) => c.json(stubListAttachments, 200)).openapi(attachmentRoutes.addAttachmentRoute, (c) => c.json(stubAddAttachment, 200)).openapi(attachmentRoutes.uploadAttachmentRoute, (c) => c.json(stubUploadAttachment, 200)).openapi(attachmentRoutes.getAttachmentMetaRoute, (c) => c.json(stubAttachmentMeta, 200)).openapi(attachmentRoutes.removeAttachmentRoute, (c) => c.json(stubRemoveAttachment, 200)).openapi(searchRoutes.searchPagesRoute, (c) => c.json(stubSearchPages, 200)).openapi(adminCryptoRoutes.getCryptoStatusRoute, (c) => c.json(stubCryptoStatus, 200)).openapi(adminCryptoRoutes.reencryptAllRoute, (c) => c.json(stubReencrypt, 200)).openapi(notificationRoutes.listNotificationsRoute, (c) => c.json(stubListNotifications, 200)).openapi(notificationRoutes.markAllAsReadRoute, (c) => c.json(stubMarkAllAsRead, 200)).openapi(notificationRoutes.getNotificationsTokenRoute, (c) => c.json(stubNotificationsToken, 200)).openapi(notificationRoutes.getUnreadCountRoute, (c) => c.json(stubNotificationStatus, 200)).openapi(notificationRoutes.openNotificationRoute, (c) => c.json(stubOpenNotification, 200));
|
|
7649
|
+
var adminSettingsContractApp = new import_zod_openapi79.OpenAPIHono().openapi(adminAppRoutes.getAppSettingsRoute, (c) => c.json(stubGetAppSettings, 200)).openapi(adminAppRoutes.updateAppSettingsRoute, (c) => c.json(stubUpdateAppSettings, 200)).openapi(adminAuthRoutes.getAuthSettingsRoute, (c) => c.json(stubAuthSettings, 200)).openapi(adminAuthRoutes.updateAuthSettingsRoute, (c) => c.json(stubAuthSettings, 200)).openapi(adminSecurityRoutes.getSecuritySettingsRoute, (c) => c.json(stubSecuritySettings, 200)).openapi(adminSecurityRoutes.updateSecuritySettingsRoute, (c) => c.json(stubSecuritySettings, 200)).openapi(adminMailRoutes.getMailSettingsRoute, (c) => c.json(stubMailSettings, 200)).openapi(adminMailRoutes.updateMailSettingsRoute, (c) => c.json(stubUpdateMailSettings, 200)).openapi(adminMailRoutes.sendTestMailRoute, (c) => c.json(stubSendTestMail, 200)).openapi(adminStorageRoutes.getStorageStatusRoute, (c) => c.json(stubStorageStatus, 200)).openapi(adminSearchRoutes.getSearchStatusRoute, (c) => c.json(stubSearchStatus, 200));
|
|
7650
|
+
var adminUsersPluginsContractApp = new import_zod_openapi79.OpenAPIHono().openapi(adminUsersRoutes.listUsersRoute, (c) => c.json(stubListAdminUsers, 200)).openapi(adminUsersRoutes.searchUsersByEmailRoute, (c) => c.json(stubSearchAdminUsersByEmail, 200)).openapi(adminUsersRoutes.pendingUsersCountRoute, (c) => c.json(stubPendingUsersCount, 200)).openapi(adminUsersRoutes.inviteUsersRoute, (c) => c.json(stubInviteUsers, 200)).openapi(adminUsersRoutes.editUserRoute, (c) => c.json(stubAdminUserMutation, 200)).openapi(adminUsersRoutes.makeAdminRoute, (c) => c.json(stubAdminUserMutation, 200)).openapi(adminUsersRoutes.removeFromAdminRoute, (c) => c.json(stubAdminUserMutation, 200)).openapi(adminUsersRoutes.activateUserRoute, (c) => c.json(stubAdminUserMutation, 200)).openapi(adminUsersRoutes.suspendUserRoute, (c) => c.json(stubAdminUserMutation, 200)).openapi(adminUsersRoutes.resetPasswordRoute, (c) => c.json(stubResetPassword, 200)).openapi(adminUsersRoutes.resendInviteRoute, (c) => c.json(stubAdminUserMutation, 200)).openapi(adminUsersRoutes.updateUserEmailRoute, (c) => c.json(stubAdminUserMutation, 200)).openapi(adminUsersRoutes.deleteUserRoute, (c) => c.json(stubDeleteAdminUser, 200)).openapi(adminPluginsRoutes.listPluginsRoute, (c) => c.json(stubListPlugins, 200)).openapi(adminPluginsRoutes.getPluginConfigRoute, (c) => c.json(stubPluginConfig, 200)).openapi(adminPluginsRoutes.updatePluginConfigRoute, (c) => c.json(stubUpdatePluginConfig, 200)).openapi(adminPluginsRoutes.getPluginReadinessRoute, (c) => c.json(stubPluginReadiness, 200)).openapi(adminPluginsRoutes.clearRenderCacheAllRoute, (c) => c.json(stubClearRenderCache, 200)).openapi(adminPluginsRoutes.clearRenderCachePluginRoute, (c) => c.json(stubClearRenderCache, 200));
|
|
7651
|
+
var oauthContractApp = new import_zod_openapi79.OpenAPIHono().openapi(oauthRoutes.authorizeRoute, (c) => c.json(stubAuthorize, 200)).openapi(oauthRoutes.tokenRoute, (c) => c.json(stubToken, 200)).openapi(oauthRoutes.revokeRoute, (c) => c.json(stubRevoke, 200)).openapi(oauthRoutes.discoveryRoute, (c) => c.json(stubDiscovery, 200)).openapi(oauthRoutes.deviceAuthorizeRoute, (c) => c.json(stubDeviceAuthorize, 200)).openapi(oauthRoutes.deviceInfoRoute, (c) => c.json(stubDeviceInfo, 200)).openapi(oauthRoutes.deviceVerifyRoute, (c) => c.json(stubDeviceVerify, 200)).openapi(oauthRoutes.clientInfoRoute, (c) => c.json(stubClientInfo, 200));
|
|
7652
|
+
var federatedAuthContractApp = new import_zod_openapi79.OpenAPIHono().openapi(federatedAuthRoutes.listFederatedProvidersRoute, (c) => c.json(stubProviderList, 200)).openapi(federatedAuthRoutes.startFederatedProviderRoute, (c) => c.redirect("", 302)).openapi(federatedAuthRoutes.callbackFederatedProviderRoute, (c) => c.redirect("", 302)).openapi(federatedAuthRoutes.federatedHandoffRoute, (c) => c.json(stubTokens, 200)).openapi(federatedAuthRoutes.listLinkedAuthProvidersRoute, (c) => c.json({ identities: [] }, 200)).openapi(federatedAuthRoutes.createAuthProviderLinkGrantRoute, (c) => c.json({ linkGrant: "" }, 200)).openapi(federatedAuthRoutes.unlinkAuthProviderRoute, (c) => c.body(null, 204));
|
|
7653
|
+
var federatedRegistrationContractApp = new import_zod_openapi79.OpenAPIHono().openapi(federatedRegistrationRoutes.getFederatedRegistrationRoute, (c) => c.json(stubFederatedRegistrationSnapshot, 200)).openapi(federatedRegistrationRoutes.submitFederatedRegistrationRoute, (c) => c.json({ status: "approval_required" }, 200)).openapi(federatedRegistrationRoutes.logoutFederatedRegistrationRoute, (c) => c.body(null, 204));
|
|
7164
7654
|
var createClient = (baseUrl, options = {}) => (0, import_client.hc)(baseUrl, {
|
|
7165
7655
|
headers: options.headers,
|
|
7166
7656
|
fetch: options.fetch
|
|
7167
7657
|
});
|
|
7168
7658
|
|
|
7169
7659
|
// src/schemas/mail-token.ts
|
|
7170
|
-
var
|
|
7171
|
-
var MailTokenPurposeSchema =
|
|
7172
|
-
var MailTokenPayloadSchema =
|
|
7660
|
+
var import_zod_openapi80 = require("@hono/zod-openapi");
|
|
7661
|
+
var MailTokenPurposeSchema = import_zod_openapi80.z.enum(["invite", "activate", "reset", "email-change"]);
|
|
7662
|
+
var MailTokenPayloadSchema = import_zod_openapi80.z.object({
|
|
7173
7663
|
purpose: MailTokenPurposeSchema,
|
|
7174
|
-
userId:
|
|
7664
|
+
userId: import_zod_openapi80.z.string(),
|
|
7175
7665
|
/** Target address. For `email-change` this is the NEW address. */
|
|
7176
|
-
email:
|
|
7666
|
+
email: import_zod_openapi80.z.string().email(),
|
|
7177
7667
|
/**
|
|
7178
7668
|
* For `email-change`: the account's email at issue time. The confirm
|
|
7179
7669
|
* endpoint rejects the token unless it still matches, making the token
|
|
7180
7670
|
* single-use (a stale token cannot revert a later change).
|
|
7181
7671
|
*/
|
|
7182
|
-
fromEmail:
|
|
7672
|
+
fromEmail: import_zod_openapi80.z.string().email().optional(),
|
|
7183
7673
|
/**
|
|
7184
7674
|
* For `reset`: the account's `passwordResetGeneration` at issue time.
|
|
7185
7675
|
* Consuming the link increments that counter, so the token only matches
|
|
@@ -7188,7 +7678,7 @@ var MailTokenPayloadSchema = import_zod_openapi75.z.object({
|
|
|
7188
7678
|
* schema because the other purposes don't carry it (and links minted
|
|
7189
7679
|
* before the claim existed simply no longer match).
|
|
7190
7680
|
*/
|
|
7191
|
-
resetGeneration:
|
|
7681
|
+
resetGeneration: import_zod_openapi80.z.number().int().nonnegative().optional(),
|
|
7192
7682
|
/**
|
|
7193
7683
|
* For `email-change`: the account's `authVersion` at issue time. The
|
|
7194
7684
|
* confirm endpoint requires it to still match, so a pending address change
|
|
@@ -7200,10 +7690,22 @@ var MailTokenPayloadSchema = import_zod_openapi75.z.object({
|
|
|
7200
7690
|
* semantics wanted are exactly "the session that asked for this is gone",
|
|
7201
7691
|
* and that is what every bump of it already means.
|
|
7202
7692
|
*/
|
|
7203
|
-
authVersion:
|
|
7693
|
+
authVersion: import_zod_openapi80.z.number().int().nonnegative().optional(),
|
|
7694
|
+
/**
|
|
7695
|
+
* For `email-change`: the account's `emailChangeGeneration` at issue time.
|
|
7696
|
+
* Requesting a change increments it, so asking for a different address
|
|
7697
|
+
* supersedes any link still pending — which is what lets a user call off a
|
|
7698
|
+
* change they did not want (one an attacker started with a stolen session,
|
|
7699
|
+
* or one sent to a mistyped address). `authVersion` cannot serve this: it
|
|
7700
|
+
* means "the session that asked is gone", and bumping it on a mere request
|
|
7701
|
+
* would log the user out of their own account for editing their profile.
|
|
7702
|
+
* Optional in the schema for the same reason as the others — links minted
|
|
7703
|
+
* before the claim existed simply no longer match.
|
|
7704
|
+
*/
|
|
7705
|
+
emailChangeGeneration: import_zod_openapi80.z.number().int().nonnegative().optional(),
|
|
7204
7706
|
// iat / exp are injected and verified by the JWT layer.
|
|
7205
|
-
iat:
|
|
7206
|
-
exp:
|
|
7707
|
+
iat: import_zod_openapi80.z.number().optional(),
|
|
7708
|
+
exp: import_zod_openapi80.z.number().optional()
|
|
7207
7709
|
});
|
|
7208
7710
|
|
|
7209
7711
|
// src/util/html-elements.ts
|
|
@@ -7419,6 +7921,8 @@ var WS_CLOSE_CODES = {
|
|
|
7419
7921
|
CommentInvalidRequestErrorSchema,
|
|
7420
7922
|
CommentNotFoundErrorSchema,
|
|
7421
7923
|
CommentSchema,
|
|
7924
|
+
ConfigReadinessIssueSchema,
|
|
7925
|
+
ConfigReadinessResponseSchema,
|
|
7422
7926
|
ConfirmEmailChangeRequestSchema,
|
|
7423
7927
|
ConfirmEmailChangeResponseSchema,
|
|
7424
7928
|
ConflictErrorSchema,
|
|
@@ -7429,6 +7933,8 @@ var WS_CLOSE_CODES = {
|
|
|
7429
7933
|
CreateAdminResponseSchema,
|
|
7430
7934
|
CreateDraftRequestSchema,
|
|
7431
7935
|
CreateDraftResponseSchema,
|
|
7936
|
+
CreateLinkGrantRequestSchema,
|
|
7937
|
+
CreateLinkGrantResponseSchema,
|
|
7432
7938
|
CreatePageRequestSchema,
|
|
7433
7939
|
CrowiCodeSidecarSchema,
|
|
7434
7940
|
CrowiDiagramNodeSchema,
|
|
@@ -7464,6 +7970,14 @@ var WS_CLOSE_CODES = {
|
|
|
7464
7970
|
EditAdminUserRequestSchema,
|
|
7465
7971
|
EncryptionNotConfiguredErrorSchema,
|
|
7466
7972
|
ErrorCodeSchema,
|
|
7973
|
+
FederatedHandoffRequestSchema,
|
|
7974
|
+
FederatedHandoffResponseSchema,
|
|
7975
|
+
FederatedProviderSchema,
|
|
7976
|
+
FederatedRegistrationActiveResultSchema,
|
|
7977
|
+
FederatedRegistrationApprovalResultSchema,
|
|
7978
|
+
FederatedRegistrationResultSchema,
|
|
7979
|
+
FederatedRegistrationSnapshotSchema,
|
|
7980
|
+
FederatedRegistrationSubmitRequestSchema,
|
|
7467
7981
|
ForbiddenErrorSchema,
|
|
7468
7982
|
ForgotPasswordRequestSchema,
|
|
7469
7983
|
ForgotPasswordResponseSchema,
|
|
@@ -7505,6 +8019,7 @@ var WS_CLOSE_CODES = {
|
|
|
7505
8019
|
LanguageSchema,
|
|
7506
8020
|
LikerSchema,
|
|
7507
8021
|
LikersResponseSchema,
|
|
8022
|
+
LinkedAuthProviderListResponseSchema,
|
|
7508
8023
|
ListAccessTokensResponseSchema,
|
|
7509
8024
|
ListAdminUsersRequestSchema,
|
|
7510
8025
|
ListAdminUsersResponseSchema,
|
|
@@ -7576,6 +8091,7 @@ var WS_CLOSE_CODES = {
|
|
|
7576
8091
|
PluginFieldSchema,
|
|
7577
8092
|
PluginInfoSchema,
|
|
7578
8093
|
PluginNotFoundErrorSchema,
|
|
8094
|
+
PluginReadinessFieldSchema,
|
|
7579
8095
|
PresenceClientMessageSchema,
|
|
7580
8096
|
PresenceCommentChangedMessageSchema,
|
|
7581
8097
|
PresenceHeartbeatMessageSchema,
|
|
@@ -7588,6 +8104,7 @@ var WS_CLOSE_CODES = {
|
|
|
7588
8104
|
PreviewPageRequestSchema,
|
|
7589
8105
|
PreviewPageResponseSchema,
|
|
7590
8106
|
ProfileErrorResponseSchema,
|
|
8107
|
+
ProviderListResponseSchema,
|
|
7591
8108
|
RENDERED_AST_NODE_DEFS,
|
|
7592
8109
|
RecentlyViewedPagesResponseSchema,
|
|
7593
8110
|
ReencryptResponseSchema,
|
|
@@ -7636,6 +8153,8 @@ var WS_CLOSE_CODES = {
|
|
|
7636
8153
|
SendTestMailErrorSchema,
|
|
7637
8154
|
SendTestMailRequestSchema,
|
|
7638
8155
|
SendTestMailResponseSchema,
|
|
8156
|
+
SenderProofSchema,
|
|
8157
|
+
SenderPublicJwkSchema,
|
|
7639
8158
|
SensitiveConfigEntrySchema,
|
|
7640
8159
|
ServiceUnavailableErrorSchema,
|
|
7641
8160
|
SetPageGrantRequestSchema,
|
|
@@ -7656,6 +8175,7 @@ var WS_CLOSE_CODES = {
|
|
|
7656
8175
|
TokenRequestSchema,
|
|
7657
8176
|
TokenResponseSchema,
|
|
7658
8177
|
UPLOAD_ALLOWED_MIME,
|
|
8178
|
+
UnlinkAuthProviderErrorSchema,
|
|
7659
8179
|
UpdateAdminUserEmailRequestSchema,
|
|
7660
8180
|
UpdateAppSettingsRequestSchema,
|
|
7661
8181
|
UpdateAppSettingsResponseSchema,
|
|
@@ -7687,6 +8207,7 @@ var WS_CLOSE_CODES = {
|
|
|
7687
8207
|
UserStatusErrorSchema,
|
|
7688
8208
|
UserStatusSchema,
|
|
7689
8209
|
UserSubpagesRequestSchema,
|
|
8210
|
+
UsernameSchema,
|
|
7690
8211
|
ValidationErrorSchema,
|
|
7691
8212
|
WS_CLOSE_CODES,
|
|
7692
8213
|
WatchStatusResponseSchema,
|
|
@@ -7718,6 +8239,7 @@ var WS_CLOSE_CODES = {
|
|
|
7718
8239
|
autocompleteUsersRoute,
|
|
7719
8240
|
backlinkRoutes,
|
|
7720
8241
|
bookmarkRoutes,
|
|
8242
|
+
callbackFederatedProviderRoute,
|
|
7721
8243
|
cancelDraftRoute,
|
|
7722
8244
|
claimPageLinkAccessRoute,
|
|
7723
8245
|
clearRenderCacheAllRoute,
|
|
@@ -7727,6 +8249,7 @@ var WS_CLOSE_CODES = {
|
|
|
7727
8249
|
confirmEmailChangeRoute,
|
|
7728
8250
|
createAccessTokenRoute,
|
|
7729
8251
|
createAdminRoute,
|
|
8252
|
+
createAuthProviderLinkGrantRoute,
|
|
7730
8253
|
createClient,
|
|
7731
8254
|
createDraftRoute,
|
|
7732
8255
|
createPageRoute,
|
|
@@ -7742,6 +8265,9 @@ var WS_CLOSE_CODES = {
|
|
|
7742
8265
|
draftRoutes,
|
|
7743
8266
|
editUserRoute,
|
|
7744
8267
|
emailChangeRoutes,
|
|
8268
|
+
federatedAuthRoutes,
|
|
8269
|
+
federatedHandoffRoute,
|
|
8270
|
+
federatedRegistrationRoutes,
|
|
7745
8271
|
forgotPasswordRoute,
|
|
7746
8272
|
getAppInfoRoute,
|
|
7747
8273
|
getAppSettingsRoute,
|
|
@@ -7751,12 +8277,14 @@ var WS_CLOSE_CODES = {
|
|
|
7751
8277
|
getBacklinksRoute,
|
|
7752
8278
|
getBookmarkRoute,
|
|
7753
8279
|
getCryptoStatusRoute,
|
|
8280
|
+
getFederatedRegistrationRoute,
|
|
7754
8281
|
getInstallerStatusRoute,
|
|
7755
8282
|
getLikersRoute,
|
|
7756
8283
|
getMailSettingsRoute,
|
|
7757
8284
|
getNotificationsTokenRoute,
|
|
7758
8285
|
getPageRoute,
|
|
7759
8286
|
getPluginConfigRoute,
|
|
8287
|
+
getPluginReadinessRoute,
|
|
7760
8288
|
getPresenceTokenRoute,
|
|
7761
8289
|
getProfileRoute,
|
|
7762
8290
|
getRevisionRoute,
|
|
@@ -7783,6 +8311,8 @@ var WS_CLOSE_CODES = {
|
|
|
7783
8311
|
listAttachmentsRoute,
|
|
7784
8312
|
listCommentsRoute,
|
|
7785
8313
|
listDraftsRoute,
|
|
8314
|
+
listFederatedProvidersRoute,
|
|
8315
|
+
listLinkedAuthProvidersRoute,
|
|
7786
8316
|
listMembersRoute,
|
|
7787
8317
|
listMyBookmarksRoute,
|
|
7788
8318
|
listNotificationsRoute,
|
|
@@ -7791,6 +8321,7 @@ var WS_CLOSE_CODES = {
|
|
|
7791
8321
|
listPluginsRoute,
|
|
7792
8322
|
listRevisionsRoute,
|
|
7793
8323
|
listUsersRoute,
|
|
8324
|
+
logoutFederatedRegistrationRoute,
|
|
7794
8325
|
makeAdminRoute,
|
|
7795
8326
|
markAllAsReadRoute,
|
|
7796
8327
|
meRoutes,
|
|
@@ -7827,7 +8358,9 @@ var WS_CLOSE_CODES = {
|
|
|
7827
8358
|
sendTestMailRoute,
|
|
7828
8359
|
setPageGrantRoute,
|
|
7829
8360
|
setWatchStatusRoute,
|
|
8361
|
+
startFederatedProviderRoute,
|
|
7830
8362
|
stripKnownHtmlTags,
|
|
8363
|
+
submitFederatedRegistrationRoute,
|
|
7831
8364
|
suspendUserRoute,
|
|
7832
8365
|
tokenAuthRoutes,
|
|
7833
8366
|
tokenLoginRoute,
|
|
@@ -7837,6 +8370,7 @@ var WS_CLOSE_CODES = {
|
|
|
7837
8370
|
tokenRegisterRoute,
|
|
7838
8371
|
tokenRoute,
|
|
7839
8372
|
unlikePageRoute,
|
|
8373
|
+
unlinkAuthProviderRoute,
|
|
7840
8374
|
unwrapRenderedAst,
|
|
7841
8375
|
updateAppSettingsRoute,
|
|
7842
8376
|
updateAuthSettingsRoute,
|