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

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.mjs CHANGED
@@ -649,6 +649,18 @@ var ClearRenderCacheResponseSchema = z6.object({
649
649
  /** Number of cache rows removed. */
650
650
  removedCount: z6.number().int().min(0)
651
651
  });
652
+ var PluginReadinessFieldSchema = z6.object({
653
+ name: z6.string(),
654
+ configured: z6.literal(false)
655
+ });
656
+ var PluginReadinessIssueSchema = z6.object({
657
+ name: z6.string(),
658
+ adminPlacement: PluginAdminPlacementSchema,
659
+ fields: z6.array(PluginReadinessFieldSchema)
660
+ });
661
+ var PluginReadinessResponseSchema = z6.object({
662
+ issues: z6.array(PluginReadinessIssueSchema)
663
+ });
652
664
 
653
665
  // src/contracts/admin/plugins.ts
654
666
  var PluginNameQuerySchema = z7.object({ name: z7.string() });
@@ -780,6 +792,27 @@ var clearRenderCacheAllRoute = createRoute4({
780
792
  }
781
793
  }
782
794
  });
795
+ var getPluginReadinessRoute = createRoute4({
796
+ method: "get",
797
+ path: "/admin/plugins/readiness",
798
+ tags: ["admin.plugins"],
799
+ security: [{ bearerAuth: [] }],
800
+ summary: "List active plugins missing required readiness config fields",
801
+ responses: {
802
+ 200: {
803
+ description: "Readiness issues for active plugins (empty when everything is configured)",
804
+ content: { "application/json": { schema: PluginReadinessResponseSchema } }
805
+ },
806
+ 401: {
807
+ description: "Authentication required",
808
+ content: { "application/json": { schema: AuthenticationRequiredErrorSchema } }
809
+ },
810
+ 403: {
811
+ description: "Admin permission required",
812
+ content: { "application/json": { schema: AdminRequiredErrorSchema } }
813
+ }
814
+ }
815
+ });
783
816
  var clearRenderCachePluginRoute = createRoute4({
784
817
  method: "post",
785
818
  path: "/admin/plugins/render-cache/clear-plugin",
@@ -819,6 +852,7 @@ var adminPluginsRoutes = {
819
852
  listPluginsRoute,
820
853
  getPluginConfigRoute,
821
854
  updatePluginConfigRoute,
855
+ getPluginReadinessRoute,
822
856
  clearRenderCacheAllRoute,
823
857
  clearRenderCachePluginRoute
824
858
  };
@@ -3374,22 +3408,28 @@ var draftRoutes = {
3374
3408
  import { createRoute as createRoute16 } from "@hono/zod-openapi";
3375
3409
 
3376
3410
  // src/schemas/installer.ts
3411
+ import { z as z30 } from "@hono/zod-openapi";
3412
+
3413
+ // src/schemas/username.ts
3377
3414
  import { z as z29 } from "@hono/zod-openapi";
3378
- var InstallerStatusResponseSchema = z29.object({
3379
- status: z29.enum(["installer_required", "already_installed"])
3380
- });
3381
- var CreateAdminRequestSchema = z29.object({
3382
- registerForm: z29.object({
3383
- username: z29.string().min(1).regex(/^[\da-zA-Z\-_.]+$/, "username may only contain letters, digits, hyphens, underscores, and dots"),
3384
- name: z29.string().min(1),
3385
- email: z29.string().email(),
3386
- password: z29.string().min(6).regex(/^[\x20-\x7F]{6,}$/, "password must be 6+ printable ASCII characters")
3415
+ var UsernameSchema = z29.string().min(1).max(64).regex(/^[A-Za-z0-9_-]+$/, "username may only contain letters, digits, hyphens, and underscores");
3416
+
3417
+ // src/schemas/installer.ts
3418
+ var InstallerStatusResponseSchema = z30.object({
3419
+ status: z30.enum(["installer_required", "already_installed"])
3420
+ });
3421
+ var CreateAdminRequestSchema = z30.object({
3422
+ registerForm: z30.object({
3423
+ username: UsernameSchema,
3424
+ name: z30.string().min(1),
3425
+ email: z30.string().email(),
3426
+ password: z30.string().min(6).regex(/^[\x20-\x7F]{6,}$/, "password must be 6+ printable ASCII characters")
3387
3427
  })
3388
3428
  });
3389
- var CreateAdminResponseSchema = z29.object({
3390
- status: z29.enum(["ok", "error"]),
3391
- message: z29.string().optional(),
3392
- errors: z29.array(z29.string()).optional()
3429
+ var CreateAdminResponseSchema = z30.object({
3430
+ status: z30.enum(["ok", "error"]),
3431
+ message: z30.string().optional(),
3432
+ errors: z30.array(z30.string()).optional()
3393
3433
  });
3394
3434
 
3395
3435
  // src/contracts/installer.ts
@@ -3461,84 +3501,84 @@ var createAdminRoute = createRoute16({
3461
3501
  var installerRoutes = { getInstallerStatusRoute, createAdminRoute };
3462
3502
 
3463
3503
  // src/contracts/me.ts
3464
- import { createRoute as createRoute17, z as z31 } from "@hono/zod-openapi";
3504
+ import { createRoute as createRoute17, z as z32 } from "@hono/zod-openapi";
3465
3505
 
3466
3506
  // src/schemas/me.ts
3467
- import { z as z30 } from "@hono/zod-openapi";
3468
- var LanguageSchema = z30.enum(["en", "ja"]);
3469
- var ThemeSchema = z30.enum(["system", "light", "dark"]);
3470
- var UserProfileResponseSchema = z30.object({
3471
- id: z30.string(),
3472
- username: z30.string(),
3473
- name: z30.string(),
3474
- email: z30.string().email(),
3507
+ import { z as z31 } from "@hono/zod-openapi";
3508
+ var LanguageSchema = z31.enum(["en", "ja"]);
3509
+ var ThemeSchema = z31.enum(["system", "light", "dark"]);
3510
+ var UserProfileResponseSchema = z31.object({
3511
+ id: z31.string(),
3512
+ username: z31.string(),
3513
+ name: z31.string(),
3514
+ email: z31.string().email(),
3475
3515
  lang: LanguageSchema,
3476
3516
  theme: ThemeSchema,
3477
- image: z30.string().nullable(),
3478
- introduction: z30.string().optional(),
3479
- hasPassword: z30.boolean(),
3480
- createdAt: z30.string(),
3517
+ image: z31.string().nullable(),
3518
+ introduction: z31.string().optional(),
3519
+ hasPassword: z31.boolean(),
3520
+ createdAt: z31.string(),
3481
3521
  /**
3482
3522
  * True when the profile update requested a new email that is awaiting
3483
3523
  * confirmation: the stored `email` is unchanged and a confirmation
3484
3524
  * link was sent to the new address.
3485
3525
  */
3486
- emailChangePending: z30.boolean().optional()
3526
+ emailChangePending: z31.boolean().optional()
3487
3527
  });
3488
- var UpdateProfileRequestSchema = z30.object({
3489
- userForm: z30.object({
3490
- name: z30.string().min(1, "Name is required"),
3491
- email: z30.string().email("Invalid email format"),
3528
+ var UpdateProfileRequestSchema = z31.object({
3529
+ userForm: z31.object({
3530
+ name: z31.string().min(1, "Name is required"),
3531
+ email: z31.string().email("Invalid email format"),
3492
3532
  lang: LanguageSchema
3493
3533
  })
3494
3534
  });
3495
- var UpdateThemeRequestSchema = z30.object({
3535
+ var UpdateThemeRequestSchema = z31.object({
3496
3536
  theme: ThemeSchema
3497
3537
  });
3498
- var ThemeUpdateResponseSchema = z30.object({
3499
- status: z30.literal("ok"),
3538
+ var ThemeUpdateResponseSchema = z31.object({
3539
+ status: z31.literal("ok"),
3500
3540
  theme: ThemeSchema
3501
3541
  });
3502
- var PictureUploadResponseSchema = z30.object({
3503
- status: z30.boolean(),
3504
- url: z30.string().optional(),
3505
- message: z30.string().optional()
3542
+ var PictureUploadResponseSchema = z31.object({
3543
+ status: z31.boolean(),
3544
+ url: z31.string().optional(),
3545
+ message: z31.string().optional()
3506
3546
  });
3507
- var SuccessResponseSchema = z30.object({
3508
- status: z30.literal("ok"),
3509
- message: z30.string().optional()
3547
+ var SuccessResponseSchema = z31.object({
3548
+ status: z31.literal("ok"),
3549
+ message: z31.string().optional()
3510
3550
  });
3511
- var ProfileErrorResponseSchema = z30.object({
3512
- status: z30.literal("error"),
3551
+ var ProfileErrorResponseSchema = z31.object({
3552
+ status: z31.literal("error"),
3513
3553
  /** Stable code so the web can localize the message (e.g. EMAIL_TAKEN). */
3514
- code: z30.string().optional(),
3515
- message: z30.string().optional(),
3516
- errors: z30.array(z30.string()).optional()
3554
+ code: z31.string().optional(),
3555
+ message: z31.string().optional(),
3556
+ errors: z31.array(z31.string()).optional()
3517
3557
  });
3518
3558
  var PASSWORD_REGEX = /^(?=.*[a-zA-Z])(?=.*\d)(?=.*[!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?`~])[a-zA-Z\d!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?`~]+$/;
3519
- var UpdatePasswordRequestSchema = z30.object({
3520
- oldPassword: z30.string().optional(),
3521
- newPassword: z30.string().min(8, "Password must be at least 8 characters").max(100, "Password must be at most 100 characters").regex(PASSWORD_REGEX, "Password must contain at least one letter, one digit, and one special character"),
3522
- newPasswordConfirm: z30.string()
3559
+ var UpdatePasswordRequestSchema = z31.object({
3560
+ oldPassword: z31.string().optional(),
3561
+ newPassword: z31.string().min(8, "Password must be at least 8 characters").max(100, "Password must be at most 100 characters").regex(PASSWORD_REGEX, "Password must contain at least one letter, one digit, and one special character"),
3562
+ newPasswordConfirm: z31.string()
3523
3563
  }).refine((data) => data.newPassword === data.newPasswordConfirm, {
3524
3564
  message: "Passwords do not match",
3525
3565
  path: ["newPasswordConfirm"]
3526
3566
  });
3527
- var PasswordUpdateSuccessSchema = z30.object({
3528
- status: z30.literal("ok"),
3529
- message: z30.string(),
3530
- accessToken: z30.string(),
3531
- refreshToken: z30.string(),
3567
+ var PasswordUpdateSuccessSchema = z31.object({
3568
+ status: z31.literal("ok"),
3569
+ message: z31.string(),
3570
+ accessToken: z31.string(),
3571
+ refreshToken: z31.string(),
3532
3572
  /** Access-token lifetime in seconds. */
3533
- expiresIn: z30.number()
3573
+ expiresIn: z31.number()
3534
3574
  });
3535
- var PasswordErrorResponseSchema = z30.object({
3536
- status: z30.literal("error"),
3537
- message: z30.string(),
3538
- errors: z30.array(z30.string()).optional()
3575
+ var PasswordErrorResponseSchema = z31.object({
3576
+ status: z31.literal("error"),
3577
+ message: z31.string(),
3578
+ errors: z31.array(z31.string()).optional()
3539
3579
  });
3540
- var RecentlyViewedPagesResponseSchema = z30.object({
3541
- pages: z30.array(PageSchema)
3580
+ var RecentlyViewedPagesResponseSchema = z31.object({
3581
+ pages: z31.array(PageSchema)
3542
3582
  });
3543
3583
 
3544
3584
  // src/contracts/me.ts
@@ -3621,8 +3661,8 @@ var uploadPictureRoute = createRoute17({
3621
3661
  body: {
3622
3662
  content: {
3623
3663
  "multipart/form-data": {
3624
- schema: z31.object({
3625
- file: z31.any().optional().describe("Profile picture file")
3664
+ schema: z32.object({
3665
+ file: z32.any().optional().describe("Profile picture file")
3626
3666
  })
3627
3667
  }
3628
3668
  }
@@ -3722,37 +3762,37 @@ var meRoutes = {
3722
3762
  };
3723
3763
 
3724
3764
  // src/contracts/access-token.ts
3725
- import { createRoute as createRoute18, z as z33 } from "@hono/zod-openapi";
3765
+ import { createRoute as createRoute18, z as z34 } from "@hono/zod-openapi";
3726
3766
 
3727
3767
  // src/schemas/access-token.ts
3728
- import { z as z32 } from "@hono/zod-openapi";
3729
- var AccessTokenSchema = z32.object({
3730
- id: z32.string(),
3731
- name: z32.string(),
3732
- scopes: z32.array(z32.string()),
3768
+ import { z as z33 } from "@hono/zod-openapi";
3769
+ var AccessTokenSchema = z33.object({
3770
+ id: z33.string(),
3771
+ name: z33.string(),
3772
+ scopes: z33.array(z33.string()),
3733
3773
  /** ISO-8601 expiry, or `null` for a non-expiring token. */
3734
- expiresAt: z32.string().nullable(),
3774
+ expiresAt: z33.string().nullable(),
3735
3775
  /** ISO-8601 of last successful use, or `null` if never used. */
3736
- lastUsedAt: z32.string().nullable(),
3737
- createdAt: z32.string()
3776
+ lastUsedAt: z33.string().nullable(),
3777
+ createdAt: z33.string()
3738
3778
  });
3739
- var ListAccessTokensResponseSchema = z32.object({
3740
- accessTokens: z32.array(AccessTokenSchema)
3779
+ var ListAccessTokensResponseSchema = z33.object({
3780
+ accessTokens: z33.array(AccessTokenSchema)
3741
3781
  });
3742
- var CreateAccessTokenRequestSchema = z32.object({
3743
- name: z32.string().min(1, "Name is required").max(200),
3744
- scopes: z32.array(z32.string()).min(1, "At least one scope is required"),
3745
- expiresAt: z32.string().datetime().nullable().optional()
3782
+ var CreateAccessTokenRequestSchema = z33.object({
3783
+ name: z33.string().min(1, "Name is required").max(200),
3784
+ scopes: z33.array(z33.string()).min(1, "At least one scope is required"),
3785
+ expiresAt: z33.string().datetime().nullable().optional()
3746
3786
  });
3747
3787
  var CreateAccessTokenResponseSchema = AccessTokenSchema.extend({
3748
- token: z32.string()
3749
- });
3750
- var InvalidScopeErrorSchema = z32.object({
3751
- error: z32.object({
3752
- code: z32.literal("INVALID_SCOPE"),
3753
- message: z32.string(),
3754
- details: z32.object({
3755
- invalidScopes: z32.array(z32.string())
3788
+ token: z33.string()
3789
+ });
3790
+ var InvalidScopeErrorSchema = z33.object({
3791
+ error: z33.object({
3792
+ code: z33.literal("INVALID_SCOPE"),
3793
+ message: z33.string(),
3794
+ details: z33.object({
3795
+ invalidScopes: z33.array(z33.string())
3756
3796
  }).optional()
3757
3797
  })
3758
3798
  });
@@ -3824,7 +3864,7 @@ var deleteAccessTokenRoute = createRoute18({
3824
3864
  security: [{ bearerAuth: [] }],
3825
3865
  summary: "Revoke a personal access token",
3826
3866
  request: {
3827
- params: z33.object({ id: z33.string() })
3867
+ params: z34.object({ id: z34.string() })
3828
3868
  },
3829
3869
  responses: {
3830
3870
  200: {
@@ -3856,13 +3896,13 @@ var accessTokenRoutes = {
3856
3896
  };
3857
3897
 
3858
3898
  // src/contracts/oauth.ts
3859
- import { createRoute as createRoute19, z as z36 } from "@hono/zod-openapi";
3899
+ import { createRoute as createRoute19, z as z37 } from "@hono/zod-openapi";
3860
3900
 
3861
3901
  // src/schemas/oauth-endpoints.ts
3862
- import { z as z35 } from "@hono/zod-openapi";
3902
+ import { z as z36 } from "@hono/zod-openapi";
3863
3903
 
3864
3904
  // src/schemas/oauth.ts
3865
- import { z as z34 } from "@hono/zod-openapi";
3905
+ import { z as z35 } from "@hono/zod-openapi";
3866
3906
  var SCOPES = [
3867
3907
  // umbrella
3868
3908
  "read",
@@ -3930,11 +3970,11 @@ function scopeSatisfies(required, granted) {
3930
3970
  return false;
3931
3971
  }
3932
3972
  var InsufficientScopeErrorSchema = ApiErrorSchema.extend({
3933
- error: z34.object({
3934
- code: z34.literal("INSUFFICIENT_SCOPE"),
3935
- message: z34.string(),
3936
- details: z34.object({
3937
- requiredScope: z34.string()
3973
+ error: z35.object({
3974
+ code: z35.literal("INSUFFICIENT_SCOPE"),
3975
+ message: z35.string(),
3976
+ details: z35.object({
3977
+ requiredScope: z35.string()
3938
3978
  }).optional()
3939
3979
  })
3940
3980
  });
@@ -3953,97 +3993,97 @@ var OAUTH_ERROR_CODES = [
3953
3993
  "slow_down",
3954
3994
  "expired_token"
3955
3995
  ];
3956
- var OAuthErrorSchema = z35.object({
3957
- error: z35.enum(OAUTH_ERROR_CODES),
3958
- error_description: z35.string().optional()
3959
- });
3960
- var AuthorizeRequestSchema = z35.object({
3961
- client_id: z35.string().min(1),
3962
- redirect_uri: z35.string().min(1),
3963
- scope: z35.string().min(1),
3964
- code_challenge: z35.string().min(1),
3965
- code_challenge_method: z35.literal("S256"),
3966
- state: z35.string().optional()
3967
- });
3968
- var AuthorizeResponseSchema = z35.object({
3969
- redirectUri: z35.string()
3970
- });
3971
- var TokenRequestSchema = z35.discriminatedUnion("grant_type", [
3972
- z35.object({
3973
- grant_type: z35.literal("authorization_code"),
3974
- code: z35.string().min(1),
3975
- code_verifier: z35.string().min(1),
3976
- redirect_uri: z35.string().min(1),
3977
- client_id: z35.string().min(1)
3996
+ var OAuthErrorSchema = z36.object({
3997
+ error: z36.enum(OAUTH_ERROR_CODES),
3998
+ error_description: z36.string().optional()
3999
+ });
4000
+ var AuthorizeRequestSchema = z36.object({
4001
+ client_id: z36.string().min(1),
4002
+ redirect_uri: z36.string().min(1),
4003
+ scope: z36.string().min(1),
4004
+ code_challenge: z36.string().min(1),
4005
+ code_challenge_method: z36.literal("S256"),
4006
+ state: z36.string().optional()
4007
+ });
4008
+ var AuthorizeResponseSchema = z36.object({
4009
+ redirectUri: z36.string()
4010
+ });
4011
+ var TokenRequestSchema = z36.discriminatedUnion("grant_type", [
4012
+ z36.object({
4013
+ grant_type: z36.literal("authorization_code"),
4014
+ code: z36.string().min(1),
4015
+ code_verifier: z36.string().min(1),
4016
+ redirect_uri: z36.string().min(1),
4017
+ client_id: z36.string().min(1)
3978
4018
  }),
3979
- z35.object({
3980
- grant_type: z35.literal("refresh_token"),
3981
- refresh_token: z35.string().min(1),
3982
- client_id: z35.string().min(1),
3983
- scope: z35.string().optional()
4019
+ z36.object({
4020
+ grant_type: z36.literal("refresh_token"),
4021
+ refresh_token: z36.string().min(1),
4022
+ client_id: z36.string().min(1),
4023
+ scope: z36.string().optional()
3984
4024
  }),
3985
4025
  // RFC 8628 §3.4 — device authorization grant. The client polls with the
3986
4026
  // opaque `device_code` returned by `/oauth/device/authorize`.
3987
- z35.object({
3988
- grant_type: z35.literal("urn:ietf:params:oauth:grant-type:device_code"),
3989
- device_code: z35.string().min(1),
3990
- client_id: z35.string().min(1)
4027
+ z36.object({
4028
+ grant_type: z36.literal("urn:ietf:params:oauth:grant-type:device_code"),
4029
+ device_code: z36.string().min(1),
4030
+ client_id: z36.string().min(1)
3991
4031
  })
3992
4032
  ]);
3993
4033
  var DEVICE_CODE_GRANT_TYPE = "urn:ietf:params:oauth:grant-type:device_code";
3994
- var TokenResponseSchema = z35.object({
3995
- access_token: z35.string(),
3996
- token_type: z35.literal("Bearer"),
3997
- expires_in: z35.number(),
3998
- refresh_token: z35.string(),
3999
- scope: z35.string()
4000
- });
4001
- var RevokeRequestSchema = z35.object({
4002
- token: z35.string().min(1),
4003
- token_type_hint: z35.string().optional()
4004
- });
4005
- var RevokeResponseSchema = z35.object({});
4006
- var DeviceAuthorizeRequestSchema = z35.object({
4007
- client_id: z35.string().min(1),
4008
- scope: z35.string().min(1)
4009
- });
4010
- var DeviceAuthorizeResponseSchema = z35.object({
4011
- device_code: z35.string(),
4012
- user_code: z35.string(),
4013
- verification_uri: z35.string(),
4014
- verification_uri_complete: z35.string(),
4015
- expires_in: z35.number(),
4016
- interval: z35.number()
4017
- });
4018
- var DeviceVerifyRequestSchema = z35.object({
4019
- user_code: z35.string().min(1),
4020
- action: z35.enum(["approve", "deny"])
4021
- });
4022
- var DeviceVerifyResponseSchema = z35.object({
4023
- status: z35.enum(["approved", "denied"])
4024
- });
4025
- var DeviceInfoResponseSchema = z35.object({
4026
- client_id: z35.string(),
4027
- scopes: z35.array(z35.string())
4028
- });
4029
- var ClientInfoResponseSchema = z35.object({
4030
- clientId: z35.string(),
4031
- name: z35.string(),
4032
- firstParty: z35.boolean(),
4033
- trusted: z35.boolean()
4034
+ var TokenResponseSchema = z36.object({
4035
+ access_token: z36.string(),
4036
+ token_type: z36.literal("Bearer"),
4037
+ expires_in: z36.number(),
4038
+ refresh_token: z36.string(),
4039
+ scope: z36.string()
4040
+ });
4041
+ var RevokeRequestSchema = z36.object({
4042
+ token: z36.string().min(1),
4043
+ token_type_hint: z36.string().optional()
4044
+ });
4045
+ var RevokeResponseSchema = z36.object({});
4046
+ var DeviceAuthorizeRequestSchema = z36.object({
4047
+ client_id: z36.string().min(1),
4048
+ scope: z36.string().min(1)
4049
+ });
4050
+ var DeviceAuthorizeResponseSchema = z36.object({
4051
+ device_code: z36.string(),
4052
+ user_code: z36.string(),
4053
+ verification_uri: z36.string(),
4054
+ verification_uri_complete: z36.string(),
4055
+ expires_in: z36.number(),
4056
+ interval: z36.number()
4057
+ });
4058
+ var DeviceVerifyRequestSchema = z36.object({
4059
+ user_code: z36.string().min(1),
4060
+ action: z36.enum(["approve", "deny"])
4061
+ });
4062
+ var DeviceVerifyResponseSchema = z36.object({
4063
+ status: z36.enum(["approved", "denied"])
4064
+ });
4065
+ var DeviceInfoResponseSchema = z36.object({
4066
+ client_id: z36.string(),
4067
+ scopes: z36.array(z36.string())
4068
+ });
4069
+ var ClientInfoResponseSchema = z36.object({
4070
+ clientId: z36.string(),
4071
+ name: z36.string(),
4072
+ firstParty: z36.boolean(),
4073
+ trusted: z36.boolean()
4034
4074
  });
4035
4075
  var GRANT_TYPES_SUPPORTED = ["authorization_code", "refresh_token", DEVICE_CODE_GRANT_TYPE];
4036
- var DiscoveryResponseSchema = z35.object({
4037
- issuer: z35.string(),
4038
- authorization_endpoint: z35.string(),
4039
- token_endpoint: z35.string(),
4040
- revocation_endpoint: z35.string(),
4041
- device_authorization_endpoint: z35.string().optional(),
4042
- scopes_supported: z35.array(z35.string()),
4043
- response_types_supported: z35.array(z35.string()),
4044
- grant_types_supported: z35.array(z35.string()),
4045
- code_challenge_methods_supported: z35.array(z35.string()),
4046
- token_endpoint_auth_methods_supported: z35.array(z35.string())
4076
+ var DiscoveryResponseSchema = z36.object({
4077
+ issuer: z36.string(),
4078
+ authorization_endpoint: z36.string(),
4079
+ token_endpoint: z36.string(),
4080
+ revocation_endpoint: z36.string(),
4081
+ device_authorization_endpoint: z36.string().optional(),
4082
+ scopes_supported: z36.array(z36.string()),
4083
+ response_types_supported: z36.array(z36.string()),
4084
+ grant_types_supported: z36.array(z36.string()),
4085
+ code_challenge_methods_supported: z36.array(z36.string()),
4086
+ token_endpoint_auth_methods_supported: z36.array(z36.string())
4047
4087
  });
4048
4088
  var DISCOVERY_SCOPES_SUPPORTED = ISSUABLE_SCOPES;
4049
4089
 
@@ -4179,7 +4219,7 @@ var deviceInfoRoute = createRoute19({
4179
4219
  // scopes so the web consent screen can show them before approval. Reveals
4180
4220
  // no secret. Unknown / expired / non-pending → 404 (PHASE4-Q9 option A).
4181
4221
  request: {
4182
- query: z36.object({ user_code: z36.string().min(1) })
4222
+ query: z37.object({ user_code: z37.string().min(1) })
4183
4223
  },
4184
4224
  responses: {
4185
4225
  200: {
@@ -4233,7 +4273,7 @@ var clientInfoRoute = createRoute19({
4233
4273
  // no redirectUris/allowedScopes — mirroring deviceInfoRoute's own
4234
4274
  // non-secret-lookup shape. Unknown client_id → 404.
4235
4275
  request: {
4236
- query: z36.object({ client_id: z36.string().min(1) })
4276
+ query: z37.object({ client_id: z37.string().min(1) })
4237
4277
  },
4238
4278
  responses: {
4239
4279
  200: {
@@ -4258,24 +4298,24 @@ var oauthRoutes = {
4258
4298
  };
4259
4299
 
4260
4300
  // src/contracts/notification.ts
4261
- import { createRoute as createRoute20, z as z38 } from "@hono/zod-openapi";
4301
+ import { createRoute as createRoute20, z as z39 } from "@hono/zod-openapi";
4262
4302
 
4263
4303
  // src/schemas/notification.ts
4264
- import { z as z37 } from "@hono/zod-openapi";
4265
- var NotificationStatusSchema = z37.enum(["UNREAD", "UNOPENED", "OPENED"]);
4304
+ import { z as z38 } from "@hono/zod-openapi";
4305
+ var NotificationStatusSchema = z38.enum(["UNREAD", "UNOPENED", "OPENED"]);
4266
4306
  var NotificationStatusEnum = {
4267
4307
  UNREAD: "UNREAD",
4268
4308
  UNOPENED: "UNOPENED",
4269
4309
  OPENED: "OPENED"
4270
4310
  };
4271
- var NotificationActionSchema = z37.enum(["COMMENT", "LIKE", "MENTION", "UPDATE"]);
4311
+ var NotificationActionSchema = z38.enum(["COMMENT", "LIKE", "MENTION", "UPDATE"]);
4272
4312
  var NotificationActionEnum = {
4273
4313
  COMMENT: "COMMENT",
4274
4314
  LIKE: "LIKE",
4275
4315
  MENTION: "MENTION",
4276
4316
  UPDATE: "UPDATE"
4277
4317
  };
4278
- var NotificationTargetModelSchema = z37.enum(["Page"]);
4318
+ var NotificationTargetModelSchema = z38.enum(["Page"]);
4279
4319
  var NotificationTargetModelEnum = {
4280
4320
  PAGE: "Page"
4281
4321
  };
@@ -4284,68 +4324,68 @@ var PageRefSchema = PageSchema.pick({
4284
4324
  path: true,
4285
4325
  status: true
4286
4326
  });
4287
- var NotificationSchema = z37.object({
4288
- _id: z37.string(),
4289
- user: z37.string(),
4327
+ var NotificationSchema = z38.object({
4328
+ _id: z38.string(),
4329
+ user: z38.string(),
4290
4330
  targetModel: NotificationTargetModelSchema,
4291
4331
  target: PageRefSchema,
4292
4332
  action: NotificationActionSchema,
4293
4333
  status: NotificationStatusSchema,
4294
- actionUsers: z37.array(UserPublicSchema),
4295
- createdAt: z37.string()
4334
+ actionUsers: z38.array(UserPublicSchema),
4335
+ createdAt: z38.string()
4296
4336
  });
4297
- var ListNotificationsRequestSchema = z37.object({
4298
- limit: z37.coerce.number().optional().default(10),
4299
- offset: z37.coerce.number().optional().default(0)
4337
+ var ListNotificationsRequestSchema = z38.object({
4338
+ limit: z38.coerce.number().optional().default(10),
4339
+ offset: z38.coerce.number().optional().default(0)
4300
4340
  });
4301
- var ListNotificationsResponseSchema = z37.object({
4302
- notifications: z37.array(NotificationSchema),
4341
+ var ListNotificationsResponseSchema = z38.object({
4342
+ notifications: z38.array(NotificationSchema),
4303
4343
  pager: PagerSchema
4304
4344
  });
4305
- var MarkAllAsReadResponseSchema = z37.object({
4306
- ok: z37.literal(true)
4345
+ var MarkAllAsReadResponseSchema = z38.object({
4346
+ ok: z38.literal(true)
4307
4347
  });
4308
- var OpenNotificationParamSchema = z37.object({
4309
- id: z37.string()
4348
+ var OpenNotificationParamSchema = z38.object({
4349
+ id: z38.string()
4310
4350
  });
4311
- var OpenNotificationResponseSchema = z37.object({
4351
+ var OpenNotificationResponseSchema = z38.object({
4312
4352
  notification: NotificationSchema
4313
4353
  });
4314
- var NotificationStatusResponseSchema = z37.object({
4315
- count: z37.number()
4354
+ var NotificationStatusResponseSchema = z38.object({
4355
+ count: z38.number()
4316
4356
  });
4317
- var NotificationNotFoundErrorSchema = z37.object({
4318
- error: z37.object({
4319
- code: z37.literal("NOTIFICATION_NOT_FOUND"),
4320
- message: z37.literal("Notification not found")
4357
+ var NotificationNotFoundErrorSchema = z38.object({
4358
+ error: z38.object({
4359
+ code: z38.literal("NOTIFICATION_NOT_FOUND"),
4360
+ message: z38.literal("Notification not found")
4321
4361
  })
4322
4362
  });
4323
- var NotificationsTokenResponseSchema = z37.object({
4324
- token: z37.string(),
4325
- selfUserId: z37.string(),
4326
- expiresAt: z37.string()
4363
+ var NotificationsTokenResponseSchema = z38.object({
4364
+ token: z38.string(),
4365
+ selfUserId: z38.string(),
4366
+ expiresAt: z38.string()
4327
4367
  });
4328
- var NotificationsTokenPayloadSchema = z37.object({
4329
- selfUserId: z37.string(),
4368
+ var NotificationsTokenPayloadSchema = z38.object({
4369
+ selfUserId: z38.string(),
4330
4370
  // Random UUID mixed into every signed token so two tokens minted
4331
4371
  // within the same second still produce byte-different JWT strings.
4332
4372
  // The browser uses the token as a React effect dependency to drive
4333
4373
  // the WebSocket reconnect — without `jti`, the iat/exp pair is
4334
4374
  // identical at second granularity and the dep stays stable.
4335
- jti: z37.string().uuid(),
4336
- iat: z37.number().int(),
4337
- exp: z37.number().int()
4375
+ jti: z38.string().uuid(),
4376
+ iat: z38.number().int(),
4377
+ exp: z38.number().int()
4338
4378
  });
4339
- var NotificationsChangedMessageSchema = z37.object({
4340
- type: z37.literal("changed")
4379
+ var NotificationsChangedMessageSchema = z38.object({
4380
+ type: z38.literal("changed")
4341
4381
  });
4342
4382
  var NotificationsServerMessageSchema = NotificationsChangedMessageSchema;
4343
4383
 
4344
4384
  // src/contracts/notification.ts
4345
- var NotificationInvalidRequestErrorSchema = z38.object({
4346
- error: z38.object({
4347
- code: z38.literal("INVALID_REQUEST"),
4348
- message: z38.string()
4385
+ var NotificationInvalidRequestErrorSchema = z39.object({
4386
+ error: z39.object({
4387
+ code: z39.literal("INVALID_REQUEST"),
4388
+ message: z39.string()
4349
4389
  })
4350
4390
  });
4351
4391
  var listNotificationsRoute = createRoute20({
@@ -4481,9 +4521,9 @@ var notificationRoutes = {
4481
4521
  };
4482
4522
 
4483
4523
  // src/contracts/page-collab.ts
4484
- import { createRoute as createRoute21, z as z39 } from "@hono/zod-openapi";
4485
- var PageIdPathParamsSchema2 = z39.object({
4486
- id: z39.string().openapi({ description: "Page id (24-char hex ObjectId)", example: "507f1f77bcf86cd799439011" })
4524
+ import { createRoute as createRoute21, z as z40 } from "@hono/zod-openapi";
4525
+ var PageIdPathParamsSchema2 = z40.object({
4526
+ id: z40.string().openapi({ description: "Page id (24-char hex ObjectId)", example: "507f1f77bcf86cd799439011" })
4487
4527
  });
4488
4528
  var getYjsTokenRoute = createRoute21({
4489
4529
  method: "get",
@@ -4522,25 +4562,25 @@ var pageCollabRoutes = {
4522
4562
  };
4523
4563
 
4524
4564
  // src/contracts/page.ts
4525
- import { createRoute as createRoute22, z as z40 } from "@hono/zod-openapi";
4526
- var PageBadRequestErrorSchema = z40.object({
4527
- error: z40.object({
4528
- code: z40.string(),
4529
- message: z40.string()
4565
+ import { createRoute as createRoute22, z as z41 } from "@hono/zod-openapi";
4566
+ var PageBadRequestErrorSchema = z41.object({
4567
+ error: z41.object({
4568
+ code: z41.string(),
4569
+ message: z41.string()
4530
4570
  })
4531
4571
  });
4532
- var DeletePageRequestSchema = z40.object({
4533
- page_id: z40.string(),
4534
- revision_id: z40.string().optional(),
4535
- completely: z40.boolean().optional()
4572
+ var DeletePageRequestSchema = z41.object({
4573
+ page_id: z41.string(),
4574
+ revision_id: z41.string().optional(),
4575
+ completely: z41.boolean().optional()
4536
4576
  });
4537
- var RevertDeletedPageRequestSchema = z40.object({
4538
- page_id: z40.string()
4577
+ var RevertDeletedPageRequestSchema = z41.object({
4578
+ page_id: z41.string()
4539
4579
  });
4540
- var PageIdBodySchema = z40.object({
4541
- page_id: z40.string()
4580
+ var PageIdBodySchema = z41.object({
4581
+ page_id: z41.string()
4542
4582
  });
4543
- var PageResponseSchema = z40.object({ page: PageSchema });
4583
+ var PageResponseSchema = z41.object({ page: PageSchema });
4544
4584
  var getPageRoute = createRoute22({
4545
4585
  method: "get",
4546
4586
  path: "/pages",
@@ -4854,7 +4894,7 @@ var claimPageLinkAccessRoute = createRoute22({
4854
4894
  description: "The caller has no access to the page (isGrantedFor is false) or lacks scope / is a non-web session \u2014 403 is about the caller lacking access, never about the page grant type per se",
4855
4895
  content: {
4856
4896
  "application/json": {
4857
- schema: z40.union([PageNotGrantedErrorSchema, InsufficientScopeErrorSchema])
4897
+ schema: z41.union([PageNotGrantedErrorSchema, InsufficientScopeErrorSchema])
4858
4898
  }
4859
4899
  }
4860
4900
  },
@@ -5044,7 +5084,7 @@ var renamePageRoute = createRoute22({
5044
5084
  description: "PAGE_INVALID_NAME / PAGE_EXISTS / PAGE_RENAME_FAILED / PAGE_RENAME_TREE_FAILED",
5045
5085
  content: {
5046
5086
  "application/json": {
5047
- schema: z40.union([PageBadRequestErrorSchema, RenameTreeErrorSchema])
5087
+ schema: z41.union([PageBadRequestErrorSchema, RenameTreeErrorSchema])
5048
5088
  }
5049
5089
  }
5050
5090
  },
@@ -5082,7 +5122,7 @@ var renameSubtreeRoute = createRoute22({
5082
5122
  description: "PAGE_INVALID_NAME / PAGE_RENAME_TREE_FAILED (collisions, nothing to move, or partial failure)",
5083
5123
  content: {
5084
5124
  "application/json": {
5085
- schema: z40.union([PageBadRequestErrorSchema, RenameTreeErrorSchema])
5125
+ schema: z41.union([PageBadRequestErrorSchema, RenameTreeErrorSchema])
5086
5126
  }
5087
5127
  }
5088
5128
  },
@@ -5135,11 +5175,11 @@ var pageRoutes = {
5135
5175
  import { createRoute as createRoute23 } from "@hono/zod-openapi";
5136
5176
 
5137
5177
  // src/schemas/page-preview.ts
5138
- import { z as z41 } from "@hono/zod-openapi";
5139
- var PreviewPageRequestSchema = z41.object({
5140
- body: z41.string()
5178
+ import { z as z42 } from "@hono/zod-openapi";
5179
+ var PreviewPageRequestSchema = z42.object({
5180
+ body: z42.string()
5141
5181
  });
5142
- var PreviewPageResponseSchema = z41.object({
5182
+ var PreviewPageResponseSchema = z42.object({
5143
5183
  renderedAst: RenderedAstValueSchema.optional(),
5144
5184
  renderedAstArtifactKey: RenderedAstArtifactKeySchema.optional()
5145
5185
  });
@@ -5183,78 +5223,78 @@ var pagePreviewRoutes = {
5183
5223
  };
5184
5224
 
5185
5225
  // src/contracts/presence.ts
5186
- import { createRoute as createRoute24, z as z43 } from "@hono/zod-openapi";
5226
+ import { createRoute as createRoute24, z as z44 } from "@hono/zod-openapi";
5187
5227
 
5188
5228
  // src/schemas/presence.ts
5189
- import { z as z42 } from "@hono/zod-openapi";
5190
- var PresenceTokenResponseSchema = z42.object({
5191
- token: z42.string(),
5192
- pageId: z42.string(),
5193
- selfUserId: z42.string(),
5194
- expiresAt: z42.string()
5195
- });
5196
- var PresenceTokenPayloadSchema = z42.object({
5197
- userId: z42.string(),
5198
- pageId: z42.string(),
5199
- iat: z42.number().int(),
5200
- exp: z42.number().int()
5201
- });
5202
- var PresenceViewerSchema = z42.object({
5203
- userId: z42.string(),
5204
- username: z42.string(),
5205
- displayName: z42.string(),
5206
- avatarUrl: z42.string().nullable(),
5207
- isEditing: z42.boolean(),
5208
- joinedAt: z42.number().int()
5209
- });
5210
- var PresenceHeartbeatMessageSchema = z42.object({
5211
- type: z42.literal("heartbeat")
5229
+ import { z as z43 } from "@hono/zod-openapi";
5230
+ var PresenceTokenResponseSchema = z43.object({
5231
+ token: z43.string(),
5232
+ pageId: z43.string(),
5233
+ selfUserId: z43.string(),
5234
+ expiresAt: z43.string()
5235
+ });
5236
+ var PresenceTokenPayloadSchema = z43.object({
5237
+ userId: z43.string(),
5238
+ pageId: z43.string(),
5239
+ iat: z43.number().int(),
5240
+ exp: z43.number().int()
5241
+ });
5242
+ var PresenceViewerSchema = z43.object({
5243
+ userId: z43.string(),
5244
+ username: z43.string(),
5245
+ displayName: z43.string(),
5246
+ avatarUrl: z43.string().nullable(),
5247
+ isEditing: z43.boolean(),
5248
+ joinedAt: z43.number().int()
5249
+ });
5250
+ var PresenceHeartbeatMessageSchema = z43.object({
5251
+ type: z43.literal("heartbeat")
5212
5252
  });
5213
5253
  var PresenceClientMessageSchema = PresenceHeartbeatMessageSchema;
5214
- var PresenceViewersMessageSchema = z42.object({
5215
- type: z42.literal("viewers"),
5216
- viewers: z42.array(PresenceViewerSchema),
5217
- generation: z42.number().int()
5218
- });
5219
- var PresencePageUpdatedMessageSchema = z42.object({
5220
- type: z42.literal("page-updated"),
5221
- pageId: z42.string(),
5222
- revisionId: z42.string(),
5223
- editorUserId: z42.string(),
5224
- editorDisplayName: z42.string()
5225
- });
5226
- var PresenceCommentChangedMessageSchema = z42.object({
5227
- type: z42.literal("comment-changed"),
5228
- pageId: z42.string(),
5229
- changeType: z42.enum(["added", "removed"]),
5230
- commentId: z42.string(),
5231
- actorUserId: z42.string().optional()
5232
- });
5233
- var PresenceServerMessageSchema = z42.discriminatedUnion("type", [
5254
+ var PresenceViewersMessageSchema = z43.object({
5255
+ type: z43.literal("viewers"),
5256
+ viewers: z43.array(PresenceViewerSchema),
5257
+ generation: z43.number().int()
5258
+ });
5259
+ var PresencePageUpdatedMessageSchema = z43.object({
5260
+ type: z43.literal("page-updated"),
5261
+ pageId: z43.string(),
5262
+ revisionId: z43.string(),
5263
+ editorUserId: z43.string(),
5264
+ editorDisplayName: z43.string()
5265
+ });
5266
+ var PresenceCommentChangedMessageSchema = z43.object({
5267
+ type: z43.literal("comment-changed"),
5268
+ pageId: z43.string(),
5269
+ changeType: z43.enum(["added", "removed"]),
5270
+ commentId: z43.string(),
5271
+ actorUserId: z43.string().optional()
5272
+ });
5273
+ var PresenceServerMessageSchema = z43.discriminatedUnion("type", [
5234
5274
  PresenceViewersMessageSchema,
5235
5275
  PresencePageUpdatedMessageSchema,
5236
5276
  PresenceCommentChangedMessageSchema
5237
5277
  ]);
5238
- var LikerSchema = z42.object({
5239
- id: z42.string(),
5240
- username: z42.string(),
5241
- displayName: z42.string(),
5242
- avatarUrl: z42.string().nullable(),
5243
- likedAt: z42.string().nullable()
5244
- });
5245
- var LikersResponseSchema = z42.object({
5246
- users: z42.array(LikerSchema),
5247
- totalCount: z42.number().int().nonnegative()
5248
- });
5249
- var GetLikersRequestSchema = z42.object({
5278
+ var LikerSchema = z43.object({
5279
+ id: z43.string(),
5280
+ username: z43.string(),
5281
+ displayName: z43.string(),
5282
+ avatarUrl: z43.string().nullable(),
5283
+ likedAt: z43.string().nullable()
5284
+ });
5285
+ var LikersResponseSchema = z43.object({
5286
+ users: z43.array(LikerSchema),
5287
+ totalCount: z43.number().int().nonnegative()
5288
+ });
5289
+ var GetLikersRequestSchema = z43.object({
5250
5290
  // Optional cap on returned `users`. `totalCount` always reflects the
5251
5291
  // full count regardless of `limit`. Omit for the full list.
5252
- limit: z42.coerce.number().int().positive().optional()
5292
+ limit: z43.coerce.number().int().positive().optional()
5253
5293
  });
5254
5294
 
5255
5295
  // src/contracts/presence.ts
5256
- var PageIdPathParamsSchema3 = z43.object({
5257
- id: z43.string().openapi({ description: "Page id (24-char hex ObjectId)", example: "507f1f77bcf86cd799439011" })
5296
+ var PageIdPathParamsSchema3 = z44.object({
5297
+ id: z44.string().openapi({ description: "Page id (24-char hex ObjectId)", example: "507f1f77bcf86cd799439011" })
5258
5298
  });
5259
5299
  var getPresenceTokenRoute = createRoute24({
5260
5300
  method: "get",
@@ -5327,49 +5367,49 @@ var presenceRoutes = {
5327
5367
  };
5328
5368
 
5329
5369
  // src/contracts/revision.ts
5330
- import { createRoute as createRoute25, z as z45 } from "@hono/zod-openapi";
5370
+ import { createRoute as createRoute25, z as z46 } from "@hono/zod-openapi";
5331
5371
 
5332
5372
  // src/schemas/revision.ts
5333
- import { z as z44 } from "@hono/zod-openapi";
5334
- var RevisionMetaSchema = z44.object({
5335
- _id: z44.string(),
5336
- path: z44.string(),
5373
+ import { z as z45 } from "@hono/zod-openapi";
5374
+ var RevisionMetaSchema = z45.object({
5375
+ _id: z45.string(),
5376
+ path: z45.string(),
5337
5377
  author: PageUserSchema.nullable().optional(),
5338
5378
  savedBy: PageUserSchema.nullable().optional(),
5339
- contributors: z44.array(PageUserSchema).optional(),
5379
+ contributors: z45.array(PageUserSchema).optional(),
5340
5380
  // RFC-0010 — edit channel. `web` (browser / collab editor) vs the API
5341
5381
  // token paths (`oauth` / `pat`). Absent on pre-RFC-0010 revisions. The
5342
5382
  // history UI shows an "app" chip for the token paths.
5343
- editVia: z44.enum(["web", "oauth", "pat"]).optional(),
5344
- createdAt: z44.string()
5383
+ editVia: z45.enum(["web", "oauth", "pat"]).optional(),
5384
+ createdAt: z45.string()
5345
5385
  });
5346
- var ListRevisionsRequestSchema = z44.object({
5347
- limit: z44.coerce.number().int().positive().max(200).optional().default(50),
5348
- offset: z44.coerce.number().int().min(0).optional().default(0)
5386
+ var ListRevisionsRequestSchema = z45.object({
5387
+ limit: z45.coerce.number().int().positive().max(200).optional().default(50),
5388
+ offset: z45.coerce.number().int().min(0).optional().default(0)
5349
5389
  });
5350
- var ListRevisionsResponseSchema = z44.object({
5351
- revisions: z44.array(RevisionMetaSchema),
5390
+ var ListRevisionsResponseSchema = z45.object({
5391
+ revisions: z45.array(RevisionMetaSchema),
5352
5392
  pager: PagerSchema
5353
5393
  });
5354
- var GetRevisionResponseSchema = z44.object({
5394
+ var GetRevisionResponseSchema = z45.object({
5355
5395
  revision: RevisionSchema
5356
5396
  });
5357
- var GetRevisionsRequestSchema = z44.object({
5358
- ids: z44.string().min(1, "ids is required")
5397
+ var GetRevisionsRequestSchema = z45.object({
5398
+ ids: z45.string().min(1, "ids is required")
5359
5399
  });
5360
- var GetRevisionsResponseSchema = z44.object({
5361
- revisions: z44.array(RevisionSchema)
5400
+ var GetRevisionsResponseSchema = z45.object({
5401
+ revisions: z45.array(RevisionSchema)
5362
5402
  });
5363
- var RevisionInvalidRequestErrorSchema = z44.object({
5364
- error: z44.object({
5365
- code: z44.literal("INVALID_REQUEST"),
5366
- message: z44.string()
5403
+ var RevisionInvalidRequestErrorSchema = z45.object({
5404
+ error: z45.object({
5405
+ code: z45.literal("INVALID_REQUEST"),
5406
+ message: z45.string()
5367
5407
  })
5368
5408
  });
5369
5409
 
5370
5410
  // src/contracts/revision.ts
5371
- var PageIdParamSchema = z45.object({ page_id: z45.string() });
5372
- var RevisionIdParamSchema = z45.object({ id: z45.string() });
5411
+ var PageIdParamSchema = z46.object({ page_id: z46.string() });
5412
+ var RevisionIdParamSchema = z46.object({ id: z46.string() });
5373
5413
  var listRevisionsRoute = createRoute25({
5374
5414
  method: "get",
5375
5415
  path: "/pages/{page_id}/revisions",
@@ -5468,31 +5508,31 @@ var revisionRoutes = {
5468
5508
  import { createRoute as createRoute26 } from "@hono/zod-openapi";
5469
5509
 
5470
5510
  // src/schemas/admin-crypto.ts
5471
- import { z as z46 } from "@hono/zod-openapi";
5472
- var SensitiveConfigEntrySchema = z46.object({
5473
- ns: z46.string(),
5474
- key: z46.string(),
5475
- present: z46.boolean(),
5476
- encrypted: z46.boolean()
5477
- });
5478
- var CryptoStatusResponseSchema = z46.object({
5511
+ import { z as z47 } from "@hono/zod-openapi";
5512
+ var SensitiveConfigEntrySchema = z47.object({
5513
+ ns: z47.string(),
5514
+ key: z47.string(),
5515
+ present: z47.boolean(),
5516
+ encrypted: z47.boolean()
5517
+ });
5518
+ var CryptoStatusResponseSchema = z47.object({
5479
5519
  /** False when CROWI_ENCRYPTION_KEY is not configured — UI shows a setup hint. */
5480
- encryptionConfigured: z46.boolean(),
5481
- unencryptedCount: z46.number().int().min(0),
5482
- encryptedCount: z46.number().int().min(0),
5483
- entries: z46.array(SensitiveConfigEntrySchema)
5520
+ encryptionConfigured: z47.boolean(),
5521
+ unencryptedCount: z47.number().int().min(0),
5522
+ encryptedCount: z47.number().int().min(0),
5523
+ entries: z47.array(SensitiveConfigEntrySchema)
5484
5524
  });
5485
- var ReencryptResponseSchema = z46.object({
5486
- rewritten: z46.number().int().min(0),
5525
+ var ReencryptResponseSchema = z47.object({
5526
+ rewritten: z47.number().int().min(0),
5487
5527
  /** Already encrypted, skipped on this run. */
5488
- alreadyEncrypted: z46.number().int().min(0),
5528
+ alreadyEncrypted: z47.number().int().min(0),
5489
5529
  /** Sensitive registry entries that had no row in the DB at all. */
5490
- missing: z46.number().int().min(0)
5530
+ missing: z47.number().int().min(0)
5491
5531
  });
5492
- var EncryptionNotConfiguredErrorSchema = z46.object({
5493
- error: z46.object({
5494
- code: z46.literal("ENCRYPTION_NOT_CONFIGURED"),
5495
- message: z46.string()
5532
+ var EncryptionNotConfiguredErrorSchema = z47.object({
5533
+ error: z47.object({
5534
+ code: z47.literal("ENCRYPTION_NOT_CONFIGURED"),
5535
+ message: z47.string()
5496
5536
  })
5497
5537
  });
5498
5538
 
@@ -5560,30 +5600,30 @@ var adminCryptoRoutes = {
5560
5600
  import { createRoute as createRoute27 } from "@hono/zod-openapi";
5561
5601
 
5562
5602
  // src/schemas/search.ts
5563
- import { z as z48 } from "@hono/zod-openapi";
5564
- var SearchPageTypeSchema = z48.enum(["portal", "public", "user"]);
5565
- var SearchPagesRequestSchema = z48.object({
5566
- q: z48.string().min(1),
5567
- tree: z48.string().optional(),
5603
+ import { z as z49 } from "@hono/zod-openapi";
5604
+ var SearchPageTypeSchema = z49.enum(["portal", "public", "user"]);
5605
+ var SearchPagesRequestSchema = z49.object({
5606
+ q: z49.string().min(1),
5607
+ tree: z49.string().optional(),
5568
5608
  type: SearchPageTypeSchema.optional(),
5569
- page: z48.coerce.number().int().min(1).default(1),
5570
- limit: z48.coerce.number().int().min(1).max(100).default(50)
5571
- });
5572
- var SearchHitSchema = z48.object({
5573
- pageId: z48.string(),
5574
- path: z48.string(),
5575
- score: z48.number().optional(),
5576
- snippet: z48.string().optional(),
5577
- bookmarkCount: z48.number(),
5609
+ page: z49.coerce.number().int().min(1).default(1),
5610
+ limit: z49.coerce.number().int().min(1).max(100).default(50)
5611
+ });
5612
+ var SearchHitSchema = z49.object({
5613
+ pageId: z49.string(),
5614
+ path: z49.string(),
5615
+ score: z49.number().optional(),
5616
+ snippet: z49.string().optional(),
5617
+ bookmarkCount: z49.number(),
5578
5618
  page: PageSchema
5579
5619
  });
5580
- var SearchPagesResponseSchema = z48.object({
5581
- meta: z48.object({
5582
- took: z48.number().optional(),
5583
- total: z48.number(),
5584
- results: z48.number()
5620
+ var SearchPagesResponseSchema = z49.object({
5621
+ meta: z49.object({
5622
+ took: z49.number().optional(),
5623
+ total: z49.number(),
5624
+ results: z49.number()
5585
5625
  }),
5586
- data: z48.array(SearchHitSchema)
5626
+ data: z49.array(SearchHitSchema)
5587
5627
  });
5588
5628
 
5589
5629
  // src/contracts/search.ts
@@ -5624,53 +5664,53 @@ var searchRoutes = {
5624
5664
  };
5625
5665
 
5626
5666
  // src/contracts/token-auth.ts
5627
- import { createRoute as createRoute28, z as z50 } from "@hono/zod-openapi";
5667
+ import { createRoute as createRoute28, z as z51 } from "@hono/zod-openapi";
5628
5668
 
5629
5669
  // src/schemas/auth.ts
5630
- import { z as z49 } from "@hono/zod-openapi";
5631
- var TokenAuthLoginRequestSchema = z49.object({
5632
- email: z49.string().email(),
5633
- password: z49.string().min(6)
5634
- });
5635
- var TokenAuthResponseSchema = z49.object({
5636
- accessToken: z49.string(),
5637
- refreshToken: z49.string(),
5638
- expiresIn: z49.number(),
5670
+ import { z as z50 } from "@hono/zod-openapi";
5671
+ var TokenAuthLoginRequestSchema = z50.object({
5672
+ email: z50.string().email(),
5673
+ password: z50.string().min(6)
5674
+ });
5675
+ var TokenAuthResponseSchema = z50.object({
5676
+ accessToken: z50.string(),
5677
+ refreshToken: z50.string(),
5678
+ expiresIn: z50.number(),
5639
5679
  // seconds until expiration
5640
- user: z49.object({
5641
- id: z49.string(),
5642
- username: z49.string(),
5643
- email: z49.string().email(),
5644
- name: z49.string(),
5645
- image: z49.string().optional(),
5646
- admin: z49.boolean().optional()
5680
+ user: z50.object({
5681
+ id: z50.string(),
5682
+ username: z50.string(),
5683
+ email: z50.string().email(),
5684
+ name: z50.string(),
5685
+ image: z50.string().optional(),
5686
+ admin: z50.boolean().optional()
5647
5687
  })
5648
5688
  });
5649
- var RefreshTokenRequestSchema = z49.object({
5650
- refreshToken: z49.string()
5689
+ var RefreshTokenRequestSchema = z50.object({
5690
+ refreshToken: z50.string()
5651
5691
  });
5652
- var TokenAuthRegisterRequestSchema = z49.object({
5653
- username: z49.string(),
5654
- name: z49.string(),
5655
- email: z49.string().email(),
5656
- password: z49.string().min(6)
5692
+ var TokenAuthRegisterRequestSchema = z50.object({
5693
+ username: UsernameSchema,
5694
+ name: z50.string(),
5695
+ email: z50.string().email(),
5696
+ password: z50.string().min(6)
5657
5697
  });
5658
- var RegisterPendingResponseSchema = z49.object({
5659
- status: z49.enum(["confirmation_required", "approval_required"])
5698
+ var RegisterPendingResponseSchema = z50.object({
5699
+ status: z50.enum(["confirmation_required", "approval_required"])
5660
5700
  });
5661
5701
 
5662
5702
  // src/contracts/token-auth.ts
5663
- var TokenLogoutResponseSchema = z50.object({ message: z50.string() });
5664
- var TokenMeResponseSchema = z50.object({
5665
- user: z50.object({
5666
- id: z50.string(),
5667
- username: z50.string(),
5668
- email: z50.string().email(),
5669
- name: z50.string(),
5670
- image: z50.string().optional(),
5671
- status: z50.number(),
5672
- admin: z50.boolean().optional(),
5673
- createdAt: z50.string()
5703
+ var TokenLogoutResponseSchema = z51.object({ message: z51.string() });
5704
+ var TokenMeResponseSchema = z51.object({
5705
+ user: z51.object({
5706
+ id: z51.string(),
5707
+ username: z51.string(),
5708
+ email: z51.string().email(),
5709
+ name: z51.string(),
5710
+ image: z51.string().optional(),
5711
+ status: z51.number(),
5712
+ admin: z51.boolean().optional(),
5713
+ createdAt: z51.string()
5674
5714
  })
5675
5715
  });
5676
5716
  var tokenLoginRoute = createRoute28({
@@ -5798,7 +5838,7 @@ var tokenLogoutRoute = createRoute28({
5798
5838
  body: {
5799
5839
  content: {
5800
5840
  "application/json": {
5801
- schema: z50.object({ refreshToken: z50.string().optional() })
5841
+ schema: z51.object({ refreshToken: z51.string().optional() })
5802
5842
  }
5803
5843
  }
5804
5844
  }
@@ -5851,15 +5891,15 @@ var tokenAuthRoutes = {
5851
5891
  import { createRoute as createRoute29 } from "@hono/zod-openapi";
5852
5892
 
5853
5893
  // src/schemas/invite-accept.ts
5854
- import { z as z51 } from "@hono/zod-openapi";
5855
- var InviteAcceptRequestSchema = z51.object({
5856
- token: z51.string(),
5857
- username: z51.string().min(1),
5858
- name: z51.string().min(1),
5859
- password: z51.string().min(6)
5894
+ import { z as z52 } from "@hono/zod-openapi";
5895
+ var InviteAcceptRequestSchema = z52.object({
5896
+ token: z52.string(),
5897
+ username: UsernameSchema,
5898
+ name: z52.string().min(1),
5899
+ password: z52.string().min(6)
5860
5900
  });
5861
- var InvitePreviewResponseSchema = z51.object({
5862
- email: z51.string().email()
5901
+ var InvitePreviewResponseSchema = z52.object({
5902
+ email: z52.string().email()
5863
5903
  });
5864
5904
 
5865
5905
  // src/contracts/invite-accept.ts
@@ -5936,16 +5976,16 @@ var inviteAcceptRoutes = {
5936
5976
  import { createRoute as createRoute30 } from "@hono/zod-openapi";
5937
5977
 
5938
5978
  // src/schemas/password-reset.ts
5939
- import { z as z52 } from "@hono/zod-openapi";
5940
- var ForgotPasswordRequestSchema = z52.object({
5941
- email: z52.string().email()
5979
+ import { z as z53 } from "@hono/zod-openapi";
5980
+ var ForgotPasswordRequestSchema = z53.object({
5981
+ email: z53.string().email()
5942
5982
  });
5943
- var ForgotPasswordResponseSchema = z52.object({
5944
- ok: z52.literal(true)
5983
+ var ForgotPasswordResponseSchema = z53.object({
5984
+ ok: z53.literal(true)
5945
5985
  });
5946
- var ResetPasswordRequestSchema = z52.object({
5947
- token: z52.string(),
5948
- password: z52.string().min(6)
5986
+ var ResetPasswordRequestSchema = z53.object({
5987
+ token: z53.string(),
5988
+ password: z53.string().min(6)
5949
5989
  });
5950
5990
 
5951
5991
  // src/contracts/password-reset.ts
@@ -6040,12 +6080,12 @@ var passwordResetRoutes = {
6040
6080
  import { createRoute as createRoute31 } from "@hono/zod-openapi";
6041
6081
 
6042
6082
  // src/schemas/activation.ts
6043
- import { z as z53 } from "@hono/zod-openapi";
6044
- var ActivateRequestSchema = z53.object({
6045
- token: z53.string()
6083
+ import { z as z54 } from "@hono/zod-openapi";
6084
+ var ActivateRequestSchema = z54.object({
6085
+ token: z54.string()
6046
6086
  });
6047
- var ActivateValidationResponseSchema = z53.object({
6048
- ok: z53.literal(true)
6087
+ var ActivateValidationResponseSchema = z54.object({
6088
+ ok: z54.literal(true)
6049
6089
  });
6050
6090
 
6051
6091
  // src/contracts/activation.ts
@@ -6110,14 +6150,14 @@ var activationRoutes = {
6110
6150
  import { createRoute as createRoute32 } from "@hono/zod-openapi";
6111
6151
 
6112
6152
  // src/schemas/email-change.ts
6113
- import { z as z54 } from "@hono/zod-openapi";
6114
- var ConfirmEmailChangeRequestSchema = z54.object({
6115
- token: z54.string()
6153
+ import { z as z55 } from "@hono/zod-openapi";
6154
+ var ConfirmEmailChangeRequestSchema = z55.object({
6155
+ token: z55.string()
6116
6156
  });
6117
- var ConfirmEmailChangeResponseSchema = z54.object({
6118
- ok: z54.literal(true),
6157
+ var ConfirmEmailChangeResponseSchema = z55.object({
6158
+ ok: z55.literal(true),
6119
6159
  /** The newly-confirmed email address. */
6120
- email: z54.string().email()
6160
+ email: z55.string().email()
6121
6161
  });
6122
6162
 
6123
6163
  // src/contracts/email-change.ts
@@ -6183,8 +6223,8 @@ var emailChangeRoutes = {
6183
6223
  };
6184
6224
 
6185
6225
  // src/contracts/user.ts
6186
- import { createRoute as createRoute33, z as z55 } from "@hono/zod-openapi";
6187
- var UsernameParamSchema = z55.object({ username: z55.string() });
6226
+ import { createRoute as createRoute33, z as z56 } from "@hono/zod-openapi";
6227
+ var UsernameParamSchema = z56.object({ username: z56.string() });
6188
6228
  var getUserPageRoute = createRoute33({
6189
6229
  method: "get",
6190
6230
  path: "/user/{username}",
@@ -6602,6 +6642,7 @@ var stubPendingUsersCount = { count: 0 };
6602
6642
  var stubListPlugins = { plugins: [] };
6603
6643
  var stubPluginConfig = { name: "", fields: [], values: {} };
6604
6644
  var stubUpdatePluginConfig = { ok: true, hotReloaded: false, reconfigureFailed: false };
6645
+ var stubPluginReadiness = { issues: [] };
6605
6646
  var stubClearRenderCache = { ok: true, clearedAt: "", removedCount: 0 };
6606
6647
  var appAuthMeUserChain = new OpenAPIHono().openapi(
6607
6648
  appRoutes.getAppInfoRoute,
@@ -6641,7 +6682,7 @@ var bookmarkBacklinkCommentRevisionChain = new OpenAPIHono().openapi(bookmarkRou
6641
6682
  var pageChain = new 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));
6642
6683
  var lateContractApp = new 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));
6643
6684
  var adminSettingsContractApp = new 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));
6644
- var adminUsersPluginsContractApp = new 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.clearRenderCacheAllRoute, (c) => c.json(stubClearRenderCache, 200)).openapi(adminPluginsRoutes.clearRenderCachePluginRoute, (c) => c.json(stubClearRenderCache, 200));
6685
+ var adminUsersPluginsContractApp = new 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));
6645
6686
  var oauthContractApp = new 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));
6646
6687
  var createClient = (baseUrl, options = {}) => hc(baseUrl, {
6647
6688
  headers: options.headers,
@@ -6649,19 +6690,19 @@ var createClient = (baseUrl, options = {}) => hc(baseUrl, {
6649
6690
  });
6650
6691
 
6651
6692
  // src/schemas/mail-token.ts
6652
- import { z as z56 } from "@hono/zod-openapi";
6653
- var MailTokenPurposeSchema = z56.enum(["invite", "activate", "reset", "email-change"]);
6654
- var MailTokenPayloadSchema = z56.object({
6693
+ import { z as z57 } from "@hono/zod-openapi";
6694
+ var MailTokenPurposeSchema = z57.enum(["invite", "activate", "reset", "email-change"]);
6695
+ var MailTokenPayloadSchema = z57.object({
6655
6696
  purpose: MailTokenPurposeSchema,
6656
- userId: z56.string(),
6697
+ userId: z57.string(),
6657
6698
  /** Target address. For `email-change` this is the NEW address. */
6658
- email: z56.string().email(),
6699
+ email: z57.string().email(),
6659
6700
  /**
6660
6701
  * For `email-change`: the account's email at issue time. The confirm
6661
6702
  * endpoint rejects the token unless it still matches, making the token
6662
6703
  * single-use (a stale token cannot revert a later change).
6663
6704
  */
6664
- fromEmail: z56.string().email().optional(),
6705
+ fromEmail: z57.string().email().optional(),
6665
6706
  /**
6666
6707
  * For `reset`: the account's `passwordResetGeneration` at issue time.
6667
6708
  * Consuming the link increments that counter, so the token only matches
@@ -6670,7 +6711,7 @@ var MailTokenPayloadSchema = z56.object({
6670
6711
  * schema because the other purposes don't carry it (and links minted
6671
6712
  * before the claim existed simply no longer match).
6672
6713
  */
6673
- resetGeneration: z56.number().int().nonnegative().optional(),
6714
+ resetGeneration: z57.number().int().nonnegative().optional(),
6674
6715
  /**
6675
6716
  * For `email-change`: the account's `authVersion` at issue time. The
6676
6717
  * confirm endpoint requires it to still match, so a pending address change
@@ -6682,10 +6723,22 @@ var MailTokenPayloadSchema = z56.object({
6682
6723
  * semantics wanted are exactly "the session that asked for this is gone",
6683
6724
  * and that is what every bump of it already means.
6684
6725
  */
6685
- authVersion: z56.number().int().nonnegative().optional(),
6726
+ authVersion: z57.number().int().nonnegative().optional(),
6727
+ /**
6728
+ * For `email-change`: the account's `emailChangeGeneration` at issue time.
6729
+ * Requesting a change increments it, so asking for a different address
6730
+ * supersedes any link still pending — which is what lets a user call off a
6731
+ * change they did not want (one an attacker started with a stolen session,
6732
+ * or one sent to a mistyped address). `authVersion` cannot serve this: it
6733
+ * means "the session that asked is gone", and bumping it on a mere request
6734
+ * would log the user out of their own account for editing their profile.
6735
+ * Optional in the schema for the same reason as the others — links minted
6736
+ * before the claim existed simply no longer match.
6737
+ */
6738
+ emailChangeGeneration: z57.number().int().nonnegative().optional(),
6686
6739
  // iat / exp are injected and verified by the JWT layer.
6687
- iat: z56.number().optional(),
6688
- exp: z56.number().optional()
6740
+ iat: z57.number().optional(),
6741
+ exp: z57.number().optional()
6689
6742
  });
6690
6743
 
6691
6744
  // src/util/html-elements.ts
@@ -7057,6 +7110,9 @@ export {
7057
7110
  PluginFieldSchema,
7058
7111
  PluginInfoSchema,
7059
7112
  PluginNotFoundErrorSchema,
7113
+ PluginReadinessFieldSchema,
7114
+ PluginReadinessIssueSchema,
7115
+ PluginReadinessResponseSchema,
7060
7116
  PresenceClientMessageSchema,
7061
7117
  PresenceCommentChangedMessageSchema,
7062
7118
  PresenceHeartbeatMessageSchema,
@@ -7168,6 +7224,7 @@ export {
7168
7224
  UserStatusErrorSchema,
7169
7225
  UserStatusSchema,
7170
7226
  UserSubpagesRequestSchema,
7227
+ UsernameSchema,
7171
7228
  ValidationErrorSchema,
7172
7229
  WS_CLOSE_CODES,
7173
7230
  WatchStatusResponseSchema,
@@ -7238,6 +7295,7 @@ export {
7238
7295
  getNotificationsTokenRoute,
7239
7296
  getPageRoute,
7240
7297
  getPluginConfigRoute,
7298
+ getPluginReadinessRoute,
7241
7299
  getPresenceTokenRoute,
7242
7300
  getProfileRoute,
7243
7301
  getRevisionRoute,