@esaio/esa-mcp-server 0.1.0 → 0.2.0

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.
@@ -493,6 +493,13 @@ export interface paths {
493
493
  query?: {
494
494
  /** @description 追加で含める情報(カンマ区切り) */
495
495
  include?: components["parameters"]["include"];
496
+ /**
497
+ * @description 本文中のsecure attachment URL(https://files.esa.io/ または https://dl.esa.io/)を署名付きURLに変換するかどうか。
498
+ * - `false`: 変換しない(デフォルト)
499
+ * - `true`: 60秒の有効期限で署名付きURLに変換
500
+ * - 整数値(1-604800): 指定した秒数の有効期限で署名付きURLに変換
501
+ */
502
+ sign_attachment_urls?: components["parameters"]["sign_attachment_urls"];
496
503
  };
497
504
  header?: never;
498
505
  path: {
@@ -783,6 +790,13 @@ export interface paths {
783
790
  query?: {
784
791
  /** @description 追加で含める情報 */
785
792
  include?: "stargazers";
793
+ /**
794
+ * @description 本文中のsecure attachment URL(https://files.esa.io/ または https://dl.esa.io/)を署名付きURLに変換するかどうか。
795
+ * - `false`: 変換しない(デフォルト)
796
+ * - `true`: 60秒の有効期限で署名付きURLに変換
797
+ * - 整数値(1-604800): 指定した秒数の有効期限で署名付きURLに変換
798
+ */
799
+ sign_attachment_urls?: components["parameters"]["sign_attachment_urls"];
786
800
  };
787
801
  header?: never;
788
802
  path: {
@@ -1509,6 +1523,77 @@ export interface paths {
1509
1523
  patch?: never;
1510
1524
  trace?: never;
1511
1525
  };
1526
+ "/v1/teams/{team_name}/categories/paths": {
1527
+ parameters: {
1528
+ query?: never;
1529
+ header?: never;
1530
+ path?: never;
1531
+ cookie?: never;
1532
+ };
1533
+ /**
1534
+ * カテゴリパス一覧取得
1535
+ * @description チームのカテゴリパスの一覧を取得します。フィルタリングオプションにより、特定の条件に合致するカテゴリのみを取得できます
1536
+ */
1537
+ get: {
1538
+ parameters: {
1539
+ query?: {
1540
+ /** @description 指定した文字列で始まるカテゴリパスのみを取得 */
1541
+ prefix?: string;
1542
+ /** @description 指定した文字列で終わるカテゴリパスのみを取得 */
1543
+ suffix?: string;
1544
+ /** @description 指定した文字列を含むカテゴリパスのみを取得 */
1545
+ match?: string;
1546
+ /** @description 指定したパスと完全一致するカテゴリのみを取得 */
1547
+ exact_match?: string;
1548
+ };
1549
+ header?: never;
1550
+ path: {
1551
+ /** @description チーム名 */
1552
+ team_name: components["parameters"]["team_name"];
1553
+ };
1554
+ cookie?: never;
1555
+ };
1556
+ requestBody?: never;
1557
+ responses: {
1558
+ /** @description 成功 */
1559
+ 200: {
1560
+ headers: {
1561
+ [name: string]: unknown;
1562
+ };
1563
+ content: {
1564
+ "application/json": {
1565
+ /**
1566
+ * @description カテゴリのパス(先頭と末尾のスラッシュは除去される)
1567
+ * @example dev/docs
1568
+ */
1569
+ path: string | null;
1570
+ /**
1571
+ * @description カテゴリ内の記事数
1572
+ * @example 42
1573
+ */
1574
+ posts: number;
1575
+ }[];
1576
+ };
1577
+ };
1578
+ 400: components["responses"]["BadRequestError"];
1579
+ 401: components["responses"]["UnauthorizedError"];
1580
+ 402: components["responses"]["PaymentRequiredError"];
1581
+ 403: components["responses"]["ForbiddenError"];
1582
+ 404: components["responses"]["NotFoundError"];
1583
+ 405: components["responses"]["MethodNotAllowedError"];
1584
+ 406: components["responses"]["NotAcceptableError"];
1585
+ 429: components["responses"]["TooManyRequestsError"];
1586
+ 500: components["responses"]["InternalServerError"];
1587
+ };
1588
+ };
1589
+ put?: never;
1590
+ post?: never;
1591
+ delete?: never;
1592
+ options?: never;
1593
+ head?: never;
1594
+ patch?: never;
1595
+ trace?: never;
1596
+ };
1512
1597
  "/v1/teams/{team_name}/categories/batch_move": {
1513
1598
  parameters: {
1514
1599
  query?: never;
@@ -2020,6 +2105,171 @@ export interface paths {
2020
2105
  patch?: never;
2021
2106
  trace?: never;
2022
2107
  };
2108
+ "/v1/teams/{team_name}/signed_urls": {
2109
+ parameters: {
2110
+ query?: never;
2111
+ header?: never;
2112
+ path?: never;
2113
+ cookie?: never;
2114
+ };
2115
+ /**
2116
+ * 署名付きURL取得(複数)
2117
+ * @description 複数のファイルパスに対して署名付きURLを取得します。
2118
+ * 最大10個のURLを一度に処理できます。
2119
+ */
2120
+ get: {
2121
+ parameters: {
2122
+ query: {
2123
+ /**
2124
+ * @description カンマ区切りのファイルパス(最大10個)
2125
+ * @example /uploads/example/file1.png,/uploads/example/file2.png
2126
+ */
2127
+ urls: string;
2128
+ /**
2129
+ * @description 署名付きURLの有効期限(秒数)。1〜604800(1週間)の範囲で指定可能。指定しない場合はデフォルトの60秒
2130
+ * @example 3600
2131
+ */
2132
+ expires_in?: number;
2133
+ /**
2134
+ * @description 署名付きURLのフォーマットバージョン。
2135
+ * 2を指定すると esa-signed-url-v2 形式の署名付きURLが返されます。
2136
+ * 指定しない場合は従来の形式が使用されます。
2137
+ * @example 2
2138
+ */
2139
+ v?: 2;
2140
+ };
2141
+ header?: never;
2142
+ path: {
2143
+ /** @description チーム名 */
2144
+ team_name: components["parameters"]["team_name"];
2145
+ };
2146
+ cookie?: never;
2147
+ };
2148
+ requestBody?: never;
2149
+ responses: {
2150
+ /** @description 成功 */
2151
+ 200: {
2152
+ headers: {
2153
+ [name: string]: unknown;
2154
+ };
2155
+ content: {
2156
+ "application/json": {
2157
+ /**
2158
+ * @description 入力URLと署名付きURLのペアの配列。
2159
+ * 各要素は[入力URL, 署名付きURL]の形式。
2160
+ * ファイルが見つからない場合、署名付きURLはnullになります。
2161
+ * @example [
2162
+ * [
2163
+ * "/uploads/example/file1.png",
2164
+ * "https://s3.amazonaws.com/bucket/uploads/example/file1.png?signature=..."
2165
+ * ],
2166
+ * [
2167
+ * "uploads/example/file2.png",
2168
+ * "https://s3.amazonaws.com/bucket/uploads/example/file2.png?signature=..."
2169
+ * ]
2170
+ * ]
2171
+ */
2172
+ signed_urls?: string[][];
2173
+ };
2174
+ };
2175
+ };
2176
+ 400: components["responses"]["BadRequestError"];
2177
+ 401: components["responses"]["UnauthorizedError"];
2178
+ 402: components["responses"]["PaymentRequiredError"];
2179
+ 403: components["responses"]["ForbiddenError"];
2180
+ 405: components["responses"]["MethodNotAllowedError"];
2181
+ 406: components["responses"]["NotAcceptableError"];
2182
+ 429: components["responses"]["TooManyRequestsError"];
2183
+ 500: components["responses"]["InternalServerError"];
2184
+ };
2185
+ };
2186
+ put?: never;
2187
+ /**
2188
+ * 署名付きURL取得(複数)
2189
+ * @description 複数のファイルパスに対して署名付きURLを取得します。
2190
+ * 最大1000個のURLを一度に処理できます。
2191
+ */
2192
+ post: {
2193
+ parameters: {
2194
+ query?: never;
2195
+ header?: never;
2196
+ path: {
2197
+ /** @description チーム名 */
2198
+ team_name: components["parameters"]["team_name"];
2199
+ };
2200
+ cookie?: never;
2201
+ };
2202
+ requestBody: {
2203
+ content: {
2204
+ "application/json": {
2205
+ /**
2206
+ * @description ファイルパスの配列(最大1000個)
2207
+ * @example [
2208
+ * "/uploads/example/file1.png",
2209
+ * "uploads/example/file2.png",
2210
+ * "https://example.com/uploads/example/file3.png"
2211
+ * ]
2212
+ */
2213
+ urls: string[];
2214
+ /**
2215
+ * @description 署名付きURLの有効期限(秒数)。1〜604800(1週間)の範囲で指定可能。指定しない場合はデフォルトの60秒
2216
+ * @example 3600
2217
+ */
2218
+ expires_in?: number;
2219
+ /**
2220
+ * @description 署名付きURLのフォーマットバージョン。
2221
+ * 2を指定すると esa-signed-url-v2 形式の署名付きURLが返されます。
2222
+ * 指定しない場合は従来の形式が使用されます。
2223
+ * @example 2
2224
+ * @enum {integer}
2225
+ */
2226
+ v?: 2;
2227
+ };
2228
+ };
2229
+ };
2230
+ responses: {
2231
+ /** @description 成功 */
2232
+ 200: {
2233
+ headers: {
2234
+ [name: string]: unknown;
2235
+ };
2236
+ content: {
2237
+ "application/json": {
2238
+ /**
2239
+ * @description 入力URLと署名付きURLのペアの配列。
2240
+ * 各要素は[入力URL, 署名付きURL]の形式。
2241
+ * ファイルが見つからない場合、署名付きURLはnullになります。
2242
+ * @example [
2243
+ * [
2244
+ * "/uploads/example/file1.png",
2245
+ * "https://s3.amazonaws.com/bucket/uploads/example/file1.png?signature=..."
2246
+ * ],
2247
+ * [
2248
+ * "uploads/example/file2.png",
2249
+ * "https://s3.amazonaws.com/bucket/uploads/example/file2.png?signature=..."
2250
+ * ]
2251
+ * ]
2252
+ */
2253
+ signed_urls?: string[][];
2254
+ };
2255
+ };
2256
+ };
2257
+ 400: components["responses"]["BadRequestError"];
2258
+ 401: components["responses"]["UnauthorizedError"];
2259
+ 402: components["responses"]["PaymentRequiredError"];
2260
+ 403: components["responses"]["ForbiddenError"];
2261
+ 405: components["responses"]["MethodNotAllowedError"];
2262
+ 406: components["responses"]["NotAcceptableError"];
2263
+ 429: components["responses"]["TooManyRequestsError"];
2264
+ 500: components["responses"]["InternalServerError"];
2265
+ };
2266
+ };
2267
+ delete?: never;
2268
+ options?: never;
2269
+ head?: never;
2270
+ patch?: never;
2271
+ trace?: never;
2272
+ };
2023
2273
  "/v1/user": {
2024
2274
  parameters: {
2025
2275
  query?: never;
@@ -2496,7 +2746,7 @@ export interface components {
2496
2746
  categories: components["schemas"]["Category"][];
2497
2747
  }[];
2498
2748
  /** @description READMEの記事情報 */
2499
- readme?: components["schemas"]["Post"];
2749
+ readme?: components["schemas"]["Post"] | null;
2500
2750
  /** @description カテゴリなし記事の情報(topカテゴリの場合) */
2501
2751
  no_category?: components["schemas"]["Category"];
2502
2752
  /** @description 子孫記事を含むかどうか */
@@ -2542,10 +2792,12 @@ export interface components {
2542
2792
  [name: string]: unknown;
2543
2793
  };
2544
2794
  content: {
2545
- /** @example {
2795
+ /**
2796
+ * @example {
2546
2797
  * "error": "Bad Request",
2547
2798
  * "message": "Invalid request parameters"
2548
- * } */
2799
+ * }
2800
+ */
2549
2801
  "application/json": components["schemas"]["Error"];
2550
2802
  };
2551
2803
  };
@@ -2555,10 +2807,12 @@ export interface components {
2555
2807
  [name: string]: unknown;
2556
2808
  };
2557
2809
  content: {
2558
- /** @example {
2810
+ /**
2811
+ * @example {
2559
2812
  * "error": "Unauthorized",
2560
2813
  * "message": "Invalid or expired token"
2561
- * } */
2814
+ * }
2815
+ */
2562
2816
  "application/json": components["schemas"]["Error"];
2563
2817
  };
2564
2818
  };
@@ -2568,10 +2822,12 @@ export interface components {
2568
2822
  [name: string]: unknown;
2569
2823
  };
2570
2824
  content: {
2571
- /** @example {
2825
+ /**
2826
+ * @example {
2572
2827
  * "error": "Payment Required",
2573
2828
  * "message": "Payment required to access this resource"
2574
- * } */
2829
+ * }
2830
+ */
2575
2831
  "application/json": components["schemas"]["Error"];
2576
2832
  };
2577
2833
  };
@@ -2581,10 +2837,12 @@ export interface components {
2581
2837
  [name: string]: unknown;
2582
2838
  };
2583
2839
  content: {
2584
- /** @example {
2840
+ /**
2841
+ * @example {
2585
2842
  * "error": "Forbidden",
2586
2843
  * "message": "Insufficient permissions"
2587
- * } */
2844
+ * }
2845
+ */
2588
2846
  "application/json": components["schemas"]["Error"];
2589
2847
  };
2590
2848
  };
