backlog-exporter 0.6.1 → 0.7.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.
- package/README.md +43 -192
- package/oclif.manifest.json +2 -384
- package/package.json +4 -1
- package/dist/commands/all/index.d.ts +0 -15
- package/dist/commands/all/index.js +0 -189
- package/dist/commands/document/index.d.ts +0 -13
- package/dist/commands/document/index.js +0 -84
- package/dist/commands/issue/index.d.ts +0 -14
- package/dist/commands/issue/index.js +0 -93
- package/dist/commands/update/index.d.ts +0 -25
- package/dist/commands/update/index.js +0 -320
- package/dist/commands/wiki/index.d.ts +0 -12
- package/dist/commands/wiki/index.js +0 -71
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/utils/backlog-api.d.ts +0 -70
- package/dist/utils/backlog-api.js +0 -435
- package/dist/utils/backlog.d.ts +0 -16
- package/dist/utils/backlog.js +0 -34
- package/dist/utils/common.d.ts +0 -25
- package/dist/utils/common.js +0 -54
- package/dist/utils/log.d.ts +0 -6
- package/dist/utils/log.js +0 -18
- package/dist/utils/settings.d.ts +0 -43
- package/dist/utils/settings.js +0 -63
- package/dist/utils/sleep.d.ts +0 -28
- package/dist/utils/sleep.js +0 -42
package/oclif.manifest.json
CHANGED
|
@@ -1,386 +1,4 @@
|
|
|
1
1
|
{
|
|
2
|
-
"commands": {
|
|
3
|
-
|
|
4
|
-
"aliases": [],
|
|
5
|
-
"args": {},
|
|
6
|
-
"description": "Backlogから課題・Wiki・ドキュメントを取得してMarkdownファイルとして保存する",
|
|
7
|
-
"examples": [
|
|
8
|
-
"<%= config.bin %> <%= command.id %> --domain example.backlog.jp --projectIdOrKey PROJECT_KEY --apiKey YOUR_API_KEY\n課題・Wiki・ドキュメントをMarkdownファイルとして保存する\n",
|
|
9
|
-
"<%= config.bin %> <%= command.id %> --domain example.backlog.jp --projectIdOrKey PROJECT_KEY --apiKey YOUR_API_KEY --output ./my-project\n指定したディレクトリに課題・Wiki・ドキュメントを保存する\n",
|
|
10
|
-
"<%= config.bin %> <%= command.id %> --domain example.backlog.jp --projectIdOrKey PROJECT_KEY --apiKey YOUR_API_KEY --only issues,wiki\n課題とWikiのみを取得する\n",
|
|
11
|
-
"<%= config.bin %> <%= command.id %> --domain example.backlog.jp --projectIdOrKey PROJECT_KEY --apiKey YOUR_API_KEY --exclude documents\nドキュメント以外(課題とWiki)を取得する\n",
|
|
12
|
-
"<%= config.bin %> <%= command.id %> --domain example.backlog.jp --projectIdOrKey PROJECT_KEY --apiKey YOUR_API_KEY --maxCount 1000\n最大1000件の課題を取得する(デフォルトは5000件)\n"
|
|
13
|
-
],
|
|
14
|
-
"flags": {
|
|
15
|
-
"apiKey": {
|
|
16
|
-
"description": "Backlog API key (環境変数 BACKLOG_API_KEY からも自動読み取り可能)",
|
|
17
|
-
"name": "apiKey",
|
|
18
|
-
"required": false,
|
|
19
|
-
"hasDynamicHelp": false,
|
|
20
|
-
"multiple": false,
|
|
21
|
-
"type": "option"
|
|
22
|
-
},
|
|
23
|
-
"domain": {
|
|
24
|
-
"description": "Backlog domain (e.g. example.backlog.jp)",
|
|
25
|
-
"name": "domain",
|
|
26
|
-
"required": true,
|
|
27
|
-
"hasDynamicHelp": false,
|
|
28
|
-
"multiple": false,
|
|
29
|
-
"type": "option"
|
|
30
|
-
},
|
|
31
|
-
"exclude": {
|
|
32
|
-
"description": "Exclude the specified types, separated by commas (e.g., 'documents,wiki')",
|
|
33
|
-
"name": "exclude",
|
|
34
|
-
"required": false,
|
|
35
|
-
"hasDynamicHelp": false,
|
|
36
|
-
"multiple": false,
|
|
37
|
-
"type": "option"
|
|
38
|
-
},
|
|
39
|
-
"maxCount": {
|
|
40
|
-
"char": "m",
|
|
41
|
-
"description": "一度に取得する課題の最大数(デフォルト: 5000)",
|
|
42
|
-
"name": "maxCount",
|
|
43
|
-
"required": false,
|
|
44
|
-
"default": 5000,
|
|
45
|
-
"hasDynamicHelp": false,
|
|
46
|
-
"multiple": false,
|
|
47
|
-
"type": "option"
|
|
48
|
-
},
|
|
49
|
-
"only": {
|
|
50
|
-
"description": "Export only the specified types, separated by commas (e.g., 'issues,wiki')",
|
|
51
|
-
"name": "only",
|
|
52
|
-
"required": false,
|
|
53
|
-
"hasDynamicHelp": false,
|
|
54
|
-
"multiple": false,
|
|
55
|
-
"type": "option"
|
|
56
|
-
},
|
|
57
|
-
"output": {
|
|
58
|
-
"char": "o",
|
|
59
|
-
"description": "出力ディレクトリパス",
|
|
60
|
-
"name": "output",
|
|
61
|
-
"required": false,
|
|
62
|
-
"hasDynamicHelp": false,
|
|
63
|
-
"multiple": false,
|
|
64
|
-
"type": "option"
|
|
65
|
-
},
|
|
66
|
-
"projectIdOrKey": {
|
|
67
|
-
"description": "Backlog project ID or key",
|
|
68
|
-
"name": "projectIdOrKey",
|
|
69
|
-
"required": true,
|
|
70
|
-
"hasDynamicHelp": false,
|
|
71
|
-
"multiple": false,
|
|
72
|
-
"type": "option"
|
|
73
|
-
}
|
|
74
|
-
},
|
|
75
|
-
"hasDynamicHelp": false,
|
|
76
|
-
"hiddenAliases": [],
|
|
77
|
-
"id": "all",
|
|
78
|
-
"pluginAlias": "backlog-exporter",
|
|
79
|
-
"pluginName": "backlog-exporter",
|
|
80
|
-
"pluginType": "core",
|
|
81
|
-
"strict": true,
|
|
82
|
-
"enableJsonFlag": false,
|
|
83
|
-
"isESM": true,
|
|
84
|
-
"relativePath": [
|
|
85
|
-
"dist",
|
|
86
|
-
"commands",
|
|
87
|
-
"all",
|
|
88
|
-
"index.js"
|
|
89
|
-
]
|
|
90
|
-
},
|
|
91
|
-
"document": {
|
|
92
|
-
"aliases": [],
|
|
93
|
-
"args": {},
|
|
94
|
-
"description": "Backlogからドキュメントを取得してMarkdownファイルとして保存する",
|
|
95
|
-
"examples": [
|
|
96
|
-
"<%= config.bin %> <%= command.id %> --domain example.backlog.jp --projectIdOrKey PROJECT_KEY --apiKey YOUR_API_KEY\nドキュメントをMarkdownファイルとして保存する\n",
|
|
97
|
-
"<%= config.bin %> <%= command.id %> --domain example.backlog.jp --projectIdOrKey PROJECT_KEY --apiKey YOUR_API_KEY --output ./my-documents\n指定したディレクトリにドキュメントを保存する\n",
|
|
98
|
-
"<%= config.bin %> <%= command.id %> --domain example.backlog.jp --projectIdOrKey PROJECT_KEY --apiKey YOUR_API_KEY --keyword 仕様書\nキーワード「仕様書」を含むドキュメントのみを取得する\n"
|
|
99
|
-
],
|
|
100
|
-
"flags": {
|
|
101
|
-
"apiKey": {
|
|
102
|
-
"description": "Backlog API key (環境変数 BACKLOG_API_KEY からも自動読み取り可能)",
|
|
103
|
-
"name": "apiKey",
|
|
104
|
-
"required": false,
|
|
105
|
-
"hasDynamicHelp": false,
|
|
106
|
-
"multiple": false,
|
|
107
|
-
"type": "option"
|
|
108
|
-
},
|
|
109
|
-
"domain": {
|
|
110
|
-
"description": "Backlog domain (e.g. example.backlog.jp)",
|
|
111
|
-
"name": "domain",
|
|
112
|
-
"required": true,
|
|
113
|
-
"hasDynamicHelp": false,
|
|
114
|
-
"multiple": false,
|
|
115
|
-
"type": "option"
|
|
116
|
-
},
|
|
117
|
-
"keyword": {
|
|
118
|
-
"description": "検索キーワード",
|
|
119
|
-
"name": "keyword",
|
|
120
|
-
"required": false,
|
|
121
|
-
"hasDynamicHelp": false,
|
|
122
|
-
"multiple": false,
|
|
123
|
-
"type": "option"
|
|
124
|
-
},
|
|
125
|
-
"output": {
|
|
126
|
-
"char": "o",
|
|
127
|
-
"description": "出力ディレクトリパス",
|
|
128
|
-
"name": "output",
|
|
129
|
-
"required": false,
|
|
130
|
-
"hasDynamicHelp": false,
|
|
131
|
-
"multiple": false,
|
|
132
|
-
"type": "option"
|
|
133
|
-
},
|
|
134
|
-
"projectIdOrKey": {
|
|
135
|
-
"description": "Backlog project ID or key",
|
|
136
|
-
"name": "projectIdOrKey",
|
|
137
|
-
"required": true,
|
|
138
|
-
"hasDynamicHelp": false,
|
|
139
|
-
"multiple": false,
|
|
140
|
-
"type": "option"
|
|
141
|
-
}
|
|
142
|
-
},
|
|
143
|
-
"hasDynamicHelp": false,
|
|
144
|
-
"hiddenAliases": [],
|
|
145
|
-
"id": "document",
|
|
146
|
-
"pluginAlias": "backlog-exporter",
|
|
147
|
-
"pluginName": "backlog-exporter",
|
|
148
|
-
"pluginType": "core",
|
|
149
|
-
"strict": true,
|
|
150
|
-
"enableJsonFlag": false,
|
|
151
|
-
"isESM": true,
|
|
152
|
-
"relativePath": [
|
|
153
|
-
"dist",
|
|
154
|
-
"commands",
|
|
155
|
-
"document",
|
|
156
|
-
"index.js"
|
|
157
|
-
]
|
|
158
|
-
},
|
|
159
|
-
"issue": {
|
|
160
|
-
"aliases": [],
|
|
161
|
-
"args": {},
|
|
162
|
-
"description": "Backlogから課題を取得してMarkdownファイルとして保存する",
|
|
163
|
-
"examples": [
|
|
164
|
-
"<%= config.bin %> <%= command.id %> --domain example.backlog.jp --projectIdOrKey PROJECT_KEY --apiKey YOUR_API_KEY\n課題をMarkdownファイルとして保存する\n",
|
|
165
|
-
"<%= config.bin %> <%= command.id %> --domain example.backlog.jp --projectIdOrKey PROJECT_KEY --apiKey YOUR_API_KEY --output ./my-issues\n指定したディレクトリに課題を保存する\n",
|
|
166
|
-
"<%= config.bin %> <%= command.id %> --domain example.backlog.jp --projectIdOrKey PROJECT_KEY --apiKey YOUR_API_KEY --statusId 1,2,3\n指定したステータスIDの課題のみを取得する\n",
|
|
167
|
-
"<%= config.bin %> <%= command.id %> --domain example.backlog.jp --projectIdOrKey PROJECT_KEY --apiKey YOUR_API_KEY --maxCount 10000\n最大10000件の課題を取得する(デフォルトは5000件)\n"
|
|
168
|
-
],
|
|
169
|
-
"flags": {
|
|
170
|
-
"apiKey": {
|
|
171
|
-
"description": "Backlog API key (環境変数 BACKLOG_API_KEY からも自動読み取り可能)",
|
|
172
|
-
"name": "apiKey",
|
|
173
|
-
"required": false,
|
|
174
|
-
"hasDynamicHelp": false,
|
|
175
|
-
"multiple": false,
|
|
176
|
-
"type": "option"
|
|
177
|
-
},
|
|
178
|
-
"domain": {
|
|
179
|
-
"description": "Backlog domain (e.g. example.backlog.jp)",
|
|
180
|
-
"name": "domain",
|
|
181
|
-
"required": true,
|
|
182
|
-
"hasDynamicHelp": false,
|
|
183
|
-
"multiple": false,
|
|
184
|
-
"type": "option"
|
|
185
|
-
},
|
|
186
|
-
"maxCount": {
|
|
187
|
-
"char": "m",
|
|
188
|
-
"description": "一度に取得する課題の最大数(デフォルト: 5000)",
|
|
189
|
-
"name": "maxCount",
|
|
190
|
-
"required": false,
|
|
191
|
-
"default": 5000,
|
|
192
|
-
"hasDynamicHelp": false,
|
|
193
|
-
"multiple": false,
|
|
194
|
-
"type": "option"
|
|
195
|
-
},
|
|
196
|
-
"output": {
|
|
197
|
-
"char": "o",
|
|
198
|
-
"description": "出力ディレクトリパス",
|
|
199
|
-
"name": "output",
|
|
200
|
-
"required": false,
|
|
201
|
-
"hasDynamicHelp": false,
|
|
202
|
-
"multiple": false,
|
|
203
|
-
"type": "option"
|
|
204
|
-
},
|
|
205
|
-
"projectIdOrKey": {
|
|
206
|
-
"description": "Backlog project ID or key",
|
|
207
|
-
"name": "projectIdOrKey",
|
|
208
|
-
"required": true,
|
|
209
|
-
"hasDynamicHelp": false,
|
|
210
|
-
"multiple": false,
|
|
211
|
-
"type": "option"
|
|
212
|
-
},
|
|
213
|
-
"statusId": {
|
|
214
|
-
"description": "ステータスID(カンマ区切りで複数指定可能)",
|
|
215
|
-
"name": "statusId",
|
|
216
|
-
"required": false,
|
|
217
|
-
"hasDynamicHelp": false,
|
|
218
|
-
"multiple": false,
|
|
219
|
-
"type": "option"
|
|
220
|
-
}
|
|
221
|
-
},
|
|
222
|
-
"hasDynamicHelp": false,
|
|
223
|
-
"hiddenAliases": [],
|
|
224
|
-
"id": "issue",
|
|
225
|
-
"pluginAlias": "backlog-exporter",
|
|
226
|
-
"pluginName": "backlog-exporter",
|
|
227
|
-
"pluginType": "core",
|
|
228
|
-
"strict": true,
|
|
229
|
-
"enableJsonFlag": false,
|
|
230
|
-
"isESM": true,
|
|
231
|
-
"relativePath": [
|
|
232
|
-
"dist",
|
|
233
|
-
"commands",
|
|
234
|
-
"issue",
|
|
235
|
-
"index.js"
|
|
236
|
-
]
|
|
237
|
-
},
|
|
238
|
-
"update": {
|
|
239
|
-
"aliases": [],
|
|
240
|
-
"args": {
|
|
241
|
-
"directory": {
|
|
242
|
-
"description": "更新対象のディレクトリ(設定ファイルが保存されている場所)",
|
|
243
|
-
"name": "directory",
|
|
244
|
-
"required": false
|
|
245
|
-
}
|
|
246
|
-
},
|
|
247
|
-
"description": "Backlogから最新データを取得して更新する",
|
|
248
|
-
"examples": [
|
|
249
|
-
"<%= config.bin %> <%= command.id %>\nカレントディレクトリの設定を使用して更新する\n",
|
|
250
|
-
"<%= config.bin %> <%= command.id %> --force\n確認プロンプトをスキップする\n",
|
|
251
|
-
"<%= config.bin %> <%= command.id %> --apiKey YOUR_API_KEY --domain example.backlog.jp --projectIdOrKey PROJECT_KEY\n指定したパラメータで更新する(設定ファイルが存在する場合は上書きされます)\n",
|
|
252
|
-
"<%= config.bin %> <%= command.id %> ./my-project\n指定したディレクトリの設定を使用して更新する\n"
|
|
253
|
-
],
|
|
254
|
-
"flags": {
|
|
255
|
-
"apiKey": {
|
|
256
|
-
"description": "Backlog API key (環境変数 BACKLOG_API_KEY からも自動読み取り可能)",
|
|
257
|
-
"name": "apiKey",
|
|
258
|
-
"required": false,
|
|
259
|
-
"hasDynamicHelp": false,
|
|
260
|
-
"multiple": false,
|
|
261
|
-
"type": "option"
|
|
262
|
-
},
|
|
263
|
-
"documentsOnly": {
|
|
264
|
-
"description": "ドキュメントのみを更新する",
|
|
265
|
-
"name": "documentsOnly",
|
|
266
|
-
"required": false,
|
|
267
|
-
"allowNo": false,
|
|
268
|
-
"type": "boolean"
|
|
269
|
-
},
|
|
270
|
-
"domain": {
|
|
271
|
-
"description": "Backlog domain (e.g. example.backlog.jp)",
|
|
272
|
-
"name": "domain",
|
|
273
|
-
"required": false,
|
|
274
|
-
"hasDynamicHelp": false,
|
|
275
|
-
"multiple": false,
|
|
276
|
-
"type": "option"
|
|
277
|
-
},
|
|
278
|
-
"force": {
|
|
279
|
-
"char": "f",
|
|
280
|
-
"description": "確認プロンプトをスキップする",
|
|
281
|
-
"name": "force",
|
|
282
|
-
"required": false,
|
|
283
|
-
"allowNo": false,
|
|
284
|
-
"type": "boolean"
|
|
285
|
-
},
|
|
286
|
-
"issuesOnly": {
|
|
287
|
-
"description": "課題のみを更新する",
|
|
288
|
-
"name": "issuesOnly",
|
|
289
|
-
"required": false,
|
|
290
|
-
"allowNo": false,
|
|
291
|
-
"type": "boolean"
|
|
292
|
-
},
|
|
293
|
-
"projectIdOrKey": {
|
|
294
|
-
"description": "Backlog project ID or key",
|
|
295
|
-
"name": "projectIdOrKey",
|
|
296
|
-
"required": false,
|
|
297
|
-
"hasDynamicHelp": false,
|
|
298
|
-
"multiple": false,
|
|
299
|
-
"type": "option"
|
|
300
|
-
},
|
|
301
|
-
"wikisOnly": {
|
|
302
|
-
"description": "Wikiのみを更新する",
|
|
303
|
-
"name": "wikisOnly",
|
|
304
|
-
"required": false,
|
|
305
|
-
"allowNo": false,
|
|
306
|
-
"type": "boolean"
|
|
307
|
-
}
|
|
308
|
-
},
|
|
309
|
-
"hasDynamicHelp": false,
|
|
310
|
-
"hiddenAliases": [],
|
|
311
|
-
"id": "update",
|
|
312
|
-
"pluginAlias": "backlog-exporter",
|
|
313
|
-
"pluginName": "backlog-exporter",
|
|
314
|
-
"pluginType": "core",
|
|
315
|
-
"strict": true,
|
|
316
|
-
"enableJsonFlag": false,
|
|
317
|
-
"isESM": true,
|
|
318
|
-
"relativePath": [
|
|
319
|
-
"dist",
|
|
320
|
-
"commands",
|
|
321
|
-
"update",
|
|
322
|
-
"index.js"
|
|
323
|
-
]
|
|
324
|
-
},
|
|
325
|
-
"wiki": {
|
|
326
|
-
"aliases": [],
|
|
327
|
-
"args": {},
|
|
328
|
-
"description": "Backlogから Wiki を取得してMarkdownファイルとして保存する",
|
|
329
|
-
"examples": [
|
|
330
|
-
"<%= config.bin %> <%= command.id %> --domain example.backlog.jp --projectIdOrKey PROJECT_KEY --apiKey YOUR_API_KEY\nWikiをダウンロードする\n",
|
|
331
|
-
"<%= config.bin %> <%= command.id %> --domain example.backlog.jp --projectIdOrKey PROJECT_KEY --apiKey YOUR_API_KEY --output ./my-project\n指定したディレクトリにWikiを保存する\n"
|
|
332
|
-
],
|
|
333
|
-
"flags": {
|
|
334
|
-
"apiKey": {
|
|
335
|
-
"description": "Backlog API key (環境変数 BACKLOG_API_KEY からも自動読み取り可能)",
|
|
336
|
-
"name": "apiKey",
|
|
337
|
-
"required": false,
|
|
338
|
-
"hasDynamicHelp": false,
|
|
339
|
-
"multiple": false,
|
|
340
|
-
"type": "option"
|
|
341
|
-
},
|
|
342
|
-
"domain": {
|
|
343
|
-
"description": "Backlog domain (e.g. example.backlog.jp)",
|
|
344
|
-
"name": "domain",
|
|
345
|
-
"required": true,
|
|
346
|
-
"hasDynamicHelp": false,
|
|
347
|
-
"multiple": false,
|
|
348
|
-
"type": "option"
|
|
349
|
-
},
|
|
350
|
-
"output": {
|
|
351
|
-
"char": "o",
|
|
352
|
-
"description": "出力ディレクトリパス",
|
|
353
|
-
"name": "output",
|
|
354
|
-
"required": false,
|
|
355
|
-
"hasDynamicHelp": false,
|
|
356
|
-
"multiple": false,
|
|
357
|
-
"type": "option"
|
|
358
|
-
},
|
|
359
|
-
"projectIdOrKey": {
|
|
360
|
-
"description": "Backlog project ID or key",
|
|
361
|
-
"name": "projectIdOrKey",
|
|
362
|
-
"required": true,
|
|
363
|
-
"hasDynamicHelp": false,
|
|
364
|
-
"multiple": false,
|
|
365
|
-
"type": "option"
|
|
366
|
-
}
|
|
367
|
-
},
|
|
368
|
-
"hasDynamicHelp": false,
|
|
369
|
-
"hiddenAliases": [],
|
|
370
|
-
"id": "wiki",
|
|
371
|
-
"pluginAlias": "backlog-exporter",
|
|
372
|
-
"pluginName": "backlog-exporter",
|
|
373
|
-
"pluginType": "core",
|
|
374
|
-
"strict": true,
|
|
375
|
-
"enableJsonFlag": false,
|
|
376
|
-
"isESM": true,
|
|
377
|
-
"relativePath": [
|
|
378
|
-
"dist",
|
|
379
|
-
"commands",
|
|
380
|
-
"wiki",
|
|
381
|
-
"index.js"
|
|
382
|
-
]
|
|
383
|
-
}
|
|
384
|
-
},
|
|
385
|
-
"version": "0.6.1"
|
|
2
|
+
"commands": {},
|
|
3
|
+
"version": "0.7.0"
|
|
386
4
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "backlog-exporter",
|
|
3
3
|
"description": "A new CLI generated with oclif",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.7.0",
|
|
5
5
|
"author": "ShuntaToda",
|
|
6
6
|
"bin": {
|
|
7
7
|
"backlog-exporter": "bin/run.js"
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
"mocha": "^10",
|
|
29
29
|
"nock": "^14.0.1",
|
|
30
30
|
"oclif": "^4",
|
|
31
|
+
"prettier": "^3.6.2",
|
|
31
32
|
"shx": "^0.3.3",
|
|
32
33
|
"ts-node": "^10",
|
|
33
34
|
"typescript": "^5"
|
|
@@ -68,6 +69,8 @@
|
|
|
68
69
|
},
|
|
69
70
|
"scripts": {
|
|
70
71
|
"build": "shx rm -rf dist && tsc -b",
|
|
72
|
+
"format": "prettier --write .",
|
|
73
|
+
"format:check": "prettier --check .",
|
|
71
74
|
"lint": "eslint",
|
|
72
75
|
"postpack": "shx rm -f oclif.manifest.json",
|
|
73
76
|
"posttest": "npm run lint",
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Command } from '@oclif/core';
|
|
2
|
-
export default class All extends Command {
|
|
3
|
-
static description: string;
|
|
4
|
-
static examples: string[];
|
|
5
|
-
static flags: {
|
|
6
|
-
apiKey: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
|
-
domain: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
|
-
exclude: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
-
maxCount: import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
-
only: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
-
output: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
-
projectIdOrKey: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
-
};
|
|
14
|
-
run(): Promise<void>;
|
|
15
|
-
}
|
|
@@ -1,189 +0,0 @@
|
|
|
1
|
-
import { Command, Flags } from '@oclif/core';
|
|
2
|
-
import * as dotenv from 'dotenv';
|
|
3
|
-
import path from 'node:path';
|
|
4
|
-
import { downloadDocuments, downloadIssues, downloadWikis } from '../../utils/backlog-api.js';
|
|
5
|
-
import { validateAndGetProjectId } from '../../utils/backlog.js';
|
|
6
|
-
import { createOutputDirectory, getApiKey } from '../../utils/common.js';
|
|
7
|
-
import { FolderType, updateSettings } from '../../utils/settings.js';
|
|
8
|
-
// .envファイルを読み込む
|
|
9
|
-
dotenv.config();
|
|
10
|
-
export default class All extends Command {
|
|
11
|
-
static description = 'Backlogから課題・Wiki・ドキュメントを取得してMarkdownファイルとして保存する';
|
|
12
|
-
static examples = [
|
|
13
|
-
`<%= config.bin %> <%= command.id %> --domain example.backlog.jp --projectIdOrKey PROJECT_KEY --apiKey YOUR_API_KEY
|
|
14
|
-
課題・Wiki・ドキュメントをMarkdownファイルとして保存する
|
|
15
|
-
`,
|
|
16
|
-
`<%= config.bin %> <%= command.id %> --domain example.backlog.jp --projectIdOrKey PROJECT_KEY --apiKey YOUR_API_KEY --output ./my-project
|
|
17
|
-
指定したディレクトリに課題・Wiki・ドキュメントを保存する
|
|
18
|
-
`,
|
|
19
|
-
`<%= config.bin %> <%= command.id %> --domain example.backlog.jp --projectIdOrKey PROJECT_KEY --apiKey YOUR_API_KEY --only issues,wiki
|
|
20
|
-
課題とWikiのみを取得する
|
|
21
|
-
`,
|
|
22
|
-
`<%= config.bin %> <%= command.id %> --domain example.backlog.jp --projectIdOrKey PROJECT_KEY --apiKey YOUR_API_KEY --exclude documents
|
|
23
|
-
ドキュメント以外(課題とWiki)を取得する
|
|
24
|
-
`,
|
|
25
|
-
`<%= config.bin %> <%= command.id %> --domain example.backlog.jp --projectIdOrKey PROJECT_KEY --apiKey YOUR_API_KEY --maxCount 1000
|
|
26
|
-
最大1000件の課題を取得する(デフォルトは5000件)
|
|
27
|
-
`,
|
|
28
|
-
];
|
|
29
|
-
static flags = {
|
|
30
|
-
apiKey: Flags.string({
|
|
31
|
-
description: 'Backlog API key (環境変数 BACKLOG_API_KEY からも自動読み取り可能)',
|
|
32
|
-
required: false,
|
|
33
|
-
}),
|
|
34
|
-
domain: Flags.string({
|
|
35
|
-
description: 'Backlog domain (e.g. example.backlog.jp)',
|
|
36
|
-
required: true,
|
|
37
|
-
}),
|
|
38
|
-
exclude: Flags.string({
|
|
39
|
-
description: "Exclude the specified types, separated by commas (e.g., 'documents,wiki')",
|
|
40
|
-
required: false,
|
|
41
|
-
}),
|
|
42
|
-
maxCount: Flags.integer({
|
|
43
|
-
char: 'm',
|
|
44
|
-
default: 5000,
|
|
45
|
-
description: '一度に取得する課題の最大数(デフォルト: 5000)',
|
|
46
|
-
required: false,
|
|
47
|
-
}),
|
|
48
|
-
only: Flags.string({
|
|
49
|
-
description: "Export only the specified types, separated by commas (e.g., 'issues,wiki')",
|
|
50
|
-
required: false,
|
|
51
|
-
}),
|
|
52
|
-
output: Flags.string({
|
|
53
|
-
char: 'o',
|
|
54
|
-
description: '出力ディレクトリパス',
|
|
55
|
-
required: false,
|
|
56
|
-
}),
|
|
57
|
-
projectIdOrKey: Flags.string({
|
|
58
|
-
description: 'Backlog project ID or key',
|
|
59
|
-
required: true,
|
|
60
|
-
}),
|
|
61
|
-
};
|
|
62
|
-
async run() {
|
|
63
|
-
const { flags } = await this.parse(All);
|
|
64
|
-
try {
|
|
65
|
-
const { domain, exclude, maxCount, only, projectIdOrKey } = flags;
|
|
66
|
-
const apiKey = flags.apiKey || getApiKey(this);
|
|
67
|
-
const outputRoot = flags.output || './backlog-data';
|
|
68
|
-
// Check for conflicting flags
|
|
69
|
-
if (only && exclude) {
|
|
70
|
-
this.error('Cannot use both --only and --exclude flags together. Please use only one.');
|
|
71
|
-
}
|
|
72
|
-
// Determine targets based on flags
|
|
73
|
-
let targets;
|
|
74
|
-
if (only) {
|
|
75
|
-
targets = only.split(',');
|
|
76
|
-
}
|
|
77
|
-
else if (exclude) {
|
|
78
|
-
const excludeTargets = exclude.split(',');
|
|
79
|
-
const allTargets = ['issues', 'wiki', 'documents'];
|
|
80
|
-
targets = allTargets.filter(target => !excludeTargets.includes(target));
|
|
81
|
-
}
|
|
82
|
-
else {
|
|
83
|
-
targets = ['issues', 'wiki', 'documents'];
|
|
84
|
-
}
|
|
85
|
-
// Validate targets
|
|
86
|
-
const validTargets = ['issues', 'wiki', 'documents'];
|
|
87
|
-
const inputTargets = only ? only.split(',') : exclude ? exclude.split(',') : [];
|
|
88
|
-
for (const target of inputTargets) {
|
|
89
|
-
if (!validTargets.includes(target)) {
|
|
90
|
-
this.error(`Invalid target '${target}'. Available targets are: ${validTargets.join(', ')}`);
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
// Check if any targets remain after exclusion
|
|
94
|
-
if (targets.length === 0) {
|
|
95
|
-
this.error('No targets remaining after exclusion. Please specify valid targets to export.');
|
|
96
|
-
}
|
|
97
|
-
// 出力ディレクトリの作成
|
|
98
|
-
await createOutputDirectory(outputRoot);
|
|
99
|
-
// プロジェクトキーからプロジェクトIDを取得
|
|
100
|
-
const projectId = await validateAndGetProjectId(domain, projectIdOrKey, apiKey);
|
|
101
|
-
this.log(`プロジェクトID: ${projectId} を使用します`);
|
|
102
|
-
if (targets.includes('issues')) {
|
|
103
|
-
// 課題の出力ディレクトリ
|
|
104
|
-
const issueOutput = path.join(outputRoot, 'issues');
|
|
105
|
-
await createOutputDirectory(issueOutput);
|
|
106
|
-
// 課題フォルダに設定ファイルを保存
|
|
107
|
-
await updateSettings(issueOutput, {
|
|
108
|
-
apiKey,
|
|
109
|
-
domain,
|
|
110
|
-
folderType: FolderType.ISSUE,
|
|
111
|
-
outputDir: issueOutput,
|
|
112
|
-
projectIdOrKey,
|
|
113
|
-
});
|
|
114
|
-
// 課題の取得と保存
|
|
115
|
-
this.log('課題の取得を開始します...');
|
|
116
|
-
await downloadIssues(this, {
|
|
117
|
-
apiKey,
|
|
118
|
-
count: maxCount,
|
|
119
|
-
domain,
|
|
120
|
-
outputDir: issueOutput,
|
|
121
|
-
projectId,
|
|
122
|
-
});
|
|
123
|
-
// 課題フォルダの最終更新日時を更新
|
|
124
|
-
await updateSettings(issueOutput, {
|
|
125
|
-
lastUpdated: new Date().toISOString(),
|
|
126
|
-
});
|
|
127
|
-
this.log('課題の取得が完了しました');
|
|
128
|
-
}
|
|
129
|
-
if (targets.includes('wiki')) {
|
|
130
|
-
// Wikiの出力ディレクトリ
|
|
131
|
-
const wikiOutput = path.join(outputRoot, 'wiki');
|
|
132
|
-
await createOutputDirectory(wikiOutput);
|
|
133
|
-
// Wikiフォルダに設定ファイルを保存
|
|
134
|
-
await updateSettings(wikiOutput, {
|
|
135
|
-
apiKey,
|
|
136
|
-
domain,
|
|
137
|
-
folderType: FolderType.WIKI,
|
|
138
|
-
outputDir: wikiOutput,
|
|
139
|
-
projectIdOrKey,
|
|
140
|
-
});
|
|
141
|
-
// Wikiの取得と保存
|
|
142
|
-
this.log('Wikiの取得を開始します...');
|
|
143
|
-
await downloadWikis(this, {
|
|
144
|
-
apiKey,
|
|
145
|
-
domain,
|
|
146
|
-
outputDir: wikiOutput,
|
|
147
|
-
projectIdOrKey,
|
|
148
|
-
});
|
|
149
|
-
// Wikiフォルダの最終更新日時を更新
|
|
150
|
-
await updateSettings(wikiOutput, {
|
|
151
|
-
lastUpdated: new Date().toISOString(),
|
|
152
|
-
});
|
|
153
|
-
this.log('Wikiの取得が完了しました');
|
|
154
|
-
}
|
|
155
|
-
if (targets.includes('documents')) {
|
|
156
|
-
// ドキュメントの出力ディレクトリ
|
|
157
|
-
const documentOutput = path.join(outputRoot, 'documents');
|
|
158
|
-
await createOutputDirectory(documentOutput);
|
|
159
|
-
// ドキュメントフォルダに設定ファイルを保存
|
|
160
|
-
await updateSettings(documentOutput, {
|
|
161
|
-
apiKey,
|
|
162
|
-
domain,
|
|
163
|
-
folderType: FolderType.DOCUMENT,
|
|
164
|
-
outputDir: documentOutput,
|
|
165
|
-
projectIdOrKey,
|
|
166
|
-
});
|
|
167
|
-
// ドキュメントの取得と保存
|
|
168
|
-
this.log('ドキュメントの取得を開始します...');
|
|
169
|
-
await downloadDocuments(this, {
|
|
170
|
-
apiKey,
|
|
171
|
-
domain,
|
|
172
|
-
outputDir: documentOutput,
|
|
173
|
-
projectId,
|
|
174
|
-
projectIdOrKey,
|
|
175
|
-
});
|
|
176
|
-
// ドキュメントフォルダの最終更新日時を更新
|
|
177
|
-
await updateSettings(documentOutput, {
|
|
178
|
-
lastUpdated: new Date().toISOString(),
|
|
179
|
-
});
|
|
180
|
-
this.log('ドキュメントの取得が完了しました');
|
|
181
|
-
}
|
|
182
|
-
this.log('すべてのデータの取得が完了しました!');
|
|
183
|
-
}
|
|
184
|
-
catch (error) {
|
|
185
|
-
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
186
|
-
this.error(`データの取得に失敗しました: ${errorMessage}`);
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Command } from '@oclif/core';
|
|
2
|
-
export default class Document extends Command {
|
|
3
|
-
static description: string;
|
|
4
|
-
static examples: string[];
|
|
5
|
-
static flags: {
|
|
6
|
-
apiKey: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
|
-
domain: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
|
-
keyword: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
-
output: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
-
projectIdOrKey: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
-
};
|
|
12
|
-
run(): Promise<void>;
|
|
13
|
-
}
|