@crowi/api-contract 2.0.0-alpha.12 → 2.0.0-alpha.14

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/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,11 +90,14 @@ __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,
94
98
  CrowiDiagramSidecarSchema: () => CrowiDiagramSidecarSchema,
95
99
  CrowiDimensionSchema: () => CrowiDimensionSchema,
100
+ CrowiFrontmatterEntrySchema: () => CrowiFrontmatterEntrySchema,
96
101
  CrowiImagePayloadSchema: () => CrowiImagePayloadSchema,
97
102
  CrowiLinkCardNodeSchema: () => CrowiLinkCardNodeSchema,
98
103
  CrowiLinkCardSidecarSchema: () => CrowiLinkCardSidecarSchema,
@@ -123,6 +128,18 @@ __export(index_exports, {
123
128
  EditAdminUserRequestSchema: () => EditAdminUserRequestSchema,
124
129
  EncryptionNotConfiguredErrorSchema: () => EncryptionNotConfiguredErrorSchema,
125
130
  ErrorCodeSchema: () => ErrorCodeSchema,
131
+ FRONTMATTER_MAX_ENTRIES: () => FRONTMATTER_MAX_ENTRIES,
132
+ FRONTMATTER_MAX_KEY_CHARS: () => FRONTMATTER_MAX_KEY_CHARS,
133
+ FRONTMATTER_MAX_RAW_BYTES: () => FRONTMATTER_MAX_RAW_BYTES,
134
+ FRONTMATTER_MAX_VALUE_CHARS: () => FRONTMATTER_MAX_VALUE_CHARS,
135
+ FederatedHandoffRequestSchema: () => FederatedHandoffRequestSchema,
136
+ FederatedHandoffResponseSchema: () => FederatedHandoffResponseSchema,
137
+ FederatedProviderSchema: () => FederatedProviderSchema,
138
+ FederatedRegistrationActiveResultSchema: () => FederatedRegistrationActiveResultSchema,
139
+ FederatedRegistrationApprovalResultSchema: () => FederatedRegistrationApprovalResultSchema,
140
+ FederatedRegistrationResultSchema: () => FederatedRegistrationResultSchema,
141
+ FederatedRegistrationSnapshotSchema: () => FederatedRegistrationSnapshotSchema,
142
+ FederatedRegistrationSubmitRequestSchema: () => FederatedRegistrationSubmitRequestSchema,
126
143
  ForbiddenErrorSchema: () => ForbiddenErrorSchema,
127
144
  ForgotPasswordRequestSchema: () => ForgotPasswordRequestSchema,
128
145
  ForgotPasswordResponseSchema: () => ForgotPasswordResponseSchema,
@@ -164,6 +181,7 @@ __export(index_exports, {
164
181
  LanguageSchema: () => LanguageSchema,
165
182
  LikerSchema: () => LikerSchema,
166
183
  LikersResponseSchema: () => LikersResponseSchema,
184
+ LinkedAuthProviderListResponseSchema: () => LinkedAuthProviderListResponseSchema,
167
185
  ListAccessTokensResponseSchema: () => ListAccessTokensResponseSchema,
168
186
  ListAdminUsersRequestSchema: () => ListAdminUsersRequestSchema,
169
187
  ListAdminUsersResponseSchema: () => ListAdminUsersResponseSchema,
@@ -236,8 +254,6 @@ __export(index_exports, {
236
254
  PluginInfoSchema: () => PluginInfoSchema,
237
255
  PluginNotFoundErrorSchema: () => PluginNotFoundErrorSchema,
238
256
  PluginReadinessFieldSchema: () => PluginReadinessFieldSchema,
239
- PluginReadinessIssueSchema: () => PluginReadinessIssueSchema,
240
- PluginReadinessResponseSchema: () => PluginReadinessResponseSchema,
241
257
  PresenceClientMessageSchema: () => PresenceClientMessageSchema,
242
258
  PresenceCommentChangedMessageSchema: () => PresenceCommentChangedMessageSchema,
243
259
  PresenceHeartbeatMessageSchema: () => PresenceHeartbeatMessageSchema,
@@ -250,6 +266,7 @@ __export(index_exports, {
250
266
  PreviewPageRequestSchema: () => PreviewPageRequestSchema,
251
267
  PreviewPageResponseSchema: () => PreviewPageResponseSchema,
252
268
  ProfileErrorResponseSchema: () => ProfileErrorResponseSchema,
269
+ ProviderListResponseSchema: () => ProviderListResponseSchema,
253
270
  RENDERED_AST_NODE_DEFS: () => RENDERED_AST_NODE_DEFS,
254
271
  RecentlyViewedPagesResponseSchema: () => RecentlyViewedPagesResponseSchema,
255
272
  ReencryptResponseSchema: () => ReencryptResponseSchema,
@@ -298,6 +315,8 @@ __export(index_exports, {
298
315
  SendTestMailErrorSchema: () => SendTestMailErrorSchema,
299
316
  SendTestMailRequestSchema: () => SendTestMailRequestSchema,
300
317
  SendTestMailResponseSchema: () => SendTestMailResponseSchema,
318
+ SenderProofSchema: () => SenderProofSchema,
319
+ SenderPublicJwkSchema: () => SenderPublicJwkSchema,
301
320
  SensitiveConfigEntrySchema: () => SensitiveConfigEntrySchema,
302
321
  ServiceUnavailableErrorSchema: () => ServiceUnavailableErrorSchema,
303
322
  SetPageGrantRequestSchema: () => SetPageGrantRequestSchema,
@@ -318,6 +337,7 @@ __export(index_exports, {
318
337
  TokenRequestSchema: () => TokenRequestSchema,
319
338
  TokenResponseSchema: () => TokenResponseSchema,
320
339
  UPLOAD_ALLOWED_MIME: () => UPLOAD_ALLOWED_MIME,
340
+ UnlinkAuthProviderErrorSchema: () => UnlinkAuthProviderErrorSchema,
321
341
  UpdateAdminUserEmailRequestSchema: () => UpdateAdminUserEmailRequestSchema,
322
342
  UpdateAppSettingsRequestSchema: () => UpdateAppSettingsRequestSchema,
323
343
  UpdateAppSettingsResponseSchema: () => UpdateAppSettingsResponseSchema,
@@ -336,6 +356,7 @@ __export(index_exports, {
336
356
  UploadAttachmentErrorCodeSchema: () => UploadAttachmentErrorCodeSchema,
337
357
  UploadAttachmentErrorSchema: () => UploadAttachmentErrorSchema,
338
358
  UploadAttachmentResponseSchema: () => UploadAttachmentResponseSchema,
359
+ UploadPolicyResponseSchema: () => UploadPolicyResponseSchema,
339
360
  UserBookmarksResponseSchema: () => UserBookmarksResponseSchema,
340
361
  UserLanguageSchema: () => UserLanguageSchema,
341
362
  UserListItemSchema: () => UserListItemSchema,
@@ -381,6 +402,7 @@ __export(index_exports, {
381
402
  autocompleteUsersRoute: () => autocompleteUsersRoute,
382
403
  backlinkRoutes: () => backlinkRoutes,
383
404
  bookmarkRoutes: () => bookmarkRoutes,
405
+ callbackFederatedProviderRoute: () => callbackFederatedProviderRoute,
384
406
  cancelDraftRoute: () => cancelDraftRoute,
385
407
  claimPageLinkAccessRoute: () => claimPageLinkAccessRoute,
386
408
  clearRenderCacheAllRoute: () => clearRenderCacheAllRoute,
@@ -390,6 +412,7 @@ __export(index_exports, {
390
412
  confirmEmailChangeRoute: () => confirmEmailChangeRoute,
391
413
  createAccessTokenRoute: () => createAccessTokenRoute,
392
414
  createAdminRoute: () => createAdminRoute,
415
+ createAuthProviderLinkGrantRoute: () => createAuthProviderLinkGrantRoute,
393
416
  createClient: () => createClient,
394
417
  createDraftRoute: () => createDraftRoute,
395
418
  createPageRoute: () => createPageRoute,
@@ -405,6 +428,9 @@ __export(index_exports, {
405
428
  draftRoutes: () => draftRoutes,
406
429
  editUserRoute: () => editUserRoute,
407
430
  emailChangeRoutes: () => emailChangeRoutes,
431
+ federatedAuthRoutes: () => federatedAuthRoutes,
432
+ federatedHandoffRoute: () => federatedHandoffRoute,
433
+ federatedRegistrationRoutes: () => federatedRegistrationRoutes,
408
434
  forgotPasswordRoute: () => forgotPasswordRoute,
409
435
  getAppInfoRoute: () => getAppInfoRoute,
410
436
  getAppSettingsRoute: () => getAppSettingsRoute,
@@ -414,6 +440,7 @@ __export(index_exports, {
414
440
  getBacklinksRoute: () => getBacklinksRoute,
415
441
  getBookmarkRoute: () => getBookmarkRoute,
416
442
  getCryptoStatusRoute: () => getCryptoStatusRoute,
443
+ getFederatedRegistrationRoute: () => getFederatedRegistrationRoute,
417
444
  getInstallerStatusRoute: () => getInstallerStatusRoute,
418
445
  getLikersRoute: () => getLikersRoute,
419
446
  getMailSettingsRoute: () => getMailSettingsRoute,
@@ -430,6 +457,7 @@ __export(index_exports, {
430
457
  getSeenUsersRoute: () => getSeenUsersRoute,
431
458
  getStorageStatusRoute: () => getStorageStatusRoute,
432
459
  getUnreadCountRoute: () => getUnreadCountRoute,
460
+ getUploadPolicyRoute: () => getUploadPolicyRoute,
433
461
  getUserBookmarksRoute: () => getUserBookmarksRoute,
434
462
  getUserPageRoute: () => getUserPageRoute,
435
463
  getUserPagesRoute: () => getUserPagesRoute,
@@ -447,6 +475,8 @@ __export(index_exports, {
447
475
  listAttachmentsRoute: () => listAttachmentsRoute,
448
476
  listCommentsRoute: () => listCommentsRoute,
449
477
  listDraftsRoute: () => listDraftsRoute,
478
+ listFederatedProvidersRoute: () => listFederatedProvidersRoute,
479
+ listLinkedAuthProvidersRoute: () => listLinkedAuthProvidersRoute,
450
480
  listMembersRoute: () => listMembersRoute,
451
481
  listMyBookmarksRoute: () => listMyBookmarksRoute,
452
482
  listNotificationsRoute: () => listNotificationsRoute,
@@ -455,6 +485,7 @@ __export(index_exports, {
455
485
  listPluginsRoute: () => listPluginsRoute,
456
486
  listRevisionsRoute: () => listRevisionsRoute,
457
487
  listUsersRoute: () => listUsersRoute,
488
+ logoutFederatedRegistrationRoute: () => logoutFederatedRegistrationRoute,
458
489
  makeAdminRoute: () => makeAdminRoute,
459
490
  markAllAsReadRoute: () => markAllAsReadRoute,
460
491
  meRoutes: () => meRoutes,
@@ -491,7 +522,9 @@ __export(index_exports, {
491
522
  sendTestMailRoute: () => sendTestMailRoute,
492
523
  setPageGrantRoute: () => setPageGrantRoute,
493
524
  setWatchStatusRoute: () => setWatchStatusRoute,
525
+ startFederatedProviderRoute: () => startFederatedProviderRoute,
494
526
  stripKnownHtmlTags: () => stripKnownHtmlTags,
527
+ submitFederatedRegistrationRoute: () => submitFederatedRegistrationRoute,
495
528
  suspendUserRoute: () => suspendUserRoute,
496
529
  tokenAuthRoutes: () => tokenAuthRoutes,
497
530
  tokenLoginRoute: () => tokenLoginRoute,
@@ -501,6 +534,7 @@ __export(index_exports, {
501
534
  tokenRegisterRoute: () => tokenRegisterRoute,
502
535
  tokenRoute: () => tokenRoute,
503
536
  unlikePageRoute: () => unlikePageRoute,
537
+ unlinkAuthProviderRoute: () => unlinkAuthProviderRoute,
504
538
  unwrapRenderedAst: () => unwrapRenderedAst,
505
539
  updateAppSettingsRoute: () => updateAppSettingsRoute,
506
540
  updateAuthSettingsRoute: () => updateAuthSettingsRoute,
@@ -522,7 +556,7 @@ __export(index_exports, {
522
556
  module.exports = __toCommonJS(index_exports);
523
557
 
524
558
  // src/client.ts
525
- var import_zod_openapi75 = require("@hono/zod-openapi");
559
+ var import_zod_openapi79 = require("@hono/zod-openapi");
526
560
  var import_client = require("hono/client");
527
561
 
528
562
  // src/contracts/admin/app.ts
@@ -628,8 +662,12 @@ var ERROR_CODES = [
628
662
  "INVALID_CREDENTIALS",
629
663
  "REFRESH_TOKEN_REQUIRED",
630
664
  "REGISTRATION_CLOSED",
665
+ // --- federated sign-in (RFC-0014) ---
666
+ "FEDERATED_HANDOFF_INVALID",
667
+ "FEDERATED_HANDOFF_CONSUMED",
631
668
  // --- admin subsystems ---
632
669
  "ENCRYPTION_NOT_CONFIGURED",
670
+ "MAIL_FROM_NOT_CONFIGURED",
633
671
  "MAIL_TEST_FAILED",
634
672
  "PLUGIN_NOT_FOUND",
635
673
  "PLUGIN_CONFIG_VALIDATION_FAILED"
@@ -910,10 +948,16 @@ var SendTestMailResponseSchema = import_zod_openapi7.z.object({
910
948
  to: import_zod_openapi7.z.string()
911
949
  });
912
950
  var SendTestMailErrorSchema = import_zod_openapi7.z.object({
913
- error: import_zod_openapi7.z.object({
914
- code: import_zod_openapi7.z.literal("MAIL_TEST_FAILED"),
915
- message: import_zod_openapi7.z.string()
916
- })
951
+ error: import_zod_openapi7.z.discriminatedUnion("code", [
952
+ import_zod_openapi7.z.object({
953
+ code: import_zod_openapi7.z.literal("MAIL_FROM_NOT_CONFIGURED"),
954
+ message: import_zod_openapi7.z.literal("The mail sender address is not configured.")
955
+ }),
956
+ import_zod_openapi7.z.object({
957
+ code: import_zod_openapi7.z.literal("MAIL_TEST_FAILED"),
958
+ 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"])
959
+ })
960
+ ])
917
961
  });
918
962
  var MailSettingsValidationErrorSchema = import_zod_openapi7.z.object({
919
963
  bodyResult: import_zod_openapi7.z.object({
@@ -1026,7 +1070,7 @@ var sendTestMailRoute = (0, import_zod_openapi8.createRoute)({
1026
1070
  content: { "application/json": { schema: AdminRequiredErrorSchema } }
1027
1071
  },
1028
1072
  502: {
1029
- description: "Test mail dispatch failed (SMTP error)",
1073
+ description: "Test mail dispatch failed (mail dispatch failure \u2014 e.g. sender/transport error, or the mail sender address is not configured)",
1030
1074
  content: { "application/json": { schema: SendTestMailErrorSchema } }
1031
1075
  }
1032
1076
  }
@@ -1176,13 +1220,16 @@ var PluginReadinessFieldSchema = import_zod_openapi9.z.object({
1176
1220
  name: import_zod_openapi9.z.string(),
1177
1221
  configured: import_zod_openapi9.z.literal(false)
1178
1222
  });
1179
- var PluginReadinessIssueSchema = import_zod_openapi9.z.object({
1180
- name: import_zod_openapi9.z.string(),
1181
- adminPlacement: PluginAdminPlacementSchema,
1223
+ var ConfigReadinessIssueSchema = import_zod_openapi9.z.object({
1224
+ /** Stable id — `plugin:<name>` or a core declaration id (e.g. `core:mail`). */
1225
+ id: import_zod_openapi9.z.string(),
1226
+ source: import_zod_openapi9.z.enum(["plugin", "core"]),
1227
+ label: import_zod_openapi9.z.string(),
1228
+ href: import_zod_openapi9.z.string(),
1182
1229
  fields: import_zod_openapi9.z.array(PluginReadinessFieldSchema)
1183
1230
  });
1184
- var PluginReadinessResponseSchema = import_zod_openapi9.z.object({
1185
- issues: import_zod_openapi9.z.array(PluginReadinessIssueSchema)
1231
+ var ConfigReadinessResponseSchema = import_zod_openapi9.z.object({
1232
+ issues: import_zod_openapi9.z.array(ConfigReadinessIssueSchema)
1186
1233
  });
1187
1234
 
1188
1235
  // src/contracts/admin/plugins.ts
@@ -1320,11 +1367,11 @@ var getPluginReadinessRoute = (0, import_zod_openapi10.createRoute)({
1320
1367
  path: "/admin/plugins/readiness",
1321
1368
  tags: ["admin.plugins"],
1322
1369
  security: [{ bearerAuth: [] }],
1323
- summary: "List active plugins missing required readiness config fields",
1370
+ summary: "List active plugins and core config missing required readiness fields",
1324
1371
  responses: {
1325
1372
  200: {
1326
- description: "Readiness issues for active plugins (empty when everything is configured)",
1327
- content: { "application/json": { schema: PluginReadinessResponseSchema } }
1373
+ description: "Readiness issues for active plugins and core config (empty when everything is configured)",
1374
+ content: { "application/json": { schema: ConfigReadinessResponseSchema } }
1328
1375
  },
1329
1376
  401: {
1330
1377
  description: "Authentication required",
@@ -2324,6 +2371,17 @@ var UPLOAD_ALLOWED_MIME = [
2324
2371
  // Unknown / unset — see the note above.
2325
2372
  "application/octet-stream"
2326
2373
  ];
2374
+ var UploadPolicyResponseSchema = import_zod_openapi24.z.object({
2375
+ allowedMimeTypes: import_zod_openapi24.z.array(import_zod_openapi24.z.string()),
2376
+ extensionHints: import_zod_openapi24.z.record(import_zod_openapi24.z.string(), import_zod_openapi24.z.string()),
2377
+ maxBytes: import_zod_openapi24.z.object({
2378
+ attachment: import_zod_openapi24.z.number()
2379
+ }),
2380
+ profilePicture: import_zod_openapi24.z.object({
2381
+ allowedMimeTypes: import_zod_openapi24.z.array(import_zod_openapi24.z.string()),
2382
+ maxBytes: import_zod_openapi24.z.number()
2383
+ })
2384
+ });
2327
2385
 
2328
2386
  // src/contracts/attachment.ts
2329
2387
  var PageIdPathParamsSchema = import_zod_openapi25.z.object({
@@ -2337,8 +2395,7 @@ var AddAttachmentBodySchema = import_zod_openapi25.z.object({
2337
2395
  });
2338
2396
  var UploadAttachmentBodySchema = import_zod_openapi25.z.object({
2339
2397
  file: import_zod_openapi25.z.any().openapi({ type: "string", format: "binary" }).optional(),
2340
- pageId: import_zod_openapi25.z.string().optional(),
2341
- intent: import_zod_openapi25.z.string().optional().openapi({ enum: ["paste", "dnd"] })
2398
+ pageId: import_zod_openapi25.z.string().optional()
2342
2399
  });
2343
2400
  var listAttachmentsRoute = (0, import_zod_openapi25.createRoute)({
2344
2401
  method: "get",
@@ -2508,7 +2565,7 @@ var uploadAttachmentRoute = (0, import_zod_openapi25.createRoute)({
2508
2565
  content: { "application/json": { schema: UploadAttachmentErrorSchema } }
2509
2566
  },
2510
2567
  413: {
2511
- description: "Body exceeds the per-intent size cap",
2568
+ description: "Body exceeds the unified upload size cap",
2512
2569
  content: { "application/json": { schema: UploadAttachmentErrorSchema } }
2513
2570
  },
2514
2571
  415: {
@@ -2561,6 +2618,23 @@ var removeAttachmentRoute = (0, import_zod_openapi25.createRoute)({
2561
2618
  }
2562
2619
  }
2563
2620
  });
2621
+ var getUploadPolicyRoute = (0, import_zod_openapi25.createRoute)({
2622
+ method: "get",
2623
+ path: "/attachments/upload-policy",
2624
+ tags: ["attachment"],
2625
+ security: [{ bearerAuth: [] }],
2626
+ summary: "Get the server upload policy (allowed MIME types, extension hints, size limits)",
2627
+ responses: {
2628
+ 200: {
2629
+ description: "Current upload policy, derived from server-side constants (never a value maintained separately)",
2630
+ content: { "application/json": { schema: UploadPolicyResponseSchema } }
2631
+ },
2632
+ 401: {
2633
+ description: "Authentication required",
2634
+ content: { "application/json": { schema: AuthenticationRequiredErrorSchema } }
2635
+ }
2636
+ }
2637
+ });
2564
2638
  var attachmentRoutes = {
2565
2639
  // `/pages/{pageId}/attachments/usage` MUST register before
2566
2640
  // `/pages/{pageId}/attachments` so the literal `/usage` suffix wins;
@@ -2572,7 +2646,8 @@ var attachmentRoutes = {
2572
2646
  addAttachmentRoute,
2573
2647
  uploadAttachmentRoute,
2574
2648
  getAttachmentMetaRoute,
2575
- removeAttachmentRoute
2649
+ removeAttachmentRoute,
2650
+ getUploadPolicyRoute
2576
2651
  };
2577
2652
 
2578
2653
  // src/contracts/autocomplete.ts
@@ -2924,6 +2999,17 @@ var crowiOpaqueFields = import_zod_openapi30.z.object({
2924
2999
  /** Best-effort diagnostics only — never a rendering hint. Truncated to 64 chars before assignment. */
2925
3000
  originalType: import_zod_openapi30.z.string().max(64).optional()
2926
3001
  });
3002
+ var FRONTMATTER_MAX_ENTRIES = 50;
3003
+ var FRONTMATTER_MAX_KEY_CHARS = 100;
3004
+ var FRONTMATTER_MAX_VALUE_CHARS = 300;
3005
+ var FRONTMATTER_MAX_RAW_BYTES = 8 * 1024;
3006
+ var CrowiFrontmatterEntrySchema = import_zod_openapi30.z.object({
3007
+ key: import_zod_openapi30.z.string().max(FRONTMATTER_MAX_KEY_CHARS),
3008
+ value: import_zod_openapi30.z.string().max(FRONTMATTER_MAX_VALUE_CHARS)
3009
+ });
3010
+ var crowiFrontmatterFields = import_zod_openapi30.z.object({
3011
+ entries: import_zod_openapi30.z.array(CrowiFrontmatterEntrySchema).max(FRONTMATTER_MAX_ENTRIES)
3012
+ });
2927
3013
  var RENDERED_AST_NODE_DEFS = {
2928
3014
  root: { placement: "flow", childModel: "flow", fields: noFields },
2929
3015
  paragraph: { placement: "flow", childModel: "phrasing", fields: noFields },
@@ -2952,10 +3038,12 @@ var RENDERED_AST_NODE_DEFS = {
2952
3038
  footnoteReference: { placement: "phrasing", childModel: "none", fields: footnoteReferenceFields },
2953
3039
  linkReference: { placement: "phrasing", childModel: "phrasing", fields: linkReferenceFields },
2954
3040
  imageReference: { placement: "phrasing", childModel: "none", fields: imageReferenceFields },
2955
- // Crowi-owned types. `crowiFigure` is the only one that also appears
2956
- // in stored ASTs; the other three only exist as projection outputs
2957
- // (or as defensively-validated plugin-injected nodes).
3041
+ // Crowi-owned types. `crowiFigure` / `crowiFrontmatter` are the only
3042
+ // ones that also appear in stored ASTs directly (a core transform
3043
+ // writes them at save time); the other three only exist as projection
3044
+ // outputs (or as defensively-validated plugin-injected nodes).
2958
3045
  crowiFigure: { placement: "flow", childModel: "phrasing", fields: noFields },
3046
+ crowiFrontmatter: { placement: "flow", childModel: "none", fields: crowiFrontmatterFields },
2959
3047
  crowiDiagram: { placement: "flow", childModel: "none", fields: CrowiDiagramSidecarSchema },
2960
3048
  crowiLinkCard: { placement: "flow", childModel: "none", fields: CrowiLinkCardSidecarSchema },
2961
3049
  crowiPlaceholder: { placement: "both", childModel: "none", fields: CrowiPlaceholderSidecarSchema },
@@ -2991,6 +3079,7 @@ var RenderedAstNodeSchema = import_zod_openapi30.z.lazy(
2991
3079
  LinkReferenceNodeSchema,
2992
3080
  ImageReferenceNodeSchema,
2993
3081
  CrowiFigureNodeSchema,
3082
+ CrowiFrontmatterNodeSchema,
2994
3083
  CrowiDiagramNodeSchema,
2995
3084
  CrowiLinkCardNodeSchema,
2996
3085
  CrowiPlaceholderNodeSchema,
@@ -3039,6 +3128,7 @@ var CrowiFigureNodeSchema = import_zod_openapi30.z.object({
3039
3128
  data: HastHintDataSchema.extend({ hName: import_zod_openapi30.z.literal("figure"), hProperties: HPropertiesSchema }),
3040
3129
  children: childrenSchema
3041
3130
  });
3131
+ var CrowiFrontmatterNodeSchema = crowiFrontmatterFields.extend({ type: import_zod_openapi30.z.literal("crowiFrontmatter"), data: dataSchema });
3042
3132
  var CrowiDiagramNodeSchema = CrowiDiagramSidecarSchema.extend({ type: import_zod_openapi30.z.literal("crowiDiagram"), data: dataSchema });
3043
3133
  var CrowiLinkCardNodeSchema = CrowiLinkCardSidecarSchema.extend({ type: import_zod_openapi30.z.literal("crowiLinkCard"), data: dataSchema });
3044
3134
  var CrowiPlaceholderNodeSchema = CrowiPlaceholderSidecarSchema.extend({ type: import_zod_openapi30.z.literal("crowiPlaceholder"), data: dataSchema });
@@ -4041,6 +4131,19 @@ var UserProfileResponseSchema = import_zod_openapi43.z.object({
4041
4131
  introduction: import_zod_openapi43.z.string().optional(),
4042
4132
  hasPassword: import_zod_openapi43.z.boolean(),
4043
4133
  createdAt: import_zod_openapi43.z.string(),
4134
+ /**
4135
+ * True when the account has at least one linked federated identity
4136
+ * (`UserIdentity` row). The email address on a federated account is
4137
+ * fixed to the value the identity provider verified — `PUT /me`
4138
+ * refuses a change and returns `EMAIL_LOCKED_BY_FEDERATED_IDENTITY`
4139
+ * when this is true and a different email is submitted. The web uses
4140
+ * this to disable the email field and point to the Security tab.
4141
+ *
4142
+ * Always reflects the account's current state — on `GET /me` and on
4143
+ * every 200 from `PUT /me`, including a `PUT` that changed only name /
4144
+ * lang.
4145
+ */
4146
+ federated: import_zod_openapi43.z.boolean(),
4044
4147
  /**
4045
4148
  * True when the profile update requested a new email that is awaiting
4046
4149
  * confirmation: the stored `email` is unchanged and a confirmation
@@ -6410,23 +6513,404 @@ var tokenAuthRoutes = {
6410
6513
  tokenMeRoute
6411
6514
  };
6412
6515
 
6413
- // src/contracts/invite-accept.ts
6516
+ // src/contracts/federated-auth.ts
6414
6517
  var import_zod_openapi67 = require("@hono/zod-openapi");
6415
6518
 
6416
- // src/schemas/invite-accept.ts
6519
+ // src/schemas/federated-auth.ts
6417
6520
  var import_zod_openapi66 = require("@hono/zod-openapi");
6418
- var InviteAcceptRequestSchema = import_zod_openapi66.z.object({
6419
- token: import_zod_openapi66.z.string(),
6521
+ var FederatedProviderSchema = import_zod_openapi66.z.object({
6522
+ name: import_zod_openapi66.z.string(),
6523
+ buttonLabel: import_zod_openapi66.z.string(),
6524
+ iconUrl: import_zod_openapi66.z.string().optional()
6525
+ });
6526
+ var ProviderListResponseSchema = import_zod_openapi66.z.object({
6527
+ providers: import_zod_openapi66.z.array(FederatedProviderSchema)
6528
+ });
6529
+ var SenderPublicJwkSchema = import_zod_openapi66.z.object({
6530
+ kty: import_zod_openapi66.z.literal("EC"),
6531
+ crv: import_zod_openapi66.z.literal("P-256"),
6532
+ x: import_zod_openapi66.z.string(),
6533
+ y: import_zod_openapi66.z.string()
6534
+ });
6535
+ var SenderProofSchema = import_zod_openapi66.z.object({
6536
+ publicJwk: SenderPublicJwkSchema,
6537
+ /** base64url ES256 signature over the canonical handoff message. */
6538
+ signature: import_zod_openapi66.z.string()
6539
+ });
6540
+ var FederatedHandoffRequestSchema = import_zod_openapi66.z.object({
6541
+ code: import_zod_openapi66.z.string(),
6542
+ proof: SenderProofSchema
6543
+ });
6544
+ var FederatedHandoffResponseSchema = TokenAuthResponseSchema;
6545
+ var LinkedAuthProviderListResponseSchema = import_zod_openapi66.z.object({
6546
+ identities: import_zod_openapi66.z.array(import_zod_openapi66.z.object({ provider: import_zod_openapi66.z.string() }))
6547
+ });
6548
+ var CreateLinkGrantRequestSchema = import_zod_openapi66.z.object({
6549
+ /** RFC 7638 thumbprint of the P-256 public key this browser will use at `/start` — binds the grant to this browser (AC-2). */
6550
+ handoffChallenge: import_zod_openapi66.z.string().min(1)
6551
+ });
6552
+ var CreateLinkGrantResponseSchema = import_zod_openapi66.z.object({
6553
+ linkGrant: import_zod_openapi66.z.string()
6554
+ });
6555
+ var UnlinkAuthProviderErrorSchema = import_zod_openapi66.z.object({
6556
+ error: import_zod_openapi66.z.object({
6557
+ code: import_zod_openapi66.z.enum(["FEDERATED_UNLINK_DISABLED", "PASSWORD_REQUIRED"]),
6558
+ message: import_zod_openapi66.z.string()
6559
+ })
6560
+ });
6561
+
6562
+ // src/contracts/federated-auth.ts
6563
+ 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");
6564
+ var listFederatedProvidersRoute = (0, import_zod_openapi67.createRoute)({
6565
+ method: "get",
6566
+ path: "/auth/providers",
6567
+ tags: ["federatedAuth"],
6568
+ summary: "List enabled OAuth2/OIDC federated sign-in providers",
6569
+ responses: {
6570
+ 200: {
6571
+ description: "Enabled providers, in name order",
6572
+ content: { "application/json": { schema: ProviderListResponseSchema } }
6573
+ },
6574
+ 500: {
6575
+ description: "Internal server error",
6576
+ content: { "application/json": { schema: InternalServerErrorSchema } }
6577
+ }
6578
+ }
6579
+ });
6580
+ var startFederatedProviderRoute = (0, import_zod_openapi67.createRoute)({
6581
+ method: "get",
6582
+ path: "/auth/providers/{name}/start",
6583
+ tags: ["federatedAuth"],
6584
+ summary: "Top-level navigation that redirects the browser to the named provider",
6585
+ request: {
6586
+ params: import_zod_openapi67.z.object({ name: import_zod_openapi67.z.string() }),
6587
+ query: import_zod_openapi67.z.object({
6588
+ continue: ContinuePathSchema,
6589
+ /** base64url(JSON) of the sender's P-256 public JWK. */
6590
+ handoff_jwk: import_zod_openapi67.z.string().min(1),
6591
+ /** base64url ES256 signature over the start canonical message. */
6592
+ handoff_proof: import_zod_openapi67.z.string().min(1),
6593
+ /**
6594
+ * RFC-0014 phase 3 — `'1'` switches this start into LINK mode: the
6595
+ * request must carry a web-session JWT, and the flow attaches the
6596
+ * resulting identity to that session's user instead of signing
6597
+ * anyone in. Absent (the ordinary sign-in start) the route stays
6598
+ * fully public.
6599
+ */
6600
+ link: import_zod_openapi67.z.literal("1").optional(),
6601
+ /** The opaque id from `POST /auth/providers/{name}/link-grants`. Required when `link=1`, ignored otherwise. */
6602
+ link_grant: import_zod_openapi67.z.string().min(1).optional()
6603
+ })
6604
+ },
6605
+ responses: {
6606
+ 302: { description: "Redirect to the provider authorization endpoint" },
6607
+ 400: {
6608
+ description: "Malformed continue / sender proof, or an invalid/expired/mismatched link grant",
6609
+ content: { "application/json": { schema: ApiErrorSchema } }
6610
+ },
6611
+ 401: {
6612
+ description: "link=1 without a web-session JWT \u2014 never downgraded to the public sign-in start",
6613
+ content: { "application/json": { schema: ApiErrorSchema } }
6614
+ },
6615
+ 403: {
6616
+ description: "link=1 with a non-web credential (PAT / OAuth access token)",
6617
+ content: { "application/json": { schema: ApiErrorSchema } }
6618
+ },
6619
+ 404: {
6620
+ description: "Unknown, unconfigured, or credential-kind provider",
6621
+ content: { "application/json": { schema: ApiErrorSchema } }
6622
+ },
6623
+ 500: {
6624
+ description: "Internal server error",
6625
+ content: { "application/json": { schema: InternalServerErrorSchema } }
6626
+ }
6627
+ }
6628
+ });
6629
+ var listLinkedAuthProvidersRoute = (0, import_zod_openapi67.createRoute)({
6630
+ method: "get",
6631
+ path: "/auth/providers/identities",
6632
+ tags: ["federatedAuth"],
6633
+ summary: "List the provider slugs the current user has linked",
6634
+ responses: {
6635
+ 200: {
6636
+ description: "Linked provider slugs, in name order",
6637
+ content: { "application/json": { schema: LinkedAuthProviderListResponseSchema } }
6638
+ },
6639
+ 401: {
6640
+ description: "Authentication required",
6641
+ content: { "application/json": { schema: AuthenticationRequiredErrorSchema } }
6642
+ },
6643
+ 500: {
6644
+ description: "Internal server error",
6645
+ content: { "application/json": { schema: InternalServerErrorSchema } }
6646
+ }
6647
+ }
6648
+ });
6649
+ var createAuthProviderLinkGrantRoute = (0, import_zod_openapi67.createRoute)({
6650
+ method: "post",
6651
+ path: "/auth/providers/{name}/link-grants",
6652
+ tags: ["federatedAuth"],
6653
+ summary: "Mint a short-lived, opaque grant that authorizes ONE link start for the current web session",
6654
+ request: {
6655
+ params: import_zod_openapi67.z.object({ name: import_zod_openapi67.z.string() }),
6656
+ body: { content: { "application/json": { schema: CreateLinkGrantRequestSchema } } }
6657
+ },
6658
+ responses: {
6659
+ 200: {
6660
+ description: "Opaque single-use grant id",
6661
+ content: { "application/json": { schema: CreateLinkGrantResponseSchema } }
6662
+ },
6663
+ 401: {
6664
+ description: "Authentication required",
6665
+ content: { "application/json": { schema: AuthenticationRequiredErrorSchema } }
6666
+ },
6667
+ 403: {
6668
+ description: "Non-web credential (PAT / OAuth access token)",
6669
+ content: { "application/json": { schema: ApiErrorSchema } }
6670
+ },
6671
+ 404: {
6672
+ description: "Unknown, unconfigured, or credential-kind provider",
6673
+ content: { "application/json": { schema: ApiErrorSchema } }
6674
+ },
6675
+ 500: {
6676
+ description: "Internal server error",
6677
+ content: { "application/json": { schema: InternalServerErrorSchema } }
6678
+ }
6679
+ }
6680
+ });
6681
+ var unlinkAuthProviderRoute = (0, import_zod_openapi67.createRoute)({
6682
+ method: "delete",
6683
+ path: "/auth/providers/{name}/identity",
6684
+ tags: ["federatedAuth"],
6685
+ summary: "Disconnect the current user's identity for this provider",
6686
+ request: {
6687
+ params: import_zod_openapi67.z.object({ name: import_zod_openapi67.z.string() })
6688
+ },
6689
+ responses: {
6690
+ 204: { description: "Identity removed" },
6691
+ 401: {
6692
+ description: "Authentication required",
6693
+ content: { "application/json": { schema: AuthenticationRequiredErrorSchema } }
6694
+ },
6695
+ 403: {
6696
+ description: "Non-web credential (PAT / OAuth access token)",
6697
+ content: { "application/json": { schema: ApiErrorSchema } }
6698
+ },
6699
+ 404: {
6700
+ description: "No identity linked for this provider",
6701
+ content: { "application/json": { schema: ApiErrorSchema } }
6702
+ },
6703
+ 409: {
6704
+ description: "Refused: password auth is disabled instance-wide, or this user has no password set",
6705
+ content: { "application/json": { schema: UnlinkAuthProviderErrorSchema } }
6706
+ },
6707
+ 500: {
6708
+ description: "Internal server error",
6709
+ content: { "application/json": { schema: InternalServerErrorSchema } }
6710
+ }
6711
+ }
6712
+ });
6713
+ var callbackFederatedProviderRoute = (0, import_zod_openapi67.createRoute)({
6714
+ method: "get",
6715
+ path: "/auth/providers/{name}/callback",
6716
+ tags: ["federatedAuth"],
6717
+ summary: "Provider redirect target; completes the OAuth2/OIDC exchange",
6718
+ request: {
6719
+ params: import_zod_openapi67.z.object({ name: import_zod_openapi67.z.string() }),
6720
+ query: import_zod_openapi67.z.object({
6721
+ code: import_zod_openapi67.z.string().optional(),
6722
+ state: import_zod_openapi67.z.string().optional(),
6723
+ error: import_zod_openapi67.z.string().optional()
6724
+ })
6725
+ },
6726
+ responses: {
6727
+ 302: {
6728
+ description: "Redirect to the trusted web login/complete page on success, or back to the trusted web /login on failure"
6729
+ },
6730
+ 404: {
6731
+ description: "Unknown or unconfigured provider (also used when trusted origins cannot be resolved)",
6732
+ content: { "application/json": { schema: ApiErrorSchema } }
6733
+ },
6734
+ 500: {
6735
+ description: "Internal server error",
6736
+ content: { "application/json": { schema: InternalServerErrorSchema } }
6737
+ }
6738
+ }
6739
+ });
6740
+ var federatedHandoffRoute = (0, import_zod_openapi67.createRoute)({
6741
+ method: "post",
6742
+ path: "/auth/handoff",
6743
+ tags: ["federatedAuth"],
6744
+ summary: "Exchange a sender-constrained federated handoff code for session tokens",
6745
+ request: {
6746
+ body: { content: { "application/json": { schema: FederatedHandoffRequestSchema } } }
6747
+ },
6748
+ responses: {
6749
+ 200: {
6750
+ description: "Session tokens \u2014 same shape as POST /auth/login",
6751
+ content: { "application/json": { schema: FederatedHandoffResponseSchema } }
6752
+ },
6753
+ 401: {
6754
+ description: "Invalid / expired handoff code, or sender proof did not verify",
6755
+ content: { "application/json": { schema: ApiErrorSchema } }
6756
+ },
6757
+ 409: {
6758
+ description: "Handoff code already consumed",
6759
+ content: { "application/json": { schema: ApiErrorSchema } }
6760
+ },
6761
+ 500: {
6762
+ description: "Internal server error",
6763
+ content: { "application/json": { schema: InternalServerErrorSchema } }
6764
+ }
6765
+ }
6766
+ });
6767
+ var federatedAuthRoutes = {
6768
+ listFederatedProvidersRoute,
6769
+ startFederatedProviderRoute,
6770
+ callbackFederatedProviderRoute,
6771
+ federatedHandoffRoute,
6772
+ listLinkedAuthProvidersRoute,
6773
+ createAuthProviderLinkGrantRoute,
6774
+ unlinkAuthProviderRoute
6775
+ };
6776
+
6777
+ // src/contracts/federated-registration.ts
6778
+ var import_zod_openapi69 = require("@hono/zod-openapi");
6779
+
6780
+ // src/schemas/federated-registration.ts
6781
+ var import_zod_openapi68 = require("@hono/zod-openapi");
6782
+ var FederatedRegistrationSnapshotSchema = import_zod_openapi68.z.object({
6783
+ /** IdP-verified email, prefilled read-only on the registration screen. */
6784
+ email: import_zod_openapi68.z.string().email(),
6785
+ /** Driver slug, e.g. `'google'`. */
6786
+ provider: import_zod_openapi68.z.string(),
6787
+ /** Human-friendly provider name (the driver's `buttonLabel`), e.g. `'Google'`. */
6788
+ providerLabel: import_zod_openapi68.z.string(),
6789
+ /**
6790
+ * This grant's registration has already been submitted and is waiting
6791
+ * for an administrator (Restricted mode). The screen must show that
6792
+ * state instead of the username form.
6793
+ *
6794
+ * Deliberately narrow: it is not a general status field, and it never
6795
+ * distinguishes unknown / expired / cancelled / completed grants (those
6796
+ * are all the same 404 — AC-2). It exists because a submitted
6797
+ * registration is still readable by its own grant, and re-offering an
6798
+ * editable username there invites a change that cannot be applied — the
6799
+ * second submit is refused and the typed value silently discarded.
6800
+ */
6801
+ approvalPending: import_zod_openapi68.z.boolean()
6802
+ });
6803
+ var FederatedRegistrationSubmitRequestSchema = import_zod_openapi68.z.object({
6804
+ username: UsernameSchema
6805
+ });
6806
+ var FederatedRegistrationActiveResultSchema = import_zod_openapi68.z.object({
6807
+ status: import_zod_openapi68.z.literal("active"),
6808
+ code: import_zod_openapi68.z.string()
6809
+ });
6810
+ var FederatedRegistrationApprovalResultSchema = import_zod_openapi68.z.object({
6811
+ status: import_zod_openapi68.z.literal("approval_required")
6812
+ });
6813
+ var FederatedRegistrationResultSchema = import_zod_openapi68.z.discriminatedUnion("status", [
6814
+ FederatedRegistrationActiveResultSchema,
6815
+ FederatedRegistrationApprovalResultSchema
6816
+ ]);
6817
+
6818
+ // src/contracts/federated-registration.ts
6819
+ var TokenParamSchema = import_zod_openapi69.z.object({ token: import_zod_openapi69.z.string().min(1) });
6820
+ var getFederatedRegistrationRoute = (0, import_zod_openapi69.createRoute)({
6821
+ method: "get",
6822
+ path: "/auth/federated-registration/{token}",
6823
+ tags: ["federatedRegistration"],
6824
+ summary: "Read-only snapshot (email/provider/providerLabel) for a pending federated registration",
6825
+ request: {
6826
+ params: TokenParamSchema
6827
+ },
6828
+ responses: {
6829
+ 200: {
6830
+ description: "Pending registration snapshot",
6831
+ content: { "application/json": { schema: FederatedRegistrationSnapshotSchema } }
6832
+ },
6833
+ 404: {
6834
+ description: "Grant is unknown, expired, or cancelled",
6835
+ content: { "application/json": { schema: ApiErrorSchema } }
6836
+ },
6837
+ 500: {
6838
+ description: "Internal server error",
6839
+ content: { "application/json": { schema: InternalServerErrorSchema } }
6840
+ }
6841
+ }
6842
+ });
6843
+ var submitFederatedRegistrationRoute = (0, import_zod_openapi69.createRoute)({
6844
+ method: "post",
6845
+ path: "/auth/federated-registration/{token}",
6846
+ tags: ["federatedRegistration"],
6847
+ summary: "Submit the chosen username; provisions the User (JIT) and activates or queues approval",
6848
+ request: {
6849
+ params: TokenParamSchema,
6850
+ body: { content: { "application/json": { schema: FederatedRegistrationSubmitRequestSchema } } }
6851
+ },
6852
+ responses: {
6853
+ 200: {
6854
+ description: "Open: account is active \u2014 a Phase 1 handoff code, redeemed via POST /auth/handoff. Restricted: awaiting admin approval.",
6855
+ content: { "application/json": { schema: FederatedRegistrationResultSchema } }
6856
+ },
6857
+ 400: {
6858
+ description: "Username fails the shared username contract",
6859
+ content: { "application/json": { schema: ApiErrorSchema } }
6860
+ },
6861
+ 404: {
6862
+ description: "Grant is unknown, expired, or cancelled",
6863
+ content: { "application/json": { schema: ApiErrorSchema } }
6864
+ },
6865
+ 409: {
6866
+ description: "Username/email already taken, or the identity is already linked to a different user",
6867
+ content: { "application/json": { schema: ApiErrorSchema } }
6868
+ },
6869
+ 500: {
6870
+ description: "Internal server error",
6871
+ content: { "application/json": { schema: InternalServerErrorSchema } }
6872
+ }
6873
+ }
6874
+ });
6875
+ var logoutFederatedRegistrationRoute = (0, import_zod_openapi69.createRoute)({
6876
+ method: "post",
6877
+ path: "/auth/federated-registration/{token}/logout",
6878
+ tags: ["federatedRegistration"],
6879
+ summary: "Cancel a pending federated registration and invalidate the grant",
6880
+ request: {
6881
+ params: TokenParamSchema
6882
+ },
6883
+ responses: {
6884
+ 204: { description: "Grant cancelled (or was already inactive) \u2014 idempotent" },
6885
+ 500: {
6886
+ description: "Internal server error",
6887
+ content: { "application/json": { schema: InternalServerErrorSchema } }
6888
+ }
6889
+ }
6890
+ });
6891
+ var federatedRegistrationRoutes = {
6892
+ getFederatedRegistrationRoute,
6893
+ submitFederatedRegistrationRoute,
6894
+ logoutFederatedRegistrationRoute
6895
+ };
6896
+
6897
+ // src/contracts/invite-accept.ts
6898
+ var import_zod_openapi71 = require("@hono/zod-openapi");
6899
+
6900
+ // src/schemas/invite-accept.ts
6901
+ var import_zod_openapi70 = require("@hono/zod-openapi");
6902
+ var InviteAcceptRequestSchema = import_zod_openapi70.z.object({
6903
+ token: import_zod_openapi70.z.string(),
6420
6904
  username: UsernameSchema,
6421
- name: import_zod_openapi66.z.string().min(1),
6422
- password: import_zod_openapi66.z.string().min(6)
6905
+ name: import_zod_openapi70.z.string().min(1),
6906
+ password: import_zod_openapi70.z.string().min(6)
6423
6907
  });
6424
- var InvitePreviewResponseSchema = import_zod_openapi66.z.object({
6425
- email: import_zod_openapi66.z.string().email()
6908
+ var InvitePreviewResponseSchema = import_zod_openapi70.z.object({
6909
+ email: import_zod_openapi70.z.string().email()
6426
6910
  });
6427
6911
 
6428
6912
  // src/contracts/invite-accept.ts
6429
- var invitePreviewRoute = (0, import_zod_openapi67.createRoute)({
6913
+ var invitePreviewRoute = (0, import_zod_openapi71.createRoute)({
6430
6914
  method: "get",
6431
6915
  path: "/invite/accept",
6432
6916
  tags: ["inviteAccept"],
@@ -6453,7 +6937,7 @@ var invitePreviewRoute = (0, import_zod_openapi67.createRoute)({
6453
6937
  }
6454
6938
  }
6455
6939
  });
6456
- var acceptInviteRoute = (0, import_zod_openapi67.createRoute)({
6940
+ var acceptInviteRoute = (0, import_zod_openapi71.createRoute)({
6457
6941
  method: "post",
6458
6942
  path: "/invite/accept",
6459
6943
  tags: ["inviteAccept"],
@@ -6496,23 +6980,23 @@ var inviteAcceptRoutes = {
6496
6980
  };
6497
6981
 
6498
6982
  // src/contracts/password-reset.ts
6499
- var import_zod_openapi69 = require("@hono/zod-openapi");
6983
+ var import_zod_openapi73 = require("@hono/zod-openapi");
6500
6984
 
6501
6985
  // src/schemas/password-reset.ts
6502
- var import_zod_openapi68 = require("@hono/zod-openapi");
6503
- var ForgotPasswordRequestSchema = import_zod_openapi68.z.object({
6504
- email: import_zod_openapi68.z.string().email()
6986
+ var import_zod_openapi72 = require("@hono/zod-openapi");
6987
+ var ForgotPasswordRequestSchema = import_zod_openapi72.z.object({
6988
+ email: import_zod_openapi72.z.string().email()
6505
6989
  });
6506
- var ForgotPasswordResponseSchema = import_zod_openapi68.z.object({
6507
- ok: import_zod_openapi68.z.literal(true)
6990
+ var ForgotPasswordResponseSchema = import_zod_openapi72.z.object({
6991
+ ok: import_zod_openapi72.z.literal(true)
6508
6992
  });
6509
- var ResetPasswordRequestSchema = import_zod_openapi68.z.object({
6510
- token: import_zod_openapi68.z.string(),
6511
- password: import_zod_openapi68.z.string().min(6)
6993
+ var ResetPasswordRequestSchema = import_zod_openapi72.z.object({
6994
+ token: import_zod_openapi72.z.string(),
6995
+ password: import_zod_openapi72.z.string().min(6)
6512
6996
  });
6513
6997
 
6514
6998
  // src/contracts/password-reset.ts
6515
- var forgotPasswordRoute = (0, import_zod_openapi69.createRoute)({
6999
+ var forgotPasswordRoute = (0, import_zod_openapi73.createRoute)({
6516
7000
  method: "post",
6517
7001
  path: "/auth/forgot-password",
6518
7002
  tags: ["passwordReset"],
@@ -6537,7 +7021,7 @@ var forgotPasswordRoute = (0, import_zod_openapi69.createRoute)({
6537
7021
  }
6538
7022
  }
6539
7023
  });
6540
- var validateResetTokenRoute = (0, import_zod_openapi69.createRoute)({
7024
+ var validateResetTokenRoute = (0, import_zod_openapi73.createRoute)({
6541
7025
  method: "get",
6542
7026
  path: "/auth/reset-password",
6543
7027
  tags: ["passwordReset"],
@@ -6560,7 +7044,7 @@ var validateResetTokenRoute = (0, import_zod_openapi69.createRoute)({
6560
7044
  }
6561
7045
  }
6562
7046
  });
6563
- var selfResetPasswordRoute = (0, import_zod_openapi69.createRoute)({
7047
+ var selfResetPasswordRoute = (0, import_zod_openapi73.createRoute)({
6564
7048
  method: "post",
6565
7049
  path: "/auth/reset-password",
6566
7050
  tags: ["passwordReset"],
@@ -6600,19 +7084,19 @@ var passwordResetRoutes = {
6600
7084
  };
6601
7085
 
6602
7086
  // src/contracts/activation.ts
6603
- var import_zod_openapi71 = require("@hono/zod-openapi");
7087
+ var import_zod_openapi75 = require("@hono/zod-openapi");
6604
7088
 
6605
7089
  // src/schemas/activation.ts
6606
- var import_zod_openapi70 = require("@hono/zod-openapi");
6607
- var ActivateRequestSchema = import_zod_openapi70.z.object({
6608
- token: import_zod_openapi70.z.string()
7090
+ var import_zod_openapi74 = require("@hono/zod-openapi");
7091
+ var ActivateRequestSchema = import_zod_openapi74.z.object({
7092
+ token: import_zod_openapi74.z.string()
6609
7093
  });
6610
- var ActivateValidationResponseSchema = import_zod_openapi70.z.object({
6611
- ok: import_zod_openapi70.z.literal(true)
7094
+ var ActivateValidationResponseSchema = import_zod_openapi74.z.object({
7095
+ ok: import_zod_openapi74.z.literal(true)
6612
7096
  });
6613
7097
 
6614
7098
  // src/contracts/activation.ts
6615
- var validateActivationTokenRoute = (0, import_zod_openapi71.createRoute)({
7099
+ var validateActivationTokenRoute = (0, import_zod_openapi75.createRoute)({
6616
7100
  method: "get",
6617
7101
  path: "/auth/activate",
6618
7102
  tags: ["activation"],
@@ -6635,7 +7119,7 @@ var validateActivationTokenRoute = (0, import_zod_openapi71.createRoute)({
6635
7119
  }
6636
7120
  }
6637
7121
  });
6638
- var activateAccountRoute = (0, import_zod_openapi71.createRoute)({
7122
+ var activateAccountRoute = (0, import_zod_openapi75.createRoute)({
6639
7123
  method: "post",
6640
7124
  path: "/auth/activate",
6641
7125
  tags: ["activation"],
@@ -6670,21 +7154,21 @@ var activationRoutes = {
6670
7154
  };
6671
7155
 
6672
7156
  // src/contracts/email-change.ts
6673
- var import_zod_openapi73 = require("@hono/zod-openapi");
7157
+ var import_zod_openapi77 = require("@hono/zod-openapi");
6674
7158
 
6675
7159
  // src/schemas/email-change.ts
6676
- var import_zod_openapi72 = require("@hono/zod-openapi");
6677
- var ConfirmEmailChangeRequestSchema = import_zod_openapi72.z.object({
6678
- token: import_zod_openapi72.z.string()
7160
+ var import_zod_openapi76 = require("@hono/zod-openapi");
7161
+ var ConfirmEmailChangeRequestSchema = import_zod_openapi76.z.object({
7162
+ token: import_zod_openapi76.z.string()
6679
7163
  });
6680
- var ConfirmEmailChangeResponseSchema = import_zod_openapi72.z.object({
6681
- ok: import_zod_openapi72.z.literal(true),
7164
+ var ConfirmEmailChangeResponseSchema = import_zod_openapi76.z.object({
7165
+ ok: import_zod_openapi76.z.literal(true),
6682
7166
  /** The newly-confirmed email address. */
6683
- email: import_zod_openapi72.z.string().email()
7167
+ email: import_zod_openapi76.z.string().email()
6684
7168
  });
6685
7169
 
6686
7170
  // src/contracts/email-change.ts
6687
- var validateEmailChangeTokenRoute = (0, import_zod_openapi73.createRoute)({
7171
+ var validateEmailChangeTokenRoute = (0, import_zod_openapi77.createRoute)({
6688
7172
  method: "get",
6689
7173
  path: "/auth/confirm-email-change",
6690
7174
  tags: ["emailChange"],
@@ -6707,7 +7191,7 @@ var validateEmailChangeTokenRoute = (0, import_zod_openapi73.createRoute)({
6707
7191
  }
6708
7192
  }
6709
7193
  });
6710
- var confirmEmailChangeRoute = (0, import_zod_openapi73.createRoute)({
7194
+ var confirmEmailChangeRoute = (0, import_zod_openapi77.createRoute)({
6711
7195
  method: "post",
6712
7196
  path: "/auth/confirm-email-change",
6713
7197
  tags: ["emailChange"],
@@ -6746,9 +7230,9 @@ var emailChangeRoutes = {
6746
7230
  };
6747
7231
 
6748
7232
  // src/contracts/user.ts
6749
- var import_zod_openapi74 = require("@hono/zod-openapi");
6750
- var UsernameParamSchema = import_zod_openapi74.z.object({ username: import_zod_openapi74.z.string() });
6751
- var getUserPageRoute = (0, import_zod_openapi74.createRoute)({
7233
+ var import_zod_openapi78 = require("@hono/zod-openapi");
7234
+ var UsernameParamSchema = import_zod_openapi78.z.object({ username: import_zod_openapi78.z.string() });
7235
+ var getUserPageRoute = (0, import_zod_openapi78.createRoute)({
6752
7236
  method: "get",
6753
7237
  path: "/user/{username}",
6754
7238
  tags: ["user"],
@@ -6776,7 +7260,7 @@ var getUserPageRoute = (0, import_zod_openapi74.createRoute)({
6776
7260
  }
6777
7261
  }
6778
7262
  });
6779
- var getUserBookmarksRoute = (0, import_zod_openapi74.createRoute)({
7263
+ var getUserBookmarksRoute = (0, import_zod_openapi78.createRoute)({
6780
7264
  method: "get",
6781
7265
  path: "/user/{username}/bookmarks",
6782
7266
  tags: ["user"],
@@ -6805,7 +7289,7 @@ var getUserBookmarksRoute = (0, import_zod_openapi74.createRoute)({
6805
7289
  }
6806
7290
  }
6807
7291
  });
6808
- var getUserPagesRoute = (0, import_zod_openapi74.createRoute)({
7292
+ var getUserPagesRoute = (0, import_zod_openapi78.createRoute)({
6809
7293
  method: "get",
6810
7294
  path: "/user/{username}/pages",
6811
7295
  tags: ["user"],
@@ -6834,7 +7318,7 @@ var getUserPagesRoute = (0, import_zod_openapi74.createRoute)({
6834
7318
  }
6835
7319
  }
6836
7320
  });
6837
- var getUserSubpagesRoute = (0, import_zod_openapi74.createRoute)({
7321
+ var getUserSubpagesRoute = (0, import_zod_openapi78.createRoute)({
6838
7322
  method: "get",
6839
7323
  path: "/user/{username}/subpages",
6840
7324
  tags: ["user"],
@@ -6871,7 +7355,7 @@ var getUserSubpagesRoute = (0, import_zod_openapi74.createRoute)({
6871
7355
  }
6872
7356
  }
6873
7357
  });
6874
- var listMembersRoute = (0, import_zod_openapi74.createRoute)({
7358
+ var listMembersRoute = (0, import_zod_openapi78.createRoute)({
6875
7359
  method: "get",
6876
7360
  path: "/users",
6877
7361
  tags: ["user"],
@@ -6917,6 +7401,13 @@ var stubTokens = {
6917
7401
  expiresIn: 0,
6918
7402
  user: stubUser
6919
7403
  };
7404
+ var stubProviderList = { providers: [] };
7405
+ var stubFederatedRegistrationSnapshot = {
7406
+ email: "stub@example.com",
7407
+ provider: "",
7408
+ providerLabel: "",
7409
+ approvalPending: false
7410
+ };
6920
7411
  var stubProfile = {
6921
7412
  id: "",
6922
7413
  username: "",
@@ -6926,7 +7417,8 @@ var stubProfile = {
6926
7417
  theme: "system",
6927
7418
  image: null,
6928
7419
  hasPassword: false,
6929
- createdAt: ""
7420
+ createdAt: "",
7421
+ federated: false
6930
7422
  };
6931
7423
  var stubAccessToken = {
6932
7424
  id: "",
@@ -7115,6 +7607,12 @@ var stubAttachmentMeta = (() => {
7115
7607
  })();
7116
7608
  var stubUploadAttachment = { url: "", filename: "", mimeType: "", sizeBytes: 0 };
7117
7609
  var stubRemoveAttachment = { success: true };
7610
+ var stubUploadPolicy = {
7611
+ allowedMimeTypes: [],
7612
+ extensionHints: {},
7613
+ maxBytes: { attachment: 0 },
7614
+ profilePicture: { allowedMimeTypes: [], maxBytes: 0 }
7615
+ };
7118
7616
  var stubSearchPages = { meta: { total: 0, results: 0 }, data: [] };
7119
7617
  var stubCryptoStatus = {
7120
7618
  encryptionConfigured: false,
@@ -7167,7 +7665,7 @@ var stubPluginConfig = { name: "", fields: [], values: {} };
7167
7665
  var stubUpdatePluginConfig = { ok: true, hotReloaded: false, reconfigureFailed: false };
7168
7666
  var stubPluginReadiness = { issues: [] };
7169
7667
  var stubClearRenderCache = { ok: true, clearedAt: "", removedCount: 0 };
7170
- var appAuthMeUserChain = new import_zod_openapi75.OpenAPIHono().openapi(
7668
+ var appAuthMeUserChain = new import_zod_openapi79.OpenAPIHono().openapi(
7171
7669
  appRoutes.getAppInfoRoute,
7172
7670
  (c) => c.json(
7173
7671
  {
@@ -7201,31 +7699,33 @@ var appAuthMeUserChain = new import_zod_openapi75.OpenAPIHono().openapi(
7201
7699
  meRoutes.updatePasswordRoute,
7202
7700
  (c) => c.json({ status: "ok", message: "", accessToken: "", refreshToken: "", expiresIn: 0 }, 200)
7203
7701
  ).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 import_zod_openapi75.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));
7205
- var pageChain = new import_zod_openapi75.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));
7206
- var lateContractApp = new import_zod_openapi75.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));
7207
- var adminSettingsContractApp = new import_zod_openapi75.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));
7208
- var adminUsersPluginsContractApp = new import_zod_openapi75.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));
7209
- var oauthContractApp = new import_zod_openapi75.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));
7702
+ 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));
7703
+ 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));
7704
+ 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(attachmentRoutes.getUploadPolicyRoute, (c) => c.json(stubUploadPolicy, 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));
7705
+ 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));
7706
+ 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));
7707
+ 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));
7708
+ 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));
7709
+ 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
7710
  var createClient = (baseUrl, options = {}) => (0, import_client.hc)(baseUrl, {
7211
7711
  headers: options.headers,
7212
7712
  fetch: options.fetch
7213
7713
  });
7214
7714
 
7215
7715
  // src/schemas/mail-token.ts
7216
- var import_zod_openapi76 = require("@hono/zod-openapi");
7217
- var MailTokenPurposeSchema = import_zod_openapi76.z.enum(["invite", "activate", "reset", "email-change"]);
7218
- var MailTokenPayloadSchema = import_zod_openapi76.z.object({
7716
+ var import_zod_openapi80 = require("@hono/zod-openapi");
7717
+ var MailTokenPurposeSchema = import_zod_openapi80.z.enum(["invite", "activate", "reset", "email-change"]);
7718
+ var MailTokenPayloadSchema = import_zod_openapi80.z.object({
7219
7719
  purpose: MailTokenPurposeSchema,
7220
- userId: import_zod_openapi76.z.string(),
7720
+ userId: import_zod_openapi80.z.string(),
7221
7721
  /** Target address. For `email-change` this is the NEW address. */
7222
- email: import_zod_openapi76.z.string().email(),
7722
+ email: import_zod_openapi80.z.string().email(),
7223
7723
  /**
7224
7724
  * For `email-change`: the account's email at issue time. The confirm
7225
7725
  * endpoint rejects the token unless it still matches, making the token
7226
7726
  * single-use (a stale token cannot revert a later change).
7227
7727
  */
7228
- fromEmail: import_zod_openapi76.z.string().email().optional(),
7728
+ fromEmail: import_zod_openapi80.z.string().email().optional(),
7229
7729
  /**
7230
7730
  * For `reset`: the account's `passwordResetGeneration` at issue time.
7231
7731
  * Consuming the link increments that counter, so the token only matches
@@ -7234,7 +7734,7 @@ var MailTokenPayloadSchema = import_zod_openapi76.z.object({
7234
7734
  * schema because the other purposes don't carry it (and links minted
7235
7735
  * before the claim existed simply no longer match).
7236
7736
  */
7237
- resetGeneration: import_zod_openapi76.z.number().int().nonnegative().optional(),
7737
+ resetGeneration: import_zod_openapi80.z.number().int().nonnegative().optional(),
7238
7738
  /**
7239
7739
  * For `email-change`: the account's `authVersion` at issue time. The
7240
7740
  * confirm endpoint requires it to still match, so a pending address change
@@ -7246,7 +7746,7 @@ var MailTokenPayloadSchema = import_zod_openapi76.z.object({
7246
7746
  * semantics wanted are exactly "the session that asked for this is gone",
7247
7747
  * and that is what every bump of it already means.
7248
7748
  */
7249
- authVersion: import_zod_openapi76.z.number().int().nonnegative().optional(),
7749
+ authVersion: import_zod_openapi80.z.number().int().nonnegative().optional(),
7250
7750
  /**
7251
7751
  * For `email-change`: the account's `emailChangeGeneration` at issue time.
7252
7752
  * Requesting a change increments it, so asking for a different address
@@ -7258,10 +7758,10 @@ var MailTokenPayloadSchema = import_zod_openapi76.z.object({
7258
7758
  * Optional in the schema for the same reason as the others — links minted
7259
7759
  * before the claim existed simply no longer match.
7260
7760
  */
7261
- emailChangeGeneration: import_zod_openapi76.z.number().int().nonnegative().optional(),
7761
+ emailChangeGeneration: import_zod_openapi80.z.number().int().nonnegative().optional(),
7262
7762
  // iat / exp are injected and verified by the JWT layer.
7263
- iat: import_zod_openapi76.z.number().optional(),
7264
- exp: import_zod_openapi76.z.number().optional()
7763
+ iat: import_zod_openapi80.z.number().optional(),
7764
+ exp: import_zod_openapi80.z.number().optional()
7265
7765
  });
7266
7766
 
7267
7767
  // src/util/html-elements.ts
@@ -7477,6 +7977,8 @@ var WS_CLOSE_CODES = {
7477
7977
  CommentInvalidRequestErrorSchema,
7478
7978
  CommentNotFoundErrorSchema,
7479
7979
  CommentSchema,
7980
+ ConfigReadinessIssueSchema,
7981
+ ConfigReadinessResponseSchema,
7480
7982
  ConfirmEmailChangeRequestSchema,
7481
7983
  ConfirmEmailChangeResponseSchema,
7482
7984
  ConflictErrorSchema,
@@ -7487,11 +7989,14 @@ var WS_CLOSE_CODES = {
7487
7989
  CreateAdminResponseSchema,
7488
7990
  CreateDraftRequestSchema,
7489
7991
  CreateDraftResponseSchema,
7992
+ CreateLinkGrantRequestSchema,
7993
+ CreateLinkGrantResponseSchema,
7490
7994
  CreatePageRequestSchema,
7491
7995
  CrowiCodeSidecarSchema,
7492
7996
  CrowiDiagramNodeSchema,
7493
7997
  CrowiDiagramSidecarSchema,
7494
7998
  CrowiDimensionSchema,
7999
+ CrowiFrontmatterEntrySchema,
7495
8000
  CrowiImagePayloadSchema,
7496
8001
  CrowiLinkCardNodeSchema,
7497
8002
  CrowiLinkCardSidecarSchema,
@@ -7522,6 +8027,18 @@ var WS_CLOSE_CODES = {
7522
8027
  EditAdminUserRequestSchema,
7523
8028
  EncryptionNotConfiguredErrorSchema,
7524
8029
  ErrorCodeSchema,
8030
+ FRONTMATTER_MAX_ENTRIES,
8031
+ FRONTMATTER_MAX_KEY_CHARS,
8032
+ FRONTMATTER_MAX_RAW_BYTES,
8033
+ FRONTMATTER_MAX_VALUE_CHARS,
8034
+ FederatedHandoffRequestSchema,
8035
+ FederatedHandoffResponseSchema,
8036
+ FederatedProviderSchema,
8037
+ FederatedRegistrationActiveResultSchema,
8038
+ FederatedRegistrationApprovalResultSchema,
8039
+ FederatedRegistrationResultSchema,
8040
+ FederatedRegistrationSnapshotSchema,
8041
+ FederatedRegistrationSubmitRequestSchema,
7525
8042
  ForbiddenErrorSchema,
7526
8043
  ForgotPasswordRequestSchema,
7527
8044
  ForgotPasswordResponseSchema,
@@ -7563,6 +8080,7 @@ var WS_CLOSE_CODES = {
7563
8080
  LanguageSchema,
7564
8081
  LikerSchema,
7565
8082
  LikersResponseSchema,
8083
+ LinkedAuthProviderListResponseSchema,
7566
8084
  ListAccessTokensResponseSchema,
7567
8085
  ListAdminUsersRequestSchema,
7568
8086
  ListAdminUsersResponseSchema,
@@ -7635,8 +8153,6 @@ var WS_CLOSE_CODES = {
7635
8153
  PluginInfoSchema,
7636
8154
  PluginNotFoundErrorSchema,
7637
8155
  PluginReadinessFieldSchema,
7638
- PluginReadinessIssueSchema,
7639
- PluginReadinessResponseSchema,
7640
8156
  PresenceClientMessageSchema,
7641
8157
  PresenceCommentChangedMessageSchema,
7642
8158
  PresenceHeartbeatMessageSchema,
@@ -7649,6 +8165,7 @@ var WS_CLOSE_CODES = {
7649
8165
  PreviewPageRequestSchema,
7650
8166
  PreviewPageResponseSchema,
7651
8167
  ProfileErrorResponseSchema,
8168
+ ProviderListResponseSchema,
7652
8169
  RENDERED_AST_NODE_DEFS,
7653
8170
  RecentlyViewedPagesResponseSchema,
7654
8171
  ReencryptResponseSchema,
@@ -7697,6 +8214,8 @@ var WS_CLOSE_CODES = {
7697
8214
  SendTestMailErrorSchema,
7698
8215
  SendTestMailRequestSchema,
7699
8216
  SendTestMailResponseSchema,
8217
+ SenderProofSchema,
8218
+ SenderPublicJwkSchema,
7700
8219
  SensitiveConfigEntrySchema,
7701
8220
  ServiceUnavailableErrorSchema,
7702
8221
  SetPageGrantRequestSchema,
@@ -7717,6 +8236,7 @@ var WS_CLOSE_CODES = {
7717
8236
  TokenRequestSchema,
7718
8237
  TokenResponseSchema,
7719
8238
  UPLOAD_ALLOWED_MIME,
8239
+ UnlinkAuthProviderErrorSchema,
7720
8240
  UpdateAdminUserEmailRequestSchema,
7721
8241
  UpdateAppSettingsRequestSchema,
7722
8242
  UpdateAppSettingsResponseSchema,
@@ -7735,6 +8255,7 @@ var WS_CLOSE_CODES = {
7735
8255
  UploadAttachmentErrorCodeSchema,
7736
8256
  UploadAttachmentErrorSchema,
7737
8257
  UploadAttachmentResponseSchema,
8258
+ UploadPolicyResponseSchema,
7738
8259
  UserBookmarksResponseSchema,
7739
8260
  UserLanguageSchema,
7740
8261
  UserListItemSchema,
@@ -7780,6 +8301,7 @@ var WS_CLOSE_CODES = {
7780
8301
  autocompleteUsersRoute,
7781
8302
  backlinkRoutes,
7782
8303
  bookmarkRoutes,
8304
+ callbackFederatedProviderRoute,
7783
8305
  cancelDraftRoute,
7784
8306
  claimPageLinkAccessRoute,
7785
8307
  clearRenderCacheAllRoute,
@@ -7789,6 +8311,7 @@ var WS_CLOSE_CODES = {
7789
8311
  confirmEmailChangeRoute,
7790
8312
  createAccessTokenRoute,
7791
8313
  createAdminRoute,
8314
+ createAuthProviderLinkGrantRoute,
7792
8315
  createClient,
7793
8316
  createDraftRoute,
7794
8317
  createPageRoute,
@@ -7804,6 +8327,9 @@ var WS_CLOSE_CODES = {
7804
8327
  draftRoutes,
7805
8328
  editUserRoute,
7806
8329
  emailChangeRoutes,
8330
+ federatedAuthRoutes,
8331
+ federatedHandoffRoute,
8332
+ federatedRegistrationRoutes,
7807
8333
  forgotPasswordRoute,
7808
8334
  getAppInfoRoute,
7809
8335
  getAppSettingsRoute,
@@ -7813,6 +8339,7 @@ var WS_CLOSE_CODES = {
7813
8339
  getBacklinksRoute,
7814
8340
  getBookmarkRoute,
7815
8341
  getCryptoStatusRoute,
8342
+ getFederatedRegistrationRoute,
7816
8343
  getInstallerStatusRoute,
7817
8344
  getLikersRoute,
7818
8345
  getMailSettingsRoute,
@@ -7829,6 +8356,7 @@ var WS_CLOSE_CODES = {
7829
8356
  getSeenUsersRoute,
7830
8357
  getStorageStatusRoute,
7831
8358
  getUnreadCountRoute,
8359
+ getUploadPolicyRoute,
7832
8360
  getUserBookmarksRoute,
7833
8361
  getUserPageRoute,
7834
8362
  getUserPagesRoute,
@@ -7846,6 +8374,8 @@ var WS_CLOSE_CODES = {
7846
8374
  listAttachmentsRoute,
7847
8375
  listCommentsRoute,
7848
8376
  listDraftsRoute,
8377
+ listFederatedProvidersRoute,
8378
+ listLinkedAuthProvidersRoute,
7849
8379
  listMembersRoute,
7850
8380
  listMyBookmarksRoute,
7851
8381
  listNotificationsRoute,
@@ -7854,6 +8384,7 @@ var WS_CLOSE_CODES = {
7854
8384
  listPluginsRoute,
7855
8385
  listRevisionsRoute,
7856
8386
  listUsersRoute,
8387
+ logoutFederatedRegistrationRoute,
7857
8388
  makeAdminRoute,
7858
8389
  markAllAsReadRoute,
7859
8390
  meRoutes,
@@ -7890,7 +8421,9 @@ var WS_CLOSE_CODES = {
7890
8421
  sendTestMailRoute,
7891
8422
  setPageGrantRoute,
7892
8423
  setWatchStatusRoute,
8424
+ startFederatedProviderRoute,
7893
8425
  stripKnownHtmlTags,
8426
+ submitFederatedRegistrationRoute,
7894
8427
  suspendUserRoute,
7895
8428
  tokenAuthRoutes,
7896
8429
  tokenLoginRoute,
@@ -7900,6 +8433,7 @@ var WS_CLOSE_CODES = {
7900
8433
  tokenRegisterRoute,
7901
8434
  tokenRoute,
7902
8435
  unlikePageRoute,
8436
+ unlinkAuthProviderRoute,
7903
8437
  unwrapRenderedAst,
7904
8438
  updateAppSettingsRoute,
7905
8439
  updateAuthSettingsRoute,