@@ -2594,10 +2852,12 @@ export interface components {
2594
2852
  [name: string]: unknown;
2595
2853
  };
2596
2854
  content: {
2597
- /** @example {
2855
+ /**
2856
+ * @example {
2598
2857
  * "error": "Not Found",
2599
2858
  * "message": "Resource not found"
2600
- * } */
2859
+ * }
2860
+ */
2601
2861
  "application/json": components["schemas"]["Error"];
2602
2862
  };
2603
2863
  };
@@ -2607,10 +2867,12 @@ export interface components {
2607
2867
  [name: string]: unknown;
2608
2868
  };
2609
2869
  content: {
2610
- /** @example {
2870
+ /**
2871
+ * @example {
2611
2872
  * "error": "Method Not Allowed",
2612
2873
  * "message": "HTTP method not allowed for this endpoint"
2613
- * } */
2874
+ * }
2875
+ */
2614
2876
  "application/json": components["schemas"]["Error"];
2615
2877
  };
2616
2878
  };
@@ -2620,10 +2882,12 @@ export interface components {
2620
2882
  [name: string]: unknown;
2621
2883
  };
2622
2884
  content: {
2623
- /** @example {
2885
+ /**
2886
+ * @example {
2624
2887
  * "error": "Not Acceptable",
2625
2888
  * "message": "Requested format not supported"
2626
- * } */
2889
+ * }
2890
+ */
2627
2891
  "application/json": components["schemas"]["Error"];
