@crowi/api-contract 2.0.0-alpha.12 → 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 +903 -13
- package/dist/generated/openapi.d.ts +903 -13
- package/dist/generated/openapi.js.map +1 -1
- package/dist/index.d.mts +5083 -1296
- package/dist/index.d.ts +5083 -1296
- package/dist/index.js +554 -83
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +517 -73
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
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,
|
|
@@ -236,8 +249,6 @@ __export(index_exports, {
|
|
|
236
249
|
PluginInfoSchema: () => PluginInfoSchema,
|
|
237
250
|
PluginNotFoundErrorSchema: () => PluginNotFoundErrorSchema,
|
|
238
251
|
PluginReadinessFieldSchema: () => PluginReadinessFieldSchema,
|
|
239
|
-
PluginReadinessIssueSchema: () => PluginReadinessIssueSchema,
|
|
240
|
-
PluginReadinessResponseSchema: () => PluginReadinessResponseSchema,
|
|
241
252
|
PresenceClientMessageSchema: () => PresenceClientMessageSchema,
|
|
242
253
|
PresenceCommentChangedMessageSchema: () => PresenceCommentChangedMessageSchema,
|
|
243
254
|
PresenceHeartbeatMessageSchema: () => PresenceHeartbeatMessageSchema,
|
|
@@ -250,6 +261,7 @@ __export(index_exports, {
|
|
|
250
261
|
PreviewPageRequestSchema: () => PreviewPageRequestSchema,
|
|
251
262
|
PreviewPageResponseSchema: () => PreviewPageResponseSchema,
|
|
252
263
|
ProfileErrorResponseSchema: () => ProfileErrorResponseSchema,
|
|
264
|
+
ProviderListResponseSchema: () => ProviderListResponseSchema,
|
|
253
265
|
RENDERED_AST_NODE_DEFS: () => RENDERED_AST_NODE_DEFS,
|
|
254
266
|
RecentlyViewedPagesResponseSchema: () => RecentlyViewedPagesResponseSchema,
|
|
255
267
|
ReencryptResponseSchema: () => ReencryptResponseSchema,
|
|
@@ -298,6 +310,8 @@ __export(index_exports, {
|
|
|
298
310
|
SendTestMailErrorSchema: () => SendTestMailErrorSchema,
|
|
299
311
|
SendTestMailRequestSchema: () => SendTestMailRequestSchema,
|
|
300
312
|
SendTestMailResponseSchema: () => SendTestMailResponseSchema,
|
|
313
|
+
SenderProofSchema: () => SenderProofSchema,
|
|
314
|
+
SenderPublicJwkSchema: () => SenderPublicJwkSchema,
|
|
301
315
|
SensitiveConfigEntrySchema: () => SensitiveConfigEntrySchema,
|
|
302
316
|
ServiceUnavailableErrorSchema: () => ServiceUnavailableErrorSchema,
|
|
303
317
|
SetPageGrantRequestSchema: () => SetPageGrantRequestSchema,
|
|
@@ -318,6 +332,7 @@ __export(index_exports, {
|
|
|
318
332
|
TokenRequestSchema: () => TokenRequestSchema,
|
|
319
333
|
TokenResponseSchema: () => TokenResponseSchema,
|
|
320
334
|
UPLOAD_ALLOWED_MIME: () => UPLOAD_ALLOWED_MIME,
|
|
335
|
+
UnlinkAuthProviderErrorSchema: () => UnlinkAuthProviderErrorSchema,
|
|
321
336
|
UpdateAdminUserEmailRequestSchema: () => UpdateAdminUserEmailRequestSchema,
|
|
322
337
|
UpdateAppSettingsRequestSchema: () => UpdateAppSettingsRequestSchema,
|
|
323
338
|
UpdateAppSettingsResponseSchema: () => UpdateAppSettingsResponseSchema,
|
|
@@ -381,6 +396,7 @@ __export(index_exports, {
|
|
|
381
396
|
autocompleteUsersRoute: () => autocompleteUsersRoute,
|
|
382
397
|
backlinkRoutes: () => backlinkRoutes,
|
|
383
398
|
bookmarkRoutes: () => bookmarkRoutes,
|
|
399
|
+
callbackFederatedProviderRoute: () => callbackFederatedProviderRoute,
|
|
384
400
|
cancelDraftRoute: () => cancelDraftRoute,
|
|
385
401
|
claimPageLinkAccessRoute: () => claimPageLinkAccessRoute,
|
|
386
402
|
clearRenderCacheAllRoute: () => clearRenderCacheAllRoute,
|
|
@@ -390,6 +406,7 @@ __export(index_exports, {
|
|
|
390
406
|
confirmEmailChangeRoute: () => confirmEmailChangeRoute,
|
|
391
407
|
createAccessTokenRoute: () => createAccessTokenRoute,
|
|
392
408
|
createAdminRoute: () => createAdminRoute,
|
|
409
|
+
createAuthProviderLinkGrantRoute: () => createAuthProviderLinkGrantRoute,
|
|
393
410
|
createClient: () => createClient,
|
|
394
411
|
createDraftRoute: () => createDraftRoute,
|
|
395
412
|
createPageRoute: () => createPageRoute,
|
|
@@ -405,6 +422,9 @@ __export(index_exports, {
|
|
|
405
422
|
draftRoutes: () => draftRoutes,
|
|
406
423
|
editUserRoute: () => editUserRoute,
|
|
407
424
|
emailChangeRoutes: () => emailChangeRoutes,
|
|
425
|
+
federatedAuthRoutes: () => federatedAuthRoutes,
|
|
426
|
+
federatedHandoffRoute: () => federatedHandoffRoute,
|
|
427
|
+
federatedRegistrationRoutes: () => federatedRegistrationRoutes,
|
|
408
428
|
forgotPasswordRoute: () => forgotPasswordRoute,
|
|
409
429
|
getAppInfoRoute: () => getAppInfoRoute,
|
|
410
430
|
getAppSettingsRoute: () => getAppSettingsRoute,
|
|
@@ -414,6 +434,7 @@ __export(index_exports, {
|
|
|
414
434
|
getBacklinksRoute: () => getBacklinksRoute,
|
|
415
435
|
getBookmarkRoute: () => getBookmarkRoute,
|
|
416
436
|
getCryptoStatusRoute: () => getCryptoStatusRoute,
|
|
437
|
+
getFederatedRegistrationRoute: () => getFederatedRegistrationRoute,
|
|
417
438
|
getInstallerStatusRoute: () => getInstallerStatusRoute,
|
|
418
439
|
getLikersRoute: () => getLikersRoute,
|
|
419
440
|
getMailSettingsRoute: () => getMailSettingsRoute,
|
|
@@ -447,6 +468,8 @@ __export(index_exports, {
|
|
|
447
468
|
listAttachmentsRoute: () => listAttachmentsRoute,
|
|
448
469
|
listCommentsRoute: () => listCommentsRoute,
|
|
449
470
|
listDraftsRoute: () => listDraftsRoute,
|
|
471
|
+
listFederatedProvidersRoute: () => listFederatedProvidersRoute,
|
|
472
|
+
listLinkedAuthProvidersRoute: () => listLinkedAuthProvidersRoute,
|
|
450
473
|
listMembersRoute: () => listMembersRoute,
|
|
451
474
|
listMyBookmarksRoute: () => listMyBookmarksRoute,
|
|
452
475
|
listNotificationsRoute: () => listNotificationsRoute,
|
|
@@ -455,6 +478,7 @@ __export(index_exports, {
|
|
|
455
478
|
listPluginsRoute: () => listPluginsRoute,
|
|
456
479
|
listRevisionsRoute: () => listRevisionsRoute,
|
|
457
480
|
listUsersRoute: () => listUsersRoute,
|
|
481
|
+
logoutFederatedRegistrationRoute: () => logoutFederatedRegistrationRoute,
|
|
458
482
|
makeAdminRoute: () => makeAdminRoute,
|
|
459
483
|
markAllAsReadRoute: () => markAllAsReadRoute,
|
|
460
484
|
meRoutes: () => meRoutes,
|
|
@@ -491,7 +515,9 @@ __export(index_exports, {
|
|
|
491
515
|
sendTestMailRoute: () => sendTestMailRoute,
|
|
492
516
|
setPageGrantRoute: () => setPageGrantRoute,
|
|
493
517
|
setWatchStatusRoute: () => setWatchStatusRoute,
|
|
518
|
+
startFederatedProviderRoute: () => startFederatedProviderRoute,
|
|
494
519
|
stripKnownHtmlTags: () => stripKnownHtmlTags,
|
|
520
|
+
submitFederatedRegistrationRoute: () => submitFederatedRegistrationRoute,
|
|
495
521
|
suspendUserRoute: () => suspendUserRoute,
|
|
496
522
|
tokenAuthRoutes: () => tokenAuthRoutes,
|
|
497
523
|
tokenLoginRoute: () => tokenLoginRoute,
|
|
@@ -501,6 +527,7 @@ __export(index_exports, {
|
|
|
501
527
|
tokenRegisterRoute: () => tokenRegisterRoute,
|
|
502
528
|
tokenRoute: () => tokenRoute,
|
|
503
529
|
unlikePageRoute: () => unlikePageRoute,
|
|
530
|
+
unlinkAuthProviderRoute: () => unlinkAuthProviderRoute,
|
|
504
531
|
unwrapRenderedAst: () => unwrapRenderedAst,
|
|
505
532
|
updateAppSettingsRoute: () => updateAppSettingsRoute,
|
|
506
533
|
updateAuthSettingsRoute: () => updateAuthSettingsRoute,
|
|
@@ -522,7 +549,7 @@ __export(index_exports, {
|
|
|
522
549
|
module.exports = __toCommonJS(index_exports);
|
|
523
550
|
|
|
524
551
|
// src/client.ts
|
|
525
|
-
var
|
|
552
|
+
var import_zod_openapi79 = require("@hono/zod-openapi");
|
|
526
553
|
var import_client = require("hono/client");
|
|
527
554
|
|
|
528
555
|
// src/contracts/admin/app.ts
|
|
@@ -628,8 +655,12 @@ var ERROR_CODES = [
|
|
|
628
655
|
"INVALID_CREDENTIALS",
|
|
629
656
|
"REFRESH_TOKEN_REQUIRED",
|
|
630
657
|
"REGISTRATION_CLOSED",
|
|
658
|
+
// --- federated sign-in (RFC-0014) ---
|
|
659
|
+
"FEDERATED_HANDOFF_INVALID",
|
|
660
|
+
"FEDERATED_HANDOFF_CONSUMED",
|
|
631
661
|
// --- admin subsystems ---
|
|
632
662
|
"ENCRYPTION_NOT_CONFIGURED",
|
|
663
|
+
"MAIL_FROM_NOT_CONFIGURED",
|
|
633
664
|
"MAIL_TEST_FAILED",
|
|
634
665
|
"PLUGIN_NOT_FOUND",
|
|
635
666
|
"PLUGIN_CONFIG_VALIDATION_FAILED"
|
|
@@ -910,10 +941,16 @@ var SendTestMailResponseSchema = import_zod_openapi7.z.object({
|
|
|
910
941
|
to: import_zod_openapi7.z.string()
|
|
911
942
|
});
|
|
912
943
|
var SendTestMailErrorSchema = import_zod_openapi7.z.object({
|
|
913
|
-
error: import_zod_openapi7.z.
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
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
|
+
])
|
|
917
954
|
});
|
|
918
955
|
var MailSettingsValidationErrorSchema = import_zod_openapi7.z.object({
|
|
919
956
|
bodyResult: import_zod_openapi7.z.object({
|
|
@@ -1026,7 +1063,7 @@ var sendTestMailRoute = (0, import_zod_openapi8.createRoute)({
|
|
|
1026
1063
|
content: { "application/json": { schema: AdminRequiredErrorSchema } }
|
|
1027
1064
|
},
|
|
1028
1065
|
502: {
|
|
1029
|
-
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)",
|
|
1030
1067
|
content: { "application/json": { schema: SendTestMailErrorSchema } }
|
|
1031
1068
|
}
|
|
1032
1069
|
}
|
|
@@ -1176,13 +1213,16 @@ var PluginReadinessFieldSchema = import_zod_openapi9.z.object({
|
|
|
1176
1213
|
name: import_zod_openapi9.z.string(),
|
|
1177
1214
|
configured: import_zod_openapi9.z.literal(false)
|
|
1178
1215
|
});
|
|
1179
|
-
var
|
|
1180
|
-
name
|
|
1181
|
-
|
|
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(),
|
|
1182
1222
|
fields: import_zod_openapi9.z.array(PluginReadinessFieldSchema)
|
|
1183
1223
|
});
|
|
1184
|
-
var
|
|
1185
|
-
issues: import_zod_openapi9.z.array(
|
|
1224
|
+
var ConfigReadinessResponseSchema = import_zod_openapi9.z.object({
|
|
1225
|
+
issues: import_zod_openapi9.z.array(ConfigReadinessIssueSchema)
|
|
1186
1226
|
});
|
|
1187
1227
|
|
|
1188
1228
|
// src/contracts/admin/plugins.ts
|
|
@@ -1320,11 +1360,11 @@ var getPluginReadinessRoute = (0, import_zod_openapi10.createRoute)({
|
|
|
1320
1360
|
path: "/admin/plugins/readiness",
|
|
1321
1361
|
tags: ["admin.plugins"],
|
|
1322
1362
|
security: [{ bearerAuth: [] }],
|
|
1323
|
-
summary: "List active plugins missing required readiness
|
|
1363
|
+
summary: "List active plugins and core config missing required readiness fields",
|
|
1324
1364
|
responses: {
|
|
1325
1365
|
200: {
|
|
1326
|
-
description: "Readiness issues for active plugins (empty when everything is configured)",
|
|
1327
|
-
content: { "application/json": { schema:
|
|
1366
|
+
description: "Readiness issues for active plugins and core config (empty when everything is configured)",
|
|
1367
|
+
content: { "application/json": { schema: ConfigReadinessResponseSchema } }
|
|
1328
1368
|
},
|
|
1329
1369
|
401: {
|
|
1330
1370
|
description: "Authentication required",
|
|
@@ -4041,6 +4081,19 @@ var UserProfileResponseSchema = import_zod_openapi43.z.object({
|
|
|
4041
4081
|
introduction: import_zod_openapi43.z.string().optional(),
|
|
4042
4082
|
hasPassword: import_zod_openapi43.z.boolean(),
|
|
4043
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(),
|
|
4044
4097
|
/**
|
|
4045
4098
|
* True when the profile update requested a new email that is awaiting
|
|
4046
4099
|
* confirmation: the stored `email` is unchanged and a confirmation
|
|
@@ -6410,23 +6463,404 @@ var tokenAuthRoutes = {
|
|
|
6410
6463
|
tokenMeRoute
|
|
6411
6464
|
};
|
|
6412
6465
|
|
|
6413
|
-
// src/contracts/
|
|
6466
|
+
// src/contracts/federated-auth.ts
|
|
6414
6467
|
var import_zod_openapi67 = require("@hono/zod-openapi");
|
|
6415
6468
|
|
|
6416
|
-
// src/schemas/
|
|
6469
|
+
// src/schemas/federated-auth.ts
|
|
6417
6470
|
var import_zod_openapi66 = require("@hono/zod-openapi");
|
|
6418
|
-
var
|
|
6419
|
-
|
|
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");
|
|
6849
|
+
|
|
6850
|
+
// src/schemas/invite-accept.ts
|
|
6851
|
+
var import_zod_openapi70 = require("@hono/zod-openapi");
|
|
6852
|
+
var InviteAcceptRequestSchema = import_zod_openapi70.z.object({
|
|
6853
|
+
token: import_zod_openapi70.z.string(),
|
|
6420
6854
|
username: UsernameSchema,
|
|
6421
|
-
name:
|
|
6422
|
-
password:
|
|
6855
|
+
name: import_zod_openapi70.z.string().min(1),
|
|
6856
|
+
password: import_zod_openapi70.z.string().min(6)
|
|
6423
6857
|
});
|
|
6424
|
-
var InvitePreviewResponseSchema =
|
|
6425
|
-
email:
|
|
6858
|
+
var InvitePreviewResponseSchema = import_zod_openapi70.z.object({
|
|
6859
|
+
email: import_zod_openapi70.z.string().email()
|
|
6426
6860
|
});
|
|
6427
6861
|
|
|
6428
6862
|
// src/contracts/invite-accept.ts
|
|
6429
|
-
var invitePreviewRoute = (0,
|
|
6863
|
+
var invitePreviewRoute = (0, import_zod_openapi71.createRoute)({
|
|
6430
6864
|
method: "get",
|
|
6431
6865
|
path: "/invite/accept",
|
|
6432
6866
|
tags: ["inviteAccept"],
|
|
@@ -6453,7 +6887,7 @@ var invitePreviewRoute = (0, import_zod_openapi67.createRoute)({
|
|
|
6453
6887
|
}
|
|
6454
6888
|
}
|
|
6455
6889
|
});
|
|
6456
|
-
var acceptInviteRoute = (0,
|
|
6890
|
+
var acceptInviteRoute = (0, import_zod_openapi71.createRoute)({
|
|
6457
6891
|
method: "post",
|
|
6458
6892
|
path: "/invite/accept",
|
|
6459
6893
|
tags: ["inviteAccept"],
|
|
@@ -6496,23 +6930,23 @@ var inviteAcceptRoutes = {
|
|
|
6496
6930
|
};
|
|
6497
6931
|
|
|
6498
6932
|
// src/contracts/password-reset.ts
|
|
6499
|
-
var
|
|
6933
|
+
var import_zod_openapi73 = require("@hono/zod-openapi");
|
|
6500
6934
|
|
|
6501
6935
|
// src/schemas/password-reset.ts
|
|
6502
|
-
var
|
|
6503
|
-
var ForgotPasswordRequestSchema =
|
|
6504
|
-
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()
|
|
6505
6939
|
});
|
|
6506
|
-
var ForgotPasswordResponseSchema =
|
|
6507
|
-
ok:
|
|
6940
|
+
var ForgotPasswordResponseSchema = import_zod_openapi72.z.object({
|
|
6941
|
+
ok: import_zod_openapi72.z.literal(true)
|
|
6508
6942
|
});
|
|
6509
|
-
var ResetPasswordRequestSchema =
|
|
6510
|
-
token:
|
|
6511
|
-
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)
|
|
6512
6946
|
});
|
|
6513
6947
|
|
|
6514
6948
|
// src/contracts/password-reset.ts
|
|
6515
|
-
var forgotPasswordRoute = (0,
|
|
6949
|
+
var forgotPasswordRoute = (0, import_zod_openapi73.createRoute)({
|
|
6516
6950
|
method: "post",
|
|
6517
6951
|
path: "/auth/forgot-password",
|
|
6518
6952
|
tags: ["passwordReset"],
|
|
@@ -6537,7 +6971,7 @@ var forgotPasswordRoute = (0, import_zod_openapi69.createRoute)({
|
|
|
6537
6971
|
}
|
|
6538
6972
|
}
|
|
6539
6973
|
});
|
|
6540
|
-
var validateResetTokenRoute = (0,
|
|
6974
|
+
var validateResetTokenRoute = (0, import_zod_openapi73.createRoute)({
|
|
6541
6975
|
method: "get",
|
|
6542
6976
|
path: "/auth/reset-password",
|
|
6543
6977
|
tags: ["passwordReset"],
|
|
@@ -6560,7 +6994,7 @@ var validateResetTokenRoute = (0, import_zod_openapi69.createRoute)({
|
|
|
6560
6994
|
}
|
|
6561
6995
|
}
|
|
6562
6996
|
});
|
|
6563
|
-
var selfResetPasswordRoute = (0,
|
|
6997
|
+
var selfResetPasswordRoute = (0, import_zod_openapi73.createRoute)({
|
|
6564
6998
|
method: "post",
|
|
6565
6999
|
path: "/auth/reset-password",
|
|
6566
7000
|
tags: ["passwordReset"],
|
|
@@ -6600,19 +7034,19 @@ var passwordResetRoutes = {
|
|
|
6600
7034
|
};
|
|
6601
7035
|
|
|
6602
7036
|
// src/contracts/activation.ts
|
|
6603
|
-
var
|
|
7037
|
+
var import_zod_openapi75 = require("@hono/zod-openapi");
|
|
6604
7038
|
|
|
6605
7039
|
// src/schemas/activation.ts
|
|
6606
|
-
var
|
|
6607
|
-
var ActivateRequestSchema =
|
|
6608
|
-
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()
|
|
6609
7043
|
});
|
|
6610
|
-
var ActivateValidationResponseSchema =
|
|
6611
|
-
ok:
|
|
7044
|
+
var ActivateValidationResponseSchema = import_zod_openapi74.z.object({
|
|
7045
|
+
ok: import_zod_openapi74.z.literal(true)
|
|
6612
7046
|
});
|
|
6613
7047
|
|
|
6614
7048
|
// src/contracts/activation.ts
|
|
6615
|
-
var validateActivationTokenRoute = (0,
|
|
7049
|
+
var validateActivationTokenRoute = (0, import_zod_openapi75.createRoute)({
|
|
6616
7050
|
method: "get",
|
|
6617
7051
|
path: "/auth/activate",
|
|
6618
7052
|
tags: ["activation"],
|
|
@@ -6635,7 +7069,7 @@ var validateActivationTokenRoute = (0, import_zod_openapi71.createRoute)({
|
|
|
6635
7069
|
}
|
|
6636
7070
|
}
|
|
6637
7071
|
});
|
|
6638
|
-
var activateAccountRoute = (0,
|
|
7072
|
+
var activateAccountRoute = (0, import_zod_openapi75.createRoute)({
|
|
6639
7073
|
method: "post",
|
|
6640
7074
|
path: "/auth/activate",
|
|
6641
7075
|
tags: ["activation"],
|
|
@@ -6670,21 +7104,21 @@ var activationRoutes = {
|
|
|
6670
7104
|
};
|
|
6671
7105
|
|
|
6672
7106
|
// src/contracts/email-change.ts
|
|
6673
|
-
var
|
|
7107
|
+
var import_zod_openapi77 = require("@hono/zod-openapi");
|
|
6674
7108
|
|
|
6675
7109
|
// src/schemas/email-change.ts
|
|
6676
|
-
var
|
|
6677
|
-
var ConfirmEmailChangeRequestSchema =
|
|
6678
|
-
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()
|
|
6679
7113
|
});
|
|
6680
|
-
var ConfirmEmailChangeResponseSchema =
|
|
6681
|
-
ok:
|
|
7114
|
+
var ConfirmEmailChangeResponseSchema = import_zod_openapi76.z.object({
|
|
7115
|
+
ok: import_zod_openapi76.z.literal(true),
|
|
6682
7116
|
/** The newly-confirmed email address. */
|
|
6683
|
-
email:
|
|
7117
|
+
email: import_zod_openapi76.z.string().email()
|
|
6684
7118
|
});
|
|
6685
7119
|
|
|
6686
7120
|
// src/contracts/email-change.ts
|
|
6687
|
-
var validateEmailChangeTokenRoute = (0,
|
|
7121
|
+
var validateEmailChangeTokenRoute = (0, import_zod_openapi77.createRoute)({
|
|
6688
7122
|
method: "get",
|
|
6689
7123
|
path: "/auth/confirm-email-change",
|
|
6690
7124
|
tags: ["emailChange"],
|
|
@@ -6707,7 +7141,7 @@ var validateEmailChangeTokenRoute = (0, import_zod_openapi73.createRoute)({
|
|
|
6707
7141
|
}
|
|
6708
7142
|
}
|
|
6709
7143
|
});
|
|
6710
|
-
var confirmEmailChangeRoute = (0,
|
|
7144
|
+
var confirmEmailChangeRoute = (0, import_zod_openapi77.createRoute)({
|
|
6711
7145
|
method: "post",
|
|
6712
7146
|
path: "/auth/confirm-email-change",
|
|
6713
7147
|
tags: ["emailChange"],
|
|
@@ -6746,9 +7180,9 @@ var emailChangeRoutes = {
|
|
|
6746
7180
|
};
|
|
6747
7181
|
|
|
6748
7182
|
// src/contracts/user.ts
|
|
6749
|
-
var
|
|
6750
|
-
var UsernameParamSchema =
|
|
6751
|
-
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)({
|
|
6752
7186
|
method: "get",
|
|
6753
7187
|
path: "/user/{username}",
|
|
6754
7188
|
tags: ["user"],
|
|
@@ -6776,7 +7210,7 @@ var getUserPageRoute = (0, import_zod_openapi74.createRoute)({
|
|
|
6776
7210
|
}
|
|
6777
7211
|
}
|
|
6778
7212
|
});
|
|
6779
|
-
var getUserBookmarksRoute = (0,
|
|
7213
|
+
var getUserBookmarksRoute = (0, import_zod_openapi78.createRoute)({
|
|
6780
7214
|
method: "get",
|
|
6781
7215
|
path: "/user/{username}/bookmarks",
|
|
6782
7216
|
tags: ["user"],
|
|
@@ -6805,7 +7239,7 @@ var getUserBookmarksRoute = (0, import_zod_openapi74.createRoute)({
|
|
|
6805
7239
|
}
|
|
6806
7240
|
}
|
|
6807
7241
|
});
|
|
6808
|
-
var getUserPagesRoute = (0,
|
|
7242
|
+
var getUserPagesRoute = (0, import_zod_openapi78.createRoute)({
|
|
6809
7243
|
method: "get",
|
|
6810
7244
|
path: "/user/{username}/pages",
|
|
6811
7245
|
tags: ["user"],
|
|
@@ -6834,7 +7268,7 @@ var getUserPagesRoute = (0, import_zod_openapi74.createRoute)({
|
|
|
6834
7268
|
}
|
|
6835
7269
|
}
|
|
6836
7270
|
});
|
|
6837
|
-
var getUserSubpagesRoute = (0,
|
|
7271
|
+
var getUserSubpagesRoute = (0, import_zod_openapi78.createRoute)({
|
|
6838
7272
|
method: "get",
|
|
6839
7273
|
path: "/user/{username}/subpages",
|
|
6840
7274
|
tags: ["user"],
|
|
@@ -6871,7 +7305,7 @@ var getUserSubpagesRoute = (0, import_zod_openapi74.createRoute)({
|
|
|
6871
7305
|
}
|
|
6872
7306
|
}
|
|
6873
7307
|
});
|
|
6874
|
-
var listMembersRoute = (0,
|
|
7308
|
+
var listMembersRoute = (0, import_zod_openapi78.createRoute)({
|
|
6875
7309
|
method: "get",
|
|
6876
7310
|
path: "/users",
|
|
6877
7311
|
tags: ["user"],
|
|
@@ -6917,6 +7351,13 @@ var stubTokens = {
|
|
|
6917
7351
|
expiresIn: 0,
|
|
6918
7352
|
user: stubUser
|
|
6919
7353
|
};
|
|
7354
|
+
var stubProviderList = { providers: [] };
|
|
7355
|
+
var stubFederatedRegistrationSnapshot = {
|
|
7356
|
+
email: "stub@example.com",
|
|
7357
|
+
provider: "",
|
|
7358
|
+
providerLabel: "",
|
|
7359
|
+
approvalPending: false
|
|
7360
|
+
};
|
|
6920
7361
|
var stubProfile = {
|
|
6921
7362
|
id: "",
|
|
6922
7363
|
username: "",
|
|
@@ -6926,7 +7367,8 @@ var stubProfile = {
|
|
|
6926
7367
|
theme: "system",
|
|
6927
7368
|
image: null,
|
|
6928
7369
|
hasPassword: false,
|
|
6929
|
-
createdAt: ""
|
|
7370
|
+
createdAt: "",
|
|
7371
|
+
federated: false
|
|
6930
7372
|
};
|
|
6931
7373
|
var stubAccessToken = {
|
|
6932
7374
|
id: "",
|
|
@@ -7167,7 +7609,7 @@ var stubPluginConfig = { name: "", fields: [], values: {} };
|
|
|
7167
7609
|
var stubUpdatePluginConfig = { ok: true, hotReloaded: false, reconfigureFailed: false };
|
|
7168
7610
|
var stubPluginReadiness = { issues: [] };
|
|
7169
7611
|
var stubClearRenderCache = { ok: true, clearedAt: "", removedCount: 0 };
|
|
7170
|
-
var appAuthMeUserChain = new
|
|
7612
|
+
var appAuthMeUserChain = new import_zod_openapi79.OpenAPIHono().openapi(
|
|
7171
7613
|
appRoutes.getAppInfoRoute,
|
|
7172
7614
|
(c) => c.json(
|
|
7173
7615
|
{
|
|
@@ -7201,31 +7643,33 @@ var appAuthMeUserChain = new import_zod_openapi75.OpenAPIHono().openapi(
|
|
|
7201
7643
|
meRoutes.updatePasswordRoute,
|
|
7202
7644
|
(c) => c.json({ status: "ok", message: "", accessToken: "", refreshToken: "", expiresIn: 0 }, 200)
|
|
7203
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));
|
|
7204
|
-
var bookmarkBacklinkCommentRevisionChain = new
|
|
7205
|
-
var pageChain = new
|
|
7206
|
-
var lateContractApp = new
|
|
7207
|
-
var adminSettingsContractApp = new
|
|
7208
|
-
var adminUsersPluginsContractApp = new
|
|
7209
|
-
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));
|
|
7210
7654
|
var createClient = (baseUrl, options = {}) => (0, import_client.hc)(baseUrl, {
|
|
7211
7655
|
headers: options.headers,
|
|
7212
7656
|
fetch: options.fetch
|
|
7213
7657
|
});
|
|
7214
7658
|
|
|
7215
7659
|
// src/schemas/mail-token.ts
|
|
7216
|
-
var
|
|
7217
|
-
var MailTokenPurposeSchema =
|
|
7218
|
-
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({
|
|
7219
7663
|
purpose: MailTokenPurposeSchema,
|
|
7220
|
-
userId:
|
|
7664
|
+
userId: import_zod_openapi80.z.string(),
|
|
7221
7665
|
/** Target address. For `email-change` this is the NEW address. */
|
|
7222
|
-
email:
|
|
7666
|
+
email: import_zod_openapi80.z.string().email(),
|
|
7223
7667
|
/**
|
|
7224
7668
|
* For `email-change`: the account's email at issue time. The confirm
|
|
7225
7669
|
* endpoint rejects the token unless it still matches, making the token
|
|
7226
7670
|
* single-use (a stale token cannot revert a later change).
|
|
7227
7671
|
*/
|
|
7228
|
-
fromEmail:
|
|
7672
|
+
fromEmail: import_zod_openapi80.z.string().email().optional(),
|
|
7229
7673
|
/**
|
|
7230
7674
|
* For `reset`: the account's `passwordResetGeneration` at issue time.
|
|
7231
7675
|
* Consuming the link increments that counter, so the token only matches
|
|
@@ -7234,7 +7678,7 @@ var MailTokenPayloadSchema = import_zod_openapi76.z.object({
|
|
|
7234
7678
|
* schema because the other purposes don't carry it (and links minted
|
|
7235
7679
|
* before the claim existed simply no longer match).
|
|
7236
7680
|
*/
|
|
7237
|
-
resetGeneration:
|
|
7681
|
+
resetGeneration: import_zod_openapi80.z.number().int().nonnegative().optional(),
|
|
7238
7682
|
/**
|
|
7239
7683
|
* For `email-change`: the account's `authVersion` at issue time. The
|
|
7240
7684
|
* confirm endpoint requires it to still match, so a pending address change
|
|
@@ -7246,7 +7690,7 @@ var MailTokenPayloadSchema = import_zod_openapi76.z.object({
|
|
|
7246
7690
|
* semantics wanted are exactly "the session that asked for this is gone",
|
|
7247
7691
|
* and that is what every bump of it already means.
|
|
7248
7692
|
*/
|
|
7249
|
-
authVersion:
|
|
7693
|
+
authVersion: import_zod_openapi80.z.number().int().nonnegative().optional(),
|
|
7250
7694
|
/**
|
|
7251
7695
|
* For `email-change`: the account's `emailChangeGeneration` at issue time.
|
|
7252
7696
|
* Requesting a change increments it, so asking for a different address
|
|
@@ -7258,10 +7702,10 @@ var MailTokenPayloadSchema = import_zod_openapi76.z.object({
|
|
|
7258
7702
|
* Optional in the schema for the same reason as the others — links minted
|
|
7259
7703
|
* before the claim existed simply no longer match.
|
|
7260
7704
|
*/
|
|
7261
|
-
emailChangeGeneration:
|
|
7705
|
+
emailChangeGeneration: import_zod_openapi80.z.number().int().nonnegative().optional(),
|
|
7262
7706
|
// iat / exp are injected and verified by the JWT layer.
|
|
7263
|
-
iat:
|
|
7264
|
-
exp:
|
|
7707
|
+
iat: import_zod_openapi80.z.number().optional(),
|
|
7708
|
+
exp: import_zod_openapi80.z.number().optional()
|
|
7265
7709
|
});
|
|
7266
7710
|
|
|
7267
7711
|
// src/util/html-elements.ts
|
|
@@ -7477,6 +7921,8 @@ var WS_CLOSE_CODES = {
|
|
|
7477
7921
|
CommentInvalidRequestErrorSchema,
|
|
7478
7922
|
CommentNotFoundErrorSchema,
|
|
7479
7923
|
CommentSchema,
|
|
7924
|
+
ConfigReadinessIssueSchema,
|
|
7925
|
+
ConfigReadinessResponseSchema,
|
|
7480
7926
|
ConfirmEmailChangeRequestSchema,
|
|
7481
7927
|
ConfirmEmailChangeResponseSchema,
|
|
7482
7928
|
ConflictErrorSchema,
|
|
@@ -7487,6 +7933,8 @@ var WS_CLOSE_CODES = {
|
|
|
7487
7933
|
CreateAdminResponseSchema,
|
|
7488
7934
|
CreateDraftRequestSchema,
|
|
7489
7935
|
CreateDraftResponseSchema,
|
|
7936
|
+
CreateLinkGrantRequestSchema,
|
|
7937
|
+
CreateLinkGrantResponseSchema,
|
|
7490
7938
|
CreatePageRequestSchema,
|
|
7491
7939
|
CrowiCodeSidecarSchema,
|
|
7492
7940
|
CrowiDiagramNodeSchema,
|
|
@@ -7522,6 +7970,14 @@ var WS_CLOSE_CODES = {
|
|
|
7522
7970
|
EditAdminUserRequestSchema,
|
|
7523
7971
|
EncryptionNotConfiguredErrorSchema,
|
|
7524
7972
|
ErrorCodeSchema,
|
|
7973
|
+
FederatedHandoffRequestSchema,
|
|
7974
|
+
FederatedHandoffResponseSchema,
|
|
7975
|
+
FederatedProviderSchema,
|
|
7976
|
+
FederatedRegistrationActiveResultSchema,
|
|
7977
|
+
FederatedRegistrationApprovalResultSchema,
|
|
7978
|
+
FederatedRegistrationResultSchema,
|
|
7979
|
+
FederatedRegistrationSnapshotSchema,
|
|
7980
|
+
FederatedRegistrationSubmitRequestSchema,
|
|
7525
7981
|
ForbiddenErrorSchema,
|
|
7526
7982
|
ForgotPasswordRequestSchema,
|
|
7527
7983
|
ForgotPasswordResponseSchema,
|
|
@@ -7563,6 +8019,7 @@ var WS_CLOSE_CODES = {
|
|
|
7563
8019
|
LanguageSchema,
|
|
7564
8020
|
LikerSchema,
|
|
7565
8021
|
LikersResponseSchema,
|
|
8022
|
+
LinkedAuthProviderListResponseSchema,
|
|
7566
8023
|
ListAccessTokensResponseSchema,
|
|
7567
8024
|
ListAdminUsersRequestSchema,
|
|
7568
8025
|
ListAdminUsersResponseSchema,
|
|
@@ -7635,8 +8092,6 @@ var WS_CLOSE_CODES = {
|
|
|
7635
8092
|
PluginInfoSchema,
|
|
7636
8093
|
PluginNotFoundErrorSchema,
|
|
7637
8094
|
PluginReadinessFieldSchema,
|
|
7638
|
-
PluginReadinessIssueSchema,
|
|
7639
|
-
PluginReadinessResponseSchema,
|
|
7640
8095
|
PresenceClientMessageSchema,
|
|
7641
8096
|
PresenceCommentChangedMessageSchema,
|
|
7642
8097
|
PresenceHeartbeatMessageSchema,
|
|
@@ -7649,6 +8104,7 @@ var WS_CLOSE_CODES = {
|
|
|
7649
8104
|
PreviewPageRequestSchema,
|
|
7650
8105
|
PreviewPageResponseSchema,
|
|
7651
8106
|
ProfileErrorResponseSchema,
|
|
8107
|
+
ProviderListResponseSchema,
|
|
7652
8108
|
RENDERED_AST_NODE_DEFS,
|
|
7653
8109
|
RecentlyViewedPagesResponseSchema,
|
|
7654
8110
|
ReencryptResponseSchema,
|
|
@@ -7697,6 +8153,8 @@ var WS_CLOSE_CODES = {
|
|
|
7697
8153
|
SendTestMailErrorSchema,
|
|
7698
8154
|
SendTestMailRequestSchema,
|
|
7699
8155
|
SendTestMailResponseSchema,
|
|
8156
|
+
SenderProofSchema,
|
|
8157
|
+
SenderPublicJwkSchema,
|
|
7700
8158
|
SensitiveConfigEntrySchema,
|
|
7701
8159
|
ServiceUnavailableErrorSchema,
|
|
7702
8160
|
SetPageGrantRequestSchema,
|
|
@@ -7717,6 +8175,7 @@ var WS_CLOSE_CODES = {
|
|
|
7717
8175
|
TokenRequestSchema,
|
|
7718
8176
|
TokenResponseSchema,
|
|
7719
8177
|
UPLOAD_ALLOWED_MIME,
|
|
8178
|
+
UnlinkAuthProviderErrorSchema,
|
|
7720
8179
|
UpdateAdminUserEmailRequestSchema,
|
|
7721
8180
|
UpdateAppSettingsRequestSchema,
|
|
7722
8181
|
UpdateAppSettingsResponseSchema,
|
|
@@ -7780,6 +8239,7 @@ var WS_CLOSE_CODES = {
|
|
|
7780
8239
|
autocompleteUsersRoute,
|
|
7781
8240
|
backlinkRoutes,
|
|
7782
8241
|
bookmarkRoutes,
|
|
8242
|
+
callbackFederatedProviderRoute,
|
|
7783
8243
|
cancelDraftRoute,
|
|
7784
8244
|
claimPageLinkAccessRoute,
|
|
7785
8245
|
clearRenderCacheAllRoute,
|
|
@@ -7789,6 +8249,7 @@ var WS_CLOSE_CODES = {
|
|
|
7789
8249
|
confirmEmailChangeRoute,
|
|
7790
8250
|
createAccessTokenRoute,
|
|
7791
8251
|
createAdminRoute,
|
|
8252
|
+
createAuthProviderLinkGrantRoute,
|
|
7792
8253
|
createClient,
|
|
7793
8254
|
createDraftRoute,
|
|
7794
8255
|
createPageRoute,
|
|
@@ -7804,6 +8265,9 @@ var WS_CLOSE_CODES = {
|
|
|
7804
8265
|
draftRoutes,
|
|
7805
8266
|
editUserRoute,
|
|
7806
8267
|
emailChangeRoutes,
|
|
8268
|
+
federatedAuthRoutes,
|
|
8269
|
+
federatedHandoffRoute,
|
|
8270
|
+
federatedRegistrationRoutes,
|
|
7807
8271
|
forgotPasswordRoute,
|
|
7808
8272
|
getAppInfoRoute,
|
|
7809
8273
|
getAppSettingsRoute,
|
|
@@ -7813,6 +8277,7 @@ var WS_CLOSE_CODES = {
|
|
|
7813
8277
|
getBacklinksRoute,
|
|
7814
8278
|
getBookmarkRoute,
|
|
7815
8279
|
getCryptoStatusRoute,
|
|
8280
|
+
getFederatedRegistrationRoute,
|
|
7816
8281
|
getInstallerStatusRoute,
|
|
7817
8282
|
getLikersRoute,
|
|
7818
8283
|
getMailSettingsRoute,
|
|
@@ -7846,6 +8311,8 @@ var WS_CLOSE_CODES = {
|
|
|
7846
8311
|
listAttachmentsRoute,
|
|
7847
8312
|
listCommentsRoute,
|
|
7848
8313
|
listDraftsRoute,
|
|
8314
|
+
listFederatedProvidersRoute,
|
|
8315
|
+
listLinkedAuthProvidersRoute,
|
|
7849
8316
|
listMembersRoute,
|
|
7850
8317
|
listMyBookmarksRoute,
|
|
7851
8318
|
listNotificationsRoute,
|
|
@@ -7854,6 +8321,7 @@ var WS_CLOSE_CODES = {
|
|
|
7854
8321
|
listPluginsRoute,
|
|
7855
8322
|
listRevisionsRoute,
|
|
7856
8323
|
listUsersRoute,
|
|
8324
|
+
logoutFederatedRegistrationRoute,
|
|
7857
8325
|
makeAdminRoute,
|
|
7858
8326
|
markAllAsReadRoute,
|
|
7859
8327
|
meRoutes,
|
|
@@ -7890,7 +8358,9 @@ var WS_CLOSE_CODES = {
|
|
|
7890
8358
|
sendTestMailRoute,
|
|
7891
8359
|
setPageGrantRoute,
|
|
7892
8360
|
setWatchStatusRoute,
|
|
8361
|
+
startFederatedProviderRoute,
|
|
7893
8362
|
stripKnownHtmlTags,
|
|
8363
|
+
submitFederatedRegistrationRoute,
|
|
7894
8364
|
suspendUserRoute,
|
|
7895
8365
|
tokenAuthRoutes,
|
|
7896
8366
|
tokenLoginRoute,
|
|
@@ -7900,6 +8370,7 @@ var WS_CLOSE_CODES = {
|
|
|
7900
8370
|
tokenRegisterRoute,
|
|
7901
8371
|
tokenRoute,
|
|
7902
8372
|
unlikePageRoute,
|
|
8373
|
+
unlinkAuthProviderRoute,
|
|
7903
8374
|
unwrapRenderedAst,
|
|
7904
8375
|
updateAppSettingsRoute,
|
|
7905
8376
|
updateAuthSettingsRoute,
|