{"id":21359569,"url":"https://github.com/suin/esa-api","last_synced_at":"2025-07-13T01:31:17.767Z","repository":{"id":52619307,"uuid":"272912628","full_name":"suin/esa-api","owner":"suin","description":"esa.io API のクライアントライブラリ。Node.js、TypeScript/JavaScript向け。","archived":false,"fork":false,"pushed_at":"2023-09-20T21:54:19.000Z","size":4065,"stargazers_count":9,"open_issues_count":8,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-06T16:43:24.763Z","etag":null,"topics":["esa","esa-io"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/suin.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2020-06-17T07:55:09.000Z","updated_at":"2025-04-13T05:16:00.000Z","dependencies_parsed_at":"2023-09-26T11:15:00.108Z","dependency_job_id":null,"html_url":"https://github.com/suin/esa-api","commit_stats":{"total_commits":36,"total_committers":2,"mean_commits":18.0,"dds":"0.33333333333333337","last_synced_commit":"b01b259d34ed9987606f80b81841ab3e3c64c562"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/suin/esa-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suin%2Fesa-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suin%2Fesa-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suin%2Fesa-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suin%2Fesa-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/suin","download_url":"https://codeload.github.com/suin/esa-api/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suin%2Fesa-api/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265080006,"owners_count":23708098,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["esa","esa-io"],"created_at":"2024-11-22T05:28:43.279Z","updated_at":"2025-07-13T01:31:17.265Z","avatar_url":"https://github.com/suin.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @suin/esa-api\n\nesa.io API のクライアントライブラリ。\n\n## 特徴\n\n- すべてのエンドポイントに対応しています。\n- [esa API の OpenAPI 仕様書](https://github.com/suin/esa-openapi)から生成したクライアントライブラリをベースに一部拡張を加えたライブラリです。\n\n## インストール\n\n```bash\nyarn add @suin/esa-api\n# or\nnpm install @suin/esa-api\n```\n\n## 使い方\n\n基本的な用法:\n\n```typescript\nimport { createClient } from \"@suin/esa-api\";\n\nconst teamName = \"your_team_name\";\n\nconst client = createClient({\n  token: process.env.ESA_TOKEN, // アクセストーン\n});\n\n{\n  // 記事一覧を取得する\n  const {\n    data: { posts },\n  } = await client.getPosts({ teamName });\n}\n\n{\n  // 指定した記事を取得する\n  const { data: post } = await client.getPost({ teamName, postNumber: 1 });\n}\n\n{\n  // 記事を新規投稿する\n  const { data: createdPost } = await client.createPost({\n    teamName,\n    post: {\n      name: \"hi!\",\n      body_md: \"# Getting Started\\n\",\n      tags: [\"api\", \"dev\"],\n      category: \"dev/2015/05/10\",\n      wip: false,\n      message: \"Add Getting Started section\",\n    },\n  });\n}\n\n{\n  // 指定した記事を編集する\n  const { data: updatedPost } = await client.updatePost({\n    teamName,\n    postNumber: 1,\n    updatePostBody: {\n      post: {\n        wip: false,\n        message: \"Ship it!\",\n      },\n    },\n  });\n}\n```\n\n複雑なクエリの例:\n\n```typescript\nimport { createClient } from \"@suin/esa-api\";\n\nconst teamName = \"your_team_name\";\n\nconst client = createClient({\n  token: process.env.ESA_TOKEN,\n});\n\n// 細かい条件を設定して記事一覧を取得する\nconst response = await client.getPosts({\n  teamName,\n  q: \"wip:false\",\n  include: [\"comments\", \"comments.stargazers\", \"stargazers\"],\n  sort: \"updated\",\n  order: \"desc\",\n  per_page: 100,\n  page: 1,\n});\n\n// 結果からは様々な付随情報が得られます:\n// 1. 記事一覧\nconst { posts } = response.data;\n// 2. 利用制限\nconst { limit, remaining, reset } = response.ratelimit;\n// 3. ページネーション\nconst { prev_page, next_page, page, per_page, max_per_page, total_count } =\n  response.data;\n```\n\n## API リファレンス\n\nhttps://suin.github.io/esa-api/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuin%2Fesa-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsuin%2Fesa-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuin%2Fesa-api/lists"}