2628
2892
  };
2629
2893
  };
@@ -2633,10 +2897,12 @@ export interface components {
2633
2897
  [name: string]: unknown;
2634
2898
  };
2635
2899
  content: {
2636
- /** @example {
2900
+ /**
2901
+ * @example {
2637
2902
  * "error": "Conflict",
2638
2903
  * "message": "Resource conflict detected"
2639
- * } */
2904
+ * }
2905
+ */
2640
2906
  "application/json": components["schemas"]["Error"];
2641
2907
  };
2642
2908
  };
@@ -2648,10 +2914,12 @@ export interface components {
2648
2914
  [name: string]: unknown;
2649
2915
  };
2650
2916
  content: {
2651
- /** @example {
2917
+ /**
2918
+ * @example {
2652
2919
  * "error": "Too Many Requests",
2653
2920
  * "message": "Rate limit exceeded"
2654
- * } */
2921
+ * }
2922
+ */
2655
2923
  "application/json": components["schemas"]["Error"];
2656
2924
  };
2657
2925
  };
@@ -2661,10 +2929,12 @@ export interface components {
2661
2929
  [name: string]: unknown;
2662
2930
  };
2663
2931
  content: {
2664
- /** @example {
2932
+ /**
2933
+ * @example {
2665
2934
  * "error": "Internal Server Error",
2666
2935
  * "message": "An unexpected error occurred"
2667
- * } */
2936
+ * }
2937
+ */
2668
2938
  "application/json": components["schemas"]["Error"];
