kibela-api-client 0.1.7 → 0.1.9

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 (2) hide show
  1. package/README.md +111 -107
  2. package/package.json +4 -4
package/README.md CHANGED
@@ -8,18 +8,22 @@
8
8
  [![TypeScript](https://img.shields.io/badge/TypeScript-Ready-blue.svg)](https://www.typescriptlang.org/)
9
9
  [![Node version](https://img.shields.io/node/v/kibela-api-client.svg)](https://nodejs.org)
10
10
 
11
- A modern TypeScript client for the Kibela API with CLI support.
11
+ Kibela API用の非公式TypeScriptクライアントライブラリ(CLI対応)
12
12
 
13
- ## Features
13
+ **注意**: これはKibelaの非公式クライアントライブラリです。Kibela社による公式サポートはありません。
14
14
 
15
- - 🚀 **Type-safe**: Full TypeScript support with complete type definitions
16
- - 🔧 **CLI Tool**: Powerful command-line interface for common operations
17
- - 🔐 **Secure**: API key management with environment variable support
18
- - 📝 **Complete API Coverage**: Notes, users, groups, and more
19
- - ⚡ **Lightweight**: Minimal dependencies, optimized bundle size
20
- - 🌐 **GraphQL**: Direct GraphQL API integration
15
+ [English Version](./README_EN.md)
21
16
 
22
- ## Installation
17
+ ## 特徴
18
+
19
+ - 🚀 **型安全**: 完全なTypeScriptサポートと型定義
20
+ - 🔧 **CLIツール**: 一般的な操作のための強力なコマンドラインインターフェース
21
+ - 🔐 **セキュア**: 環境変数対応のAPIキー管理
22
+ - 📝 **完全なAPIカバレッジ**: ノート、ユーザー、グループなど
23
+ - ⚡ **軽量**: 最小限の依存関係、最適化されたバンドルサイズ
24
+ - 🌐 **GraphQL**: 直接的なGraphQL API統合
25
+
26
+ ## インストール
23
27
 
24
28
  ```bash
25
29
  # npm
@@ -31,142 +35,142 @@ yarn add kibela-api-client
31
35
  # pnpm
32
36
  pnpm add kibela-api-client
33
37
 
34
- # Global CLI installation
38
+ # グローバルCLIインストール
35
39
  npm install -g kibela-api-client
36
40
  ```
37
41
 
38
- ## Quick Start
42
+ ## クイックスタート
39
43
 
40
- ### As a Library
44
+ ### ライブラリとして使用
41
45
 
42
46
  ```typescript
43
47
  import { createClient } from 'kibela-api-client';
44
48
 
45
- // Create client instance
49
+ // クライアントインスタンスの作成
46
50
  const kibela = createClient({
47
51
  team: 'your-team-name',
48
52
  token: process.env.KIBELA_API_KEY
49
53
  });
50
54
 
51
- // Create a note
55
+ // ノートの作成
52
56
  const note = await kibela.notes.create({
53
- title: 'Meeting Notes',
54
- content: '# Today\'s Topics\n\n- Project updates\n- Next steps',
57
+ title: 'ミーティングノート',
58
+ content: '# 今日のトピック\n\n- プロジェクトの更新\n- 次のステップ',
55
59
  coediting: true,
56
- groupIds: ['group-id']
60
+ groupIds: ['<グループID>']
57
61
  });
58
62
 
59
- // Search notes
60
- const results = await kibela.notes.search('project update');
63
+ // ノートの検索
64
+ const results = await kibela.notes.search('プロジェクト更新');
61
65
 
62
- // Get current user
66
+ // 現在のユーザー情報の取得
63
67
  const user = await kibela.users.getCurrentUser();
64
68
  ```
65
69
 
66
- ### CLI Usage
70
+ ### CLI使用方法
67
71
 
68
- #### Configuration
72
+ #### 設定
69
73
 
70
- The CLI supports multiple configuration methods with the following priority:
74
+ CLIは以下の優先順位で複数の設定方法をサポートしています:
71
75
 
72
- 1. Config file (`~/.kibela/config.json`)
73
- 2. Environment variables
74
- 3. `.env` file in current directory
76
+ 1. 設定ファイル(`~/.kibela/config.json`)
77
+ 2. 環境変数
78
+ 3. 現在のディレクトリの`.env`ファイル
75
79
 
76
80
  ```bash
77
- # Interactive setup
81
+ # 対話的セットアップ
78
82
  kibela config
79
83
 
80
- # Set credentials directly
84
+ # 認証情報を直接設定
81
85
  kibela config --team your-team --token your-api-token
82
86
 
83
- # Using environment variables
87
+ # 環境変数を使用
84
88
  export KIBELA_TEAM=your-team
85
89
  export KIBELA_API_KEY=your-api-token
86
90
 
87
- # Or use .env file
91
+ # または.envファイルを使用
88
92
  echo "KIBELA_TEAM=your-team" >> .env
89
93
  echo "KIBELA_API_KEY=your-api-token" >> .env
90
94
  ```
91
95
 
92
- #### Commands
96
+ #### コマンド
93
97
 
94
- ##### Notes Management
98
+ ##### ノート管理
95
99
 
96
100
  ```bash
97
- # List recent notes
101
+ # 最近のノート一覧
98
102
  kibela notes list
99
103
 
100
- # List notes in a specific group
101
- kibela notes list --group GROUP_ID
104
+ # 特定のグループのノート一覧
105
+ kibela notes list --group <グループID>
102
106
 
103
- # List notes in a specific folder within a group
104
- kibela notes list --group GROUP_ID --folder "specs"
107
+ # グループ内の特定のフォルダのノート一覧
108
+ kibela notes list --group <グループID> --folder "<フォルダ名>"
105
109
 
106
- # Search notes
107
- kibela notes list --search "keyword" --limit 20
110
+ # ノートの検索
111
+ kibela notes list --search "キーワード" --limit 20
108
112
 
109
- # List all folders in a group
110
- kibela notes folders --group GROUP_ID
113
+ # グループ内の全フォルダ一覧
114
+ kibela notes folders --group <グループID>
111
115
 
112
- # Create a new note
113
- kibela notes create --title "Title" --content "Content" --groups GROUP_ID
116
+ # 新規ノートの作成
117
+ kibela notes create --title "タイトル" --content "内容" --groups <グループID>
114
118
 
115
- # Create a note from markdown file
116
- kibela notes create --markdown note.md --groups GROUP_ID
119
+ # Markdownファイルからノートを作成
120
+ kibela notes create --markdown note.md --groups <グループID>
117
121
 
118
- # Create a note in a specific folder
119
- kibela notes create --markdown note.md --groups GROUP_ID --folder "specs"
122
+ # 特定のフォルダにノートを作成
123
+ kibela notes create --markdown note.md --groups <グループID> --folder "<フォルダ名>"
120
124
 
121
- # Get a specific note
122
- kibela notes get <note-id>
125
+ # 特定のノートを取得
126
+ kibela notes get <ノートID>
123
127
 
124
- # Save note content to file
125
- kibela notes get <note-id> --output output.md
128
+ # ノートの内容をファイルに保存
129
+ kibela notes get <ノートID> --output output.md
126
130
 
127
- # Show HTML content instead of markdown
128
- kibela notes get <note-id> --html
131
+ # Markdownの代わりにHTML内容を表示
132
+ kibela notes get <ノートID> --html
129
133
 
130
- # Update a note
131
- kibela notes update <note-id> --title "New Title" --content "New Content"
134
+ # ノートの更新
135
+ kibela notes update <ノートID> --title "新しいタイトル" --content "新しい内容"
132
136
 
133
- # Update a note from markdown file
134
- kibela notes update <note-id> --markdown updated.md
137
+ # Markdownファイルからノートを更新
138
+ kibela notes update <ノートID> --markdown updated.md
135
139
 
136
- # Delete a note
137
- kibela notes delete <note-id>
140
+ # ノートの削除
141
+ kibela notes delete <ノートID>
138
142
  ```
139
143
 
140
- ##### Workspace Information
144
+ ##### ワークスペース情報
141
145
 
142
146
  ```bash
143
- # List all groups
147
+ # 全グループ一覧
144
148
  kibela groups
145
- kibela groups --all # Show all groups without pagination
149
+ kibela groups --all # ページネーションなしで全グループを表示
146
150
 
147
- # List users
151
+ # ユーザー一覧
148
152
  kibela users list
149
- kibela users list --all # Show all users
153
+ kibela users list --all # 全ユーザーを表示
150
154
 
151
- # Get current user info
155
+ # 現在のユーザー情報を取得
152
156
  kibela users me
153
157
  ```
154
158
 
155
- ## API Reference
159
+ ## APIリファレンス
156
160
 
157
- ### Client Creation
161
+ ### クライアント作成
158
162
 
159
163
  ```typescript
160
164
  const kibela = createClient({
161
- team: string, // Your Kibela team name
162
- token: string // Your API token
165
+ team: string, // あなたのKibelaチーム名
166
+ token: string // あなたのAPIトークン
163
167
  });
164
168
  ```
165
169
 
166
170
  ### Notes API
167
171
 
168
172
  ```typescript
169
- // Create a note
173
+ // ノートの作成
170
174
  kibela.notes.create({
171
175
  title: string,
172
176
  content: string,
@@ -179,7 +183,7 @@ kibela.notes.create({
179
183
  }>
180
184
  })
181
185
 
182
- // Update a note
186
+ // ノートの更新
183
187
  kibela.notes.update(id: string, {
184
188
  title?: string,
185
189
  content?: string,
@@ -188,13 +192,13 @@ kibela.notes.update(id: string, {
188
192
  draft?: boolean
189
193
  })
190
194
 
191
- // Delete a note
195
+ // ノートの削除
192
196
  kibela.notes.delete(id: string)
193
197
 
194
- // Get a note by ID
198
+ // IDでノートを取得
195
199
  kibela.notes.get(id: string)
196
200
 
197
- // List notes with pagination
201
+ // ページネーション付きノート一覧
198
202
  kibela.notes.list({
199
203
  first?: number,
200
204
  after?: string,
@@ -204,7 +208,7 @@ kibela.notes.list({
204
208
  }
205
209
  })
206
210
 
207
- // Search notes
211
+ // ノートの検索
208
212
  kibela.notes.search(query: string, {
209
213
  first?: number,
210
214
  after?: string
@@ -214,89 +218,89 @@ kibela.notes.search(query: string, {
214
218
  ### Groups API
215
219
 
216
220
  ```typescript
217
- // List groups
221
+ // グループ一覧
218
222
  kibela.groups.list({
219
223
  first?: number,
220
224
  after?: string
221
225
  })
222
226
 
223
- // Get a group by ID
227
+ // IDでグループを取得
224
228
  kibela.groups.get(id: string)
225
229
 
226
- // Get all groups (no pagination)
230
+ // 全グループを取得(ページネーションなし)
227
231
  kibela.groups.getAll()
228
232
  ```
229
233
 
230
234
  ### Users API
231
235
 
232
236
  ```typescript
233
- // List users
237
+ // ユーザー一覧
234
238
  kibela.users.list({
235
239
  first?: number,
236
240
  after?: string
237
241
  })
238
242
 
239
- // Get current user
243
+ // 現在のユーザーを取得
240
244
  kibela.users.getCurrentUser()
241
245
 
242
- // Get all users (no pagination)
246
+ // 全ユーザーを取得(ページネーションなし)
243
247
  kibela.users.getAll()
244
248
  ```
245
249
 
246
- ## Environment Variables
250
+ ## 環境変数
247
251
 
248
- - `KIBELA_TEAM`: Your Kibela team name
249
- - `KIBELA_API_KEY` or `KIBELA_TOKEN`: Your API token
252
+ - `KIBELA_TEAM`: あなたのKibelaチーム名
253
+ - `KIBELA_API_KEY` または `KIBELA_TOKEN`: あなたのAPIトークン
250
254
 
251
- ## Security
255
+ ## セキュリティ
252
256
 
253
- - API tokens are never logged or displayed in full
254
- - Tokens are masked in CLI output (shows only first 4 and last 4 characters)
255
- - Support for `.env` files for local development
256
- - Secure storage in user home directory for CLI configuration
257
+ - APIトークンはログに記録されたり、完全に表示されることはありません
258
+ - トークンはCLI出力でマスクされます(最初の4文字と最後の4文字のみ表示)
259
+ - ローカル開発用の`.env`ファイルをサポート
260
+ - CLI設定用にユーザーホームディレクトリに安全に保存
257
261
 
258
- ## Error Handling
262
+ ## エラーハンドリング
259
263
 
260
- The library provides detailed error messages with specific error codes:
264
+ ライブラリは特定のエラーコードと共に詳細なエラーメッセージを提供します:
261
265
 
262
266
  ```typescript
263
267
  try {
264
268
  await kibela.notes.create({ title: '', content: '' });
265
269
  } catch (error) {
266
270
  if (error.code === 'AUTH_ERROR') {
267
- // Handle authentication error
271
+ // 認証エラーの処理
268
272
  } else if (error.code === 'VALIDATION_ERROR') {
269
- // Handle validation error
273
+ // バリデーションエラーの処理
270
274
  }
271
275
  }
272
276
  ```
273
277
 
274
- ## Development
278
+ ## 開発
275
279
 
276
280
  ```bash
277
- # Install dependencies
281
+ # 依存関係のインストール
278
282
  npm install
279
283
 
280
- # Build the project
284
+ # プロジェクトのビルド
281
285
  npm run build
282
286
 
283
- # Run CLI in development
287
+ # 開発モードでCLIを実行
284
288
  npm run dev
285
289
 
286
- # Run tests
290
+ # テストの実行
287
291
  npm test
288
292
  ```
289
293
 
290
- ## Contributing
294
+ ## コントリビュート
291
295
 
292
- Contributions are welcome! Please feel free to submit a Pull Request.
296
+ コントリビューションを歓迎します!お気軽にプルリクエストを送信してください。
293
297
 
294
- 1. Fork the repository
295
- 2. Create your feature branch (`git checkout -b feature/amazing-feature`)
296
- 3. Commit your changes (`git commit -m 'Add some amazing feature'`)
297
- 4. Push to the branch (`git push origin feature/amazing-feature`)
298
- 5. Open a Pull Request
298
+ 1. リポジトリをフォーク
299
+ 2. フィーチャーブランチを作成(`git checkout -b feature/amazing-feature`)
300
+ 3. 変更をコミット(`git commit -m 'Add some amazing feature'`)
301
+ 4. ブランチにプッシュ(`git push origin feature/amazing-feature`)
302
+ 5. プルリクエストを開く
299
303
 
300
- ## License
304
+ ## ライセンス
301
305
 
302
- MIT
306
+ MIT © [Se1ya0hara](https://github.com/Se1ya0hara)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kibela-api-client",
3
- "version": "0.1.7",
3
+ "version": "0.1.9",
4
4
  "description": "Kibela API client for Node.js with CLI",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -26,11 +26,11 @@
26
26
  "license": "MIT",
27
27
  "repository": {
28
28
  "type": "git",
29
- "url": "https://github.com/yourusername/kibela-api-client.git"
29
+ "url": "https://github.com/Se1ya0hara/kibela-api-client.git"
30
30
  },
31
- "homepage": "https://github.com/yourusername/kibela-api-client#readme",
31
+ "homepage": "https://github.com/Se1ya0hara/kibela-api-client#readme",
32
32
  "bugs": {
33
- "url": "https://github.com/yourusername/kibela-api-client/issues"
33
+ "url": "https://github.com/Se1ya0hara/kibela-api-client/issues"
34
34
  },
35
35
  "dependencies": {
36
36
  "chalk": "^4.1.2",