@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/generated/openapi.d.mts +290 -0
- package/dist/generated/openapi.d.ts +290 -0
- package/dist/generated/openapi.js.map +1 -1
- package/dist/index.d.mts +306 -6
- package/dist/index.d.ts +306 -6
- package/dist/index.js +595 -532
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +504 -446
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
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
|
|
3379
|
-
|
|
3380
|
-
|
|
3381
|
-
var
|
|
3382
|
-
|
|
3383
|
-
|
|
3384
|
-
|
|
3385
|
-
|
|
3386
|
-
|
|
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 =
|
|
3390
|
-
status:
|
|
3391
|
-
message:
|
|
3392
|
-
errors:
|
|
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
|
|
3504
|
+
import { createRoute as createRoute17, z as z32 } from "@hono/zod-openapi";
|
|
3465
3505
|
|
|
3466
3506
|
// src/schemas/me.ts
|
|
3467
|
-
import { z as
|
|
3468
|
-
var LanguageSchema =
|
|
3469
|
-
var ThemeSchema =
|
|
3470
|
-
var UserProfileResponseSchema =
|
|
3471
|
-
id:
|
|
3472
|
-
username:
|
|
3473
|
-
name:
|
|
3474
|
-
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:
|
|
3478
|
-
introduction:
|
|
3479
|
-
hasPassword:
|
|
3480
|
-
createdAt:
|
|
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:
|
|
3526
|
+
emailChangePending: z31.boolean().optional()
|
|
3487
3527
|
});
|
|
3488
|
-
var UpdateProfileRequestSchema =
|
|
3489
|
-
userForm:
|
|
3490
|
-
name:
|
|
3491
|
-
email:
|
|
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 =
|
|
3535
|
+
var UpdateThemeRequestSchema = z31.object({
|
|
3496
3536
|
theme: ThemeSchema
|
|
3497
3537
|
});
|
|
3498
|
-
var ThemeUpdateResponseSchema =
|
|
3499
|
-
status:
|
|
3538
|
+
var ThemeUpdateResponseSchema = z31.object({
|
|
3539
|
+
status: z31.literal("ok"),
|
|
3500
3540
|
theme: ThemeSchema
|
|
3501
3541
|
});
|
|
3502
|
-
var PictureUploadResponseSchema =
|
|
3503
|
-
status:
|
|
3504
|
-
url:
|
|
3505
|
-
message:
|
|
3542
|
+
var PictureUploadResponseSchema = z31.object({
|
|
3543
|
+
status: z31.boolean(),
|
|
3544
|
+
url: z31.string().optional(),
|
|
3545
|
+
message: z31.string().optional()
|
|
3506
3546
|
});
|
|
3507
|
-
var SuccessResponseSchema =
|
|
3508
|
-
status:
|
|
3509
|
-
message:
|
|
3547
|
+
var SuccessResponseSchema = z31.object({
|
|
3548
|
+
status: z31.literal("ok"),
|
|
3549
|
+
message: z31.string().optional()
|
|
3510
3550
|
});
|
|
3511
|
-
var ProfileErrorResponseSchema =
|
|
3512
|
-
status:
|
|
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:
|
|
3515
|
-
message:
|
|
3516
|
-
errors:
|
|
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 =
|
|
3520
|
-
oldPassword:
|
|
3521
|
-
newPassword:
|
|
3522
|
-
newPasswordConfirm:
|
|
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 =
|
|
3528
|
-
status:
|
|
3529
|
-
message:
|
|
3530
|
-
accessToken:
|
|
3531
|
-
refreshToken:
|
|
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:
|
|
3573
|
+
expiresIn: z31.number()
|
|
3534
3574
|
});
|
|
3535
|
-
var PasswordErrorResponseSchema =
|
|
3536
|
-
status:
|
|
3537
|
-
message:
|
|
3538
|
-
errors:
|
|
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 =
|
|
3541
|
-
pages:
|
|
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:
|
|
3625
|
-
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
|
|
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
|
|
3729
|
-
var AccessTokenSchema =
|
|
3730
|
-
id:
|
|
3731
|
-
name:
|
|
3732
|
-
scopes:
|
|
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:
|
|
3774
|
+
expiresAt: z33.string().nullable(),
|
|
3735
3775
|
/** ISO-8601 of last successful use, or `null` if never used. */
|
|
3736
|
-
lastUsedAt:
|
|
3737
|
-
createdAt:
|
|
3776
|
+
lastUsedAt: z33.string().nullable(),
|
|
3777
|
+
createdAt: z33.string()
|
|
3738
3778
|
});
|
|
3739
|
-
var ListAccessTokensResponseSchema =
|
|
3740
|
-
accessTokens:
|
|
3779
|
+
var ListAccessTokensResponseSchema = z33.object({
|
|
3780
|
+
accessTokens: z33.array(AccessTokenSchema)
|
|
3741
3781
|
});
|
|
3742
|
-
var CreateAccessTokenRequestSchema =
|
|
3743
|
-
name:
|
|
3744
|
-
scopes:
|
|
3745
|
-
expiresAt:
|
|
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:
|
|
3749
|
-
});
|
|
3750
|
-
var InvalidScopeErrorSchema =
|
|
3751
|
-
error:
|
|
3752
|
-
code:
|
|
3753
|
-
message:
|
|
3754
|
-
details:
|
|
3755
|
-
invalidScopes:
|
|
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:
|
|
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
|
|
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
|
|
3902
|
+
import { z as z36 } from "@hono/zod-openapi";
|
|
3863
3903
|
|
|
3864
3904
|
// src/schemas/oauth.ts
|
|
3865
|
-
import { z as
|
|
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:
|
|
3934
|
-
code:
|
|
3935
|
-
message:
|
|
3936
|
-
details:
|
|
3937
|
-
requiredScope:
|
|
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 =
|
|
3957
|
-
error:
|
|
3958
|
-
error_description:
|
|
3959
|
-
});
|
|
3960
|
-
var AuthorizeRequestSchema =
|
|
3961
|
-
client_id:
|
|
3962
|
-
redirect_uri:
|
|
3963
|
-
scope:
|
|
3964
|
-
code_challenge:
|
|
3965
|
-
code_challenge_method:
|
|
3966
|
-
state:
|
|
3967
|
-
});
|
|
3968
|
-
var AuthorizeResponseSchema =
|
|
3969
|
-
redirectUri:
|
|
3970
|
-
});
|
|
3971
|
-
var TokenRequestSchema =
|
|
3972
|
-
|
|
3973
|
-
grant_type:
|
|
3974
|
-
code:
|
|
3975
|
-
code_verifier:
|
|
3976
|
-
redirect_uri:
|
|
3977
|
-
client_id:
|
|
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
|
-
|
|
3980
|
-
grant_type:
|
|
3981
|
-
refresh_token:
|
|
3982
|
-
client_id:
|
|
3983
|
-
scope:
|
|
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
|
-
|
|
3988
|
-
grant_type:
|
|
3989
|
-
device_code:
|
|
3990
|
-
client_id:
|
|
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 =
|
|
3995
|
-
access_token:
|
|
3996
|
-
token_type:
|
|
3997
|
-
expires_in:
|
|
3998
|
-
refresh_token:
|
|
3999
|
-
scope:
|
|
4000
|
-
});
|
|
4001
|
-
var RevokeRequestSchema =
|
|
4002
|
-
token:
|
|
4003
|
-
token_type_hint:
|
|
4004
|
-
});
|
|
4005
|
-
var RevokeResponseSchema =
|
|
4006
|
-
var DeviceAuthorizeRequestSchema =
|
|
4007
|
-
client_id:
|
|
4008
|
-
scope:
|
|
4009
|
-
});
|
|
4010
|
-
var DeviceAuthorizeResponseSchema =
|
|
4011
|
-
device_code:
|
|
4012
|
-
user_code:
|
|
4013
|
-
verification_uri:
|
|
4014
|
-
verification_uri_complete:
|
|
4015
|
-
expires_in:
|
|
4016
|
-
interval:
|
|
4017
|
-
});
|
|
4018
|
-
var DeviceVerifyRequestSchema =
|
|
4019
|
-
user_code:
|
|
4020
|
-
action:
|
|
4021
|
-
});
|
|
4022
|
-
var DeviceVerifyResponseSchema =
|
|
4023
|
-
status:
|
|
4024
|
-
});
|
|
4025
|
-
var DeviceInfoResponseSchema =
|
|
4026
|
-
client_id:
|
|
4027
|
-
scopes:
|
|
4028
|
-
});
|
|
4029
|
-
var ClientInfoResponseSchema =
|
|
4030
|
-
clientId:
|
|
4031
|
-
name:
|
|
4032
|
-
firstParty:
|
|
4033
|
-
trusted:
|
|
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 =
|
|
4037
|
-
issuer:
|
|
4038
|
-
authorization_endpoint:
|
|
4039
|
-
token_endpoint:
|
|
4040
|
-
revocation_endpoint:
|
|
4041
|
-
device_authorization_endpoint:
|
|
4042
|
-
scopes_supported:
|
|
4043
|
-
response_types_supported:
|
|
4044
|
-
grant_types_supported:
|
|
4045
|
-
code_challenge_methods_supported:
|
|
4046
|
-
token_endpoint_auth_methods_supported:
|
|
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:
|
|
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:
|
|
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
|
|
4301
|
+
import { createRoute as createRoute20, z as z39 } from "@hono/zod-openapi";
|
|
4262
4302
|
|
|
4263
4303
|
// src/schemas/notification.ts
|
|
4264
|
-
import { z as
|
|
4265
|
-
var NotificationStatusSchema =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
4288
|
-
_id:
|
|
4289
|
-
user:
|
|
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:
|
|
4295
|
-
createdAt:
|
|
4334
|
+
actionUsers: z38.array(UserPublicSchema),
|
|
4335
|
+
createdAt: z38.string()
|
|
4296
4336
|
});
|
|
4297
|
-
var ListNotificationsRequestSchema =
|
|
4298
|
-
limit:
|
|
4299
|
-
offset:
|
|
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 =
|
|
4302
|
-
notifications:
|
|
4341
|
+
var ListNotificationsResponseSchema = z38.object({
|
|
4342
|
+
notifications: z38.array(NotificationSchema),
|
|
4303
4343
|
pager: PagerSchema
|
|
4304
4344
|
});
|
|
4305
|
-
var MarkAllAsReadResponseSchema =
|
|
4306
|
-
ok:
|
|
4345
|
+
var MarkAllAsReadResponseSchema = z38.object({
|
|
4346
|
+
ok: z38.literal(true)
|
|
4307
4347
|
});
|
|
4308
|
-
var OpenNotificationParamSchema =
|
|
4309
|
-
id:
|
|
4348
|
+
var OpenNotificationParamSchema = z38.object({
|
|
4349
|
+
id: z38.string()
|
|
4310
4350
|
});
|
|
4311
|
-
var OpenNotificationResponseSchema =
|
|
4351
|
+
var OpenNotificationResponseSchema = z38.object({
|
|
4312
4352
|
notification: NotificationSchema
|
|
4313
4353
|
});
|
|
4314
|
-
var NotificationStatusResponseSchema =
|
|
4315
|
-
count:
|
|
4354
|
+
var NotificationStatusResponseSchema = z38.object({
|
|
4355
|
+
count: z38.number()
|
|
4316
4356
|
});
|
|
4317
|
-
var NotificationNotFoundErrorSchema =
|
|
4318
|
-
error:
|
|
4319
|
-
code:
|
|
4320
|
-
message:
|
|
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 =
|
|
4324
|
-
token:
|
|
4325
|
-
selfUserId:
|
|
4326
|
-
expiresAt:
|
|
4363
|
+
var NotificationsTokenResponseSchema = z38.object({
|
|
4364
|
+
token: z38.string(),
|
|
4365
|
+
selfUserId: z38.string(),
|
|
4366
|
+
expiresAt: z38.string()
|
|
4327
4367
|
});
|
|
4328
|
-
var NotificationsTokenPayloadSchema =
|
|
4329
|
-
selfUserId:
|
|
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:
|
|
4336
|
-
iat:
|
|
4337
|
-
exp:
|
|
4375
|
+
jti: z38.string().uuid(),
|
|
4376
|
+
iat: z38.number().int(),
|
|
4377
|
+
exp: z38.number().int()
|
|
4338
4378
|
});
|
|
4339
|
-
var NotificationsChangedMessageSchema =
|
|
4340
|
-
type:
|
|
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 =
|
|
4346
|
-
error:
|
|
4347
|
-
code:
|
|
4348
|
-
message:
|
|
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
|
|
4485
|
-
var PageIdPathParamsSchema2 =
|
|
4486
|
-
id:
|
|
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
|
|
4526
|
-
var PageBadRequestErrorSchema =
|
|
4527
|
-
error:
|
|
4528
|
-
code:
|
|
4529
|
-
message:
|
|
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 =
|
|
4533
|
-
page_id:
|
|
4534
|
-
revision_id:
|
|
4535
|
-
completely:
|
|
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 =
|
|
4538
|
-
page_id:
|
|
4577
|
+
var RevertDeletedPageRequestSchema = z41.object({
|
|
4578
|
+
page_id: z41.string()
|
|
4539
4579
|
});
|
|
4540
|
-
var PageIdBodySchema =
|
|
4541
|
-
page_id:
|
|
4580
|
+
var PageIdBodySchema = z41.object({
|
|
4581
|
+
page_id: z41.string()
|
|
4542
4582
|
});
|
|
4543
|
-
var PageResponseSchema =
|
|
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:
|
|
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:
|
|
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:
|
|
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
|
|
5139
|
-
var PreviewPageRequestSchema =
|
|
5140
|
-
body:
|
|
5178
|
+
import { z as z42 } from "@hono/zod-openapi";
|
|
5179
|
+
var PreviewPageRequestSchema = z42.object({
|
|
5180
|
+
body: z42.string()
|
|
5141
5181
|
});
|
|
5142
|
-
var PreviewPageResponseSchema =
|
|
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
|
|
5226
|
+
import { createRoute as createRoute24, z as z44 } from "@hono/zod-openapi";
|
|
5187
5227
|
|
|
5188
5228
|
// src/schemas/presence.ts
|
|
5189
|
-
import { z as
|
|
5190
|
-
var PresenceTokenResponseSchema =
|
|
5191
|
-
token:
|
|
5192
|
-
pageId:
|
|
5193
|
-
selfUserId:
|
|
5194
|
-
expiresAt:
|
|
5195
|
-
});
|
|
5196
|
-
var PresenceTokenPayloadSchema =
|
|
5197
|
-
userId:
|
|
5198
|
-
pageId:
|
|
5199
|
-
iat:
|
|
5200
|
-
exp:
|
|
5201
|
-
});
|
|
5202
|
-
var PresenceViewerSchema =
|
|
5203
|
-
userId:
|
|
5204
|
-
username:
|
|
5205
|
-
displayName:
|
|
5206
|
-
avatarUrl:
|
|
5207
|
-
isEditing:
|
|
5208
|
-
joinedAt:
|
|
5209
|
-
});
|
|
5210
|
-
var PresenceHeartbeatMessageSchema =
|
|
5211
|
-
type:
|
|
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 =
|
|
5215
|
-
type:
|
|
5216
|
-
viewers:
|
|
5217
|
-
generation:
|
|
5218
|
-
});
|
|
5219
|
-
var PresencePageUpdatedMessageSchema =
|
|
5220
|
-
type:
|
|
5221
|
-
pageId:
|
|
5222
|
-
revisionId:
|
|
5223
|
-
editorUserId:
|
|
5224
|
-
editorDisplayName:
|
|
5225
|
-
});
|
|
5226
|
-
var PresenceCommentChangedMessageSchema =
|
|
5227
|
-
type:
|
|
5228
|
-
pageId:
|
|
5229
|
-
changeType:
|
|
5230
|
-
commentId:
|
|
5231
|
-
actorUserId:
|
|
5232
|
-
});
|
|
5233
|
-
var PresenceServerMessageSchema =
|
|
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 =
|
|
5239
|
-
id:
|
|
5240
|
-
username:
|
|
5241
|
-
displayName:
|
|
5242
|
-
avatarUrl:
|
|
5243
|
-
likedAt:
|
|
5244
|
-
});
|
|
5245
|
-
var LikersResponseSchema =
|
|
5246
|
-
users:
|
|
5247
|
-
totalCount:
|
|
5248
|
-
});
|
|
5249
|
-
var GetLikersRequestSchema =
|
|
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:
|
|
5292
|
+
limit: z43.coerce.number().int().positive().optional()
|
|
5253
5293
|
});
|
|
5254
5294
|
|
|
5255
5295
|
// src/contracts/presence.ts
|
|
5256
|
-
var PageIdPathParamsSchema3 =
|
|
5257
|
-
id:
|
|
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
|
|
5370
|
+
import { createRoute as createRoute25, z as z46 } from "@hono/zod-openapi";
|
|
5331
5371
|
|
|
5332
5372
|
// src/schemas/revision.ts
|
|
5333
|
-
import { z as
|
|
5334
|
-
var RevisionMetaSchema =
|
|
5335
|
-
_id:
|
|
5336
|
-
path:
|
|
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:
|
|
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:
|
|
5344
|
-
createdAt:
|
|
5383
|
+
editVia: z45.enum(["web", "oauth", "pat"]).optional(),
|
|
5384
|
+
createdAt: z45.string()
|
|
5345
5385
|
});
|
|
5346
|
-
var ListRevisionsRequestSchema =
|
|
5347
|
-
limit:
|
|
5348
|
-
offset:
|
|
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 =
|
|
5351
|
-
revisions:
|
|
5390
|
+
var ListRevisionsResponseSchema = z45.object({
|
|
5391
|
+
revisions: z45.array(RevisionMetaSchema),
|
|
5352
5392
|
pager: PagerSchema
|
|
5353
5393
|
});
|
|
5354
|
-
var GetRevisionResponseSchema =
|
|
5394
|
+
var GetRevisionResponseSchema = z45.object({
|
|
5355
5395
|
revision: RevisionSchema
|
|
5356
5396
|
});
|
|
5357
|
-
var GetRevisionsRequestSchema =
|
|
5358
|
-
ids:
|
|
5397
|
+
var GetRevisionsRequestSchema = z45.object({
|
|
5398
|
+
ids: z45.string().min(1, "ids is required")
|
|
5359
5399
|
});
|
|
5360
|
-
var GetRevisionsResponseSchema =
|
|
5361
|
-
revisions:
|
|
5400
|
+
var GetRevisionsResponseSchema = z45.object({
|
|
5401
|
+
revisions: z45.array(RevisionSchema)
|
|
5362
5402
|
});
|
|
5363
|
-
var RevisionInvalidRequestErrorSchema =
|
|
5364
|
-
error:
|
|
5365
|
-
code:
|
|
5366
|
-
message:
|
|
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 =
|
|
5372
|
-
var RevisionIdParamSchema =
|
|
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
|
|
5472
|
-
var SensitiveConfigEntrySchema =
|
|
5473
|
-
ns:
|
|
5474
|
-
key:
|
|
5475
|
-
present:
|
|
5476
|
-
encrypted:
|
|
5477
|
-
});
|
|
5478
|
-
var CryptoStatusResponseSchema =
|
|
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:
|
|
5481
|
-
unencryptedCount:
|
|
5482
|
-
encryptedCount:
|
|
5483
|
-
entries:
|
|
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 =
|
|
5486
|
-
rewritten:
|
|
5525
|
+
var ReencryptResponseSchema = z47.object({
|
|
5526
|
+
rewritten: z47.number().int().min(0),
|
|
5487
5527
|
/** Already encrypted, skipped on this run. */
|
|
5488
|
-
alreadyEncrypted:
|
|
5528
|
+
alreadyEncrypted: z47.number().int().min(0),
|
|
5489
5529
|
/** Sensitive registry entries that had no row in the DB at all. */
|
|
5490
|
-
missing:
|
|
5530
|
+
missing: z47.number().int().min(0)
|
|
5491
5531
|
});
|
|
5492
|
-
var EncryptionNotConfiguredErrorSchema =
|
|
5493
|
-
error:
|
|
5494
|
-
code:
|
|
5495
|
-
message:
|
|
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
|
|
5564
|
-
var SearchPageTypeSchema =
|
|
5565
|
-
var SearchPagesRequestSchema =
|
|
5566
|
-
q:
|
|
5567
|
-
tree:
|
|
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:
|
|
5570
|
-
limit:
|
|
5571
|
-
});
|
|
5572
|
-
var SearchHitSchema =
|
|
5573
|
-
pageId:
|
|
5574
|
-
path:
|
|
5575
|
-
score:
|
|
5576
|
-
snippet:
|
|
5577
|
-
bookmarkCount:
|
|
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 =
|
|
5581
|
-
meta:
|
|
5582
|
-
took:
|
|
5583
|
-
total:
|
|
5584
|
-
results:
|
|
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:
|
|
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
|
|
5667
|
+
import { createRoute as createRoute28, z as z51 } from "@hono/zod-openapi";
|
|
5628
5668
|
|
|
5629
5669
|
// src/schemas/auth.ts
|
|
5630
|
-
import { z as
|
|
5631
|
-
var TokenAuthLoginRequestSchema =
|
|
5632
|
-
email:
|
|
5633
|
-
password:
|
|
5634
|
-
});
|
|
5635
|
-
var TokenAuthResponseSchema =
|
|
5636
|
-
accessToken:
|
|
5637
|
-
refreshToken:
|
|
5638
|
-
expiresIn:
|
|
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:
|
|
5641
|
-
id:
|
|
5642
|
-
username:
|
|
5643
|
-
email:
|
|
5644
|
-
name:
|
|
5645
|
-
image:
|
|
5646
|
-
admin:
|
|
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 =
|
|
5650
|
-
refreshToken:
|
|
5689
|
+
var RefreshTokenRequestSchema = z50.object({
|
|
5690
|
+
refreshToken: z50.string()
|
|
5651
5691
|
});
|
|
5652
|
-
var TokenAuthRegisterRequestSchema =
|
|
5653
|
-
username:
|
|
5654
|
-
name:
|
|
5655
|
-
email:
|
|
5656
|
-
password:
|
|
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 =
|
|
5659
|
-
status:
|
|
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 =
|
|
5664
|
-
var TokenMeResponseSchema =
|
|
5665
|
-
user:
|
|
5666
|
-
id:
|
|
5667
|
-
username:
|
|
5668
|
-
email:
|
|
5669
|
-
name:
|
|
5670
|
-
image:
|
|
5671
|
-
status:
|
|
5672
|
-
admin:
|
|
5673
|
-
createdAt:
|
|
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:
|
|
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
|
|
5855
|
-
var InviteAcceptRequestSchema =
|
|
5856
|
-
token:
|
|
5857
|
-
username:
|
|
5858
|
-
name:
|
|
5859
|
-
password:
|
|
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 =
|
|
5862
|
-
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
|
|
5940
|
-
var ForgotPasswordRequestSchema =
|
|
5941
|
-
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 =
|
|
5944
|
-
ok:
|
|
5983
|
+
var ForgotPasswordResponseSchema = z53.object({
|
|
5984
|
+
ok: z53.literal(true)
|
|
5945
5985
|
});
|
|
5946
|
-
var ResetPasswordRequestSchema =
|
|
5947
|
-
token:
|
|
5948
|
-
password:
|
|
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
|
|
6044
|
-
var ActivateRequestSchema =
|
|
6045
|
-
token:
|
|
6083
|
+
import { z as z54 } from "@hono/zod-openapi";
|
|
6084
|
+
var ActivateRequestSchema = z54.object({
|
|
6085
|
+
token: z54.string()
|
|
6046
6086
|
});
|
|
6047
|
-
var ActivateValidationResponseSchema =
|
|
6048
|
-
ok:
|
|
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
|
|
6114
|
-
var ConfirmEmailChangeRequestSchema =
|
|
6115
|
-
token:
|
|
6153
|
+
import { z as z55 } from "@hono/zod-openapi";
|
|
6154
|
+
var ConfirmEmailChangeRequestSchema = z55.object({
|
|
6155
|
+
token: z55.string()
|
|
6116
6156
|
});
|
|
6117
|
-
var ConfirmEmailChangeResponseSchema =
|
|
6118
|
-
ok:
|
|
6157
|
+
var ConfirmEmailChangeResponseSchema = z55.object({
|
|
6158
|
+
ok: z55.literal(true),
|
|
6119
6159
|
/** The newly-confirmed email address. */
|
|
6120
|
-
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
|
|
6187
|
-
var UsernameParamSchema =
|
|
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
|
|
6653
|
-
var MailTokenPurposeSchema =
|
|
6654
|
-
var MailTokenPayloadSchema =
|
|
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:
|
|
6697
|
+
userId: z57.string(),
|
|
6657
6698
|
/** Target address. For `email-change` this is the NEW address. */
|
|
6658
|
-
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:
|
|
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:
|
|
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:
|
|
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:
|
|
6688
|
-
exp:
|
|
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,
|