@bifos/dooray-cli 0.6.0 → 0.8.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bifos/dooray-cli",
3
- "version": "0.6.0",
3
+ "version": "0.8.0",
4
4
  "description": "CLI tool for Dooray project management — AI agent & terminal friendly",
5
5
  "keywords": [
6
6
  "dooray",
@@ -66,6 +66,7 @@ dooray doctor # 설정 검증
66
66
  | 업무 워크플로우 변경 | `dooray post workflow <project> <number> <workflow>` |
67
67
  | 댓글 조회 | `dooray post comment list <project> <number>` — `--sort asc\|desc`, `--reverse`, `--latest <n>`, `--since <iso>`, `--from-author <name>` 필터 지원. table 출력은 Creator 이름 자동 채움, `--json`은 raw 유지 (ADR-021) |
68
68
  | 최신 댓글 조회 | `dooray post comment latest <project> <number>` — 최신 댓글 1개 빠른 조회. `-n <N>`으로 N개 지정 |
69
+ | 단일 댓글 조회 | `dooray post comment get <project> <number> <comment-id> --json` — 단일 댓글 본문·메타·attachments 직접 fetch. `comment list` 후 jq 필터 우회 불필요. `--id <postId> --comment-id <id>` / `--url <url> --comment-id <id>` 모드 지원 |
69
70
  | 댓글 추가 | `dooray post comment add <project> <number> --body "..."` 또는 `--body-file <path>` |
70
71
  | 댓글 수정 | `dooray post comment edit <project> <number> <comment-id> --body "..."` 또는 `--body-file <path>` |
71
72
  | 댓글 삭제 | `dooray post comment delete <project> <number> <comment-id>` |
@@ -91,6 +92,9 @@ dooray doctor # 설정 검증
91
92
  | 댓글 파일 업로드 | `dooray post comment file upload <project> <number> <comment-id> <path>` |
92
93
  | 댓글 파일 다운로드 | `dooray post comment file download <project> <number> <comment-id> <file-id>` |
93
94
  | 댓글 파일 삭제 | `dooray post comment file delete <project> <number> <comment-id> <file-id> --yes` |
95
+ | 참조자(cc) 멤버/그룹 추가 | `dooray post edit <project> <number> --cc-group <code>` — 기존 참조자 유지 + 그룹 추가 (dedupe, ADR-025) |
96
+ | 참조자 전체 교체 | `dooray post edit <project> <number> --cc-clear --cc <name>` — 기존 참조자 비우고 신규 멤버만 |
97
+ | 신규 업무 + 그룹 cc | `dooray post create <project> --title "..." --cc-group <code>` — 생성 시 그룹 참조자 포함 |
94
98
 
95
99
  > **제목 옵션 네이밍**: `post` 와 `wiki page` 모두 `--title` 표준. `post`의 `--subject`는 deprecated alias로 당분간 동작하되, 새 코드에서는 `--title` 사용을 권장.
96
100
 
@@ -102,7 +106,7 @@ CLI로 처리 **불가능한** 작업. 아래 항목을 요청받으면 웹 UI
102
106
 
103
107
  | 작업 | 대체 경로 | 근거 |
104
108
  |---|---|---|
105
- | 위키 페이지 **삭제** | 웹 UI (`https://{tenant}.dooray.com/wiki/...`) | Dooray REST API에 해당 엔드포인트 없음 (위키 댓글·첨부파일 삭제는 있지만 페이지 자체는 없음, `docs/dooray-api-reference.md` §7 참조) |
109
+ | 위키 페이지 **삭제** | 웹 UI (`https://{tenant}.dooray.com/wiki/...`) | Dooray REST API에 해당 엔드포인트 없음 (위키 댓글·첨부파일 삭제는 있지만 페이지 자체는 없음 ADR 또는 Dooray 공식 API 문서 미제공) |
106
110
  | 프로젝트 삭제 | 웹 UI (admin 페이지) | API 미지원 |
107
111
 
108
112
  위키 페이지를 잘못 만든 경우(테스트/중복) **soft delete(빈 제목·본문) 우회 금지** — 페이지가 트리에 남아 사용자 혼란 유발.
@@ -181,6 +185,27 @@ dooray wiki pages <project> --json
181
185
  dooray wiki page get <project> <pageId> --json
182
186
  ```
183
187
 
188
+ ## 단일 댓글 본문 fetch
189
+
190
+ `post comment get <project> <post-number> <comment-id> --json` 으로 단일 댓글의 본문 + attachments 를 곧장 fetch. `comment list` 후 jq 필터링 우회 불필요.
191
+
192
+ 본문 patch 흐름:
193
+ 1. `dooray post comment get <p> <n> <id> --json | jq -r '.body.content' > current.md`
194
+ 2. (편집)
195
+ 3. `dooray post comment edit <p> <n> <id> --body-file current.md --no-confirm` (attachment guard 통과)
196
+
197
+ ---
198
+
199
+ ## 본문 수정 (attachment 보호)
200
+
201
+ `post edit` / `post comment edit` 는 full-replace 방식이다. 자동화에서는 다음 중 하나를 선택:
202
+
203
+ 1. **기존 attachment 보존**:
204
+ - `post edit` 수정 전: `dooray post get <project> <post-number> --json` 으로 `.body.content` 에서 `/files/<id>` 패턴 추출
205
+ - `post comment edit` 수정 전: `dooray post comment list <project> <post-number> --json` 으로 해당 댓글 본문에서 `/files/<id>` 패턴 추출
206
+ 추출한 markdown reference 를 새 본문에 그대로 포함하여 전달
207
+ 2. **명시적 제거**: attachment 가 더 이상 필요 없다고 판단하면 `--no-confirm` 으로 진행. 누락이 의도한 결과임을 명시
208
+
184
209
  ---
185
210
 
186
211
  ## 커맨드 상세
@@ -257,6 +282,46 @@ dooray post edit <project> <number> --body "새 본문"
257
282
  dooray post edit <project> <number> --title "새 제목" --body-file ./updated.md
258
283
  ```
259
284
 
285
+ ### 참조자(cc) / 담당자(to) 변경 — 멤버 · 그룹 (ADR-025)
286
+
287
+ ```bash
288
+ # 기존 참조자 유지 + 그룹 추가 (dedupe: organizationMemberId / projectMemberGroupId)
289
+ dooray post edit <project> <number> --cc-group dev-team
290
+
291
+ # 기존 참조자 전부 비우고 신규 멤버만
292
+ dooray post edit <project> <number> --cc-clear --cc 홍길동
293
+
294
+ # 담당자(to)도 동일 패턴: --to / --to-group / --to-clear
295
+ dooray post edit <project> <number> --to 김철수 --to-group qa-team
296
+ ```
297
+
298
+ dry-run 으로 변경 결과 미리보기 (API 호출 없음):
299
+
300
+ ```bash
301
+ dooray post edit --id "$POST_ID" --cc-group qa-team --dry-run --json \
302
+ | jq '.users.cc'
303
+ ```
304
+
305
+ > interactive (`$EDITOR`) 모드에서는 위 옵션이 무시되고 stderr 경고가 출력됩니다.
306
+
307
+ ## 신규 업무 생성 후 그룹 cc 첨부 (ADR-025)
308
+
309
+ audit 리포트 분석 → 신규 업무 생성 → 후속으로 특정 그룹을 참조에 추가하는 자동화 패턴:
310
+
311
+ ```bash
312
+ # 1. 신규 업무 생성 (그룹 cc 포함)
313
+ POST_ID=$(dooray post create <project> \
314
+ --title "주간 audit 리포트" \
315
+ --body-file ./report.md \
316
+ --cc-group dev-team \
317
+ --json | jq -r '.id')
318
+
319
+ # 2. (필요 시) 후속으로 cc 추가
320
+ dooray post edit --id "$POST_ID" --cc-group qa-team
321
+ ```
322
+
323
+ ---
324
+
260
325
  ### 댓글 추가 (non-interactive)
261
326
 
262
327
  ```bash
@@ -279,9 +344,14 @@ dooray post comment latest <project> <number>
279
344
 
280
345
  ---
281
346
 
282
- ## 멘션 자동 작성 (post comment add/edit)
347
+ ## 멘션·링크 자동 삽입 (first-class)
348
+
349
+ `post create`, `post edit`, `post comment add`, `post comment edit` 모두 지원:
283
350
 
284
- `--mention <name>` (반복) 또는 `--mention-group <code>` (반복)으로 본문 앞에 멘션 마크업을 자동 prepend한다. 아래 "Dooray 마크다운 링크 형식" 섹션의 URL 형식을 자동 출력한다.
351
+ - `--mention <name>` (반복) 이름으로 멤버 resolve dooray:// markdown prepend
352
+ - `--mention-group <code>` (반복) — 그룹 코드로 resolve
353
+ - `--link-task <project>/<number>` (반복) — 다른 업무 link 를 본문 끝에 append. 19자리 postId 도 가능
354
+ - `--dry-run` — API 호출 없이 합성 결과만 stdout. CI / 자동화 검증용
285
355
 
286
356
  ```bash
287
357
  dooray post comment add P 1 --mention 홍길동 --mention-group 개발 --body "..."
@@ -290,7 +360,7 @@ dooray post comment add P 1 --mention 홍길동 --mention-group 개발 --body ".
290
360
 
291
361
  - 이름 부분일치 지원 (모호하면 에러 + 후보 목록 출력)
292
362
  - 멤버 먼저, 그룹 다음 순서 고정
293
- - comment edit에도 동일 옵션 사용 (`$EDITOR` 모드에서는 EDITOR 진입 전에 prepend)
363
+ - interactive (`$EDITOR`) 모드의 `post edit` mention/link-task 무시 + stderr 경고
294
364
 
295
365
  ## Dooray 마크다운 링크 형식 (멤버·그룹·업무 멘션)
296
366