2669
2939
  };
2670
2940
  };
@@ -2682,6 +2952,13 @@ export interface components {
2682
2952
  comment_id: number;
2683
2953
  /** @description 追加で含める情報(カンマ区切り) */
2684
2954
  include: "comments" | "stargazers" | "comments.stargazers";
2955
+ /**
2956
+ * @description 本文中のsecure attachment URL(https://files.esa.io/ または https://dl.esa.io/)を署名付きURLに変換するかどうか。
2957
+ * - `false`: 変換しない(デフォルト)
2958
+ * - `true`: 60秒の有効期限で署名付きURLに変換
2959
+ * - 整数値(1-604800): 指定した秒数の有効期限で署名付きURLに変換
2960
+ */
2961
+ sign_attachment_urls: boolean | number;
2685
2962
  };
2686
2963
  requestBodies: never;
2687
2964
  headers: never;
@@ -1,4 +1,5 @@
1
1
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ import type { MockInstance } from "vitest";
2
3
  import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
3
4
  import type { MCPContext } from "../../context/mcp-context.js";
4
5
  import { setupPrompts } from "../index.js";
@@ -6,7 +7,7 @@ import { setupPrompts } from "../index.js";
6
7
  describe("setupPrompts", () => {
7
8
  let server: McpServer;
8
9
  let context: MCPContext;
9
- let consoleErrorSpy: ReturnType<typeof vi.spyOn>;
10
+ let consoleErrorSpy: MockInstance<typeof console.error>;
10
11
 
11
12
  beforeEach(() => {
12
13
  server = new McpServer({
@@ -7,7 +7,7 @@ import { createSummarizePostSchema, summarizePost } from "./summarize-post.js";
7
7
 
8
8
  export function setupPrompts(server: McpServer, context: MCPContext): void {
9
9
  console.error("Setting up MCP prompts...");
10
- // NOTE: Stremable HTTP Stransport では ユーザーの LANG 設定に応じて i18next の lang 設定を変える
10
+ // NOTE: Streamable HTTP transport では ユーザーの LANG 設定に応じて i18next の lang 設定を変える
11
11
  server.registerPrompt(
12
12
  "esa_summarize_post",
13
13
  {
@@ -1,4 +1,5 @@
1
1
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ import type { MockInstance } from "vitest";
2
3
  import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
3
4
  import type { MCPContext } from "../../context/mcp-context.js";
4
5
  import { setupResources } from "../index.js";
@@ -6,7 +7,7 @@ import { setupResources } from "../index.js";
6
7
  describe("setupResources", () => {
7
8
  let server: McpServer;
8
9
  let context: MCPContext;
9
- let consoleErrorSpy: ReturnType<typeof vi.spyOn>;
10
+ let consoleErrorSpy: MockInstance<typeof console.error>;
10
11
 
11
12
  beforeEach(() => {
12
13
  server = new McpServer({
@@ -1,3 +1,4 @@
1
+ import type { MockInstance } from "vitest";
1
2
  import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
2
3
  import { withContext } from "../../api_client/with-context.js";
3
4
  import type { MCPContext } from "../../context/mcp-context.js";
@@ -9,7 +10,7 @@ vi.mock("../../tools/teams.js");
9
10
 
10
11
  describe("createRecentPostsResourceList", () => {
11
12
  let context: MCPContext;
12
- let consoleErrorSpy: ReturnType<typeof vi.spyOn>;
13
+ let consoleErrorSpy: MockInstance<typeof console.error>;
13
14
 
14
15
  beforeEach(() => {
15
16
  context = {} as unknown as MCPContext;