@crowi/api-contract 2.0.0-alpha.10 → 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 +401 -47
- package/dist/generated/openapi.d.ts +401 -47
- package/dist/generated/openapi.js.map +1 -1
- package/dist/index.d.mts +1899 -179
- package/dist/index.d.ts +1899 -179
- package/dist/index.js +1390 -859
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1242 -754
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -23,6 +23,13 @@ __export(index_exports, {
|
|
|
23
23
|
ALL_CAPABILITIES: () => ALL_CAPABILITIES,
|
|
24
24
|
ALL_SCOPES: () => ALL_SCOPES,
|
|
25
25
|
API_SURFACE_VERSION: () => API_SURFACE_VERSION,
|
|
26
|
+
AST_INPUT_LIMIT_BYTES: () => AST_INPUT_LIMIT_BYTES,
|
|
27
|
+
AST_MAX_HAST_DEPTH: () => AST_MAX_HAST_DEPTH,
|
|
28
|
+
AST_MAX_IMAGE_BASE64_CHARS: () => AST_MAX_IMAGE_BASE64_CHARS,
|
|
29
|
+
AST_MAX_TREE_DEPTH: () => AST_MAX_TREE_DEPTH,
|
|
30
|
+
AST_MAX_VALUE_CHARS: () => AST_MAX_VALUE_CHARS,
|
|
31
|
+
AST_OUTPUT_BUDGET_BYTES: () => AST_OUTPUT_BUDGET_BYTES,
|
|
32
|
+
AST_OUTPUT_WARN_BYTES: () => AST_OUTPUT_WARN_BYTES,
|
|
26
33
|
AccessTokenSchema: () => AccessTokenSchema,
|
|
27
34
|
ActivateRequestSchema: () => ActivateRequestSchema,
|
|
28
35
|
ActivateValidationResponseSchema: () => ActivateValidationResponseSchema,
|
|
@@ -59,6 +66,7 @@ __export(index_exports, {
|
|
|
59
66
|
BacklinkSchema: () => BacklinkSchema,
|
|
60
67
|
BookmarkResponseSchema: () => BookmarkResponseSchema,
|
|
61
68
|
BookmarkSchema: () => BookmarkSchema,
|
|
69
|
+
CURRENT_AST_VERSION: () => CURRENT_AST_VERSION,
|
|
62
70
|
CapabilitySchema: () => CapabilitySchema,
|
|
63
71
|
ClaimPageLinkAccessResponseSchema: () => ClaimPageLinkAccessResponseSchema,
|
|
64
72
|
ClearRenderCacheResponseSchema: () => ClearRenderCacheResponseSchema,
|
|
@@ -81,10 +89,21 @@ __export(index_exports, {
|
|
|
81
89
|
CreateDraftRequestSchema: () => CreateDraftRequestSchema,
|
|
82
90
|
CreateDraftResponseSchema: () => CreateDraftResponseSchema,
|
|
83
91
|
CreatePageRequestSchema: () => CreatePageRequestSchema,
|
|
92
|
+
CrowiCodeSidecarSchema: () => CrowiCodeSidecarSchema,
|
|
93
|
+
CrowiDiagramNodeSchema: () => CrowiDiagramNodeSchema,
|
|
94
|
+
CrowiDiagramSidecarSchema: () => CrowiDiagramSidecarSchema,
|
|
95
|
+
CrowiDimensionSchema: () => CrowiDimensionSchema,
|
|
96
|
+
CrowiImagePayloadSchema: () => CrowiImagePayloadSchema,
|
|
97
|
+
CrowiLinkCardNodeSchema: () => CrowiLinkCardNodeSchema,
|
|
98
|
+
CrowiLinkCardSidecarSchema: () => CrowiLinkCardSidecarSchema,
|
|
99
|
+
CrowiMathSidecarSchema: () => CrowiMathSidecarSchema,
|
|
100
|
+
CrowiOpaqueNodeSchema: () => CrowiOpaqueNodeSchema,
|
|
101
|
+
CrowiPlaceholderKindSchema: () => CrowiPlaceholderKindSchema,
|
|
102
|
+
CrowiPlaceholderNodeSchema: () => CrowiPlaceholderNodeSchema,
|
|
103
|
+
CrowiPlaceholderSidecarSchema: () => CrowiPlaceholderSidecarSchema,
|
|
84
104
|
CryptoStatusResponseSchema: () => CryptoStatusResponseSchema,
|
|
85
105
|
DEVICE_CODE_GRANT_TYPE: () => DEVICE_CODE_GRANT_TYPE,
|
|
86
106
|
DISCOVERY_SCOPES_SUPPORTED: () => DISCOVERY_SCOPES_SUPPORTED,
|
|
87
|
-
DND_EXTRA_UPLOAD_MIME: () => DND_EXTRA_UPLOAD_MIME,
|
|
88
107
|
DYNAMIC_CAPABILITIES: () => DYNAMIC_CAPABILITIES,
|
|
89
108
|
DeleteAdminUserResponseSchema: () => DeleteAdminUserResponseSchema,
|
|
90
109
|
DeleteCommentRequestSchema: () => DeleteCommentRequestSchema,
|
|
@@ -125,7 +144,11 @@ __export(index_exports, {
|
|
|
125
144
|
GetSeenUsersRequestSchema: () => GetSeenUsersRequestSchema,
|
|
126
145
|
GetStorageStatusResponseSchema: () => GetStorageStatusResponseSchema,
|
|
127
146
|
GetWatchStatusRequestSchema: () => GetWatchStatusRequestSchema,
|
|
128
|
-
|
|
147
|
+
HChildSchema: () => HChildSchema,
|
|
148
|
+
HChildrenSchema: () => HChildrenSchema,
|
|
149
|
+
HNameSchema: () => HNameSchema,
|
|
150
|
+
HPropertiesSchema: () => HPropertiesSchema,
|
|
151
|
+
HastHintDataSchema: () => HastHintDataSchema,
|
|
129
152
|
ISSUABLE_SCOPES: () => ISSUABLE_SCOPES,
|
|
130
153
|
InstallerStatusResponseSchema: () => InstallerStatusResponseSchema,
|
|
131
154
|
InsufficientScopeErrorSchema: () => InsufficientScopeErrorSchema,
|
|
@@ -160,6 +183,7 @@ __export(index_exports, {
|
|
|
160
183
|
ListRevisionsResponseSchema: () => ListRevisionsResponseSchema,
|
|
161
184
|
ListUsersRequestSchema: () => ListUsersRequestSchema,
|
|
162
185
|
ListUsersResponseSchema: () => ListUsersResponseSchema,
|
|
186
|
+
LooseRenderedAstRootSchema: () => LooseRenderedAstRootSchema,
|
|
163
187
|
MailSettingsValidationErrorSchema: () => MailSettingsValidationErrorSchema,
|
|
164
188
|
MailTokenPayloadSchema: () => MailTokenPayloadSchema,
|
|
165
189
|
MailTokenPurposeSchema: () => MailTokenPurposeSchema,
|
|
@@ -211,6 +235,9 @@ __export(index_exports, {
|
|
|
211
235
|
PluginFieldSchema: () => PluginFieldSchema,
|
|
212
236
|
PluginInfoSchema: () => PluginInfoSchema,
|
|
213
237
|
PluginNotFoundErrorSchema: () => PluginNotFoundErrorSchema,
|
|
238
|
+
PluginReadinessFieldSchema: () => PluginReadinessFieldSchema,
|
|
239
|
+
PluginReadinessIssueSchema: () => PluginReadinessIssueSchema,
|
|
240
|
+
PluginReadinessResponseSchema: () => PluginReadinessResponseSchema,
|
|
214
241
|
PresenceClientMessageSchema: () => PresenceClientMessageSchema,
|
|
215
242
|
PresenceCommentChangedMessageSchema: () => PresenceCommentChangedMessageSchema,
|
|
216
243
|
PresenceHeartbeatMessageSchema: () => PresenceHeartbeatMessageSchema,
|
|
@@ -223,6 +250,7 @@ __export(index_exports, {
|
|
|
223
250
|
PreviewPageRequestSchema: () => PreviewPageRequestSchema,
|
|
224
251
|
PreviewPageResponseSchema: () => PreviewPageResponseSchema,
|
|
225
252
|
ProfileErrorResponseSchema: () => ProfileErrorResponseSchema,
|
|
253
|
+
RENDERED_AST_NODE_DEFS: () => RENDERED_AST_NODE_DEFS,
|
|
226
254
|
RecentlyViewedPagesResponseSchema: () => RecentlyViewedPagesResponseSchema,
|
|
227
255
|
ReencryptResponseSchema: () => ReencryptResponseSchema,
|
|
228
256
|
RefreshTokenRequestSchema: () => RefreshTokenRequestSchema,
|
|
@@ -236,6 +264,13 @@ __export(index_exports, {
|
|
|
236
264
|
RenameSubtreeRequestSchema: () => RenameSubtreeRequestSchema,
|
|
237
265
|
RenameSubtreeResponseSchema: () => RenameSubtreeResponseSchema,
|
|
238
266
|
RenameTreeErrorSchema: () => RenameTreeErrorSchema,
|
|
267
|
+
RenderedAstArtifactKeySchema: () => RenderedAstArtifactKeySchema,
|
|
268
|
+
RenderedAstEnvelopeOpenApiSchema: () => RenderedAstEnvelopeOpenApiSchema,
|
|
269
|
+
RenderedAstEnvelopeSchema: () => RenderedAstEnvelopeSchema,
|
|
270
|
+
RenderedAstNodeSchema: () => RenderedAstNodeSchema,
|
|
271
|
+
RenderedAstRootSchema: () => RenderedAstRootSchema,
|
|
272
|
+
RenderedAstValueSchema: () => RenderedAstValueSchema,
|
|
273
|
+
ReservationSchema: () => ReservationSchema,
|
|
239
274
|
ResetPasswordRequestSchema: () => ResetPasswordRequestSchema,
|
|
240
275
|
ResetPasswordResponseSchema: () => ResetPasswordResponseSchema,
|
|
241
276
|
RevertToRevisionRequestSchema: () => RevertToRevisionRequestSchema,
|
|
@@ -247,6 +282,7 @@ __export(index_exports, {
|
|
|
247
282
|
RevokeRequestSchema: () => RevokeRequestSchema,
|
|
248
283
|
RevokeResponseSchema: () => RevokeResponseSchema,
|
|
249
284
|
SCOPES: () => SCOPES,
|
|
285
|
+
SIDECAR_KEYS: () => SIDECAR_KEYS,
|
|
250
286
|
STATIC_CAPABILITIES: () => STATIC_CAPABILITIES,
|
|
251
287
|
STRIP_KNOWN_HTML_TAGS_MAX_LENGTH: () => STRIP_KNOWN_HTML_TAGS_MAX_LENGTH,
|
|
252
288
|
SearchAdminUsersByEmailRequestSchema: () => SearchAdminUsersByEmailRequestSchema,
|
|
@@ -266,6 +302,9 @@ __export(index_exports, {
|
|
|
266
302
|
ServiceUnavailableErrorSchema: () => ServiceUnavailableErrorSchema,
|
|
267
303
|
SetPageGrantRequestSchema: () => SetPageGrantRequestSchema,
|
|
268
304
|
SetWatchStatusRequestSchema: () => SetWatchStatusRequestSchema,
|
|
305
|
+
ShikiTokenLinesSchema: () => ShikiTokenLinesSchema,
|
|
306
|
+
ShikiTokenSchema: () => ShikiTokenSchema,
|
|
307
|
+
ShikiTokenStyleSchema: () => ShikiTokenStyleSchema,
|
|
269
308
|
StorageDriverEntrySchema: () => StorageDriverEntrySchema,
|
|
270
309
|
SuccessResponseSchema: () => SuccessResponseSchema,
|
|
271
310
|
ThemeSchema: () => ThemeSchema,
|
|
@@ -278,6 +317,7 @@ __export(index_exports, {
|
|
|
278
317
|
TokenAuthResponseSchema: () => TokenAuthResponseSchema,
|
|
279
318
|
TokenRequestSchema: () => TokenRequestSchema,
|
|
280
319
|
TokenResponseSchema: () => TokenResponseSchema,
|
|
320
|
+
UPLOAD_ALLOWED_MIME: () => UPLOAD_ALLOWED_MIME,
|
|
281
321
|
UpdateAdminUserEmailRequestSchema: () => UpdateAdminUserEmailRequestSchema,
|
|
282
322
|
UpdateAppSettingsRequestSchema: () => UpdateAppSettingsRequestSchema,
|
|
283
323
|
UpdateAppSettingsResponseSchema: () => UpdateAppSettingsResponseSchema,
|
|
@@ -309,6 +349,7 @@ __export(index_exports, {
|
|
|
309
349
|
UserStatusErrorSchema: () => UserStatusErrorSchema,
|
|
310
350
|
UserStatusSchema: () => UserStatusSchema,
|
|
311
351
|
UserSubpagesRequestSchema: () => UserSubpagesRequestSchema,
|
|
352
|
+
UsernameSchema: () => UsernameSchema,
|
|
312
353
|
ValidationErrorSchema: () => ValidationErrorSchema,
|
|
313
354
|
WS_CLOSE_CODES: () => WS_CLOSE_CODES,
|
|
314
355
|
WatchStatusResponseSchema: () => WatchStatusResponseSchema,
|
|
@@ -379,6 +420,7 @@ __export(index_exports, {
|
|
|
379
420
|
getNotificationsTokenRoute: () => getNotificationsTokenRoute,
|
|
380
421
|
getPageRoute: () => getPageRoute,
|
|
381
422
|
getPluginConfigRoute: () => getPluginConfigRoute,
|
|
423
|
+
getPluginReadinessRoute: () => getPluginReadinessRoute,
|
|
382
424
|
getPresenceTokenRoute: () => getPresenceTokenRoute,
|
|
383
425
|
getProfileRoute: () => getProfileRoute,
|
|
384
426
|
getRevisionRoute: () => getRevisionRoute,
|
|
@@ -459,6 +501,7 @@ __export(index_exports, {
|
|
|
459
501
|
tokenRegisterRoute: () => tokenRegisterRoute,
|
|
460
502
|
tokenRoute: () => tokenRoute,
|
|
461
503
|
unlikePageRoute: () => unlikePageRoute,
|
|
504
|
+
unwrapRenderedAst: () => unwrapRenderedAst,
|
|
462
505
|
updateAppSettingsRoute: () => updateAppSettingsRoute,
|
|
463
506
|
updateAuthSettingsRoute: () => updateAuthSettingsRoute,
|
|
464
507
|
updateMailSettingsRoute: () => updateMailSettingsRoute,
|
|
@@ -479,7 +522,7 @@ __export(index_exports, {
|
|
|
479
522
|
module.exports = __toCommonJS(index_exports);
|
|
480
523
|
|
|
481
524
|
// src/client.ts
|
|
482
|
-
var
|
|
525
|
+
var import_zod_openapi75 = require("@hono/zod-openapi");
|
|
483
526
|
var import_client = require("hono/client");
|
|
484
527
|
|
|
485
528
|
// src/contracts/admin/app.ts
|
|
@@ -1129,6 +1172,18 @@ var ClearRenderCacheResponseSchema = import_zod_openapi9.z.object({
|
|
|
1129
1172
|
/** Number of cache rows removed. */
|
|
1130
1173
|
removedCount: import_zod_openapi9.z.number().int().min(0)
|
|
1131
1174
|
});
|
|
1175
|
+
var PluginReadinessFieldSchema = import_zod_openapi9.z.object({
|
|
1176
|
+
name: import_zod_openapi9.z.string(),
|
|
1177
|
+
configured: import_zod_openapi9.z.literal(false)
|
|
1178
|
+
});
|
|
1179
|
+
var PluginReadinessIssueSchema = import_zod_openapi9.z.object({
|
|
1180
|
+
name: import_zod_openapi9.z.string(),
|
|
1181
|
+
adminPlacement: PluginAdminPlacementSchema,
|
|
1182
|
+
fields: import_zod_openapi9.z.array(PluginReadinessFieldSchema)
|
|
1183
|
+
});
|
|
1184
|
+
var PluginReadinessResponseSchema = import_zod_openapi9.z.object({
|
|
1185
|
+
issues: import_zod_openapi9.z.array(PluginReadinessIssueSchema)
|
|
1186
|
+
});
|
|
1132
1187
|
|
|
1133
1188
|
// src/contracts/admin/plugins.ts
|
|
1134
1189
|
var PluginNameQuerySchema = import_zod_openapi10.z.object({ name: import_zod_openapi10.z.string() });
|
|
@@ -1260,6 +1315,27 @@ var clearRenderCacheAllRoute = (0, import_zod_openapi10.createRoute)({
|
|
|
1260
1315
|
}
|
|
1261
1316
|
}
|
|
1262
1317
|
});
|
|
1318
|
+
var getPluginReadinessRoute = (0, import_zod_openapi10.createRoute)({
|
|
1319
|
+
method: "get",
|
|
1320
|
+
path: "/admin/plugins/readiness",
|
|
1321
|
+
tags: ["admin.plugins"],
|
|
1322
|
+
security: [{ bearerAuth: [] }],
|
|
1323
|
+
summary: "List active plugins missing required readiness config fields",
|
|
1324
|
+
responses: {
|
|
1325
|
+
200: {
|
|
1326
|
+
description: "Readiness issues for active plugins (empty when everything is configured)",
|
|
1327
|
+
content: { "application/json": { schema: PluginReadinessResponseSchema } }
|
|
1328
|
+
},
|
|
1329
|
+
401: {
|
|
1330
|
+
description: "Authentication required",
|
|
1331
|
+
content: { "application/json": { schema: AuthenticationRequiredErrorSchema } }
|
|
1332
|
+
},
|
|
1333
|
+
403: {
|
|
1334
|
+
description: "Admin permission required",
|
|
1335
|
+
content: { "application/json": { schema: AdminRequiredErrorSchema } }
|
|
1336
|
+
}
|
|
1337
|
+
}
|
|
1338
|
+
});
|
|
1263
1339
|
var clearRenderCachePluginRoute = (0, import_zod_openapi10.createRoute)({
|
|
1264
1340
|
method: "post",
|
|
1265
1341
|
path: "/admin/plugins/render-cache/clear-plugin",
|
|
@@ -1299,6 +1375,7 @@ var adminPluginsRoutes = {
|
|
|
1299
1375
|
listPluginsRoute,
|
|
1300
1376
|
getPluginConfigRoute,
|
|
1301
1377
|
updatePluginConfigRoute,
|
|
1378
|
+
getPluginReadinessRoute,
|
|
1302
1379
|
clearRenderCacheAllRoute,
|
|
1303
1380
|
clearRenderCachePluginRoute
|
|
1304
1381
|
};
|
|
@@ -2202,14 +2279,51 @@ var UploadAttachmentResponseSchema = import_zod_openapi24.z.object({
|
|
|
2202
2279
|
mimeType: import_zod_openapi24.z.string(),
|
|
2203
2280
|
sizeBytes: import_zod_openapi24.z.number()
|
|
2204
2281
|
});
|
|
2205
|
-
var UploadAttachmentErrorCodeSchema = import_zod_openapi24.z.enum(["too_large", "disallowed_type", "rate_limited", "no_permission"]);
|
|
2282
|
+
var UploadAttachmentErrorCodeSchema = import_zod_openapi24.z.enum(["too_large", "disallowed_type", "DISALLOWED_MIME", "rate_limited", "no_permission"]);
|
|
2206
2283
|
var UploadAttachmentErrorSchema = import_zod_openapi24.z.object({
|
|
2207
2284
|
error: UploadAttachmentErrorCodeSchema,
|
|
2208
2285
|
message: import_zod_openapi24.z.string(),
|
|
2209
2286
|
details: import_zod_openapi24.z.record(import_zod_openapi24.z.string(), import_zod_openapi24.z.unknown()).optional()
|
|
2210
2287
|
});
|
|
2211
|
-
var
|
|
2212
|
-
|
|
2288
|
+
var UPLOAD_ALLOWED_MIME = [
|
|
2289
|
+
// Raster + vector images.
|
|
2290
|
+
"image/png",
|
|
2291
|
+
"image/jpeg",
|
|
2292
|
+
"image/gif",
|
|
2293
|
+
"image/webp",
|
|
2294
|
+
"image/svg+xml",
|
|
2295
|
+
"image/bmp",
|
|
2296
|
+
"image/avif",
|
|
2297
|
+
"image/apng",
|
|
2298
|
+
"image/x-icon",
|
|
2299
|
+
// Documents / text.
|
|
2300
|
+
"application/pdf",
|
|
2301
|
+
"text/plain",
|
|
2302
|
+
"text/markdown",
|
|
2303
|
+
"text/csv",
|
|
2304
|
+
"application/json",
|
|
2305
|
+
"application/xml",
|
|
2306
|
+
"text/html",
|
|
2307
|
+
// Office documents.
|
|
2308
|
+
"application/msword",
|
|
2309
|
+
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
2310
|
+
"application/vnd.ms-excel",
|
|
2311
|
+
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
2312
|
+
"application/vnd.ms-powerpoint",
|
|
2313
|
+
"application/vnd.openxmlformats-officedocument.presentationml.presentation",
|
|
2314
|
+
// Archives.
|
|
2315
|
+
"application/zip",
|
|
2316
|
+
"application/gzip",
|
|
2317
|
+
"application/x-tar",
|
|
2318
|
+
// Audio / video.
|
|
2319
|
+
"audio/mpeg",
|
|
2320
|
+
"audio/wav",
|
|
2321
|
+
"video/mp4",
|
|
2322
|
+
"video/webm",
|
|
2323
|
+
"video/quicktime",
|
|
2324
|
+
// Unknown / unset — see the note above.
|
|
2325
|
+
"application/octet-stream"
|
|
2326
|
+
];
|
|
2213
2327
|
|
|
2214
2328
|
// src/contracts/attachment.ts
|
|
2215
2329
|
var PageIdPathParamsSchema = import_zod_openapi25.z.object({
|
|
@@ -2291,6 +2405,10 @@ var addAttachmentRoute = (0, import_zod_openapi25.createRoute)({
|
|
|
2291
2405
|
description: "Request body exceeds the multipart envelope ceiling",
|
|
2292
2406
|
content: { "application/json": { schema: AttachmentErrorSchema } }
|
|
2293
2407
|
},
|
|
2408
|
+
415: {
|
|
2409
|
+
description: "MIME type not in the unified upload allow-list (feature-attachment-upload-policy)",
|
|
2410
|
+
content: { "application/json": { schema: AttachmentErrorSchema } }
|
|
2411
|
+
},
|
|
2294
2412
|
500: {
|
|
2295
2413
|
description: "Upload / storage failure",
|
|
2296
2414
|
content: { "application/json": { schema: AttachmentErrorSchema } }
|
|
@@ -2394,7 +2512,7 @@ var uploadAttachmentRoute = (0, import_zod_openapi25.createRoute)({
|
|
|
2394
2512
|
content: { "application/json": { schema: UploadAttachmentErrorSchema } }
|
|
2395
2513
|
},
|
|
2396
2514
|
415: {
|
|
2397
|
-
description: "MIME type not in the
|
|
2515
|
+
description: "MIME type not in the unified upload allow-list (feature-attachment-upload-policy)",
|
|
2398
2516
|
content: { "application/json": { schema: UploadAttachmentErrorSchema } }
|
|
2399
2517
|
},
|
|
2400
2518
|
429: {
|
|
@@ -2555,7 +2673,7 @@ var autocompleteRoutes = {
|
|
|
2555
2673
|
};
|
|
2556
2674
|
|
|
2557
2675
|
// src/contracts/backlink.ts
|
|
2558
|
-
var
|
|
2676
|
+
var import_zod_openapi32 = require("@hono/zod-openapi");
|
|
2559
2677
|
|
|
2560
2678
|
// src/schemas/backlink.ts
|
|
2561
2679
|
var import_zod_openapi28 = require("@hono/zod-openapi");
|
|
@@ -2589,7 +2707,7 @@ var GetBacklinksResponseSchema = import_zod_openapi28.z.object({
|
|
|
2589
2707
|
});
|
|
2590
2708
|
|
|
2591
2709
|
// src/schemas/page.ts
|
|
2592
|
-
var
|
|
2710
|
+
var import_zod_openapi31 = require("@hono/zod-openapi");
|
|
2593
2711
|
|
|
2594
2712
|
// src/schemas/collab.ts
|
|
2595
2713
|
var import_zod_openapi29 = require("@hono/zod-openapi");
|
|
@@ -2627,15 +2745,341 @@ var CollabForceReloadMessageSchema = import_zod_openapi29.z.object({
|
|
|
2627
2745
|
reason: import_zod_openapi29.z.string().optional()
|
|
2628
2746
|
});
|
|
2629
2747
|
|
|
2748
|
+
// src/schemas/rendered-ast.ts
|
|
2749
|
+
var import_zod_openapi30 = require("@hono/zod-openapi");
|
|
2750
|
+
var CURRENT_AST_VERSION = 1;
|
|
2751
|
+
var AST_INPUT_LIMIT_BYTES = 8 * 1024 * 1024;
|
|
2752
|
+
var AST_OUTPUT_WARN_BYTES = 512 * 1024;
|
|
2753
|
+
var AST_OUTPUT_BUDGET_BYTES = 2 * 1024 * 1024;
|
|
2754
|
+
var AST_MAX_TREE_DEPTH = 64;
|
|
2755
|
+
var AST_MAX_HAST_DEPTH = 16;
|
|
2756
|
+
var AST_MAX_IMAGE_BASE64_CHARS = 14e4;
|
|
2757
|
+
var AST_MAX_VALUE_CHARS = 2e5;
|
|
2758
|
+
var HPropertyValueSchema = import_zod_openapi30.z.union([
|
|
2759
|
+
import_zod_openapi30.z.string().max(4096),
|
|
2760
|
+
import_zod_openapi30.z.number(),
|
|
2761
|
+
import_zod_openapi30.z.boolean(),
|
|
2762
|
+
import_zod_openapi30.z.array(import_zod_openapi30.z.union([import_zod_openapi30.z.string().max(4096), import_zod_openapi30.z.number()])).max(64)
|
|
2763
|
+
// className etc.
|
|
2764
|
+
]);
|
|
2765
|
+
var HPropertiesSchema = import_zod_openapi30.z.object({
|
|
2766
|
+
id: import_zod_openapi30.z.string().max(256).optional(),
|
|
2767
|
+
className: import_zod_openapi30.z.union([import_zod_openapi30.z.string().max(4096), import_zod_openapi30.z.array(import_zod_openapi30.z.string().max(256)).max(64)]).optional(),
|
|
2768
|
+
role: import_zod_openapi30.z.string().max(64).optional(),
|
|
2769
|
+
ariaLabel: import_zod_openapi30.z.string().max(256).optional(),
|
|
2770
|
+
"data-source-line": import_zod_openapi30.z.union([import_zod_openapi30.z.string().max(32), import_zod_openapi30.z.number()]).optional(),
|
|
2771
|
+
"data-crowi-image-align": import_zod_openapi30.z.string().max(16).optional(),
|
|
2772
|
+
"data-crowi-image-float": import_zod_openapi30.z.string().max(16).optional(),
|
|
2773
|
+
"data-crowi-image-width": import_zod_openapi30.z.string().max(16).optional(),
|
|
2774
|
+
"data-crowi-image-height": import_zod_openapi30.z.string().max(16).optional()
|
|
2775
|
+
}).catchall(HPropertyValueSchema);
|
|
2776
|
+
var HChildSchema = import_zod_openapi30.z.lazy(
|
|
2777
|
+
() => import_zod_openapi30.z.discriminatedUnion("type", [
|
|
2778
|
+
import_zod_openapi30.z.object({ type: import_zod_openapi30.z.literal("raw"), value: import_zod_openapi30.z.string().max(AST_MAX_VALUE_CHARS) }),
|
|
2779
|
+
import_zod_openapi30.z.object({ type: import_zod_openapi30.z.literal("text"), value: import_zod_openapi30.z.string().max(AST_MAX_VALUE_CHARS) }),
|
|
2780
|
+
import_zod_openapi30.z.object({
|
|
2781
|
+
type: import_zod_openapi30.z.literal("element"),
|
|
2782
|
+
tagName: import_zod_openapi30.z.string().max(32).regex(/^[a-zA-Z][a-zA-Z0-9-]*$/),
|
|
2783
|
+
properties: HPropertiesSchema.optional(),
|
|
2784
|
+
children: import_zod_openapi30.z.array(HChildSchema)
|
|
2785
|
+
})
|
|
2786
|
+
])
|
|
2787
|
+
);
|
|
2788
|
+
var HChildrenSchema = import_zod_openapi30.z.array(HChildSchema).max(256);
|
|
2789
|
+
var HNameSchema = import_zod_openapi30.z.string().max(32).regex(/^[a-zA-Z][a-zA-Z0-9-]*$/);
|
|
2790
|
+
var HastHintDataSchema = import_zod_openapi30.z.object({
|
|
2791
|
+
hName: HNameSchema.optional(),
|
|
2792
|
+
hProperties: HPropertiesSchema.optional(),
|
|
2793
|
+
hChildren: HChildrenSchema.optional()
|
|
2794
|
+
});
|
|
2795
|
+
var CrowiDimensionSchema = import_zod_openapi30.z.number().int().min(1).max(16384);
|
|
2796
|
+
var CrowiImagePayloadSchema = import_zod_openapi30.z.object({
|
|
2797
|
+
mediaType: import_zod_openapi30.z.enum(["image/svg+xml", "image/png"]),
|
|
2798
|
+
base64: import_zod_openapi30.z.string().max(AST_MAX_IMAGE_BASE64_CHARS),
|
|
2799
|
+
/** Intrinsic dimensions — required (parent spec §3). Producers that cannot derive them fall back to html-only. */
|
|
2800
|
+
width: CrowiDimensionSchema,
|
|
2801
|
+
height: CrowiDimensionSchema
|
|
2802
|
+
});
|
|
2803
|
+
var ShikiTokenStyleSchema = import_zod_openapi30.z.object({
|
|
2804
|
+
color: import_zod_openapi30.z.string().max(32),
|
|
2805
|
+
bgColor: import_zod_openapi30.z.string().max(32).optional(),
|
|
2806
|
+
fontStyle: import_zod_openapi30.z.array(import_zod_openapi30.z.enum(["italic", "bold", "underline", "strikethrough"])).max(4).optional()
|
|
2807
|
+
});
|
|
2808
|
+
var ShikiTokenSchema = import_zod_openapi30.z.object({
|
|
2809
|
+
content: import_zod_openapi30.z.string().max(4096),
|
|
2810
|
+
light: ShikiTokenStyleSchema,
|
|
2811
|
+
dark: ShikiTokenStyleSchema
|
|
2812
|
+
});
|
|
2813
|
+
var ShikiTokenLinesSchema = import_zod_openapi30.z.array(import_zod_openapi30.z.array(ShikiTokenSchema)).max(2e4);
|
|
2814
|
+
var CrowiCodeSidecarSchema = import_zod_openapi30.z.object({
|
|
2815
|
+
lang: import_zod_openapi30.z.string().max(64).optional(),
|
|
2816
|
+
value: import_zod_openapi30.z.string().max(AST_MAX_VALUE_CHARS),
|
|
2817
|
+
/** Lines of themed tokens (light/dark both, `defaultColor: false`). */
|
|
2818
|
+
tokens: ShikiTokenLinesSchema
|
|
2819
|
+
});
|
|
2820
|
+
var CrowiMathSidecarSchema = import_zod_openapi30.z.object({
|
|
2821
|
+
tex: import_zod_openapi30.z.string().max(AST_MAX_VALUE_CHARS),
|
|
2822
|
+
display: import_zod_openapi30.z.boolean()
|
|
2823
|
+
});
|
|
2824
|
+
var CrowiDiagramSidecarSchema = import_zod_openapi30.z.object({
|
|
2825
|
+
kind: import_zod_openapi30.z.enum(["mermaid", "plantuml"]),
|
|
2826
|
+
/** Mermaid's closed-enum diagram-type keyword (flowchart / sequence / ...). */
|
|
2827
|
+
diagramType: import_zod_openapi30.z.string().max(32).optional(),
|
|
2828
|
+
alt: import_zod_openapi30.z.string().max(256),
|
|
2829
|
+
image: CrowiImagePayloadSchema
|
|
2830
|
+
});
|
|
2831
|
+
var CrowiLinkCardSidecarSchema = import_zod_openapi30.z.object({
|
|
2832
|
+
url: import_zod_openapi30.z.string().max(4096),
|
|
2833
|
+
title: import_zod_openapi30.z.string().max(512).optional(),
|
|
2834
|
+
description: import_zod_openapi30.z.string().max(2048).optional(),
|
|
2835
|
+
/** OGP image stays an external URL (never inlined server-side — parent spec §10). */
|
|
2836
|
+
image: import_zod_openapi30.z.object({ url: import_zod_openapi30.z.string().max(4096) }).optional(),
|
|
2837
|
+
siteName: import_zod_openapi30.z.string().max(256).optional(),
|
|
2838
|
+
domain: import_zod_openapi30.z.string().max(256).optional()
|
|
2839
|
+
});
|
|
2840
|
+
var CrowiPlaceholderKindSchema = import_zod_openapi30.z.enum([
|
|
2841
|
+
"error-auth",
|
|
2842
|
+
"error-rate-limit",
|
|
2843
|
+
"error-not-found",
|
|
2844
|
+
"error-network",
|
|
2845
|
+
"error-timeout",
|
|
2846
|
+
"error-unknown",
|
|
2847
|
+
"error-blocked",
|
|
2848
|
+
"error-busy",
|
|
2849
|
+
"size-limit-entry",
|
|
2850
|
+
"size-limit-page",
|
|
2851
|
+
"dispatch-limit",
|
|
2852
|
+
"validation-failed",
|
|
2853
|
+
"envelope-invalid"
|
|
2854
|
+
]);
|
|
2855
|
+
var ReservationSchema = import_zod_openapi30.z.discriminatedUnion("variant", [
|
|
2856
|
+
import_zod_openapi30.z.object({ variant: import_zod_openapi30.z.literal("fixed"), widthPx: import_zod_openapi30.z.number().optional(), heightPx: import_zod_openapi30.z.number() }),
|
|
2857
|
+
import_zod_openapi30.z.object({ variant: import_zod_openapi30.z.literal("aspect"), aspectRatio: import_zod_openapi30.z.number() }),
|
|
2858
|
+
import_zod_openapi30.z.object({ variant: import_zod_openapi30.z.literal("card"), size: import_zod_openapi30.z.enum(["small", "medium", "large"]) })
|
|
2859
|
+
]);
|
|
2860
|
+
var CrowiPlaceholderSidecarSchema = import_zod_openapi30.z.object({
|
|
2861
|
+
kind: CrowiPlaceholderKindSchema,
|
|
2862
|
+
label: import_zod_openapi30.z.string().max(512),
|
|
2863
|
+
reservation: ReservationSchema
|
|
2864
|
+
});
|
|
2865
|
+
var SIDECAR_KEYS = ["crowiCode", "crowiMath", "crowiDiagram", "crowiLinkCard", "crowiPlaceholder"];
|
|
2866
|
+
var noFields = import_zod_openapi30.z.object({});
|
|
2867
|
+
var headingFields = import_zod_openapi30.z.object({ depth: import_zod_openapi30.z.number().int().min(1).max(6) });
|
|
2868
|
+
var valueFields = import_zod_openapi30.z.object({ value: import_zod_openapi30.z.string().max(AST_MAX_VALUE_CHARS) });
|
|
2869
|
+
var codeFields = import_zod_openapi30.z.object({
|
|
2870
|
+
value: import_zod_openapi30.z.string().max(AST_MAX_VALUE_CHARS),
|
|
2871
|
+
lang: import_zod_openapi30.z.string().max(64).nullable().optional(),
|
|
2872
|
+
meta: import_zod_openapi30.z.string().max(1024).nullable().optional()
|
|
2873
|
+
});
|
|
2874
|
+
var mathFields = import_zod_openapi30.z.object({
|
|
2875
|
+
value: import_zod_openapi30.z.string().max(AST_MAX_VALUE_CHARS),
|
|
2876
|
+
meta: import_zod_openapi30.z.string().max(1024).nullable().optional()
|
|
2877
|
+
});
|
|
2878
|
+
var listFields = import_zod_openapi30.z.object({
|
|
2879
|
+
ordered: import_zod_openapi30.z.boolean().nullable().optional(),
|
|
2880
|
+
start: import_zod_openapi30.z.number().int().nullable().optional(),
|
|
2881
|
+
spread: import_zod_openapi30.z.boolean().nullable().optional()
|
|
2882
|
+
});
|
|
2883
|
+
var listItemFields = import_zod_openapi30.z.object({
|
|
2884
|
+
checked: import_zod_openapi30.z.boolean().nullable().optional(),
|
|
2885
|
+
spread: import_zod_openapi30.z.boolean().nullable().optional()
|
|
2886
|
+
});
|
|
2887
|
+
var linkFields = import_zod_openapi30.z.object({
|
|
2888
|
+
url: import_zod_openapi30.z.string().max(4096),
|
|
2889
|
+
title: import_zod_openapi30.z.string().max(512).nullable().optional()
|
|
2890
|
+
});
|
|
2891
|
+
var imageFields = import_zod_openapi30.z.object({
|
|
2892
|
+
url: import_zod_openapi30.z.string().max(4096),
|
|
2893
|
+
alt: import_zod_openapi30.z.string().max(1024).nullable().optional(),
|
|
2894
|
+
title: import_zod_openapi30.z.string().max(512).nullable().optional()
|
|
2895
|
+
});
|
|
2896
|
+
var tableFields = import_zod_openapi30.z.object({
|
|
2897
|
+
align: import_zod_openapi30.z.array(import_zod_openapi30.z.enum(["left", "right", "center"]).nullable()).max(256).nullable().optional()
|
|
2898
|
+
});
|
|
2899
|
+
var definitionFields = import_zod_openapi30.z.object({
|
|
2900
|
+
identifier: import_zod_openapi30.z.string().max(256),
|
|
2901
|
+
url: import_zod_openapi30.z.string().max(4096),
|
|
2902
|
+
label: import_zod_openapi30.z.string().max(256).optional(),
|
|
2903
|
+
title: import_zod_openapi30.z.string().max(512).nullable().optional()
|
|
2904
|
+
});
|
|
2905
|
+
var footnoteDefinitionFields = import_zod_openapi30.z.object({
|
|
2906
|
+
identifier: import_zod_openapi30.z.string().max(256),
|
|
2907
|
+
label: import_zod_openapi30.z.string().max(256).optional()
|
|
2908
|
+
});
|
|
2909
|
+
var footnoteReferenceFields = footnoteDefinitionFields;
|
|
2910
|
+
var referenceTypeSchema = import_zod_openapi30.z.enum(["shortcut", "collapsed", "full"]);
|
|
2911
|
+
var linkReferenceFields = import_zod_openapi30.z.object({
|
|
2912
|
+
identifier: import_zod_openapi30.z.string().max(256),
|
|
2913
|
+
referenceType: referenceTypeSchema,
|
|
2914
|
+
label: import_zod_openapi30.z.string().max(256).optional()
|
|
2915
|
+
});
|
|
2916
|
+
var imageReferenceFields = import_zod_openapi30.z.object({
|
|
2917
|
+
identifier: import_zod_openapi30.z.string().max(256),
|
|
2918
|
+
referenceType: referenceTypeSchema,
|
|
2919
|
+
label: import_zod_openapi30.z.string().max(256).optional(),
|
|
2920
|
+
alt: import_zod_openapi30.z.string().max(1024).nullable().optional()
|
|
2921
|
+
});
|
|
2922
|
+
var crowiOpaqueFields = import_zod_openapi30.z.object({
|
|
2923
|
+
reason: import_zod_openapi30.z.enum(["unknown-type", "invalid-shape", "invalid-position"]),
|
|
2924
|
+
/** Best-effort diagnostics only — never a rendering hint. Truncated to 64 chars before assignment. */
|
|
2925
|
+
originalType: import_zod_openapi30.z.string().max(64).optional()
|
|
2926
|
+
});
|
|
2927
|
+
var RENDERED_AST_NODE_DEFS = {
|
|
2928
|
+
root: { placement: "flow", childModel: "flow", fields: noFields },
|
|
2929
|
+
paragraph: { placement: "flow", childModel: "phrasing", fields: noFields },
|
|
2930
|
+
heading: { placement: "flow", childModel: "phrasing", fields: headingFields },
|
|
2931
|
+
thematicBreak: { placement: "flow", childModel: "none", fields: noFields },
|
|
2932
|
+
blockquote: { placement: "flow", childModel: "flow", fields: noFields },
|
|
2933
|
+
list: { placement: "flow", childModel: "listItems", fields: listFields },
|
|
2934
|
+
listItem: { placement: "listItems", childModel: "flow", fields: listItemFields },
|
|
2935
|
+
html: { placement: "both", childModel: "none", fields: valueFields },
|
|
2936
|
+
code: { placement: "flow", childModel: "none", fields: codeFields },
|
|
2937
|
+
inlineCode: { placement: "phrasing", childModel: "none", fields: valueFields },
|
|
2938
|
+
math: { placement: "flow", childModel: "none", fields: mathFields },
|
|
2939
|
+
inlineMath: { placement: "phrasing", childModel: "none", fields: mathFields },
|
|
2940
|
+
text: { placement: "phrasing", childModel: "none", fields: valueFields },
|
|
2941
|
+
strong: { placement: "phrasing", childModel: "phrasing", fields: noFields },
|
|
2942
|
+
emphasis: { placement: "phrasing", childModel: "phrasing", fields: noFields },
|
|
2943
|
+
delete: { placement: "phrasing", childModel: "phrasing", fields: noFields },
|
|
2944
|
+
break: { placement: "phrasing", childModel: "none", fields: noFields },
|
|
2945
|
+
link: { placement: "phrasing", childModel: "phrasing", fields: linkFields },
|
|
2946
|
+
image: { placement: "phrasing", childModel: "none", fields: imageFields },
|
|
2947
|
+
table: { placement: "flow", childModel: "tableRows", fields: tableFields },
|
|
2948
|
+
tableRow: { placement: "tableRows", childModel: "tableCells", fields: noFields },
|
|
2949
|
+
tableCell: { placement: "tableCells", childModel: "phrasing", fields: noFields },
|
|
2950
|
+
definition: { placement: "flow", childModel: "none", fields: definitionFields },
|
|
2951
|
+
footnoteDefinition: { placement: "flow", childModel: "flow", fields: footnoteDefinitionFields },
|
|
2952
|
+
footnoteReference: { placement: "phrasing", childModel: "none", fields: footnoteReferenceFields },
|
|
2953
|
+
linkReference: { placement: "phrasing", childModel: "phrasing", fields: linkReferenceFields },
|
|
2954
|
+
imageReference: { placement: "phrasing", childModel: "none", fields: imageReferenceFields },
|
|
2955
|
+
// Crowi-owned types. `crowiFigure` is the only one that also appears
|
|
2956
|
+
// in stored ASTs; the other three only exist as projection outputs
|
|
2957
|
+
// (or as defensively-validated plugin-injected nodes).
|
|
2958
|
+
crowiFigure: { placement: "flow", childModel: "phrasing", fields: noFields },
|
|
2959
|
+
crowiDiagram: { placement: "flow", childModel: "none", fields: CrowiDiagramSidecarSchema },
|
|
2960
|
+
crowiLinkCard: { placement: "flow", childModel: "none", fields: CrowiLinkCardSidecarSchema },
|
|
2961
|
+
crowiPlaceholder: { placement: "both", childModel: "none", fields: CrowiPlaceholderSidecarSchema },
|
|
2962
|
+
crowiOpaque: { placement: "both", childModel: "none", fields: crowiOpaqueFields }
|
|
2963
|
+
};
|
|
2964
|
+
var RenderedAstNodeSchema = import_zod_openapi30.z.lazy(
|
|
2965
|
+
() => import_zod_openapi30.z.discriminatedUnion("type", [
|
|
2966
|
+
RootNodeSchema,
|
|
2967
|
+
ParagraphNodeSchema,
|
|
2968
|
+
HeadingNodeSchema,
|
|
2969
|
+
ThematicBreakNodeSchema,
|
|
2970
|
+
BlockquoteNodeSchema,
|
|
2971
|
+
ListNodeSchema,
|
|
2972
|
+
ListItemNodeSchema,
|
|
2973
|
+
HtmlNodeSchema,
|
|
2974
|
+
CodeNodeSchema,
|
|
2975
|
+
InlineCodeNodeSchema,
|
|
2976
|
+
MathNodeSchema,
|
|
2977
|
+
InlineMathNodeSchema,
|
|
2978
|
+
TextNodeSchema,
|
|
2979
|
+
StrongNodeSchema,
|
|
2980
|
+
EmphasisNodeSchema,
|
|
2981
|
+
DeleteNodeSchema,
|
|
2982
|
+
BreakNodeSchema,
|
|
2983
|
+
LinkNodeSchema,
|
|
2984
|
+
ImageNodeSchema,
|
|
2985
|
+
TableNodeSchema,
|
|
2986
|
+
TableRowNodeSchema,
|
|
2987
|
+
TableCellNodeSchema,
|
|
2988
|
+
DefinitionNodeSchema,
|
|
2989
|
+
FootnoteDefinitionNodeSchema,
|
|
2990
|
+
FootnoteReferenceNodeSchema,
|
|
2991
|
+
LinkReferenceNodeSchema,
|
|
2992
|
+
ImageReferenceNodeSchema,
|
|
2993
|
+
CrowiFigureNodeSchema,
|
|
2994
|
+
CrowiDiagramNodeSchema,
|
|
2995
|
+
CrowiLinkCardNodeSchema,
|
|
2996
|
+
CrowiPlaceholderNodeSchema,
|
|
2997
|
+
CrowiOpaqueNodeSchema
|
|
2998
|
+
])
|
|
2999
|
+
);
|
|
3000
|
+
var childrenSchema = import_zod_openapi30.z.array(RenderedAstNodeSchema);
|
|
3001
|
+
var dataSchema = HastHintDataSchema.optional();
|
|
3002
|
+
var RootNodeSchema = import_zod_openapi30.z.object({ type: import_zod_openapi30.z.literal("root"), data: dataSchema, children: childrenSchema });
|
|
3003
|
+
var ParagraphNodeSchema = import_zod_openapi30.z.object({ type: import_zod_openapi30.z.literal("paragraph"), data: dataSchema, children: childrenSchema });
|
|
3004
|
+
var HeadingNodeSchema = headingFields.extend({ type: import_zod_openapi30.z.literal("heading"), data: dataSchema, children: childrenSchema });
|
|
3005
|
+
var ThematicBreakNodeSchema = import_zod_openapi30.z.object({ type: import_zod_openapi30.z.literal("thematicBreak"), data: dataSchema });
|
|
3006
|
+
var BlockquoteNodeSchema = import_zod_openapi30.z.object({ type: import_zod_openapi30.z.literal("blockquote"), data: dataSchema, children: childrenSchema });
|
|
3007
|
+
var ListNodeSchema = listFields.extend({ type: import_zod_openapi30.z.literal("list"), data: dataSchema, children: childrenSchema });
|
|
3008
|
+
var ListItemNodeSchema = listItemFields.extend({ type: import_zod_openapi30.z.literal("listItem"), data: dataSchema, children: childrenSchema });
|
|
3009
|
+
var HtmlNodeSchema = valueFields.extend({ type: import_zod_openapi30.z.literal("html"), data: dataSchema });
|
|
3010
|
+
var CodeDataSchema = HastHintDataSchema.extend({
|
|
3011
|
+
renderPending: import_zod_openapi30.z.boolean().optional(),
|
|
3012
|
+
tokens: ShikiTokenLinesSchema.optional()
|
|
3013
|
+
}).optional();
|
|
3014
|
+
var CodeNodeSchema = codeFields.extend({ type: import_zod_openapi30.z.literal("code"), data: CodeDataSchema });
|
|
3015
|
+
var InlineCodeNodeSchema = valueFields.extend({ type: import_zod_openapi30.z.literal("inlineCode"), data: dataSchema });
|
|
3016
|
+
var MathNodeSchema = mathFields.extend({ type: import_zod_openapi30.z.literal("math"), data: dataSchema });
|
|
3017
|
+
var InlineMathNodeSchema = mathFields.extend({ type: import_zod_openapi30.z.literal("inlineMath"), data: dataSchema });
|
|
3018
|
+
var TextNodeSchema = valueFields.extend({ type: import_zod_openapi30.z.literal("text"), data: dataSchema });
|
|
3019
|
+
var StrongNodeSchema = import_zod_openapi30.z.object({ type: import_zod_openapi30.z.literal("strong"), data: dataSchema, children: childrenSchema });
|
|
3020
|
+
var EmphasisNodeSchema = import_zod_openapi30.z.object({ type: import_zod_openapi30.z.literal("emphasis"), data: dataSchema, children: childrenSchema });
|
|
3021
|
+
var DeleteNodeSchema = import_zod_openapi30.z.object({ type: import_zod_openapi30.z.literal("delete"), data: dataSchema, children: childrenSchema });
|
|
3022
|
+
var BreakNodeSchema = import_zod_openapi30.z.object({ type: import_zod_openapi30.z.literal("break"), data: dataSchema });
|
|
3023
|
+
var LinkNodeSchema = linkFields.extend({ type: import_zod_openapi30.z.literal("link"), data: dataSchema, children: childrenSchema });
|
|
3024
|
+
var ImageNodeSchema = imageFields.extend({ type: import_zod_openapi30.z.literal("image"), data: dataSchema });
|
|
3025
|
+
var TableNodeSchema = tableFields.extend({ type: import_zod_openapi30.z.literal("table"), data: dataSchema, children: childrenSchema });
|
|
3026
|
+
var TableRowNodeSchema = import_zod_openapi30.z.object({ type: import_zod_openapi30.z.literal("tableRow"), data: dataSchema, children: childrenSchema });
|
|
3027
|
+
var TableCellNodeSchema = import_zod_openapi30.z.object({ type: import_zod_openapi30.z.literal("tableCell"), data: dataSchema, children: childrenSchema });
|
|
3028
|
+
var DefinitionNodeSchema = definitionFields.extend({ type: import_zod_openapi30.z.literal("definition"), data: dataSchema });
|
|
3029
|
+
var FootnoteDefinitionNodeSchema = footnoteDefinitionFields.extend({
|
|
3030
|
+
type: import_zod_openapi30.z.literal("footnoteDefinition"),
|
|
3031
|
+
data: dataSchema,
|
|
3032
|
+
children: childrenSchema
|
|
3033
|
+
});
|
|
3034
|
+
var FootnoteReferenceNodeSchema = footnoteReferenceFields.extend({ type: import_zod_openapi30.z.literal("footnoteReference"), data: dataSchema });
|
|
3035
|
+
var LinkReferenceNodeSchema = linkReferenceFields.extend({ type: import_zod_openapi30.z.literal("linkReference"), data: dataSchema, children: childrenSchema });
|
|
3036
|
+
var ImageReferenceNodeSchema = imageReferenceFields.extend({ type: import_zod_openapi30.z.literal("imageReference"), data: dataSchema });
|
|
3037
|
+
var CrowiFigureNodeSchema = import_zod_openapi30.z.object({
|
|
3038
|
+
type: import_zod_openapi30.z.literal("crowiFigure"),
|
|
3039
|
+
data: HastHintDataSchema.extend({ hName: import_zod_openapi30.z.literal("figure"), hProperties: HPropertiesSchema }),
|
|
3040
|
+
children: childrenSchema
|
|
3041
|
+
});
|
|
3042
|
+
var CrowiDiagramNodeSchema = CrowiDiagramSidecarSchema.extend({ type: import_zod_openapi30.z.literal("crowiDiagram"), data: dataSchema });
|
|
3043
|
+
var CrowiLinkCardNodeSchema = CrowiLinkCardSidecarSchema.extend({ type: import_zod_openapi30.z.literal("crowiLinkCard"), data: dataSchema });
|
|
3044
|
+
var CrowiPlaceholderNodeSchema = CrowiPlaceholderSidecarSchema.extend({ type: import_zod_openapi30.z.literal("crowiPlaceholder"), data: dataSchema });
|
|
3045
|
+
var CrowiOpaqueNodeSchema = crowiOpaqueFields.extend({ type: import_zod_openapi30.z.literal("crowiOpaque"), data: dataSchema });
|
|
3046
|
+
var RenderedAstRootSchema = RootNodeSchema;
|
|
3047
|
+
var RenderedAstEnvelopeSchema = import_zod_openapi30.z.object({
|
|
3048
|
+
astVersion: import_zod_openapi30.z.literal(CURRENT_AST_VERSION),
|
|
3049
|
+
root: RenderedAstRootSchema
|
|
3050
|
+
});
|
|
3051
|
+
var RenderedAstEnvelopeOpenApiSchema = import_zod_openapi30.z.object({
|
|
3052
|
+
astVersion: import_zod_openapi30.z.literal(CURRENT_AST_VERSION),
|
|
3053
|
+
root: import_zod_openapi30.z.unknown()
|
|
3054
|
+
}).openapi("RenderedAstEnvelope");
|
|
3055
|
+
var LooseRenderedAstRootSchema = import_zod_openapi30.z.object({
|
|
3056
|
+
type: import_zod_openapi30.z.literal("root"),
|
|
3057
|
+
children: import_zod_openapi30.z.array(import_zod_openapi30.z.unknown())
|
|
3058
|
+
}).openapi("LegacyRenderedAstRoot");
|
|
3059
|
+
var RenderedAstValueSchema = import_zod_openapi30.z.union([RenderedAstEnvelopeOpenApiSchema, LooseRenderedAstRootSchema]);
|
|
3060
|
+
var RenderedAstArtifactKeySchema = import_zod_openapi30.z.string().max(64);
|
|
3061
|
+
function unwrapRenderedAst(value) {
|
|
3062
|
+
if (value === void 0 || value === null) return void 0;
|
|
3063
|
+
if (typeof value !== "object") return void 0;
|
|
3064
|
+
if (value.astVersion === CURRENT_AST_VERSION) {
|
|
3065
|
+
const root = value.root;
|
|
3066
|
+
return root === null ? void 0 : root;
|
|
3067
|
+
}
|
|
3068
|
+
if (value.type === "root" && Array.isArray(value.children)) {
|
|
3069
|
+
return value;
|
|
3070
|
+
}
|
|
3071
|
+
return void 0;
|
|
3072
|
+
}
|
|
3073
|
+
|
|
2630
3074
|
// src/schemas/page.ts
|
|
2631
|
-
var PageGrantSchema =
|
|
3075
|
+
var PageGrantSchema = import_zod_openapi31.z.enum(["1", "2", "3", "4"]).transform((val) => Number(val));
|
|
2632
3076
|
var PageGrantEnum = {
|
|
2633
3077
|
PUBLIC: 1,
|
|
2634
3078
|
RESTRICTED: 2,
|
|
2635
3079
|
SPECIFIED: 3,
|
|
2636
3080
|
OWNER: 4
|
|
2637
3081
|
};
|
|
2638
|
-
var PageStatusSchema =
|
|
3082
|
+
var PageStatusSchema = import_zod_openapi31.z.enum(["wip", "published", "deleted", "deprecated", "draft"]);
|
|
2639
3083
|
var PageStatusEnum = {
|
|
2640
3084
|
WIP: "wip",
|
|
2641
3085
|
PUBLISHED: "published",
|
|
@@ -2643,43 +3087,43 @@ var PageStatusEnum = {
|
|
|
2643
3087
|
DEPRECATED: "deprecated",
|
|
2644
3088
|
DRAFT: "draft"
|
|
2645
3089
|
};
|
|
2646
|
-
var PageTypeSchema =
|
|
3090
|
+
var PageTypeSchema = import_zod_openapi31.z.enum(["portal", "user", "public"]);
|
|
2647
3091
|
var PageTypeEnum = {
|
|
2648
3092
|
PORTAL: "portal",
|
|
2649
3093
|
USER: "user",
|
|
2650
3094
|
PUBLIC: "public"
|
|
2651
3095
|
};
|
|
2652
|
-
var PageUserSchema =
|
|
2653
|
-
_id:
|
|
2654
|
-
id:
|
|
3096
|
+
var PageUserSchema = import_zod_openapi31.z.object({
|
|
3097
|
+
_id: import_zod_openapi31.z.string(),
|
|
3098
|
+
id: import_zod_openapi31.z.string().optional(),
|
|
2655
3099
|
// for compatibility
|
|
2656
|
-
username:
|
|
2657
|
-
name:
|
|
2658
|
-
email:
|
|
2659
|
-
image:
|
|
2660
|
-
createdAt:
|
|
2661
|
-
});
|
|
2662
|
-
var TocEntrySchema =
|
|
2663
|
-
level:
|
|
2664
|
-
text:
|
|
2665
|
-
anchorId:
|
|
2666
|
-
});
|
|
2667
|
-
var WikiLinkSchema =
|
|
3100
|
+
username: import_zod_openapi31.z.string(),
|
|
3101
|
+
name: import_zod_openapi31.z.string(),
|
|
3102
|
+
email: import_zod_openapi31.z.string().email(),
|
|
3103
|
+
image: import_zod_openapi31.z.string().nullable().optional(),
|
|
3104
|
+
createdAt: import_zod_openapi31.z.string()
|
|
3105
|
+
});
|
|
3106
|
+
var TocEntrySchema = import_zod_openapi31.z.object({
|
|
3107
|
+
level: import_zod_openapi31.z.number().int().min(1).max(6),
|
|
3108
|
+
text: import_zod_openapi31.z.string(),
|
|
3109
|
+
anchorId: import_zod_openapi31.z.string()
|
|
3110
|
+
});
|
|
3111
|
+
var WikiLinkSchema = import_zod_openapi31.z.object({
|
|
2668
3112
|
/** Verbatim source between the `[[` `]]` (no surrounding brackets). */
|
|
2669
|
-
raw:
|
|
3113
|
+
raw: import_zod_openapi31.z.string(),
|
|
2670
3114
|
/** Normalised target (left of the `|`, fragment trimmed for resolution). */
|
|
2671
|
-
target:
|
|
3115
|
+
target: import_zod_openapi31.z.string(),
|
|
2672
3116
|
/** Optional pipe-aliased display text (right of the `|`). */
|
|
2673
|
-
displayText:
|
|
3117
|
+
displayText: import_zod_openapi31.z.string().optional()
|
|
2674
3118
|
});
|
|
2675
|
-
var MentionSchema =
|
|
2676
|
-
username:
|
|
3119
|
+
var MentionSchema = import_zod_openapi31.z.object({
|
|
3120
|
+
username: import_zod_openapi31.z.string()
|
|
2677
3121
|
});
|
|
2678
|
-
var RevisionMetaSchemaShape =
|
|
2679
|
-
toc:
|
|
2680
|
-
wikiLinks:
|
|
2681
|
-
mentions:
|
|
2682
|
-
codeBlockLanguages:
|
|
3122
|
+
var RevisionMetaSchemaShape = import_zod_openapi31.z.object({
|
|
3123
|
+
toc: import_zod_openapi31.z.array(TocEntrySchema).optional(),
|
|
3124
|
+
wikiLinks: import_zod_openapi31.z.array(WikiLinkSchema).optional(),
|
|
3125
|
+
mentions: import_zod_openapi31.z.array(MentionSchema).optional(),
|
|
3126
|
+
codeBlockLanguages: import_zod_openapi31.z.array(import_zod_openapi31.z.string()).optional(),
|
|
2683
3127
|
// feature-backlink-raw-space-metadata: raw destinations recovered by
|
|
2684
3128
|
// `renderer/core/raw-space-links.ts` (`[label](/a b)` — a raw-space
|
|
2685
3129
|
// absolute path CommonMark itself rejects as a link). Verbatim, NOT
|
|
@@ -2687,58 +3131,66 @@ var RevisionMetaSchemaShape = import_zod_openapi30.z.object({
|
|
|
2687
3131
|
// `stripFragmentAndQuery` -> `decodeLinkPath` pipeline the regex-based
|
|
2688
3132
|
// extraction path uses. Mirrors `wikiLinks` above: pushed by the core
|
|
2689
3133
|
// transform into `PipelineMetadata`, persisted verbatim on `revision.meta`.
|
|
2690
|
-
rawSpaceLinks:
|
|
3134
|
+
rawSpaceLinks: import_zod_openapi31.z.array(import_zod_openapi31.z.string()).optional()
|
|
2691
3135
|
});
|
|
2692
|
-
var RevisionSchema =
|
|
2693
|
-
_id:
|
|
2694
|
-
path:
|
|
2695
|
-
body:
|
|
2696
|
-
format:
|
|
3136
|
+
var RevisionSchema = import_zod_openapi31.z.object({
|
|
3137
|
+
_id: import_zod_openapi31.z.string(),
|
|
3138
|
+
path: import_zod_openapi31.z.string(),
|
|
3139
|
+
body: import_zod_openapi31.z.string(),
|
|
3140
|
+
format: import_zod_openapi31.z.string().default("markdown"),
|
|
2697
3141
|
author: PageUserSchema.nullable().optional(),
|
|
2698
|
-
createdAt:
|
|
3142
|
+
createdAt: import_zod_openapi31.z.string(),
|
|
2699
3143
|
meta: RevisionMetaSchemaShape.optional(),
|
|
2700
|
-
// RFC-0002 Phase 3: transformed mdast
|
|
2701
|
-
//
|
|
2702
|
-
//
|
|
2703
|
-
//
|
|
2704
|
-
//
|
|
2705
|
-
//
|
|
2706
|
-
|
|
3144
|
+
// RFC-0002 Phase 3 / RFC-0023: transformed mdast. Requests that
|
|
3145
|
+
// declare `X-Crowi-Ast-Version: 1` receive the typed envelope
|
|
3146
|
+
// (`{astVersion, root}`); everyone else (including the web,
|
|
3147
|
+
// permanently) receives the stored bare mdast `Root` verbatim and
|
|
3148
|
+
// unvalidated — see `schemas/rendered-ast.ts` for the full contract.
|
|
3149
|
+
// Only single-page detail (`getPage`), the listPages portal document
|
|
3150
|
+
// and single-revision detail (`getRevision`) emit it; list rows skip
|
|
3151
|
+
// it for payload weight.
|
|
3152
|
+
renderedAst: RenderedAstValueSchema.optional(),
|
|
3153
|
+
// RFC-0023 (design doc §14): identity of the served AST artifact —
|
|
3154
|
+
// `rendererVersion` for a verbatim stored AST, a per-response nonce
|
|
3155
|
+
// when the served tree differs from the stored one (pending-marker
|
|
3156
|
+
// retry / freshness-mismatch recompute). The web render memo keys on
|
|
3157
|
+
// `[revisionId, renderedAstArtifactKey]`.
|
|
3158
|
+
renderedAstArtifactKey: RenderedAstArtifactKeySchema.optional(),
|
|
2707
3159
|
// RFC-0002 round 3.1: semver of the renderer pipeline that produced
|
|
2708
3160
|
// `renderedAst`. The read path uses this to detect stale entries
|
|
2709
3161
|
// (rebuilt by `renderer:rebuild` once RFC-0008 lands). Absent on
|
|
2710
3162
|
// revisions saved before this field was introduced.
|
|
2711
|
-
rendererVersion:
|
|
3163
|
+
rendererVersion: import_zod_openapi31.z.string().optional(),
|
|
2712
3164
|
// RFC-0003 collaborative-save fields. All optional; v1.x revisions
|
|
2713
3165
|
// emit none of them. See `packages/api/src/models/revision.ts` for
|
|
2714
3166
|
// semantics. The list-page endpoint currently does not surface
|
|
2715
3167
|
// these — they only appear on the Phase 5+ checkpoint Revisions
|
|
2716
3168
|
// produced by Hocuspocus and on the single-revision detail route.
|
|
2717
|
-
parentRevisionId:
|
|
3169
|
+
parentRevisionId: import_zod_openapi31.z.string().nullable().optional(),
|
|
2718
3170
|
type: RevisionTypeSchema.optional(),
|
|
2719
|
-
savedBy:
|
|
2720
|
-
contributors:
|
|
2721
|
-
message:
|
|
3171
|
+
savedBy: import_zod_openapi31.z.union([import_zod_openapi31.z.string(), PageUserSchema]).nullable().optional(),
|
|
3172
|
+
contributors: import_zod_openapi31.z.array(import_zod_openapi31.z.union([import_zod_openapi31.z.string(), PageUserSchema])).optional(),
|
|
3173
|
+
message: import_zod_openapi31.z.string().optional(),
|
|
2722
3174
|
// RFC-0010 — edit channel ('web' | 'oauth' | 'pat'); absent on
|
|
2723
3175
|
// pre-RFC-0010 / collaborative / browser revisions.
|
|
2724
|
-
editVia:
|
|
2725
|
-
});
|
|
2726
|
-
var PageExtendedSchema =
|
|
2727
|
-
var PageSchema =
|
|
2728
|
-
_id:
|
|
2729
|
-
path:
|
|
2730
|
-
revision:
|
|
2731
|
-
redirectTo:
|
|
3176
|
+
editVia: import_zod_openapi31.z.enum(["web", "oauth", "pat"]).optional()
|
|
3177
|
+
});
|
|
3178
|
+
var PageExtendedSchema = import_zod_openapi31.z.record(import_zod_openapi31.z.string(), import_zod_openapi31.z.any()).optional();
|
|
3179
|
+
var PageSchema = import_zod_openapi31.z.object({
|
|
3180
|
+
_id: import_zod_openapi31.z.string(),
|
|
3181
|
+
path: import_zod_openapi31.z.string(),
|
|
3182
|
+
revision: import_zod_openapi31.z.union([import_zod_openapi31.z.string(), RevisionSchema]).optional(),
|
|
3183
|
+
redirectTo: import_zod_openapi31.z.string().nullable().optional(),
|
|
2732
3184
|
status: PageStatusSchema.nullable().optional(),
|
|
2733
|
-
grant:
|
|
2734
|
-
grantedUsers:
|
|
2735
|
-
creator:
|
|
2736
|
-
lastUpdateUser:
|
|
2737
|
-
liker:
|
|
2738
|
-
commentCount:
|
|
3185
|
+
grant: import_zod_openapi31.z.number().optional(),
|
|
3186
|
+
grantedUsers: import_zod_openapi31.z.array(import_zod_openapi31.z.string()).optional(),
|
|
3187
|
+
creator: import_zod_openapi31.z.union([import_zod_openapi31.z.string(), PageUserSchema]).nullable().optional(),
|
|
3188
|
+
lastUpdateUser: import_zod_openapi31.z.union([import_zod_openapi31.z.string(), PageUserSchema]).nullable().optional(),
|
|
3189
|
+
liker: import_zod_openapi31.z.array(import_zod_openapi31.z.string()).optional(),
|
|
3190
|
+
commentCount: import_zod_openapi31.z.number().default(0),
|
|
2739
3191
|
extended: PageExtendedSchema,
|
|
2740
|
-
createdAt:
|
|
2741
|
-
updatedAt:
|
|
3192
|
+
createdAt: import_zod_openapi31.z.string(),
|
|
3193
|
+
updatedAt: import_zod_openapi31.z.string().optional(),
|
|
2742
3194
|
// RFC-0003 collaborative-edit fields. All optional; `null` is the
|
|
2743
3195
|
// "no live state yet" value. Existing read endpoints (list /
|
|
2744
3196
|
// detail) do not currently emit these — the contract is widened
|
|
@@ -2746,32 +3198,32 @@ var PageSchema = import_zod_openapi30.z.object({
|
|
|
2746
3198
|
// bump. `yjsState` is intentionally omitted from the contract:
|
|
2747
3199
|
// the binary blob lives only inside Hocuspocus and never crosses
|
|
2748
3200
|
// the HTTP API.
|
|
2749
|
-
currentRevision:
|
|
2750
|
-
yjsCheckpointAt:
|
|
3201
|
+
currentRevision: import_zod_openapi31.z.string().nullable().optional(),
|
|
3202
|
+
yjsCheckpointAt: import_zod_openapi31.z.string().nullable().optional(),
|
|
2751
3203
|
// dynamic fields
|
|
2752
|
-
latestRevision:
|
|
2753
|
-
likerCount:
|
|
2754
|
-
seenUsersCount:
|
|
3204
|
+
latestRevision: import_zod_openapi31.z.string().optional(),
|
|
3205
|
+
likerCount: import_zod_openapi31.z.number().optional(),
|
|
3206
|
+
seenUsersCount: import_zod_openapi31.z.number().optional()
|
|
2755
3207
|
});
|
|
2756
3208
|
var PageWithRevisionSchema = PageSchema.extend({
|
|
2757
3209
|
revision: RevisionSchema,
|
|
2758
3210
|
creator: PageUserSchema.nullable().optional(),
|
|
2759
3211
|
lastUpdateUser: PageUserSchema.nullable().optional()
|
|
2760
3212
|
});
|
|
2761
|
-
var GetPageRequestSchema =
|
|
2762
|
-
path:
|
|
2763
|
-
page_id:
|
|
2764
|
-
revision_id:
|
|
3213
|
+
var GetPageRequestSchema = import_zod_openapi31.z.object({
|
|
3214
|
+
path: import_zod_openapi31.z.string().optional(),
|
|
3215
|
+
page_id: import_zod_openapi31.z.string().optional(),
|
|
3216
|
+
revision_id: import_zod_openapi31.z.string().optional()
|
|
2765
3217
|
});
|
|
2766
|
-
var GetPageResponseSchema =
|
|
3218
|
+
var GetPageResponseSchema = import_zod_openapi31.z.object({
|
|
2767
3219
|
page: PageWithRevisionSchema
|
|
2768
3220
|
});
|
|
2769
|
-
var ClaimPageLinkAccessResponseSchema = GetPageResponseSchema.extend({ granted:
|
|
2770
|
-
var ListPagesRequestSchema =
|
|
2771
|
-
path:
|
|
2772
|
-
user:
|
|
2773
|
-
limit:
|
|
2774
|
-
offset:
|
|
3221
|
+
var ClaimPageLinkAccessResponseSchema = GetPageResponseSchema.extend({ granted: import_zod_openapi31.z.boolean() });
|
|
3222
|
+
var ListPagesRequestSchema = import_zod_openapi31.z.object({
|
|
3223
|
+
path: import_zod_openapi31.z.string().optional(),
|
|
3224
|
+
user: import_zod_openapi31.z.string().optional(),
|
|
3225
|
+
limit: import_zod_openapi31.z.coerce.number().optional().default(50),
|
|
3226
|
+
offset: import_zod_openapi31.z.coerce.number().optional().default(0),
|
|
2775
3227
|
// NOT `z.coerce.boolean()`: that uses JS `Boolean(v)`, so the string
|
|
2776
3228
|
// `"false"` (which is how the web client serialises `false` on the
|
|
2777
3229
|
// query string) coerces to `true`. That silently flipped
|
|
@@ -2779,25 +3231,25 @@ var ListPagesRequestSchema = import_zod_openapi30.z.object({
|
|
|
2779
3231
|
// filter and leak other users' drafts. Parse the string explicitly so
|
|
2780
3232
|
// only `"true"` / `true` is truthy; anything else (incl. `"false"`,
|
|
2781
3233
|
// absent) is `false`.
|
|
2782
|
-
include_deleted:
|
|
3234
|
+
include_deleted: import_zod_openapi31.z.preprocess((v) => v === true || v === "true" || v === "1", import_zod_openapi31.z.boolean()).optional().default(false),
|
|
2783
3235
|
// Sort field + direction for the listing. Defaults preserve the legacy
|
|
2784
3236
|
// "newest-updated first" order so existing callers are unaffected.
|
|
2785
3237
|
// `path` sorts alphabetically by full page path (≈ name order).
|
|
2786
|
-
sort:
|
|
2787
|
-
order:
|
|
3238
|
+
sort: import_zod_openapi31.z.enum(["updatedAt", "createdAt", "path"]).optional().default("updatedAt"),
|
|
3239
|
+
order: import_zod_openapi31.z.enum(["asc", "desc"]).optional().default("desc"),
|
|
2788
3240
|
// When listing a portal path (`/foo/`), open the portal document at this
|
|
2789
3241
|
// past revision so the catch-all can mirror `?revision_id=` on portals.
|
|
2790
3242
|
// Only the `portalPage` is rewound — the child rows always reflect the
|
|
2791
3243
|
// latest. Absent for normal listings.
|
|
2792
|
-
revision_id:
|
|
3244
|
+
revision_id: import_zod_openapi31.z.string().optional()
|
|
2793
3245
|
});
|
|
2794
|
-
var PagerSchema =
|
|
2795
|
-
prev:
|
|
2796
|
-
next:
|
|
2797
|
-
offset:
|
|
3246
|
+
var PagerSchema = import_zod_openapi31.z.object({
|
|
3247
|
+
prev: import_zod_openapi31.z.number().nullable(),
|
|
3248
|
+
next: import_zod_openapi31.z.number().nullable(),
|
|
3249
|
+
offset: import_zod_openapi31.z.number()
|
|
2798
3250
|
});
|
|
2799
|
-
var ListPagesResponseSchema =
|
|
2800
|
-
pages:
|
|
3251
|
+
var ListPagesResponseSchema = import_zod_openapi31.z.object({
|
|
3252
|
+
pages: import_zod_openapi31.z.array(PageSchema),
|
|
2801
3253
|
pager: PagerSchema,
|
|
2802
3254
|
portalPage: PageSchema.nullable().optional(),
|
|
2803
3255
|
// When listing a portal path (`/foo/`) that has NO portal document of
|
|
@@ -2807,148 +3259,155 @@ var ListPagesResponseSchema = import_zod_openapi30.z.object({
|
|
|
2807
3259
|
// (feature-update-pages-list-ux §4). Mutually exclusive with `portalPage`
|
|
2808
3260
|
// — only set when `portalPage` is null. Absent / null for ordinary
|
|
2809
3261
|
// listings.
|
|
2810
|
-
contentPage: PageSchema.nullable().optional()
|
|
2811
|
-
|
|
2812
|
-
|
|
3262
|
+
contentPage: PageSchema.nullable().optional(),
|
|
3263
|
+
// feature-profile-stats-and-page-total — the exact count of the viewer-
|
|
3264
|
+
// visible set `pages` pages from (i.e. matching `pages`' visibility
|
|
3265
|
+
// conditions, independent of `limit`/`offset`, and excluding whichever
|
|
3266
|
+
// ids `portalPage`/`contentPage` already removed from `pages`). Not part
|
|
3267
|
+
// of `PagerSchema` — mirrors `ListUsersResponseSchema.total`, a sibling
|
|
3268
|
+
// top-level field alongside `pager`.
|
|
3269
|
+
total: import_zod_openapi31.z.number()
|
|
3270
|
+
});
|
|
3271
|
+
var PageChildSegmentSchema = import_zod_openapi31.z.object({
|
|
2813
3272
|
// The bare segment name immediately under the queried path
|
|
2814
3273
|
// (e.g. 'rfc' for /crowi/rfc/... when querying /crowi/).
|
|
2815
|
-
segment:
|
|
3274
|
+
segment: import_zod_openapi31.z.string(),
|
|
2816
3275
|
// Portal-style path for this segment (always trailing-slashed),
|
|
2817
3276
|
// e.g. '/crowi/rfc/'. Drop the trailing slash for the page path when
|
|
2818
3277
|
// the segment is a leaf page (see `isPage`).
|
|
2819
|
-
path:
|
|
3278
|
+
path: import_zod_openapi31.z.string(),
|
|
2820
3279
|
// True when a real page is saved at the segment path itself
|
|
2821
3280
|
// (e.g. `/crowi/rfc`, no trailing slash) — i.e. the segment is a
|
|
2822
3281
|
// navigable page, not only an inferred directory.
|
|
2823
|
-
isPage:
|
|
3282
|
+
isPage: import_zod_openapi31.z.boolean(),
|
|
2824
3283
|
// True when a real portal page is saved at `path` (→ compass icon).
|
|
2825
|
-
hasPortal:
|
|
3284
|
+
hasPortal: import_zod_openapi31.z.boolean(),
|
|
2826
3285
|
// Number of descendant content pages strictly under this segment
|
|
2827
3286
|
// (excludes the segment's own page / portal docs). A rough "how much
|
|
2828
3287
|
// lives here" hint; > 0 means the segment is an expandable directory.
|
|
2829
|
-
count:
|
|
3288
|
+
count: import_zod_openapi31.z.number(),
|
|
2830
3289
|
// ISO8601 timestamp of the segment's representative page: the segment's
|
|
2831
3290
|
// own page when `isPage` is true, otherwise the most-recently-updated
|
|
2832
3291
|
// descendant (including the portal doc itself). `null` when no
|
|
2833
3292
|
// representative page's timestamp could be derived. Optional so
|
|
2834
3293
|
// existing clients (web SidebarTree) that don't read it keep working
|
|
2835
3294
|
// unchanged — additive contract extension, feature-child-segments-metadata.
|
|
2836
|
-
lastUpdatedAt:
|
|
3295
|
+
lastUpdatedAt: import_zod_openapi31.z.string().nullable().optional(),
|
|
2837
3296
|
// The representative page's last updater (same page as `lastUpdatedAt`
|
|
2838
3297
|
// above). `null` when the updater can't be resolved (e.g. a deleted
|
|
2839
3298
|
// user, or legacy rows predating `lastUpdateUser`).
|
|
2840
3299
|
updater: PageUserSchema.nullable().optional()
|
|
2841
3300
|
});
|
|
2842
|
-
var ListPageChildrenRequestSchema =
|
|
3301
|
+
var ListPageChildrenRequestSchema = import_zod_openapi31.z.object({
|
|
2843
3302
|
// Portal path to list children of. Trailing slash optional — the
|
|
2844
3303
|
// handler normalises it. '/' lists the top-level segments.
|
|
2845
|
-
path:
|
|
3304
|
+
path: import_zod_openapi31.z.string()
|
|
2846
3305
|
});
|
|
2847
|
-
var ListPageChildrenResponseSchema =
|
|
3306
|
+
var ListPageChildrenResponseSchema = import_zod_openapi31.z.object({
|
|
2848
3307
|
// Sorted alphabetically by segment.
|
|
2849
|
-
children:
|
|
2850
|
-
});
|
|
2851
|
-
var CreatePageRequestSchema =
|
|
2852
|
-
path:
|
|
2853
|
-
body:
|
|
2854
|
-
grant:
|
|
2855
|
-
});
|
|
2856
|
-
var UpdatePageRequestSchema =
|
|
2857
|
-
page_id:
|
|
2858
|
-
body:
|
|
2859
|
-
revision_id:
|
|
2860
|
-
grant:
|
|
2861
|
-
});
|
|
2862
|
-
var RevertToRevisionRequestSchema =
|
|
2863
|
-
page_id:
|
|
2864
|
-
revision_id:
|
|
2865
|
-
});
|
|
2866
|
-
var SetPageGrantRequestSchema =
|
|
2867
|
-
page_id:
|
|
2868
|
-
grant:
|
|
2869
|
-
});
|
|
2870
|
-
var RenamePageRequestSchema =
|
|
2871
|
-
page_id:
|
|
2872
|
-
new_path:
|
|
2873
|
-
revision_id:
|
|
2874
|
-
create_redirect:
|
|
3308
|
+
children: import_zod_openapi31.z.array(PageChildSegmentSchema)
|
|
3309
|
+
});
|
|
3310
|
+
var CreatePageRequestSchema = import_zod_openapi31.z.object({
|
|
3311
|
+
path: import_zod_openapi31.z.string(),
|
|
3312
|
+
body: import_zod_openapi31.z.string(),
|
|
3313
|
+
grant: import_zod_openapi31.z.number().optional()
|
|
3314
|
+
});
|
|
3315
|
+
var UpdatePageRequestSchema = import_zod_openapi31.z.object({
|
|
3316
|
+
page_id: import_zod_openapi31.z.string(),
|
|
3317
|
+
body: import_zod_openapi31.z.string(),
|
|
3318
|
+
revision_id: import_zod_openapi31.z.string().optional(),
|
|
3319
|
+
grant: import_zod_openapi31.z.number().optional()
|
|
3320
|
+
});
|
|
3321
|
+
var RevertToRevisionRequestSchema = import_zod_openapi31.z.object({
|
|
3322
|
+
page_id: import_zod_openapi31.z.string(),
|
|
3323
|
+
revision_id: import_zod_openapi31.z.string()
|
|
3324
|
+
});
|
|
3325
|
+
var SetPageGrantRequestSchema = import_zod_openapi31.z.object({
|
|
3326
|
+
page_id: import_zod_openapi31.z.string(),
|
|
3327
|
+
grant: import_zod_openapi31.z.number().int()
|
|
3328
|
+
});
|
|
3329
|
+
var RenamePageRequestSchema = import_zod_openapi31.z.object({
|
|
3330
|
+
page_id: import_zod_openapi31.z.string(),
|
|
3331
|
+
new_path: import_zod_openapi31.z.string(),
|
|
3332
|
+
revision_id: import_zod_openapi31.z.string().optional(),
|
|
3333
|
+
create_redirect: import_zod_openapi31.z.boolean().optional(),
|
|
2875
3334
|
// When true, rename the page together with its whole (grant-visible)
|
|
2876
3335
|
// descendant subtree (renameTree) instead of just the single page.
|
|
2877
3336
|
// Defaults to false — the single-page rename behaviour.
|
|
2878
|
-
include_descendants:
|
|
3337
|
+
include_descendants: import_zod_openapi31.z.boolean().optional()
|
|
2879
3338
|
});
|
|
2880
|
-
var RenamePageResponseSchema =
|
|
3339
|
+
var RenamePageResponseSchema = import_zod_openapi31.z.object({
|
|
2881
3340
|
page: PageSchema,
|
|
2882
|
-
renamed_count:
|
|
2883
|
-
});
|
|
2884
|
-
var RenameTreeErrorSchema =
|
|
2885
|
-
error:
|
|
2886
|
-
code:
|
|
2887
|
-
message:
|
|
2888
|
-
conflicts:
|
|
2889
|
-
|
|
2890
|
-
path:
|
|
2891
|
-
reasons:
|
|
3341
|
+
renamed_count: import_zod_openapi31.z.number()
|
|
3342
|
+
});
|
|
3343
|
+
var RenameTreeErrorSchema = import_zod_openapi31.z.object({
|
|
3344
|
+
error: import_zod_openapi31.z.object({
|
|
3345
|
+
code: import_zod_openapi31.z.literal("PAGE_RENAME_TREE_FAILED"),
|
|
3346
|
+
message: import_zod_openapi31.z.string(),
|
|
3347
|
+
conflicts: import_zod_openapi31.z.array(
|
|
3348
|
+
import_zod_openapi31.z.object({
|
|
3349
|
+
path: import_zod_openapi31.z.string(),
|
|
3350
|
+
reasons: import_zod_openapi31.z.array(import_zod_openapi31.z.string())
|
|
2892
3351
|
})
|
|
2893
3352
|
),
|
|
2894
3353
|
// True when the failure happened after some pages were already moved
|
|
2895
3354
|
// (non-transactional best-effort). When omitted/false the failure was
|
|
2896
3355
|
// detected up-front and nothing was moved.
|
|
2897
|
-
partial:
|
|
3356
|
+
partial: import_zod_openapi31.z.boolean().optional()
|
|
2898
3357
|
})
|
|
2899
3358
|
});
|
|
2900
|
-
var RenameSubtreeRequestSchema =
|
|
2901
|
-
old_path:
|
|
2902
|
-
new_path:
|
|
2903
|
-
create_redirect:
|
|
3359
|
+
var RenameSubtreeRequestSchema = import_zod_openapi31.z.object({
|
|
3360
|
+
old_path: import_zod_openapi31.z.string(),
|
|
3361
|
+
new_path: import_zod_openapi31.z.string(),
|
|
3362
|
+
create_redirect: import_zod_openapi31.z.boolean().optional()
|
|
2904
3363
|
});
|
|
2905
|
-
var RenameSubtreeResponseSchema =
|
|
2906
|
-
renamed_count:
|
|
3364
|
+
var RenameSubtreeResponseSchema = import_zod_openapi31.z.object({
|
|
3365
|
+
renamed_count: import_zod_openapi31.z.number()
|
|
2907
3366
|
});
|
|
2908
|
-
var PageNotFoundErrorSchema =
|
|
2909
|
-
error:
|
|
2910
|
-
code:
|
|
2911
|
-
message:
|
|
3367
|
+
var PageNotFoundErrorSchema = import_zod_openapi31.z.object({
|
|
3368
|
+
error: import_zod_openapi31.z.object({
|
|
3369
|
+
code: import_zod_openapi31.z.literal("PAGE_NOT_FOUND"),
|
|
3370
|
+
message: import_zod_openapi31.z.literal("Page not found")
|
|
2912
3371
|
})
|
|
2913
3372
|
});
|
|
2914
|
-
var PageNotGrantedErrorSchema =
|
|
2915
|
-
error:
|
|
2916
|
-
code:
|
|
2917
|
-
message:
|
|
3373
|
+
var PageNotGrantedErrorSchema = import_zod_openapi31.z.object({
|
|
3374
|
+
error: import_zod_openapi31.z.object({
|
|
3375
|
+
code: import_zod_openapi31.z.literal("PAGE_NOT_GRANTED"),
|
|
3376
|
+
message: import_zod_openapi31.z.literal("Page is not granted for the user")
|
|
2918
3377
|
})
|
|
2919
3378
|
});
|
|
2920
|
-
var PageRevisionErrorSchema =
|
|
2921
|
-
error:
|
|
2922
|
-
code:
|
|
2923
|
-
message:
|
|
3379
|
+
var PageRevisionErrorSchema = import_zod_openapi31.z.object({
|
|
3380
|
+
error: import_zod_openapi31.z.object({
|
|
3381
|
+
code: import_zod_openapi31.z.literal("PAGE_REVISION_ERROR"),
|
|
3382
|
+
message: import_zod_openapi31.z.string()
|
|
2924
3383
|
})
|
|
2925
3384
|
});
|
|
2926
|
-
var SeenPageRequestSchema =
|
|
2927
|
-
page_id:
|
|
3385
|
+
var SeenPageRequestSchema = import_zod_openapi31.z.object({
|
|
3386
|
+
page_id: import_zod_openapi31.z.string()
|
|
2928
3387
|
});
|
|
2929
|
-
var SeenUsersResponseSchema =
|
|
2930
|
-
seenUsers:
|
|
2931
|
-
seenUsersCount:
|
|
3388
|
+
var SeenUsersResponseSchema = import_zod_openapi31.z.object({
|
|
3389
|
+
seenUsers: import_zod_openapi31.z.array(UserPublicSchema),
|
|
3390
|
+
seenUsersCount: import_zod_openapi31.z.number()
|
|
2932
3391
|
});
|
|
2933
|
-
var GetSeenUsersRequestSchema =
|
|
2934
|
-
page_id:
|
|
3392
|
+
var GetSeenUsersRequestSchema = import_zod_openapi31.z.object({
|
|
3393
|
+
page_id: import_zod_openapi31.z.string(),
|
|
2935
3394
|
// Optional cap on returned `seenUsers`. `seenUsersCount` always reflects
|
|
2936
3395
|
// the full count regardless of `limit`. Omit for the full list.
|
|
2937
|
-
limit:
|
|
3396
|
+
limit: import_zod_openapi31.z.coerce.number().int().positive().optional()
|
|
2938
3397
|
});
|
|
2939
|
-
var GetWatchStatusRequestSchema =
|
|
2940
|
-
page_id:
|
|
3398
|
+
var GetWatchStatusRequestSchema = import_zod_openapi31.z.object({
|
|
3399
|
+
page_id: import_zod_openapi31.z.string()
|
|
2941
3400
|
});
|
|
2942
|
-
var WatchStatusResponseSchema =
|
|
2943
|
-
watching:
|
|
3401
|
+
var WatchStatusResponseSchema = import_zod_openapi31.z.object({
|
|
3402
|
+
watching: import_zod_openapi31.z.boolean()
|
|
2944
3403
|
});
|
|
2945
|
-
var SetWatchStatusRequestSchema =
|
|
2946
|
-
page_id:
|
|
2947
|
-
watching:
|
|
3404
|
+
var SetWatchStatusRequestSchema = import_zod_openapi31.z.object({
|
|
3405
|
+
page_id: import_zod_openapi31.z.string(),
|
|
3406
|
+
watching: import_zod_openapi31.z.boolean()
|
|
2948
3407
|
});
|
|
2949
3408
|
|
|
2950
3409
|
// src/contracts/backlink.ts
|
|
2951
|
-
var getBacklinksRoute = (0,
|
|
3410
|
+
var getBacklinksRoute = (0, import_zod_openapi32.createRoute)({
|
|
2952
3411
|
method: "get",
|
|
2953
3412
|
path: "/backlinks",
|
|
2954
3413
|
tags: ["backlink"],
|
|
@@ -2981,96 +3440,103 @@ var backlinkRoutes = {
|
|
|
2981
3440
|
};
|
|
2982
3441
|
|
|
2983
3442
|
// src/contracts/bookmark.ts
|
|
2984
|
-
var
|
|
3443
|
+
var import_zod_openapi35 = require("@hono/zod-openapi");
|
|
2985
3444
|
|
|
2986
3445
|
// src/schemas/bookmark.ts
|
|
2987
|
-
var
|
|
2988
|
-
var BookmarkSchema =
|
|
2989
|
-
_id:
|
|
3446
|
+
var import_zod_openapi33 = require("@hono/zod-openapi");
|
|
3447
|
+
var BookmarkSchema = import_zod_openapi33.z.object({
|
|
3448
|
+
_id: import_zod_openapi33.z.string(),
|
|
2990
3449
|
page: PageSchema,
|
|
2991
|
-
user:
|
|
2992
|
-
createdAt:
|
|
3450
|
+
user: import_zod_openapi33.z.union([import_zod_openapi33.z.string(), UserPublicSchema]),
|
|
3451
|
+
createdAt: import_zod_openapi33.z.string()
|
|
2993
3452
|
});
|
|
2994
|
-
var GetBookmarkRequestSchema =
|
|
2995
|
-
page_id:
|
|
3453
|
+
var GetBookmarkRequestSchema = import_zod_openapi33.z.object({
|
|
3454
|
+
page_id: import_zod_openapi33.z.string()
|
|
2996
3455
|
});
|
|
2997
|
-
var BookmarkResponseSchema =
|
|
3456
|
+
var BookmarkResponseSchema = import_zod_openapi33.z.object({
|
|
2998
3457
|
bookmark: BookmarkSchema.nullable()
|
|
2999
3458
|
});
|
|
3000
|
-
var ListMyBookmarksResponseSchema =
|
|
3001
|
-
bookmarks:
|
|
3459
|
+
var ListMyBookmarksResponseSchema = import_zod_openapi33.z.object({
|
|
3460
|
+
bookmarks: import_zod_openapi33.z.array(BookmarkSchema),
|
|
3002
3461
|
pager: PagerSchema,
|
|
3003
|
-
total:
|
|
3462
|
+
total: import_zod_openapi33.z.number()
|
|
3004
3463
|
});
|
|
3005
|
-
var AddBookmarkRequestSchema =
|
|
3006
|
-
page_id:
|
|
3464
|
+
var AddBookmarkRequestSchema = import_zod_openapi33.z.object({
|
|
3465
|
+
page_id: import_zod_openapi33.z.string()
|
|
3007
3466
|
});
|
|
3008
|
-
var RemoveBookmarkRequestSchema =
|
|
3009
|
-
page_id:
|
|
3467
|
+
var RemoveBookmarkRequestSchema = import_zod_openapi33.z.object({
|
|
3468
|
+
page_id: import_zod_openapi33.z.string()
|
|
3010
3469
|
});
|
|
3011
|
-
var RemoveBookmarkResponseSchema =
|
|
3012
|
-
ok:
|
|
3470
|
+
var RemoveBookmarkResponseSchema = import_zod_openapi33.z.object({
|
|
3471
|
+
ok: import_zod_openapi33.z.literal(true)
|
|
3013
3472
|
});
|
|
3014
3473
|
|
|
3015
3474
|
// src/schemas/user.ts
|
|
3016
|
-
var
|
|
3017
|
-
var UserStatusSchema =
|
|
3475
|
+
var import_zod_openapi34 = require("@hono/zod-openapi");
|
|
3476
|
+
var UserStatusSchema = import_zod_openapi34.z.enum(["1", "2", "3", "4", "5"]).transform((val) => Number(val));
|
|
3018
3477
|
var UserStatusEnum = UserPublicStatus;
|
|
3019
|
-
var UserLanguageSchema =
|
|
3020
|
-
var PaginationRequestSchema =
|
|
3021
|
-
limit:
|
|
3022
|
-
offset:
|
|
3023
|
-
});
|
|
3024
|
-
var UserListItemSchema =
|
|
3025
|
-
_id:
|
|
3026
|
-
username:
|
|
3027
|
-
name:
|
|
3028
|
-
image:
|
|
3029
|
-
});
|
|
3030
|
-
var ListUsersRequestSchema =
|
|
3031
|
-
q:
|
|
3478
|
+
var UserLanguageSchema = import_zod_openapi34.z.enum(["en", "ja"]);
|
|
3479
|
+
var PaginationRequestSchema = import_zod_openapi34.z.object({
|
|
3480
|
+
limit: import_zod_openapi34.z.coerce.number().optional().default(50),
|
|
3481
|
+
offset: import_zod_openapi34.z.coerce.number().optional().default(0)
|
|
3482
|
+
});
|
|
3483
|
+
var UserListItemSchema = import_zod_openapi34.z.object({
|
|
3484
|
+
_id: import_zod_openapi34.z.string(),
|
|
3485
|
+
username: import_zod_openapi34.z.string(),
|
|
3486
|
+
name: import_zod_openapi34.z.string(),
|
|
3487
|
+
image: import_zod_openapi34.z.string().nullable().optional()
|
|
3488
|
+
});
|
|
3489
|
+
var ListUsersRequestSchema = import_zod_openapi34.z.object({
|
|
3490
|
+
q: import_zod_openapi34.z.string().optional(),
|
|
3032
3491
|
// Cap the page size so a client can't request the whole user table in one
|
|
3033
3492
|
// unbounded find+sort (mirrors the page-list `limit` guard).
|
|
3034
|
-
limit:
|
|
3035
|
-
offset:
|
|
3493
|
+
limit: import_zod_openapi34.z.coerce.number().int().min(1).max(100).optional().default(24),
|
|
3494
|
+
offset: import_zod_openapi34.z.coerce.number().int().min(0).optional().default(0)
|
|
3036
3495
|
});
|
|
3037
|
-
var UserSubpagesRequestSchema =
|
|
3038
|
-
limit:
|
|
3039
|
-
offset:
|
|
3496
|
+
var UserSubpagesRequestSchema = import_zod_openapi34.z.object({
|
|
3497
|
+
limit: import_zod_openapi34.z.coerce.number().int().min(1).max(50).optional().default(30),
|
|
3498
|
+
offset: import_zod_openapi34.z.coerce.number().int().min(0).optional().default(0)
|
|
3040
3499
|
});
|
|
3041
|
-
var ListUsersResponseSchema =
|
|
3042
|
-
users:
|
|
3500
|
+
var ListUsersResponseSchema = import_zod_openapi34.z.object({
|
|
3501
|
+
users: import_zod_openapi34.z.array(UserListItemSchema),
|
|
3043
3502
|
pager: PagerSchema,
|
|
3044
|
-
total:
|
|
3503
|
+
total: import_zod_openapi34.z.number()
|
|
3045
3504
|
});
|
|
3046
|
-
var UserPageResponseSchema =
|
|
3505
|
+
var UserPageResponseSchema = import_zod_openapi34.z.object({
|
|
3047
3506
|
user: UserPublicSchema,
|
|
3048
3507
|
// Page statistics
|
|
3049
|
-
createdPagesCount:
|
|
3050
|
-
bookmarksCount:
|
|
3508
|
+
createdPagesCount: import_zod_openapi34.z.number(),
|
|
3509
|
+
bookmarksCount: import_zod_openapi34.z.number(),
|
|
3510
|
+
// feature-profile-stats-and-page-total — the target user's OWN actions:
|
|
3511
|
+
// pages they liked (`Page.liker` contains their id) and comments they
|
|
3512
|
+
// wrote (`Comment.creator` is their id). NOT activity their own pages
|
|
3513
|
+
// received from others, and not re-filtered by the viewer's grants —
|
|
3514
|
+
// see the spec's "プロフィール統計の主語と API 契約" section.
|
|
3515
|
+
likesCount: import_zod_openapi34.z.number(),
|
|
3516
|
+
commentsCount: import_zod_openapi34.z.number(),
|
|
3051
3517
|
// Optionally include recent items for initial display
|
|
3052
|
-
recentPages:
|
|
3053
|
-
recentBookmarks:
|
|
3518
|
+
recentPages: import_zod_openapi34.z.array(PageSchema).optional(),
|
|
3519
|
+
recentBookmarks: import_zod_openapi34.z.array(BookmarkSchema).optional()
|
|
3054
3520
|
});
|
|
3055
|
-
var UserBookmarksResponseSchema =
|
|
3056
|
-
bookmarks:
|
|
3521
|
+
var UserBookmarksResponseSchema = import_zod_openapi34.z.object({
|
|
3522
|
+
bookmarks: import_zod_openapi34.z.array(BookmarkSchema),
|
|
3057
3523
|
pager: PagerSchema,
|
|
3058
|
-
total:
|
|
3524
|
+
total: import_zod_openapi34.z.number()
|
|
3059
3525
|
});
|
|
3060
|
-
var UserPagesResponseSchema =
|
|
3061
|
-
pages:
|
|
3526
|
+
var UserPagesResponseSchema = import_zod_openapi34.z.object({
|
|
3527
|
+
pages: import_zod_openapi34.z.array(PageSchema),
|
|
3062
3528
|
pager: PagerSchema,
|
|
3063
|
-
total:
|
|
3529
|
+
total: import_zod_openapi34.z.number()
|
|
3064
3530
|
});
|
|
3065
|
-
var UserNotFoundErrorSchema =
|
|
3066
|
-
error:
|
|
3067
|
-
code:
|
|
3068
|
-
message:
|
|
3531
|
+
var UserNotFoundErrorSchema = import_zod_openapi34.z.object({
|
|
3532
|
+
error: import_zod_openapi34.z.object({
|
|
3533
|
+
code: import_zod_openapi34.z.literal("USER_NOT_FOUND"),
|
|
3534
|
+
message: import_zod_openapi34.z.literal("User not found")
|
|
3069
3535
|
})
|
|
3070
3536
|
});
|
|
3071
3537
|
|
|
3072
3538
|
// src/contracts/bookmark.ts
|
|
3073
|
-
var getBookmarkRoute = (0,
|
|
3539
|
+
var getBookmarkRoute = (0, import_zod_openapi35.createRoute)({
|
|
3074
3540
|
method: "get",
|
|
3075
3541
|
path: "/bookmarks",
|
|
3076
3542
|
tags: ["bookmark"],
|
|
@@ -3098,7 +3564,7 @@ var getBookmarkRoute = (0, import_zod_openapi34.createRoute)({
|
|
|
3098
3564
|
}
|
|
3099
3565
|
}
|
|
3100
3566
|
});
|
|
3101
|
-
var listMyBookmarksRoute = (0,
|
|
3567
|
+
var listMyBookmarksRoute = (0, import_zod_openapi35.createRoute)({
|
|
3102
3568
|
method: "get",
|
|
3103
3569
|
path: "/bookmarks/me",
|
|
3104
3570
|
tags: ["bookmark"],
|
|
@@ -3122,7 +3588,7 @@ var listMyBookmarksRoute = (0, import_zod_openapi34.createRoute)({
|
|
|
3122
3588
|
}
|
|
3123
3589
|
}
|
|
3124
3590
|
});
|
|
3125
|
-
var addBookmarkRoute = (0,
|
|
3591
|
+
var addBookmarkRoute = (0, import_zod_openapi35.createRoute)({
|
|
3126
3592
|
method: "post",
|
|
3127
3593
|
path: "/bookmarks",
|
|
3128
3594
|
tags: ["bookmark"],
|
|
@@ -3152,7 +3618,7 @@ var addBookmarkRoute = (0, import_zod_openapi34.createRoute)({
|
|
|
3152
3618
|
}
|
|
3153
3619
|
}
|
|
3154
3620
|
});
|
|
3155
|
-
var removeBookmarkRoute = (0,
|
|
3621
|
+
var removeBookmarkRoute = (0, import_zod_openapi35.createRoute)({
|
|
3156
3622
|
method: "delete",
|
|
3157
3623
|
path: "/bookmarks",
|
|
3158
3624
|
tags: ["bookmark"],
|
|
@@ -3190,59 +3656,59 @@ var bookmarkRoutes = {
|
|
|
3190
3656
|
};
|
|
3191
3657
|
|
|
3192
3658
|
// src/contracts/comment.ts
|
|
3193
|
-
var
|
|
3659
|
+
var import_zod_openapi37 = require("@hono/zod-openapi");
|
|
3194
3660
|
|
|
3195
3661
|
// src/schemas/comment.ts
|
|
3196
|
-
var
|
|
3197
|
-
var CommentSchema =
|
|
3198
|
-
_id:
|
|
3199
|
-
page:
|
|
3662
|
+
var import_zod_openapi36 = require("@hono/zod-openapi");
|
|
3663
|
+
var CommentSchema = import_zod_openapi36.z.object({
|
|
3664
|
+
_id: import_zod_openapi36.z.string(),
|
|
3665
|
+
page: import_zod_openapi36.z.string(),
|
|
3200
3666
|
// creator is populated to a user object on the API side; allow string fallback for safety
|
|
3201
|
-
creator:
|
|
3202
|
-
revision:
|
|
3203
|
-
comment:
|
|
3204
|
-
commentPosition:
|
|
3205
|
-
createdAt:
|
|
3206
|
-
});
|
|
3207
|
-
var ListCommentsRequestSchema =
|
|
3208
|
-
page_id:
|
|
3209
|
-
revision_id:
|
|
3210
|
-
});
|
|
3211
|
-
var ListCommentsResponseSchema =
|
|
3212
|
-
comments:
|
|
3213
|
-
});
|
|
3214
|
-
var AddCommentRequestSchema =
|
|
3215
|
-
page_id:
|
|
3216
|
-
revision_id:
|
|
3217
|
-
comment:
|
|
3218
|
-
comment_position:
|
|
3219
|
-
});
|
|
3220
|
-
var AddCommentResponseSchema =
|
|
3667
|
+
creator: import_zod_openapi36.z.union([import_zod_openapi36.z.string(), PageUserSchema]).nullable(),
|
|
3668
|
+
revision: import_zod_openapi36.z.string(),
|
|
3669
|
+
comment: import_zod_openapi36.z.string(),
|
|
3670
|
+
commentPosition: import_zod_openapi36.z.number().default(-1),
|
|
3671
|
+
createdAt: import_zod_openapi36.z.string()
|
|
3672
|
+
});
|
|
3673
|
+
var ListCommentsRequestSchema = import_zod_openapi36.z.object({
|
|
3674
|
+
page_id: import_zod_openapi36.z.string().optional(),
|
|
3675
|
+
revision_id: import_zod_openapi36.z.string().optional()
|
|
3676
|
+
});
|
|
3677
|
+
var ListCommentsResponseSchema = import_zod_openapi36.z.object({
|
|
3678
|
+
comments: import_zod_openapi36.z.array(CommentSchema)
|
|
3679
|
+
});
|
|
3680
|
+
var AddCommentRequestSchema = import_zod_openapi36.z.object({
|
|
3681
|
+
page_id: import_zod_openapi36.z.string().min(1, "page_id is required"),
|
|
3682
|
+
revision_id: import_zod_openapi36.z.string().min(1, "revision_id is required"),
|
|
3683
|
+
comment: import_zod_openapi36.z.string().min(1, "comment is required"),
|
|
3684
|
+
comment_position: import_zod_openapi36.z.number().int().optional()
|
|
3685
|
+
});
|
|
3686
|
+
var AddCommentResponseSchema = import_zod_openapi36.z.object({
|
|
3221
3687
|
comment: CommentSchema,
|
|
3222
|
-
newlyWatching:
|
|
3688
|
+
newlyWatching: import_zod_openapi36.z.boolean()
|
|
3223
3689
|
});
|
|
3224
|
-
var DeleteCommentRequestSchema =
|
|
3225
|
-
comment_id:
|
|
3226
|
-
page_id:
|
|
3690
|
+
var DeleteCommentRequestSchema = import_zod_openapi36.z.object({
|
|
3691
|
+
comment_id: import_zod_openapi36.z.string().min(1, "comment_id is required"),
|
|
3692
|
+
page_id: import_zod_openapi36.z.string().min(1, "page_id is required")
|
|
3227
3693
|
});
|
|
3228
|
-
var DeleteCommentResponseSchema =
|
|
3229
|
-
ok:
|
|
3694
|
+
var DeleteCommentResponseSchema = import_zod_openapi36.z.object({
|
|
3695
|
+
ok: import_zod_openapi36.z.literal(true)
|
|
3230
3696
|
});
|
|
3231
|
-
var CommentNotFoundErrorSchema =
|
|
3232
|
-
error:
|
|
3233
|
-
code:
|
|
3234
|
-
message:
|
|
3697
|
+
var CommentNotFoundErrorSchema = import_zod_openapi36.z.object({
|
|
3698
|
+
error: import_zod_openapi36.z.object({
|
|
3699
|
+
code: import_zod_openapi36.z.literal("COMMENT_NOT_FOUND"),
|
|
3700
|
+
message: import_zod_openapi36.z.literal("Comment not found")
|
|
3235
3701
|
})
|
|
3236
3702
|
});
|
|
3237
|
-
var CommentInvalidRequestErrorSchema =
|
|
3238
|
-
error:
|
|
3239
|
-
code:
|
|
3240
|
-
message:
|
|
3703
|
+
var CommentInvalidRequestErrorSchema = import_zod_openapi36.z.object({
|
|
3704
|
+
error: import_zod_openapi36.z.object({
|
|
3705
|
+
code: import_zod_openapi36.z.literal("INVALID_REQUEST"),
|
|
3706
|
+
message: import_zod_openapi36.z.string()
|
|
3241
3707
|
})
|
|
3242
3708
|
});
|
|
3243
3709
|
|
|
3244
3710
|
// src/contracts/comment.ts
|
|
3245
|
-
var listCommentsRoute = (0,
|
|
3711
|
+
var listCommentsRoute = (0, import_zod_openapi37.createRoute)({
|
|
3246
3712
|
method: "get",
|
|
3247
3713
|
path: "/comments",
|
|
3248
3714
|
tags: ["comment"],
|
|
@@ -3270,7 +3736,7 @@ var listCommentsRoute = (0, import_zod_openapi36.createRoute)({
|
|
|
3270
3736
|
}
|
|
3271
3737
|
}
|
|
3272
3738
|
});
|
|
3273
|
-
var addCommentRoute = (0,
|
|
3739
|
+
var addCommentRoute = (0, import_zod_openapi37.createRoute)({
|
|
3274
3740
|
method: "post",
|
|
3275
3741
|
path: "/comments",
|
|
3276
3742
|
tags: ["comment"],
|
|
@@ -3300,7 +3766,7 @@ var addCommentRoute = (0, import_zod_openapi36.createRoute)({
|
|
|
3300
3766
|
}
|
|
3301
3767
|
}
|
|
3302
3768
|
});
|
|
3303
|
-
var deleteCommentRoute = (0,
|
|
3769
|
+
var deleteCommentRoute = (0, import_zod_openapi37.createRoute)({
|
|
3304
3770
|
method: "delete",
|
|
3305
3771
|
path: "/comments",
|
|
3306
3772
|
tags: ["comment"],
|
|
@@ -3341,50 +3807,50 @@ var commentRoutes = {
|
|
|
3341
3807
|
};
|
|
3342
3808
|
|
|
3343
3809
|
// src/contracts/draft.ts
|
|
3344
|
-
var
|
|
3810
|
+
var import_zod_openapi39 = require("@hono/zod-openapi");
|
|
3345
3811
|
|
|
3346
3812
|
// src/schemas/draft.ts
|
|
3347
|
-
var
|
|
3348
|
-
var CreateDraftRequestSchema =
|
|
3349
|
-
path:
|
|
3350
|
-
initialBody:
|
|
3813
|
+
var import_zod_openapi38 = require("@hono/zod-openapi");
|
|
3814
|
+
var CreateDraftRequestSchema = import_zod_openapi38.z.object({
|
|
3815
|
+
path: import_zod_openapi38.z.string().min(1),
|
|
3816
|
+
initialBody: import_zod_openapi38.z.string().optional()
|
|
3351
3817
|
});
|
|
3352
|
-
var CreateDraftResponseSchema =
|
|
3353
|
-
pageId:
|
|
3818
|
+
var CreateDraftResponseSchema = import_zod_openapi38.z.object({
|
|
3819
|
+
pageId: import_zod_openapi38.z.string()
|
|
3354
3820
|
});
|
|
3355
|
-
var DraftConflictOwnerSchema =
|
|
3356
|
-
id:
|
|
3357
|
-
username:
|
|
3358
|
-
displayName:
|
|
3821
|
+
var DraftConflictOwnerSchema = import_zod_openapi38.z.object({
|
|
3822
|
+
id: import_zod_openapi38.z.string(),
|
|
3823
|
+
username: import_zod_openapi38.z.string(),
|
|
3824
|
+
displayName: import_zod_openapi38.z.string()
|
|
3359
3825
|
});
|
|
3360
|
-
var DraftPathConflictErrorSchema =
|
|
3361
|
-
error:
|
|
3826
|
+
var DraftPathConflictErrorSchema = import_zod_openapi38.z.object({
|
|
3827
|
+
error: import_zod_openapi38.z.literal("path_taken_by_draft"),
|
|
3362
3828
|
owner: DraftConflictOwnerSchema,
|
|
3363
|
-
message:
|
|
3829
|
+
message: import_zod_openapi38.z.string()
|
|
3364
3830
|
});
|
|
3365
|
-
var DraftBadRequestErrorSchema =
|
|
3366
|
-
error:
|
|
3367
|
-
message:
|
|
3831
|
+
var DraftBadRequestErrorSchema = import_zod_openapi38.z.object({
|
|
3832
|
+
error: import_zod_openapi38.z.enum(["invalid_path", "path_taken"]),
|
|
3833
|
+
message: import_zod_openapi38.z.string()
|
|
3368
3834
|
});
|
|
3369
|
-
var DraftNotFoundErrorSchema =
|
|
3370
|
-
error:
|
|
3371
|
-
message:
|
|
3835
|
+
var DraftNotFoundErrorSchema = import_zod_openapi38.z.object({
|
|
3836
|
+
error: import_zod_openapi38.z.literal("draft_not_found"),
|
|
3837
|
+
message: import_zod_openapi38.z.string()
|
|
3372
3838
|
});
|
|
3373
|
-
var DraftSummarySchema =
|
|
3374
|
-
pageId:
|
|
3375
|
-
path:
|
|
3376
|
-
createdAt:
|
|
3377
|
-
updatedAt:
|
|
3839
|
+
var DraftSummarySchema = import_zod_openapi38.z.object({
|
|
3840
|
+
pageId: import_zod_openapi38.z.string(),
|
|
3841
|
+
path: import_zod_openapi38.z.string(),
|
|
3842
|
+
createdAt: import_zod_openapi38.z.string(),
|
|
3843
|
+
updatedAt: import_zod_openapi38.z.string()
|
|
3378
3844
|
});
|
|
3379
|
-
var ListDraftsResponseSchema =
|
|
3380
|
-
drafts:
|
|
3845
|
+
var ListDraftsResponseSchema = import_zod_openapi38.z.object({
|
|
3846
|
+
drafts: import_zod_openapi38.z.array(DraftSummarySchema)
|
|
3381
3847
|
});
|
|
3382
3848
|
|
|
3383
3849
|
// src/contracts/draft.ts
|
|
3384
|
-
var DraftIdPathParamsSchema =
|
|
3385
|
-
id:
|
|
3850
|
+
var DraftIdPathParamsSchema = import_zod_openapi39.z.object({
|
|
3851
|
+
id: import_zod_openapi39.z.string().openapi({ description: "Draft page id (24-char hex ObjectId)", example: "507f1f77bcf86cd799439011" })
|
|
3386
3852
|
});
|
|
3387
|
-
var createDraftRoute = (0,
|
|
3853
|
+
var createDraftRoute = (0, import_zod_openapi39.createRoute)({
|
|
3388
3854
|
method: "post",
|
|
3389
3855
|
path: "/pages/drafts",
|
|
3390
3856
|
tags: ["draft"],
|
|
@@ -3414,7 +3880,7 @@ var createDraftRoute = (0, import_zod_openapi38.createRoute)({
|
|
|
3414
3880
|
}
|
|
3415
3881
|
}
|
|
3416
3882
|
});
|
|
3417
|
-
var listDraftsRoute = (0,
|
|
3883
|
+
var listDraftsRoute = (0, import_zod_openapi39.createRoute)({
|
|
3418
3884
|
method: "get",
|
|
3419
3885
|
path: "/pages/drafts",
|
|
3420
3886
|
tags: ["draft"],
|
|
@@ -3431,7 +3897,7 @@ var listDraftsRoute = (0, import_zod_openapi38.createRoute)({
|
|
|
3431
3897
|
}
|
|
3432
3898
|
}
|
|
3433
3899
|
});
|
|
3434
|
-
var cancelDraftRoute = (0,
|
|
3900
|
+
var cancelDraftRoute = (0, import_zod_openapi39.createRoute)({
|
|
3435
3901
|
method: "delete",
|
|
3436
3902
|
path: "/pages/drafts/{id}",
|
|
3437
3903
|
tags: ["draft"],
|
|
@@ -3462,29 +3928,35 @@ var draftRoutes = {
|
|
|
3462
3928
|
};
|
|
3463
3929
|
|
|
3464
3930
|
// src/contracts/installer.ts
|
|
3931
|
+
var import_zod_openapi42 = require("@hono/zod-openapi");
|
|
3932
|
+
|
|
3933
|
+
// src/schemas/installer.ts
|
|
3934
|
+
var import_zod_openapi41 = require("@hono/zod-openapi");
|
|
3935
|
+
|
|
3936
|
+
// src/schemas/username.ts
|
|
3465
3937
|
var import_zod_openapi40 = require("@hono/zod-openapi");
|
|
3938
|
+
var UsernameSchema = import_zod_openapi40.z.string().min(1).max(64).regex(/^[A-Za-z0-9_-]+$/, "username may only contain letters, digits, hyphens, and underscores");
|
|
3466
3939
|
|
|
3467
3940
|
// src/schemas/installer.ts
|
|
3468
|
-
var
|
|
3469
|
-
|
|
3470
|
-
|
|
3471
|
-
|
|
3472
|
-
|
|
3473
|
-
|
|
3474
|
-
|
|
3475
|
-
|
|
3476
|
-
|
|
3477
|
-
password: import_zod_openapi39.z.string().min(6).regex(/^[\x20-\x7F]{6,}$/, "password must be 6+ printable ASCII characters")
|
|
3941
|
+
var InstallerStatusResponseSchema = import_zod_openapi41.z.object({
|
|
3942
|
+
status: import_zod_openapi41.z.enum(["installer_required", "already_installed"])
|
|
3943
|
+
});
|
|
3944
|
+
var CreateAdminRequestSchema = import_zod_openapi41.z.object({
|
|
3945
|
+
registerForm: import_zod_openapi41.z.object({
|
|
3946
|
+
username: UsernameSchema,
|
|
3947
|
+
name: import_zod_openapi41.z.string().min(1),
|
|
3948
|
+
email: import_zod_openapi41.z.string().email(),
|
|
3949
|
+
password: import_zod_openapi41.z.string().min(6).regex(/^[\x20-\x7F]{6,}$/, "password must be 6+ printable ASCII characters")
|
|
3478
3950
|
})
|
|
3479
3951
|
});
|
|
3480
|
-
var CreateAdminResponseSchema =
|
|
3481
|
-
status:
|
|
3482
|
-
message:
|
|
3483
|
-
errors:
|
|
3952
|
+
var CreateAdminResponseSchema = import_zod_openapi41.z.object({
|
|
3953
|
+
status: import_zod_openapi41.z.enum(["ok", "error"]),
|
|
3954
|
+
message: import_zod_openapi41.z.string().optional(),
|
|
3955
|
+
errors: import_zod_openapi41.z.array(import_zod_openapi41.z.string()).optional()
|
|
3484
3956
|
});
|
|
3485
3957
|
|
|
3486
3958
|
// src/contracts/installer.ts
|
|
3487
|
-
var getInstallerStatusRoute = (0,
|
|
3959
|
+
var getInstallerStatusRoute = (0, import_zod_openapi42.createRoute)({
|
|
3488
3960
|
method: "get",
|
|
3489
3961
|
path: "/installer",
|
|
3490
3962
|
tags: ["installer"],
|
|
@@ -3508,7 +3980,7 @@ var getInstallerStatusRoute = (0, import_zod_openapi40.createRoute)({
|
|
|
3508
3980
|
}
|
|
3509
3981
|
}
|
|
3510
3982
|
});
|
|
3511
|
-
var createAdminRoute = (0,
|
|
3983
|
+
var createAdminRoute = (0, import_zod_openapi42.createRoute)({
|
|
3512
3984
|
method: "post",
|
|
3513
3985
|
path: "/installer/createAdmin",
|
|
3514
3986
|
tags: ["installer"],
|
|
@@ -3552,88 +4024,88 @@ var createAdminRoute = (0, import_zod_openapi40.createRoute)({
|
|
|
3552
4024
|
var installerRoutes = { getInstallerStatusRoute, createAdminRoute };
|
|
3553
4025
|
|
|
3554
4026
|
// src/contracts/me.ts
|
|
3555
|
-
var
|
|
4027
|
+
var import_zod_openapi44 = require("@hono/zod-openapi");
|
|
3556
4028
|
|
|
3557
4029
|
// src/schemas/me.ts
|
|
3558
|
-
var
|
|
3559
|
-
var LanguageSchema =
|
|
3560
|
-
var ThemeSchema =
|
|
3561
|
-
var UserProfileResponseSchema =
|
|
3562
|
-
id:
|
|
3563
|
-
username:
|
|
3564
|
-
name:
|
|
3565
|
-
email:
|
|
4030
|
+
var import_zod_openapi43 = require("@hono/zod-openapi");
|
|
4031
|
+
var LanguageSchema = import_zod_openapi43.z.enum(["en", "ja"]);
|
|
4032
|
+
var ThemeSchema = import_zod_openapi43.z.enum(["system", "light", "dark"]);
|
|
4033
|
+
var UserProfileResponseSchema = import_zod_openapi43.z.object({
|
|
4034
|
+
id: import_zod_openapi43.z.string(),
|
|
4035
|
+
username: import_zod_openapi43.z.string(),
|
|
4036
|
+
name: import_zod_openapi43.z.string(),
|
|
4037
|
+
email: import_zod_openapi43.z.string().email(),
|
|
3566
4038
|
lang: LanguageSchema,
|
|
3567
4039
|
theme: ThemeSchema,
|
|
3568
|
-
image:
|
|
3569
|
-
introduction:
|
|
3570
|
-
hasPassword:
|
|
3571
|
-
createdAt:
|
|
4040
|
+
image: import_zod_openapi43.z.string().nullable(),
|
|
4041
|
+
introduction: import_zod_openapi43.z.string().optional(),
|
|
4042
|
+
hasPassword: import_zod_openapi43.z.boolean(),
|
|
4043
|
+
createdAt: import_zod_openapi43.z.string(),
|
|
3572
4044
|
/**
|
|
3573
4045
|
* True when the profile update requested a new email that is awaiting
|
|
3574
4046
|
* confirmation: the stored `email` is unchanged and a confirmation
|
|
3575
4047
|
* link was sent to the new address.
|
|
3576
4048
|
*/
|
|
3577
|
-
emailChangePending:
|
|
4049
|
+
emailChangePending: import_zod_openapi43.z.boolean().optional()
|
|
3578
4050
|
});
|
|
3579
|
-
var UpdateProfileRequestSchema =
|
|
3580
|
-
userForm:
|
|
3581
|
-
name:
|
|
3582
|
-
email:
|
|
4051
|
+
var UpdateProfileRequestSchema = import_zod_openapi43.z.object({
|
|
4052
|
+
userForm: import_zod_openapi43.z.object({
|
|
4053
|
+
name: import_zod_openapi43.z.string().min(1, "Name is required"),
|
|
4054
|
+
email: import_zod_openapi43.z.string().email("Invalid email format"),
|
|
3583
4055
|
lang: LanguageSchema
|
|
3584
4056
|
})
|
|
3585
4057
|
});
|
|
3586
|
-
var UpdateThemeRequestSchema =
|
|
4058
|
+
var UpdateThemeRequestSchema = import_zod_openapi43.z.object({
|
|
3587
4059
|
theme: ThemeSchema
|
|
3588
4060
|
});
|
|
3589
|
-
var ThemeUpdateResponseSchema =
|
|
3590
|
-
status:
|
|
4061
|
+
var ThemeUpdateResponseSchema = import_zod_openapi43.z.object({
|
|
4062
|
+
status: import_zod_openapi43.z.literal("ok"),
|
|
3591
4063
|
theme: ThemeSchema
|
|
3592
4064
|
});
|
|
3593
|
-
var PictureUploadResponseSchema =
|
|
3594
|
-
status:
|
|
3595
|
-
url:
|
|
3596
|
-
message:
|
|
4065
|
+
var PictureUploadResponseSchema = import_zod_openapi43.z.object({
|
|
4066
|
+
status: import_zod_openapi43.z.boolean(),
|
|
4067
|
+
url: import_zod_openapi43.z.string().optional(),
|
|
4068
|
+
message: import_zod_openapi43.z.string().optional()
|
|
3597
4069
|
});
|
|
3598
|
-
var SuccessResponseSchema =
|
|
3599
|
-
status:
|
|
3600
|
-
message:
|
|
4070
|
+
var SuccessResponseSchema = import_zod_openapi43.z.object({
|
|
4071
|
+
status: import_zod_openapi43.z.literal("ok"),
|
|
4072
|
+
message: import_zod_openapi43.z.string().optional()
|
|
3601
4073
|
});
|
|
3602
|
-
var ProfileErrorResponseSchema =
|
|
3603
|
-
status:
|
|
4074
|
+
var ProfileErrorResponseSchema = import_zod_openapi43.z.object({
|
|
4075
|
+
status: import_zod_openapi43.z.literal("error"),
|
|
3604
4076
|
/** Stable code so the web can localize the message (e.g. EMAIL_TAKEN). */
|
|
3605
|
-
code:
|
|
3606
|
-
message:
|
|
3607
|
-
errors:
|
|
4077
|
+
code: import_zod_openapi43.z.string().optional(),
|
|
4078
|
+
message: import_zod_openapi43.z.string().optional(),
|
|
4079
|
+
errors: import_zod_openapi43.z.array(import_zod_openapi43.z.string()).optional()
|
|
3608
4080
|
});
|
|
3609
4081
|
var PASSWORD_REGEX = /^(?=.*[a-zA-Z])(?=.*\d)(?=.*[!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?`~])[a-zA-Z\d!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?`~]+$/;
|
|
3610
|
-
var UpdatePasswordRequestSchema =
|
|
3611
|
-
oldPassword:
|
|
3612
|
-
newPassword:
|
|
3613
|
-
newPasswordConfirm:
|
|
4082
|
+
var UpdatePasswordRequestSchema = import_zod_openapi43.z.object({
|
|
4083
|
+
oldPassword: import_zod_openapi43.z.string().optional(),
|
|
4084
|
+
newPassword: import_zod_openapi43.z.string().min(8, "Password must be at least 8 characters").max(100, "Password must be at most 100 characters").regex(PASSWORD_REGEX, "Password must contain at least one letter, one digit, and one special character"),
|
|
4085
|
+
newPasswordConfirm: import_zod_openapi43.z.string()
|
|
3614
4086
|
}).refine((data) => data.newPassword === data.newPasswordConfirm, {
|
|
3615
4087
|
message: "Passwords do not match",
|
|
3616
4088
|
path: ["newPasswordConfirm"]
|
|
3617
4089
|
});
|
|
3618
|
-
var PasswordUpdateSuccessSchema =
|
|
3619
|
-
status:
|
|
3620
|
-
message:
|
|
3621
|
-
accessToken:
|
|
3622
|
-
refreshToken:
|
|
4090
|
+
var PasswordUpdateSuccessSchema = import_zod_openapi43.z.object({
|
|
4091
|
+
status: import_zod_openapi43.z.literal("ok"),
|
|
4092
|
+
message: import_zod_openapi43.z.string(),
|
|
4093
|
+
accessToken: import_zod_openapi43.z.string(),
|
|
4094
|
+
refreshToken: import_zod_openapi43.z.string(),
|
|
3623
4095
|
/** Access-token lifetime in seconds. */
|
|
3624
|
-
expiresIn:
|
|
4096
|
+
expiresIn: import_zod_openapi43.z.number()
|
|
3625
4097
|
});
|
|
3626
|
-
var PasswordErrorResponseSchema =
|
|
3627
|
-
status:
|
|
3628
|
-
message:
|
|
3629
|
-
errors:
|
|
4098
|
+
var PasswordErrorResponseSchema = import_zod_openapi43.z.object({
|
|
4099
|
+
status: import_zod_openapi43.z.literal("error"),
|
|
4100
|
+
message: import_zod_openapi43.z.string(),
|
|
4101
|
+
errors: import_zod_openapi43.z.array(import_zod_openapi43.z.string()).optional()
|
|
3630
4102
|
});
|
|
3631
|
-
var RecentlyViewedPagesResponseSchema =
|
|
3632
|
-
pages:
|
|
4103
|
+
var RecentlyViewedPagesResponseSchema = import_zod_openapi43.z.object({
|
|
4104
|
+
pages: import_zod_openapi43.z.array(PageSchema)
|
|
3633
4105
|
});
|
|
3634
4106
|
|
|
3635
4107
|
// src/contracts/me.ts
|
|
3636
|
-
var getProfileRoute = (0,
|
|
4108
|
+
var getProfileRoute = (0, import_zod_openapi44.createRoute)({
|
|
3637
4109
|
method: "get",
|
|
3638
4110
|
path: "/me",
|
|
3639
4111
|
tags: ["me"],
|
|
@@ -3650,7 +4122,7 @@ var getProfileRoute = (0, import_zod_openapi42.createRoute)({
|
|
|
3650
4122
|
}
|
|
3651
4123
|
}
|
|
3652
4124
|
});
|
|
3653
|
-
var updateProfileRoute = (0,
|
|
4125
|
+
var updateProfileRoute = (0, import_zod_openapi44.createRoute)({
|
|
3654
4126
|
method: "put",
|
|
3655
4127
|
path: "/me",
|
|
3656
4128
|
tags: ["me"],
|
|
@@ -3676,7 +4148,7 @@ var updateProfileRoute = (0, import_zod_openapi42.createRoute)({
|
|
|
3676
4148
|
}
|
|
3677
4149
|
}
|
|
3678
4150
|
});
|
|
3679
|
-
var updateThemeRoute = (0,
|
|
4151
|
+
var updateThemeRoute = (0, import_zod_openapi44.createRoute)({
|
|
3680
4152
|
method: "patch",
|
|
3681
4153
|
path: "/me/theme",
|
|
3682
4154
|
tags: ["me"],
|
|
@@ -3702,7 +4174,7 @@ var updateThemeRoute = (0, import_zod_openapi42.createRoute)({
|
|
|
3702
4174
|
}
|
|
3703
4175
|
}
|
|
3704
4176
|
});
|
|
3705
|
-
var uploadPictureRoute = (0,
|
|
4177
|
+
var uploadPictureRoute = (0, import_zod_openapi44.createRoute)({
|
|
3706
4178
|
method: "post",
|
|
3707
4179
|
path: "/me/picture",
|
|
3708
4180
|
tags: ["me"],
|
|
@@ -3712,8 +4184,8 @@ var uploadPictureRoute = (0, import_zod_openapi42.createRoute)({
|
|
|
3712
4184
|
body: {
|
|
3713
4185
|
content: {
|
|
3714
4186
|
"multipart/form-data": {
|
|
3715
|
-
schema:
|
|
3716
|
-
file:
|
|
4187
|
+
schema: import_zod_openapi44.z.object({
|
|
4188
|
+
file: import_zod_openapi44.z.any().optional().describe("Profile picture file")
|
|
3717
4189
|
})
|
|
3718
4190
|
}
|
|
3719
4191
|
}
|
|
@@ -3734,7 +4206,7 @@ var uploadPictureRoute = (0, import_zod_openapi42.createRoute)({
|
|
|
3734
4206
|
}
|
|
3735
4207
|
}
|
|
3736
4208
|
});
|
|
3737
|
-
var deletePictureRoute = (0,
|
|
4209
|
+
var deletePictureRoute = (0, import_zod_openapi44.createRoute)({
|
|
3738
4210
|
method: "delete",
|
|
3739
4211
|
path: "/me/picture",
|
|
3740
4212
|
tags: ["me"],
|
|
@@ -3755,7 +4227,7 @@ var deletePictureRoute = (0, import_zod_openapi42.createRoute)({
|
|
|
3755
4227
|
}
|
|
3756
4228
|
}
|
|
3757
4229
|
});
|
|
3758
|
-
var updatePasswordRoute = (0,
|
|
4230
|
+
var updatePasswordRoute = (0, import_zod_openapi44.createRoute)({
|
|
3759
4231
|
method: "put",
|
|
3760
4232
|
path: "/me/password",
|
|
3761
4233
|
tags: ["me"],
|
|
@@ -3781,7 +4253,7 @@ var updatePasswordRoute = (0, import_zod_openapi42.createRoute)({
|
|
|
3781
4253
|
}
|
|
3782
4254
|
}
|
|
3783
4255
|
});
|
|
3784
|
-
var recentlyViewedPagesRoute = (0,
|
|
4256
|
+
var recentlyViewedPagesRoute = (0, import_zod_openapi44.createRoute)({
|
|
3785
4257
|
method: "get",
|
|
3786
4258
|
path: "/me/recently-viewed-pages",
|
|
3787
4259
|
tags: ["me"],
|
|
@@ -3813,43 +4285,43 @@ var meRoutes = {
|
|
|
3813
4285
|
};
|
|
3814
4286
|
|
|
3815
4287
|
// src/contracts/access-token.ts
|
|
3816
|
-
var
|
|
4288
|
+
var import_zod_openapi46 = require("@hono/zod-openapi");
|
|
3817
4289
|
|
|
3818
4290
|
// src/schemas/access-token.ts
|
|
3819
|
-
var
|
|
3820
|
-
var AccessTokenSchema =
|
|
3821
|
-
id:
|
|
3822
|
-
name:
|
|
3823
|
-
scopes:
|
|
4291
|
+
var import_zod_openapi45 = require("@hono/zod-openapi");
|
|
4292
|
+
var AccessTokenSchema = import_zod_openapi45.z.object({
|
|
4293
|
+
id: import_zod_openapi45.z.string(),
|
|
4294
|
+
name: import_zod_openapi45.z.string(),
|
|
4295
|
+
scopes: import_zod_openapi45.z.array(import_zod_openapi45.z.string()),
|
|
3824
4296
|
/** ISO-8601 expiry, or `null` for a non-expiring token. */
|
|
3825
|
-
expiresAt:
|
|
4297
|
+
expiresAt: import_zod_openapi45.z.string().nullable(),
|
|
3826
4298
|
/** ISO-8601 of last successful use, or `null` if never used. */
|
|
3827
|
-
lastUsedAt:
|
|
3828
|
-
createdAt:
|
|
4299
|
+
lastUsedAt: import_zod_openapi45.z.string().nullable(),
|
|
4300
|
+
createdAt: import_zod_openapi45.z.string()
|
|
3829
4301
|
});
|
|
3830
|
-
var ListAccessTokensResponseSchema =
|
|
3831
|
-
accessTokens:
|
|
4302
|
+
var ListAccessTokensResponseSchema = import_zod_openapi45.z.object({
|
|
4303
|
+
accessTokens: import_zod_openapi45.z.array(AccessTokenSchema)
|
|
3832
4304
|
});
|
|
3833
|
-
var CreateAccessTokenRequestSchema =
|
|
3834
|
-
name:
|
|
3835
|
-
scopes:
|
|
3836
|
-
expiresAt:
|
|
4305
|
+
var CreateAccessTokenRequestSchema = import_zod_openapi45.z.object({
|
|
4306
|
+
name: import_zod_openapi45.z.string().min(1, "Name is required").max(200),
|
|
4307
|
+
scopes: import_zod_openapi45.z.array(import_zod_openapi45.z.string()).min(1, "At least one scope is required"),
|
|
4308
|
+
expiresAt: import_zod_openapi45.z.string().datetime().nullable().optional()
|
|
3837
4309
|
});
|
|
3838
4310
|
var CreateAccessTokenResponseSchema = AccessTokenSchema.extend({
|
|
3839
|
-
token:
|
|
3840
|
-
});
|
|
3841
|
-
var InvalidScopeErrorSchema =
|
|
3842
|
-
error:
|
|
3843
|
-
code:
|
|
3844
|
-
message:
|
|
3845
|
-
details:
|
|
3846
|
-
invalidScopes:
|
|
4311
|
+
token: import_zod_openapi45.z.string()
|
|
4312
|
+
});
|
|
4313
|
+
var InvalidScopeErrorSchema = import_zod_openapi45.z.object({
|
|
4314
|
+
error: import_zod_openapi45.z.object({
|
|
4315
|
+
code: import_zod_openapi45.z.literal("INVALID_SCOPE"),
|
|
4316
|
+
message: import_zod_openapi45.z.string(),
|
|
4317
|
+
details: import_zod_openapi45.z.object({
|
|
4318
|
+
invalidScopes: import_zod_openapi45.z.array(import_zod_openapi45.z.string())
|
|
3847
4319
|
}).optional()
|
|
3848
4320
|
})
|
|
3849
4321
|
});
|
|
3850
4322
|
|
|
3851
4323
|
// src/contracts/access-token.ts
|
|
3852
|
-
var listAccessTokensRoute = (0,
|
|
4324
|
+
var listAccessTokensRoute = (0, import_zod_openapi46.createRoute)({
|
|
3853
4325
|
method: "get",
|
|
3854
4326
|
path: "/me/access-tokens",
|
|
3855
4327
|
tags: ["me"],
|
|
@@ -3874,7 +4346,7 @@ var listAccessTokensRoute = (0, import_zod_openapi44.createRoute)({
|
|
|
3874
4346
|
}
|
|
3875
4347
|
}
|
|
3876
4348
|
});
|
|
3877
|
-
var createAccessTokenRoute = (0,
|
|
4349
|
+
var createAccessTokenRoute = (0, import_zod_openapi46.createRoute)({
|
|
3878
4350
|
method: "post",
|
|
3879
4351
|
path: "/me/access-tokens",
|
|
3880
4352
|
tags: ["me"],
|
|
@@ -3908,14 +4380,14 @@ var createAccessTokenRoute = (0, import_zod_openapi44.createRoute)({
|
|
|
3908
4380
|
}
|
|
3909
4381
|
}
|
|
3910
4382
|
});
|
|
3911
|
-
var deleteAccessTokenRoute = (0,
|
|
4383
|
+
var deleteAccessTokenRoute = (0, import_zod_openapi46.createRoute)({
|
|
3912
4384
|
method: "delete",
|
|
3913
4385
|
path: "/me/access-tokens/{id}",
|
|
3914
4386
|
tags: ["me"],
|
|
3915
4387
|
security: [{ bearerAuth: [] }],
|
|
3916
4388
|
summary: "Revoke a personal access token",
|
|
3917
4389
|
request: {
|
|
3918
|
-
params:
|
|
4390
|
+
params: import_zod_openapi46.z.object({ id: import_zod_openapi46.z.string() })
|
|
3919
4391
|
},
|
|
3920
4392
|
responses: {
|
|
3921
4393
|
200: {
|
|
@@ -3947,13 +4419,13 @@ var accessTokenRoutes = {
|
|
|
3947
4419
|
};
|
|
3948
4420
|
|
|
3949
4421
|
// src/contracts/oauth.ts
|
|
3950
|
-
var
|
|
4422
|
+
var import_zod_openapi49 = require("@hono/zod-openapi");
|
|
3951
4423
|
|
|
3952
4424
|
// src/schemas/oauth-endpoints.ts
|
|
3953
|
-
var
|
|
4425
|
+
var import_zod_openapi48 = require("@hono/zod-openapi");
|
|
3954
4426
|
|
|
3955
4427
|
// src/schemas/oauth.ts
|
|
3956
|
-
var
|
|
4428
|
+
var import_zod_openapi47 = require("@hono/zod-openapi");
|
|
3957
4429
|
var SCOPES = [
|
|
3958
4430
|
// umbrella
|
|
3959
4431
|
"read",
|
|
@@ -4021,11 +4493,11 @@ function scopeSatisfies(required, granted) {
|
|
|
4021
4493
|
return false;
|
|
4022
4494
|
}
|
|
4023
4495
|
var InsufficientScopeErrorSchema = ApiErrorSchema.extend({
|
|
4024
|
-
error:
|
|
4025
|
-
code:
|
|
4026
|
-
message:
|
|
4027
|
-
details:
|
|
4028
|
-
requiredScope:
|
|
4496
|
+
error: import_zod_openapi47.z.object({
|
|
4497
|
+
code: import_zod_openapi47.z.literal("INSUFFICIENT_SCOPE"),
|
|
4498
|
+
message: import_zod_openapi47.z.string(),
|
|
4499
|
+
details: import_zod_openapi47.z.object({
|
|
4500
|
+
requiredScope: import_zod_openapi47.z.string()
|
|
4029
4501
|
}).optional()
|
|
4030
4502
|
})
|
|
4031
4503
|
});
|
|
@@ -4044,102 +4516,102 @@ var OAUTH_ERROR_CODES = [
|
|
|
4044
4516
|
"slow_down",
|
|
4045
4517
|
"expired_token"
|
|
4046
4518
|
];
|
|
4047
|
-
var OAuthErrorSchema =
|
|
4048
|
-
error:
|
|
4049
|
-
error_description:
|
|
4050
|
-
});
|
|
4051
|
-
var AuthorizeRequestSchema =
|
|
4052
|
-
client_id:
|
|
4053
|
-
redirect_uri:
|
|
4054
|
-
scope:
|
|
4055
|
-
code_challenge:
|
|
4056
|
-
code_challenge_method:
|
|
4057
|
-
state:
|
|
4058
|
-
});
|
|
4059
|
-
var AuthorizeResponseSchema =
|
|
4060
|
-
redirectUri:
|
|
4061
|
-
});
|
|
4062
|
-
var TokenRequestSchema =
|
|
4063
|
-
|
|
4064
|
-
grant_type:
|
|
4065
|
-
code:
|
|
4066
|
-
code_verifier:
|
|
4067
|
-
redirect_uri:
|
|
4068
|
-
client_id:
|
|
4519
|
+
var OAuthErrorSchema = import_zod_openapi48.z.object({
|
|
4520
|
+
error: import_zod_openapi48.z.enum(OAUTH_ERROR_CODES),
|
|
4521
|
+
error_description: import_zod_openapi48.z.string().optional()
|
|
4522
|
+
});
|
|
4523
|
+
var AuthorizeRequestSchema = import_zod_openapi48.z.object({
|
|
4524
|
+
client_id: import_zod_openapi48.z.string().min(1),
|
|
4525
|
+
redirect_uri: import_zod_openapi48.z.string().min(1),
|
|
4526
|
+
scope: import_zod_openapi48.z.string().min(1),
|
|
4527
|
+
code_challenge: import_zod_openapi48.z.string().min(1),
|
|
4528
|
+
code_challenge_method: import_zod_openapi48.z.literal("S256"),
|
|
4529
|
+
state: import_zod_openapi48.z.string().optional()
|
|
4530
|
+
});
|
|
4531
|
+
var AuthorizeResponseSchema = import_zod_openapi48.z.object({
|
|
4532
|
+
redirectUri: import_zod_openapi48.z.string()
|
|
4533
|
+
});
|
|
4534
|
+
var TokenRequestSchema = import_zod_openapi48.z.discriminatedUnion("grant_type", [
|
|
4535
|
+
import_zod_openapi48.z.object({
|
|
4536
|
+
grant_type: import_zod_openapi48.z.literal("authorization_code"),
|
|
4537
|
+
code: import_zod_openapi48.z.string().min(1),
|
|
4538
|
+
code_verifier: import_zod_openapi48.z.string().min(1),
|
|
4539
|
+
redirect_uri: import_zod_openapi48.z.string().min(1),
|
|
4540
|
+
client_id: import_zod_openapi48.z.string().min(1)
|
|
4069
4541
|
}),
|
|
4070
|
-
|
|
4071
|
-
grant_type:
|
|
4072
|
-
refresh_token:
|
|
4073
|
-
client_id:
|
|
4074
|
-
scope:
|
|
4542
|
+
import_zod_openapi48.z.object({
|
|
4543
|
+
grant_type: import_zod_openapi48.z.literal("refresh_token"),
|
|
4544
|
+
refresh_token: import_zod_openapi48.z.string().min(1),
|
|
4545
|
+
client_id: import_zod_openapi48.z.string().min(1),
|
|
4546
|
+
scope: import_zod_openapi48.z.string().optional()
|
|
4075
4547
|
}),
|
|
4076
4548
|
// RFC 8628 §3.4 — device authorization grant. The client polls with the
|
|
4077
4549
|
// opaque `device_code` returned by `/oauth/device/authorize`.
|
|
4078
|
-
|
|
4079
|
-
grant_type:
|
|
4080
|
-
device_code:
|
|
4081
|
-
client_id:
|
|
4550
|
+
import_zod_openapi48.z.object({
|
|
4551
|
+
grant_type: import_zod_openapi48.z.literal("urn:ietf:params:oauth:grant-type:device_code"),
|
|
4552
|
+
device_code: import_zod_openapi48.z.string().min(1),
|
|
4553
|
+
client_id: import_zod_openapi48.z.string().min(1)
|
|
4082
4554
|
})
|
|
4083
4555
|
]);
|
|
4084
4556
|
var DEVICE_CODE_GRANT_TYPE = "urn:ietf:params:oauth:grant-type:device_code";
|
|
4085
|
-
var TokenResponseSchema =
|
|
4086
|
-
access_token:
|
|
4087
|
-
token_type:
|
|
4088
|
-
expires_in:
|
|
4089
|
-
refresh_token:
|
|
4090
|
-
scope:
|
|
4091
|
-
});
|
|
4092
|
-
var RevokeRequestSchema =
|
|
4093
|
-
token:
|
|
4094
|
-
token_type_hint:
|
|
4095
|
-
});
|
|
4096
|
-
var RevokeResponseSchema =
|
|
4097
|
-
var DeviceAuthorizeRequestSchema =
|
|
4098
|
-
client_id:
|
|
4099
|
-
scope:
|
|
4100
|
-
});
|
|
4101
|
-
var DeviceAuthorizeResponseSchema =
|
|
4102
|
-
device_code:
|
|
4103
|
-
user_code:
|
|
4104
|
-
verification_uri:
|
|
4105
|
-
verification_uri_complete:
|
|
4106
|
-
expires_in:
|
|
4107
|
-
interval:
|
|
4108
|
-
});
|
|
4109
|
-
var DeviceVerifyRequestSchema =
|
|
4110
|
-
user_code:
|
|
4111
|
-
action:
|
|
4112
|
-
});
|
|
4113
|
-
var DeviceVerifyResponseSchema =
|
|
4114
|
-
status:
|
|
4115
|
-
});
|
|
4116
|
-
var DeviceInfoResponseSchema =
|
|
4117
|
-
client_id:
|
|
4118
|
-
scopes:
|
|
4119
|
-
});
|
|
4120
|
-
var ClientInfoResponseSchema =
|
|
4121
|
-
clientId:
|
|
4122
|
-
name:
|
|
4123
|
-
firstParty:
|
|
4124
|
-
trusted:
|
|
4557
|
+
var TokenResponseSchema = import_zod_openapi48.z.object({
|
|
4558
|
+
access_token: import_zod_openapi48.z.string(),
|
|
4559
|
+
token_type: import_zod_openapi48.z.literal("Bearer"),
|
|
4560
|
+
expires_in: import_zod_openapi48.z.number(),
|
|
4561
|
+
refresh_token: import_zod_openapi48.z.string(),
|
|
4562
|
+
scope: import_zod_openapi48.z.string()
|
|
4563
|
+
});
|
|
4564
|
+
var RevokeRequestSchema = import_zod_openapi48.z.object({
|
|
4565
|
+
token: import_zod_openapi48.z.string().min(1),
|
|
4566
|
+
token_type_hint: import_zod_openapi48.z.string().optional()
|
|
4567
|
+
});
|
|
4568
|
+
var RevokeResponseSchema = import_zod_openapi48.z.object({});
|
|
4569
|
+
var DeviceAuthorizeRequestSchema = import_zod_openapi48.z.object({
|
|
4570
|
+
client_id: import_zod_openapi48.z.string().min(1),
|
|
4571
|
+
scope: import_zod_openapi48.z.string().min(1)
|
|
4572
|
+
});
|
|
4573
|
+
var DeviceAuthorizeResponseSchema = import_zod_openapi48.z.object({
|
|
4574
|
+
device_code: import_zod_openapi48.z.string(),
|
|
4575
|
+
user_code: import_zod_openapi48.z.string(),
|
|
4576
|
+
verification_uri: import_zod_openapi48.z.string(),
|
|
4577
|
+
verification_uri_complete: import_zod_openapi48.z.string(),
|
|
4578
|
+
expires_in: import_zod_openapi48.z.number(),
|
|
4579
|
+
interval: import_zod_openapi48.z.number()
|
|
4580
|
+
});
|
|
4581
|
+
var DeviceVerifyRequestSchema = import_zod_openapi48.z.object({
|
|
4582
|
+
user_code: import_zod_openapi48.z.string().min(1),
|
|
4583
|
+
action: import_zod_openapi48.z.enum(["approve", "deny"])
|
|
4584
|
+
});
|
|
4585
|
+
var DeviceVerifyResponseSchema = import_zod_openapi48.z.object({
|
|
4586
|
+
status: import_zod_openapi48.z.enum(["approved", "denied"])
|
|
4587
|
+
});
|
|
4588
|
+
var DeviceInfoResponseSchema = import_zod_openapi48.z.object({
|
|
4589
|
+
client_id: import_zod_openapi48.z.string(),
|
|
4590
|
+
scopes: import_zod_openapi48.z.array(import_zod_openapi48.z.string())
|
|
4591
|
+
});
|
|
4592
|
+
var ClientInfoResponseSchema = import_zod_openapi48.z.object({
|
|
4593
|
+
clientId: import_zod_openapi48.z.string(),
|
|
4594
|
+
name: import_zod_openapi48.z.string(),
|
|
4595
|
+
firstParty: import_zod_openapi48.z.boolean(),
|
|
4596
|
+
trusted: import_zod_openapi48.z.boolean()
|
|
4125
4597
|
});
|
|
4126
4598
|
var GRANT_TYPES_SUPPORTED = ["authorization_code", "refresh_token", DEVICE_CODE_GRANT_TYPE];
|
|
4127
|
-
var DiscoveryResponseSchema =
|
|
4128
|
-
issuer:
|
|
4129
|
-
authorization_endpoint:
|
|
4130
|
-
token_endpoint:
|
|
4131
|
-
revocation_endpoint:
|
|
4132
|
-
device_authorization_endpoint:
|
|
4133
|
-
scopes_supported:
|
|
4134
|
-
response_types_supported:
|
|
4135
|
-
grant_types_supported:
|
|
4136
|
-
code_challenge_methods_supported:
|
|
4137
|
-
token_endpoint_auth_methods_supported:
|
|
4599
|
+
var DiscoveryResponseSchema = import_zod_openapi48.z.object({
|
|
4600
|
+
issuer: import_zod_openapi48.z.string(),
|
|
4601
|
+
authorization_endpoint: import_zod_openapi48.z.string(),
|
|
4602
|
+
token_endpoint: import_zod_openapi48.z.string(),
|
|
4603
|
+
revocation_endpoint: import_zod_openapi48.z.string(),
|
|
4604
|
+
device_authorization_endpoint: import_zod_openapi48.z.string().optional(),
|
|
4605
|
+
scopes_supported: import_zod_openapi48.z.array(import_zod_openapi48.z.string()),
|
|
4606
|
+
response_types_supported: import_zod_openapi48.z.array(import_zod_openapi48.z.string()),
|
|
4607
|
+
grant_types_supported: import_zod_openapi48.z.array(import_zod_openapi48.z.string()),
|
|
4608
|
+
code_challenge_methods_supported: import_zod_openapi48.z.array(import_zod_openapi48.z.string()),
|
|
4609
|
+
token_endpoint_auth_methods_supported: import_zod_openapi48.z.array(import_zod_openapi48.z.string())
|
|
4138
4610
|
});
|
|
4139
4611
|
var DISCOVERY_SCOPES_SUPPORTED = ISSUABLE_SCOPES;
|
|
4140
4612
|
|
|
4141
4613
|
// src/contracts/oauth.ts
|
|
4142
|
-
var authorizeRoute = (0,
|
|
4614
|
+
var authorizeRoute = (0, import_zod_openapi49.createRoute)({
|
|
4143
4615
|
method: "post",
|
|
4144
4616
|
path: "/oauth/authorize",
|
|
4145
4617
|
tags: ["oauth"],
|
|
@@ -4169,7 +4641,7 @@ var authorizeRoute = (0, import_zod_openapi47.createRoute)({
|
|
|
4169
4641
|
}
|
|
4170
4642
|
}
|
|
4171
4643
|
});
|
|
4172
|
-
var tokenRoute = (0,
|
|
4644
|
+
var tokenRoute = (0, import_zod_openapi49.createRoute)({
|
|
4173
4645
|
method: "post",
|
|
4174
4646
|
path: "/oauth/token",
|
|
4175
4647
|
tags: ["oauth"],
|
|
@@ -4201,7 +4673,7 @@ var tokenRoute = (0, import_zod_openapi47.createRoute)({
|
|
|
4201
4673
|
}
|
|
4202
4674
|
}
|
|
4203
4675
|
});
|
|
4204
|
-
var revokeRoute = (0,
|
|
4676
|
+
var revokeRoute = (0, import_zod_openapi49.createRoute)({
|
|
4205
4677
|
method: "post",
|
|
4206
4678
|
path: "/oauth/revoke",
|
|
4207
4679
|
tags: ["oauth"],
|
|
@@ -4221,7 +4693,7 @@ var revokeRoute = (0, import_zod_openapi47.createRoute)({
|
|
|
4221
4693
|
}
|
|
4222
4694
|
}
|
|
4223
4695
|
});
|
|
4224
|
-
var discoveryRoute = (0,
|
|
4696
|
+
var discoveryRoute = (0, import_zod_openapi49.createRoute)({
|
|
4225
4697
|
method: "get",
|
|
4226
4698
|
path: "/.well-known/oauth-authorization-server",
|
|
4227
4699
|
tags: ["oauth"],
|
|
@@ -4233,7 +4705,7 @@ var discoveryRoute = (0, import_zod_openapi47.createRoute)({
|
|
|
4233
4705
|
}
|
|
4234
4706
|
}
|
|
4235
4707
|
});
|
|
4236
|
-
var deviceAuthorizeRoute = (0,
|
|
4708
|
+
var deviceAuthorizeRoute = (0, import_zod_openapi49.createRoute)({
|
|
4237
4709
|
method: "post",
|
|
4238
4710
|
path: "/oauth/device/authorize",
|
|
4239
4711
|
tags: ["oauth"],
|
|
@@ -4261,7 +4733,7 @@ var deviceAuthorizeRoute = (0, import_zod_openapi47.createRoute)({
|
|
|
4261
4733
|
}
|
|
4262
4734
|
}
|
|
4263
4735
|
});
|
|
4264
|
-
var deviceInfoRoute = (0,
|
|
4736
|
+
var deviceInfoRoute = (0, import_zod_openapi49.createRoute)({
|
|
4265
4737
|
method: "get",
|
|
4266
4738
|
path: "/oauth/device",
|
|
4267
4739
|
tags: ["oauth"],
|
|
@@ -4270,7 +4742,7 @@ var deviceInfoRoute = (0, import_zod_openapi47.createRoute)({
|
|
|
4270
4742
|
// scopes so the web consent screen can show them before approval. Reveals
|
|
4271
4743
|
// no secret. Unknown / expired / non-pending → 404 (PHASE4-Q9 option A).
|
|
4272
4744
|
request: {
|
|
4273
|
-
query:
|
|
4745
|
+
query: import_zod_openapi49.z.object({ user_code: import_zod_openapi49.z.string().min(1) })
|
|
4274
4746
|
},
|
|
4275
4747
|
responses: {
|
|
4276
4748
|
200: {
|
|
@@ -4283,7 +4755,7 @@ var deviceInfoRoute = (0, import_zod_openapi47.createRoute)({
|
|
|
4283
4755
|
}
|
|
4284
4756
|
}
|
|
4285
4757
|
});
|
|
4286
|
-
var deviceVerifyRoute = (0,
|
|
4758
|
+
var deviceVerifyRoute = (0, import_zod_openapi49.createRoute)({
|
|
4287
4759
|
method: "post",
|
|
4288
4760
|
path: "/oauth/device/verify",
|
|
4289
4761
|
tags: ["oauth"],
|
|
@@ -4313,7 +4785,7 @@ var deviceVerifyRoute = (0, import_zod_openapi47.createRoute)({
|
|
|
4313
4785
|
}
|
|
4314
4786
|
}
|
|
4315
4787
|
});
|
|
4316
|
-
var clientInfoRoute = (0,
|
|
4788
|
+
var clientInfoRoute = (0, import_zod_openapi49.createRoute)({
|
|
4317
4789
|
method: "get",
|
|
4318
4790
|
path: "/oauth/client-info",
|
|
4319
4791
|
tags: ["oauth"],
|
|
@@ -4324,7 +4796,7 @@ var clientInfoRoute = (0, import_zod_openapi47.createRoute)({
|
|
|
4324
4796
|
// no redirectUris/allowedScopes — mirroring deviceInfoRoute's own
|
|
4325
4797
|
// non-secret-lookup shape. Unknown client_id → 404.
|
|
4326
4798
|
request: {
|
|
4327
|
-
query:
|
|
4799
|
+
query: import_zod_openapi49.z.object({ client_id: import_zod_openapi49.z.string().min(1) })
|
|
4328
4800
|
},
|
|
4329
4801
|
responses: {
|
|
4330
4802
|
200: {
|
|
@@ -4349,24 +4821,24 @@ var oauthRoutes = {
|
|
|
4349
4821
|
};
|
|
4350
4822
|
|
|
4351
4823
|
// src/contracts/notification.ts
|
|
4352
|
-
var
|
|
4824
|
+
var import_zod_openapi51 = require("@hono/zod-openapi");
|
|
4353
4825
|
|
|
4354
4826
|
// src/schemas/notification.ts
|
|
4355
|
-
var
|
|
4356
|
-
var NotificationStatusSchema =
|
|
4827
|
+
var import_zod_openapi50 = require("@hono/zod-openapi");
|
|
4828
|
+
var NotificationStatusSchema = import_zod_openapi50.z.enum(["UNREAD", "UNOPENED", "OPENED"]);
|
|
4357
4829
|
var NotificationStatusEnum = {
|
|
4358
4830
|
UNREAD: "UNREAD",
|
|
4359
4831
|
UNOPENED: "UNOPENED",
|
|
4360
4832
|
OPENED: "OPENED"
|
|
4361
4833
|
};
|
|
4362
|
-
var NotificationActionSchema =
|
|
4834
|
+
var NotificationActionSchema = import_zod_openapi50.z.enum(["COMMENT", "LIKE", "MENTION", "UPDATE"]);
|
|
4363
4835
|
var NotificationActionEnum = {
|
|
4364
4836
|
COMMENT: "COMMENT",
|
|
4365
4837
|
LIKE: "LIKE",
|
|
4366
4838
|
MENTION: "MENTION",
|
|
4367
4839
|
UPDATE: "UPDATE"
|
|
4368
4840
|
};
|
|
4369
|
-
var NotificationTargetModelSchema =
|
|
4841
|
+
var NotificationTargetModelSchema = import_zod_openapi50.z.enum(["Page"]);
|
|
4370
4842
|
var NotificationTargetModelEnum = {
|
|
4371
4843
|
PAGE: "Page"
|
|
4372
4844
|
};
|
|
@@ -4375,71 +4847,71 @@ var PageRefSchema = PageSchema.pick({
|
|
|
4375
4847
|
path: true,
|
|
4376
4848
|
status: true
|
|
4377
4849
|
});
|
|
4378
|
-
var NotificationSchema =
|
|
4379
|
-
_id:
|
|
4380
|
-
user:
|
|
4850
|
+
var NotificationSchema = import_zod_openapi50.z.object({
|
|
4851
|
+
_id: import_zod_openapi50.z.string(),
|
|
4852
|
+
user: import_zod_openapi50.z.string(),
|
|
4381
4853
|
targetModel: NotificationTargetModelSchema,
|
|
4382
4854
|
target: PageRefSchema,
|
|
4383
4855
|
action: NotificationActionSchema,
|
|
4384
4856
|
status: NotificationStatusSchema,
|
|
4385
|
-
actionUsers:
|
|
4386
|
-
createdAt:
|
|
4857
|
+
actionUsers: import_zod_openapi50.z.array(UserPublicSchema),
|
|
4858
|
+
createdAt: import_zod_openapi50.z.string()
|
|
4387
4859
|
});
|
|
4388
|
-
var ListNotificationsRequestSchema =
|
|
4389
|
-
limit:
|
|
4390
|
-
offset:
|
|
4860
|
+
var ListNotificationsRequestSchema = import_zod_openapi50.z.object({
|
|
4861
|
+
limit: import_zod_openapi50.z.coerce.number().optional().default(10),
|
|
4862
|
+
offset: import_zod_openapi50.z.coerce.number().optional().default(0)
|
|
4391
4863
|
});
|
|
4392
|
-
var ListNotificationsResponseSchema =
|
|
4393
|
-
notifications:
|
|
4864
|
+
var ListNotificationsResponseSchema = import_zod_openapi50.z.object({
|
|
4865
|
+
notifications: import_zod_openapi50.z.array(NotificationSchema),
|
|
4394
4866
|
pager: PagerSchema
|
|
4395
4867
|
});
|
|
4396
|
-
var MarkAllAsReadResponseSchema =
|
|
4397
|
-
ok:
|
|
4868
|
+
var MarkAllAsReadResponseSchema = import_zod_openapi50.z.object({
|
|
4869
|
+
ok: import_zod_openapi50.z.literal(true)
|
|
4398
4870
|
});
|
|
4399
|
-
var OpenNotificationParamSchema =
|
|
4400
|
-
id:
|
|
4871
|
+
var OpenNotificationParamSchema = import_zod_openapi50.z.object({
|
|
4872
|
+
id: import_zod_openapi50.z.string()
|
|
4401
4873
|
});
|
|
4402
|
-
var OpenNotificationResponseSchema =
|
|
4874
|
+
var OpenNotificationResponseSchema = import_zod_openapi50.z.object({
|
|
4403
4875
|
notification: NotificationSchema
|
|
4404
4876
|
});
|
|
4405
|
-
var NotificationStatusResponseSchema =
|
|
4406
|
-
count:
|
|
4877
|
+
var NotificationStatusResponseSchema = import_zod_openapi50.z.object({
|
|
4878
|
+
count: import_zod_openapi50.z.number()
|
|
4407
4879
|
});
|
|
4408
|
-
var NotificationNotFoundErrorSchema =
|
|
4409
|
-
error:
|
|
4410
|
-
code:
|
|
4411
|
-
message:
|
|
4880
|
+
var NotificationNotFoundErrorSchema = import_zod_openapi50.z.object({
|
|
4881
|
+
error: import_zod_openapi50.z.object({
|
|
4882
|
+
code: import_zod_openapi50.z.literal("NOTIFICATION_NOT_FOUND"),
|
|
4883
|
+
message: import_zod_openapi50.z.literal("Notification not found")
|
|
4412
4884
|
})
|
|
4413
4885
|
});
|
|
4414
|
-
var NotificationsTokenResponseSchema =
|
|
4415
|
-
token:
|
|
4416
|
-
selfUserId:
|
|
4417
|
-
expiresAt:
|
|
4886
|
+
var NotificationsTokenResponseSchema = import_zod_openapi50.z.object({
|
|
4887
|
+
token: import_zod_openapi50.z.string(),
|
|
4888
|
+
selfUserId: import_zod_openapi50.z.string(),
|
|
4889
|
+
expiresAt: import_zod_openapi50.z.string()
|
|
4418
4890
|
});
|
|
4419
|
-
var NotificationsTokenPayloadSchema =
|
|
4420
|
-
selfUserId:
|
|
4891
|
+
var NotificationsTokenPayloadSchema = import_zod_openapi50.z.object({
|
|
4892
|
+
selfUserId: import_zod_openapi50.z.string(),
|
|
4421
4893
|
// Random UUID mixed into every signed token so two tokens minted
|
|
4422
4894
|
// within the same second still produce byte-different JWT strings.
|
|
4423
4895
|
// The browser uses the token as a React effect dependency to drive
|
|
4424
4896
|
// the WebSocket reconnect — without `jti`, the iat/exp pair is
|
|
4425
4897
|
// identical at second granularity and the dep stays stable.
|
|
4426
|
-
jti:
|
|
4427
|
-
iat:
|
|
4428
|
-
exp:
|
|
4898
|
+
jti: import_zod_openapi50.z.string().uuid(),
|
|
4899
|
+
iat: import_zod_openapi50.z.number().int(),
|
|
4900
|
+
exp: import_zod_openapi50.z.number().int()
|
|
4429
4901
|
});
|
|
4430
|
-
var NotificationsChangedMessageSchema =
|
|
4431
|
-
type:
|
|
4902
|
+
var NotificationsChangedMessageSchema = import_zod_openapi50.z.object({
|
|
4903
|
+
type: import_zod_openapi50.z.literal("changed")
|
|
4432
4904
|
});
|
|
4433
4905
|
var NotificationsServerMessageSchema = NotificationsChangedMessageSchema;
|
|
4434
4906
|
|
|
4435
4907
|
// src/contracts/notification.ts
|
|
4436
|
-
var NotificationInvalidRequestErrorSchema =
|
|
4437
|
-
error:
|
|
4438
|
-
code:
|
|
4439
|
-
message:
|
|
4908
|
+
var NotificationInvalidRequestErrorSchema = import_zod_openapi51.z.object({
|
|
4909
|
+
error: import_zod_openapi51.z.object({
|
|
4910
|
+
code: import_zod_openapi51.z.literal("INVALID_REQUEST"),
|
|
4911
|
+
message: import_zod_openapi51.z.string()
|
|
4440
4912
|
})
|
|
4441
4913
|
});
|
|
4442
|
-
var listNotificationsRoute = (0,
|
|
4914
|
+
var listNotificationsRoute = (0, import_zod_openapi51.createRoute)({
|
|
4443
4915
|
method: "get",
|
|
4444
4916
|
path: "/notifications",
|
|
4445
4917
|
tags: ["notification"],
|
|
@@ -4463,7 +4935,7 @@ var listNotificationsRoute = (0, import_zod_openapi49.createRoute)({
|
|
|
4463
4935
|
}
|
|
4464
4936
|
}
|
|
4465
4937
|
});
|
|
4466
|
-
var markAllAsReadRoute = (0,
|
|
4938
|
+
var markAllAsReadRoute = (0, import_zod_openapi51.createRoute)({
|
|
4467
4939
|
method: "post",
|
|
4468
4940
|
path: "/notifications/read",
|
|
4469
4941
|
tags: ["notification"],
|
|
@@ -4484,7 +4956,7 @@ var markAllAsReadRoute = (0, import_zod_openapi49.createRoute)({
|
|
|
4484
4956
|
}
|
|
4485
4957
|
}
|
|
4486
4958
|
});
|
|
4487
|
-
var getUnreadCountRoute = (0,
|
|
4959
|
+
var getUnreadCountRoute = (0, import_zod_openapi51.createRoute)({
|
|
4488
4960
|
method: "get",
|
|
4489
4961
|
path: "/notifications/status",
|
|
4490
4962
|
tags: ["notification"],
|
|
@@ -4505,7 +4977,7 @@ var getUnreadCountRoute = (0, import_zod_openapi49.createRoute)({
|
|
|
4505
4977
|
}
|
|
4506
4978
|
}
|
|
4507
4979
|
});
|
|
4508
|
-
var openNotificationRoute = (0,
|
|
4980
|
+
var openNotificationRoute = (0, import_zod_openapi51.createRoute)({
|
|
4509
4981
|
method: "post",
|
|
4510
4982
|
path: "/notifications/{id}/open",
|
|
4511
4983
|
tags: ["notification"],
|
|
@@ -4537,7 +5009,7 @@ var openNotificationRoute = (0, import_zod_openapi49.createRoute)({
|
|
|
4537
5009
|
}
|
|
4538
5010
|
}
|
|
4539
5011
|
});
|
|
4540
|
-
var getNotificationsTokenRoute = (0,
|
|
5012
|
+
var getNotificationsTokenRoute = (0, import_zod_openapi51.createRoute)({
|
|
4541
5013
|
method: "get",
|
|
4542
5014
|
path: "/notifications/token",
|
|
4543
5015
|
tags: ["notification"],
|
|
@@ -4572,11 +5044,11 @@ var notificationRoutes = {
|
|
|
4572
5044
|
};
|
|
4573
5045
|
|
|
4574
5046
|
// src/contracts/page-collab.ts
|
|
4575
|
-
var
|
|
4576
|
-
var PageIdPathParamsSchema2 =
|
|
4577
|
-
id:
|
|
5047
|
+
var import_zod_openapi52 = require("@hono/zod-openapi");
|
|
5048
|
+
var PageIdPathParamsSchema2 = import_zod_openapi52.z.object({
|
|
5049
|
+
id: import_zod_openapi52.z.string().openapi({ description: "Page id (24-char hex ObjectId)", example: "507f1f77bcf86cd799439011" })
|
|
4578
5050
|
});
|
|
4579
|
-
var getYjsTokenRoute = (0,
|
|
5051
|
+
var getYjsTokenRoute = (0, import_zod_openapi52.createRoute)({
|
|
4580
5052
|
method: "get",
|
|
4581
5053
|
path: "/pages/{id}/yjs-token",
|
|
4582
5054
|
tags: ["page-collab"],
|
|
@@ -4613,26 +5085,26 @@ var pageCollabRoutes = {
|
|
|
4613
5085
|
};
|
|
4614
5086
|
|
|
4615
5087
|
// src/contracts/page.ts
|
|
4616
|
-
var
|
|
4617
|
-
var PageBadRequestErrorSchema =
|
|
4618
|
-
error:
|
|
4619
|
-
code:
|
|
4620
|
-
message:
|
|
5088
|
+
var import_zod_openapi53 = require("@hono/zod-openapi");
|
|
5089
|
+
var PageBadRequestErrorSchema = import_zod_openapi53.z.object({
|
|
5090
|
+
error: import_zod_openapi53.z.object({
|
|
5091
|
+
code: import_zod_openapi53.z.string(),
|
|
5092
|
+
message: import_zod_openapi53.z.string()
|
|
4621
5093
|
})
|
|
4622
5094
|
});
|
|
4623
|
-
var DeletePageRequestSchema =
|
|
4624
|
-
page_id:
|
|
4625
|
-
revision_id:
|
|
4626
|
-
completely:
|
|
5095
|
+
var DeletePageRequestSchema = import_zod_openapi53.z.object({
|
|
5096
|
+
page_id: import_zod_openapi53.z.string(),
|
|
5097
|
+
revision_id: import_zod_openapi53.z.string().optional(),
|
|
5098
|
+
completely: import_zod_openapi53.z.boolean().optional()
|
|
4627
5099
|
});
|
|
4628
|
-
var RevertDeletedPageRequestSchema =
|
|
4629
|
-
page_id:
|
|
5100
|
+
var RevertDeletedPageRequestSchema = import_zod_openapi53.z.object({
|
|
5101
|
+
page_id: import_zod_openapi53.z.string()
|
|
4630
5102
|
});
|
|
4631
|
-
var PageIdBodySchema =
|
|
4632
|
-
page_id:
|
|
5103
|
+
var PageIdBodySchema = import_zod_openapi53.z.object({
|
|
5104
|
+
page_id: import_zod_openapi53.z.string()
|
|
4633
5105
|
});
|
|
4634
|
-
var PageResponseSchema =
|
|
4635
|
-
var getPageRoute = (0,
|
|
5106
|
+
var PageResponseSchema = import_zod_openapi53.z.object({ page: PageSchema });
|
|
5107
|
+
var getPageRoute = (0, import_zod_openapi53.createRoute)({
|
|
4636
5108
|
method: "get",
|
|
4637
5109
|
path: "/pages",
|
|
4638
5110
|
tags: ["page"],
|
|
@@ -4643,7 +5115,7 @@ var getPageRoute = (0, import_zod_openapi51.createRoute)({
|
|
|
4643
5115
|
},
|
|
4644
5116
|
responses: {
|
|
4645
5117
|
200: {
|
|
4646
|
-
description: "The requested page with populated revision",
|
|
5118
|
+
description: "The requested page with populated revision. `revision.renderedAst` shape is content-negotiated via the `X-Crowi-Ast-Version` request header (RFC-0023): requests declaring `X-Crowi-Ast-Version: 1` receive the typed `{astVersion, root}` envelope; all other requests receive the stored bare mdast Root verbatim. The response varies on this header (`Vary: X-Crowi-Ast-Version`).",
|
|
4647
5119
|
content: { "application/json": { schema: GetPageResponseSchema } }
|
|
4648
5120
|
},
|
|
4649
5121
|
401: {
|
|
@@ -4669,7 +5141,7 @@ var getPageRoute = (0, import_zod_openapi51.createRoute)({
|
|
|
4669
5141
|
}
|
|
4670
5142
|
}
|
|
4671
5143
|
});
|
|
4672
|
-
var listPagesRoute = (0,
|
|
5144
|
+
var listPagesRoute = (0, import_zod_openapi53.createRoute)({
|
|
4673
5145
|
method: "get",
|
|
4674
5146
|
path: "/pages/list",
|
|
4675
5147
|
tags: ["page"],
|
|
@@ -4680,7 +5152,7 @@ var listPagesRoute = (0, import_zod_openapi51.createRoute)({
|
|
|
4680
5152
|
},
|
|
4681
5153
|
responses: {
|
|
4682
5154
|
200: {
|
|
4683
|
-
description: "Page list (newest first) with optional portal page",
|
|
5155
|
+
description: "Page list (newest first) with optional portal page and an accurate `total` (the full, unpaginated count of the same viewer-visible set `pages` is a page of). The portal document is the only row carrying `revision.renderedAst`; its shape is content-negotiated via the `X-Crowi-Ast-Version` request header (RFC-0023, same semantics as GET /pages). The response varies on this header (`Vary: X-Crowi-Ast-Version`).",
|
|
4684
5156
|
content: { "application/json": { schema: ListPagesResponseSchema } }
|
|
4685
5157
|
},
|
|
4686
5158
|
401: {
|
|
@@ -4689,7 +5161,7 @@ var listPagesRoute = (0, import_zod_openapi51.createRoute)({
|
|
|
4689
5161
|
}
|
|
4690
5162
|
}
|
|
4691
5163
|
});
|
|
4692
|
-
var listPageChildrenRoute = (0,
|
|
5164
|
+
var listPageChildrenRoute = (0, import_zod_openapi53.createRoute)({
|
|
4693
5165
|
method: "get",
|
|
4694
5166
|
path: "/pages/children",
|
|
4695
5167
|
tags: ["page"],
|
|
@@ -4709,7 +5181,7 @@ var listPageChildrenRoute = (0, import_zod_openapi51.createRoute)({
|
|
|
4709
5181
|
}
|
|
4710
5182
|
}
|
|
4711
5183
|
});
|
|
4712
|
-
var createPageRoute = (0,
|
|
5184
|
+
var createPageRoute = (0, import_zod_openapi53.createRoute)({
|
|
4713
5185
|
method: "post",
|
|
4714
5186
|
path: "/pages",
|
|
4715
5187
|
tags: ["page"],
|
|
@@ -4735,7 +5207,7 @@ var createPageRoute = (0, import_zod_openapi51.createRoute)({
|
|
|
4735
5207
|
}
|
|
4736
5208
|
}
|
|
4737
5209
|
});
|
|
4738
|
-
var updatePageRoute = (0,
|
|
5210
|
+
var updatePageRoute = (0, import_zod_openapi53.createRoute)({
|
|
4739
5211
|
method: "put",
|
|
4740
5212
|
path: "/pages",
|
|
4741
5213
|
tags: ["page"],
|
|
@@ -4769,7 +5241,7 @@ var updatePageRoute = (0, import_zod_openapi51.createRoute)({
|
|
|
4769
5241
|
}
|
|
4770
5242
|
}
|
|
4771
5243
|
});
|
|
4772
|
-
var setPageGrantRoute = (0,
|
|
5244
|
+
var setPageGrantRoute = (0, import_zod_openapi53.createRoute)({
|
|
4773
5245
|
method: "put",
|
|
4774
5246
|
path: "/pages/grant",
|
|
4775
5247
|
tags: ["page"],
|
|
@@ -4799,7 +5271,7 @@ var setPageGrantRoute = (0, import_zod_openapi51.createRoute)({
|
|
|
4799
5271
|
}
|
|
4800
5272
|
}
|
|
4801
5273
|
});
|
|
4802
|
-
var seenPageRoute = (0,
|
|
5274
|
+
var seenPageRoute = (0, import_zod_openapi53.createRoute)({
|
|
4803
5275
|
method: "post",
|
|
4804
5276
|
path: "/pages/seen",
|
|
4805
5277
|
tags: ["page"],
|
|
@@ -4829,7 +5301,7 @@ var seenPageRoute = (0, import_zod_openapi51.createRoute)({
|
|
|
4829
5301
|
}
|
|
4830
5302
|
}
|
|
4831
5303
|
});
|
|
4832
|
-
var getSeenUsersRoute = (0,
|
|
5304
|
+
var getSeenUsersRoute = (0, import_zod_openapi53.createRoute)({
|
|
4833
5305
|
method: "get",
|
|
4834
5306
|
path: "/pages/seen-users",
|
|
4835
5307
|
tags: ["page"],
|
|
@@ -4857,7 +5329,7 @@ var getSeenUsersRoute = (0, import_zod_openapi51.createRoute)({
|
|
|
4857
5329
|
}
|
|
4858
5330
|
}
|
|
4859
5331
|
});
|
|
4860
|
-
var likePageRoute = (0,
|
|
5332
|
+
var likePageRoute = (0, import_zod_openapi53.createRoute)({
|
|
4861
5333
|
method: "post",
|
|
4862
5334
|
path: "/pages/like",
|
|
4863
5335
|
tags: ["page"],
|
|
@@ -4887,7 +5359,7 @@ var likePageRoute = (0, import_zod_openapi51.createRoute)({
|
|
|
4887
5359
|
}
|
|
4888
5360
|
}
|
|
4889
5361
|
});
|
|
4890
|
-
var unlikePageRoute = (0,
|
|
5362
|
+
var unlikePageRoute = (0, import_zod_openapi53.createRoute)({
|
|
4891
5363
|
method: "post",
|
|
4892
5364
|
path: "/pages/unlike",
|
|
4893
5365
|
tags: ["page"],
|
|
@@ -4917,7 +5389,7 @@ var unlikePageRoute = (0, import_zod_openapi51.createRoute)({
|
|
|
4917
5389
|
}
|
|
4918
5390
|
}
|
|
4919
5391
|
});
|
|
4920
|
-
var claimPageLinkAccessRoute = (0,
|
|
5392
|
+
var claimPageLinkAccessRoute = (0, import_zod_openapi53.createRoute)({
|
|
4921
5393
|
method: "post",
|
|
4922
5394
|
path: "/pages/link-access",
|
|
4923
5395
|
tags: ["page"],
|
|
@@ -4945,7 +5417,7 @@ var claimPageLinkAccessRoute = (0, import_zod_openapi51.createRoute)({
|
|
|
4945
5417
|
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",
|
|
4946
5418
|
content: {
|
|
4947
5419
|
"application/json": {
|
|
4948
|
-
schema:
|
|
5420
|
+
schema: import_zod_openapi53.z.union([PageNotGrantedErrorSchema, InsufficientScopeErrorSchema])
|
|
4949
5421
|
}
|
|
4950
5422
|
}
|
|
4951
5423
|
},
|
|
@@ -4963,7 +5435,7 @@ var claimPageLinkAccessRoute = (0, import_zod_openapi51.createRoute)({
|
|
|
4963
5435
|
}
|
|
4964
5436
|
}
|
|
4965
5437
|
});
|
|
4966
|
-
var getWatchStatusRoute = (0,
|
|
5438
|
+
var getWatchStatusRoute = (0, import_zod_openapi53.createRoute)({
|
|
4967
5439
|
method: "get",
|
|
4968
5440
|
path: "/pages/watch",
|
|
4969
5441
|
tags: ["page"],
|
|
@@ -4991,7 +5463,7 @@ var getWatchStatusRoute = (0, import_zod_openapi51.createRoute)({
|
|
|
4991
5463
|
}
|
|
4992
5464
|
}
|
|
4993
5465
|
});
|
|
4994
|
-
var setWatchStatusRoute = (0,
|
|
5466
|
+
var setWatchStatusRoute = (0, import_zod_openapi53.createRoute)({
|
|
4995
5467
|
method: "put",
|
|
4996
5468
|
path: "/pages/watch",
|
|
4997
5469
|
tags: ["page"],
|
|
@@ -5021,7 +5493,7 @@ var setWatchStatusRoute = (0, import_zod_openapi51.createRoute)({
|
|
|
5021
5493
|
}
|
|
5022
5494
|
}
|
|
5023
5495
|
});
|
|
5024
|
-
var deletePageRoute = (0,
|
|
5496
|
+
var deletePageRoute = (0, import_zod_openapi53.createRoute)({
|
|
5025
5497
|
method: "delete",
|
|
5026
5498
|
path: "/pages",
|
|
5027
5499
|
tags: ["page"],
|
|
@@ -5055,7 +5527,7 @@ var deletePageRoute = (0, import_zod_openapi51.createRoute)({
|
|
|
5055
5527
|
}
|
|
5056
5528
|
}
|
|
5057
5529
|
});
|
|
5058
|
-
var revertDeletedPageRoute = (0,
|
|
5530
|
+
var revertDeletedPageRoute = (0, import_zod_openapi53.createRoute)({
|
|
5059
5531
|
method: "post",
|
|
5060
5532
|
path: "/pages/revert",
|
|
5061
5533
|
tags: ["page"],
|
|
@@ -5085,7 +5557,7 @@ var revertDeletedPageRoute = (0, import_zod_openapi51.createRoute)({
|
|
|
5085
5557
|
}
|
|
5086
5558
|
}
|
|
5087
5559
|
});
|
|
5088
|
-
var revertToRevisionRoute = (0,
|
|
5560
|
+
var revertToRevisionRoute = (0, import_zod_openapi53.createRoute)({
|
|
5089
5561
|
method: "post",
|
|
5090
5562
|
path: "/pages/revert-to-revision",
|
|
5091
5563
|
tags: ["page"],
|
|
@@ -5115,7 +5587,7 @@ var revertToRevisionRoute = (0, import_zod_openapi51.createRoute)({
|
|
|
5115
5587
|
}
|
|
5116
5588
|
}
|
|
5117
5589
|
});
|
|
5118
|
-
var renamePageRoute = (0,
|
|
5590
|
+
var renamePageRoute = (0, import_zod_openapi53.createRoute)({
|
|
5119
5591
|
method: "post",
|
|
5120
5592
|
path: "/pages/rename",
|
|
5121
5593
|
tags: ["page"],
|
|
@@ -5135,7 +5607,7 @@ var renamePageRoute = (0, import_zod_openapi51.createRoute)({
|
|
|
5135
5607
|
description: "PAGE_INVALID_NAME / PAGE_EXISTS / PAGE_RENAME_FAILED / PAGE_RENAME_TREE_FAILED",
|
|
5136
5608
|
content: {
|
|
5137
5609
|
"application/json": {
|
|
5138
|
-
schema:
|
|
5610
|
+
schema: import_zod_openapi53.z.union([PageBadRequestErrorSchema, RenameTreeErrorSchema])
|
|
5139
5611
|
}
|
|
5140
5612
|
}
|
|
5141
5613
|
},
|
|
@@ -5153,7 +5625,7 @@ var renamePageRoute = (0, import_zod_openapi51.createRoute)({
|
|
|
5153
5625
|
}
|
|
5154
5626
|
}
|
|
5155
5627
|
});
|
|
5156
|
-
var renameSubtreeRoute = (0,
|
|
5628
|
+
var renameSubtreeRoute = (0, import_zod_openapi53.createRoute)({
|
|
5157
5629
|
method: "post",
|
|
5158
5630
|
path: "/pages/rename-subtree",
|
|
5159
5631
|
tags: ["page"],
|
|
@@ -5173,7 +5645,7 @@ var renameSubtreeRoute = (0, import_zod_openapi51.createRoute)({
|
|
|
5173
5645
|
description: "PAGE_INVALID_NAME / PAGE_RENAME_TREE_FAILED (collisions, nothing to move, or partial failure)",
|
|
5174
5646
|
content: {
|
|
5175
5647
|
"application/json": {
|
|
5176
|
-
schema:
|
|
5648
|
+
schema: import_zod_openapi53.z.union([PageBadRequestErrorSchema, RenameTreeErrorSchema])
|
|
5177
5649
|
}
|
|
5178
5650
|
}
|
|
5179
5651
|
},
|
|
@@ -5223,19 +5695,20 @@ var pageRoutes = {
|
|
|
5223
5695
|
};
|
|
5224
5696
|
|
|
5225
5697
|
// src/contracts/page-preview.ts
|
|
5226
|
-
var
|
|
5698
|
+
var import_zod_openapi55 = require("@hono/zod-openapi");
|
|
5227
5699
|
|
|
5228
5700
|
// src/schemas/page-preview.ts
|
|
5229
|
-
var
|
|
5230
|
-
var PreviewPageRequestSchema =
|
|
5231
|
-
body:
|
|
5701
|
+
var import_zod_openapi54 = require("@hono/zod-openapi");
|
|
5702
|
+
var PreviewPageRequestSchema = import_zod_openapi54.z.object({
|
|
5703
|
+
body: import_zod_openapi54.z.string()
|
|
5232
5704
|
});
|
|
5233
|
-
var PreviewPageResponseSchema =
|
|
5234
|
-
renderedAst:
|
|
5705
|
+
var PreviewPageResponseSchema = import_zod_openapi54.z.object({
|
|
5706
|
+
renderedAst: RenderedAstValueSchema.optional(),
|
|
5707
|
+
renderedAstArtifactKey: RenderedAstArtifactKeySchema.optional()
|
|
5235
5708
|
});
|
|
5236
5709
|
|
|
5237
5710
|
// src/contracts/page-preview.ts
|
|
5238
|
-
var previewPageRoute = (0,
|
|
5711
|
+
var previewPageRoute = (0, import_zod_openapi55.createRoute)({
|
|
5239
5712
|
method: "post",
|
|
5240
5713
|
path: "/pages/preview",
|
|
5241
5714
|
tags: ["page-preview"],
|
|
@@ -5248,7 +5721,7 @@ var previewPageRoute = (0, import_zod_openapi53.createRoute)({
|
|
|
5248
5721
|
},
|
|
5249
5722
|
responses: {
|
|
5250
5723
|
200: {
|
|
5251
|
-
description: "Rendered mdast tree (serialised \u2014 same shape as a persisted revision.renderedAst)",
|
|
5724
|
+
description: "Rendered mdast tree (serialised \u2014 same shape as a persisted revision.renderedAst). Content-negotiated via the `X-Crowi-Ast-Version` request header (RFC-0023): requests declaring `X-Crowi-Ast-Version: 1` receive the typed `{astVersion, root}` envelope; all other requests receive the bare mdast Root. The response varies on this header (`Vary: X-Crowi-Ast-Version`).",
|
|
5252
5725
|
content: { "application/json": { schema: PreviewPageResponseSchema } }
|
|
5253
5726
|
},
|
|
5254
5727
|
401: {
|
|
@@ -5273,80 +5746,80 @@ var pagePreviewRoutes = {
|
|
|
5273
5746
|
};
|
|
5274
5747
|
|
|
5275
5748
|
// src/contracts/presence.ts
|
|
5276
|
-
var
|
|
5749
|
+
var import_zod_openapi57 = require("@hono/zod-openapi");
|
|
5277
5750
|
|
|
5278
5751
|
// src/schemas/presence.ts
|
|
5279
|
-
var
|
|
5280
|
-
var PresenceTokenResponseSchema =
|
|
5281
|
-
token:
|
|
5282
|
-
pageId:
|
|
5283
|
-
selfUserId:
|
|
5284
|
-
expiresAt:
|
|
5285
|
-
});
|
|
5286
|
-
var PresenceTokenPayloadSchema =
|
|
5287
|
-
userId:
|
|
5288
|
-
pageId:
|
|
5289
|
-
iat:
|
|
5290
|
-
exp:
|
|
5291
|
-
});
|
|
5292
|
-
var PresenceViewerSchema =
|
|
5293
|
-
userId:
|
|
5294
|
-
username:
|
|
5295
|
-
displayName:
|
|
5296
|
-
avatarUrl:
|
|
5297
|
-
isEditing:
|
|
5298
|
-
joinedAt:
|
|
5299
|
-
});
|
|
5300
|
-
var PresenceHeartbeatMessageSchema =
|
|
5301
|
-
type:
|
|
5752
|
+
var import_zod_openapi56 = require("@hono/zod-openapi");
|
|
5753
|
+
var PresenceTokenResponseSchema = import_zod_openapi56.z.object({
|
|
5754
|
+
token: import_zod_openapi56.z.string(),
|
|
5755
|
+
pageId: import_zod_openapi56.z.string(),
|
|
5756
|
+
selfUserId: import_zod_openapi56.z.string(),
|
|
5757
|
+
expiresAt: import_zod_openapi56.z.string()
|
|
5758
|
+
});
|
|
5759
|
+
var PresenceTokenPayloadSchema = import_zod_openapi56.z.object({
|
|
5760
|
+
userId: import_zod_openapi56.z.string(),
|
|
5761
|
+
pageId: import_zod_openapi56.z.string(),
|
|
5762
|
+
iat: import_zod_openapi56.z.number().int(),
|
|
5763
|
+
exp: import_zod_openapi56.z.number().int()
|
|
5764
|
+
});
|
|
5765
|
+
var PresenceViewerSchema = import_zod_openapi56.z.object({
|
|
5766
|
+
userId: import_zod_openapi56.z.string(),
|
|
5767
|
+
username: import_zod_openapi56.z.string(),
|
|
5768
|
+
displayName: import_zod_openapi56.z.string(),
|
|
5769
|
+
avatarUrl: import_zod_openapi56.z.string().nullable(),
|
|
5770
|
+
isEditing: import_zod_openapi56.z.boolean(),
|
|
5771
|
+
joinedAt: import_zod_openapi56.z.number().int()
|
|
5772
|
+
});
|
|
5773
|
+
var PresenceHeartbeatMessageSchema = import_zod_openapi56.z.object({
|
|
5774
|
+
type: import_zod_openapi56.z.literal("heartbeat")
|
|
5302
5775
|
});
|
|
5303
5776
|
var PresenceClientMessageSchema = PresenceHeartbeatMessageSchema;
|
|
5304
|
-
var PresenceViewersMessageSchema =
|
|
5305
|
-
type:
|
|
5306
|
-
viewers:
|
|
5307
|
-
generation:
|
|
5308
|
-
});
|
|
5309
|
-
var PresencePageUpdatedMessageSchema =
|
|
5310
|
-
type:
|
|
5311
|
-
pageId:
|
|
5312
|
-
revisionId:
|
|
5313
|
-
editorUserId:
|
|
5314
|
-
editorDisplayName:
|
|
5315
|
-
});
|
|
5316
|
-
var PresenceCommentChangedMessageSchema =
|
|
5317
|
-
type:
|
|
5318
|
-
pageId:
|
|
5319
|
-
changeType:
|
|
5320
|
-
commentId:
|
|
5321
|
-
actorUserId:
|
|
5322
|
-
});
|
|
5323
|
-
var PresenceServerMessageSchema =
|
|
5777
|
+
var PresenceViewersMessageSchema = import_zod_openapi56.z.object({
|
|
5778
|
+
type: import_zod_openapi56.z.literal("viewers"),
|
|
5779
|
+
viewers: import_zod_openapi56.z.array(PresenceViewerSchema),
|
|
5780
|
+
generation: import_zod_openapi56.z.number().int()
|
|
5781
|
+
});
|
|
5782
|
+
var PresencePageUpdatedMessageSchema = import_zod_openapi56.z.object({
|
|
5783
|
+
type: import_zod_openapi56.z.literal("page-updated"),
|
|
5784
|
+
pageId: import_zod_openapi56.z.string(),
|
|
5785
|
+
revisionId: import_zod_openapi56.z.string(),
|
|
5786
|
+
editorUserId: import_zod_openapi56.z.string(),
|
|
5787
|
+
editorDisplayName: import_zod_openapi56.z.string()
|
|
5788
|
+
});
|
|
5789
|
+
var PresenceCommentChangedMessageSchema = import_zod_openapi56.z.object({
|
|
5790
|
+
type: import_zod_openapi56.z.literal("comment-changed"),
|
|
5791
|
+
pageId: import_zod_openapi56.z.string(),
|
|
5792
|
+
changeType: import_zod_openapi56.z.enum(["added", "removed"]),
|
|
5793
|
+
commentId: import_zod_openapi56.z.string(),
|
|
5794
|
+
actorUserId: import_zod_openapi56.z.string().optional()
|
|
5795
|
+
});
|
|
5796
|
+
var PresenceServerMessageSchema = import_zod_openapi56.z.discriminatedUnion("type", [
|
|
5324
5797
|
PresenceViewersMessageSchema,
|
|
5325
5798
|
PresencePageUpdatedMessageSchema,
|
|
5326
5799
|
PresenceCommentChangedMessageSchema
|
|
5327
5800
|
]);
|
|
5328
|
-
var LikerSchema =
|
|
5329
|
-
id:
|
|
5330
|
-
username:
|
|
5331
|
-
displayName:
|
|
5332
|
-
avatarUrl:
|
|
5333
|
-
likedAt:
|
|
5334
|
-
});
|
|
5335
|
-
var LikersResponseSchema =
|
|
5336
|
-
users:
|
|
5337
|
-
totalCount:
|
|
5338
|
-
});
|
|
5339
|
-
var GetLikersRequestSchema =
|
|
5801
|
+
var LikerSchema = import_zod_openapi56.z.object({
|
|
5802
|
+
id: import_zod_openapi56.z.string(),
|
|
5803
|
+
username: import_zod_openapi56.z.string(),
|
|
5804
|
+
displayName: import_zod_openapi56.z.string(),
|
|
5805
|
+
avatarUrl: import_zod_openapi56.z.string().nullable(),
|
|
5806
|
+
likedAt: import_zod_openapi56.z.string().nullable()
|
|
5807
|
+
});
|
|
5808
|
+
var LikersResponseSchema = import_zod_openapi56.z.object({
|
|
5809
|
+
users: import_zod_openapi56.z.array(LikerSchema),
|
|
5810
|
+
totalCount: import_zod_openapi56.z.number().int().nonnegative()
|
|
5811
|
+
});
|
|
5812
|
+
var GetLikersRequestSchema = import_zod_openapi56.z.object({
|
|
5340
5813
|
// Optional cap on returned `users`. `totalCount` always reflects the
|
|
5341
5814
|
// full count regardless of `limit`. Omit for the full list.
|
|
5342
|
-
limit:
|
|
5815
|
+
limit: import_zod_openapi56.z.coerce.number().int().positive().optional()
|
|
5343
5816
|
});
|
|
5344
5817
|
|
|
5345
5818
|
// src/contracts/presence.ts
|
|
5346
|
-
var PageIdPathParamsSchema3 =
|
|
5347
|
-
id:
|
|
5819
|
+
var PageIdPathParamsSchema3 = import_zod_openapi57.z.object({
|
|
5820
|
+
id: import_zod_openapi57.z.string().openapi({ description: "Page id (24-char hex ObjectId)", example: "507f1f77bcf86cd799439011" })
|
|
5348
5821
|
});
|
|
5349
|
-
var getPresenceTokenRoute = (0,
|
|
5822
|
+
var getPresenceTokenRoute = (0, import_zod_openapi57.createRoute)({
|
|
5350
5823
|
method: "get",
|
|
5351
5824
|
path: "/pages/{id}/presence-token",
|
|
5352
5825
|
tags: ["presence"],
|
|
@@ -5378,7 +5851,7 @@ var getPresenceTokenRoute = (0, import_zod_openapi55.createRoute)({
|
|
|
5378
5851
|
}
|
|
5379
5852
|
}
|
|
5380
5853
|
});
|
|
5381
|
-
var getLikersRoute = (0,
|
|
5854
|
+
var getLikersRoute = (0, import_zod_openapi57.createRoute)({
|
|
5382
5855
|
method: "get",
|
|
5383
5856
|
path: "/pages/{id}/likers",
|
|
5384
5857
|
tags: ["presence"],
|
|
@@ -5417,50 +5890,50 @@ var presenceRoutes = {
|
|
|
5417
5890
|
};
|
|
5418
5891
|
|
|
5419
5892
|
// src/contracts/revision.ts
|
|
5420
|
-
var
|
|
5893
|
+
var import_zod_openapi59 = require("@hono/zod-openapi");
|
|
5421
5894
|
|
|
5422
5895
|
// src/schemas/revision.ts
|
|
5423
|
-
var
|
|
5424
|
-
var RevisionMetaSchema =
|
|
5425
|
-
_id:
|
|
5426
|
-
path:
|
|
5896
|
+
var import_zod_openapi58 = require("@hono/zod-openapi");
|
|
5897
|
+
var RevisionMetaSchema = import_zod_openapi58.z.object({
|
|
5898
|
+
_id: import_zod_openapi58.z.string(),
|
|
5899
|
+
path: import_zod_openapi58.z.string(),
|
|
5427
5900
|
author: PageUserSchema.nullable().optional(),
|
|
5428
5901
|
savedBy: PageUserSchema.nullable().optional(),
|
|
5429
|
-
contributors:
|
|
5902
|
+
contributors: import_zod_openapi58.z.array(PageUserSchema).optional(),
|
|
5430
5903
|
// RFC-0010 — edit channel. `web` (browser / collab editor) vs the API
|
|
5431
5904
|
// token paths (`oauth` / `pat`). Absent on pre-RFC-0010 revisions. The
|
|
5432
5905
|
// history UI shows an "app" chip for the token paths.
|
|
5433
|
-
editVia:
|
|
5434
|
-
createdAt:
|
|
5906
|
+
editVia: import_zod_openapi58.z.enum(["web", "oauth", "pat"]).optional(),
|
|
5907
|
+
createdAt: import_zod_openapi58.z.string()
|
|
5435
5908
|
});
|
|
5436
|
-
var ListRevisionsRequestSchema =
|
|
5437
|
-
limit:
|
|
5438
|
-
offset:
|
|
5909
|
+
var ListRevisionsRequestSchema = import_zod_openapi58.z.object({
|
|
5910
|
+
limit: import_zod_openapi58.z.coerce.number().int().positive().max(200).optional().default(50),
|
|
5911
|
+
offset: import_zod_openapi58.z.coerce.number().int().min(0).optional().default(0)
|
|
5439
5912
|
});
|
|
5440
|
-
var ListRevisionsResponseSchema =
|
|
5441
|
-
revisions:
|
|
5913
|
+
var ListRevisionsResponseSchema = import_zod_openapi58.z.object({
|
|
5914
|
+
revisions: import_zod_openapi58.z.array(RevisionMetaSchema),
|
|
5442
5915
|
pager: PagerSchema
|
|
5443
5916
|
});
|
|
5444
|
-
var GetRevisionResponseSchema =
|
|
5917
|
+
var GetRevisionResponseSchema = import_zod_openapi58.z.object({
|
|
5445
5918
|
revision: RevisionSchema
|
|
5446
5919
|
});
|
|
5447
|
-
var GetRevisionsRequestSchema =
|
|
5448
|
-
ids:
|
|
5920
|
+
var GetRevisionsRequestSchema = import_zod_openapi58.z.object({
|
|
5921
|
+
ids: import_zod_openapi58.z.string().min(1, "ids is required")
|
|
5449
5922
|
});
|
|
5450
|
-
var GetRevisionsResponseSchema =
|
|
5451
|
-
revisions:
|
|
5923
|
+
var GetRevisionsResponseSchema = import_zod_openapi58.z.object({
|
|
5924
|
+
revisions: import_zod_openapi58.z.array(RevisionSchema)
|
|
5452
5925
|
});
|
|
5453
|
-
var RevisionInvalidRequestErrorSchema =
|
|
5454
|
-
error:
|
|
5455
|
-
code:
|
|
5456
|
-
message:
|
|
5926
|
+
var RevisionInvalidRequestErrorSchema = import_zod_openapi58.z.object({
|
|
5927
|
+
error: import_zod_openapi58.z.object({
|
|
5928
|
+
code: import_zod_openapi58.z.literal("INVALID_REQUEST"),
|
|
5929
|
+
message: import_zod_openapi58.z.string()
|
|
5457
5930
|
})
|
|
5458
5931
|
});
|
|
5459
5932
|
|
|
5460
5933
|
// src/contracts/revision.ts
|
|
5461
|
-
var PageIdParamSchema =
|
|
5462
|
-
var RevisionIdParamSchema =
|
|
5463
|
-
var listRevisionsRoute = (0,
|
|
5934
|
+
var PageIdParamSchema = import_zod_openapi59.z.object({ page_id: import_zod_openapi59.z.string() });
|
|
5935
|
+
var RevisionIdParamSchema = import_zod_openapi59.z.object({ id: import_zod_openapi59.z.string() });
|
|
5936
|
+
var listRevisionsRoute = (0, import_zod_openapi59.createRoute)({
|
|
5464
5937
|
method: "get",
|
|
5465
5938
|
path: "/pages/{page_id}/revisions",
|
|
5466
5939
|
tags: ["revision"],
|
|
@@ -5489,7 +5962,7 @@ var listRevisionsRoute = (0, import_zod_openapi57.createRoute)({
|
|
|
5489
5962
|
}
|
|
5490
5963
|
}
|
|
5491
5964
|
});
|
|
5492
|
-
var getRevisionsRoute = (0,
|
|
5965
|
+
var getRevisionsRoute = (0, import_zod_openapi59.createRoute)({
|
|
5493
5966
|
method: "get",
|
|
5494
5967
|
path: "/pages/revisions",
|
|
5495
5968
|
tags: ["revision"],
|
|
@@ -5517,7 +5990,7 @@ var getRevisionsRoute = (0, import_zod_openapi57.createRoute)({
|
|
|
5517
5990
|
}
|
|
5518
5991
|
}
|
|
5519
5992
|
});
|
|
5520
|
-
var getRevisionRoute = (0,
|
|
5993
|
+
var getRevisionRoute = (0, import_zod_openapi59.createRoute)({
|
|
5521
5994
|
method: "get",
|
|
5522
5995
|
path: "/pages/revisions/{id}",
|
|
5523
5996
|
tags: ["revision"],
|
|
@@ -5528,7 +6001,7 @@ var getRevisionRoute = (0, import_zod_openapi57.createRoute)({
|
|
|
5528
6001
|
},
|
|
5529
6002
|
responses: {
|
|
5530
6003
|
200: {
|
|
5531
|
-
description: "Full revision document",
|
|
6004
|
+
description: "Full revision document. `renderedAst` shape is content-negotiated via the `X-Crowi-Ast-Version` request header (RFC-0023): requests declaring `X-Crowi-Ast-Version: 1` receive the typed `{astVersion, root}` envelope; all other requests receive the stored bare mdast Root verbatim. The response varies on this header (`Vary: X-Crowi-Ast-Version`).",
|
|
5532
6005
|
content: { "application/json": { schema: GetRevisionResponseSchema } }
|
|
5533
6006
|
},
|
|
5534
6007
|
400: {
|
|
@@ -5555,39 +6028,39 @@ var revisionRoutes = {
|
|
|
5555
6028
|
};
|
|
5556
6029
|
|
|
5557
6030
|
// src/contracts/admin-crypto.ts
|
|
5558
|
-
var
|
|
6031
|
+
var import_zod_openapi61 = require("@hono/zod-openapi");
|
|
5559
6032
|
|
|
5560
6033
|
// src/schemas/admin-crypto.ts
|
|
5561
|
-
var
|
|
5562
|
-
var SensitiveConfigEntrySchema =
|
|
5563
|
-
ns:
|
|
5564
|
-
key:
|
|
5565
|
-
present:
|
|
5566
|
-
encrypted:
|
|
6034
|
+
var import_zod_openapi60 = require("@hono/zod-openapi");
|
|
6035
|
+
var SensitiveConfigEntrySchema = import_zod_openapi60.z.object({
|
|
6036
|
+
ns: import_zod_openapi60.z.string(),
|
|
6037
|
+
key: import_zod_openapi60.z.string(),
|
|
6038
|
+
present: import_zod_openapi60.z.boolean(),
|
|
6039
|
+
encrypted: import_zod_openapi60.z.boolean()
|
|
5567
6040
|
});
|
|
5568
|
-
var CryptoStatusResponseSchema =
|
|
6041
|
+
var CryptoStatusResponseSchema = import_zod_openapi60.z.object({
|
|
5569
6042
|
/** False when CROWI_ENCRYPTION_KEY is not configured — UI shows a setup hint. */
|
|
5570
|
-
encryptionConfigured:
|
|
5571
|
-
unencryptedCount:
|
|
5572
|
-
encryptedCount:
|
|
5573
|
-
entries:
|
|
6043
|
+
encryptionConfigured: import_zod_openapi60.z.boolean(),
|
|
6044
|
+
unencryptedCount: import_zod_openapi60.z.number().int().min(0),
|
|
6045
|
+
encryptedCount: import_zod_openapi60.z.number().int().min(0),
|
|
6046
|
+
entries: import_zod_openapi60.z.array(SensitiveConfigEntrySchema)
|
|
5574
6047
|
});
|
|
5575
|
-
var ReencryptResponseSchema =
|
|
5576
|
-
rewritten:
|
|
6048
|
+
var ReencryptResponseSchema = import_zod_openapi60.z.object({
|
|
6049
|
+
rewritten: import_zod_openapi60.z.number().int().min(0),
|
|
5577
6050
|
/** Already encrypted, skipped on this run. */
|
|
5578
|
-
alreadyEncrypted:
|
|
6051
|
+
alreadyEncrypted: import_zod_openapi60.z.number().int().min(0),
|
|
5579
6052
|
/** Sensitive registry entries that had no row in the DB at all. */
|
|
5580
|
-
missing:
|
|
6053
|
+
missing: import_zod_openapi60.z.number().int().min(0)
|
|
5581
6054
|
});
|
|
5582
|
-
var EncryptionNotConfiguredErrorSchema =
|
|
5583
|
-
error:
|
|
5584
|
-
code:
|
|
5585
|
-
message:
|
|
6055
|
+
var EncryptionNotConfiguredErrorSchema = import_zod_openapi60.z.object({
|
|
6056
|
+
error: import_zod_openapi60.z.object({
|
|
6057
|
+
code: import_zod_openapi60.z.literal("ENCRYPTION_NOT_CONFIGURED"),
|
|
6058
|
+
message: import_zod_openapi60.z.string()
|
|
5586
6059
|
})
|
|
5587
6060
|
});
|
|
5588
6061
|
|
|
5589
6062
|
// src/contracts/admin-crypto.ts
|
|
5590
|
-
var getCryptoStatusRoute = (0,
|
|
6063
|
+
var getCryptoStatusRoute = (0, import_zod_openapi61.createRoute)({
|
|
5591
6064
|
method: "get",
|
|
5592
6065
|
path: "/admin/crypto/status",
|
|
5593
6066
|
tags: ["adminCrypto"],
|
|
@@ -5612,7 +6085,7 @@ var getCryptoStatusRoute = (0, import_zod_openapi59.createRoute)({
|
|
|
5612
6085
|
}
|
|
5613
6086
|
}
|
|
5614
6087
|
});
|
|
5615
|
-
var reencryptAllRoute = (0,
|
|
6088
|
+
var reencryptAllRoute = (0, import_zod_openapi61.createRoute)({
|
|
5616
6089
|
method: "post",
|
|
5617
6090
|
path: "/admin/crypto/reencrypt",
|
|
5618
6091
|
tags: ["adminCrypto"],
|
|
@@ -5647,37 +6120,37 @@ var adminCryptoRoutes = {
|
|
|
5647
6120
|
};
|
|
5648
6121
|
|
|
5649
6122
|
// src/contracts/search.ts
|
|
5650
|
-
var
|
|
6123
|
+
var import_zod_openapi63 = require("@hono/zod-openapi");
|
|
5651
6124
|
|
|
5652
6125
|
// src/schemas/search.ts
|
|
5653
|
-
var
|
|
5654
|
-
var SearchPageTypeSchema =
|
|
5655
|
-
var SearchPagesRequestSchema =
|
|
5656
|
-
q:
|
|
5657
|
-
tree:
|
|
6126
|
+
var import_zod_openapi62 = require("@hono/zod-openapi");
|
|
6127
|
+
var SearchPageTypeSchema = import_zod_openapi62.z.enum(["portal", "public", "user"]);
|
|
6128
|
+
var SearchPagesRequestSchema = import_zod_openapi62.z.object({
|
|
6129
|
+
q: import_zod_openapi62.z.string().min(1),
|
|
6130
|
+
tree: import_zod_openapi62.z.string().optional(),
|
|
5658
6131
|
type: SearchPageTypeSchema.optional(),
|
|
5659
|
-
page:
|
|
5660
|
-
limit:
|
|
5661
|
-
});
|
|
5662
|
-
var SearchHitSchema =
|
|
5663
|
-
pageId:
|
|
5664
|
-
path:
|
|
5665
|
-
score:
|
|
5666
|
-
snippet:
|
|
5667
|
-
bookmarkCount:
|
|
6132
|
+
page: import_zod_openapi62.z.coerce.number().int().min(1).default(1),
|
|
6133
|
+
limit: import_zod_openapi62.z.coerce.number().int().min(1).max(100).default(50)
|
|
6134
|
+
});
|
|
6135
|
+
var SearchHitSchema = import_zod_openapi62.z.object({
|
|
6136
|
+
pageId: import_zod_openapi62.z.string(),
|
|
6137
|
+
path: import_zod_openapi62.z.string(),
|
|
6138
|
+
score: import_zod_openapi62.z.number().optional(),
|
|
6139
|
+
snippet: import_zod_openapi62.z.string().optional(),
|
|
6140
|
+
bookmarkCount: import_zod_openapi62.z.number(),
|
|
5668
6141
|
page: PageSchema
|
|
5669
6142
|
});
|
|
5670
|
-
var SearchPagesResponseSchema =
|
|
5671
|
-
meta:
|
|
5672
|
-
took:
|
|
5673
|
-
total:
|
|
5674
|
-
results:
|
|
6143
|
+
var SearchPagesResponseSchema = import_zod_openapi62.z.object({
|
|
6144
|
+
meta: import_zod_openapi62.z.object({
|
|
6145
|
+
took: import_zod_openapi62.z.number().optional(),
|
|
6146
|
+
total: import_zod_openapi62.z.number(),
|
|
6147
|
+
results: import_zod_openapi62.z.number()
|
|
5675
6148
|
}),
|
|
5676
|
-
data:
|
|
6149
|
+
data: import_zod_openapi62.z.array(SearchHitSchema)
|
|
5677
6150
|
});
|
|
5678
6151
|
|
|
5679
6152
|
// src/contracts/search.ts
|
|
5680
|
-
var searchPagesRoute = (0,
|
|
6153
|
+
var searchPagesRoute = (0, import_zod_openapi63.createRoute)({
|
|
5681
6154
|
method: "get",
|
|
5682
6155
|
path: "/search",
|
|
5683
6156
|
tags: ["search"],
|
|
@@ -5714,56 +6187,56 @@ var searchRoutes = {
|
|
|
5714
6187
|
};
|
|
5715
6188
|
|
|
5716
6189
|
// src/contracts/token-auth.ts
|
|
5717
|
-
var
|
|
6190
|
+
var import_zod_openapi65 = require("@hono/zod-openapi");
|
|
5718
6191
|
|
|
5719
6192
|
// src/schemas/auth.ts
|
|
5720
|
-
var
|
|
5721
|
-
var TokenAuthLoginRequestSchema =
|
|
5722
|
-
email:
|
|
5723
|
-
password:
|
|
5724
|
-
});
|
|
5725
|
-
var TokenAuthResponseSchema =
|
|
5726
|
-
accessToken:
|
|
5727
|
-
refreshToken:
|
|
5728
|
-
expiresIn:
|
|
6193
|
+
var import_zod_openapi64 = require("@hono/zod-openapi");
|
|
6194
|
+
var TokenAuthLoginRequestSchema = import_zod_openapi64.z.object({
|
|
6195
|
+
email: import_zod_openapi64.z.string().email(),
|
|
6196
|
+
password: import_zod_openapi64.z.string().min(6)
|
|
6197
|
+
});
|
|
6198
|
+
var TokenAuthResponseSchema = import_zod_openapi64.z.object({
|
|
6199
|
+
accessToken: import_zod_openapi64.z.string(),
|
|
6200
|
+
refreshToken: import_zod_openapi64.z.string(),
|
|
6201
|
+
expiresIn: import_zod_openapi64.z.number(),
|
|
5729
6202
|
// seconds until expiration
|
|
5730
|
-
user:
|
|
5731
|
-
id:
|
|
5732
|
-
username:
|
|
5733
|
-
email:
|
|
5734
|
-
name:
|
|
5735
|
-
image:
|
|
5736
|
-
admin:
|
|
6203
|
+
user: import_zod_openapi64.z.object({
|
|
6204
|
+
id: import_zod_openapi64.z.string(),
|
|
6205
|
+
username: import_zod_openapi64.z.string(),
|
|
6206
|
+
email: import_zod_openapi64.z.string().email(),
|
|
6207
|
+
name: import_zod_openapi64.z.string(),
|
|
6208
|
+
image: import_zod_openapi64.z.string().optional(),
|
|
6209
|
+
admin: import_zod_openapi64.z.boolean().optional()
|
|
5737
6210
|
})
|
|
5738
6211
|
});
|
|
5739
|
-
var RefreshTokenRequestSchema =
|
|
5740
|
-
refreshToken:
|
|
6212
|
+
var RefreshTokenRequestSchema = import_zod_openapi64.z.object({
|
|
6213
|
+
refreshToken: import_zod_openapi64.z.string()
|
|
5741
6214
|
});
|
|
5742
|
-
var TokenAuthRegisterRequestSchema =
|
|
5743
|
-
username:
|
|
5744
|
-
name:
|
|
5745
|
-
email:
|
|
5746
|
-
password:
|
|
6215
|
+
var TokenAuthRegisterRequestSchema = import_zod_openapi64.z.object({
|
|
6216
|
+
username: UsernameSchema,
|
|
6217
|
+
name: import_zod_openapi64.z.string(),
|
|
6218
|
+
email: import_zod_openapi64.z.string().email(),
|
|
6219
|
+
password: import_zod_openapi64.z.string().min(6)
|
|
5747
6220
|
});
|
|
5748
|
-
var RegisterPendingResponseSchema =
|
|
5749
|
-
status:
|
|
6221
|
+
var RegisterPendingResponseSchema = import_zod_openapi64.z.object({
|
|
6222
|
+
status: import_zod_openapi64.z.enum(["confirmation_required", "approval_required"])
|
|
5750
6223
|
});
|
|
5751
6224
|
|
|
5752
6225
|
// src/contracts/token-auth.ts
|
|
5753
|
-
var TokenLogoutResponseSchema =
|
|
5754
|
-
var TokenMeResponseSchema =
|
|
5755
|
-
user:
|
|
5756
|
-
id:
|
|
5757
|
-
username:
|
|
5758
|
-
email:
|
|
5759
|
-
name:
|
|
5760
|
-
image:
|
|
5761
|
-
status:
|
|
5762
|
-
admin:
|
|
5763
|
-
createdAt:
|
|
6226
|
+
var TokenLogoutResponseSchema = import_zod_openapi65.z.object({ message: import_zod_openapi65.z.string() });
|
|
6227
|
+
var TokenMeResponseSchema = import_zod_openapi65.z.object({
|
|
6228
|
+
user: import_zod_openapi65.z.object({
|
|
6229
|
+
id: import_zod_openapi65.z.string(),
|
|
6230
|
+
username: import_zod_openapi65.z.string(),
|
|
6231
|
+
email: import_zod_openapi65.z.string().email(),
|
|
6232
|
+
name: import_zod_openapi65.z.string(),
|
|
6233
|
+
image: import_zod_openapi65.z.string().optional(),
|
|
6234
|
+
status: import_zod_openapi65.z.number(),
|
|
6235
|
+
admin: import_zod_openapi65.z.boolean().optional(),
|
|
6236
|
+
createdAt: import_zod_openapi65.z.string()
|
|
5764
6237
|
})
|
|
5765
6238
|
});
|
|
5766
|
-
var tokenLoginRoute = (0,
|
|
6239
|
+
var tokenLoginRoute = (0, import_zod_openapi65.createRoute)({
|
|
5767
6240
|
method: "post",
|
|
5768
6241
|
path: "/auth/login",
|
|
5769
6242
|
tags: ["tokenAuth"],
|
|
@@ -5800,7 +6273,7 @@ var tokenLoginRoute = (0, import_zod_openapi63.createRoute)({
|
|
|
5800
6273
|
}
|
|
5801
6274
|
}
|
|
5802
6275
|
});
|
|
5803
|
-
var tokenRegisterRoute = (0,
|
|
6276
|
+
var tokenRegisterRoute = (0, import_zod_openapi65.createRoute)({
|
|
5804
6277
|
method: "post",
|
|
5805
6278
|
path: "/auth/register",
|
|
5806
6279
|
tags: ["tokenAuth"],
|
|
@@ -5841,7 +6314,7 @@ var tokenRegisterRoute = (0, import_zod_openapi63.createRoute)({
|
|
|
5841
6314
|
}
|
|
5842
6315
|
}
|
|
5843
6316
|
});
|
|
5844
|
-
var tokenRefreshRoute = (0,
|
|
6317
|
+
var tokenRefreshRoute = (0, import_zod_openapi65.createRoute)({
|
|
5845
6318
|
method: "post",
|
|
5846
6319
|
path: "/auth/refresh",
|
|
5847
6320
|
tags: ["tokenAuth"],
|
|
@@ -5878,7 +6351,7 @@ var tokenRefreshRoute = (0, import_zod_openapi63.createRoute)({
|
|
|
5878
6351
|
}
|
|
5879
6352
|
}
|
|
5880
6353
|
});
|
|
5881
|
-
var tokenLogoutRoute = (0,
|
|
6354
|
+
var tokenLogoutRoute = (0, import_zod_openapi65.createRoute)({
|
|
5882
6355
|
method: "post",
|
|
5883
6356
|
path: "/auth/logout",
|
|
5884
6357
|
tags: ["tokenAuth"],
|
|
@@ -5888,7 +6361,7 @@ var tokenLogoutRoute = (0, import_zod_openapi63.createRoute)({
|
|
|
5888
6361
|
body: {
|
|
5889
6362
|
content: {
|
|
5890
6363
|
"application/json": {
|
|
5891
|
-
schema:
|
|
6364
|
+
schema: import_zod_openapi65.z.object({ refreshToken: import_zod_openapi65.z.string().optional() })
|
|
5892
6365
|
}
|
|
5893
6366
|
}
|
|
5894
6367
|
}
|
|
@@ -5908,7 +6381,7 @@ var tokenLogoutRoute = (0, import_zod_openapi63.createRoute)({
|
|
|
5908
6381
|
}
|
|
5909
6382
|
}
|
|
5910
6383
|
});
|
|
5911
|
-
var tokenMeRoute = (0,
|
|
6384
|
+
var tokenMeRoute = (0, import_zod_openapi65.createRoute)({
|
|
5912
6385
|
method: "get",
|
|
5913
6386
|
path: "/auth/me",
|
|
5914
6387
|
tags: ["tokenAuth"],
|
|
@@ -5938,22 +6411,22 @@ var tokenAuthRoutes = {
|
|
|
5938
6411
|
};
|
|
5939
6412
|
|
|
5940
6413
|
// src/contracts/invite-accept.ts
|
|
5941
|
-
var
|
|
6414
|
+
var import_zod_openapi67 = require("@hono/zod-openapi");
|
|
5942
6415
|
|
|
5943
6416
|
// src/schemas/invite-accept.ts
|
|
5944
|
-
var
|
|
5945
|
-
var InviteAcceptRequestSchema =
|
|
5946
|
-
token:
|
|
5947
|
-
username:
|
|
5948
|
-
name:
|
|
5949
|
-
password:
|
|
6417
|
+
var import_zod_openapi66 = require("@hono/zod-openapi");
|
|
6418
|
+
var InviteAcceptRequestSchema = import_zod_openapi66.z.object({
|
|
6419
|
+
token: import_zod_openapi66.z.string(),
|
|
6420
|
+
username: UsernameSchema,
|
|
6421
|
+
name: import_zod_openapi66.z.string().min(1),
|
|
6422
|
+
password: import_zod_openapi66.z.string().min(6)
|
|
5950
6423
|
});
|
|
5951
|
-
var InvitePreviewResponseSchema =
|
|
5952
|
-
email:
|
|
6424
|
+
var InvitePreviewResponseSchema = import_zod_openapi66.z.object({
|
|
6425
|
+
email: import_zod_openapi66.z.string().email()
|
|
5953
6426
|
});
|
|
5954
6427
|
|
|
5955
6428
|
// src/contracts/invite-accept.ts
|
|
5956
|
-
var invitePreviewRoute = (0,
|
|
6429
|
+
var invitePreviewRoute = (0, import_zod_openapi67.createRoute)({
|
|
5957
6430
|
method: "get",
|
|
5958
6431
|
path: "/invite/accept",
|
|
5959
6432
|
tags: ["inviteAccept"],
|
|
@@ -5980,7 +6453,7 @@ var invitePreviewRoute = (0, import_zod_openapi65.createRoute)({
|
|
|
5980
6453
|
}
|
|
5981
6454
|
}
|
|
5982
6455
|
});
|
|
5983
|
-
var acceptInviteRoute = (0,
|
|
6456
|
+
var acceptInviteRoute = (0, import_zod_openapi67.createRoute)({
|
|
5984
6457
|
method: "post",
|
|
5985
6458
|
path: "/invite/accept",
|
|
5986
6459
|
tags: ["inviteAccept"],
|
|
@@ -6023,23 +6496,23 @@ var inviteAcceptRoutes = {
|
|
|
6023
6496
|
};
|
|
6024
6497
|
|
|
6025
6498
|
// src/contracts/password-reset.ts
|
|
6026
|
-
var
|
|
6499
|
+
var import_zod_openapi69 = require("@hono/zod-openapi");
|
|
6027
6500
|
|
|
6028
6501
|
// src/schemas/password-reset.ts
|
|
6029
|
-
var
|
|
6030
|
-
var ForgotPasswordRequestSchema =
|
|
6031
|
-
email:
|
|
6502
|
+
var import_zod_openapi68 = require("@hono/zod-openapi");
|
|
6503
|
+
var ForgotPasswordRequestSchema = import_zod_openapi68.z.object({
|
|
6504
|
+
email: import_zod_openapi68.z.string().email()
|
|
6032
6505
|
});
|
|
6033
|
-
var ForgotPasswordResponseSchema =
|
|
6034
|
-
ok:
|
|
6506
|
+
var ForgotPasswordResponseSchema = import_zod_openapi68.z.object({
|
|
6507
|
+
ok: import_zod_openapi68.z.literal(true)
|
|
6035
6508
|
});
|
|
6036
|
-
var ResetPasswordRequestSchema =
|
|
6037
|
-
token:
|
|
6038
|
-
password:
|
|
6509
|
+
var ResetPasswordRequestSchema = import_zod_openapi68.z.object({
|
|
6510
|
+
token: import_zod_openapi68.z.string(),
|
|
6511
|
+
password: import_zod_openapi68.z.string().min(6)
|
|
6039
6512
|
});
|
|
6040
6513
|
|
|
6041
6514
|
// src/contracts/password-reset.ts
|
|
6042
|
-
var forgotPasswordRoute = (0,
|
|
6515
|
+
var forgotPasswordRoute = (0, import_zod_openapi69.createRoute)({
|
|
6043
6516
|
method: "post",
|
|
6044
6517
|
path: "/auth/forgot-password",
|
|
6045
6518
|
tags: ["passwordReset"],
|
|
@@ -6064,7 +6537,7 @@ var forgotPasswordRoute = (0, import_zod_openapi67.createRoute)({
|
|
|
6064
6537
|
}
|
|
6065
6538
|
}
|
|
6066
6539
|
});
|
|
6067
|
-
var validateResetTokenRoute = (0,
|
|
6540
|
+
var validateResetTokenRoute = (0, import_zod_openapi69.createRoute)({
|
|
6068
6541
|
method: "get",
|
|
6069
6542
|
path: "/auth/reset-password",
|
|
6070
6543
|
tags: ["passwordReset"],
|
|
@@ -6087,7 +6560,7 @@ var validateResetTokenRoute = (0, import_zod_openapi67.createRoute)({
|
|
|
6087
6560
|
}
|
|
6088
6561
|
}
|
|
6089
6562
|
});
|
|
6090
|
-
var selfResetPasswordRoute = (0,
|
|
6563
|
+
var selfResetPasswordRoute = (0, import_zod_openapi69.createRoute)({
|
|
6091
6564
|
method: "post",
|
|
6092
6565
|
path: "/auth/reset-password",
|
|
6093
6566
|
tags: ["passwordReset"],
|
|
@@ -6127,19 +6600,19 @@ var passwordResetRoutes = {
|
|
|
6127
6600
|
};
|
|
6128
6601
|
|
|
6129
6602
|
// src/contracts/activation.ts
|
|
6130
|
-
var
|
|
6603
|
+
var import_zod_openapi71 = require("@hono/zod-openapi");
|
|
6131
6604
|
|
|
6132
6605
|
// src/schemas/activation.ts
|
|
6133
|
-
var
|
|
6134
|
-
var ActivateRequestSchema =
|
|
6135
|
-
token:
|
|
6606
|
+
var import_zod_openapi70 = require("@hono/zod-openapi");
|
|
6607
|
+
var ActivateRequestSchema = import_zod_openapi70.z.object({
|
|
6608
|
+
token: import_zod_openapi70.z.string()
|
|
6136
6609
|
});
|
|
6137
|
-
var ActivateValidationResponseSchema =
|
|
6138
|
-
ok:
|
|
6610
|
+
var ActivateValidationResponseSchema = import_zod_openapi70.z.object({
|
|
6611
|
+
ok: import_zod_openapi70.z.literal(true)
|
|
6139
6612
|
});
|
|
6140
6613
|
|
|
6141
6614
|
// src/contracts/activation.ts
|
|
6142
|
-
var validateActivationTokenRoute = (0,
|
|
6615
|
+
var validateActivationTokenRoute = (0, import_zod_openapi71.createRoute)({
|
|
6143
6616
|
method: "get",
|
|
6144
6617
|
path: "/auth/activate",
|
|
6145
6618
|
tags: ["activation"],
|
|
@@ -6162,7 +6635,7 @@ var validateActivationTokenRoute = (0, import_zod_openapi69.createRoute)({
|
|
|
6162
6635
|
}
|
|
6163
6636
|
}
|
|
6164
6637
|
});
|
|
6165
|
-
var activateAccountRoute = (0,
|
|
6638
|
+
var activateAccountRoute = (0, import_zod_openapi71.createRoute)({
|
|
6166
6639
|
method: "post",
|
|
6167
6640
|
path: "/auth/activate",
|
|
6168
6641
|
tags: ["activation"],
|
|
@@ -6197,21 +6670,21 @@ var activationRoutes = {
|
|
|
6197
6670
|
};
|
|
6198
6671
|
|
|
6199
6672
|
// src/contracts/email-change.ts
|
|
6200
|
-
var
|
|
6673
|
+
var import_zod_openapi73 = require("@hono/zod-openapi");
|
|
6201
6674
|
|
|
6202
6675
|
// src/schemas/email-change.ts
|
|
6203
|
-
var
|
|
6204
|
-
var ConfirmEmailChangeRequestSchema =
|
|
6205
|
-
token:
|
|
6676
|
+
var import_zod_openapi72 = require("@hono/zod-openapi");
|
|
6677
|
+
var ConfirmEmailChangeRequestSchema = import_zod_openapi72.z.object({
|
|
6678
|
+
token: import_zod_openapi72.z.string()
|
|
6206
6679
|
});
|
|
6207
|
-
var ConfirmEmailChangeResponseSchema =
|
|
6208
|
-
ok:
|
|
6680
|
+
var ConfirmEmailChangeResponseSchema = import_zod_openapi72.z.object({
|
|
6681
|
+
ok: import_zod_openapi72.z.literal(true),
|
|
6209
6682
|
/** The newly-confirmed email address. */
|
|
6210
|
-
email:
|
|
6683
|
+
email: import_zod_openapi72.z.string().email()
|
|
6211
6684
|
});
|
|
6212
6685
|
|
|
6213
6686
|
// src/contracts/email-change.ts
|
|
6214
|
-
var validateEmailChangeTokenRoute = (0,
|
|
6687
|
+
var validateEmailChangeTokenRoute = (0, import_zod_openapi73.createRoute)({
|
|
6215
6688
|
method: "get",
|
|
6216
6689
|
path: "/auth/confirm-email-change",
|
|
6217
6690
|
tags: ["emailChange"],
|
|
@@ -6234,7 +6707,7 @@ var validateEmailChangeTokenRoute = (0, import_zod_openapi71.createRoute)({
|
|
|
6234
6707
|
}
|
|
6235
6708
|
}
|
|
6236
6709
|
});
|
|
6237
|
-
var confirmEmailChangeRoute = (0,
|
|
6710
|
+
var confirmEmailChangeRoute = (0, import_zod_openapi73.createRoute)({
|
|
6238
6711
|
method: "post",
|
|
6239
6712
|
path: "/auth/confirm-email-change",
|
|
6240
6713
|
tags: ["emailChange"],
|
|
@@ -6273,9 +6746,9 @@ var emailChangeRoutes = {
|
|
|
6273
6746
|
};
|
|
6274
6747
|
|
|
6275
6748
|
// src/contracts/user.ts
|
|
6276
|
-
var
|
|
6277
|
-
var UsernameParamSchema =
|
|
6278
|
-
var getUserPageRoute = (0,
|
|
6749
|
+
var import_zod_openapi74 = require("@hono/zod-openapi");
|
|
6750
|
+
var UsernameParamSchema = import_zod_openapi74.z.object({ username: import_zod_openapi74.z.string() });
|
|
6751
|
+
var getUserPageRoute = (0, import_zod_openapi74.createRoute)({
|
|
6279
6752
|
method: "get",
|
|
6280
6753
|
path: "/user/{username}",
|
|
6281
6754
|
tags: ["user"],
|
|
@@ -6286,7 +6759,7 @@ var getUserPageRoute = (0, import_zod_openapi72.createRoute)({
|
|
|
6286
6759
|
},
|
|
6287
6760
|
responses: {
|
|
6288
6761
|
200: {
|
|
6289
|
-
description: "User profile with statistics + recent activity",
|
|
6762
|
+
description: "User profile with statistics (createdPagesCount, bookmarksCount, likesCount, commentsCount \u2014 the last two are the target user's OWN likes/comments, not activity their pages received) + recent activity",
|
|
6290
6763
|
content: { "application/json": { schema: UserPageResponseSchema } }
|
|
6291
6764
|
},
|
|
6292
6765
|
401: {
|
|
@@ -6303,7 +6776,7 @@ var getUserPageRoute = (0, import_zod_openapi72.createRoute)({
|
|
|
6303
6776
|
}
|
|
6304
6777
|
}
|
|
6305
6778
|
});
|
|
6306
|
-
var getUserBookmarksRoute = (0,
|
|
6779
|
+
var getUserBookmarksRoute = (0, import_zod_openapi74.createRoute)({
|
|
6307
6780
|
method: "get",
|
|
6308
6781
|
path: "/user/{username}/bookmarks",
|
|
6309
6782
|
tags: ["user"],
|
|
@@ -6332,7 +6805,7 @@ var getUserBookmarksRoute = (0, import_zod_openapi72.createRoute)({
|
|
|
6332
6805
|
}
|
|
6333
6806
|
}
|
|
6334
6807
|
});
|
|
6335
|
-
var getUserPagesRoute = (0,
|
|
6808
|
+
var getUserPagesRoute = (0, import_zod_openapi74.createRoute)({
|
|
6336
6809
|
method: "get",
|
|
6337
6810
|
path: "/user/{username}/pages",
|
|
6338
6811
|
tags: ["user"],
|
|
@@ -6361,7 +6834,7 @@ var getUserPagesRoute = (0, import_zod_openapi72.createRoute)({
|
|
|
6361
6834
|
}
|
|
6362
6835
|
}
|
|
6363
6836
|
});
|
|
6364
|
-
var getUserSubpagesRoute = (0,
|
|
6837
|
+
var getUserSubpagesRoute = (0, import_zod_openapi74.createRoute)({
|
|
6365
6838
|
method: "get",
|
|
6366
6839
|
path: "/user/{username}/subpages",
|
|
6367
6840
|
tags: ["user"],
|
|
@@ -6398,7 +6871,7 @@ var getUserSubpagesRoute = (0, import_zod_openapi72.createRoute)({
|
|
|
6398
6871
|
}
|
|
6399
6872
|
}
|
|
6400
6873
|
});
|
|
6401
|
-
var listMembersRoute = (0,
|
|
6874
|
+
var listMembersRoute = (0, import_zod_openapi74.createRoute)({
|
|
6402
6875
|
method: "get",
|
|
6403
6876
|
path: "/users",
|
|
6404
6877
|
tags: ["user"],
|
|
@@ -6509,7 +6982,9 @@ var stubUserPublic = {
|
|
|
6509
6982
|
var stubUserPage = {
|
|
6510
6983
|
user: stubUserPublic,
|
|
6511
6984
|
createdPagesCount: 0,
|
|
6512
|
-
bookmarksCount: 0
|
|
6985
|
+
bookmarksCount: 0,
|
|
6986
|
+
likesCount: 0,
|
|
6987
|
+
commentsCount: 0
|
|
6513
6988
|
};
|
|
6514
6989
|
var stubPager = { prev: null, next: null, offset: 0 };
|
|
6515
6990
|
var stubUserBookmarks = {
|
|
@@ -6596,11 +7071,11 @@ var stubPageWithRevision = {
|
|
|
6596
7071
|
}
|
|
6597
7072
|
};
|
|
6598
7073
|
var stubPageResponse = { page: stubPage };
|
|
6599
|
-
var stubListPages = { pages: [], pager: stubPager, portalPage: null };
|
|
7074
|
+
var stubListPages = { pages: [], pager: stubPager, portalPage: null, total: 0 };
|
|
6600
7075
|
var stubListPageChildren = { children: [] };
|
|
6601
7076
|
var stubSeenUsers = { seenUsers: [], seenUsersCount: 0 };
|
|
6602
7077
|
var stubWatchStatus = { watching: false };
|
|
6603
|
-
var stubPreview = {
|
|
7078
|
+
var stubPreview = {};
|
|
6604
7079
|
var stubWsToken = {
|
|
6605
7080
|
wsToken: "",
|
|
6606
7081
|
pageId: "",
|
|
@@ -6690,8 +7165,9 @@ var stubPendingUsersCount = { count: 0 };
|
|
|
6690
7165
|
var stubListPlugins = { plugins: [] };
|
|
6691
7166
|
var stubPluginConfig = { name: "", fields: [], values: {} };
|
|
6692
7167
|
var stubUpdatePluginConfig = { ok: true, hotReloaded: false, reconfigureFailed: false };
|
|
7168
|
+
var stubPluginReadiness = { issues: [] };
|
|
6693
7169
|
var stubClearRenderCache = { ok: true, clearedAt: "", removedCount: 0 };
|
|
6694
|
-
var appAuthMeUserChain = new
|
|
7170
|
+
var appAuthMeUserChain = new import_zod_openapi75.OpenAPIHono().openapi(
|
|
6695
7171
|
appRoutes.getAppInfoRoute,
|
|
6696
7172
|
(c) => c.json(
|
|
6697
7173
|
{
|
|
@@ -6725,31 +7201,31 @@ var appAuthMeUserChain = new import_zod_openapi73.OpenAPIHono().openapi(
|
|
|
6725
7201
|
meRoutes.updatePasswordRoute,
|
|
6726
7202
|
(c) => c.json({ status: "ok", message: "", accessToken: "", refreshToken: "", expiresIn: 0 }, 200)
|
|
6727
7203
|
).openapi(meRoutes.recentlyViewedPagesRoute, (c) => c.json({ pages: [] }, 200)).openapi(accessTokenRoutes.listAccessTokensRoute, (c) => c.json({ accessTokens: [] }, 200)).openapi(accessTokenRoutes.createAccessTokenRoute, (c) => c.json(stubCreateAccessToken, 201)).openapi(accessTokenRoutes.deleteAccessTokenRoute, (c) => c.json(stubAccessToken, 200)).openapi(userRoutes.getUserPageRoute, (c) => c.json(stubUserPage, 200)).openapi(userRoutes.getUserBookmarksRoute, (c) => c.json(stubUserBookmarks, 200)).openapi(userRoutes.getUserPagesRoute, (c) => c.json(stubUserPages, 200)).openapi(userRoutes.getUserSubpagesRoute, (c) => c.json(stubUserPages, 200)).openapi(userRoutes.listMembersRoute, (c) => c.json(stubListUsers, 200));
|
|
6728
|
-
var bookmarkBacklinkCommentRevisionChain = new
|
|
6729
|
-
var pageChain = new
|
|
6730
|
-
var lateContractApp = new
|
|
6731
|
-
var adminSettingsContractApp = new
|
|
6732
|
-
var adminUsersPluginsContractApp = new
|
|
6733
|
-
var oauthContractApp = new
|
|
7204
|
+
var bookmarkBacklinkCommentRevisionChain = new import_zod_openapi75.OpenAPIHono().openapi(bookmarkRoutes.getBookmarkRoute, (c) => c.json(stubBookmarkResponse, 200)).openapi(bookmarkRoutes.listMyBookmarksRoute, (c) => c.json(stubListMyBookmarks, 200)).openapi(bookmarkRoutes.addBookmarkRoute, (c) => c.json(stubBookmarkResponse, 200)).openapi(bookmarkRoutes.removeBookmarkRoute, (c) => c.json(stubRemoveBookmark, 200)).openapi(backlinkRoutes.getBacklinksRoute, (c) => c.json(stubBacklinks, 200)).openapi(commentRoutes.listCommentsRoute, (c) => c.json(stubListComments, 200)).openapi(commentRoutes.addCommentRoute, (c) => c.json(stubAddComment, 200)).openapi(commentRoutes.deleteCommentRoute, (c) => c.json(stubDeleteComment, 200)).openapi(revisionRoutes.listRevisionsRoute, (c) => c.json(stubListRevisions, 200)).openapi(revisionRoutes.getRevisionsRoute, (c) => c.json(stubGetRevisions, 200)).openapi(revisionRoutes.getRevisionRoute, (c) => c.json(stubGetRevision, 200));
|
|
7205
|
+
var pageChain = new import_zod_openapi75.OpenAPIHono().openapi(pageRoutes.getPageRoute, (c) => c.json(stubPageWithRevision, 200)).openapi(pageRoutes.listPagesRoute, (c) => c.json(stubListPages, 200)).openapi(pageRoutes.listPageChildrenRoute, (c) => c.json(stubListPageChildren, 200)).openapi(pageRoutes.createPageRoute, (c) => c.json(stubPageResponse, 200)).openapi(pageRoutes.updatePageRoute, (c) => c.json(stubPageResponse, 200)).openapi(pageRoutes.setPageGrantRoute, (c) => c.json(stubPageResponse, 200)).openapi(pageRoutes.seenPageRoute, (c) => c.json(stubSeenUsers, 200)).openapi(pageRoutes.getSeenUsersRoute, (c) => c.json(stubSeenUsers, 200)).openapi(pageRoutes.likePageRoute, (c) => c.json(stubPageResponse, 200)).openapi(pageRoutes.unlikePageRoute, (c) => c.json(stubPageResponse, 200)).openapi(pageRoutes.claimPageLinkAccessRoute, (c) => c.json({ ...stubPageWithRevision, granted: false }, 200)).openapi(pageRoutes.getWatchStatusRoute, (c) => c.json(stubWatchStatus, 200)).openapi(pageRoutes.setWatchStatusRoute, (c) => c.json(stubWatchStatus, 200)).openapi(pageRoutes.deletePageRoute, (c) => c.json(stubPageResponse, 200)).openapi(pageRoutes.revertDeletedPageRoute, (c) => c.json(stubPageResponse, 200)).openapi(pageRoutes.revertToRevisionRoute, (c) => c.json(stubPageResponse, 200)).openapi(pageRoutes.renamePageRoute, (c) => c.json({ ...stubPageResponse, renamed_count: 1 }, 200)).openapi(pageRoutes.renameSubtreeRoute, (c) => c.json({ renamed_count: 0 }, 200)).openapi(pagePreviewRoutes.previewPageRoute, (c) => c.json(stubPreview, 200)).openapi(pageCollabRoutes.getYjsTokenRoute, (c) => c.json(stubWsToken, 200)).openapi(presenceRoutes.getPresenceTokenRoute, (c) => c.json(stubPresenceToken, 200)).openapi(presenceRoutes.getLikersRoute, (c) => c.json(stubLikers, 200));
|
|
7206
|
+
var lateContractApp = new import_zod_openapi75.OpenAPIHono().openapi(draftRoutes.createDraftRoute, (c) => c.json(stubCreateDraft, 201)).openapi(draftRoutes.listDraftsRoute, (c) => c.json(stubListDrafts, 200)).openapi(draftRoutes.cancelDraftRoute, (c) => c.json(stubCreateDraft, 200)).openapi(autocompleteRoutes.autocompleteUsersRoute, (c) => c.json(stubAutocomplete, 200)).openapi(autocompleteRoutes.autocompletePagesRoute, (c) => c.json(stubAutocomplete, 200)).openapi(attachmentRoutes.getAttachmentUsageRoute, (c) => c.json(stubAttachmentUsage, 200)).openapi(attachmentRoutes.listAttachmentsRoute, (c) => c.json(stubListAttachments, 200)).openapi(attachmentRoutes.addAttachmentRoute, (c) => c.json(stubAddAttachment, 200)).openapi(attachmentRoutes.uploadAttachmentRoute, (c) => c.json(stubUploadAttachment, 200)).openapi(attachmentRoutes.getAttachmentMetaRoute, (c) => c.json(stubAttachmentMeta, 200)).openapi(attachmentRoutes.removeAttachmentRoute, (c) => c.json(stubRemoveAttachment, 200)).openapi(searchRoutes.searchPagesRoute, (c) => c.json(stubSearchPages, 200)).openapi(adminCryptoRoutes.getCryptoStatusRoute, (c) => c.json(stubCryptoStatus, 200)).openapi(adminCryptoRoutes.reencryptAllRoute, (c) => c.json(stubReencrypt, 200)).openapi(notificationRoutes.listNotificationsRoute, (c) => c.json(stubListNotifications, 200)).openapi(notificationRoutes.markAllAsReadRoute, (c) => c.json(stubMarkAllAsRead, 200)).openapi(notificationRoutes.getNotificationsTokenRoute, (c) => c.json(stubNotificationsToken, 200)).openapi(notificationRoutes.getUnreadCountRoute, (c) => c.json(stubNotificationStatus, 200)).openapi(notificationRoutes.openNotificationRoute, (c) => c.json(stubOpenNotification, 200));
|
|
7207
|
+
var adminSettingsContractApp = new import_zod_openapi75.OpenAPIHono().openapi(adminAppRoutes.getAppSettingsRoute, (c) => c.json(stubGetAppSettings, 200)).openapi(adminAppRoutes.updateAppSettingsRoute, (c) => c.json(stubUpdateAppSettings, 200)).openapi(adminAuthRoutes.getAuthSettingsRoute, (c) => c.json(stubAuthSettings, 200)).openapi(adminAuthRoutes.updateAuthSettingsRoute, (c) => c.json(stubAuthSettings, 200)).openapi(adminSecurityRoutes.getSecuritySettingsRoute, (c) => c.json(stubSecuritySettings, 200)).openapi(adminSecurityRoutes.updateSecuritySettingsRoute, (c) => c.json(stubSecuritySettings, 200)).openapi(adminMailRoutes.getMailSettingsRoute, (c) => c.json(stubMailSettings, 200)).openapi(adminMailRoutes.updateMailSettingsRoute, (c) => c.json(stubUpdateMailSettings, 200)).openapi(adminMailRoutes.sendTestMailRoute, (c) => c.json(stubSendTestMail, 200)).openapi(adminStorageRoutes.getStorageStatusRoute, (c) => c.json(stubStorageStatus, 200)).openapi(adminSearchRoutes.getSearchStatusRoute, (c) => c.json(stubSearchStatus, 200));
|
|
7208
|
+
var adminUsersPluginsContractApp = new import_zod_openapi75.OpenAPIHono().openapi(adminUsersRoutes.listUsersRoute, (c) => c.json(stubListAdminUsers, 200)).openapi(adminUsersRoutes.searchUsersByEmailRoute, (c) => c.json(stubSearchAdminUsersByEmail, 200)).openapi(adminUsersRoutes.pendingUsersCountRoute, (c) => c.json(stubPendingUsersCount, 200)).openapi(adminUsersRoutes.inviteUsersRoute, (c) => c.json(stubInviteUsers, 200)).openapi(adminUsersRoutes.editUserRoute, (c) => c.json(stubAdminUserMutation, 200)).openapi(adminUsersRoutes.makeAdminRoute, (c) => c.json(stubAdminUserMutation, 200)).openapi(adminUsersRoutes.removeFromAdminRoute, (c) => c.json(stubAdminUserMutation, 200)).openapi(adminUsersRoutes.activateUserRoute, (c) => c.json(stubAdminUserMutation, 200)).openapi(adminUsersRoutes.suspendUserRoute, (c) => c.json(stubAdminUserMutation, 200)).openapi(adminUsersRoutes.resetPasswordRoute, (c) => c.json(stubResetPassword, 200)).openapi(adminUsersRoutes.resendInviteRoute, (c) => c.json(stubAdminUserMutation, 200)).openapi(adminUsersRoutes.updateUserEmailRoute, (c) => c.json(stubAdminUserMutation, 200)).openapi(adminUsersRoutes.deleteUserRoute, (c) => c.json(stubDeleteAdminUser, 200)).openapi(adminPluginsRoutes.listPluginsRoute, (c) => c.json(stubListPlugins, 200)).openapi(adminPluginsRoutes.getPluginConfigRoute, (c) => c.json(stubPluginConfig, 200)).openapi(adminPluginsRoutes.updatePluginConfigRoute, (c) => c.json(stubUpdatePluginConfig, 200)).openapi(adminPluginsRoutes.getPluginReadinessRoute, (c) => c.json(stubPluginReadiness, 200)).openapi(adminPluginsRoutes.clearRenderCacheAllRoute, (c) => c.json(stubClearRenderCache, 200)).openapi(adminPluginsRoutes.clearRenderCachePluginRoute, (c) => c.json(stubClearRenderCache, 200));
|
|
7209
|
+
var oauthContractApp = new import_zod_openapi75.OpenAPIHono().openapi(oauthRoutes.authorizeRoute, (c) => c.json(stubAuthorize, 200)).openapi(oauthRoutes.tokenRoute, (c) => c.json(stubToken, 200)).openapi(oauthRoutes.revokeRoute, (c) => c.json(stubRevoke, 200)).openapi(oauthRoutes.discoveryRoute, (c) => c.json(stubDiscovery, 200)).openapi(oauthRoutes.deviceAuthorizeRoute, (c) => c.json(stubDeviceAuthorize, 200)).openapi(oauthRoutes.deviceInfoRoute, (c) => c.json(stubDeviceInfo, 200)).openapi(oauthRoutes.deviceVerifyRoute, (c) => c.json(stubDeviceVerify, 200)).openapi(oauthRoutes.clientInfoRoute, (c) => c.json(stubClientInfo, 200));
|
|
6734
7210
|
var createClient = (baseUrl, options = {}) => (0, import_client.hc)(baseUrl, {
|
|
6735
7211
|
headers: options.headers,
|
|
6736
7212
|
fetch: options.fetch
|
|
6737
7213
|
});
|
|
6738
7214
|
|
|
6739
7215
|
// src/schemas/mail-token.ts
|
|
6740
|
-
var
|
|
6741
|
-
var MailTokenPurposeSchema =
|
|
6742
|
-
var MailTokenPayloadSchema =
|
|
7216
|
+
var import_zod_openapi76 = require("@hono/zod-openapi");
|
|
7217
|
+
var MailTokenPurposeSchema = import_zod_openapi76.z.enum(["invite", "activate", "reset", "email-change"]);
|
|
7218
|
+
var MailTokenPayloadSchema = import_zod_openapi76.z.object({
|
|
6743
7219
|
purpose: MailTokenPurposeSchema,
|
|
6744
|
-
userId:
|
|
7220
|
+
userId: import_zod_openapi76.z.string(),
|
|
6745
7221
|
/** Target address. For `email-change` this is the NEW address. */
|
|
6746
|
-
email:
|
|
7222
|
+
email: import_zod_openapi76.z.string().email(),
|
|
6747
7223
|
/**
|
|
6748
7224
|
* For `email-change`: the account's email at issue time. The confirm
|
|
6749
7225
|
* endpoint rejects the token unless it still matches, making the token
|
|
6750
7226
|
* single-use (a stale token cannot revert a later change).
|
|
6751
7227
|
*/
|
|
6752
|
-
fromEmail:
|
|
7228
|
+
fromEmail: import_zod_openapi76.z.string().email().optional(),
|
|
6753
7229
|
/**
|
|
6754
7230
|
* For `reset`: the account's `passwordResetGeneration` at issue time.
|
|
6755
7231
|
* Consuming the link increments that counter, so the token only matches
|
|
@@ -6758,7 +7234,7 @@ var MailTokenPayloadSchema = import_zod_openapi74.z.object({
|
|
|
6758
7234
|
* schema because the other purposes don't carry it (and links minted
|
|
6759
7235
|
* before the claim existed simply no longer match).
|
|
6760
7236
|
*/
|
|
6761
|
-
resetGeneration:
|
|
7237
|
+
resetGeneration: import_zod_openapi76.z.number().int().nonnegative().optional(),
|
|
6762
7238
|
/**
|
|
6763
7239
|
* For `email-change`: the account's `authVersion` at issue time. The
|
|
6764
7240
|
* confirm endpoint requires it to still match, so a pending address change
|
|
@@ -6770,10 +7246,22 @@ var MailTokenPayloadSchema = import_zod_openapi74.z.object({
|
|
|
6770
7246
|
* semantics wanted are exactly "the session that asked for this is gone",
|
|
6771
7247
|
* and that is what every bump of it already means.
|
|
6772
7248
|
*/
|
|
6773
|
-
authVersion:
|
|
7249
|
+
authVersion: import_zod_openapi76.z.number().int().nonnegative().optional(),
|
|
7250
|
+
/**
|
|
7251
|
+
* For `email-change`: the account's `emailChangeGeneration` at issue time.
|
|
7252
|
+
* Requesting a change increments it, so asking for a different address
|
|
7253
|
+
* supersedes any link still pending — which is what lets a user call off a
|
|
7254
|
+
* change they did not want (one an attacker started with a stolen session,
|
|
7255
|
+
* or one sent to a mistyped address). `authVersion` cannot serve this: it
|
|
7256
|
+
* means "the session that asked is gone", and bumping it on a mere request
|
|
7257
|
+
* would log the user out of their own account for editing their profile.
|
|
7258
|
+
* Optional in the schema for the same reason as the others — links minted
|
|
7259
|
+
* before the claim existed simply no longer match.
|
|
7260
|
+
*/
|
|
7261
|
+
emailChangeGeneration: import_zod_openapi76.z.number().int().nonnegative().optional(),
|
|
6774
7262
|
// iat / exp are injected and verified by the JWT layer.
|
|
6775
|
-
iat:
|
|
6776
|
-
exp:
|
|
7263
|
+
iat: import_zod_openapi76.z.number().optional(),
|
|
7264
|
+
exp: import_zod_openapi76.z.number().optional()
|
|
6777
7265
|
});
|
|
6778
7266
|
|
|
6779
7267
|
// src/util/html-elements.ts
|
|
@@ -6934,6 +7422,13 @@ var WS_CLOSE_CODES = {
|
|
|
6934
7422
|
ALL_CAPABILITIES,
|
|
6935
7423
|
ALL_SCOPES,
|
|
6936
7424
|
API_SURFACE_VERSION,
|
|
7425
|
+
AST_INPUT_LIMIT_BYTES,
|
|
7426
|
+
AST_MAX_HAST_DEPTH,
|
|
7427
|
+
AST_MAX_IMAGE_BASE64_CHARS,
|
|
7428
|
+
AST_MAX_TREE_DEPTH,
|
|
7429
|
+
AST_MAX_VALUE_CHARS,
|
|
7430
|
+
AST_OUTPUT_BUDGET_BYTES,
|
|
7431
|
+
AST_OUTPUT_WARN_BYTES,
|
|
6937
7432
|
AccessTokenSchema,
|
|
6938
7433
|
ActivateRequestSchema,
|
|
6939
7434
|
ActivateValidationResponseSchema,
|
|
@@ -6970,6 +7465,7 @@ var WS_CLOSE_CODES = {
|
|
|
6970
7465
|
BacklinkSchema,
|
|
6971
7466
|
BookmarkResponseSchema,
|
|
6972
7467
|
BookmarkSchema,
|
|
7468
|
+
CURRENT_AST_VERSION,
|
|
6973
7469
|
CapabilitySchema,
|
|
6974
7470
|
ClaimPageLinkAccessResponseSchema,
|
|
6975
7471
|
ClearRenderCacheResponseSchema,
|
|
@@ -6992,10 +7488,21 @@ var WS_CLOSE_CODES = {
|
|
|
6992
7488
|
CreateDraftRequestSchema,
|
|
6993
7489
|
CreateDraftResponseSchema,
|
|
6994
7490
|
CreatePageRequestSchema,
|
|
7491
|
+
CrowiCodeSidecarSchema,
|
|
7492
|
+
CrowiDiagramNodeSchema,
|
|
7493
|
+
CrowiDiagramSidecarSchema,
|
|
7494
|
+
CrowiDimensionSchema,
|
|
7495
|
+
CrowiImagePayloadSchema,
|
|
7496
|
+
CrowiLinkCardNodeSchema,
|
|
7497
|
+
CrowiLinkCardSidecarSchema,
|
|
7498
|
+
CrowiMathSidecarSchema,
|
|
7499
|
+
CrowiOpaqueNodeSchema,
|
|
7500
|
+
CrowiPlaceholderKindSchema,
|
|
7501
|
+
CrowiPlaceholderNodeSchema,
|
|
7502
|
+
CrowiPlaceholderSidecarSchema,
|
|
6995
7503
|
CryptoStatusResponseSchema,
|
|
6996
7504
|
DEVICE_CODE_GRANT_TYPE,
|
|
6997
7505
|
DISCOVERY_SCOPES_SUPPORTED,
|
|
6998
|
-
DND_EXTRA_UPLOAD_MIME,
|
|
6999
7506
|
DYNAMIC_CAPABILITIES,
|
|
7000
7507
|
DeleteAdminUserResponseSchema,
|
|
7001
7508
|
DeleteCommentRequestSchema,
|
|
@@ -7036,7 +7543,11 @@ var WS_CLOSE_CODES = {
|
|
|
7036
7543
|
GetSeenUsersRequestSchema,
|
|
7037
7544
|
GetStorageStatusResponseSchema,
|
|
7038
7545
|
GetWatchStatusRequestSchema,
|
|
7039
|
-
|
|
7546
|
+
HChildSchema,
|
|
7547
|
+
HChildrenSchema,
|
|
7548
|
+
HNameSchema,
|
|
7549
|
+
HPropertiesSchema,
|
|
7550
|
+
HastHintDataSchema,
|
|
7040
7551
|
ISSUABLE_SCOPES,
|
|
7041
7552
|
InstallerStatusResponseSchema,
|
|
7042
7553
|
InsufficientScopeErrorSchema,
|
|
@@ -7071,6 +7582,7 @@ var WS_CLOSE_CODES = {
|
|
|
7071
7582
|
ListRevisionsResponseSchema,
|
|
7072
7583
|
ListUsersRequestSchema,
|
|
7073
7584
|
ListUsersResponseSchema,
|
|
7585
|
+
LooseRenderedAstRootSchema,
|
|
7074
7586
|
MailSettingsValidationErrorSchema,
|
|
7075
7587
|
MailTokenPayloadSchema,
|
|
7076
7588
|
MailTokenPurposeSchema,
|
|
@@ -7122,6 +7634,9 @@ var WS_CLOSE_CODES = {
|
|
|
7122
7634
|
PluginFieldSchema,
|
|
7123
7635
|
PluginInfoSchema,
|
|
7124
7636
|
PluginNotFoundErrorSchema,
|
|
7637
|
+
PluginReadinessFieldSchema,
|
|
7638
|
+
PluginReadinessIssueSchema,
|
|
7639
|
+
PluginReadinessResponseSchema,
|
|
7125
7640
|
PresenceClientMessageSchema,
|
|
7126
7641
|
PresenceCommentChangedMessageSchema,
|
|
7127
7642
|
PresenceHeartbeatMessageSchema,
|
|
@@ -7134,6 +7649,7 @@ var WS_CLOSE_CODES = {
|
|
|
7134
7649
|
PreviewPageRequestSchema,
|
|
7135
7650
|
PreviewPageResponseSchema,
|
|
7136
7651
|
ProfileErrorResponseSchema,
|
|
7652
|
+
RENDERED_AST_NODE_DEFS,
|
|
7137
7653
|
RecentlyViewedPagesResponseSchema,
|
|
7138
7654
|
ReencryptResponseSchema,
|
|
7139
7655
|
RefreshTokenRequestSchema,
|
|
@@ -7147,6 +7663,13 @@ var WS_CLOSE_CODES = {
|
|
|
7147
7663
|
RenameSubtreeRequestSchema,
|
|
7148
7664
|
RenameSubtreeResponseSchema,
|
|
7149
7665
|
RenameTreeErrorSchema,
|
|
7666
|
+
RenderedAstArtifactKeySchema,
|
|
7667
|
+
RenderedAstEnvelopeOpenApiSchema,
|
|
7668
|
+
RenderedAstEnvelopeSchema,
|
|
7669
|
+
RenderedAstNodeSchema,
|
|
7670
|
+
RenderedAstRootSchema,
|
|
7671
|
+
RenderedAstValueSchema,
|
|
7672
|
+
ReservationSchema,
|
|
7150
7673
|
ResetPasswordRequestSchema,
|
|
7151
7674
|
ResetPasswordResponseSchema,
|
|
7152
7675
|
RevertToRevisionRequestSchema,
|
|
@@ -7158,6 +7681,7 @@ var WS_CLOSE_CODES = {
|
|
|
7158
7681
|
RevokeRequestSchema,
|
|
7159
7682
|
RevokeResponseSchema,
|
|
7160
7683
|
SCOPES,
|
|
7684
|
+
SIDECAR_KEYS,
|
|
7161
7685
|
STATIC_CAPABILITIES,
|
|
7162
7686
|
STRIP_KNOWN_HTML_TAGS_MAX_LENGTH,
|
|
7163
7687
|
SearchAdminUsersByEmailRequestSchema,
|
|
@@ -7177,6 +7701,9 @@ var WS_CLOSE_CODES = {
|
|
|
7177
7701
|
ServiceUnavailableErrorSchema,
|
|
7178
7702
|
SetPageGrantRequestSchema,
|
|
7179
7703
|
SetWatchStatusRequestSchema,
|
|
7704
|
+
ShikiTokenLinesSchema,
|
|
7705
|
+
ShikiTokenSchema,
|
|
7706
|
+
ShikiTokenStyleSchema,
|
|
7180
7707
|
StorageDriverEntrySchema,
|
|
7181
7708
|
SuccessResponseSchema,
|
|
7182
7709
|
ThemeSchema,
|
|
@@ -7189,6 +7716,7 @@ var WS_CLOSE_CODES = {
|
|
|
7189
7716
|
TokenAuthResponseSchema,
|
|
7190
7717
|
TokenRequestSchema,
|
|
7191
7718
|
TokenResponseSchema,
|
|
7719
|
+
UPLOAD_ALLOWED_MIME,
|
|
7192
7720
|
UpdateAdminUserEmailRequestSchema,
|
|
7193
7721
|
UpdateAppSettingsRequestSchema,
|
|
7194
7722
|
UpdateAppSettingsResponseSchema,
|
|
@@ -7220,6 +7748,7 @@ var WS_CLOSE_CODES = {
|
|
|
7220
7748
|
UserStatusErrorSchema,
|
|
7221
7749
|
UserStatusSchema,
|
|
7222
7750
|
UserSubpagesRequestSchema,
|
|
7751
|
+
UsernameSchema,
|
|
7223
7752
|
ValidationErrorSchema,
|
|
7224
7753
|
WS_CLOSE_CODES,
|
|
7225
7754
|
WatchStatusResponseSchema,
|
|
@@ -7290,6 +7819,7 @@ var WS_CLOSE_CODES = {
|
|
|
7290
7819
|
getNotificationsTokenRoute,
|
|
7291
7820
|
getPageRoute,
|
|
7292
7821
|
getPluginConfigRoute,
|
|
7822
|
+
getPluginReadinessRoute,
|
|
7293
7823
|
getPresenceTokenRoute,
|
|
7294
7824
|
getProfileRoute,
|
|
7295
7825
|
getRevisionRoute,
|
|
@@ -7370,6 +7900,7 @@ var WS_CLOSE_CODES = {
|
|
|
7370
7900
|
tokenRegisterRoute,
|
|
7371
7901
|
tokenRoute,
|
|
7372
7902
|
unlikePageRoute,
|
|
7903
|
+
unwrapRenderedAst,
|
|
7373
7904
|
updateAppSettingsRoute,
|
|
7374
7905
|
updateAuthSettingsRoute,
|
|
7375
7906
|
updateMailSettingsRoute,
|