@tocca-systems/twp-cli 0.146.0 → 0.147.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/CHANGELOG.public.md +4 -0
- package/README.md +6 -3
- package/dist/{api-command-BLM3DK7Z.js → api-command-OTG5TUSN.js} +1 -1
- package/dist/{app-SSCNXNWO.js → app-GDI4V2G7.js} +1 -1
- package/dist/{backlog-QMR5YEB5.js → backlog-X67QUKWT.js} +87 -57
- package/dist/{chunk-A6THUBBS.js → chunk-52GXWKG7.js} +1 -1
- package/dist/{chunk-WPMY2AL3.js → chunk-TFNUT7CA.js} +2 -2
- package/dist/cli.js +8 -6
- package/dist/{commands-C45R6NIV.js → commands-MQ6YVTSY.js} +1 -1
- package/dist/{github-git-E6LRJT7H.js → github-git-IIYT3I7N.js} +1 -1
- package/dist/{media-MLBN34CH.js → media-KQEOBN4W.js} +1 -1
- package/dist/{registry-SCH56R5U.js → registry-5ZTZX4C2.js} +1 -1
- package/dist/{run-XGSF35UT.js → run-OPK5OPAR.js} +1 -1
- package/package.json +1 -1
package/CHANGELOG.public.md
CHANGED
|
@@ -11,6 +11,10 @@
|
|
|
11
11
|
`CHANGELOG.md` に残してあります。顧客向けの履歴は public 公開以降を対象とします。
|
|
12
12
|
-->
|
|
13
13
|
|
|
14
|
+
## 0.147.0
|
|
15
|
+
|
|
16
|
+
Backlog にファイルをアップロードし、課題の作成・更新やコメントに添付できるようになりました(`twp backlog attachment upload` と `--attachment-id`)。
|
|
17
|
+
|
|
14
18
|
## 0.146.0
|
|
15
19
|
|
|
16
20
|
`twp media hls create` / `twp media hls get` で動画の HLS 変換の開始と状態・配信 URL の確認ができるようになりました(`--wait` で完了まで待てます)。`twp media project list` でファイルを扱えるプロジェクトを、`twp task attachment get` でタスクの添付1件のメタ情報を取得できます。
|
package/README.md
CHANGED
|
@@ -2235,17 +2235,19 @@ twp backlog comment list <課題キー> [--limit <件数>] [--all] [--order <asc
|
|
|
2235
2235
|
|
|
2236
2236
|
twp backlog attachment list <課題キー> # id / name / size / contentType
|
|
2237
2237
|
twp backlog attachment download <課題キー> <添付ID> --out <パス> # 実体をファイルへ書き出す
|
|
2238
|
+
twp backlog attachment upload <ファイルパス> --yes # スペースへ上げて添付ID を得る
|
|
2238
2239
|
|
|
2239
|
-
twp backlog comment create <課題キー> --body-file <パス> --yes
|
|
2240
|
+
twp backlog comment create <課題キー> --body-file <パス> [--attachment-id <ID>]... --yes
|
|
2240
2241
|
twp backlog issue create --project <キー|名称|ID> --summary <件名> --type <名前|ID> --priority <名前|ID>
|
|
2241
|
-
[--description-file <パス>] [--assignee <名前|ID>] [--due-date <yyyy-MM-dd>]
|
|
2242
|
+
[--description-file <パス>] [--assignee <名前|ID>] [--due-date <yyyy-MM-dd>]
|
|
2243
|
+
[--attachment-id <ID>]... --yes
|
|
2242
2244
|
twp backlog issue update <課題キー> [--summary <件名>] [--description-file <パス>]
|
|
2243
2245
|
[--priority <名前|ID>] [--due-date <yyyy-MM-dd>]
|
|
2244
2246
|
[--assignee <名前|ID>] [--status <名前|ID>]
|
|
2245
2247
|
[--start-date <yyyy-MM-dd>] [--milestone <ID,...>] [--affected-version <ID,...>]
|
|
2246
2248
|
[--category <ID,...>] [--resolution <ID>]
|
|
2247
2249
|
[--estimated-hours <時間>] [--actual-hours <時間>] [--clear <項目,...>]
|
|
2248
|
-
[--comment-file <パス>] [--project <キー|名称|ID>] --yes
|
|
2250
|
+
[--comment-file <パス>] [--attachment-id <ID>]... [--project <キー|名称|ID>] --yes
|
|
2249
2251
|
```
|
|
2250
2252
|
|
|
2251
2253
|
- **`--space` を省略すると、`twp configure` で設定した既定の Backlog スペース、無ければ登録が1件だけのときのそのスペースを使います**(どちらの場合も、どのスペースを使ったかを必ず表示します)。登録が2件以上で既定も無ければ `--space` で指定してください。設定した既定が登録に見つからないときは、別のスペースへ落とさずに止まります
|
|
@@ -2253,6 +2255,7 @@ twp backlog issue update <課題キー> [--summary <件名>] [--description-fi
|
|
|
2253
2255
|
- **`--project` / `--status` / `--assignee` / `--created-user` は名前でも数値 ID でも指定できます。** 複数指定はカンマ区切りです(`--status 未対応,処理中`)。名前で指定するときは、候補が Backlog プロジェクト配下にしかないため `--project` が要ります
|
|
2254
2256
|
- **`--issue-type` / `--category` / `--milestone` / `--priority` / `--resolution` は数値 ID だけを受けます**(名前は解決しません)。種別・優先度の id は `twp backlog issue get` の `issueTypeId` / `priorityId`、カテゴリーは `category[].id`、マイルストーンは `twp backlog milestone list`、完了理由は `twp backlog resolution list` で分かります(完了理由は `0` も有効です)
|
|
2255
2257
|
- 日付の範囲(`--updated-since`/`--updated-until`・`--created-since`/`--created-until`・`--start-date-since`/`--start-date-until`・`--due-date-since`/`--due-date-until`)は `yyyy-MM-dd` で両端を含みます。since が until より後のときは、送らずに止まります(終了コード 2)
|
|
2258
|
+
- ⚠ **`twp backlog attachment upload` は Backlog(外部)へ書く操作で、`--yes` が要ります**(`--dry-run` で送らずに確認できます。中身は表示しません)。返る `id` はまだどの課題にも付いていない添付で、`twp backlog issue create` / `issue update` / `comment create` の `--attachment-id <ID>`(複数なら重ねて指定)に渡して初めて課題に付きます。送るファイル名はパスの末尾だけで、上限は 30MB です
|
|
2256
2259
|
- ⚠ **`twp backlog issue list` の本文は既定で 1000 文字に切られます**(切られた課題には `descriptionTruncated: true` が付き、何件切られたかを実行のたびにお知らせします)。全文が要るときは `--description-max 0` か `twp backlog issue get`(常に全文)を使ってください
|
|
2257
2260
|
- `twp backlog comment list` の出力には担当・ステータスの変更履歴(`changeLog`)が含まれます
|
|
2258
2261
|
- `twp backlog attachment download` は **`--out` のパスへ実体をそのまま書き出します**(標準出力には書いた場所・バイト数・種別だけが出ます)。既存ファイルは上書きしません(`--force` を付けたときだけ上書きします)。書き出し先のディレクトリは自動で作りません。添付ID は `twp backlog attachment list` の `id` で、ファイル名では指定できません。落とす前の大きさは同じ一覧の `size` で分かります
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire as __twpCreateRequire } from 'node:module';
|
|
2
2
|
const require = __twpCreateRequire(import.meta.url);
|
|
3
|
-
import{CommandModelMissingError,MAX_REPORTED_VIOLATIONS,loadCommandModelDomain,loadCommandModelRoutes,validateBody,validateQuery}from"./chunk-66MFQCKL.js";import{exitCodeFor,fetchAllPages,reportError}from"./chunk-
|
|
3
|
+
import{CommandModelMissingError,MAX_REPORTED_VIOLATIONS,loadCommandModelDomain,loadCommandModelRoutes,validateBody,validateQuery}from"./chunk-66MFQCKL.js";import{exitCodeFor,fetchAllPages,reportError}from"./chunk-52GXWKG7.js";import"./chunk-TFNUT7CA.js";import{renderOutput}from"./chunk-P4QSPSOQ.js";import{evaluateQuery}from"./chunk-PAJAEUPA.js";import"./chunk-Q3B65OFC.js";import{describeWaitResult,parseWaitOptions,waitUntilTerminal}from"./chunk-3EFJQDC4.js";
|
|
4
4
|
import{readBody}from"./chunk-V5WDGX4S.js";import{ALLOW_REDACTED_FLAG,NO_REDACT_FLAG,NO_REDACT_NOTICE}from"./chunk-W4NLJ2YK.js";import{redactSecretValues,redactSecrets,withDebug}from"./chunk-BD7O73GK.js";import{parseOperationArgs,repeatedValues}from"./chunk-6NHLWYI2.js";import"./chunk-KG634EFO.js";import{ApiError,RepeatedQueryValue,TwpApiClient,appendQuery,appendRepeatable,isArrayQueryKey}from"./chunk-NUEKGK4J.js";import"./chunk-CJFIIGSH.js";import"./chunk-HVZUXLQ4.js";
|
|
5
5
|
import"./chunk-YJP4FUY4.js";import"./chunk-SBRTBKEZ.js";import{DEFAULT_MAX_ITEMS,DEFAULT_MAX_PAGES,envelopePaging,isPageNumberEnvelope,pageRangeNotes,positiveInteger,readEnvelopeCursor,readPageNumberCursor,shellQuote}from"./chunk-PMTQFMJS.js";import"./chunk-HCTPCUST.js";import{ApiResponseError,EXIT_OK,EXIT_WAIT_TIMEOUT,NetworkError,UsageError}from"./chunk-STILP3Z6.js";import{GLOBAL_OPTIONS_HELP}from"./chunk-TZL2342W.js";import{AuthSession,NotLoggedInError,SessionExpiredError}from"./chunk-ITFO5GPX.js";
|
|
6
6
|
import{loadCredentials}from"./chunk-GWVREACM.js";import{httpFetch}from"./chunk-J7QYPKVK.js";import{effectiveApiUrl,resolveConfiguredOutput,resolveProfile}from"./chunk-EDF4U5BT.js";import"./chunk-RZVI6PMW.js";import{HELP_TOKEN}from"./chunk-PLPEDJLC.js";import"./chunk-OKATZ4SN.js";import{OUTPUT_FORMATS,resolveOutputFormat}from"./chunk-RKBUJKI5.js";import"./chunk-UREA4ZIG.js";import{stripTerminalControls}from"./chunk-NHYMHCAT.js";import"./chunk-VSJBJXZO.js";var MIN_SEGMENT_CHARS=3;var parsedCache=new WeakMap;function splitSegments(path){return path.split("/").filter(segment=>segment!=="")}function parseRoutes(routes){const cached=parsedCache.get(routes);if(cached!==void 0)return cached;const parsed=[];for(const[key,domain]of Object.entries(routes.routes)){const space=key.indexOf(" ");if(space<=0)continue;const template=key.slice(space+1);parsed.push({method:key.slice(0,space),template,domain,segments:splitSegments(template).map(segment=>/^\{[^/{}]+\}$/.
|
|
@@ -1212,7 +1212,7 @@ cwd()){const listed=await gitListFiles(cwd2);const raw=listed??await walkFiles(c
|
|
|
1212
1212
|
1;const after=/^[^\s]*/.exec(text.slice(cursor))?.[0]??"";return{query,start,end:cursor+after.length}}var TWP_SLASH_ROUTES={"/tasks":{domain:"task",operation:"list"},"/task":{domain:"task",operation:"get"},"/projects":{domain:"project",operation:"list"}};function isTwpSlashCommand(name){return Object.hasOwn(TWP_SLASH_ROUTES,name)}async function runTwpSlashCommand(name,args,deps){const route=TWP_SLASH_ROUTES[name];if(!Object.hasOwn(TWP_SLASH_ROUTES,name)||route===void 0){return{code:2,out:"",err:`\u4E0D\u660E\u306A\u30B3\u30DE\u30F3\u30C9: ${name}
|
|
1213
1213
|
`}}const parsed=parseArgv([route.domain,route.operation,...args]);if(parsed.command!=="domain"||parsed.domain!==route.domain){return{code:2,out:"",err:`${name}: \u3053\u306E\u5F15\u6570\u306F\u4F7F\u3048\u307E\u305B\u3093\uFF08${args.join(" ")}\uFF09
|
|
1214
1214
|
`}}if(parsed.unknown.length>0){return{code:2,out:"",err:`\u4E0D\u660E\u306A\u5F15\u6570: ${formatUnknownArgs(parsed.unknown)}
|
|
1215
|
-
`}}let out="";let err="";const io={out:text=>void(out+=text),err:text=>void(err+=text),isTty:true};const globals={profile:parsed.profile??deps.profile,...parsed.output!==void 0?{output:parsed.output}:{},...parsed.query!==void 0?{query:parsed.query}:{},dryRun:parsed.dryRun,debug:parsed.debug,yes:parsed.yes,refresh:parsed.refresh};const{runDomain}=await import("./run-
|
|
1215
|
+
`}}let out="";let err="";const io={out:text=>void(out+=text),err:text=>void(err+=text),isTty:true};const globals={profile:parsed.profile??deps.profile,...parsed.output!==void 0?{output:parsed.output}:{},...parsed.query!==void 0?{query:parsed.query}:{},dryRun:parsed.dryRun,debug:parsed.debug,yes:parsed.yes,refresh:parsed.refresh};const{runDomain}=await import("./run-OPK5OPAR.js");try{const code=await runDomain({domain:route.domain,...parsed.operation!==void 0?{operation:parsed.operation}:
|
|
1216
1216
|
{},argv:parsed.domainArgv,help:parsed.domainHelp,globals,version:deps.version,io,...deps.fetchImpl!==void 0?{fetchImpl:deps.fetchImpl}:{}});return{code,out,err}}catch(e){return{code:1,out,err:`${err}${e.message}
|
|
1217
1217
|
`}}}var GIT_LOG_OUTPUT=["9f3c1a2 feat(ui): \u4E00\u89A7\u306E\u30D5\u30A3\u30EB\u30BF\u3092 URL \u30AF\u30A8\u30EA\u3068\u540C\u671F\u3059\u308B","4b8e0d7 fix(ui): \u4EEE\u60F3\u30B9\u30AF\u30ED\u30FC\u30EB\u306E\u884C\u9AD8\u3055\u3092\u5B9F\u6E2C\u5024\u306B\u5408\u308F\u305B\u308B","c15a99e refactor(api): \u4E00\u89A7\u53D6\u5F97\u306E\u30DA\u30FC\u30B8\u30F3\u30B0\u51E6\u7406\u3092\u5171\u901A\u5316\u3059\u308B","2d70f4b test: \u4E00\u89A7\u30D5\u30A3\u30EB\u30BF\u306E\u56DE\u5E30\u30C6\u30B9\u30C8\u3092\u8FFD\u52A0\u3059\u308B",
|
|
1218
1218
|
"a6e2b38 fix(api): \u7A7A\u306E\u691C\u7D22\u6761\u4EF6\u3067\u5168\u4EF6\u8FD4\u3089\u306A\u3044\u3088\u3046\u306B\u3059\u308B","7c40d51 chore(deps): \u958B\u767A\u4F9D\u5B58\u3092\u6700\u65B0\u3078\u66F4\u65B0\u3059\u308B","e83b1c6 docs: \u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u624B\u9806\u306B Node 22 \u306E\u524D\u63D0\u3092\u8FFD\u8A18\u3059\u308B","b91f7a4 fix(ui): \u30E2\u30FC\u30C0\u30EB\u306E\u91CD\u306A\u308A\u9806\u3092\u6307\u5B9A\u3059\u308B","5a2c8e0 perf(api): \u4E00\u89A7\u306E N+1 \u3092\u89E3\u6D88\u3059\u308B",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire as __twpCreateRequire } from 'node:module';
|
|
2
2
|
const require = __twpCreateRequire(import.meta.url);
|
|
3
|
-
import{readBody}from"./chunk-V5WDGX4S.js";import"./chunk-W4NLJ2YK.js";import"./chunk-BD7O73GK.js";import{repeatedValues}from"./chunk-6NHLWYI2.js";import{BACKLOG_PROJECT_SCOPE_LABEL,BACKLOG_SCOPE_LABEL,isExactNumericId,resolveNamed}from"./chunk-KG634EFO.js";import"./chunk-NUEKGK4J.js";import{BACKLOG_BASE_PATH,backlogSpacePath}from"./chunk-CJFIIGSH.js";import"./chunk-HVZUXLQ4.js";import"./chunk-YJP4FUY4.js";
|
|
4
|
-
LIST_FLAGS}from"./chunk-PMTQFMJS.js";import{requireResolved,singleRef,withResolved}from"./chunk-7DCWZ2NF.js";import{isRecord,pick}from"./chunk-HCTPCUST.js";import{ApiResponseError,UsageError}from"./chunk-STILP3Z6.js";import"./chunk-J7QYPKVK.js";import"./chunk-EDF4U5BT.js";import"./chunk-RZVI6PMW.js";import"./chunk-OKATZ4SN.js";import"./chunk-NHYMHCAT.js";import"./chunk-VSJBJXZO.js";var DEFAULT_COUNT=20;var MAX_COUNT=100;var NUMERIC=/^[0-9]+$/;var ISSUE_REF=/^(?:[A-Za-z0-9_]+-[0-9]+|[0-9]+)$/;var DATE=/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/;var SPACE_COLUMNS=["id","space_url"];var PROJECT_COLUMNS=["id","projectKey","name"];var ISSUE_LIST_COLUMNS=["issueKey","summary","status","assignee","priority","dueDate","updated","descriptionTruncated"];var ISSUE_GET_COLUMNS=["id","issueKey","projectId","summary","description","descriptionTruncated","status","issueType","priority","assignee","cr\
|
|
3
|
+
import{JsonBodyWithView}from"./chunk-Q3B65OFC.js";import{readBody}from"./chunk-V5WDGX4S.js";import"./chunk-W4NLJ2YK.js";import"./chunk-BD7O73GK.js";import{repeatedValues}from"./chunk-6NHLWYI2.js";import{BACKLOG_PROJECT_SCOPE_LABEL,BACKLOG_SCOPE_LABEL,isExactNumericId,resolveNamed}from"./chunk-KG634EFO.js";import"./chunk-NUEKGK4J.js";import{BACKLOG_BASE_PATH,backlogSpacePath}from"./chunk-CJFIIGSH.js";import"./chunk-HVZUXLQ4.js";import"./chunk-YJP4FUY4.js";
|
|
4
|
+
import"./chunk-SBRTBKEZ.js";import{LIST_FLAGS}from"./chunk-PMTQFMJS.js";import{requireResolved,singleRef,withResolved}from"./chunk-7DCWZ2NF.js";import{isRecord,pick}from"./chunk-HCTPCUST.js";import{ApiResponseError,UsageError}from"./chunk-STILP3Z6.js";import"./chunk-J7QYPKVK.js";import"./chunk-EDF4U5BT.js";import"./chunk-RZVI6PMW.js";import"./chunk-OKATZ4SN.js";import"./chunk-NHYMHCAT.js";import"./chunk-VSJBJXZO.js";import fs from"fs";import path from"path";var DEFAULT_COUNT=20;var MAX_COUNT=100;var NUMERIC=/^[0-9]+$/;var ISSUE_REF=/^(?:[A-Za-z0-9_]+-[0-9]+|[0-9]+)$/;var DATE=/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/;var SPACE_COLUMNS=["id","space_url"];var PROJECT_COLUMNS=["id","projectKey","name"];var ISSUE_LIST_COLUMNS=["issueKey","summary","status","assignee","priority","dueDate","updated","descriptionTruncated"];var ISSUE_GET_COLUMNS=["id","issueKey","projectId","summary","description","descriptionTruncated","status","issueType","priority","assignee","cr\
|
|
5
5
|
eatedUser","parentIssueId","startDate","dueDate","estimatedHours","actualHours","created","updated"];var ISSUE_JSON_SHAPE_HELP='--output json \u306E\u5F62\uFF08Backlog API \u306E\u5F62\u3067\u306F\u3042\u308A\u307E\u305B\u3093\uFF09:\n TWP \u30B5\u30FC\u30D0\u304C\u6574\u3048\u305F\u5F62\u3067\u8FD4\u308A\u307E\u3059\u3002Backlog API \u306E\u8AB2\u984C\u3092\u305D\u306E\u307E\u307E\u8AAD\u3080\u524D\u63D0\u3067\u66F8\u304F\u3068\u58CA\u308C\u307E\u3059\u3002\n - status / priority / resolution / issueType / assignee / createdUser / updatedUser \u306F\n \u540D\u524D\u306E\u6587\u5B57\u5217\u3067\u3059\uFF08{id, name} \u3067\u306F\u3042\u308A\u307E\u305B\u3093\uFF09\u3002ID \u306F statusId / issueTypeId /\n assigneeId \u2026 \u306E\u3088\u3046\u306B\u672B\u5C3E Id \u306E\u5225\u30AD\u30FC\u306B\u3042\u308A\u307E\u3059\u3002\u672A\u8A2D\u5B9A\u306A\u3089\u4E21\u65B9 null \u3067\u3059\u3002\n - category / versions / milestone \u306F {id, name} \u306E\u914D\u5217\u306E\u307E\u307E\u3067\u3059\uFF08\u8907\u6570\u4ED8\u3051\u3089\u308C\u308B\u305F\u3081\u3001\n \
|
|
6
6
|
\u540D\u524D\u3068 ID \u3092\u5225\u30AD\u30FC\u3078\u5206\u3051\u308B\u3068\u5BFE\u5FDC\u304C\u5D29\u308C\u307E\u3059\uFF09\u3002customFields \u3082\u914D\u5217\u3067\u3059\u3002\n \u4F8B\uFF081\u4EF6\u30FB\u629C\u7C8B\uFF09:\n {"id": 1234, "issueKey": "PRJ-12", "summary": "\u2026",\n "statusId": 1, "status": "\u672A\u5BFE\u5FDC", "issueTypeId": 56, "issueType": "\u30BF\u30B9\u30AF",\n "assigneeId": 91, "assignee": "\u8C37 \u6A39",\n "category": [{"id": 7, "name": "\u8A2D\u8A08"}], "milestone": [], ...}\n --query \u3082\u3053\u306E\u5F62\u306B\u5F53\u305F\u308A\u307E\u3059\uFF08issue list \u306E\u4F8B: --query "[].{key: issueKey, type: issueType}"\uFF09\u3002';
|
|
7
7
|
var COMMENT_COLUMNS=["id","created","createdUserId","createdUser","content","changeLog"];function commentRow(row){const source=isRecord(row)?row:{};const user=isRecord(source["createdUser"])?source["createdUser"]:{};return pick({...source,createdUserId:user["id"]??null,createdUser:user["name"]??null},COMMENT_COLUMNS)}var ATTACHMENT_COLUMNS=["id","name","size","contentType","createdUserId","createdUser","created"];var STATUS_COLUMNS=["id","name","color"];var USER_COLUMNS=["id","userId","name","ma\
|
|
@@ -41,29 +41,31 @@ return resolved.id}async function resolveUpdateRef(ref,projectId,load){if(ref.pr
|
|
|
41
41
|
resolved.id)){throw new ApiResponseError(`${ref.label}\u300C${ref.value}\u300D\u306E ID \u3092\u6570\u5024\u3068\u3057\u3066\u9001\u308C\u307E\u305B\u3093: ${JSON.stringify(resolved.id)}\u3002\u63A5\u7D9A\u5148\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002`)}return resolved.id}var NOTIFY_FLAG={name:"--notify",summary:"\u30B3\u30E1\u30F3\u30C8\u306E\u901A\u77E5\u5148\uFF08Backlog \u306E\u300C\u304A\u77E5\u3089\u305B\u3057\u305F\u3044\u30E6\u30FC\u30B6\u30FC\u300D\uFF09\u3002\u8907\u6570\u306A\u3089\u91CD\u306D\u3066\u6307\u5B9A\u3002\u6570\u5B57\u3060\u3051\u306E\u5024\u306F ID \u3068\u3057\u3066\u9001\u308A\u307E\u3059\uFF08\u540D\u524D\u306A\u3089 --project \u304C\u8981\u308B\uFF09",
|
|
42
42
|
takesValue:true,repeatable:true,placeholder:"<\u540D\u524D|ID>"};var NOTIFY_HELP="--notify <\u540D\u524D|ID> \u3067\u3001\u30B3\u30E1\u30F3\u30C8\u306E\u901A\u77E5\u5148\uFF08Backlog \u306E\u300C\u304A\u77E5\u3089\u305B\u3057\u305F\u3044\u30E6\u30FC\u30B6\u30FC\u300D\uFF09\u3092\u6307\u5B9A\u3067\u304D\u307E\u3059\u3002\n \u26A0 \u6307\u5B9A\u3057\u306A\u3044\u3068\u3001\u62C5\u5F53\u8005\u4EE5\u5916\u3078\u306F\u901A\u77E5\u304C\u5C4A\u304B\u306A\u3044\u3053\u3068\u304C\u3042\u308A\u307E\u3059\u3002\u62C5\u5F53\u3092\u5909\u3048\u305A\u306B\u76F8\u624B\u3078\u805E\u304D\u305F\u3044\u3068\u304D\u306F\n \u62C5\u5F53\u5909\u66F4\u3067\u4EE3\u7528\u305B\u305A --notify \u3092\u4F7F\u3063\u3066\u304F\u3060\u3055\u3044\u3002\u8907\u6570\u4EBA\u306A\u3089 --notify \u3092\u91CD\u306D\u3066\u6307\u5B9A\u3057\u307E\u3059\u3002\n \u6570\u5B57\u3060\u3051\u306E\u5024\u306F ID \u3068\u3057\u3066\u9001\u308A\u307E\u3059\u3002\u540D\u524D\u30FB\u30ED\u30B0\u30A4\u30F3ID\u30FB\u30E1\u30FC\u30EB\u3067\u6307\u3059\u306B\u306F --project \u304C\u5FC5\u8981\u3067\u3001\n \u7167\u5408\u306F\u5B8C\u5168\u4E00\u81F4\u3060\u3051\u3067\u3059\uFF08\u4E00\u81F4\u3057\u306A\u3051\u308C\u3070\u5019\u88DC\u3092\u51FA\u3057\u3066\u7D42\u4E86\u30B3\u30FC\u30C9 2 \u3067\u6B62\u307E\u308A\u3001\u4F55\u3082\u9001\u308A\u307E\u305B\u3093\uFF09\u3002";
|
|
43
43
|
function readNotifyRefs(input){return repeatedValues(input,NOTIFY_FLAG.name).map(raw=>updateRefOf(input,NOTIFY_FLAG.name,"Backlog \u30E6\u30FC\u30B6\u30FC",raw))}async function resolveNotifyRefs(refs,projectId,load){if(refs.length===0)return void 0;const ids=[];for(const ref of refs){const id=await resolveUpdateRef(ref,projectId,load);if(!ids.includes(id))ids.push(id)}return ids.join(",")}function notifyBody(input,body){const ids=resolvedList(input,"notifiedUserId");if(ids!==void 0)body["notifie\
|
|
44
|
-
dUserId"]=ids.map(Number)}
|
|
45
|
-
|
|
46
|
-
return
|
|
47
|
-
\u3044\
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
\uFF09
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
\
|
|
44
|
+
dUserId"]=ids.map(Number)}var ATTACHMENT_ID_FLAG={name:"--attachment-id",summary:"twp backlog attachment upload \u304C\u8FD4\u3057\u305F\u6DFB\u4ED8 ID \u3092\u4ED8\u3051\u308B\u3002\u8907\u6570\u306A\u3089\u91CD\u306D\u3066\u6307\u5B9A\uFF08\u6570\u5024 ID \u306E\u307F\uFF09",takesValue:true,repeatable:true,placeholder:"<ID>"};var ATTACHMENT_ID_HELP="--attachment-id <ID> \u3067\u3001twp backlog attachment upload \u304C\u8FD4\u3057\u305F\u6DFB\u4ED8\uFF08id\uFF09\u3092\u3053\u306E\u64CD\u4F5C\u3067\u4ED8\u3051\u307E\u3059\u3002\n \u8907\u6570\u306A\u3089 --attachment-id \u3092\u91CD\u306D\u3066\u6307\u5B9A\u3057\u307E\u3059\u3002\u6570\u5024 ID \u3060\u3051\u3092\u53D7\u3051\u307E\u3059\uFF08\u30D5\u30A1\u30A4\u30EB\u540D\u3067\u306F\u6307\u305B\u307E\u305B\u3093\uFF09\u3002";
|
|
45
|
+
function readAttachmentIds(input,usage){const values=repeatedValues(input,ATTACHMENT_ID_FLAG.name);if(values.length===0)return void 0;const ids=[];for(const raw of values){const value=raw.trim();if(!isExactNumericId(value)||value==="0"){throw new UsageError(`--attachment-id \u306F\u6B63\u306E\u6574\u6570\u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\uFF08${raw}\uFF09`,`twp backlog attachment upload \u306E\u5FDC\u7B54\u306E id \u3092\u6E21\u3057\u3066\u304F\u3060\u3055\u3044\u3002${usage}`)}
|
|
46
|
+
if(!ids.includes(value))ids.push(value)}return ids.join(",")}function attachmentIdBody(input,body){const ids=resolvedList(input,"attachmentId");if(ids!==void 0)body["attachmentId"]=ids.map(Number)}function spaceNotes(input){const defaulted=input.resolved?.["spaceDefaulted"];if(defaulted===void 0)return[];return input.resolved?.["spaceDefaultSource"]==="config"?[`--space \u3092\u7701\u7565\u3057\u305F\u305F\u3081\u3001\u8A2D\u5B9A\u306E\u65E2\u5B9A Backlog \u30B9\u30DA\u30FC\u30B9 ${defaulted} \u3092\u4F7F\
|
|
47
|
+
\u3044\u307E\u3057\u305F\uFF08twp configure \u3067\u5909\u66F4\u3067\u304D\u307E\u3059\uFF09\u3002`]:[`--space \u3092\u7701\u7565\u3057\u305F\u305F\u3081\u3001\u767B\u9332\u3055\u308C\u3066\u3044\u308B\u552F\u4E00\u306E Backlog \u30B9\u30DA\u30FC\u30B9 ${defaulted} \u3092\u4F7F\u3044\u307E\u3057\u305F\u3002`]}function updateNotes(input){const notes=[...spaceNotes(input)];const usedForName=input.resolved?.["projectUsed"]!==void 0;if(input.flags.get("--project")!==void 0&&!usedForName){notes.push(
|
|
48
|
+
"--project \u306F\u4F7F\u3044\u307E\u305B\u3093\u3067\u3057\u305F\uFF08\u540D\u524D\u3067\u6307\u5B9A\u3057\u305F\u5024\u304C\u7121\u304F\u3001\u3059\u3079\u3066\u6570\u5024 ID \u3060\u3063\u305F\u305F\u3081\u3001\u540D\u524D\u306E\u89E3\u6C7A\u304C\u8981\u308A\u307E\u305B\u3093\uFF09\u3002")}return notes}function offsetNotes(input,received,offsetFlag="--offset"){const count=integerFlag(input.flags,"--count",{min:1,max:MAX_COUNT})??DEFAULT_COUNT;if(received<count)return[];const offset=integerFlag(
|
|
49
|
+
input.flags,offsetFlag,{min:0})??0;return[`${received} \u4EF6\uFF08--count \u306E\u4E0A\u9650\u3061\u3087\u3046\u3069\uFF09\u3092\u53D6\u5F97\u3057\u307E\u3057\u305F\u3002\u7D9A\u304D\u304C\u3042\u308B\u304B\u3082\u3057\u308C\u307E\u305B\u3093: ${offsetFlag} ${offset+received} \u3092\u4ED8\u3051\u3066\u7D9A\u304D\u3092\u53D6\u5F97\u3057\u3066\u304F\u3060\u3055\u3044\uFF08\u3053\u306E API \u306F\u30AB\u30FC\u30BD\u30EB\u3092\u8FD4\u3055\u306A\u3044\u305F\u3081 --all \u306F\u3042\u308A\u307E\u305B\u3093\uFF09\u3002`]}
|
|
50
|
+
var ISSUE_FIELDS_HELP="\u8AB2\u984C\u9805\u76EE\uFF08TWP-8176\uFF09:\n --start-date <yyyy-MM-dd> \u958B\u59CB\u65E5\n --milestone <ID,...> \u30DE\u30A4\u30EB\u30B9\u30C8\u30FC\u30F3\uFF08twp backlog milestone list \u306E id\uFF09\n --affected-version <ID,...> \u767A\u751F\u30D0\u30FC\u30B8\u30E7\u30F3\uFF08\u540C\u3058\u304F milestone list \u306E id\u3002Backlog \u3067\u306F\u540C\u3058\u4E00\u89A7\u3067\u3059\uFF09\n --category <ID,...> \u30AB\u30C6\u30B4\u30EA\u30FC\uFF08twp backlog issue get \u306E category[].id\uFF09\n --resolution <ID> \u5B8C\u4E86\u7406\u7531\uFF08twp backlog resolution list \u306E id\u30020 \u3082\u6709\u52B9\u306A\u5024\u3067\u3059\uFF09\n --estimated-hours <\u6642\u9593> \u4E88\u5B9A\u6642\u9593\uFF080 \u4EE5\u4E0A\u3002\u5C0F\u6570\u53EF: 1.5\uFF09\n --actual-hours <\u6642\u9593> \u5B9F\u7E3E\u6642\u9593\uFF080 \u4EE5\u4E0A\u3002\u5C0F\u6570\u53EF\uFF09\n \u26A0 \u3053\u308C\u3089\u306F\u6570\u5024\
|
|
51
|
+
ID \u3060\u3051\u3092\u53D7\u3051\u307E\u3059\uFF08\u540D\u524D\u3067\u306F\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093\uFF09\u3002\n \u26A0 --milestone / --affected-version / --category \u306F\u9001\u3063\u305F\u5024\u3067**\u7F6E\u304D\u63DB\u308F\u308A\u307E\u3059**\uFF08\u8FFD\u8A18\u3067\u306F\u3042\u308A\u307E\u305B\u3093\uFF09\u3002\n \u6B8B\u3057\u305F\u3044\u5024\u3082\u542B\u3081\u3066\u6E21\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u672A\u8A2D\u5B9A\u3078\u623B\u3059\uFF08\u7A7A\u306B\u3059\u308B\uFF09\u3068\u304D\u306F --clear \u3092\u4F7F\u3044\u307E\u3059\u3002\n --clear <\u9805\u76EE,...> \u6307\u5B9A\u3057\u305F\u9805\u76EE\u3092\u7A7A\uFF08\u672A\u8A2D\u5B9A\uFF09\u306B\u3059\u308B\uFF08TWP-8285\uFF09\u3002\u6307\u5B9A\u3067\u304D\u308B\u9805\u76EE:\n start-date / due-date / assignee / milestone / affected-version / category / resolution /\n estimated-hours / actual-hours\uFF08\u4F8B: --clear due-date,milestone\uFF09\n \u540C\u3058\u9805\u76EE\u306B\u5024\u3092\u5165\u308C\u308B\u30D5\u30E9\u30B0\uFF08--start-date \u7B49\uFF09\u3068\u4E00\u7DD2\u306B\u306F\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093\u3002";
|
|
52
|
+
var CLEAR_TARGETS={"start-date":{key:"startDate",setFlag:"--start-date"},"due-date":{key:"dueDate",setFlag:"--due-date"},assignee:{key:"assigneeId",setFlag:"--assignee"},milestone:{key:"milestoneId",setFlag:"--milestone"},"affected-version":{key:"versionId",setFlag:"--affected-version"},category:{key:"categoryId",setFlag:"--category"},resolution:{key:"resolutionId",setFlag:"--resolution"},"estimated-hours":{key:"estimatedHours",setFlag:"--estimated-hours"},"actual-hours":{key:"actualHours",setFlag:"\
|
|
53
|
+
--actual-hours"}};function readClearFields(input){const names=commaList(input.flags,"--clear");if(names===void 0)return void 0;const allowed=Object.keys(CLEAR_TARGETS).join(" / ");const keys=[];for(const raw of names){const name=raw.toLowerCase();const target=CLEAR_TARGETS[name];if(target===void 0){throw new UsageError(`--clear \u306B\u6307\u5B9A\u3067\u304D\u306A\u3044\u9805\u76EE\u3067\u3059: ${raw}`,`\u6307\u5B9A\u3067\u304D\u308B\u9805\u76EE: ${allowed}`)}if(target.setFlag!==null&&input.flags.
|
|
54
|
+
has(target.setFlag)){throw new UsageError(`${target.setFlag} \u3068 --clear ${name} \u306F\u540C\u6642\u306B\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093\uFF08\u5024\u3092\u5165\u308C\u308B\u306E\u304B\u7A7A\u306B\u3059\u308B\u306E\u304B\u304C\u6C7A\u307E\u308A\u307E\u305B\u3093\uFF09`)}if(!keys.includes(target.key))keys.push(target.key)}return keys.join(",")}var ISSUE_FIELD_FLAGS=[{name:"--start-date",summary:"\u958B\u59CB\u65E5\uFF08yyyy-MM-dd\uFF09",takesValue:true,placeholder:"<yyyy-MM-dd>"},{name:"\
|
|
55
|
+
--milestone",summary:"\u30DE\u30A4\u30EB\u30B9\u30C8\u30FC\u30F3\u306E ID\uFF08\u30AB\u30F3\u30DE\u533A\u5207\u308A\u3067\u8907\u6570\u3002\u7F6E\u304D\u63DB\u3048\uFF09",takesValue:true,placeholder:"<ID,...>"},{name:"--affected-version",summary:"\u767A\u751F\u30D0\u30FC\u30B8\u30E7\u30F3\u306E ID\uFF08\u30AB\u30F3\u30DE\u533A\u5207\u308A\u3067\u8907\u6570\u3002\u7F6E\u304D\u63DB\u3048\uFF09",takesValue:true,placeholder:"<ID,...>"},{name:"--category",summary:"\u30AB\u30C6\u30B4\u30EA\u30FC\u306E ID\uFF08\u30AB\u30F3\u30DE\u533A\u5207\u308A\u3067\u8907\u6570\u3002\u7F6E\u304D\u63DB\u3048\uFF09",
|
|
56
|
+
takesValue:true,placeholder:"<ID,...>"},{name:"--resolution",summary:"\u5B8C\u4E86\u7406\u7531\u306E ID",takesValue:true,placeholder:"<ID>"},{name:"--estimated-hours",summary:"\u4E88\u5B9A\u6642\u9593\uFF080 \u4EE5\u4E0A\u30FB\u5C0F\u6570\u53EF\uFF09",takesValue:true,placeholder:"<\u6642\u9593>"},{name:"--actual-hours",summary:"\u5B9F\u7E3E\u6642\u9593\uFF080 \u4EE5\u4E0A\u30FB\u5C0F\u6570\u53EF\uFF09",takesValue:true,placeholder:"<\u6642\u9593>"}];var HOURS=/^[0-9]+(?:\.[0-9]+)?$/;function idListFlag(input,name,hint){
|
|
57
|
+
const values=commaList(input.flags,name);if(values===void 0)return void 0;const bad=values.filter(value=>!isExactNumericId(value));if(bad.length>0){throw new UsageError(`${name} \u306B\u306F\u6570\u5024 ID \u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\uFF08\u53D7\u3051\u53D6\u3063\u305F\u5024: ${bad.join(" / ")}\uFF09`,hint)}return[...new Set(values)].join(",")}function readIssueFields(input){const fields={};const startDate=dateFlag(input.flags,"--start-date");if(startDate!==void 0)fields["\
|
|
58
|
+
startDate"]=startDate;const milestone=idListFlag(input,"--milestone","twp backlog milestone list --project <\u30AD\u30FC> \u3067 id \u3092\u8ABF\u3079\u3066\u304F\u3060\u3055\u3044\u3002");if(milestone!==void 0)fields["milestoneId"]=milestone;const version=idListFlag(input,"--affected-version","twp backlog milestone list --project <\u30AD\u30FC> \u3067 id \u3092\u8ABF\u3079\u3066\u304F\u3060\u3055\u3044\u3002");if(version!==void 0)fields["versionId"]=version;const category=idListFlag(input,"--ca\
|
|
59
|
+
tegory","twp backlog issue get <\u8AB2\u984C\u30AD\u30FC> \u306E category[].id \u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002");if(category!==void 0)fields["categoryId"]=category;const resolution=input.flags.get("--resolution");if(resolution!==void 0){const trimmed=resolution.trim();if(!isExactNumericId(trimmed)){throw new UsageError(`--resolution \u306B\u306F\u6570\u5024 ID \u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\uFF08\u53D7\u3051\u53D6\u3063\u305F\u5024: ${resolution}\
|
|
60
|
+
\uFF09`,"twp backlog resolution list \u3067 id \u3092\u8ABF\u3079\u3066\u304F\u3060\u3055\u3044\uFF08\u540D\u524D\u3067\u306F\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093\uFF09\u3002")}fields["resolutionId"]=trimmed}for(const[flag,key]of[["--estimated-hours","estimatedHours"],["--actual-hours","actualHours"]]){const raw=input.flags.get(flag);if(raw===void 0)continue;const trimmed=raw.trim();if(!HOURS.test(trimmed)){throw new UsageError(`${flag} \u306B\u306F 0 \u4EE5\u4E0A\u306E\u6570\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\uFF08\u53D7\u3051\u53D6\u3063\u305F\u5024: ${raw}\
|
|
61
|
+
\uFF09`,"\u4F8B: 1.5")}fields[key]=trimmed}return fields}function issueFieldsBody(input,body){const resolved=input.resolved??{};if(resolved["startDate"]!==void 0)body["startDate"]=resolved["startDate"];for(const key of["milestoneId","versionId","categoryId"]){const ids=resolvedList(input,key);if(ids!==void 0)body[key]=ids.map(Number)}for(const key of["resolutionId","estimatedHours","actualHours"]){const value=resolved[key];if(value!==void 0)body[key]=Number(value)}}function summaryFlag(input){const raw=input.
|
|
62
|
+
flags.get("--summary");if(raw===void 0)return void 0;if(raw.trim()===""){throw new UsageError("--summary \u306B\u7A7A\u306E\u4EF6\u540D\u306F\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093","--summary \u3054\u3068\u5916\u305B\u3070\u3001\u4EF6\u540D\u306F\u5909\u66F4\u3057\u307E\u305B\u3093\u3002")}return raw}function readPriorityRef(input){const raw=input.flags.get("--priority");if(raw===void 0)return void 0;const value=raw.trim();if(value===""){throw new UsageError("--priority \u306B\u7A7A\u306E\u5024\u306F\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093",
|
|
63
|
+
"--priority \u3054\u3068\u5916\u305B\u3070\u3001\u305D\u306E\u9805\u76EE\u306F\u5909\u66F4\u3057\u307E\u305B\u3093\u3002")}if(value.includes(",")){throw new UsageError(`--priority \u306B\u8907\u6570\u306E\u5024\u306F\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093\uFF08\u53D7\u3051\u53D6\u3063\u305F\u5024: ${value}\uFF09`)}if(NUMERIC.test(value)&&!isExactNumericId(value)){throw new UsageError(`--priority \u306E ID \u304C\u6570\u5024\u3068\u3057\u3066\u6271\u3048\u308B\u7BC4\u56F2\u3092\u8D85\u3048\u3066\u3044\u307E\u3059: ${value}`,
|
|
64
|
+
"twp backlog priority list \u306E id \u3092\u305D\u306E\u307E\u307E\u6E21\u3057\u3066\u304F\u3060\u3055\u3044\u3002")}return{value,numeric:NUMERIC.test(value)}}async function resolvePriorityRef(ref,spaceId,ctx){if(ref.numeric)return ref.value;const resolved=await resolveNamed(ref.value,await ctx.resolver.backlogPriorities(spaceId),{flag:"--priority",label:"Backlog \u512A\u5148\u5EA6",scope:BACKLOG_SCOPE_LABEL});if(!isExactNumericId(resolved.id)){throw new ApiResponseError(`Backlog \u512A\u5148\u5EA6\u300C${ref.
|
|
65
|
+
value}\u300D\u306E ID \u3092\u6570\u5024\u3068\u3057\u3066\u9001\u308C\u307E\u305B\u3093: ${JSON.stringify(resolved.id)}\u3002\u63A5\u7D9A\u5148\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002`)}return resolved.id}var DESCRIPTION_FLAGS=[{name:"--description-file",summary:"\u8AB2\u984C\u306E\u8A73\u7D30\uFF08\u672C\u6587\uFF09\u3092\u30D5\u30A1\u30A4\u30EB\u304B\u3089\u8AAD\u3080\uFF08- \u3067\u6A19\u6E96\u5165\u529B\uFF09\u3002\u6539\u884C\u30FBMarkdown \u3092\u58CA\u3055\u306A\u3044\u4E3B\u7D4C\u8DEF",
|
|
66
|
+
takesValue:true,placeholder:"<\u30D1\u30B9|->"},{name:"--description",summary:"\u8AB2\u984C\u306E\u8A73\u7D30\u3092\u76F4\u63A5\u6307\u5B9A\u3059\u308B\uFF08\u4E00\u884C\u5411\u3051\u3002--description-file \u3068\u306E\u4F75\u7528\u306F\u30A8\u30E9\u30FC\uFF09",takesValue:true,placeholder:"<\u6587\u5B57\u5217>"}];var SUMMARY_FLAG={name:"--summary",summary:"\u4EF6\u540D",takesValue:true,placeholder:"<\u4EF6\u540D>"};var PRIORITY_FLAG={name:"--priority",summary:"\u512A\u5148\u5EA6\uFF08\u6570\u5024ID\u3001\u307E\u305F\u306F\u540D\u524D\u3002\u540D\u524D\u3067\u3082 --project \u306F\u8981\u3089\u306A\u3044\
|
|
67
|
+
\uFF09",takesValue:true,placeholder:"<\u540D\u524D|ID>"};var DUE_DATE_FLAG={name:"--due-date",summary:"\u671F\u9650\u65E5\uFF08yyyy-MM-dd\uFF09",takesValue:true,placeholder:"<yyyy-MM-dd>"};function readDescription(input,usage){return readBody(input,{flag:"--description",fileFlag:"--description-file",label:"\u8AB2\u984C\u306E\u8A73\u7D30",maxChars:BODY_MAX_CHARS,usage})}var spaceResource={name:"space",summary:"\u9023\u643A\u6E08\u307F Backlog \u30B9\u30DA\u30FC\u30B9",operations:[{name:"list",summary:"\
|
|
68
|
+
\u9023\u643A\u6E08\u307F\u306E Backlog \u30B9\u30DA\u30FC\u30B9\u3092\u4E00\u89A7\u3059\u308B",usage:"twp backlog space list",description:"TWP \u306E\u5916\u90E8\u9023\u643A\u8A2D\u5B9A\u306B\u767B\u9332\u3055\u308C\u3066\u3044\u308B Backlog \u30B9\u30DA\u30FC\u30B9\u3092\u4E00\u89A7\u3057\u307E\u3059\u3002\n\u30B9\u30DA\u30FC\u30B9\u306F**\u30ED\u30B0\u30A4\u30F3\u3057\u3066\u3044\u308B\u30E6\u30FC\u30B6\u30FC\u3054\u3068**\u306E\u8A2D\u5B9A\u3067\u3059\uFF08\u30C6\u30CA\u30F3\u30C8\u5171\u901A\u3067\u306F\u3042\u308A\u307E\u305B\u3093\uFF09\u3002\n\u3053\u3053\u306B\u51FA\u308B id / space_url \u306F\u3001\u4ED6\u306E backlog \u30B3\u30DE\u30F3\u30C9\u306E --space \u306B\u305D\u306E\u307E\u307E\u6E21\u305B\u307E\u3059\u3002\nAPI \u30AD\u30FC\u306F\u8FD4\u308A\u307E\u305B\u3093\uFF08\u30B5\u30FC\u30D0\u5074\u3067\u30DE\u30B9\u30AF\u3055\u308C\u3066\u3044\u307E\u3059\uFF09\u3002",
|
|
67
69
|
flags:[],plan(input){if(input.args.length>0){throw new UsageError(`list \u306F\u4F4D\u7F6E\u5F15\u6570\u3092\u53D6\u308A\u307E\u305B\u3093: ${input.args.join(" ")}`,"twp backlog space list help")}return{method:"GET",path:`${BACKLOG_BASE_PATH}/spaces`}},summarize:body=>listOf(body,"spaces","Backlog \u30B9\u30DA\u30FC\u30B9\u4E00\u89A7").map(row=>pick(row,SPACE_COLUMNS)),raw:body=>listOf(body,"spaces","Backlog \u30B9\u30DA\u30FC\u30B9\u4E00\u89A7")}]};var projectResource={name:"project",summary:"B\
|
|
68
70
|
acklog \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8",operations:[{name:"list",summary:"Backlog \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u3092\u4E00\u89A7\u3059\u308B",usage:"twp backlog project list [--space <ID|URL>]",description:"\u3053\u3053\u306B\u51FA\u308B id\uFF08\u6570\u5024\uFF09\u306F backlog issue list --project \u306B\u3001projectKey \u306F\nbacklog status list / backlog user list \u306E --project \u306B\u6E21\u305B\u307E\u3059\u3002\n\u3053\u306E API \u306F\u30DA\u30FC\u30B8\u30F3\u30B0\u3092\u6301\u305F\u305A\u3001\u5E38\u306B\u5168\u4EF6\u3092\u8FD4\u3057\u307E\u3059\u3002",
|
|
69
71
|
flags:[SPACE_FLAG],async prepare(input,ctx){if(input.args.length>0){throw new UsageError(`list \u306F\u4F4D\u7F6E\u5F15\u6570\u3092\u53D6\u308A\u307E\u305B\u3093: ${input.args.join(" ")}`,"twp backlog project list help")}return withSpace(input,await resolveSpace(input,ctx))},plan(input){return{method:"GET",path:backlogSpacePath(requireSpace(input),"/projects")}},plannedNotes:spaceNotes,summarize:body=>listOf(body,"projects","Backlog \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u4E00\u89A7").map(row=>pick(
|
|
@@ -94,7 +96,7 @@ flags.get("--sort");query["order"]=order(input.flags.get("--order"));query["desc
|
|
|
94
96
|
filter(row=>isRecord(row)&&row["descriptionTruncated"]===true).length;const notes=[...offsetNotes(input,issues.length)];if(truncated>0){notes.push(`${truncated} \u4EF6\u306E\u672C\u6587\u304C\u9014\u4E2D\u3067\u5207\u3089\u308C\u3066\u3044\u307E\u3059\uFF08descriptionTruncated: true\uFF09\u3002\u5168\u6587\u304C\u8981\u308B\u306A\u3089 --description-max 0 \u304B twp backlog issue get \u3092\u4F7F\u3063\u3066\u304F\u3060\u3055\u3044\u3002`)}return notes}},{name:"get",summary:"Backlog \u8AB2\u984C1\u4EF6\u306E\u8A73\u7D30\u3092\u8868\u793A\u3059\u308B\
|
|
95
97
|
\uFF08\u672C\u6587\u306F\u5168\u6587\uFF09",usage:"twp backlog issue get <\u8AB2\u984C\u30AD\u30FC|\u8AB2\u984CID> [--space <ID|URL>]",description:"\u672C\u6587\uFF08description\uFF09\u306F\u5E38\u306B\u5168\u6587\u304C\u8FD4\u308A\u307E\u3059\uFF08descriptionTruncated \u306F\u5FC5\u305A false\uFF09\u3002\n\u4E00\u89A7\uFF08twp backlog issue list\uFF09\u306F\u65E2\u5B9A\u3067 1000 \u6587\u5B57\u306B\u5207\u308B\u306E\u3067\u3001\u305D\u3053\u304C\u9055\u3044\u307E\u3059\u3002\n\u8AB2\u984C\u30AD\u30FC\uFF08HC_FM_ID-19171\uFF09\u3067\u3082\u8AB2\u984CID\uFF08\u6570\u5024\uFF09\u3067\u3082\u5F15\u3051\u307E\u3059\u3002\n\n"+
|
|
96
98
|
ISSUE_JSON_SHAPE_HELP,flags:[SPACE_FLAG,{name:"--issue",summary:"\u8AB2\u984C\u30AD\u30FC\uFF08\u4F4D\u7F6E\u5F15\u6570\u3068\u540C\u3058\u610F\u5473\uFF09",takesValue:true,placeholder:"<\u30AD\u30FC|ID>"}],async prepare(input,ctx){const ref=issueRef(input,"twp backlog issue get help");return withResolved(withSpace(input,await resolveSpace(input,ctx)),{issueRef:ref})},plan(input){const ref=requireResolved(input,"issueRef");return{method:"GET",path:backlogSpacePath(requireSpace(input),`/issues/${encodeURIComponent(
|
|
97
|
-
ref)}`)}},plannedNotes:spaceNotes,summarize:body=>pick(issueObject(body),ISSUE_GET_COLUMNS),raw:body=>issueObject(body)},{name:"create",summary:"Backlog \u8AB2\u984C\u3092\u4F5C\u6210\u3059\u308B\uFF08--yes \u304C\u5FC5\u8981\uFF09",usage:"twp backlog issue create --project <\u30AD\u30FC|\u540D\u79F0|ID> --summary <\u4EF6\u540D> --type <\u540D\u524D|ID> --priority <\u540D\u524D|ID> [--description-file <\u30D1\u30B9>] [--assignee <\u540D\u524D|ID>] [--due-date <yyyy-MM-dd>] [--space <ID|URL>] --yes",
|
|
99
|
+
ref)}`)}},plannedNotes:spaceNotes,summarize:body=>pick(issueObject(body),ISSUE_GET_COLUMNS),raw:body=>issueObject(body)},{name:"create",summary:"Backlog \u8AB2\u984C\u3092\u4F5C\u6210\u3059\u308B\uFF08--yes \u304C\u5FC5\u8981\uFF09",usage:"twp backlog issue create --project <\u30AD\u30FC|\u540D\u79F0|ID> --summary <\u4EF6\u540D> --type <\u540D\u524D|ID> --priority <\u540D\u524D|ID> [--description-file <\u30D1\u30B9>] [--assignee <\u540D\u524D|ID>] [--due-date <yyyy-MM-dd>] [--attachment-id <ID>]... [--space <ID|URL>] --yes",
|
|
98
100
|
description:`\u26A0 \u3053\u308C\u306F Backlog\uFF08\u5916\u90E8\uFF09\u3078\u5B9F\u969B\u306B\u66F8\u304F\u64CD\u4F5C\u3067\u3059\u3002\u4F5C\u6210\u3057\u305F\u8AB2\u984C\u306F\u76F8\u624B\u306E\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u306B\u6B8B\u308A\u3001\u901A\u77E5\u304C\u98DB\u3073\u307E\u3059\u3002
|
|
99
101
|
\u9001\u308B\u5185\u5BB9\u306F --dry-run \u3067\u9001\u4FE1\u305B\u305A\u306B\u78BA\u8A8D\u3067\u304D\u307E\u3059\uFF08--dry-run \u306F --yes \u3092\u8981\u308A\u307E\u305B\u3093\uFF09\u3002
|
|
100
102
|
\u5931\u6557\u3057\u3066\u3082\u6A5F\u68B0\u7684\u306B\u518D\u5B9F\u884C\u3057\u306A\u3044\u3067\u304F\u3060\u3055\u3044\u3002Backlog \u306B\u51AA\u7B49\u30AD\u30FC\u306F\u7121\u304F\u3001\u4F5C\u6210\u304C\u5C4A\u3044\u305F\u5F8C\u306B\u5FDC\u7B54\u306E\u8AAD\u307F\u53D6\u308A
|
|
@@ -109,15 +111,17 @@ description:`\u26A0 \u3053\u308C\u306F Backlog\uFF08\u5916\u90E8\uFF09\u3078\u5B
|
|
|
109
111
|
ID \u306E\u8ABF\u3079\u5148: twp backlog issue-type list --project <\u30AD\u30FC> / twp backlog priority list /
|
|
110
112
|
twp backlog user list --project <\u30AD\u30FC>
|
|
111
113
|
|
|
112
|
-
${
|
|
113
|
-
--assignee",summary:"\u62C5\u5F53\u8005\u3002\u6570\u5B57\u3060\u3051\u306E\u5024\u306F ID \u3068\u3057\u3066\u9001\u308A\u307E\u3059\uFF08\u540D\u524D\u30FB\u30ED\u30B0\u30A4\u30F3ID\u30FB\u30E1\u30FC\u30EB\u3067\u3082\u53EF\uFF09",takesValue:true,placeholder:"<\u540D\u524D|ID>"},DUE_DATE_FLAG],async prepare(input,ctx){noArgs(input,"twp backlog issue create help");const usage="twp backlog issue create help";const projectRaw=input.flags.get("--project")?.trim();const missing=[projectRaw===void 0||
|
|
114
|
-
projectRaw===""?"--project":null,input.flags.has("--summary")?null:"--summary",input.flags.has("--type")?null:"--type",input.flags.has("--priority")?null:"--priority"].filter(flag=>flag!==null);if(missing.length>0){throw new UsageError(`\u8AB2\u984C\u306E\u4F5C\u6210\u306B\u5FC5\u8981\u306A\u9805\u76EE\u304C\u3042\u308A\u307E\u305B\u3093: ${missing.join(" / ")}`,usage)}if(projectRaw?.includes(",")){throw new UsageError(`--project \u306B\u8907\u6570\u306E\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u306F\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093\uFF08\u53D7\u3051\u53D6\u3063\u305F\u5024: ${projectRaw}\
|
|
115
|
-
\uFF09`)}const summary=summaryFlag(input);const typeRef=readUpdateRef(input,"--type","Backlog \u8AB2\u984C\u7A2E\u5225");const priorityRef=readPriorityRef(input);const assigneeRef=readUpdateRef(input,"--assignee","Backlog \u30E6\u30FC\u30B6\u30FC");const dueDate=dateFlag(input.flags,"--due-date");const description=await readDescription(input,usage);const space=await resolveSpace(input,ctx);const projectId=await resolveUpdateProject(projectRaw,()=>ctx.resolver.backlogProjects(space.id));const resolved={
|
|
116
|
-
projectId,summary,issueTypeId:await resolveUpdateRef(typeRef,projectId,id=>ctx.resolver.backlogIssueTypes(space.id,id)),priorityId:await resolvePriorityRef(priorityRef,space.id,ctx)};if(assigneeRef!==void 0){resolved["assigneeId"]=await resolveUpdateRef(assigneeRef,projectId,id=>ctx.resolver.backlogUsers(space.id,id))}if(dueDate!==void 0)resolved["dueDate"]=dueDate;if(description!==void 0)resolved["description"]=description;return withSpace(withResolved(input,resolved),space)},plan(input){const resolved=input.
|
|
117
|
-
resolved??{};const body={projectId:Number(requireResolved(input,"projectId")),summary:requireResolved(input,"summary"),issueTypeId:Number(requireResolved(input,"issueTypeId")),priorityId:Number(requireResolved(input,"priorityId"))};if(resolved["assigneeId"]!==void 0)body["assigneeId"]=Number(resolved["assigneeId"]);if(resolved["dueDate"]!==void 0)body["dueDate"]=resolved["dueDate"];if(resolved["description"]!==void 0)body["description"]=resolved["description"];return{method:"POST",path:backlogSpacePath(
|
|
118
|
-
requireSpace(input),"/issues"),body}},plannedNotes:spaceNotes,summarize:body=>pick(issueObject(body),ISSUE_GET_COLUMNS),raw:body=>issueObject(body)},{name:"update",summary:"Backlog \u8AB2\u984C\u306E\u4EF6\u540D\u30FB\u8A73\u7D30\u30FB\u62C5\u5F53\u30FB\u30B9\u30C6\u30FC\u30BF\u30B9\u30FB\u512A\u5148\u5EA6\u30FB\u65E5\u4ED8\u30FB\u30DE\u30A4\u30EB\u30B9\u30C8\u30FC\u30F3\u7B49\u3092\u5909\u66F4\u3059\u308B\uFF08--yes \u304C\u5FC5\u8981\uFF09",usage:"twp backlog issue update <\u8AB2\u984C\u30AD\u30FC|\u8AB2\u984CID> [--summar\
|
|
119
|
-
y <\u4EF6\u540D>] [--description-file <\u30D1\u30B9>] [--priority <\u540D\u524D|ID>] [--due-date <yyyy-MM-dd>] [--assignee <\u540D\u524D|ID>] [--status <\u540D\u524D|ID>] [--start-date <yyyy-MM-dd>] [--milestone <ID,...>] [--affected-version <ID,...>] [--category <ID,...>] [--resolution <ID>] [--estimated-hours <\u6642\u9593>] [--actual-hours <\u6642\u9593>] [--clear <\u9805\u76EE,...>] [--comment-file <\u30D1\u30B9>] [--notify <\u540D\u524D|ID>]... [--project <\u30AD\u30FC|ID>] --yes",description:`${EXTERNAL_WRITE_HELP}\
|
|
114
|
+
${ATTACHMENT_ID_HELP}
|
|
120
115
|
|
|
116
|
+
${bodyHelp("--description-file","--description")}`,destructive:true,flags:[SPACE_FLAG,{name:"--project",summary:"\u4F5C\u6210\u5148\u306E Backlog \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\uFF08\u30AD\u30FC / \u540D\u79F0 / \u6570\u5024ID\uFF09",takesValue:true,placeholder:"<\u30AD\u30FC|ID>"},SUMMARY_FLAG,{name:"--type",summary:"\u8AB2\u984C\u7A2E\u5225\uFF08\u6570\u5024ID\u3001\u307E\u305F\u306F\u540D\u524D\uFF09",takesValue:true,placeholder:"<\u540D\u524D|ID>"},PRIORITY_FLAG,...DESCRIPTION_FLAGS,{name:"\
|
|
117
|
+
--assignee",summary:"\u62C5\u5F53\u8005\u3002\u6570\u5B57\u3060\u3051\u306E\u5024\u306F ID \u3068\u3057\u3066\u9001\u308A\u307E\u3059\uFF08\u540D\u524D\u30FB\u30ED\u30B0\u30A4\u30F3ID\u30FB\u30E1\u30FC\u30EB\u3067\u3082\u53EF\uFF09",takesValue:true,placeholder:"<\u540D\u524D|ID>"},DUE_DATE_FLAG,ATTACHMENT_ID_FLAG],async prepare(input,ctx){noArgs(input,"twp backlog issue create help");const usage="twp backlog issue create help";const projectRaw=input.flags.get("--project")?.trim();const missing=[
|
|
118
|
+
projectRaw===void 0||projectRaw===""?"--project":null,input.flags.has("--summary")?null:"--summary",input.flags.has("--type")?null:"--type",input.flags.has("--priority")?null:"--priority"].filter(flag=>flag!==null);if(missing.length>0){throw new UsageError(`\u8AB2\u984C\u306E\u4F5C\u6210\u306B\u5FC5\u8981\u306A\u9805\u76EE\u304C\u3042\u308A\u307E\u305B\u3093: ${missing.join(" / ")}`,usage)}if(projectRaw?.includes(",")){throw new UsageError(`--project \u306B\u8907\u6570\u306E\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u306F\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093\uFF08\u53D7\u3051\u53D6\u3063\u305F\u5024: ${projectRaw}\
|
|
119
|
+
\uFF09`)}const summary=summaryFlag(input);const typeRef=readUpdateRef(input,"--type","Backlog \u8AB2\u984C\u7A2E\u5225");const priorityRef=readPriorityRef(input);const assigneeRef=readUpdateRef(input,"--assignee","Backlog \u30E6\u30FC\u30B6\u30FC");const dueDate=dateFlag(input.flags,"--due-date");const attachmentIds=readAttachmentIds(input,usage);const description=await readDescription(input,usage);const space=await resolveSpace(input,ctx);const projectId=await resolveUpdateProject(projectRaw,()=>ctx.
|
|
120
|
+
resolver.backlogProjects(space.id));const resolved={projectId,summary,issueTypeId:await resolveUpdateRef(typeRef,projectId,id=>ctx.resolver.backlogIssueTypes(space.id,id)),priorityId:await resolvePriorityRef(priorityRef,space.id,ctx)};if(assigneeRef!==void 0){resolved["assigneeId"]=await resolveUpdateRef(assigneeRef,projectId,id=>ctx.resolver.backlogUsers(space.id,id))}if(dueDate!==void 0)resolved["dueDate"]=dueDate;if(description!==void 0)resolved["description"]=description;if(attachmentIds!==void 0)
|
|
121
|
+
resolved["attachmentId"]=attachmentIds;return withSpace(withResolved(input,resolved),space)},plan(input){const resolved=input.resolved??{};const body={projectId:Number(requireResolved(input,"projectId")),summary:requireResolved(input,"summary"),issueTypeId:Number(requireResolved(input,"issueTypeId")),priorityId:Number(requireResolved(input,"priorityId"))};if(resolved["assigneeId"]!==void 0)body["assigneeId"]=Number(resolved["assigneeId"]);if(resolved["dueDate"]!==void 0)body["dueDate"]=resolved["\
|
|
122
|
+
dueDate"];if(resolved["description"]!==void 0)body["description"]=resolved["description"];attachmentIdBody(input,body);return{method:"POST",path:backlogSpacePath(requireSpace(input),"/issues"),body}},plannedNotes:spaceNotes,summarize:body=>pick(issueObject(body),ISSUE_GET_COLUMNS),raw:body=>issueObject(body)},{name:"update",summary:"Backlog \u8AB2\u984C\u306E\u4EF6\u540D\u30FB\u8A73\u7D30\u30FB\u62C5\u5F53\u30FB\u30B9\u30C6\u30FC\u30BF\u30B9\u30FB\u512A\u5148\u5EA6\u30FB\u65E5\u4ED8\u30FB\u30DE\u30A4\u30EB\u30B9\u30C8\u30FC\u30F3\u7B49\u3092\u5909\u66F4\u3059\u308B\uFF08--yes \u304C\u5FC5\u8981\uFF09",
|
|
123
|
+
usage:"twp backlog issue update <\u8AB2\u984C\u30AD\u30FC|\u8AB2\u984CID> [--summary <\u4EF6\u540D>] [--description-file <\u30D1\u30B9>] [--priority <\u540D\u524D|ID>] [--due-date <yyyy-MM-dd>] [--assignee <\u540D\u524D|ID>] [--status <\u540D\u524D|ID>] [--start-date <yyyy-MM-dd>] [--milestone <ID,...>] [--affected-version <ID,...>] [--category <ID,...>] [--resolution <ID>] [--estimated-hours <\u6642\u9593>] [--actual-hours <\u6642\u9593>] [--clear <\u9805\u76EE,...>] [--comment-file <\u30D1\u30B9>] [--notify <\u540D\u524D|ID>]... [--attachment-id <ID>]... [--project <\u30AD\u30FC|ID>] --yes",
|
|
124
|
+
description:`${EXTERNAL_WRITE_HELP}
|
|
121
125
|
|
|
122
126
|
--summary / --description-file\uFF08--description\uFF09/ --priority / --due-date / --assignee / --status /
|
|
123
127
|
--comment-file\uFF08--comment\uFF09\u3068\u3001\u4E0B\u306E\u8AB2\u984C\u9805\u76EE\u306E\u3046\u3061\u3001\u5C11\u306A\u304F\u3068\u30821\u3064\u304C\u5FC5\u8981\u3067\u3059\u3002
|
|
@@ -152,21 +156,24 @@ ${bodyHelp("--comment-file","--comment")}
|
|
|
152
156
|
|
|
153
157
|
${NOTIFY_HELP}
|
|
154
158
|
|
|
159
|
+
${ATTACHMENT_ID_HELP}
|
|
160
|
+
|
|
155
161
|
${ORDER_HELP}`,destructive:true,flags:[SPACE_FLAG,{name:"--issue",summary:"\u8AB2\u984C\u30AD\u30FC\uFF08\u4F4D\u7F6E\u5F15\u6570\u3068\u540C\u3058\u610F\u5473\uFF09",takesValue:true,placeholder:"<\u30AD\u30FC|ID>"},UPDATE_PROJECT_FLAG,{name:"--assignee",summary:"\u62C5\u5F53\u8005\u3002\u6570\u5B57\u3060\u3051\u306E\u5024\u306F ID \u3068\u3057\u3066\u9001\u308A\u307E\u3059\uFF08\u540D\u524D\u30FB\u30ED\u30B0\u30A4\u30F3ID\u30FB\u30E1\u30FC\u30EB\u306A\u3089 --project \u304C\u8981\u308B\uFF09",takesValue:true,
|
|
156
162
|
placeholder:"<\u540D\u524D|ID>"},{name:"--status",summary:"\u30B9\u30C6\u30FC\u30BF\u30B9\uFF08\u6570\u5024ID\u3001\u307E\u305F\u306F\u540D\u524D\u3002\u540D\u524D\u306A\u3089 --project \u304C\u8981\u308B\uFF09",takesValue:true,placeholder:"<\u540D\u524D|ID>"},{name:"--comment-file",summary:"\u5909\u66F4\u306E\u7406\u7531\u3092\u672C\u6587\u3068\u3057\u3066\u30D5\u30A1\u30A4\u30EB\u304B\u3089\u8AAD\u307F\u3001\u540C\u3058\u30EA\u30AF\u30A8\u30B9\u30C8\u3067\u6295\u7A3F\u3059\u308B\uFF08- \u3067\u6A19\u6E96\u5165\u529B\uFF09",
|
|
157
|
-
takesValue:true,placeholder:"<\u30D1\u30B9|->"},{name:"--comment",summary:"\u5909\u66F4\u306E\u7406\u7531\u3092\u76F4\u63A5\u6307\u5B9A\u3059\u308B\uFF08\u4E00\u884C\u5411\u3051\u3002--comment-file \u3068\u306E\u4F75\u7528\u306F\u30A8\u30E9\u30FC\uFF09",takesValue:true,placeholder:"<\u6587\u5B57\u5217>"},NOTIFY_FLAG,SUMMARY_FLAG,...DESCRIPTION_FLAGS,PRIORITY_FLAG,DUE_DATE_FLAG,...ISSUE_FIELD_FLAGS,{name:"--clear",summary:"\u6307\u5B9A\u3057\u305F\u9805\u76EE\u3092\u7A7A\u306B\u3059\u308B\uFF08\u30AB\u30F3\u30DE\u533A\u5207\u308A\u3002\u4F8B: due-date,milestone\uFF09",
|
|
158
|
-
takesValue:true,placeholder:"<\u9805\u76EE,...>"}],async prepare(input,ctx){const ref=issueRef(input,"twp backlog issue update help");const assigneeRef=readUpdateRef(input,"--assignee","Backlog \u30E6\u30FC\u30B6\u30FC");const statusRef=readUpdateRef(input,"--status","Backlog \u30B9\u30C6\u30FC\u30BF\u30B9");const notifyRefs=readNotifyRefs(input);const
|
|
159
|
-
input.flags,"--due-date");if(input.flags.get("--description-file")==="-"&&input.flags.get("--comment-file")==="-"){throw new UsageError("--description-file \u3068 --comment-file \u306E\u4E21\u65B9\u3092\u6A19\u6E96\u5165\u529B\uFF08-\uFF09\u306B\u306F\u3067\u304D\u307E\u305B\u3093","\u3069\u3061\u3089\u304B\u4E00\u65B9\u3092\u30D5\u30A1\u30A4\u30EB\u306B\u3057\u3066\u304F\u3060\u3055\u3044\u3002")}const description=await readDescription(
|
|
160
|
-
input,{flag:"--comment",fileFlag:"--comment-file",label:"\u5909\u66F4\u30B3\u30E1\u30F3\u30C8",maxChars:BODY_MAX_CHARS,usage:"twp backlog issue update help"});if(comment===void 0&&summary===void 0&&description===void 0&&priorityRef===void 0&&dueDate===void 0&&assigneeRef===void 0&&statusRef===void 0&&clear===void 0&&Object.keys(fields).length===0){throw new UsageError("\u5909\u66F4\u3059\u308B\u9805\u76EE\u304C\u3042\u308A\u307E\u305B\u3093",
|
|
161
|
-
|
|
163
|
+
takesValue:true,placeholder:"<\u30D1\u30B9|->"},{name:"--comment",summary:"\u5909\u66F4\u306E\u7406\u7531\u3092\u76F4\u63A5\u6307\u5B9A\u3059\u308B\uFF08\u4E00\u884C\u5411\u3051\u3002--comment-file \u3068\u306E\u4F75\u7528\u306F\u30A8\u30E9\u30FC\uFF09",takesValue:true,placeholder:"<\u6587\u5B57\u5217>"},NOTIFY_FLAG,ATTACHMENT_ID_FLAG,SUMMARY_FLAG,...DESCRIPTION_FLAGS,PRIORITY_FLAG,DUE_DATE_FLAG,...ISSUE_FIELD_FLAGS,{name:"--clear",summary:"\u6307\u5B9A\u3057\u305F\u9805\u76EE\u3092\u7A7A\u306B\u3059\u308B\uFF08\u30AB\u30F3\u30DE\u533A\u5207\u308A\u3002\u4F8B: due-date,milestone\uFF09",
|
|
164
|
+
takesValue:true,placeholder:"<\u9805\u76EE,...>"}],async prepare(input,ctx){const ref=issueRef(input,"twp backlog issue update help");const assigneeRef=readUpdateRef(input,"--assignee","Backlog \u30E6\u30FC\u30B6\u30FC");const statusRef=readUpdateRef(input,"--status","Backlog \u30B9\u30C6\u30FC\u30BF\u30B9");const notifyRefs=readNotifyRefs(input);const attachmentIds=readAttachmentIds(input,"twp backlog issue update help");const fields=readIssueFields(input);const clear=readClearFields(input);const summary=summaryFlag(
|
|
165
|
+
input);const priorityRef=readPriorityRef(input);const dueDate=dateFlag(input.flags,"--due-date");if(input.flags.get("--description-file")==="-"&&input.flags.get("--comment-file")==="-"){throw new UsageError("--description-file \u3068 --comment-file \u306E\u4E21\u65B9\u3092\u6A19\u6E96\u5165\u529B\uFF08-\uFF09\u306B\u306F\u3067\u304D\u307E\u305B\u3093","\u3069\u3061\u3089\u304B\u4E00\u65B9\u3092\u30D5\u30A1\u30A4\u30EB\u306B\u3057\u3066\u304F\u3060\u3055\u3044\u3002")}const description=await readDescription(
|
|
166
|
+
input,"twp backlog issue update help");const comment=await readBody(input,{flag:"--comment",fileFlag:"--comment-file",label:"\u5909\u66F4\u30B3\u30E1\u30F3\u30C8",maxChars:BODY_MAX_CHARS,usage:"twp backlog issue update help"});if(comment===void 0&&summary===void 0&&description===void 0&&priorityRef===void 0&&dueDate===void 0&&assigneeRef===void 0&&statusRef===void 0&&clear===void 0&&attachmentIds===void 0&&Object.keys(fields).length===0){throw new UsageError("\u5909\u66F4\u3059\u308B\u9805\u76EE\u304C\u3042\u308A\u307E\u305B\u3093",
|
|
167
|
+
"--summary / --description-file / --priority / --due-date / --assignee <\u540D\u524D|ID> / --status <\u540D\u524D|ID> / --comment-file <\u30D1\u30B9> / --start-date / --milestone / --affected-version / --category / --resolution / --estimated-hours / --actual-hours / --clear / --attachment-id \u306E\u3046\u3061\u3001\u5C11\u306A\u304F\u3068\u30821\u3064\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\uFF08--notify \u306F\u901A\u77E5\u5148\u306E\u6307\u5B9A\u3067\u3001\u305D\u308C\u3060\u3051\u3067\u306F\u5909\u66F4\u306B\u306A\u308A\u307E\u305B\u3093\uFF09\u3002")}
|
|
162
168
|
const space=await resolveSpace(input,ctx);const resolved={issueRef:ref};const projectRef=assigneeRef?.projectRef??statusRef?.projectRef??notifyRefs.find(ref2=>ref2.projectRef!==null)?.projectRef??null;const projectId=projectRef===null?void 0:await resolveUpdateProject(projectRef,()=>ctx.resolver.backlogProjects(space.id));if(projectId!==void 0)resolved["projectUsed"]=projectId;if(assigneeRef!==void 0){resolved["assigneeId"]=await resolveUpdateRef(assigneeRef,projectId,id=>ctx.resolver.backlogUsers(
|
|
163
|
-
space.id,id))}if(statusRef!==void 0){resolved["statusId"]=await resolveUpdateRef(statusRef,projectId,id=>ctx.resolver.backlogStatuses(space.id,id))}const notified=await resolveNotifyRefs(notifyRefs,projectId,id=>ctx.resolver.backlogUsers(space.id,id));if(notified!==void 0)resolved["notifiedUserId"]=notified;if(comment!==void 0)resolved["comment"]=comment;if(clear!==void 0)resolved["clear"]=clear;if(
|
|
164
|
-
if(dueDate!==void 0)resolved["dueDate"]=dueDate;if(priorityRef!==void 0)resolved["priorityId"]=await resolvePriorityRef(priorityRef,space.id,ctx);Object.assign(resolved,fields);return withSpace(withResolved(input,resolved),space)},plan(input){const body={};issueFieldsBody(input,body);for(const key of["assigneeId","statusId","priorityId"]){const value=input.resolved?.[key];if(value!==void 0)body[key]=Number(value)}for(const key of[
|
|
165
|
-
if(value!==void 0)body[key]=value}const comment=input.resolved?.["comment"];if(comment!==void 0)body["comment"]=comment;const clear=resolvedList(input,"clear");if(clear!==void 0)body["clear"]=clear;notifyBody(input,body);return{method:"PATCH",path:backlogSpacePath(requireSpace(input),`/issues/${encodeURIComponent(requireResolved(input,"issueRef"))}`),body}},plannedNotes:updateNotes,summarize:body=>pick(
|
|
166
|
-
if(input.flags.has("--limit")&&input.flags.has("--count")){throw new UsageError("--limit \u3068 --count \u306F\u540C\u3058\u610F\u5473\u3067\u3059\u3002\u3069\u3061\u3089\u304B\u4E00\u65B9\u3060\u3051\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044")}const flag=input.flags.has("--limit")?"--limit":"--count";return integerFlag(input.flags,flag,{min:1,max:MAX_COUNT})}var COMMENT_PAGING={cursorParam:"
|
|
167
|
-
body,"comments","\u30B3\u30E1\u30F3\u30C8\u4E00\u89A7"),nextCursor(body,plan){const comments=listOf(body,"comments","\u30B3\u30E1\u30F3\u30C8\u4E00\u89A7");const requested=Number(plan?.query?.["count"]??DEFAULT_COUNT);const last=comments[comments.length-1];if(last===void 0||comments.length<requested)return null;const id=isRecord(last)?last["id"]:void 0;if((typeof id!=="number"||!Number.isInteger(id))&&(typeof id!==
|
|
168
|
-
\u304D\u3092\u8FBF\u308C\u307E\u305B\u3093\u3002\u63A5\u7D9A\u5148\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002")}return String(id)},withItems:(body,merged)=>({...isRecord(body)?body:{},comments:[...merged]}),readCursor:()=>({hasMore:void 0,cursor:void 0}),resume:cursor=>`--max-id ${cursor}\uFF08--order asc
|
|
169
|
-
operations:[{name:"list",summary:"Backlog \u8AB2\u984C\u306E\u30B3\u30E1\u30F3\u30C8\u3092\u4E00\u89A7\u3059\u308B",usage:"twp backlog comment list <\u8AB2\u984C\u30AD\u30FC|\u8AB2\u984CID> [--space <ID|URL>] [--limit <\u4EF6\u6570>] [--all] [--order <\u9806\u5E8F>]",description:`\u5404\u30B3\u30E1\u30F3\u30C8\u306B\u306F changeLog\uFF08\u30B9\u30C6\u30FC\u30BF\u30B9\u30FB\u62C5\u5F53\u306E\u5909\u66F4\u5C65\u6B74\uFF09\u304C\u5FC5\u305A\u542B\u307E\u308C\u307E\
|
|
169
|
+
space.id,id))}if(statusRef!==void 0){resolved["statusId"]=await resolveUpdateRef(statusRef,projectId,id=>ctx.resolver.backlogStatuses(space.id,id))}const notified=await resolveNotifyRefs(notifyRefs,projectId,id=>ctx.resolver.backlogUsers(space.id,id));if(notified!==void 0)resolved["notifiedUserId"]=notified;if(comment!==void 0)resolved["comment"]=comment;if(clear!==void 0)resolved["clear"]=clear;if(attachmentIds!==void 0)resolved["attachmentId"]=attachmentIds;if(summary!==void 0)resolved["summar\
|
|
170
|
+
y"]=summary;if(description!==void 0)resolved["description"]=description;if(dueDate!==void 0)resolved["dueDate"]=dueDate;if(priorityRef!==void 0)resolved["priorityId"]=await resolvePriorityRef(priorityRef,space.id,ctx);Object.assign(resolved,fields);return withSpace(withResolved(input,resolved),space)},plan(input){const body={};issueFieldsBody(input,body);for(const key of["assigneeId","statusId","priorityId"]){const value=input.resolved?.[key];if(value!==void 0)body[key]=Number(value)}for(const key of[
|
|
171
|
+
"summary","description","dueDate"]){const value=input.resolved?.[key];if(value!==void 0)body[key]=value}const comment=input.resolved?.["comment"];if(comment!==void 0)body["comment"]=comment;const clear=resolvedList(input,"clear");if(clear!==void 0)body["clear"]=clear;notifyBody(input,body);attachmentIdBody(input,body);return{method:"PATCH",path:backlogSpacePath(requireSpace(input),`/issues/${encodeURIComponent(requireResolved(input,"issueRef"))}`),body}},plannedNotes:updateNotes,summarize:body=>pick(
|
|
172
|
+
issueObject(body),ISSUE_GET_COLUMNS),raw:body=>issueObject(body)}]};function commentPageSize(input){if(input.flags.has("--limit")&&input.flags.has("--count")){throw new UsageError("--limit \u3068 --count \u306F\u540C\u3058\u610F\u5473\u3067\u3059\u3002\u3069\u3061\u3089\u304B\u4E00\u65B9\u3060\u3051\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044")}const flag=input.flags.has("--limit")?"--limit":"--count";return integerFlag(input.flags,flag,{min:1,max:MAX_COUNT})}var COMMENT_PAGING={cursorParam:"\
|
|
173
|
+
maxId",cursorParamFor:plan=>plan.query?.["order"]==="asc"?"minId":"maxId",items:body=>listOf(body,"comments","\u30B3\u30E1\u30F3\u30C8\u4E00\u89A7"),nextCursor(body,plan){const comments=listOf(body,"comments","\u30B3\u30E1\u30F3\u30C8\u4E00\u89A7");const requested=Number(plan?.query?.["count"]??DEFAULT_COUNT);const last=comments[comments.length-1];if(last===void 0||comments.length<requested)return null;const id=isRecord(last)?last["id"]:void 0;if((typeof id!=="number"||!Number.isInteger(id))&&(typeof id!==
|
|
174
|
+
"string"||!NUMERIC.test(id))){throw new ApiResponseError("\u30B3\u30E1\u30F3\u30C8\u4E00\u89A7\u306E\u5FDC\u7B54\u306B\u6570\u5024\u306E id \u304C\u7121\u3044\u305F\u3081\u3001\u7D9A\u304D\u3092\u8FBF\u308C\u307E\u305B\u3093\u3002\u63A5\u7D9A\u5148\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002")}return String(id)},withItems:(body,merged)=>({...isRecord(body)?body:{},comments:[...merged]}),readCursor:()=>({hasMore:void 0,cursor:void 0}),resume:cursor=>`--max-id ${cursor}\uFF08--order asc\
|
|
175
|
+
\u306A\u3089 --min-id ${cursor}\uFF09`};var commentResource={name:"comment",summary:"Backlog \u8AB2\u984C\u306E\u30B3\u30E1\u30F3\u30C8\uFF08\u4E00\u89A7\u30FB\u6295\u7A3F\uFF09",operations:[{name:"list",summary:"Backlog \u8AB2\u984C\u306E\u30B3\u30E1\u30F3\u30C8\u3092\u4E00\u89A7\u3059\u308B",usage:"twp backlog comment list <\u8AB2\u984C\u30AD\u30FC|\u8AB2\u984CID> [--space <ID|URL>] [--limit <\u4EF6\u6570>] [--all] [--order <\u9806\u5E8F>]",description:`\u5404\u30B3\u30E1\u30F3\u30C8\u306B\u306F changeLog\uFF08\u30B9\u30C6\u30FC\u30BF\u30B9\u30FB\u62C5\u5F53\u306E\u5909\u66F4\u5C65\u6B74\uFF09\u304C\u5FC5\u305A\u542B\u307E\u308C\u307E\
|
|
176
|
+
\u3059\u3002
|
|
170
177
|
\u300C\u3044\u3064\u30FB\u8AB0\u304C\u30FB\u8AB0\u306B\u632F\u3063\u305F\u304B\u300D\u306F Backlog \u3067\u306F\u3053\u3053\u306B\u3057\u304B\u7121\u3044\u306E\u3067\u3001\u8981\u7D04\u5217\u304B\u3089\u3082\u843D\u3068\u3057\u307E\u305B\u3093\u3002
|
|
171
178
|
|
|
172
179
|
\u30DA\u30FC\u30B8\u30F3\u30B0:
|
|
@@ -178,17 +185,19 @@ in-id \u3068\u4F75\u7528\u3059\u308B\u3068\u305D\u306E\u7BC4\u56F2\u3092\u5168\u
|
|
|
178
185
|
takesValue:true,placeholder:"<ID>"}],async prepare(input,ctx){const ref=issueRef(input,"twp backlog comment list help");return withResolved(withSpace(input,await resolveSpace(input,ctx)),{issueRef:ref})},plan(input){const ref=requireResolved(input,"issueRef");return{method:"GET",path:backlogSpacePath(requireSpace(input),`/issues/${encodeURIComponent(ref)}/comments`),query:{count:commentPageSize(input)??(input.flags.has("--all")?MAX_COUNT:void 0),order:order(input.flags.get("--order")),minId:integerFlag(
|
|
179
186
|
input.flags,"--min-id",{min:0}),maxId:integerFlag(input.flags,"--max-id",{min:0})}}},plannedNotes:spaceNotes,paging:COMMENT_PAGING,summarize:body=>listOf(body,"comments","\u30B3\u30E1\u30F3\u30C8\u4E00\u89A7").map(commentRow),raw:body=>listOf(body,"comments","\u30B3\u30E1\u30F3\u30C8\u4E00\u89A7"),notes(body,input){if(input.flags.has("--all"))return[];const received=listOf(body,"comments","\u30B3\u30E1\u30F3\u30C8\u4E00\u89A7").length;const count=commentPageSize(input)??DEFAULT_COUNT;return received<
|
|
180
187
|
count?[]:[`${received} \u4EF6\uFF08--limit \u306E\u4E0A\u9650\u3061\u3087\u3046\u3069\uFF09\u3092\u53D6\u5F97\u3057\u307E\u3057\u305F\u3002\u7D9A\u304D\u304C\u3042\u308B\u304B\u3082\u3057\u308C\u307E\u305B\u3093: --all \u3067\u5168\u4EF6\u3092\u53D6\u5F97\u3059\u308B\u304B\u3001--min-id / --max-id \u3067\u7D9A\u304D\u3092\u53D6\u5F97\u3057\u3066\u304F\u3060\u3055\u3044\u3002`]}},{name:"create",summary:"Backlog \u8AB2\u984C\u306B\u30B3\u30E1\u30F3\u30C8\u3092\u6295\u7A3F\u3059\u308B\uFF08--yes \u304C\u5FC5\u8981\uFF09",
|
|
181
|
-
usage:"twp backlog comment create <\u8AB2\u984C\u30AD\u30FC|\u8AB2\u984CID> --body-file <\u30D1\u30B9> [--notify <\u540D\u524D|ID>]... [--project <\u30AD\u30FC|ID>] [--space <ID|URL>] --yes",description:`${EXTERNAL_WRITE_HELP}
|
|
188
|
+
usage:"twp backlog comment create <\u8AB2\u984C\u30AD\u30FC|\u8AB2\u984CID> --body-file <\u30D1\u30B9> [--notify <\u540D\u524D|ID>]... [--attachment-id <ID>]... [--project <\u30AD\u30FC|ID>] [--space <ID|URL>] --yes",description:`${EXTERNAL_WRITE_HELP}
|
|
182
189
|
|
|
183
190
|
${bodyHelp("--body-file","--body")}
|
|
184
191
|
|
|
185
192
|
${NOTIFY_HELP}
|
|
186
193
|
|
|
187
|
-
${
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
194
|
+
${ATTACHMENT_ID_HELP}
|
|
195
|
+
|
|
196
|
+
${ORDER_HELP}`,destructive:true,flags:[...BODY_FLAGS,SPACE_FLAG,{name:"--issue",summary:"\u8AB2\u984C\u30AD\u30FC\uFF08\u4F4D\u7F6E\u5F15\u6570\u3068\u540C\u3058\u610F\u5473\uFF09",takesValue:true,placeholder:"<\u30AD\u30FC|ID>"},NOTIFY_FLAG,ATTACHMENT_ID_FLAG,{...UPDATE_PROJECT_FLAG,summary:"--notify \u3092\u540D\u524D\u3067\u6307\u5B9A\u3059\u308B\u3068\u304D\u306B\u8981\u308B Backlog \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\uFF08\u30AD\u30FC / \u540D\u79F0 / \u6570\u5024ID\uFF09"}],async prepare(input,ctx){
|
|
197
|
+
const ref=issueRef(input,"twp backlog comment create help");const notifyRefs=readNotifyRefs(input);const attachmentIds=readAttachmentIds(input,"twp backlog comment create help");const content=await readBody(input,{flag:"--body",fileFlag:"--body-file",label:"\u30B3\u30E1\u30F3\u30C8\u672C\u6587",maxChars:BODY_MAX_CHARS,usage:"twp backlog comment create help"});if(content===void 0){throw new UsageError("\u30B3\u30E1\u30F3\u30C8\u672C\u6587\u3092 --body-file <\u30D1\u30B9> \u304B --body <\u6587\u5B57\u5217> \u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044",
|
|
198
|
+
"twp backlog comment create help")}const space=await resolveSpace(input,ctx);const resolved={issueRef:ref,content};if(attachmentIds!==void 0)resolved["attachmentId"]=attachmentIds;const projectRef=notifyRefs.find(notify=>notify.projectRef!==null)?.projectRef??null;const projectId=projectRef===null?void 0:await resolveUpdateProject(projectRef,()=>ctx.resolver.backlogProjects(space.id));if(projectId!==void 0)resolved["projectUsed"]=projectId;const notified=await resolveNotifyRefs(notifyRefs,projectId,
|
|
199
|
+
id=>ctx.resolver.backlogUsers(space.id,id));if(notified!==void 0)resolved["notifiedUserId"]=notified;return withSpace(withResolved(input,resolved),space)},plan(input){const body={content:requireResolved(input,"content")};notifyBody(input,body);attachmentIdBody(input,body);return{method:"POST",path:backlogSpacePath(requireSpace(input),`/issues/${encodeURIComponent(requireResolved(input,"issueRef"))}/comments`),body}},plannedNotes:updateNotes,summarize:body=>commentRow(commentObject(body)),raw:commentObject}]};
|
|
200
|
+
function projectMasterResource(spec){const key=spec.responseKey??spec.envelope;return{name:spec.name,summary:spec.summary,operations:[{name:"list",summary:spec.operationSummary,usage:`twp backlog ${spec.name} list --project <\u30AD\u30FC|ID> [--space <ID|URL>]`,description:`${spec.description}
|
|
192
201
|
\u3053\u306E API \u306F\u30DA\u30FC\u30B8\u30F3\u30B0\u3092\u6301\u305F\u305A\u3001\u5E38\u306B\u5168\u4EF6\u3092\u8FD4\u3057\u307E\u3059\u3002`,flags:[SPACE_FLAG,{name:"--project",summary:"Backlog \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u30AD\u30FC\uFF08HC_FM_ID\uFF09\u304B\u6570\u5024ID\u3002\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u540D\u3067\u306F\u5F15\u3051\u307E\u305B\u3093",takesValue:true,placeholder:"<\u30AD\u30FC|ID>"}],async prepare(input,ctx){if(input.args.length>0){throw new UsageError(`l\
|
|
193
202
|
ist \u306F\u4F4D\u7F6E\u5F15\u6570\u3092\u53D6\u308A\u307E\u305B\u3093: ${input.args.join(" ")}`,`twp backlog ${spec.name} list help`)}const space=await resolveSpace(input,ctx);const refs=commaList(input.flags,"--project");if(refs===void 0){throw new UsageError("--project \u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044",`twp backlog ${spec.name} list help`)}if(refs.length>1){throw new UsageError(`--project \u306B\u8907\u6570\u306E\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u306F\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093\uFF08\u53D7\u3051\u53D6\u3063\u305F\u5024: ${refs.
|
|
194
203
|
join(" / ")}\uFF09`,"\u3053\u306E\u4E00\u89A7\u306F1\u3064\u306E Backlog \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u306B\u5C5E\u3057\u307E\u3059\u3002")}const ref=refs[0];return withResolved(withSpace(input,space),{projectRef:ref})},plan(input){const ref=requireResolved(input,"projectRef");if(!/^[A-Za-z0-9_]+$/.test(ref)){throw new UsageError(`--project \u306E\u5F62\u5F0F\u304C\u9055\u3044\u307E\u3059: ${ref}`,"Backlog \u306E\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u30AD\u30FC\uFF08HC_FM_ID\uFF09\u304B\u6570\u5024 ID \u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u540D\u3067\u306F\u5F15\u3051\u307E\u305B\u3093\uFF08twp backlog project list \u3067 proj\
|
|
@@ -196,17 +205,38 @@ ectKey \u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\uFF09\u3002")}retu
|
|
|
196
205
|
ent",label:"\u6DFB\u4ED8ID"}];const values=new Map;const open=[];for(const slot of slots){const fromFlag=input.flags.get(slot.flag);if(fromFlag===void 0){open.push(slot);continue}if(fromFlag.trim()==="")throw new UsageError(`${slot.flag} \u306B\u5024\u304C\u3042\u308A\u307E\u305B\u3093`,usage);values.set(slot.flag,fromFlag.trim())}const args=input.args.map(arg=>arg.trim()).filter(arg=>arg!=="");if(args.length>open.length){throw new UsageError(`\u4F4D\u7F6E\u5F15\u6570\u304C\u591A\u3059\u304E\u307E\u3059: ${args.
|
|
197
206
|
slice(open.length).join(" ")}`,open.length===0?"\u8AB2\u984C\u30AD\u30FC\u3068\u6DFB\u4ED8ID \u306F\u3069\u3061\u3089\u3082\u30D5\u30E9\u30B0\u3067\u6307\u5B9A\u6E08\u307F\u3067\u3059\u3002":`\u6B8B\u308A\u306E\u4F4D\u7F6E\u5F15\u6570\u3067\u6307\u5B9A\u3067\u304D\u308B\u306E\u306F ${open.map(slot=>slot.label).join(" \u2192 ")} \u3060\u3051\u3067\u3059\u3002`)}if(args.length<open.length){throw new UsageError(`${open[args.length]?.label}\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044`,usage)}
|
|
198
207
|
open.forEach((slot,index)=>values.set(slot.flag,args[index]));const issue=values.get("--issue");if(!ISSUE_REF.test(issue)){throw new UsageError(`\u8AB2\u984C\u30AD\u30FC\u306E\u5F62\u5F0F\u304C\u9055\u3044\u307E\u3059: ${issue}`,"Backlog \u306E\u8AB2\u984C\u30AD\u30FC\uFF08HC_FM_ID-19171\uFF09\u304B\u8AB2\u984CID\uFF08\u6570\u5024\uFF09\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002")}const attachment=values.get("--attachment");if(!isExactNumericId(attachment)){throw new UsageError(
|
|
199
|
-
`\u6DFB\u4ED8ID \u306E\u5F62\u5F0F\u304C\u9055\u3044\u307E\u3059: ${attachment}`,"twp backlog attachment list \u306E id\uFF08\u6570\u5024\uFF09\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\uFF08\u30D5\u30A1\u30A4\u30EB\u540D\u3067\u306F\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093\uFF09\u3002")}return{issue,attachment}}var attachmentResource={name:"attachment",summary:"Backlog \u8AB2\u984C\u306E\u6DFB\u4ED8\u30D5\u30A1\u30A4\u30EB\uFF08\u4E00\u89A7\u30FB\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9\uFF09",
|
|
208
|
+
`\u6DFB\u4ED8ID \u306E\u5F62\u5F0F\u304C\u9055\u3044\u307E\u3059: ${attachment}`,"twp backlog attachment list \u306E id\uFF08\u6570\u5024\uFF09\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\uFF08\u30D5\u30A1\u30A4\u30EB\u540D\u3067\u306F\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093\uFF09\u3002")}return{issue,attachment}}var UPLOAD_MAX_BYTES=30*1024*1024;var attachmentResource={name:"attachment",summary:"Backlog \u8AB2\u984C\u306E\u6DFB\u4ED8\u30D5\u30A1\u30A4\u30EB\uFF08\u4E00\u89A7\u30FB\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9\u30FB\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\uFF09",
|
|
200
209
|
operations:[{name:"list",summary:"Backlog \u8AB2\u984C\u306E\u6DFB\u4ED8\u30D5\u30A1\u30A4\u30EB\u3092\u4E00\u89A7\u3059\u308B",usage:"twp backlog attachment list <\u8AB2\u984C\u30AD\u30FC|\u8AB2\u984CID> [--space <ID|URL>]",description:"download \u306B\u6E21\u3059 id \u3068\u3001\u843D\u3068\u3059\u524D\u306B\u5927\u304D\u3055\u3092\u5224\u65AD\u3059\u308B\u305F\u3081\u306E size \u3092\u8FD4\u3057\u307E\u3059\u3002\n\u3053\u306E API \u306F\u30DA\u30FC\u30B8\u30F3\u30B0\u3092\u6301\u3061\u307E\u305B\u3093\uFF08\u8AB2\u984C1\u4EF6\u3076\u3093\u306E\u6DFB\u4ED8\u3092\u3059\u3079\u3066\u8FD4\u3057\u307E\u3059\uFF09\u3002",
|
|
201
210
|
flags:[SPACE_FLAG,{name:"--issue",summary:"\u8AB2\u984C\u30AD\u30FC\uFF08\u4F4D\u7F6E\u5F15\u6570\u3068\u540C\u3058\u610F\u5473\uFF09",takesValue:true,placeholder:"<\u30AD\u30FC|ID>"}],async prepare(input,ctx){const ref=issueRef(input,"twp backlog attachment list help");return withResolved(withSpace(input,await resolveSpace(input,ctx)),{issueRef:ref})},plan(input){const ref=requireResolved(input,"issueRef");return{method:"GET",path:backlogSpacePath(requireSpace(input),`/issues/${encodeURIComponent(
|
|
202
211
|
ref)}/attachments`)}},plannedNotes:spaceNotes,summarize:body=>listOf(body,"attachments","\u6DFB\u4ED8\u4E00\u89A7").map(row=>pick(row,ATTACHMENT_COLUMNS)),raw:body=>listOf(body,"attachments","\u6DFB\u4ED8\u4E00\u89A7")},{name:"download",summary:"Backlog \u8AB2\u984C\u306E\u6DFB\u4ED8\u30D5\u30A1\u30A4\u30EB\u3092 --out \u3078\u66F8\u304D\u51FA\u3059",usage:"twp backlog attachment download <\u8AB2\u984C\u30AD\u30FC|\u8AB2\u984CID> <\u6DFB\u4ED8ID> --out <\u30D1\u30B9> [--force] [--space <ID|URL>]",
|
|
203
212
|
description:"\u6DFB\u4ED8\u306E\u5B9F\u4F53\u3092 --out \u306E\u30D1\u30B9\u3078\u305D\u306E\u307E\u307E\u66F8\u304D\u307E\u3059\uFF08\u6A19\u6E96\u51FA\u529B\u3078\u306F\u51FA\u3057\u307E\u305B\u3093\uFF09\u3002\n\u6A19\u6E96\u51FA\u529B\u306B\u51FA\u308B\u306E\u306F\u66F8\u3044\u305F\u5834\u6240\u30FB\u30D0\u30A4\u30C8\u6570\u30FBContent-Type \u3060\u3051\u3067\u3001--output json \u3067\u305D\u306E\u307E\u307E\u8AAD\u3081\u307E\u3059\u3002\n\n\u6DFB\u4ED8ID \u306F twp backlog attachment list \u306E id \u3067\u3059\uFF08\u30D5\u30A1\u30A4\u30EB\u540D\u3067\u306F\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093\uFF09\u3002\n\u65E2\u5B58\u30D5\u30A1\u30A4\u30EB\u306F\u4E0A\u66F8\u304D\u3057\u307E\u305B\u3093\uFF08--force \u3092\u4ED8\u3051\u305F\u3068\u304D\u3060\u3051\u4E0A\u66F8\u304D\u3057\u307E\u3059\uFF09\u3002\n\u66F8\u304D\u51FA\u3057\u5148\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306F\u81EA\u52D5\u3067\u4F5C\u308A\u307E\u305B\u3093\u3002\n\n\u30B5\u30A4\u30BA\u306E\u4E0A\u9650\u306F\u3042\u308A\u307E\u305B\u3093\u3002v1 \u306E\u516C\u958BAPI\uFF08api.tocca.systems\uFF09\u306B\u306F\u7D04 4.49MB \u306E\u4E0A\u9650\u304C\n\u3042\u308A\u307E\u3059\u304C\u3001\u3053\u306E CLI \u304C\u4F7F\u3046 v2 \u9762\u306F\u5225\u7D4C\u8DEF\u306A\u306E\u3067\u639B\u304B\u308A\u307E\u305B\u3093\u3002",
|
|
204
213
|
flags:[SPACE_FLAG,{name:"--issue",summary:"\u8AB2\u984C\u30AD\u30FC\uFF08\u7B2C1\u4F4D\u7F6E\u5F15\u6570\u3068\u540C\u3058\u610F\u5473\uFF09",takesValue:true,placeholder:"<\u30AD\u30FC|ID>"},{name:"--attachment",summary:"\u6DFB\u4ED8ID\uFF08\u7B2C2\u4F4D\u7F6E\u5F15\u6570\u3068\u540C\u3058\u610F\u5473\uFF09",takesValue:true,placeholder:"<ID>"},{name:"--out",summary:"\u66F8\u304D\u51FA\u3057\u5148\u306E\u30D5\u30A1\u30A4\u30EB\u30D1\u30B9\uFF08\u5FC5\u9808\uFF09",takesValue:true,placeholder:"<\u30D1\u30B9>"},
|
|
205
214
|
{name:"--force",summary:"\u65E2\u5B58\u30D5\u30A1\u30A4\u30EB\u3092\u4E0A\u66F8\u304D\u3059\u308B",takesValue:false}],download:{outFlag:"--out",forceFlag:"--force"},async prepare(input,ctx){const refs=attachmentRefs(input);return withResolved(withSpace(input,await resolveSpace(input,ctx)),{issueRef:refs.issue,attachmentId:refs.attachment})},plan(input){const ref=requireResolved(input,"issueRef");const attachmentId=requireResolved(input,"attachmentId");return{method:"GET",path:backlogSpacePath(requireSpace(
|
|
206
|
-
input),`/issues/${encodeURIComponent(ref)}/attachments/${encodeURIComponent(attachmentId)}`)}},plannedNotes:spaceNotes,summarize:body=>body,raw:body=>body}
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
215
|
+
input),`/issues/${encodeURIComponent(ref)}/attachments/${encodeURIComponent(attachmentId)}`)}},plannedNotes:spaceNotes,summarize:body=>body,raw:body=>body},{name:"upload",summary:"Backlog \u30B9\u30DA\u30FC\u30B9\u3078\u30D5\u30A1\u30A4\u30EB\u3092\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u3057\u3001\u6DFB\u4ED8ID \u3092\u5F97\u308B\uFF08--yes \u304C\u5FC5\u8981\uFF09",usage:"twp backlog attachment upload <\u30D5\u30A1\u30A4\u30EB\u30D1\u30B9> [--space <ID|URL>] --yes",description:`\u30D5\u30A1\u30A4\u30EB\u3092 Backlog \u30B9\u30DA\u30FC\u30B9\
|
|
216
|
+
\u3078\u9001\u308A\u3001\u8AB2\u984C\u306B\u6DFB\u4ED8\u3059\u308B\u305F\u3081\u306E\u6DFB\u4ED8ID\uFF08id\uFF09\u3092\u8FD4\u3057\u307E\u3059\uFF08TWP-9029\uFF09\u3002
|
|
217
|
+
\u26A0 \u3053\u306E\u6642\u70B9\u3067\u306F\u3069\u306E\u8AB2\u984C\u306B\u3082\u4ED8\u3044\u3066\u3044\u307E\u305B\u3093\u3002\u8FD4\u3063\u305F id \u3092\u6B21\u306E\u3044\u305A\u308C\u304B\u306E --attachment-id \u306B\u6E21\u3057\u3066
|
|
218
|
+
\u521D\u3081\u3066\u8AB2\u984C\u306B\u4ED8\u304D\u307E\u3059\uFF08TWP-9057\uFF09:
|
|
219
|
+
twp backlog issue create ... --attachment-id <ID> \uFF08\u65B0\u3057\u3044\u8AB2\u984C\u306B\u4ED8\u3051\u308B\uFF09
|
|
220
|
+
twp backlog issue update <\u8AB2\u984C\u30AD\u30FC> --attachment-id <ID> --yes \uFF08\u65E2\u5B58\u306E\u8AB2\u984C\u306B\u4ED8\u3051\u308B\uFF09
|
|
221
|
+
twp backlog comment create <\u8AB2\u984C\u30AD\u30FC> --body-file <\u30D1\u30B9> --attachment-id <ID> --yes \uFF08\u30B3\u30E1\u30F3\u30C8\u306B\u4ED8\u3051\u308B\uFF09
|
|
222
|
+
|
|
223
|
+
\u26A0 \u3053\u308C\u306F Backlog\uFF08\u5916\u90E8\uFF09\u3078\u5B9F\u969B\u306B\u66F8\u304F\u64CD\u4F5C\u3067\u3059\uFF08--yes \u306F\u5BFE\u8A71\u3067\u3082\u8981\u308A\u307E\u3059\uFF09\u3002
|
|
224
|
+
\u9001\u308B\u5185\u5BB9\uFF08\u30D5\u30A1\u30A4\u30EB\u540D\u30FB\u5927\u304D\u3055\u30FB\u7A2E\u985E\uFF09\u306F --dry-run \u3067\u9001\u4FE1\u305B\u305A\u306B\u78BA\u8A8D\u3067\u304D\u307E\u3059\u3002
|
|
225
|
+
\u5931\u6557\u3057\u3066\u3082\u6A5F\u68B0\u7684\u306B\u518D\u5B9F\u884C\u3057\u306A\u3044\u3067\u304F\u3060\u3055\u3044\uFF08\u5C4A\u3044\u305F\u5F8C\u306B\u5FDC\u7B54\u3060\u3051\u5931\u6557\u3057\u305F\u5834\u5408\u3001\u540C\u3058\u30D5\u30A1\u30A4\u30EB\u304C\u4E8C\u91CD\u306B\u4E0A\u304C\u308A\u307E\u3059\uFF09\u3002
|
|
226
|
+
|
|
227
|
+
\u9001\u308B\u30D5\u30A1\u30A4\u30EB\u540D\u306F\u30D1\u30B9\u306E\u672B\u5C3E\u3060\u3051\u3067\u3059\uFF08\u624B\u5143\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u69CB\u6210\u306F\u9001\u308A\u307E\u305B\u3093\uFF09\u3002
|
|
228
|
+
\u5927\u304D\u3055\u306E\u4E0A\u9650\u306F ${UPLOAD_MAX_BYTES/1024/1024}MB \u3067\u3059\uFF08\u4E2D\u7D99 API \u306E\u53D7\u4FE1\u4E0A\u9650 50MB \u306B base64 \u306E 4/3 \u500D\u304C\u4E57\u308B\u305F\u3081\uFF09\u3002
|
|
229
|
+
Backlog \u5074\u306B\u3082\u30D7\u30E9\u30F3\u3054\u3068\u306E\u4E0A\u9650\u304C\u3042\u308A\u3001\u8D85\u3048\u308B\u3068 Backlog \u304C\u30A8\u30E9\u30FC\u3092\u8FD4\u3057\u307E\u3059\u3002`,destructive:true,flags:[SPACE_FLAG,{name:"--file",summary:"\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u3059\u308B\u30D5\u30A1\u30A4\u30EB\uFF08\u4F4D\u7F6E\u5F15\u6570\u3068\u540C\u3058\u610F\u5473\uFF09",takesValue:true,placeholder:"<\u30D1\u30B9>"}],async prepare(input,ctx){const file=singleRef(input,{flag:"--\
|
|
230
|
+
file",label:"\u30D5\u30A1\u30A4\u30EB",usage:"twp backlog attachment upload help"});const upload=readUploadFile(file);return withResolved(withSpace(input,await resolveSpace(input,ctx)),{upload:JSON.stringify(upload)})},plan(input){const upload=JSON.parse(requireResolved(input,"upload"));const base={filename:upload.name,contentType:upload.contentType};return{method:"POST",path:backlogSpacePath(requireSpace(input),"/attachments"),body:new JsonBodyWithView({...base,contentBytes:upload.contentBytes},
|
|
231
|
+
{...base,contentBytes:`\uFF08base64\u30FB\u5143 ${upload.bytes} \u30D0\u30A4\u30C8\u30FB\u8868\u793A\u3057\u306A\u3044\uFF09`})}},plannedNotes(input){const upload=JSON.parse(requireResolved(input,"upload"));return[...spaceNotes(input),`\u9001\u308B\u30D5\u30A1\u30A4\u30EB: ${upload.path}\uFF08${upload.bytes} \u30D0\u30A4\u30C8\u30FB${upload.contentType}\uFF09`]},summarize:uploadedAttachment,raw:uploadedAttachment,notes:()=>["\u3053\u306E\u6DFB\u4ED8\u306F\u307E\u3060\u3069\u306E\u8AB2\u984C\u306B\u3082\u4ED8\u3044\u3066\u3044\u307E\u305B\u3093\u3002id \u3092 twp backlog issue create / issue update / com\
|
|
232
|
+
ment create \u306E --attachment-id \u306B\u6E21\u3057\u3066\u8AB2\u984C\u3078\u4ED8\u3051\u3066\u304F\u3060\u3055\u3044\u3002"]}]};var UPLOAD_CONTENT_TYPES={".pdf":"application/pdf",".csv":"text/csv",".txt":"text/plain",".md":"text/markdown",".json":"application/json",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".zip":"application/zip",".xlsx":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",".docx":"application/vnd.openxmlformats-officedocum\
|
|
233
|
+
ent.wordprocessingml.document",".pptx":"application/vnd.openxmlformats-officedocument.presentationml.presentation"};function readUploadFile(file){let fd;try{fd=fs.openSync(file,"r")}catch(err){const reason=err.code??err.message;throw new UsageError(`\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u3059\u308B\u30D5\u30A1\u30A4\u30EB\u3092\u8AAD\u3081\u307E\u305B\u3093: ${file}\uFF08${reason}\uFF09`)}try{const stat=fs.fstatSync(fd);if(!stat.isFile())throw new UsageError(`\u901A\u5E38\u306E\u30D5\u30A1\u30A4\u30EB\u4EE5\u5916\u306F\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u3067\u304D\u307E\u305B\u3093: ${file}`);
|
|
234
|
+
if(stat.size>UPLOAD_MAX_BYTES)throw uploadTooLarge(stat.size);const bytes=fs.readFileSync(fd);if(bytes.byteLength>UPLOAD_MAX_BYTES)throw uploadTooLarge(bytes.byteLength);if(bytes.byteLength===0)throw new UsageError(`\u7A7A\u306E\u30D5\u30A1\u30A4\u30EB\u306F\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u3057\u307E\u305B\u3093: ${file}`);const name=path.basename(file);return{name,path:path.resolve(file),bytes:bytes.byteLength,contentType:UPLOAD_CONTENT_TYPES[path.extname(name).toLowerCase()]??"application\
|
|
235
|
+
/octet-stream",contentBytes:bytes.toString("base64")}}finally{fs.closeSync(fd)}}function uploadTooLarge(size){return new UsageError(`\u30D5\u30A1\u30A4\u30EB\u304C\u5927\u304D\u3059\u304E\u307E\u3059\uFF08${size} \u30D0\u30A4\u30C8\u30FB\u4E0A\u9650 ${UPLOAD_MAX_BYTES} \u30D0\u30A4\u30C8\uFF09`)}function uploadedAttachment(body){const attachment=isRecord(body)?body["attachment"]:void 0;if(!isRecord(attachment)||attachment["id"]===void 0||attachment["id"]===null){throw new ApiResponseError("\u30A2\u30C3\u30D7\u30ED\u30FC\
|
|
236
|
+
\u30C9\u306E\u5FDC\u7B54\u306B attachment.id \u304C\u3042\u308A\u307E\u305B\u3093\u3002\u63A5\u7D9A\u5148\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002")}return attachment}function noArgs(input,usage){if(input.args.length>0){throw new UsageError(`\u4F4D\u7F6E\u5F15\u6570\u306F\u53D6\u308A\u307E\u305B\u3093: ${input.args.join(" ")}`,usage)}}function userObject(body){const user=isRecord(body)?body["data"]:void 0;if(!isRecord(user)){throw new ApiResponseError("\u30E6\u30FC\u30B6\u30FC\u306E\u5FDC\u7B54\u306B data \u304C\u3042\u308A\u307E\u305B\u3093\u3002\u63A5\u7D9A\u5148\
|
|
237
|
+
\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002")}return user}function notificationRow(row){const record=isRecord(row)?row:{};const issue=isRecord(record["issue"])?record["issue"]:{};const sender=isRecord(record["sender"])?record["sender"]:{};const comment=isRecord(record["comment"])?record["comment"]:{};return pick({...record,issueKey:issue["issueKey"]??null,summary:issue["summary"]??null,sender:sender["name"]??null,comment:comment["content"]??null},NOTIFICATION_COLUMNS)}function notificationNotes(body,input){
|
|
238
|
+
const next=isRecord(body)?body["next_cursor"]:void 0;if(typeof next!=="string"||next==="")return[];const flag=input.flags.get("--order")?.trim().toLowerCase()==="asc"?"--min-id":"--max-id";return[`--count \u3061\u3087\u3046\u3069\u306E\u4EF6\u6570\u3092\u53D6\u5F97\u3057\u307E\u3057\u305F\u3002\u7D9A\u304D\u304C\u3042\u308B\u304B\u3082\u3057\u308C\u307E\u305B\u3093: ${flag} ${next} \u3092\u4ED8\u3051\u3066\u7D9A\u304D\u3092\u53D6\u5F97\u3057\u3066\u304F\u3060\u3055\u3044\u3002`]}var NOTIFICATION_COUNT_BOUNDS={
|
|
239
|
+
min:1,max:MAX_COUNT,overHint:"Backlog \u5074\u306E\u4E0A\u9650\u3067\u3059\u3002\u7D9A\u304D\u306F stderr \u306B\u51FA\u308B --max-id \u3067\u53D6\u5F97\u3057\u3066\u304F\u3060\u3055\u3044\u3002"};var notificationResource={name:"notification",summary:"Backlog \u306E\u81EA\u5206\u3042\u3066\u306E\u304A\u77E5\u3089\u305B\uFF08\u4E00\u89A7\u30FB\u4EF6\u6570\u30FB\u65E2\u8AAD\u5316\uFF09",operations:[{name:"list",summary:"\u81EA\u5206\u3042\u3066\u306E\u304A\u77E5\u3089\u305B\u3092\u65B0\u3057\u3044\u9806\u306B\u4E00\u89A7\u3059\u308B",
|
|
210
240
|
usage:"twp backlog notification list [--space <ID|URL>] [--count <\u4EF6\u6570>] [--max-id <ID>] [--min-id <ID>] [--order asc|desc]",description:"\u30E1\u30F3\u30B7\u30E7\u30F3\u30FB\u62C5\u5F53\u306E\u5272\u308A\u5F53\u3066\u30FB\u30B3\u30E1\u30F3\u30C8\u7B49\u3067\u5C4A\u3044\u305F\u304A\u77E5\u3089\u305B\u3092\u8FD4\u3057\u307E\u3059\uFF08\u65E2\u5B9A\u306F\u65B0\u3057\u3044\u9806\u30FB20\u4EF6\u30FB\u4E0A\u9650100\u4EF6\uFF09\u3002\n\u7D9A\u304D\u306F\u3001\u6700\u5F8C\u306E id \u3092 --max-id \u306B\u6E21\u3057\u3066\u53D6\u5F97\u3057\u307E\u3059\uFF08--max-id / --min-id \u306F\u305D\u306E ID \u3092\u542B\u307F\u307E\u305B\u3093\uFF09\u3002\n\u672A\u8AAD\u3060\u3051\u304C\u6B32\u3057\u3044\u3068\u304D\u306F\u3001\u51FA\u529B\u306E alreadyRead \u304C false \u306E\u3082\u306E\u3092\u9078\u3093\u3067\u304F\u3060\u3055\u3044\n\uFF08Backlog \u306E\u3053\u306E API \u306F\u672A\u8AAD\u3060\u3051\u306B\u7D5E\u308A\u8FBC\u3081\u307E\u305B\u3093\u3002\u4EF6\u6570\u306F notification count --unread \u3067\u5F15\u3051\u307E\u3059\uFF09\u3002\n\n--output json \u306E\u5F62: [{id, alreadyRead, resourceAlreadyRead, reason, reasonLabel,\n project: {id, projectKey, name}\
|
|
211
241
|
, issue: {id, issueKey, summary}, comment: {id, content},\n sender: {id, userId, name}, created}]\uFF08\u8AB2\u984C\u30FB\u30B3\u30E1\u30F3\u30C8\u306E\u7121\u3044\u304A\u77E5\u3089\u305B\u3067\u306F null\uFF09",flags:[SPACE_FLAG,{name:"--count",summary:"\u53D6\u5F97\u4EF6\u6570\uFF081\u301C100\u30FB\u65E2\u5B9A 20\uFF09",takesValue:true,placeholder:"<\u4EF6\u6570>"},{name:"--max-id",summary:"\u3053\u306E ID \u3088\u308A\u53E4\u3044\u3082\u306E\u3092\u53D6\u308B\uFF08\u542B\u307E\u306A\u3044\uFF09",
|
|
212
242
|
takesValue:true,placeholder:"<ID>"},{name:"--min-id",summary:"\u3053\u306E ID \u3088\u308A\u65B0\u3057\u3044\u3082\u306E\u3092\u53D6\u308B\uFF08\u542B\u307E\u306A\u3044\uFF09",takesValue:true,placeholder:"<ID>"},{name:"--order",summary:"\u4E26\u3073\u9806\uFF08asc / desc\u30FB\u65E2\u5B9A desc\uFF09",takesValue:true,placeholder:"<asc|desc>"}],async prepare(input,ctx){noArgs(input,"twp backlog notification list help");integerFlag(input.flags,"--count",NOTIFICATION_COUNT_BOUNDS);integerFlag(input.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire as __twpCreateRequire } from 'node:module';
|
|
2
2
|
const require = __twpCreateRequire(import.meta.url);
|
|
3
|
-
import{loadDomain}from"./chunk-
|
|
3
|
+
import{loadDomain}from"./chunk-TFNUT7CA.js";import{renderDocument,renderOutput}from"./chunk-P4QSPSOQ.js";import{evaluateQuery}from"./chunk-PAJAEUPA.js";import{JsonBodyWithView}from"./chunk-Q3B65OFC.js";import{NO_REDACT_NOTICE,withCommonFlags}from"./chunk-W4NLJ2YK.js";import{redactSecretValues,redactSecrets,withDebug}from"./chunk-BD7O73GK.js";import{parseOperationArgs}from"./chunk-6NHLWYI2.js";import{Resolver,requireDefaultProject}from"./chunk-KG634EFO.js";
|
|
4
4
|
import{ApiError,MultipartBody,TwpApiClient,appendQuery}from"./chunk-NUEKGK4J.js";import{ResolveError}from"./chunk-HVZUXLQ4.js";import{DEFAULT_MAX_ITEMS,DEFAULT_MAX_PAGES,nextPageNotes,positiveInteger,shellQuote}from"./chunk-PMTQFMJS.js";import{isRecord}from"./chunk-HCTPCUST.js";import{ApiRejectedError,ApiResponseError,ConflictError,EXIT_API_CLIENT,EXIT_API_SERVER,EXIT_AUTH,EXIT_CONFLICT,EXIT_FAILURE,EXIT_OK,EXIT_USAGE,EXIT_WAIT_TIMEOUT,NetworkError,UsageError,WaitTimeoutError}from"./chunk-STILP3Z6.js";
|
|
5
5
|
import{GLOBAL_OPTIONS_HELP}from"./chunk-TZL2342W.js";import{AuthSession,NotLoggedInError,SessionExpiredError}from"./chunk-ITFO5GPX.js";import{loadCredentials}from"./chunk-GWVREACM.js";import{httpFetch}from"./chunk-J7QYPKVK.js";import{effectiveApiUrl,loadUserConfig,resolveConfiguredBacklogSpace,resolveConfiguredOutput,resolveProfile}from"./chunk-EDF4U5BT.js";import{HELP_TOKEN}from"./chunk-PLPEDJLC.js";import{OUTPUT_FORMATS,resolveOutputFormat}from"./chunk-RKBUJKI5.js";
|
|
6
6
|
import{stringWidth}from"./chunk-UREA4ZIG.js";import{stripTerminalControls}from"./chunk-NHYMHCAT.js";import fs from"fs";import path from"path";function alignedList(entries,indent=" "){const width=entries.reduce((max,[left])=>Math.max(max,stringWidth(left)),0);return entries.map(([left,right])=>`${indent}${left}${" ".repeat(Math.max(0,width-stringWidth(left)))} ${right}`).join("\n")}function subresourcesOf(resource){return resource.subresources??[]}function renderResourceHelp(resource,path2){const subresources=subresourcesOf(resource);const operationSection=resource.operations.length===0?"":`
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { createRequire as __twpCreateRequire } from 'node:module';
|
|
2
2
|
const require = __twpCreateRequire(import.meta.url);
|
|
3
3
|
var LOADERS={agent:async()=>(await import("./agent-AI5RIE46.js")).agentDomain,"agent-loop":async()=>(await import("./agent-loop-ZVUJ2CV7.js")).agentLoopDomain,"ai-review-reason":async()=>(await import("./sales-ai-review-W5AUC6ZJ.js")).aiReviewReasonDomain,analysis:async()=>(await import("./analysis-WNJX4PJS.js")).analysisDomain,announcement:async()=>(await import("./announcement-I6GBF3SR.js")).announcementDomain,"api-key":async()=>(await import("./api-key-I477577M.js")).apiKeyDomain,attendance:async()=>(await import("./attendance-correct-TCNYIRK3.js")).
|
|
4
|
-
attendanceDomainWithRecords,"audit-log":async()=>(await import("./audit-log-63IQEXXV.js")).auditLogDomain,backlog:async()=>(await import("./backlog-
|
|
4
|
+
attendanceDomainWithRecords,"audit-log":async()=>(await import("./audit-log-63IQEXXV.js")).auditLogDomain,backlog:async()=>(await import("./backlog-X67QUKWT.js")).backlogDomain,brief:async()=>(await import("./brief-4XHJ5AVO.js")).briefDomain,budget:async()=>(await import("./budget-2M7RVRSN.js")).budgetDomain,"business-hours":async()=>(await import("./business-hours-QL763KSA.js")).businessHoursDomain,"business-place":async()=>(await import("./sales-master-KOQ5R6B4.js")).businessPlaceDomain,
|
|
5
5
|
chat:async()=>(await import("./chat-NNGID63J.js")).chatDomain,company:async()=>(await import("./company-ZLB3GW3Q.js")).companyDomain,content:async()=>(await import("./content-ZXR56RVL.js")).contentDomain,contract:async()=>(await import("./contract-BBAVEQQE.js")).contractDomain,corporate:async()=>(await import("./corporate-IBZKFU7G.js")).corporateDomain,customer:async()=>(await import("./company-ZLB3GW3Q.js")).customerDomain,department:async()=>(await import("./department-RRQME3X5.js")).
|
|
6
6
|
departmentDomain,deposit:async()=>(await import("./deposit-FQZALZNQ.js")).depositDomain,estimate:async()=>(await import("./estimate-M4JV6WS5.js")).estimateDomain,evaluation:async()=>(await import("./evaluation-EBDHIRJK.js")).evaluationDomain,expense:async()=>(await import("./expense-WAVTLXE2.js")).expenseDomain,faq:async()=>(await import("./faq-MDAMZTRV.js")).faqDomain,"fiscal-year":async()=>(await import("./fiscal-year-CEPARJVT.js")).fiscalYearDomain,github:async()=>(await import("./github-2TYYMLBR.js")).
|
|
7
7
|
githubDomain,hearing:async()=>(await import("./hearing-3SGXLLQM.js")).hearingDomain,holiday:async()=>(await import("./holiday-YUEGT6Z6.js")).holidayDomain,"goal-sheet":async()=>(await import("./evaluation-EBDHIRJK.js")).goalSheetDomain,inquiry:async()=>(await import("./inquiry-KFMTURVN.js")).inquiryDomain,invoice:async()=>(await import("./invoice-LXHZCWNU.js")).invoiceDomain,"job-title":async()=>(await import("./job-title-IBG62U34.js")).jobTitleDomain,journal:async()=>(await import("./journal-77ZMS7HY.js")).
|
|
8
|
-
journalDomain,knowledge:async()=>(await import("./domain-knowledge-3SOTZO3P.js")).knowledgeDomain,leave:async()=>(await import("./leave-VJWHCHU2.js")).leaveDomain,license:async()=>(await import("./license-PPPFRM3C.js")).licenseDomain,"login-history":async()=>(await import("./login-history-LGXAE3WR.js")).loginHistoryDomain,media:async()=>(await import("./media-
|
|
8
|
+
journalDomain,knowledge:async()=>(await import("./domain-knowledge-3SOTZO3P.js")).knowledgeDomain,leave:async()=>(await import("./leave-VJWHCHU2.js")).leaveDomain,license:async()=>(await import("./license-PPPFRM3C.js")).licenseDomain,"login-history":async()=>(await import("./login-history-LGXAE3WR.js")).loginHistoryDomain,media:async()=>(await import("./media-KQEOBN4W.js")).mediaDomain,meeting:async()=>(await import("./knowledge-7DORPY6M.js")).meetingDomain,note:async()=>(await import("./note-MJAIN4FR.js")).
|
|
9
9
|
noteDomain,notification:async()=>(await import("./notification-VHCXO6ZU.js")).notificationDomain,ojt:async()=>(await import("./ojt-YAEWQNNW.js")).ojtDomain,onedrive:async()=>(await import("./onedrive-ZALMBXZI.js")).onedriveDomain,outlook:async()=>(await import("./outlook-UNSMQEIS.js")).outlookDomain,payee:async()=>(await import("./sales-master-KOQ5R6B4.js")).payeeDomain,position:async()=>(await import("./position-TJTBJCCH.js")).positionDomain,project:async()=>(await import("./project-DXAUEUJM.js")).
|
|
10
10
|
projectDomain,"process-master":async()=>(await import("./project-masters-VPTVBVCU.js")).processMasterDomain,prospect:async()=>(await import("./prospect-QKNJXSNF.js")).prospectDomain,purchase:async()=>(await import("./purchase-UQ47LTY6.js")).purchaseDomain,qualification:async()=>(await import("./skill-NTR6Z7RK.js")).qualificationDomain,"quality-check-item":async()=>(await import("./project-masters-VPTVBVCU.js")).qualityCheckItemDomain,receivable:async()=>(await import("./receivable-JGOZSG6S.js")).
|
|
11
11
|
receivableDomain,redmine:async()=>(await import("./redmine-NBOXFHWT.js")).redmineDomain,report:async()=>(await import("./report-7XTYWYZH.js")).reportDomain,"role-template":async()=>(await import("./evaluation-EBDHIRJK.js")).roleTemplateDomain,"rounding-setting":async()=>(await import("./sales-numbering-56OXR5LB.js")).roundingSettingDomain,"seal-impression":async()=>(await import("./sales-master-KOQ5R6B4.js")).sealImpressionDomain,search:async()=>(await import("./search-PCAGDA2H.js")).searchDomain,
|
package/dist/cli.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __twpCreateRequire } from 'node:module';
|
|
3
3
|
const require = __twpCreateRequire(import.meta.url);
|
|
4
|
-
import{GLOBAL_OPTIONS_HELP}from"./chunk-TZL2342W.js";import{parseArgv,quietFromEnv}from"./chunk-F2N776L5.js";import"./chunk-2LOT54OO.js";import"./chunk-NJL3H2BB.js";import"./chunk-PLPEDJLC.js";import"./chunk-AH4KHEAC.js";import{formatUnknownArgs}from"./chunk-OKATZ4SN.js";import"./chunk-VSJBJXZO.js";var VERSION=true?"0.
|
|
4
|
+
import{GLOBAL_OPTIONS_HELP}from"./chunk-TZL2342W.js";import{parseArgv,quietFromEnv}from"./chunk-F2N776L5.js";import"./chunk-2LOT54OO.js";import"./chunk-NJL3H2BB.js";import"./chunk-PLPEDJLC.js";import"./chunk-AH4KHEAC.js";import{formatUnknownArgs}from"./chunk-OKATZ4SN.js";import"./chunk-VSJBJXZO.js";var VERSION=true?"0.147.0":"0.0.0-dev";var HELP=`twp ${VERSION} \u2014 TWP CLI
|
|
5
5
|
|
|
6
6
|
\u4F7F\u3044\u65B9:
|
|
7
7
|
twp \u5BFE\u8A71 TUI \u3092\u8D77\u52D5
|
|
@@ -705,6 +705,8 @@ import{GLOBAL_OPTIONS_HELP}from"./chunk-TZL2342W.js";import{parseArgv,quietFromE
|
|
|
705
705
|
Backlog \u8AB2\u984C\u306E\u6DFB\u4ED8\u30D5\u30A1\u30A4\u30EB\u3092\u4E00\u89A7\u3059\u308B\uFF08id / name / size\uFF09
|
|
706
706
|
twp backlog attachment download <\u8AB2\u984C\u30AD\u30FC> <\u6DFB\u4ED8ID> --out <\u30D1\u30B9>
|
|
707
707
|
Backlog \u8AB2\u984C\u306E\u6DFB\u4ED8\u30D5\u30A1\u30A4\u30EB\u3092 --out \u3078\u66F8\u304D\u51FA\u3059
|
|
708
|
+
twp backlog attachment upload <\u30D5\u30A1\u30A4\u30EB\u30D1\u30B9>
|
|
709
|
+
Backlog \u30B9\u30DA\u30FC\u30B9\u3078\u30D5\u30A1\u30A4\u30EB\u3092\u4E0A\u3052\u3066\u6DFB\u4ED8ID \u3092\u5F97\u308B\uFF08\u5916\u90E8\u3078\u51FA\u308B\u30FB--yes \u304C\u8981\u308B\uFF09
|
|
708
710
|
twp backlog status list Backlog \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u306E\u30B9\u30C6\u30FC\u30BF\u30B9\u3092\u4E00\u89A7\u3059\u308B\uFF08--project \u304C\u8981\u308B\uFF09
|
|
709
711
|
twp backlog user list Backlog \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u306E\u30E1\u30F3\u30D0\u30FC\u3092\u4E00\u89A7\u3059\u308B\uFF08--project \u304C\u8981\u308B\uFF09
|
|
710
712
|
twp backlog user myself Backlog \u306E\u81EA\u5206\uFF08\u9023\u643A\u306B\u767B\u9332\u3057\u305F API \u30AD\u30FC\u306E\u6301\u3061\u4E3B\uFF09\u3092\u8868\u793A\u3059\u308B
|
|
@@ -1959,17 +1961,17 @@ TUI \u5185:
|
|
|
1959
1961
|
\u4F1A\u8A71\u30FB\u30ED\u30FC\u30AB\u30EB\u30C4\u30FC\u30EB\uFF08\u30D5\u30A1\u30A4\u30EB\u30FB\u30B3\u30DE\u30F3\u30C9\u30FBgit\uFF09\u306F\u30C6\u30CA\u30F3\u30C8\u306E\u30AF\u30EC\u30B8\u30C3\u30C8\u3067\u5B9F\u969B\u306B\u52D5\u304D\u307E\u3059\u3002
|
|
1960
1962
|
`;function ignoreEpipe(stream){stream.on("error",err=>{if(err.code==="EPIPE")process.exit(0);throw err})}async function main(){const nodeMajor=Number(process.versions.node.split(".")[0]);if(nodeMajor<22){process.stderr.write(`twp-cli \u306B\u306F Node.js 22 \u4EE5\u4E0A\u304C\u5FC5\u8981\u3067\u3059\uFF08\u73FE\u5728: ${process.versions.node}\uFF09
|
|
1961
1963
|
`);process.exit(1)}ignoreEpipe(process.stdout);ignoreEpipe(process.stderr);if(process.env["TWP_AUTO_UPDATE_WORKER"]==="1"){const{runAutoUpdateWorker}=await import("./auto-update-worker-CB52KUTF.js");await runAutoUpdateWorker().catch(()=>void 0);return}const[first,...rest]=process.argv.slice(2);if(first==="__complete"||first==="completion"){const completion=await import("./completion-DPS67SWH.js");if(first==="completion"){process.exitCode=completion.runCompletion(rest,process.stdout,process.stderr);return}
|
|
1962
|
-
const[{loadDomain},{loadUserConfig}]=await Promise.all([import("./registry-
|
|
1963
|
-
exitCode=await runLocalLoopCommand(rest);return}if(first==="github"&&(rest[0]==="git-credential"||rest[0]==="git-remote")){const autoUpdate2=await import("./auto-update-FXXQHBV5.js");autoUpdate2.registerRunning();const{runGithubGit}=await import("./github-git-
|
|
1964
|
+
const[{loadDomain},{loadUserConfig}]=await Promise.all([import("./registry-5ZTZX4C2.js"),import("./config-XYWRBIC6.js")]);process.exitCode=await completion.runComplete(rest,process.stdout,{loadDomain,profileNames:()=>Object.keys(loadUserConfig().profiles??{})});return}if(first==="local-loop"){process.env["TWP_NO_AUTO_UPDATE"]="1";const autoUpdate2=await import("./auto-update-FXXQHBV5.js");autoUpdate2.registerRunning();const{runLocalLoopCommand}=await import("./commands-MQ6YVTSY.js");process.
|
|
1965
|
+
exitCode=await runLocalLoopCommand(rest);return}if(first==="github"&&(rest[0]==="git-credential"||rest[0]==="git-remote")){const autoUpdate2=await import("./auto-update-FXXQHBV5.js");autoUpdate2.registerRunning();const{runGithubGit}=await import("./github-git-IIYT3I7N.js");process.exitCode=await runGithubGit(rest[0],rest.slice(1),{version:VERSION});return}if(first==="configure"){const autoUpdate2=await import("./auto-update-FXXQHBV5.js");autoUpdate2.registerRunning();autoUpdate2.onStartup(VERSION);
|
|
1964
1966
|
const{runConfigure}=await import("./configure-BJGPASNG.js");process.exitCode=await runConfigure(rest);return}const args=parseArgv(process.argv.slice(2));if(args.command==="version"){process.stdout.write(`${VERSION}
|
|
1965
1967
|
`);return}if(args.command==="help"){process.stdout.write(HELP);return}if(args.movedCommand!==void 0){const{MOVED_QUEUE_COMMAND_MESSAGE}=await import("./dispatch-ZWCEVLKZ.js");process.stderr.write(MOVED_QUEUE_COMMAND_MESSAGE);process.exitCode=2;return}if(args.unknown.length>0){process.stderr.write(`\u4E0D\u660E\u306A\u5F15\u6570: ${formatUnknownArgs(args.unknown)}
|
|
1966
1968
|
|
|
1967
|
-
${HELP}`);process.exitCode=2;return}const autoUpdate=await import("./auto-update-FXXQHBV5.js");autoUpdate.registerRunning();if(args.command==="task-loop"&&args.taskLoopAction!=="capacity"){process.env[autoUpdate.DISABLE_ENV]="1"}else if(args.command!=="update"){autoUpdate.onStartup(VERSION)}if(args.command==="domain"&&args.domain!==void 0){const{runDomain}=await import("./run-
|
|
1968
|
-
{},argv:args.domainArgv,help:args.domainHelp,globals:{...args.profile!==void 0?{profile:args.profile}:{},...args.output!==void 0?{output:args.output}:{},...args.query!==void 0?{query:args.query}:{},dryRun:args.dryRun,debug:args.debug,yes:args.yes,refresh:args.refresh,quiet:args.quiet||quietFromEnv(process.env)},version:VERSION});return}if(args.command==="api"){const{runApiCommand}=await import("./api-command-
|
|
1969
|
+
${HELP}`);process.exitCode=2;return}const autoUpdate=await import("./auto-update-FXXQHBV5.js");autoUpdate.registerRunning();if(args.command==="task-loop"&&args.taskLoopAction!=="capacity"){process.env[autoUpdate.DISABLE_ENV]="1"}else if(args.command!=="update"){autoUpdate.onStartup(VERSION)}if(args.command==="domain"&&args.domain!==void 0){const{runDomain}=await import("./run-OPK5OPAR.js");process.exitCode=await runDomain({domain:args.domain,...args.operation!==void 0?{operation:args.operation}:
|
|
1970
|
+
{},argv:args.domainArgv,help:args.domainHelp,globals:{...args.profile!==void 0?{profile:args.profile}:{},...args.output!==void 0?{output:args.output}:{},...args.query!==void 0?{query:args.query}:{},dryRun:args.dryRun,debug:args.debug,yes:args.yes,refresh:args.refresh,quiet:args.quiet||quietFromEnv(process.env)},version:VERSION});return}if(args.command==="api"){const{runApiCommand}=await import("./api-command-OTG5TUSN.js");process.exitCode=await runApiCommand({argv:args.domainArgv,help:args.domainHelp,
|
|
1969
1971
|
globals:{...args.profile!==void 0?{profile:args.profile}:{},...args.output!==void 0?{output:args.output}:{},...args.query!==void 0?{query:args.query}:{},dryRun:args.dryRun,debug:args.debug,yes:args.yes,quiet:args.quiet||quietFromEnv(process.env)},version:VERSION});return}if(args.command==="update"){const{runUpdate}=await import("./update-MQPXAW2C.js");process.exitCode=await runUpdate({...args.profile!==void 0?{profile:args.profile}:{},version:VERSION});return}if(args.command==="login"||args.
|
|
1970
1972
|
command==="logout"||args.command==="whoami"){const{runLogin,runLogout,runWhoami}=await import("./commands-QLPSSZPM.js");const options={profile:args.profile,method:args.loginMethod,tenant:args.tenant,noBrowser:args.loginNoBrowser,cliVersion:VERSION,force:args.logoutForce,...args.output!==void 0?{output:args.output}:{},...args.query!==void 0?{query:args.query}:{}};const runner=args.command==="login"?runLogin:args.command==="logout"?runLogout:runWhoami;process.exitCode=await runner(options);return}
|
|
1971
1973
|
if(args.command==="task-loop"){const{runTaskLoop}=await import("./commands-U2QP6MGC.js");process.exitCode=await runTaskLoop({action:args.taskLoopAction??"run",project:args.project,profile:args.profile,safe:args.safe,daemon:args.daemon,interval:args.interval,maxCycles:args.maxCycles,forceRunner:args.forceRunner,force:args.stopForce,drain:args.stopDrain,engine:args.engine,version:VERSION,verbose:args.verbose,scheduleNow:args.scheduleNow,scheduleCounts:args.scheduleCounts,scheduleGate:args.scheduleGate,
|
|
1972
1974
|
scheduleOp:args.scheduleOp,scheduleConfigOp:args.scheduleConfigOp,scheduleId:args.scheduleId,charterOp:args.charterOp,charterInput:args.charterFile,charterOutput:args.charterOut,charterRevision:args.charterRevision,settingsOp:args.settingsOp,orientationOp:args.orientationOp,orientationArgs:args.orientationArgs,skillOp:args.skillOp,skillName:args.skillName,skillAll:args.skillAll,skillDir:args.skillDir,skillConfig:args.skillConfig,output:args.output,query:args.query,revisionFrom:args.revisionFrom,
|
|
1973
1975
|
revisionTo:args.revisionTo,planOp:args.planOp,capacityOp:args.capacityOp,includeStopped:args.includeStopped,runnerOp:args.runnerOp,runnerId:args.runnerTargetId,triggerOp:args.triggerOp,triggerId:args.triggerId,triggerKey:args.triggerKey,triggerLimit:args.triggerLimit,planEmpty:args.planEmpty,planCheck:args.planCheck,yes:args.yes,ais:args.ais,workspace:args.workspace,aiConfigFile:args.aiConfigFile,noAiConfigFile:args.noAiConfigFile});return}if(args.command==="print"){const{runOneShot}=await import("./oneshot-GYUQC244.js");
|
|
1974
|
-
process.exitCode=await runOneShot({prompt:args.prompt??"",fromStdin:args.promptFromStdin,mode:args.mode??"dev",...args.permissionMode!==void 0?{permissionMode:args.permissionMode}:{},allowedTools:args.allowedTools,disallowedTools:args.disallowedTools,...args.model!==void 0?{model:args.model}:{},...args.profile!==void 0?{profile:args.profile}:{},version:VERSION});return}const{startTui}=await import("./app-
|
|
1976
|
+
process.exitCode=await runOneShot({prompt:args.prompt??"",fromStdin:args.promptFromStdin,mode:args.mode??"dev",...args.permissionMode!==void 0?{permissionMode:args.permissionMode}:{},allowedTools:args.allowedTools,disallowedTools:args.disallowedTools,...args.model!==void 0?{model:args.model}:{},...args.profile!==void 0?{profile:args.profile}:{},version:VERSION});return}const{startTui}=await import("./app-GDI4V2G7.js");await startTui({mode:args.mode,permissionMode:args.permissionMode,allowedTools:args.
|
|
1975
1977
|
allowedTools,disallowedTools:args.disallowedTools,model:args.model,profile:args.profile,noTui:args.noTui||!process.stdout.isTTY,doctor:args.doctor,version:VERSION})}await main();
|
|
@@ -304,7 +304,7 @@ flags}}function numberFlag(p,name){const v=p.flags.get(name);if(v===void 0)retur
|
|
|
304
304
|
\u3066\u304F\u3060\u3055\u3044"}return n}async function buildPublicOptions(p,env){const str=n=>{const v=p.flags.get(n);return typeof v==="string"?v:void 0};const publicUrl=str("--public-url");if(publicUrl===void 0)return"\u516C\u958B\u30E2\u30FC\u30C9\u306B\u306F --public-url\uFF08\u5916\u304B\u3089\u958B\u304F https:// \u306E URL\uFF09\u304C\u5FC5\u8981\u3067\u3059";const certPath=str("--tls-cert");const keyPath=str("--tls-key");if(certPath===void 0!==(keyPath===void 0))return"--tls-cert \u3068 --tl\
|
|
305
305
|
s-key \u306F\u4E21\u65B9\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044";let tls;if(certPath!==void 0&&keyPath!==void 0){try{tls={cert:fs5.readFileSync(certPath,"utf8"),key:fs5.readFileSync(keyPath,"utf8")}}catch(e){return`\u8A3C\u660E\u66F8\u30FB\u9375\u3092\u8AAD\u3081\u307E\u305B\u3093\uFF08${e.message}\uFF09`}}const reauthRaw=str("--reauth-minutes");const reauth=reauthRaw===void 0?null:Number(reauthRaw);if(reauth!==null&&(!/^\d+$/.test(reauthRaw??"")||reauth<1||reauth>720))return"--reauth-m\
|
|
306
306
|
inutes \u306F 1\u301C720 \u306E\u6574\u6570\u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044";const allow=str("--allow-ip");const profile=str("--profile");const bind=str("--bind");const allowIps=allow!==void 0?allow.split(",").map(x=>x.trim()).filter(x=>x!==""):void 0;if(allowIps!==void 0&&allowIps.length===0)return"--allow-ip \u306B IP \u30A2\u30C9\u30EC\u30B9\u304C1\u3064\u3082\u3042\u308A\u307E\u305B\u3093";const opts={publicUrl,...tls?{tls}:{},behindTlsProxy:p.flags.get("--behind-tls-pr\
|
|
307
|
-
oxy")===true,trustedProxy:p.flags.get("--trusted-proxy")===true,...allowIps!==void 0?{allowIps}:{},...bind!==void 0?{bindHost:bind}:{},...profile!==void 0?{profile}:{},...reauth!==null?{reauthWindowMs:reauth*6e4}:{},env,cliVersion:true?"0.
|
|
307
|
+
oxy")===true,trustedProxy:p.flags.get("--trusted-proxy")===true,...allowIps!==void 0?{allowIps}:{},...bind!==void 0?{bindHost:bind}:{},...profile!==void 0?{profile}:{},...reauth!==null?{reauthWindowMs:reauth*6e4}:{},env,cliVersion:true?"0.147.0":"0.0.0-dev"};const{validatePublicOptions}=await import("./console-public-S6QW3QAA.js");return validatePublicOptions(opts)??opts}function waitForSignal(){return new Promise(resolve=>{const done=()=>{process.removeListener("SIGINT",done);process.removeListener(
|
|
308
308
|
"SIGTERM",done);resolve()};process.once("SIGINT",done);process.once("SIGTERM",done)})}function lockDirOf(dir){return path5.join(dir,"lock")}function runningPid2(dir,isLoop){let pid;try{pid=Number.parseInt(fs5.readFileSync(path5.join(lockDirOf(dir),"pid"),"utf8").trim(),10)}catch{return null}if(!Number.isInteger(pid)||pid<=0)return null;return isLoop(pid)?pid:null}function protectedDeny(twpHome,cwd,home=os.homedir(),claudeConfigDir){const readWrite=[absPathRule(twpHome),absPathRule(path5.join(home,
|
|
309
309
|
".ssh")),absPathRule(path5.join(home,".claude")),absPathRule(path5.join(home,".claude.json"),""),...claudeConfigDir!==void 0&&claudeConfigDir.trim()!==""?[absPathRule(claudeConfigDir)]:[]];const writeOnly=[...cwd!==void 0?[absPathRule(path5.join(cwd,".claude")),absPathRule(path5.join(cwd,".git")),absPathRule(path5.join(cwd,".git"),""),absPathRule(path5.join(cwd,".mcp.json"),"")]:[],...SHELL_RC_FILES.map(f=>absPathRule(path5.join(home,f),""))];return[...readWrite.flatMap(p=>[`Read(${p})`,`Edit(${p}\
|
|
310
310
|
)`]),...writeOnly.map(p=>`Edit(${p})`)]}var SHELL_RC_FILES=[".bashrc",".bash_profile",".bash_login",".bash_logout",".profile",".zshrc",".zprofile",".zshenv",".zlogin",".zlogout"];function unscopedWriteRules(allow){return allow.filter(r=>r==="Edit"||r==="Write"||r==="MultiEdit"||r==="Edit(*)"||r==="Edit(**)")}var STRIPPED_ENV_KEYS=["TWP_TOKEN","TWP_API_KEY","TWP_API_KEY_VALUE","TWP_LOOP_PLAN_TOKEN"];function aiEnv(env){const out={...env};for(const k of STRIPPED_ENV_KEYS)delete out[k];return out}async function defaultEngine(config,log,env){
|
|
@@ -37,4 +37,4 @@ REMOTE_USAGE)}const account=args.account!==void 0?await resolver.githubAccount(a
|
|
|
37
37
|
`);if(deps.hint??process.stderr.isTTY===true){const origin=new URL(ctx.apiUrl).origin;err(`\u8A8D\u8A3C\u306F credential helper \u3067\u6E21\u3057\u307E\u3059\uFF08\u672A\u8A2D\u5B9A\u306A\u30891\u56DE\u3060\u3051\u30021\u884C\u76EE\u306F\u65E2\u5B58\u306E\u6C4E\u7528 helper \u3092\u5916\u3059\uFF09:
|
|
38
38
|
git config --global credential.${origin}.helper ''
|
|
39
39
|
git config --global --add credential.${origin}.helper '!twp github git-credential${args.profile!==void 0?` --profile ${args.profile}`:""}'
|
|
40
|
-
`)}return EXIT_OK}async function runGithubGit(sub,argv,deps={}){try{return sub==="git-remote"?await runRemote(argv,deps):await runCredential(argv,deps)}catch(e){const{exitCodeFor,reportError}=await import("./run-
|
|
40
|
+
`)}return EXIT_OK}async function runGithubGit(sub,argv,deps={}){try{return sub==="git-remote"?await runRemote(argv,deps):await runCredential(argv,deps)}catch(e){const{exitCodeFor,reportError}=await import("./run-OPK5OPAR.js");const code=exitCodeFor(e);reportError(e,null,code,deps.err??writeStderr);return code}}export{GIT_TOKEN_MARGIN_MS,GIT_USERNAME,isRelayTarget,parseCredentialInput,runGithubGit};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire as __twpCreateRequire } from 'node:module';
|
|
2
2
|
const require = __twpCreateRequire(import.meta.url);
|
|
3
|
-
import{checkOutTarget}from"./chunk-
|
|
3
|
+
import{checkOutTarget}from"./chunk-52GXWKG7.js";import"./chunk-TFNUT7CA.js";import"./chunk-P4QSPSOQ.js";import"./chunk-PAJAEUPA.js";import"./chunk-Q3B65OFC.js";import{contentTypeFor,inspectLocalFile}from"./chunk-YALMEDJ4.js";import{checkUploadQuota}from"./chunk-GNSZOYBQ.js";import{parseWaitOptions,waitUntilTerminal}from"./chunk-3EFJQDC4.js";import"./chunk-RMFLTSOV.js";import{readBody}from"./chunk-V5WDGX4S.js";import"./chunk-W4NLJ2YK.js";
|
|
4
4
|
import"./chunk-BD7O73GK.js";import{repeatedValues}from"./chunk-6NHLWYI2.js";import"./chunk-KG634EFO.js";import{ApiError}from"./chunk-NUEKGK4J.js";import"./chunk-CJFIIGSH.js";import{collapsesInUrlPath,isSafePathSegment}from"./chunk-HVZUXLQ4.js";import"./chunk-YJP4FUY4.js";import"./chunk-SBRTBKEZ.js";import{LIST_FLAGS,LIST_PAGING_HELP,envelopePaging,nonEmpty,positiveInteger,readEnvelopeCursor,shellQuote}from"./chunk-PMTQFMJS.js";import{requireResolved,
|
|
5
5
|
singleRef,withResolved}from"./chunk-7DCWZ2NF.js";import{acknowledgement,isRecord,pick}from"./chunk-HCTPCUST.js";import{ApiRejectedError,ApiResponseError,NetworkError,UsageError,WaitTimeoutError}from"./chunk-STILP3Z6.js";import"./chunk-TZL2342W.js";import"./chunk-ITFO5GPX.js";import"./chunk-GWVREACM.js";import"./chunk-J7QYPKVK.js";import"./chunk-EDF4U5BT.js";import"./chunk-RZVI6PMW.js";import"./chunk-PLPEDJLC.js";import"./chunk-OKATZ4SN.js";
|
|
6
6
|
import"./chunk-RKBUJKI5.js";import"./chunk-UREA4ZIG.js";import"./chunk-NHYMHCAT.js";import"./chunk-VSJBJXZO.js";import crypto2 from"crypto";import fs2 from"fs";import path from"path";var SCOPE_PERSONAL="personal";var SCOPE_PROJECT="project";var UUID=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;var FORBIDDEN_NAME=/[/\\:*?"<>|]/;var NAME_MAX=255;var ROW_COLUMNS=["id","path","name","file_count","subfolder_count","parent_id","updated_at"];var TRASH_COLUMNS=["id","path","name","file_count","subfolder_count","parent_id","deleted_at"];function folderRows(raw){return raw.map(row=>{const id=row["id"];const name=row["name"];const parentId=row["parent_id"];if(typeof id!==
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { createRequire as __twpCreateRequire } from 'node:module';
|
|
2
2
|
const require = __twpCreateRequire(import.meta.url);
|
|
3
|
-
import{loadDomain}from"./chunk-
|
|
3
|
+
import{loadDomain}from"./chunk-TFNUT7CA.js";import"./chunk-VSJBJXZO.js";export{loadDomain};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire as __twpCreateRequire } from 'node:module';
|
|
2
2
|
const require = __twpCreateRequire(import.meta.url);
|
|
3
|
-
import{CURATED_PAGING_VOCABULARY,buildPrepareContext,checkOutTarget,exitCodeFor,fetchAllPages,outputValue,reportError,requiresYes,resolvePaging,runDomain}from"./chunk-
|
|
3
|
+
import{CURATED_PAGING_VOCABULARY,buildPrepareContext,checkOutTarget,exitCodeFor,fetchAllPages,outputValue,reportError,requiresYes,resolvePaging,runDomain}from"./chunk-52GXWKG7.js";import"./chunk-TFNUT7CA.js";import"./chunk-P4QSPSOQ.js";import"./chunk-PAJAEUPA.js";import"./chunk-Q3B65OFC.js";import"./chunk-W4NLJ2YK.js";import"./chunk-BD7O73GK.js";import"./chunk-6NHLWYI2.js";import"./chunk-KG634EFO.js";import"./chunk-NUEKGK4J.js";import"./chunk-CJFIIGSH.js";
|
|
4
4
|
import"./chunk-HVZUXLQ4.js";import"./chunk-YJP4FUY4.js";import"./chunk-SBRTBKEZ.js";import"./chunk-PMTQFMJS.js";import"./chunk-HCTPCUST.js";import"./chunk-STILP3Z6.js";import"./chunk-TZL2342W.js";import"./chunk-ITFO5GPX.js";import"./chunk-GWVREACM.js";import"./chunk-J7QYPKVK.js";import"./chunk-EDF4U5BT.js";import"./chunk-RZVI6PMW.js";import"./chunk-PLPEDJLC.js";import"./chunk-OKATZ4SN.js";import"./chunk-RKBUJKI5.js";
|
|
5
5
|
import"./chunk-UREA4ZIG.js";import"./chunk-NHYMHCAT.js";import"./chunk-VSJBJXZO.js";export{CURATED_PAGING_VOCABULARY,buildPrepareContext,checkOutTarget,exitCodeFor,fetchAllPages,outputValue,reportError,requiresYes,resolvePaging,runDomain};
|