backlog-exporter 1.0.0 → 1.1.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.
Files changed (64) hide show
  1. package/README.md +23 -1
  2. package/dist/commands/all/index.d.ts +1 -0
  3. package/dist/commands/all/index.js +8 -2
  4. package/dist/commands/document/index.d.ts +1 -0
  5. package/dist/commands/document/index.js +9 -2
  6. package/dist/commands/issue/index.d.ts +1 -0
  7. package/dist/commands/issue/index.js +12 -2
  8. package/dist/commands/update/index.d.ts +1 -0
  9. package/dist/commands/update/index.js +5 -0
  10. package/dist/commands/wiki/index.d.ts +1 -0
  11. package/dist/commands/wiki/index.js +9 -2
  12. package/dist/composition/backlog-repositories.d.ts +1 -1
  13. package/dist/composition/backlog-repositories.js +1 -1
  14. package/dist/modules/all/use-case/export-all.d.ts +1 -0
  15. package/dist/modules/all/use-case/export-all.js +7 -1
  16. package/dist/modules/document/domain/document-markdown.d.ts +1 -1
  17. package/dist/modules/document/domain/document-markdown.js +6 -3
  18. package/dist/modules/document/domain/document-path.d.ts +8 -0
  19. package/dist/modules/document/domain/document-path.js +9 -0
  20. package/dist/modules/document/domain/document-repository.d.ts +1 -0
  21. package/dist/modules/document/repository/backlog-document-repository.js +4 -0
  22. package/dist/modules/document/use-case/export-documents.d.ts +1 -0
  23. package/dist/modules/document/use-case/export-documents.js +28 -3
  24. package/dist/modules/issue/domain/issue-markdown.d.ts +4 -3
  25. package/dist/modules/issue/domain/issue-markdown.js +23 -8
  26. package/dist/modules/issue/domain/issue-path.d.ts +12 -1
  27. package/dist/modules/issue/domain/issue-path.js +12 -0
  28. package/dist/modules/issue/domain/issue-repository.d.ts +1 -0
  29. package/dist/modules/issue/domain/issue.d.ts +6 -0
  30. package/dist/modules/issue/repository/backlog-issue-repository.js +3 -0
  31. package/dist/modules/issue/use-case/export-issues.d.ts +1 -0
  32. package/dist/modules/issue/use-case/export-issues.js +29 -3
  33. package/dist/modules/prune/repository/prune-walker.js +5 -0
  34. package/dist/modules/prune/use-case/prune-directories.d.ts +1 -1
  35. package/dist/modules/prune/use-case/prune-directories.js +1 -1
  36. package/dist/modules/settings/domain/settings.d.ts +1 -0
  37. package/dist/modules/update/domain/update-plan.d.ts +2 -0
  38. package/dist/modules/update/domain/update-plan.js +1 -0
  39. package/dist/modules/update/use-case/update-exports.d.ts +1 -1
  40. package/dist/modules/update/use-case/update-exports.js +4 -1
  41. package/dist/modules/wiki/domain/wiki-markdown.d.ts +6 -1
  42. package/dist/modules/wiki/domain/wiki-markdown.js +17 -2
  43. package/dist/modules/wiki/domain/wiki-path.d.ts +3 -0
  44. package/dist/modules/wiki/domain/wiki-path.js +12 -0
  45. package/dist/modules/wiki/domain/wiki-repository.d.ts +1 -0
  46. package/dist/modules/wiki/domain/wiki.d.ts +6 -0
  47. package/dist/modules/wiki/repository/backlog-wiki-repository.js +3 -0
  48. package/dist/modules/wiki/use-case/export-wikis.d.ts +1 -0
  49. package/dist/modules/wiki/use-case/export-wikis.js +31 -3
  50. package/dist/shared/attachment.d.ts +8 -0
  51. package/dist/shared/attachment.js +37 -0
  52. package/dist/shared/backlog/http-client.d.ts +5 -2
  53. package/dist/shared/backlog/http-client.js +41 -10
  54. package/dist/shared/backlog/sleep.d.ts +1 -0
  55. package/dist/shared/backlog/sleep.js +3 -0
  56. package/dist/shared/console/progress.js +8 -1
  57. package/dist/shared/file-name.d.ts +1 -0
  58. package/dist/shared/file-name.js +11 -0
  59. package/dist/shared/storage/markdown-store.d.ts +2 -0
  60. package/dist/shared/storage/markdown-store.js +11 -0
  61. package/oclif.manifest.json +43 -2
  62. package/package.json +1 -1
  63. package/dist/shared/backlog/rate-limiter.d.ts +0 -9
  64. package/dist/shared/backlog/rate-limiter.js +0 -25
@@ -31,6 +31,14 @@
31
31
  "multiple": false,
32
32
  "type": "option"
33
33
  },
34
+ "downloadAttachments": {
35
+ "char": "d",
36
+ "description": "課題の添付ファイルもダウンロードする",
37
+ "name": "downloadAttachments",
38
+ "required": false,
39
+ "allowNo": false,
40
+ "type": "boolean"
41
+ },
34
42
  "exclude": {
35
43
  "description": "Exclude the specified types, separated by commas (e.g., 'documents,wiki')",
36
44
  "name": "exclude",
@@ -131,6 +139,14 @@
131
139
  "multiple": false,
132
140
  "type": "option"
133
141
  },
