@crowi/api 2.0.0-alpha.0 → 2.0.0-alpha.1

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.
Files changed (70) hide show
  1. package/dist/hono/handlers/access-token.d.ts +55 -55
  2. package/dist/hono/handlers/activation.d.ts +27 -27
  3. package/dist/hono/handlers/admin/app.d.ts +26 -26
  4. package/dist/hono/handlers/admin/auth.d.ts +24 -24
  5. package/dist/hono/handlers/admin/mail.d.ts +30 -30
  6. package/dist/hono/handlers/admin/plugins.d.ts +112 -112
  7. package/dist/hono/handlers/admin/search.d.ts +21 -21
  8. package/dist/hono/handlers/admin/security.d.ts +24 -24
  9. package/dist/hono/handlers/admin/storage.d.ts +19 -19
  10. package/dist/hono/handlers/admin/users.d.ts +305 -305
  11. package/dist/hono/handlers/adminCrypto.d.ts +32 -32
  12. package/dist/hono/handlers/app.d.ts +11 -8
  13. package/dist/hono/handlers/app.js +31 -1
  14. package/dist/hono/handlers/app.js.map +1 -1
  15. package/dist/hono/handlers/attachment.d.ts +180 -180
  16. package/dist/hono/handlers/autocomplete.d.ts +45 -45
  17. package/dist/hono/handlers/backlink.d.ts +33 -33
  18. package/dist/hono/handlers/bookmark.d.ts +95 -95
  19. package/dist/hono/handlers/comment.d.ts +55 -55
  20. package/dist/hono/handlers/draft.d.ts +27 -27
  21. package/dist/hono/handlers/emailChange.d.ts +25 -25
  22. package/dist/hono/handlers/installer.d.ts +16 -16
  23. package/dist/hono/handlers/inviteAccept.d.ts +37 -37
  24. package/dist/hono/handlers/me.d.ts +92 -92
  25. package/dist/hono/handlers/notification.d.ts +94 -94
  26. package/dist/hono/handlers/oauth.d.ts +58 -58
  27. package/dist/hono/handlers/page-collab.d.ts +20 -20
  28. package/dist/hono/handlers/page-preview.d.ts +7 -7
  29. package/dist/hono/handlers/page.d.ts +333 -333
  30. package/dist/hono/handlers/passwordReset.d.ts +37 -37
  31. package/dist/hono/handlers/presence.d.ts +44 -44
  32. package/dist/hono/handlers/revision.d.ts +99 -99
  33. package/dist/hono/handlers/search.d.ts +64 -64
  34. package/dist/hono/handlers/tokenAuth.d.ts +80 -80
  35. package/dist/hono/handlers/user.d.ts +102 -102
  36. package/dist/hono/handlers/user.js +15 -5
  37. package/dist/hono/handlers/user.js.map +1 -1
  38. package/dist/hono/index.d.ts +94 -94
  39. package/dist/mcp/result.d.ts +15 -0
  40. package/dist/mcp/result.js +20 -1
  41. package/dist/mcp/result.js.map +1 -1
  42. package/dist/mcp/tools/page.js +9 -4
  43. package/dist/mcp/tools/page.js.map +1 -1
  44. package/dist/migration/migrations/index.js +2 -0
  45. package/dist/migration/migrations/index.js.map +1 -1
  46. package/dist/migration/migrations/relocate-reserved-api-paths.d.ts +3 -0
  47. package/dist/migration/migrations/relocate-reserved-api-paths.js +135 -0
  48. package/dist/migration/migrations/relocate-reserved-api-paths.js.map +1 -0
  49. package/dist/models/page.js +9 -2
  50. package/dist/models/page.js.map +1 -1
  51. package/dist/util/replace-url.d.ts +85 -0
  52. package/dist/util/replace-url.js +251 -0
  53. package/dist/util/replace-url.js.map +1 -0
  54. package/package.json +6 -4
  55. package/public/images/file-not-found.png +0 -0
  56. package/views/mail/activation.mjml +9 -0
  57. package/views/mail/activation.text +13 -0
  58. package/views/mail/adminApprovalPending.mjml +7 -0
  59. package/views/mail/adminApprovalPending.text +11 -0
  60. package/views/mail/emailChange.mjml +9 -0
  61. package/views/mail/emailChange.text +13 -0
  62. package/views/mail/invite.mjml +9 -0
  63. package/views/mail/invite.text +13 -0
  64. package/views/mail/layout.mjml +36 -0
  65. package/views/mail/passwordChanged.mjml +4 -0
  66. package/views/mail/passwordChanged.text +9 -0
  67. package/views/mail/passwordReset.mjml +9 -0
  68. package/views/mail/passwordReset.text +13 -0
  69. package/views/mail/test.mjml +2 -0
  70. package/views/mail/test.text +7 -0