142
+ "downloadAttachments": {
143
+ "char": "d",
144
+ "description": "添付ファイルもダウンロードする",
145
+ "name": "downloadAttachments",
146
+ "required": false,
147
+ "allowNo": false,
148
+ "type": "boolean"
149
+ },
134
150
  "keyword": {
135
151
  "description": "検索キーワード",
136
152
  "name": "keyword",
@@ -184,7 +200,8 @@
184
200
  "<%= config.bin %> <%= command.id %> --domain example.backlog.jp --projectIdOrKey PROJECT_KEY --apiKey YOUR_API_KEY --maxCount 10000\n最大10000件の課題を取得する(デフォルトは5000件)\n",
185
201
  "<%= config.bin %> <%= command.id %> --domain example.backlog.jp --projectIdOrKey PROJECT_KEY --apiKey YOUR_API_KEY --issueKeyFileName\nファイル名を課題キーにする\n",
186
202
  "<%= config.bin %> <%= command.id %> --domain example.backlog.jp --projectIdOrKey PROJECT_KEY --apiKey YOUR_API_KEY --issueKeyFolder\n課題キーでフォルダを作成する\n",
187
- "<%= config.bin %> <%= command.id %> --domain example.backlog.jp --projectIdOrKey PROJECT_KEY --apiKey YOUR_API_KEY --issueKeyFileName --issueKeyFolder\n課題キーでフォルダを作成し、ファイル名も課題キーにする\n"
203
+ "<%= config.bin %> <%= command.id %> --domain example.backlog.jp --projectIdOrKey PROJECT_KEY --apiKey YOUR_API_KEY --issueKeyFileName --issueKeyFolder\n課題キーでフォルダを作成し、ファイル名も課題キーにする\n",
204
+ "<%= config.bin %> <%= command.id %> --domain example.backlog.jp --projectIdOrKey PROJECT_KEY --apiKey YOUR_API_KEY --downloadAttachments\n課題の添付ファイルもダウンロードする\n"
188
205
  ],
189
206
  "flags": {
190
207
  "apiKey": {
@@ -203,6 +220,14 @@
203
220
  "multiple": false,
204
221
  "type": "option"
205
222
  },
223
+ "downloadAttachments": {
224
+ "char": "d",
225
+ "description": "課題の添付ファイルもダウンロードする",
226
+ "name": "downloadAttachments",
227
+ "required": false,
228
+ "allowNo": false,
229
+ "type": "boolean"
230
+ },
206
231
  "issueKeyFileName": {
207
232
  "description": "ファイル名を課題キーにする",
208
233
  "name": "issueKeyFileName",
@@ -388,6 +413,14 @@
388
413
  "multiple": false,
389
414
  "type": "option"
390
415
  },
416
+ "downloadAttachments": {
417
+ "char": "d",
418
+ "description": "課題の添付ファイルもダウンロードする(未指定時は設定ファイルの値を使用)",
419
+ "name": "downloadAttachments",
420
+ "required": false,
421
+ "allowNo": false,
422
+ "type": "boolean"
423
+ },
391
424
  "force": {
392
425
  "char": "f",
393
426
  "description": "確認プロンプトをスキップする",
@@ -490,6 +523,14 @@
490
523
  "multiple": false,
491
524
  "type": "option"
492
525
  },
526
+ "downloadAttachments": {
527
+ "char": "d",
528
+ "description": "添付ファイルもダウンロードする",
529
+ "name": "downloadAttachments",
530
+ "required": false,
531
+ "allowNo": false,
532
+ "type": "boolean"
533
+ },
493
534
  "output": {
494
535
  "char": "o",
495
536
  "description": "出力ディレクトリパス",
@@ -525,5 +566,5 @@
525
566
  ]
526
567
  }
527
568
  },
528
- "version": "1.0.0"
569
+ "version": "1.1.0"
529
570
  }
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": "1.0.0",
4
+ "version": "1.1.0",
5
5
  "author": "ShuntaToda",
6
6
  "bin": {
7
7
  "backlog-exporter": "bin/run.js"
@@ -1,9 +0,0 @@
1
- export declare const sleep: (ms: number) => Promise<void>;
2
- export declare class RateLimiter {
3
- private readonly onWait?;
4
- private requestCount;
5
- constructor(onWait?: () => void);
6
- getCount(): number;
7
- increment(): Promise<number>;
8
- setCount(count: number): void;
9
- }
@@ -1,25 +0,0 @@
1
- export const sleep = (ms) => new Promise((resolve) => {
2
- setTimeout(resolve, ms);
3
- });
4
- // Backlogのレート制限(100req/15s)対策: 100リクエストごとに15秒待機する
5
- export class RateLimiter {
6
- onWait;
7
- requestCount = 0;
8
- constructor(onWait) {
9
- this.onWait = onWait;
10
- }
11
- getCount() {
12
- return this.requestCount;
13
- }
14
- async increment() {
15
- this.requestCount++;
16
- if (this.requestCount > 1 && this.requestCount % 100 === 0) {
17
- this.onWait?.();
18
- await sleep(15_000);
19
- }
20
- return this.requestCount;
21
- }
22
- setCount(count) {
23
- this.requestCount = count;
24
- }
25
- }