@@ -4,6 +4,63 @@ import type { CrowiHonoBindings } from '../app';
4
4
  export declare const registerAttachmentRoutes: <E extends OpenAPIHono<CrowiHonoBindings>>(app: E, crowi: Crowi) => OpenAPIHono<CrowiHonoBindings, {
5
5
  "/pages/:pageId/attachments/usage": {
6
6
  $get: {
7
+ input: {
8
+ param: {
9
+ pageId: string;
10
+ };
11
+ };
12
+ output: {
13
+ error: {
14
+ code: "INTERNAL_ERROR";
15
+ message: "Internal server error";
16
+ };
17
+ };
18
+ outputFormat: "json";
19
+ status: 500;
20
+ } | {
21
+ input: {
22
+ param: {
23
+ pageId: string;
24
+ };
25
+ };
26
+ output: {
27
+ error: {
28
+ code: "PAGE_NOT_FOUND" | "INVALID_PAGE_ID" | "FILE_MISSING" | "FILE_TOO_LARGE" | "DISALLOWED_MIME" | "INVALID_ATTACHMENT_ID" | "ATTACHMENT_NOT_FOUND" | "FORBIDDEN_FOR_DELETE" | "UPLOAD_FAILED" | "REMOVE_FAILED";
29
+ message: string;
30
+ };
31
+ };
32
+ outputFormat: "json";
33
+ status: 404;
34
+ } | {
35
+ input: {
36
+ param: {
37
+ pageId: string;
38
+ };
39
+ };
40
+ output: {
41
+ error: {
42
+ code: "PAGE_NOT_FOUND" | "INVALID_PAGE_ID" | "FILE_MISSING" | "FILE_TOO_LARGE" | "DISALLOWED_MIME" | "INVALID_ATTACHMENT_ID" | "ATTACHMENT_NOT_FOUND" | "FORBIDDEN_FOR_DELETE" | "UPLOAD_FAILED" | "REMOVE_FAILED";
43
+ message: string;
44
+ };
45
+ };
46
+ outputFormat: "json";
47
+ status: 400;
48
+ } | {
49
+ input: {
50
+ param: {
51
+ pageId: string;
52
+ };
53
+ };
54
+ output: {
55
+ error: {
56
+ code: "AUTHENTICATION_REQUIRED";
57
+ message: "Authentication is required";
58
+ redirectTo?: string | undefined;
59
+ };
60
+ };
61
+ outputFormat: "json";
62
+ status: 401;
63
+ } | {
7
64
  input: {
8
65
  param: {
9
66
  pageId: string;
@@ -80,7 +137,11 @@ export declare const registerAttachmentRoutes: <E extends OpenAPIHono<CrowiHonoB
80
137
  };
81
138
  outputFormat: "json";
82
139
  status: 200;
83
- } | {
140
+ };
141
+ };
142
+ } & {
143
+ "/pages/:pageId/attachments": {
144
+ $get: {
84
145
  input: {
85
146
  param: {
86
147
  pageId: string;
@@ -88,12 +149,12 @@ export declare const registerAttachmentRoutes: <E extends OpenAPIHono<CrowiHonoB
88
149
  };
89
150
  output: {
90
151
  error: {
91
- code: "INVALID_PAGE_ID" | "PAGE_NOT_FOUND" | "FILE_MISSING" | "FILE_TOO_LARGE" | "DISALLOWED_MIME" | "INVALID_ATTACHMENT_ID" | "ATTACHMENT_NOT_FOUND" | "FORBIDDEN_FOR_DELETE" | "UPLOAD_FAILED" | "REMOVE_FAILED";
92
- message: string;
152
+ code: "INTERNAL_ERROR";
153
+ message: "Internal server error";
93
154
  };
94
155
  };
95
156
  outputFormat: "json";
96
- status: 400;
157
+ status: 500;
97
158
  } | {
98
159
  input: {
99
160
  param: {
@@ -102,13 +163,12 @@ export declare const registerAttachmentRoutes: <E extends OpenAPIHono<CrowiHonoB
102
163
  };
103
164
  output: {
104
165
  error: {
105
- code: "AUTHENTICATION_REQUIRED";
106
- message: "Authentication is required";
107
- redirectTo?: string | undefined;
166
+ code: "PAGE_NOT_FOUND" | "INVALID_PAGE_ID" | "FILE_MISSING" | "FILE_TOO_LARGE" | "DISALLOWED_MIME" | "INVALID_ATTACHMENT_ID" | "ATTACHMENT_NOT_FOUND" | "FORBIDDEN_FOR_DELETE" | "UPLOAD_FAILED" | "REMOVE_FAILED";
167
+ message: string;
108
168
  };
109
169
  };
110
170
  outputFormat: "json";
111
- status: 401;
171
+ status: 404;
112
172
  } | {
113
173
  input: {
114
174
  param: {
@@ -117,12 +177,12 @@ export declare const registerAttachmentRoutes: <E extends OpenAPIHono<CrowiHonoB
117
177
  };
118
178
  output: {
119
179
  error: {
120
- code: "INVALID_PAGE_ID" | "PAGE_NOT_FOUND" | "FILE_MISSING" | "FILE_TOO_LARGE" | "DISALLOWED_MIME" | "INVALID_ATTACHMENT_ID" | "ATTACHMENT_NOT_FOUND" | "FORBIDDEN_FOR_DELETE" | "UPLOAD_FAILED" | "REMOVE_FAILED";
180
+ code: "PAGE_NOT_FOUND" | "INVALID_PAGE_ID" | "FILE_MISSING" | "FILE_TOO_LARGE" | "DISALLOWED_MIME" | "INVALID_ATTACHMENT_ID" | "ATTACHMENT_NOT_FOUND" | "FORBIDDEN_FOR_DELETE" | "UPLOAD_FAILED" | "REMOVE_FAILED";
121
181
  message: string;
122
182
  };
123
183
  };
124
184
  outputFormat: "json";
125
- status: 404;
185
+ status: 400;
126
186
  } | {
127
187
  input: {
128
188
  param: {
@@ -131,17 +191,14 @@ export declare const registerAttachmentRoutes: <E extends OpenAPIHono<CrowiHonoB
131
191
  };
132
192
  output: {
133
193
  error: {
134
- code: "INTERNAL_ERROR";
135
- message: "Internal server error";
194
+ code: "AUTHENTICATION_REQUIRED";
195
+ message: "Authentication is required";
196
+ redirectTo?: string | undefined;
136
197
  };
137
198
  };
138
199
  outputFormat: "json";
139
- status: 500;
140
- };
141
- };
142
- } & {
143
- "/pages/:pageId/attachments": {
144
- $get: {
200
+ status: 401;
201
+ } | {
145
202
  input: {
146
203
  param: {
147
204
  pageId: string;
@@ -175,68 +232,84 @@ export declare const registerAttachmentRoutes: <E extends OpenAPIHono<CrowiHonoB
175
232
  };
176
233
  outputFormat: "json";
177
234
  status: 200;
178
- } | {
235
+ };
236
+ };
237
+ } & {
238
+ "/pages/:pageId/attachments": {
239
+ $post: {
179
240
  input: {
180
241
  param: {
181
242
  pageId: string;
182
243
  };
244
+ } & {
245
+ form: {
246
+ file?: any;
247
+ };
183
248
  };
184
249
  output: {
185
250
  error: {
186
- code: "INVALID_PAGE_ID" | "PAGE_NOT_FOUND" | "FILE_MISSING" | "FILE_TOO_LARGE" | "DISALLOWED_MIME" | "INVALID_ATTACHMENT_ID" | "ATTACHMENT_NOT_FOUND" | "FORBIDDEN_FOR_DELETE" | "UPLOAD_FAILED" | "REMOVE_FAILED";
251
+ code: "PAGE_NOT_FOUND" | "INVALID_PAGE_ID" | "FILE_MISSING" | "FILE_TOO_LARGE" | "DISALLOWED_MIME" | "INVALID_ATTACHMENT_ID" | "ATTACHMENT_NOT_FOUND" | "FORBIDDEN_FOR_DELETE" | "UPLOAD_FAILED" | "REMOVE_FAILED";
187
252
  message: string;
188
253
  };
189
254
  };
190
255
  outputFormat: "json";
191
- status: 400;
256
+ status: 500;
192
257
  } | {
193
258
  input: {
194
259
  param: {
195
260
  pageId: string;
196
261
  };
262
+ } & {
263
+ form: {
264
+ file?: any;
265
+ };
197
266
  };
198
267
  output: {
199
268
  error: {
200
- code: "AUTHENTICATION_REQUIRED";
201
- message: "Authentication is required";
202
- redirectTo?: string | undefined;
269
+ code: "PAGE_NOT_FOUND" | "INVALID_PAGE_ID" | "FILE_MISSING" | "FILE_TOO_LARGE" | "DISALLOWED_MIME" | "INVALID_ATTACHMENT_ID" | "ATTACHMENT_NOT_FOUND" | "FORBIDDEN_FOR_DELETE" | "UPLOAD_FAILED" | "REMOVE_FAILED";
270
+ message: string;
203
271
  };
204
272
  };
205
273
  outputFormat: "json";
206
- status: 401;
274
+ status: 404;
207
275
  } | {
208
276
  input: {
209
277
  param: {
210
278
  pageId: string;
211
279
  };
280
+ } & {
281
+ form: {
282
+ file?: any;
283
+ };
212
284
  };
213
285
  output: {
214
286
  error: {
215
- code: "INVALID_PAGE_ID" | "PAGE_NOT_FOUND" | "FILE_MISSING" | "FILE_TOO_LARGE" | "DISALLOWED_MIME" | "INVALID_ATTACHMENT_ID" | "ATTACHMENT_NOT_FOUND" | "FORBIDDEN_FOR_DELETE" | "UPLOAD_FAILED" | "REMOVE_FAILED";
287
+ code: "PAGE_NOT_FOUND" | "INVALID_PAGE_ID" | "FILE_MISSING" | "FILE_TOO_LARGE" | "DISALLOWED_MIME" | "INVALID_ATTACHMENT_ID" | "ATTACHMENT_NOT_FOUND" | "FORBIDDEN_FOR_DELETE" | "UPLOAD_FAILED" | "REMOVE_FAILED";
216
288
  message: string;
217
289
  };
218
290
  };
219
291
  outputFormat: "json";
220
- status: 404;
292
+ status: 400;
221
293
  } | {
222
294
  input: {
223
295
  param: {
224
296
  pageId: string;
225
297
  };
298
+ } & {
299
+ form: {
300
+ file?: any;
301
+ };
226
302
  };
227
303
  output: {
228
304
  error: {
229
- code: "INTERNAL_ERROR";
230
- message: "Internal server error";
305
+ code: "AUTHENTICATION_REQUIRED";
306
+ message: "Authentication is required";
307
+ redirectTo?: string | undefined;
231
308
  };
232
309
  };
233
310
  outputFormat: "json";
234
- status: 500;
235
- };
236
- };
237
- } & {
238
- "/pages/:pageId/attachments": {
239
- $post: {
311
+ status: 401;
312
+ } | {
240
313
  input: {
241
314
  param: {
242
315
  pageId: string;
@@ -287,85 +360,12 @@ export declare const registerAttachmentRoutes: <E extends OpenAPIHono<CrowiHonoB
287
360
  };
288
361
  output: {
289
362
  error: {
290
- code: "INVALID_PAGE_ID" | "PAGE_NOT_FOUND" | "FILE_MISSING" | "FILE_TOO_LARGE" | "DISALLOWED_MIME" | "INVALID_ATTACHMENT_ID" | "ATTACHMENT_NOT_FOUND" | "FORBIDDEN_FOR_DELETE" | "UPLOAD_FAILED" | "REMOVE_FAILED";
291
- message: string;
292
- };
293
- };
294
- outputFormat: "json";
295
- status: 400;
296
- } | {
297
- input: {
298
- param: {
299
- pageId: string;
300
- };
301
- } & {
302
- form: {
303
- file?: any;
304
- };
305
- };
306
- output: {
307
- error: {
308
- code: "AUTHENTICATION_REQUIRED";
309
- message: "Authentication is required";
310
- redirectTo?: string | undefined;
311
- };
312
- };
313
- outputFormat: "json";
314
- status: 401;
315
- } | {
316
- input: {
317
- param: {
318
- pageId: string;
319
- };
320
- } & {
321
- form: {
322
- file?: any;
323
- };
324
- };
325
- output: {
326
- error: {
327
- code: "INVALID_PAGE_ID" | "PAGE_NOT_FOUND" | "FILE_MISSING" | "FILE_TOO_LARGE" | "DISALLOWED_MIME" | "INVALID_ATTACHMENT_ID" | "ATTACHMENT_NOT_FOUND" | "FORBIDDEN_FOR_DELETE" | "UPLOAD_FAILED" | "REMOVE_FAILED";
328
- message: string;
329
- };
330
- };
331
- outputFormat: "json";
332
- status: 404;
333
- } | {
334
- input: {
335
- param: {
336
- pageId: string;
337
- };
338
- } & {
339
- form: {
340
- file?: any;
341
- };
342
- };
343
- output: {
344
- error: {
345
- code: "INVALID_PAGE_ID" | "PAGE_NOT_FOUND" | "FILE_MISSING" | "FILE_TOO_LARGE" | "DISALLOWED_MIME" | "INVALID_ATTACHMENT_ID" | "ATTACHMENT_NOT_FOUND" | "FORBIDDEN_FOR_DELETE" | "UPLOAD_FAILED" | "REMOVE_FAILED";
363
+ code: "PAGE_NOT_FOUND" | "INVALID_PAGE_ID" | "FILE_MISSING" | "FILE_TOO_LARGE" | "DISALLOWED_MIME" | "INVALID_ATTACHMENT_ID" | "ATTACHMENT_NOT_FOUND" | "FORBIDDEN_FOR_DELETE" | "UPLOAD_FAILED" | "REMOVE_FAILED";
346
364
  message: string;
347
365
  };
348
366
  };
349
367
  outputFormat: "json";
350
368
  status: 413;
351
- } | {
352
- input: {
353
- param: {
354
- pageId: string;
355
- };
356
- } & {
357
- form: {
358
- file?: any;
359
- };
360
- };
361
- output: {
362
- error: {
363
- code: "INVALID_PAGE_ID" | "PAGE_NOT_FOUND" | "FILE_MISSING" | "FILE_TOO_LARGE" | "DISALLOWED_MIME" | "INVALID_ATTACHMENT_ID" | "ATTACHMENT_NOT_FOUND" | "FORBIDDEN_FOR_DELETE" | "UPLOAD_FAILED" | "REMOVE_FAILED";
364
- message: string;
365
- };
366
- };
367
- outputFormat: "json";
368
- status: 500;
369
369
  };
370
370
  };
371
371
  } & {
@@ -379,13 +379,13 @@ export declare const registerAttachmentRoutes: <E extends OpenAPIHono<CrowiHonoB
379
379
  };
380
380
  };
381
381
  output: {
382
- url: string;
383
- filename: string;
384
- mimeType: string;
385
- sizeBytes: number;
382
+ error: {
383
+ code: "INTERNAL_ERROR";
384
+ message: "Internal server error";
385
+ };
386
386
  };
387
387
  outputFormat: "json";
388
- status: 200;
388
+ status: 500;
389
389
  } | {
390
390
  input: {
391
391
  form: {
@@ -429,14 +429,13 @@ export declare const registerAttachmentRoutes: <E extends OpenAPIHono<CrowiHonoB
429
429
  };
430
430
  };
431
431
  output: {
432
- error: "rate_limited" | "too_large" | "disallowed_type" | "no_permission";
433
- message: string;
434
- details?: {
435
- [x: string]: import("hono/utils/types").JSONValue;
436
- } | undefined;
432
+ url: string;
433
+ filename: string;
434
+ mimeType: string;
435
+ sizeBytes: number;
437
436
  };
438
437
  outputFormat: "json";
439
- status: 403;
438
+ status: 200;
440
439
  } | {
441
440
  input: {
442
441
  form: {
@@ -453,7 +452,7 @@ export declare const registerAttachmentRoutes: <E extends OpenAPIHono<CrowiHonoB
453
452
  } | undefined;
454
453
  };
455
454
  outputFormat: "json";
456
- status: 413;
455
+ status: 403;
457
456
  } | {
458
457
  input: {
459
458
  form: {
@@ -470,7 +469,7 @@ export declare const registerAttachmentRoutes: <E extends OpenAPIHono<CrowiHonoB
470
469
  } | undefined;
471
470
  };
472
471
  outputFormat: "json";
473
- status: 415;
472
+ status: 413;
474
473
  } | {
475
474
  input: {
476
475
  form: {
@@ -487,7 +486,7 @@ export declare const registerAttachmentRoutes: <E extends OpenAPIHono<CrowiHonoB
487
486
  } | undefined;
488
487
  };
489
488
  outputFormat: "json";
490
- status: 429;
489
+ status: 415;
491
490
  } | {
492
491
  input: {
493
492
  form: {
@@ -497,13 +496,14 @@ export declare const registerAttachmentRoutes: <E extends OpenAPIHono<CrowiHonoB
497
496
  };
498
497
  };
499
498
  output: {
500
- error: {
501
- code: "INTERNAL_ERROR";
502
- message: "Internal server error";
503
- };
499
+ error: "rate_limited" | "too_large" | "disallowed_type" | "no_permission";
500
+ message: string;
501
+ details?: {
502
+ [x: string]: import("hono/utils/types").JSONValue;
503
+ } | undefined;
504
504
  };
505
505
  outputFormat: "json";
506
- status: 500;
506
+ status: 429;
507
507
  };
508
508
  };
509
509
  } & {
@@ -515,30 +515,13 @@ export declare const registerAttachmentRoutes: <E extends OpenAPIHono<CrowiHonoB
515
515
  };
516
516
  };
517
517
  output: {
518
- createdAt: string;
519
- _id: string;
520
- creator: {
521
- _id: string;
522
- username: string;
523
- name: string;
524
- email: string;
525
- createdAt: string;
526
- id?: string | undefined;
527
- image?: string | null | undefined;
528
- introduction?: string | undefined;
529
- admin?: boolean | undefined;
530
- status?: 1 | 2 | 3 | 4 | 5 | undefined;
518
+ error: {
519
+ code: "INTERNAL_ERROR";
520
+ message: "Internal server error";
531
521
  };
532
- page: string;
533
- url: string;
534
- filePath: string;
535
- fileName: string;
536
- originalName: string;
537
- fileFormat: string;
538
- fileSize: number;
539
522
  };
540
523
  outputFormat: "json";
541
- status: 200;
524
+ status: 500;
542
525
  } | {
543
526
  input: {
544
527
  param: {
@@ -547,12 +530,12 @@ export declare const registerAttachmentRoutes: <E extends OpenAPIHono<CrowiHonoB
547
530
  };
548
531
  output: {
549
532
  error: {
550
- code: "INVALID_PAGE_ID" | "PAGE_NOT_FOUND" | "FILE_MISSING" | "FILE_TOO_LARGE" | "DISALLOWED_MIME" | "INVALID_ATTACHMENT_ID" | "ATTACHMENT_NOT_FOUND" | "FORBIDDEN_FOR_DELETE" | "UPLOAD_FAILED" | "REMOVE_FAILED";
533
+ code: "PAGE_NOT_FOUND" | "INVALID_PAGE_ID" | "FILE_MISSING" | "FILE_TOO_LARGE" | "DISALLOWED_MIME" | "INVALID_ATTACHMENT_ID" | "ATTACHMENT_NOT_FOUND" | "FORBIDDEN_FOR_DELETE" | "UPLOAD_FAILED" | "REMOVE_FAILED";
551
534
  message: string;
552
535
  };
553
536
  };
554
537
  outputFormat: "json";
555
- status: 400;
538
+ status: 404;
556
539
  } | {
557
540
  input: {
558
541
  param: {
@@ -561,13 +544,12 @@ export declare const registerAttachmentRoutes: <E extends OpenAPIHono<CrowiHonoB
561
544
  };
562
545
  output: {
563
546
  error: {
564
- code: "AUTHENTICATION_REQUIRED";
565
- message: "Authentication is required";
566
- redirectTo?: string | undefined;
547
+ code: "PAGE_NOT_FOUND" | "INVALID_PAGE_ID" | "FILE_MISSING" | "FILE_TOO_LARGE" | "DISALLOWED_MIME" | "INVALID_ATTACHMENT_ID" | "ATTACHMENT_NOT_FOUND" | "FORBIDDEN_FOR_DELETE" | "UPLOAD_FAILED" | "REMOVE_FAILED";
548
+ message: string;
567
549
  };
568
550
  };
569
551
  outputFormat: "json";
570
- status: 401;
552
+ status: 400;
571
553
  } | {
572
554
  input: {
573
555
  param: {
@@ -576,12 +558,13 @@ export declare const registerAttachmentRoutes: <E extends OpenAPIHono<CrowiHonoB
576
558
  };
577
559
  output: {
578
560
  error: {
579
- code: "INVALID_PAGE_ID" | "PAGE_NOT_FOUND" | "FILE_MISSING" | "FILE_TOO_LARGE" | "DISALLOWED_MIME" | "INVALID_ATTACHMENT_ID" | "ATTACHMENT_NOT_FOUND" | "FORBIDDEN_FOR_DELETE" | "UPLOAD_FAILED" | "REMOVE_FAILED";
580
- message: string;
561
+ code: "AUTHENTICATION_REQUIRED";
562
+ message: "Authentication is required";
563
+ redirectTo?: string | undefined;
581
564
  };
582
565
  };
583
566
  outputFormat: "json";
584
- status: 404;
567
+ status: 401;
585
568
  } | {
586
569
  input: {
587
570
  param: {
@@ -589,13 +572,30 @@ export declare const registerAttachmentRoutes: <E extends OpenAPIHono<CrowiHonoB
589
572
  };
590
573
  };
591
574
  output: {
592
- error: {
593
- code: "INTERNAL_ERROR";
594
- message: "Internal server error";
575
+ createdAt: string;
576
+ _id: string;
577
+ creator: {
578
+ _id: string;
579
+ username: string;
580
+ name: string;
581
+ email: string;
582
+ createdAt: string;
583
+ id?: string | undefined;
584
+ image?: string | null | undefined;
585
+ introduction?: string | undefined;
586
+ admin?: boolean | undefined;
587
+ status?: 1 | 2 | 3 | 4 | 5 | undefined;
595
588
  };
589
+ page: string;
590
+ url: string;
591
+ filePath: string;
592
+ fileName: string;
593
+ originalName: string;
594
+ fileFormat: string;
595
+ fileSize: number;
596
596
  };
597
597
  outputFormat: "json";
598
- status: 500;
598
+ status: 200;
599
599
  };
600
600
  };
601
601
  } & {
@@ -607,10 +607,13 @@ export declare const registerAttachmentRoutes: <E extends OpenAPIHono<CrowiHonoB
607
607
  };
608
608
  };
609
609
  output: {
610
- success: true;
610
+ error: {
611
+ code: "PAGE_NOT_FOUND" | "INVALID_PAGE_ID" | "FILE_MISSING" | "FILE_TOO_LARGE" | "DISALLOWED_MIME" | "INVALID_ATTACHMENT_ID" | "ATTACHMENT_NOT_FOUND" | "FORBIDDEN_FOR_DELETE" | "UPLOAD_FAILED" | "REMOVE_FAILED";
612
+ message: string;
613
+ };
611
614
  };
612
615
  outputFormat: "json";
613
- status: 200;
616
+ status: 500;
614
617
  } | {
615
618
  input: {
616
619
  param: {
@@ -619,12 +622,12 @@ export declare const registerAttachmentRoutes: <E extends OpenAPIHono<CrowiHonoB
619
622
  };
620
623
  output: {
621
624
  error: {
622
- code: "INVALID_PAGE_ID" | "PAGE_NOT_FOUND" | "FILE_MISSING" | "FILE_TOO_LARGE" | "DISALLOWED_MIME" | "INVALID_ATTACHMENT_ID" | "ATTACHMENT_NOT_FOUND" | "FORBIDDEN_FOR_DELETE" | "UPLOAD_FAILED" | "REMOVE_FAILED";
625
+ code: "PAGE_NOT_FOUND" | "INVALID_PAGE_ID" | "FILE_MISSING" | "FILE_TOO_LARGE" | "DISALLOWED_MIME" | "INVALID_ATTACHMENT_ID" | "ATTACHMENT_NOT_FOUND" | "FORBIDDEN_FOR_DELETE" | "UPLOAD_FAILED" | "REMOVE_FAILED";
623
626
  message: string;
624
627
  };
625
628
  };
626
629
  outputFormat: "json";
627
- status: 400;
630
+ status: 404;
628
631
  } | {
629
632
  input: {
630
633
  param: {
@@ -633,13 +636,12 @@ export declare const registerAttachmentRoutes: <E extends OpenAPIHono<CrowiHonoB
633
636
  };
634
637
  output: {
635
638
  error: {
636
- code: "AUTHENTICATION_REQUIRED";
637
- message: "Authentication is required";
638
- redirectTo?: string | undefined;
639
+ code: "PAGE_NOT_FOUND" | "INVALID_PAGE_ID" | "FILE_MISSING" | "FILE_TOO_LARGE" | "DISALLOWED_MIME" | "INVALID_ATTACHMENT_ID" | "ATTACHMENT_NOT_FOUND" | "FORBIDDEN_FOR_DELETE" | "UPLOAD_FAILED" | "REMOVE_FAILED";
640
+ message: string;
639
641
  };
640
642
  };
641
643
  outputFormat: "json";
642
- status: 401;
644
+ status: 400;
643
645
  } | {
644
646
  input: {
645
647
  param: {
@@ -648,12 +650,13 @@ export declare const registerAttachmentRoutes: <E extends OpenAPIHono<CrowiHonoB
648
650
  };
649
651
  output: {
650
652
  error: {
651
- code: "INVALID_PAGE_ID" | "PAGE_NOT_FOUND" | "FILE_MISSING" | "FILE_TOO_LARGE" | "DISALLOWED_MIME" | "INVALID_ATTACHMENT_ID" | "ATTACHMENT_NOT_FOUND" | "FORBIDDEN_FOR_DELETE" | "UPLOAD_FAILED" | "REMOVE_FAILED";
652
- message: string;
653
+ code: "AUTHENTICATION_REQUIRED";
654
+ message: "Authentication is required";
655
+ redirectTo?: string | undefined;
653
656
  };
654
657
  };
655
658
  outputFormat: "json";
656
- status: 403;
659
+ status: 401;
657
660
  } | {
658
661
  input: {
659
662
  param: {
@@ -661,13 +664,10 @@ export declare const registerAttachmentRoutes: <E extends OpenAPIHono<CrowiHonoB
661
664
  };
662
665
  };
663
666
  output: {
664
- error: {
665
- code: "INVALID_PAGE_ID" | "PAGE_NOT_FOUND" | "FILE_MISSING" | "FILE_TOO_LARGE" | "DISALLOWED_MIME" | "INVALID_ATTACHMENT_ID" | "ATTACHMENT_NOT_FOUND" | "FORBIDDEN_FOR_DELETE" | "UPLOAD_FAILED" | "REMOVE_FAILED";
666
- message: string;
667
- };
667
+ success: true;
668
668
  };
669
669
  outputFormat: "json";
670
- status: 404;
670
+ status: 200;
671
671
  } | {
672
672
  input: {
673
673
  param: {
@@ -676,12 +676,12 @@ export declare const registerAttachmentRoutes: <E extends OpenAPIHono<CrowiHonoB
676
676
  };
677
677
  output: {
678
678
  error: {
679
- code: "INVALID_PAGE_ID" | "PAGE_NOT_FOUND" | "FILE_MISSING" | "FILE_TOO_LARGE" | "DISALLOWED_MIME" | "INVALID_ATTACHMENT_ID" | "ATTACHMENT_NOT_FOUND" | "FORBIDDEN_FOR_DELETE" | "UPLOAD_FAILED" | "REMOVE_FAILED";
679
+ code: "PAGE_NOT_FOUND" | "INVALID_PAGE_ID" | "FILE_MISSING" | "FILE_TOO_LARGE" | "DISALLOWED_MIME" | "INVALID_ATTACHMENT_ID" | "ATTACHMENT_NOT_FOUND" | "FORBIDDEN_FOR_DELETE" | "UPLOAD_FAILED" | "REMOVE_FAILED";
680
680
  message: string;
681
681
  };
682
682
  };
683
683
  outputFormat: "json";
684
- status: 500;
684
+ status: 403;
685
685
  };
686
686
  };
687
687
  }, "/">;