@tocca-systems/twp-cli 0.38.0 → 0.39.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/CHANGELOG.public.md +10 -0
  2. package/README.md +118 -3
  3. package/dist/{ai-dispatch-AHCYPQ5Y.js → ai-dispatch-KRMDHQEF.js} +1 -1
  4. package/dist/{api-command-BZVUZIOB.js → api-command-IO572BZ4.js} +3 -3
  5. package/dist/{app-SNRFIHTQ.js → app-Y2RIXLS4.js} +4 -4
  6. package/dist/{backlog-33ELMSV6.js → backlog-67JSQYOH.js} +1 -1
  7. package/dist/chunk-4ZT5LTRX.js +94 -0
  8. package/dist/{chunk-QBA6THJ5.js → chunk-BJLXXRSY.js} +1 -1
  9. package/dist/{chunk-LS7P3IWP.js → chunk-C7UDUHQZ.js} +7 -7
  10. package/dist/{chunk-ZST7XESB.js → chunk-ELXDRPDV.js} +39 -33
  11. package/dist/{chunk-TAN5I2DP.js → chunk-I4ARX6NM.js} +1 -1
  12. package/dist/{chunk-IRT7VFG4.js → chunk-MHRGKUMK.js} +1 -1
  13. package/dist/chunk-QDTYD5PY.js +147 -0
  14. package/dist/{chunk-57HDZYSN.js → chunk-QQLWMHGR.js} +1 -1
  15. package/dist/{chunk-ADQD5OPN.js → chunk-RZ54TCQU.js} +15 -14
  16. package/dist/chunk-TLN3JSEC.js +7 -0
  17. package/dist/chunk-UVUVEL3B.js +3 -0
  18. package/dist/{chunk-OHIERIBW.js → chunk-Y5YDL3MC.js} +1 -1
  19. package/dist/cli.js +109 -9
  20. package/dist/{commands-RCDYCU6L.js → commands-MLYGGSUE.js} +3 -3
  21. package/dist/company-3KUWW7QA.js +71 -0
  22. package/dist/{completion-3X7HPIPM.js → completion-6R5D5TQQ.js} +1 -1
  23. package/dist/contract-FGRHTOGI.js +86 -0
  24. package/dist/{department-PVUB3ZPI.js → department-PN5DCCRL.js} +1 -1
  25. package/dist/deposit-XQER6PMG.js +4 -0
  26. package/dist/estimate-IXBEQVGI.js +164 -0
  27. package/dist/{inquiry-CUK2LWQK.js → inquiry-3VOJASJH.js} +1 -1
  28. package/dist/invoice-KY3BYTHQ.js +209 -0
  29. package/dist/{job-title-CZRZFVUU.js → job-title-EM6RKGQ6.js} +1 -1
  30. package/dist/{knowledge-XYLG42MB.js → knowledge-F4FZ4MLH.js} +1 -1
  31. package/dist/{leave-DL3JPO5I.js → leave-D2S7NMJC.js} +1 -1
  32. package/dist/{media-CMNIZUPY.js → media-SQVQVX2E.js} +1 -1
  33. package/dist/{notification-ULATH7AC.js → notification-NTFUPUMY.js} +1 -1
  34. package/dist/{oneshot-RYWJ6ECA.js → oneshot-TMGTEN3S.js} +1 -1
  35. package/dist/{position-ICOGEMRG.js → position-D52LXRDT.js} +1 -1
  36. package/dist/{prospect-MB2OP7L2.js → prospect-AQ7EUU4N.js} +1 -1
  37. package/dist/receivable-AE44YIJO.js +49 -0
  38. package/dist/{registry-XBYUPKQQ.js → registry-3WV46K26.js} +1 -1
  39. package/dist/{report-JL7UJB4G.js → report-TI2DOJGX.js} +1 -1
  40. package/dist/{run-6JRHCC67.js → run-KNZ43HFF.js} +2 -2
  41. package/dist/{task-CMCHUX2D.js → task-VKVZSF7J.js} +2 -2
  42. package/dist/{user-5JXFO56G.js → user-KEFI7XZI.js} +1 -1
  43. package/dist/{workflow-XBUMFS2G.js → workflow-4FHTOQZZ.js} +1 -1
  44. package/package.json +1 -1
  45. package/dist/chunk-GLBQAXWC.js +0 -6
  46. package/dist/chunk-O4NSYHR4.js +0 -3
  47. package/dist/company-GMCHRVHF.js +0 -161
  48. package/dist/sales-GJKW7VVG.js +0 -4
  49. /package/dist/{commands-7PGS2PTH.js → commands-K6DQ3O35.js} +0 -0
@@ -11,6 +11,16 @@
11
11
  `CHANGELOG.md` に残してあります。顧客向けの履歴は public 公開以降を対象とします。
12
12
  -->
13
13
 
14
+ ## 0.39.0
15
+
16
+ 見積を CLI から作成・更新・削除できるようになりました(`twp estimate create` / `update` / `delete`)。社内共有メモ・請求の紐づけ・関連入金・部署按分・案件書類(注文書・個別契約書など)の登録と差替え・ダウンロード、注文書からの注文書番号の読み取りにも対応しました。
17
+
18
+ 請求を CLI から作成・更新・削除できるようになりました(`twp invoice create` / `update` / `delete`)。取消(無効)とその解除、統合請求書の作成、社内共有メモ、CSV と MF 会計仕訳の書き出し、請求書メールの送信、支払いリンクの作成にも対応しました。
19
+
20
+ 取引契約を CLI から一覧・作成・更新・削除できるようになりました(`twp contract`)。自動請求テンプレートの管理と発行履歴の参照にも対応しました(`twp invoice auto-template`)。有効なテンプレートを作成・更新するときは、次に請求が発行される日を事前に表示します。
21
+
22
+ 入金と売掛金を CLI から扱えるようになりました。入金の登録・更新・削除・CSV 出力、請求への引当(CSV での一括を含む)と手数料分の引き上げ、入金予定からの入金と引当のまとめ登録(`twp deposit`)、売掛金残高の表示と CSV 出力、月次の締めと締めの解除(`twp receivable`)に対応しました。
23
+
14
24
  ## 0.38.0
15
25
 
16
26
  wiki・ノート・議事録を CLI から読めるようになりました(`twp wiki` / `twp note` / `twp meeting`)。`get --output text` で本文を文書として読めます。
package/README.md CHANGED
@@ -24,7 +24,7 @@ TWP(Tocca Working Platform)を、ターミナルから使うための CLI
24
24
  | **できる** | `twp department` / `twp position` / `twp job-title` による組織マスタ(部署・役職・職位)の一覧・取得・作成・更新・削除と、部署ツリー・部署の所属者の表示。作成・更新・削除は管理者の権限が要ります |
25
25
  | **できる** | `twp inquiry category` による問い合わせカテゴリの一覧・取得・作成・更新(通知先の設定・末尾への並べ替えを含む)。取得・作成・更新は問い合わせ機能の管理者の権限が要ります |
26
26
  | **できる** | `twp notification` による自分宛ての通知の一覧(未読・カテゴリ・語で絞り込み)・詳細・未読件数・カテゴリ一覧と、1件ずつ・まとめての既読化 |
27
- | **できる** | `twp estimate` / `twp invoice` による販売管理の見積・請求の一覧(語・ステータス・取引先・プロジェクト・担当者・日付・回収状況で絞り込み)と詳細、`twp company` / `twp customer` による取引先企業・顧客の一覧と詳細(名前でも指定できます)、`twp customer` による顧客の登録・更新・削除(担当者・対応履歴ごと。ID を並べたファイルでの一括削除を含む)と担当者・対応履歴の一覧・詳細・登録・更新・削除、全顧客の最近の対応、名刺画像の登録・裏面メモ・削除、企業をまたいだ人物の一覧・詳細・CSV 書き出し、登録前の類似企業検索、`twp company` による取引先企業(仕入先を含む)の登録・更新・削除、`twp prospect` によるアプローチ先(見込客)の一覧・登録・更新・削除・CSV での一括登録と書き出し・重複確認・顧客への昇格と対応履歴の記録。販売管理・顧客管理の権限が要ります |
27
+ | **できる** | `twp estimate` / `twp invoice` による販売管理の見積・請求の一覧(語・ステータス・取引先・プロジェクト・担当者・日付・回収状況で絞り込み)と詳細、`twp estimate` による見積の作成・更新・削除・社内共有メモ・既存の請求の紐づけ・関連入金・部署按分・案件書類(注文書・個別契約書など)の登録・版の差替え・ダウンロードと、注文書からの注文書番号の読み取り、`twp invoice` による請求の作成・更新・削除・取消と取消解除・統合請求書の作成・社内共有メモ・CSV/MF 会計仕訳の書き出し・請求書メールの送信・支払いリンクの作成、`twp contract` による取引契約(見積から作る販売管理の契約)の一覧・詳細・作成・更新・削除、`twp invoice auto-template` による自動請求テンプレートの一覧・詳細・作成・更新・削除と発行履歴の参照(販売管理の管理者)、`twp deposit` による入金の一覧・詳細・登録・更新・削除・CSV 書き出し、請求への引当(CSV での一括を含む)・解除・手数料分の引き上げ、入金予定からの入金と引当のまとめ登録、`twp receivable` による売掛金残高の表示と CSV 書き出し・月次の締めと締めの解除(どちらも販売管理の管理者)、`twp company` / `twp customer` による取引先企業・顧客の一覧と詳細(名前でも指定できます)、`twp customer` による顧客の登録・更新・削除(担当者・対応履歴ごと。ID を並べたファイルでの一括削除を含む)と担当者・対応履歴の一覧・詳細・登録・更新・削除、全顧客の最近の対応、名刺画像の登録・裏面メモ・削除、企業をまたいだ人物の一覧・詳細・CSV 書き出し、登録前の類似企業検索、`twp company` による取引先企業(仕入先を含む)の登録・更新・削除、`twp prospect` によるアプローチ先(見込客)の一覧・登録・更新・削除・CSV での一括登録と書き出し・重複確認・顧客への昇格と対応履歴の記録。販売管理・顧客管理の権限が要ります |
28
28
  | **できる** | `twp media` によるメディアライブラリのファイルのアップロード・一覧・ダウンロード・削除(ゴミ箱へ移す)・一括操作(公開・非公開・アーカイブ・移動・削除・復元・ZIP ダウンロード)、`twp storage get` によるストレージ使用量の確認(管理者) |
29
29
  | **できる** | `twp attendance` による自分の勤怠の参照(いまの打刻状態・打刻の履歴・月の勤怠表)と打刻、管理者向けの残業サマリ(36協定を含む)・締め状況の参照 |
30
30
  | **できる** | `twp leave` による有給の残日数・取得履歴・付与履歴の参照と有給の申請(`twp leave request`)、`twp workchange list` / `twp shift list` による月の勤務変更・シフトの参照(`--me` で自分の分・無ければ全員分=勤怠の管理者) |
@@ -367,9 +367,124 @@ twp customer get <顧客>
367
367
  - `get <見積ID>` / `get <請求ID>` は一覧の `id` 列の数字です。見積番号・請求番号で探すなら `list --keyword <番号>` を使ってください
368
368
  - 請求の一覧は画面と同じく、統合請求書を本体1行で出し、統合元の請求はその `children` に入ります
369
369
  - 一覧は **ページ番号で辿ります**(`--cursor` はページ番号・`--limit` は1ページの件数でサーバの上限は100)。並びは登録の新しい順(ID の降順)に固定しています。絞り込み全体の件数と合計金額は stderr に出ます
370
- - 画面にあるそれ以外の絞り込み(確度・見積区分・部署など)と、見積・請求の作成・更新・削除はまだありません(顧客・取引先は次の節。`twp api /api/v2/sales/estimates --query-param reliability_list=A` のように到達できます。`twp api` はこの一覧も最後のページまで自動で辿ります。1ページだけなら `--no-paginate`、特定のページだけなら `--query-param page_no=2 --no-paginate` と指定します)
370
+ - 画面にあるそれ以外の絞り込み(確度・見積区分・部署など)はまだありません(見積・請求の書き込みは次の2節、顧客・取引先はその次の節。`twp api /api/v2/sales/estimates --query-param reliability_list=A` のように到達できます。`twp api` はこの一覧も最後のページまで自動で辿ります。1ページだけなら `--no-paginate`、特定のページだけなら `--query-param page_no=2 --no-paginate` と指定します)
371
371
  - ヘルプは `twp estimate help` / `twp invoice help` / `twp company help` / `twp customer help`
372
372
 
373
+ ### 見積を書く
374
+
375
+ ```
376
+ twp estimate create --generate-cli-skeleton --output json > estimate.json
377
+ twp estimate create --content-file estimate.json
378
+ twp estimate update <見積ID> --generate-cli-skeleton --output json > estimate.json
379
+ twp estimate update <見積ID> --content-file estimate.json
380
+ twp estimate delete <見積ID> --yes
381
+ twp estimate memo <見積ID> (--text <本文> | --text-file <パス> | --clear)
382
+ twp estimate link-invoice <見積ID> (--invoice <請求番号> | --invoice-id <請求ID>) --yes
383
+ twp estimate deposits <見積ID>
384
+ twp estimate allocation list <見積ID>
385
+ twp estimate allocation set <見積ID> --split <部署>=<金額> [--split <部署>=<金額>]... --yes
386
+ twp estimate allocation delete <見積ID> --yes
387
+ twp estimate case-document list|get [<書類ID>] --estimate <見積ID>
388
+ twp estimate case-document create --estimate <見積ID> --file <パス> --type order_form|individual_contract|other --name <書類名>
389
+ twp estimate case-document add-version <書類ID> --estimate <見積ID> --file <パス>
390
+ twp estimate case-document update <書類ID> --estimate <見積ID> [--name <書類名>] [--type <種別>]
391
+ twp estimate case-document delete <書類ID> --estimate <見積ID> --yes
392
+ twp estimate case-document download <書類ID> --estimate <見積ID> --out <パス> [--rev <版番号>] [--force]
393
+ twp estimate scan-order-form --file <パス> --yes
394
+ ```
395
+
396
+ - **見積の内容は JSON ファイル(`--content-file`)で渡します。** キーは画面の入力項目と同じ名前(`title` / `estimate_date` / `details` など)で、`--generate-cli-skeleton` がひな形を出し、各キーに渡せる値を stderr に並べます。**サーバに無いキー(打ち間違いを含む。明細・送付先の中も)は、送る前にすべて挙げて止めます**(サーバは知らないキーを黙って捨てるため)。値の誤りはサーバが断り、その理由をそのまま出します
397
+ - `update --generate-cli-skeleton` は今の見積から書き込める項目だけを出します。**変えない項目は消してから送ってください**——`details`(明細)と `recipients`(送付先)は送ると丸ごと置き換わります。`status` を `in_progress` にすると承認申請になります
398
+ - **見積区分を `formal`(正式)にすると、保存したときにサーバが請求を自動で作ります。** 送る前に stderr で知らせます。削除は、契約か人が作った請求が紐づいているとサーバが断ります(自動作成の未確定の請求は見積と一緒に消えます)
399
+ - `memo` は見積一覧のメモ欄(社内共有メモ・5,000 文字まで)だけを書き換えます。見積本体の保存を伴わないので、確定済みの見積にも書けます
400
+ - `link-invoice` は既存の請求の「紐づく見積」を付け替えます。別の見積に紐づいていた請求は、前の見積からの自動反映が外れて戻らないため `--yes` が要ります。請求は `--invoice`(請求番号)か `--invoice-id`(ID)で指定し、送る前に対象の請求と今の紐づけ先を stderr に出します
401
+ - `deposits` は販売管理の「管理者」だけが見られます(金額はこの見積の請求へ引き当てた分だけです)
402
+ - **部署按分(`allocation set`)は全件の置き換えです。** 按分金額の合計は見積金額(税込)と一致させます(一致しなければ送る前に止めます)。割合は画面と同じ式で CLI が計算します。`--dry-run` で置換前と置換後が見られます
403
+ - **案件書類(`case-document`)は見積に紐づく注文書・個別契約書・その他の書類です。** PDF・画像(JPEG/PNG)・Office(Word/Excel)を登録でき、形式の合わないファイルは送る前に止めます。登録・差替え・更新は**顧客管理**の「編集者」以上、削除は「管理者」です(販売管理の権限ではありません)。容量検査・差替え・ダウンロードの扱いは顧客の契約書と同じです
404
+ - **`scan-order-form` はテナントの AI クレジットを消費するので `--yes` が要ります。** 読み取った注文書番号は候補で、見積は変わりません(見積へ入れるなら `update` で `order_no` を送ります)
405
+ - 見積の作成・更新・削除・メモ・紐づけ・按分・注文書の読み取りは販売管理の「メンバー」以上の権限が要ります
406
+ - ヘルプは `twp estimate help` / `twp estimate allocation help` / `twp estimate case-document help`
407
+
408
+ ### 請求を書く・出力する・送る
409
+
410
+ ```
411
+ twp invoice create --generate-cli-skeleton --output json > invoice.json
412
+ twp invoice create --content-file invoice.json
413
+ twp invoice update <請求ID> --generate-cli-skeleton --output json > invoice.json
414
+ twp invoice update <請求ID> --content-file invoice.json
415
+ twp invoice delete <請求ID> --yes
416
+ twp invoice cancel <請求ID> (--reason <理由> | --reason-file <パス>) --yes
417
+ twp invoice uncancel <請求ID> --yes
418
+ twp invoice consolidate --invoices <ID,ID,…> [--title <件名>] --yes
419
+ twp invoice memo <請求ID> (--text <本文> | --text-file <パス> | --clear)
420
+ twp invoice export --out <パス.csv> [--force] [--format csv|mf-journal] [--debit-account <科目>] [--credit-account <科目>] [一覧と同じ絞り込み]
421
+ twp invoice send <請求ID> --to <メール> [--to <メール>]... [--cc <メール>]... [--message <本文>] --yes
422
+ twp invoice payment-link <請求ID> --yes
423
+ ```
424
+
425
+ - **請求の内容は見積と同じく JSON ファイル(`--content-file`)で渡します。** `--generate-cli-skeleton` がひな形と各キーに渡せる値を出し、サーバに無いキーは送る前にすべて挙げて止めます。`estimate_id`(見積から作る)・`invoice_no_rule_id`(採番)・`direct_create`(見積を自動作成)は作成のときだけ指定できます
426
+ - `update` の `details`(明細)と `recipients`(送付先)は送ると丸ごと置き換わります。`status` を `in_progress` にすると承認申請になります
427
+ - **`cancel` は請求を取消(無効)にします。** 発行した事実と内容は残したまま、売掛金・収支のどの集計にも数えられなくなります。理由は必須で、実行者・日時とともに記録されます。`uncancel`(`--yes` が要ります。取消の記録は消えます)で取消前のステータスへ戻せます。どちらも販売管理の「管理者」の権限が要ります。入金が引き当て済み・承認申請中・失注の請求はサーバが断ります
428
+ - **`consolidate` は同じ取引先の請求を1枚の統合請求書にまとめます。** 統合元の請求は消えずに残り、一覧では統合請求書の `children` に移ります。統合を取り消す API は無いので `--yes` が要ります。送る前に統合元の請求と合計を stderr に出します
429
+ - `export` は一覧と同じ絞り込みで CSV を書き出します(既定は画面の「CSV出力」と同じ請求一覧)。`--format mf-journal` は画面の「MF会計仕訳CSV出力」と同じで、絞り込みに当たる請求のうち**保管済だけ**を取引先ごとに合算した仕訳です。並びは一覧と同じ ID の降順です。既存のファイルは上書きしません(上書きするなら `--force`)
430
+ - **`send` は請求書 PDF を添付したメールを実際に送ります。** 取り消せないので `--yes` が要り、送る前に宛先・写し・件名・添付の名前を stderr に出します(`--dry-run` なら出すだけで送りません)。宛先は画面と同じく毎回指定します
431
+ - **`payment-link` は顧客が実際に支払える決済ページ(Stripe)を作り、URL を出します。** 金額は請求の残額です。作り直しても前のリンクは失効しません。`--yes` が要ります。送信・リンク作成の結果を受け取れなかったときは、実行された可能性を stderr に出します
432
+ - `delete` は入金が引き当てられている請求をサーバが断ります。統合請求書を消しても統合元の請求は残ります
433
+ - 取消・取消解除以外は販売管理の「メンバー」以上の権限が要ります。ヘルプは `twp invoice help`
434
+
435
+ ### 取引契約と自動請求
436
+
437
+ ```
438
+ twp contract list [--keyword <語>] [--status <ステータス>]... [--customer <取引先>] [--project <コード|ID>] [--estimate <見積ID>] [--from <日付>] [--to <日付>] [--all] [--limit <件数>]
439
+ twp contract get <契約ID>
440
+ twp contract create --generate-cli-skeleton --estimate <見積ID> --output json > contract.json
441
+ twp contract create --content-file contract.json
442
+ twp contract update <契約ID> (--generate-cli-skeleton | --content-file <パス>)
443
+ twp contract delete <契約ID> --yes
444
+ twp invoice auto-template list [--keyword <語>] [--active true|false] [--customer <取引先>] [--all] [--limit <件数>]
445
+ twp invoice auto-template get <テンプレートID>
446
+ twp invoice auto-template create (--generate-cli-skeleton | --content-file <パス>)
447
+ twp invoice auto-template update <テンプレートID> (--generate-cli-skeleton | --content-file <パス>)
448
+ twp invoice auto-template delete <テンプレートID> --yes
449
+ twp invoice auto-template history (<テンプレートID> | --all-templates) [--status success|error|skipped]... [--from <日付>] [--to <日付>] [--all] [--limit <件数>]
450
+ ```
451
+
452
+ - **`twp contract` は見積から作る取引の契約です**(明細・金額を持ち、承認ワークフローに乗ります)。顧客に紐づけて保管する契約書の PDF は別物で、`twp customer contract` で扱います
453
+ - 契約の内容は見積・請求と同じく JSON ファイル(`--content-file`)で渡します。ひな形は元の見積の件名と明細を写します。元の見積(`estimate_id`)は作成のときだけ指定でき、取引先・プロジェクトは見積から決まります。請求が紐づいた契約の削除はサーバが断ります
454
+ - **有効な自動請求テンプレートは、毎日 4:00(日本時間)のバッチで本物の見積と請求を発行します。** `is_active` を省いて作ると有効になります。作成・更新の前に、いつ発行されるかを stderr に出します(`--dry-run` でも出ます)。ひな形は無効(`is_active: false`)で出ます
455
+ - 画面にある「期間の月・日」の項目(`period_*_months` / `period_*_day`)はサーバが保存しないので、CLI は送る前に止めます
456
+ - 自動請求テンプレートと発行履歴は販売管理の「管理者」、取引契約は「メンバー」以上の権限が要ります。ヘルプは `twp contract help` / `twp invoice auto-template help`
457
+
458
+ ### 入金・売掛金を扱う(販売管理の管理者)
459
+
460
+ ```
461
+ twp deposit list [--keyword <語>] [--customer <取引先>] [--allocation <引当状態>]... [--from <入金日>] [--to <入金日>] [--invoice-from <請求日>] [--invoice-to <請求日>] [--all]
462
+ twp deposit get <入金ID>
463
+ twp deposit create --payee <振込先ID> --date <入金日> --amount <円> [--customer <取引先>] [--memo <備考>] [--excess-reason <過不足理由>] [--excess-amount <円>]
464
+ twp deposit update <入金ID> [項目…] [--clear <項目>]...
465
+ twp deposit delete <入金ID> --yes
466
+ twp deposit export --out <パス.csv> [絞り込み…]
467
+ twp deposit allocation list <入金ID>
468
+ twp deposit allocation add <入金ID> (--invoice-id <請求ID> | --invoice <請求番号>) --amount <円>
469
+ twp deposit allocation add <入金ID> --file <「請求ID,金額」の CSV>
470
+ twp deposit allocation remove <入金ID> <引当ID> --yes
471
+ twp deposit allocation fill <入金ID> --yes
472
+ twp deposit plan list --from <支払期日> --to <支払期日> [--customer <取引先>] [--status <ステータス>]...
473
+ twp deposit plan register --generate-cli-skeleton --from <支払期日> --to <支払期日> --output json > plan.json
474
+ twp deposit plan register --content-file plan.json
475
+ twp receivable list [--month <YYYY-MM>] [--customer <取引先>] [--department <部署>] [--negative-only]
476
+ twp receivable export --out <パス.csv> [--type detail|summary] [--month <YYYY-MM>]
477
+ twp receivable closing list | get <YYYY-MM>
478
+ twp receivable closing close <YYYY-MM> --yes
479
+ twp receivable closing reopen <YYYY-MM> --yes
480
+ ```
481
+
482
+ - **一括の引当(`--file`)と入金予定からの登録は、全件成功か全件失敗です。** 送る前に全行を検査し、誤りが1つでもあれば1件も送りません。断られたときは何も登録されていないので、直して同じコマンドを打ち直します。応答を受け取れなかったときは、打ち直す前に `twp deposit allocation list` / `twp deposit list` で登録されたかを確かめてください(打ち直すと二重に登録されます)
483
+ - 入金予定のひな形は画面の初期状態と同じ(取引先ごとの全請求を未入金残の全額で引き当て、振込先は前回のもの)です。着金額が違う取引先は `deposit_amount` と `excess_reason` を書き足してから渡します
484
+ - `allocation fill` は、過不足理由(振込手数料など)を後から登録したときに手数料の分を既存の引当へ足します(引当を消して入れ直さずに済みます)
485
+ - **締め(`closing close`)はテナント全体の月次の確定値です。** 締めた月の入金は、登録・入金日の変更・削除・引当の変更をサーバが断ります(請求は締めの対象外)。締める前に、締める月の現在値と前月の締めとの差異を表示します(`--dry-run` でも出ます)。解除(`closing reopen`)すると確定値は消えます
486
+ - 負の過不足金額は `--excess-amount=-500` のように `=` でつないで渡します。ヘルプは `twp deposit help` / `twp receivable help`
487
+
373
488
  ### 顧客を登録・更新・削除する
374
489
 
375
490
  ```
@@ -413,7 +528,7 @@ twp company delete <取引先> --yes
413
528
  - **`twp company delete` は担当者を消しません**(対応履歴だけサーバが併せて消します)。担当者が残る取引先は送る前に止め、`twp customer delete` を案内します
414
529
  - `twp customer search-similar` は顧客だけでなく仕入先だけの取引先も当てます
415
530
  - **契約書(`contract create` / `add-version`)は PDF のアップロードと登録を1コマンドで行います。** 送る前にテナントの容量を検査し、超過なら何も送りません。PDF 以外(名前が `.pdf` で終わらない・中身の先頭が `%PDF-` でない)はサーバも受け付けないので、送る前に止めます。差替えは新しい版として足され、過去版は `contract get` の `versions` に残り `download --rev <版番号>` で取り出せます。登録・差替え・更新は顧客管理の「編集者」以上、削除は「管理者」です。**契約書が残っている顧客はサーバが削除を断る**ので、顧客を消す前に `contract delete` で消してください
416
- - 案件書類(`case-document list`)は見積をまたいだ一覧だけです(登録・差替え・削除・ダウンロードは見積ごとの操作で、CLI にはまだありません)。案件書類が残る顧客もサーバが削除を断るので、その顧客は画面から案件書類を片付けてから削除してください
531
+ - 案件書類(`case-document list`)は見積をまたいだ一覧だけです(登録・差替え・削除・ダウンロードは見積ごとの操作で、`twp estimate case-document` で行います)。案件書類が残る顧客もサーバが削除を断るので、その顧客は `twp estimate case-document delete` で案件書類を片付けてから削除してください
417
532
  - 施策(`campaign`)の作成・更新・削除は顧客管理の「管理者」だけです。**サーバは担当者・アプローチ先からの参照を検査せずに削除する**ので、参照を残したまま止めるなら `--active false` で無効にしてください
418
533
  - タグ・施策の紐づけはまだありません(`twp api /api/v2/customers/<顧客ID>/contacts/<担当者ID>` に `tags` / `campaign_ids` を送って到達できます)
419
534
  - ヘルプは `twp customer delete help` / `twp customer contact help` / `twp customer interaction help` / `twp customer business-card help` / `twp customer people help` / `twp customer contract help` / `twp customer case-document help` / `twp customer campaign help` / `twp company help`
@@ -1,6 +1,6 @@
1
1
  import { createRequire as __twpCreateRequire } from 'node:module';
2
2
  const require = __twpCreateRequire(import.meta.url);
3
- import{failureHint,isAuthError,isCliFatalText,isRateLimited,isServerAiType,isUntrusted,maxTurnsReached,rateLimitWaitSeconds,tailForScan}from"./chunk-ZOOEH7ZE.js";import{expandServerSkills,prepareSkillOverlay}from"./chunk-L52XJFJR.js";import{detectAiClis}from"./chunk-T4QZO6RQ.js";import"./chunk-QWSXHHFT.js";import"./chunk-VK2Z4QGC.js";import"./chunk-P4AEFKLM.js";import"./chunk-VRBI2NPI.js";import"./chunk-J7QYPKVK.js";import{stripTerminalControls}from"./chunk-NHYMHCAT.js";
3
+ import{failureHint,isAuthError,isCliFatalText,isRateLimited,isServerAiType,isUntrusted,maxTurnsReached,rateLimitWaitSeconds,tailForScan}from"./chunk-ZOOEH7ZE.js";import{expandServerSkills,prepareSkillOverlay}from"./chunk-L52XJFJR.js";import"./chunk-QWSXHHFT.js";import"./chunk-VK2Z4QGC.js";import{detectAiClis}from"./chunk-T4QZO6RQ.js";import"./chunk-P4AEFKLM.js";import"./chunk-VRBI2NPI.js";import"./chunk-J7QYPKVK.js";import{stripTerminalControls}from"./chunk-NHYMHCAT.js";
4
4
  import{isForceOnly,killProcessTree,system32}from"./chunk-N2UVRM3Z.js";import{DEFAULT_CLAUDE_LAUNCHER,activeSlotPath,detectClaudeAutoSwitch,isClaudeAi,isUsableModelId,modelFitsRoute,resolveSpawnTarget,usesBedrock,wrapWithAutoSwitch}from"./chunk-AEJHDFXB.js";import"./chunk-GY7KI5E5.js";import"./chunk-7WSNIXTQ.js";import{findExecutable,isWindowsDriveAbsolute}from"./chunk-PMOUHEJQ.js";import"./chunk-5WGOHFAS.js";import"./chunk-VSJBJXZO.js";import{spawnSync}from"child_process";import fs2 from"fs";import path2 from"path";import{spawn}from"child_process";import fs from"fs";import path from"path";var FINAL_REPORT_BEGIN="<<<AI_FINAL_REPORT>>>";var FINAL_REPORT_END="<<<END_AI_FINAL_REPORT>>>";var ClaudeStreamRenderer=class{constructor(now=()=>new Date){this.now=now}now;toolNames=new Map;toolCount=0;result={subtype:null,isError:null,numTurns:null,costUsd:null,durationMs:null,tokensIn:null,tokensOut:null,rateLimited:false,resetsAt:null,finalText:""};push(line){const trimmed=line.trim();if(trimmed==="")return[];let event;try{const parsed=JSON.parse(trimmed);if(parsed===null||typeof parsed!=="\
5
5
  object"||Array.isArray(parsed)){return[line]}event=parsed}catch{return[line]}switch(event["type"]){case"rate_limit_event":return this.onRateLimit(event);case"assistant":return this.onAssistant(event);case"user":return this.onUser(event);case"result":return this.onResult(event);default:return event["type"]==="system"?[]:[line]}}sawRateLimit(){return this.result.rateLimited}lastRateLimitNote="";onRateLimit(event){const info=event["rate_limit_info"];if(info===null||typeof info!=="object")return[];const rec=info;
6
6
  const status=typeof rec["status"]==="string"?rec["status"]:"";const resets=typeof rec["resetsAt"]==="number"?rec["resetsAt"]:null;if(status==="")return[];const at=isSaneEpochSec(resets)?` resets=${new Date(resets*1e3).toISOString()}`:"";if(status.startsWith("allowed")){if(status==="allowed")return[];const seen=`${status}|${resets??""}`;if(seen===this.lastRateLimitNote)return[];this.lastRateLimitNote=seen;return[this.line(`\u2139\uFE0F \u4E0A\u9650\u306B\u63A5\u8FD1\uFF08status=${status}${at}\uFF09\u2014 \u5B9F\
@@ -1,8 +1,8 @@
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-NZ7WI4RZ.js";import{NO_REDACT_FLAG,NO_REDACT_NOTICE,exitCodeFor,fetchAllPages,reportError}from"./chunk-LS7P3IWP.js";import{evaluateQuery}from"./chunk-GDM2QUBL.js";import{renderOutput}from"./chunk-FEOST3GF.js";import{redactSecretValues,withDebug}from"./chunk-BUZKNZ45.js";import"./chunk-GLBQAXWC.js";import{readBody}from"./chunk-HGTG5XQ7.js";
4
- import{parseOperationArgs,repeatedValues}from"./chunk-IOGVQVGD.js";import"./chunk-ZST7XESB.js";import{ApiError,TwpApiClient,appendQuery}from"./chunk-IF2K4PM5.js";import"./chunk-GMBJTG6A.js";import{GLOBAL_OPTIONS_HELP}from"./chunk-TAN5I2DP.js";import{AuthSession,NotLoggedInError,SessionExpiredError,loadCredentials}from"./chunk-XNLIEUAW.js";import{httpFetch}from"./chunk-J7QYPKVK.js";import{effectiveApiUrl,resolveConfiguredOutput,resolveProfile}from"./chunk-4VZKNEVN.js";
5
- import{HELP_TOKEN}from"./chunk-O4NSYHR4.js";import"./chunk-QQRJLH6B.js";import{OUTPUT_FORMATS,resolveOutputFormat}from"./chunk-K2ONOH3L.js";import"./chunk-WVS4W5FY.js";import{stripTerminalControls}from"./chunk-NHYMHCAT.js";import{DEFAULT_MAX_ITEMS,DEFAULT_MAX_PAGES,envelopePaging,isPageNumberEnvelope,pageRangeNotes,positiveInteger,readEnvelopeCursor,readPageNumberCursor,shellQuote}from"./chunk-5R4SEO3I.js";import"./chunk-II5RVJQN.js";import{ApiResponseError,
3
+ import{CommandModelMissingError,MAX_REPORTED_VIOLATIONS,loadCommandModelDomain,loadCommandModelRoutes,validateBody,validateQuery}from"./chunk-NZ7WI4RZ.js";import{NO_REDACT_FLAG,NO_REDACT_NOTICE,exitCodeFor,fetchAllPages,reportError}from"./chunk-C7UDUHQZ.js";import"./chunk-TLN3JSEC.js";import{evaluateQuery}from"./chunk-GDM2QUBL.js";import{renderOutput}from"./chunk-FEOST3GF.js";import{redactSecretValues,withDebug}from"./chunk-BUZKNZ45.js";import{readBody}from"./chunk-HGTG5XQ7.js";
4
+ import{parseOperationArgs,repeatedValues}from"./chunk-IOGVQVGD.js";import"./chunk-ELXDRPDV.js";import{ApiError,TwpApiClient,appendQuery}from"./chunk-IF2K4PM5.js";import"./chunk-GMBJTG6A.js";import{GLOBAL_OPTIONS_HELP}from"./chunk-I4ARX6NM.js";import{AuthSession,NotLoggedInError,SessionExpiredError,loadCredentials}from"./chunk-XNLIEUAW.js";import{httpFetch}from"./chunk-J7QYPKVK.js";import{effectiveApiUrl,resolveConfiguredOutput,resolveProfile}from"./chunk-4VZKNEVN.js";
5
+ import{HELP_TOKEN}from"./chunk-UVUVEL3B.js";import"./chunk-QQRJLH6B.js";import{OUTPUT_FORMATS,resolveOutputFormat}from"./chunk-K2ONOH3L.js";import"./chunk-WVS4W5FY.js";import{stripTerminalControls}from"./chunk-NHYMHCAT.js";import{DEFAULT_MAX_ITEMS,DEFAULT_MAX_PAGES,envelopePaging,isPageNumberEnvelope,pageRangeNotes,positiveInteger,readEnvelopeCursor,readPageNumberCursor,shellQuote}from"./chunk-5R4SEO3I.js";import"./chunk-II5RVJQN.js";import{ApiResponseError,
6
6
  EXIT_OK,NetworkError,UsageError}from"./chunk-7WSNIXTQ.js";import"./chunk-RZVI6PMW.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=>/^\{[^/{}]+\}$/.
7
7
  test(segment)?null:segment)})}parsedCache.set(routes,parsed);return parsed}function matches(route,segments){if(route.segments.length!==segments.length)return false;return route.segments.every((literal,i)=>literal===null||literal===segments[i])}function compareSpecificity(a,b){const literals=route=>route.segments.filter(segment=>segment!==null).length;const diff=literals(b)-literals(a);if(diff!==0)return diff;for(let i=0;i<a.segments.length;i+=1){const aLiteral=a.segments[i]!==null;const bLiteral=b.
8
8
  segments[i]!==null;if(aLiteral!==bLiteral)return aLiteral?-1:1}return 0}function lookupRoute(routes,method,path){const segments=splitSegments(path);const hits=parseRoutes(routes).filter(route=>matches(route,segments));const sameMethod=hits.filter(route=>route.method===method).sort(compareSpecificity);const best=sameMethod[0];if(best!==void 0)return{kind:"matched",domain:best.domain,template:best.template};if(hits.length>0){const[top]=[...hits].sort(compareSpecificity);const template=top.template;
@@ -1,8 +1,8 @@
1
1
  import { createRequire as __twpCreateRequire } from 'node:module';
2
2
  const require = __twpCreateRequire(import.meta.url);
3
- import{RESIDENT_TOKEN_CAP,activateModeFiles,activatePermissionSettings,buildResidentSet,buildSystemPrompt,createAuditLogger,createTwpToolkit,currentBranch,describeAuditLog,describeToolCatalog,displayCwd,executeTool,findProjectTwpSubdir,localTools,lstatOrNull,parseFrontMatter,parseRule,persistProjectAllow,projectPermissionsPath,projectRootFor,readFileTool,residentInputs,resolveGitExecutable,runTurn,secretReason}from"./chunk-HAIZHSNZ.js";import"./chunk-NZ7WI4RZ.js";import"./chunk-BUZKNZ45.js";
4
- import{buildDiffLines,diffStat}from"./chunk-VRBI2NPI.js";import{require_fuzzysort}from"./chunk-DIMZRTLE.js";import"./chunk-ZST7XESB.js";import"./chunk-IF2K4PM5.js";import"./chunk-GMBJTG6A.js";import{RelayError,builtinCatalog,createRuntime,loadCachedCatalog,modelLabel,pickModel,toModelInfos}from"./chunk-PWXXCLVZ.js";import"./chunk-D233KKXW.js";import"./chunk-XNLIEUAW.js";import{proxyDiagnostics}from"./chunk-J7QYPKVK.js";import{checkMinSupportedVersion,
5
- isBelowMinSupported,minSupportedBlockMessage}from"./chunk-DXXFUNYN.js";import"./chunk-4VZKNEVN.js";import{parseArgv}from"./chunk-QBA6THJ5.js";import{applyPermissionMode,checkPermission,describePermissionMode,getMode,isModeId,modeSource,nextMode}from"./chunk-NAUH75MM.js";import"./chunk-O4NSYHR4.js";import"./chunk-QQRJLH6B.js";import{isFullWidth,isWide,stringWidth,stripAnsi}from"./chunk-WVS4W5FY.js";import{stripTerminalControls}from"./chunk-NHYMHCAT.js";
3
+ import{RESIDENT_TOKEN_CAP,activateModeFiles,activatePermissionSettings,buildResidentSet,buildSystemPrompt,createAuditLogger,createTwpToolkit,currentBranch,describeAuditLog,describeToolCatalog,displayCwd,executeTool,findProjectTwpSubdir,localTools,lstatOrNull,parseFrontMatter,parseRule,persistProjectAllow,projectPermissionsPath,projectRootFor,readFileTool,residentInputs,resolveGitExecutable,runTurn,secretReason}from"./chunk-HAIZHSNZ.js";import{buildDiffLines,diffStat}from"./chunk-VRBI2NPI.js";
4
+ import"./chunk-NZ7WI4RZ.js";import"./chunk-BUZKNZ45.js";import{require_fuzzysort}from"./chunk-DIMZRTLE.js";import"./chunk-ELXDRPDV.js";import"./chunk-IF2K4PM5.js";import"./chunk-GMBJTG6A.js";import{RelayError,builtinCatalog,createRuntime,loadCachedCatalog,modelLabel,pickModel,toModelInfos}from"./chunk-PWXXCLVZ.js";import"./chunk-D233KKXW.js";import"./chunk-XNLIEUAW.js";import{proxyDiagnostics}from"./chunk-J7QYPKVK.js";import{checkMinSupportedVersion,
5
+ isBelowMinSupported,minSupportedBlockMessage}from"./chunk-DXXFUNYN.js";import"./chunk-4VZKNEVN.js";import{parseArgv}from"./chunk-BJLXXRSY.js";import{applyPermissionMode,checkPermission,describePermissionMode,getMode,isModeId,modeSource,nextMode}from"./chunk-NAUH75MM.js";import"./chunk-UVUVEL3B.js";import"./chunk-QQRJLH6B.js";import{isFullWidth,isWide,stringWidth,stripAnsi}from"./chunk-WVS4W5FY.js";import{stripTerminalControls}from"./chunk-NHYMHCAT.js";
6
6
  import"./chunk-N2UVRM3Z.js";import"./chunk-II5RVJQN.js";import"./chunk-7WSNIXTQ.js";import"./chunk-PMOUHEJQ.js";import{configReadDirs,twpHomeDir}from"./chunk-RZVI6PMW.js";import{__commonJS,__export,__require,__toESM}from"./chunk-VSJBJXZO.js";var require_react_production=__commonJS({"node_modules/react/cjs/react.production.js"(exports){"use strict";var REACT_ELEMENT_TYPE=Symbol.for("react.transitional.element");var REACT_PORTAL_TYPE=Symbol.for("react.portal");var REACT_FRAGMENT_TYPE=Symbol.for("react.fragment");var REACT_STRICT_MODE_TYPE=Symbol.for("react.strict_mode");var REACT_PROFILER_TYPE=Symbol.for("react.profiler");var REACT_CONSUMER_TYPE=Symbol.for("react.consumer");var REACT_CONTEXT_TYPE=Symbol.for("react.context");var REACT_FORWARD_REF_TYPE=Symbol.
7
7
  for("react.forward_ref");var REACT_SUSPENSE_TYPE=Symbol.for("react.suspense");var REACT_MEMO_TYPE=Symbol.for("react.memo");var REACT_LAZY_TYPE=Symbol.for("react.lazy");var REACT_ACTIVITY_TYPE=Symbol.for("react.activity");var REACT_VIEW_TRANSITION_TYPE=Symbol.for("react.view_transition");var MAYBE_ITERATOR_SYMBOL=Symbol.iterator;function getIteratorFn(maybeIterable){if(null===maybeIterable||"object"!==typeof maybeIterable)return null;maybeIterable=MAYBE_ITERATOR_SYMBOL&&maybeIterable[MAYBE_ITERATOR_SYMBOL]||
8
8
  maybeIterable["@@iterator"];return"function"===typeof maybeIterable?maybeIterable:null}var ReactNoopUpdateQueue={isMounted:function(){return false},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}};var assign=Object.assign;var emptyObject={};function Component(props,context,updater){this.props=props;this.context=context;this.refs=emptyObject;this.updater=updater||ReactNoopUpdateQueue}Component.prototype.isReactComponent={};Component.prototype.setState=
@@ -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: ${parsed.unknown.join(" ")}
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-6JRHCC67.js");try{const code=await runDomain({domain:route.domain,...parsed.operation!==void 0?{operation:parsed.operation}:
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-KNZ43HFF.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,6 +1,6 @@
1
1
  import { createRequire as __twpCreateRequire } from 'node:module';
2
2
  const require = __twpCreateRequire(import.meta.url);
3
- import{readBody}from"./chunk-HGTG5XQ7.js";import{BACKLOG_BASE_PATH,BACKLOG_PROJECT_SCOPE_LABEL,BACKLOG_SCOPE_LABEL,backlogSpacePath,isExactNumericId,resolveNamed}from"./chunk-ZST7XESB.js";import"./chunk-IF2K4PM5.js";import"./chunk-GMBJTG6A.js";import"./chunk-J7QYPKVK.js";import"./chunk-4VZKNEVN.js";import"./chunk-NHYMHCAT.js";import"./chunk-II5RVJQN.js";import{requireResolved,singleRef,withResolved}from"./chunk-ZN5EFDH7.js";import{isRecord,pick}from"./chunk-ZWVYVS2A.js";
3
+ import{readBody}from"./chunk-HGTG5XQ7.js";import{BACKLOG_BASE_PATH,BACKLOG_PROJECT_SCOPE_LABEL,BACKLOG_SCOPE_LABEL,backlogSpacePath,isExactNumericId,resolveNamed}from"./chunk-ELXDRPDV.js";import"./chunk-IF2K4PM5.js";import"./chunk-GMBJTG6A.js";import"./chunk-J7QYPKVK.js";import"./chunk-4VZKNEVN.js";import"./chunk-NHYMHCAT.js";import"./chunk-II5RVJQN.js";import{requireResolved,singleRef,withResolved}from"./chunk-ZN5EFDH7.js";import{isRecord,pick}from"./chunk-ZWVYVS2A.js";
4
4
  import{ApiResponseError,UsageError}from"./chunk-7WSNIXTQ.js";import"./chunk-RZVI6PMW.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\
5
5
  eatedUser","parentIssueId","startDate","dueDate","estimatedHours","actualHours","created","updated"];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","create\
6
6
  dUser","created"];var STATUS_COLUMNS=["id","name","color"];var USER_COLUMNS=["id","userId","name","mailAddress","roleType"];var SPACE_FLAG={name:"--space",summary:"Backlog \u30B9\u30DA\u30FC\u30B9\uFF08ID / \u30B9\u30DA\u30FC\u30B9URL / \u30B5\u30D6\u30C9\u30E1\u30A4\u30F3\uFF09\u3002\u767B\u9332\u304C1\u4EF6\u306A\u3089\u7701\u7565\u3067\u304D\u307E\u3059",takesValue:true,placeholder:"<ID|URL>"};var BODY_MAX_CHARS=1e5;var BODY_FLAGS=[{name:"--body-file",summary:"\u672C\u6587\u3092\u30D5\u30A1\u30A4\u30EB\u304B\u3089\u8AAD\u3080\uFF08- \u3067\u6A19\u6E96\u5165\u529B\uFF09\u3002\u6539\u884C\u30FBMarkdown\
@@ -0,0 +1,94 @@
1
+ import { createRequire as __twpCreateRequire } from 'node:module';
2
+ const require = __twpCreateRequire(import.meta.url);
3
+ import{CUSTOMER_FLAG,CUSTOMER_LICENSE,childForbidden,levelForbidden,prepareCustomerFlag}from"./chunk-QQLWMHGR.js";import{inspectLocalFile}from"./chunk-VECUCVIY.js";import{checkUploadQuota}from"./chunk-DDKZ5IPT.js";import{createFlags,fieldBody,hasAnyField,updateFlags}from"./chunk-MHRGKUMK.js";import{booleanText}from"./chunk-UDPJ2IGK.js";import{CUSTOMERS_PATH,isExactNumericId}from"./chunk-ELXDRPDV.js";import{ApiError}from"./chunk-IF2K4PM5.js";import{isSafePathSegment}from"./chunk-GMBJTG6A.js";
4
+ import{NotLoggedInError,SessionExpiredError}from"./chunk-XNLIEUAW.js";import{nonEmpty}from"./chunk-5R4SEO3I.js";import{requireResolved,withResolved}from"./chunk-ZN5EFDH7.js";import{acknowledgement,isRecord,pick}from"./chunk-ZWVYVS2A.js";import{ApiResponseError,UsageError}from"./chunk-7WSNIXTQ.js";import fs from"fs";import path from"path";var CONTRACT_TYPES=["basic_contract","nda","other"];var CONTRACT_TYPE_HELP="basic_contract\uFF1D\u57FA\u672C\u5951\u7D04\u66F8 / nda\uFF1D\u6A5F\u5BC6\u4FDD\u6301\u5951\u7D04\u66F8 / other\uFF1D\u305D\u306E\u4ED6\u5951\u7D04\u66F8\u985E";var FILE_NAME_MAX_CHARS=255;var PDF_MAGIC="%PDF-";var CONTRACT_FIELDS=[{kind:"text",flag:"--name",key:"document_name",label:"\u66F8\u985E\u540D",maxChars:255,summary:"\u66F8\u985E\u540D\uFF08create \u3067\u306F\u5FC5\u9808\uFF09"},{kind:"enum",flag:"--type",key:"\
5
+ document_type",values:CONTRACT_TYPES,summary:`\u66F8\u985E\u7A2E\u5225\uFF08${CONTRACT_TYPE_HELP}\u30FBcreate \u3067\u306F\u5FC5\u9808\uFF09`}];var CONTRACT_COLUMNS=["document_id","company_id","document_type","document_name","current_version","updated_by_name","updated_at"];var VERSION_COLUMNS=["version_number","file_name","file_size","is_current","created_by_name","created_at"];var CASE_COLUMNS=["document_id","document_type_label","document_name","estimate_no","estimate_title","project_name","c\
6
+ urrent_version","updated_at"];var FILE_FLAG={name:"--file",summary:"\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u3059\u308B PDF \u30D5\u30A1\u30A4\u30EB\u306E\u30D1\u30B9\uFF08\u5FC5\u9808\uFF09",takesValue:true,placeholder:"<\u30D1\u30B9.pdf>"};var OUT_FLAG={name:"--out",summary:"\u66F8\u304D\u51FA\u3057\u5148\u306E\u30D5\u30A1\u30A4\u30EB\u30D1\u30B9\uFF08\u5FC5\u9808\u3002\u6A19\u6E96\u51FA\u529B\u3078\u306F\u51FA\u3057\u307E\u305B\u3093\uFF09",takesValue:true,placeholder:"<\u30D1\u30B9>"};var FORCE_FLAG={
7
+ name:"--force",summary:"\u66F8\u304D\u51FA\u3057\u5148\u304C\u65E2\u306B\u3042\u308C\u3070\u4E0A\u66F8\u304D\u3059\u308B\uFF08\u65E2\u5B9A\u3067\u306F\u4E0A\u66F8\u304D\u3057\u306A\u3044\uFF09",takesValue:false};var REV_FLAG={name:"--rev",summary:"\u53D6\u308A\u51FA\u3059\u7248\u306E\u756A\u53F7\uFF08\u7701\u7565\u6642\u306F\u73FE\u884C\u7248\u3002get \u306E versions \u306E version_number\uFF09",takesValue:true,placeholder:"<\u7248\u756A\u53F7>"};var CONTRACT_REF_HELP="--customer\uFF08\u9867\u5BA2\uFF09\u304C\u5FC5\u9808\u3067\u3059\u3002<\u66F8\u985EID>\
8
+ \u306F twp customer contract list \u306E document_id \u5217\u306E\u5024\u3067\u3059\u3002\n<\u9867\u5BA2> \u306F\u4F01\u696D\u540D\u30FB\u7565\u79F0\u30FB\u30AB\u30CA\u306E\u5B8C\u5168\u4E00\u81F4\u304B ID\uFF08twp customer list \u306E id \u5217\u306E\u6570\u5B57\uFF09\u3067\u6307\u5B9A\u3057\u307E\u3059\u3002";var VIEW_FORBIDDEN=label=>levelForbidden(CUSTOMER_LICENSE,`${label}\u3092\u898B\u308B\u306B\u306F\u9867\u5BA2\u7BA1\u7406\u306E\u6A29\u9650\u304C\u8981\u308A\u307E\u3059\u3002\u30C6\u30CA\u30F3\u30C8\u7BA1\u7406\u8005\u306B\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002`);
9
+ function usageOf(resource,op){return`twp customer ${resource} ${op} help`}function companyBase(input,kind){const id=requireResolved(input,"companyId");if(!isExactNumericId(id))throw new ApiResponseError(`\u53D6\u5F15\u5148 ID \u3092\u30D1\u30B9\u306B\u4F7F\u3048\u307E\u305B\u3093: ${id}\u3002\u63A5\u7D9A\u5148\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002`);return`${CUSTOMERS_PATH}/${id}/${kind}`}function singleId(input,label,usage,listHint){const[raw,...rest]=input.args;if(raw===void 0||
10
+ raw.trim()==="")throw new UsageError(`${label}\u306E ID \u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044`,usage);if(rest.length>0)throw new UsageError(`\u53D7\u3051\u53D6\u308C\u308B${label}\u306E ID \u306F1\u3064\u3060\u3051\u3067\u3059: ${rest.join(" ")}`,usage);const id=raw.trim();if(!isSafePathSegment(id))throw new UsageError(`${label}\u306E ID \u3068\u3057\u3066\u4F7F\u3048\u306A\u3044\u6587\u5B57\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u3059: ${id}`,listHint);return id}function noArgs(input,op,usage){
11
+ if(input.args.length>0)throw new UsageError(`${op} \u306F\u4F4D\u7F6E\u5F15\u6570\u3092\u53D6\u308A\u307E\u305B\u3093: ${input.args.join(" ")}`,usage)}function itemsOf(body,what){const items=isRecord(body)?body["items"]:void 0;if(!isRecord(body)||body["result"]!==true||!Array.isArray(items)||!items.every(isRecord)){throw new ApiResponseError(`${what}\u306E\u5FDC\u7B54\u306B items \u914D\u5217\u304C\u3042\u308A\u307E\u305B\u3093\u3002\u63A5\u7D9A\u5148\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002`)}
12
+ return items}var docUsage=op=>usageOf("contract",op);var docId=(input,op)=>singleId(input,"\u66F8\u985E",docUsage(op),"twp customer contract list \u306E document_id \u5217\u306E\u5024\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002");var docPath=(input,op)=>`${companyBase(input,"contract-documents")}/${encodeURIComponent(docId(input,op))}`;function contractOf(body,what){const doc=isRecord(body)?body["contract_document"]:void 0;if(!isRecord(body)||body["result"]!==true||!isRecord(doc)||
13
+ typeof doc["document_id"]!=="string"){throw new ApiResponseError(`${what}\u306E\u5FDC\u7B54\u306B contract_document.document_id \u304C\u3042\u308A\u307E\u305B\u3093\u3002\u63A5\u7D9A\u5148\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002`)}return doc}function versionsOf(doc){const versions=doc["versions"];return Array.isArray(versions)?versions.filter(isRecord):[]}function localPdf(input,usage){const{file,size}=inspectLocalFile(input.flags.get(FILE_FLAG.name),FILE_FLAG.name,usage);const name=path.
14
+ basename(file);if(!/\.pdf$/i.test(name)){throw new UsageError(`\u5951\u7D04\u66F8\u306F PDF \u3060\u3051\u3092\u767B\u9332\u3067\u304D\u307E\u3059\uFF08\u30D5\u30A1\u30A4\u30EB\u540D\u304C .pdf \u3067\u7D42\u308F\u3063\u3066\u3044\u307E\u305B\u3093\uFF09: ${file}`)}if(Array.from(name).length>FILE_NAME_MAX_CHARS){throw new UsageError(`\u30D5\u30A1\u30A4\u30EB\u540D\u306F ${FILE_NAME_MAX_CHARS} \u6587\u5B57\u307E\u3067\u3067\u3059\uFF08${Array.from(name).length} \u6587\u5B57\uFF09: ${name}`)}const head=Buffer.
15
+ alloc(PDF_MAGIC.length);try{const fd=fs.openSync(file,"r");try{fs.readSync(fd,head,0,head.length,0)}finally{fs.closeSync(fd)}}catch(err){throw new UsageError(`\u30D5\u30A1\u30A4\u30EB\u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\uFF08${FILE_FLAG.name}\uFF09: ${file}\uFF08${err.code??err.message}\uFF09`)}if(head.toString("latin1")!==PDF_MAGIC){throw new UsageError(`\u6709\u52B9\u306A PDF \u3067\u306F\u3042\u308A\u307E\u305B\u3093\uFF08\u5148\u982D\u304C ${PDF_MAGIC} \u3067\u306F\u3042\u308A\u307E\u305B\u3093\uFF09: ${file}`)}
16
+ return{file,name,size}}function uploadUrlPlan(input){return{method:"POST",path:`${companyBase(input,"contract-documents")}/upload-url`,body:{file_name:requireResolved(input,"fileName"),file_size:Number(requireResolved(input,"fileSize"))}}}function issuedStaged(body){const uploadUrl=isRecord(body)?body["upload_url"]:void 0;const uploadKey=isRecord(body)?body["upload_key"]:void 0;const contentType=isRecord(body)?body["content_type"]:void 0;if(typeof uploadUrl!=="string"||!/^https:\/\//.test(uploadUrl)||
17
+ typeof uploadKey!=="string"||uploadKey===""||typeof contentType!=="string"||contentType===""){throw new ApiResponseError("\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9URL\u767A\u884C\u306E\u5FDC\u7B54\u306B upload_url / upload_key / content_type \u304C\u3042\u308A\u307E\u305B\u3093\u3002\u63A5\u7D9A\u5148\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002")}return{uploadUrl,uploadKey,contentType}}async function uploadStaged(input,ctx,upload){const file=requireResolved(input,"file");const size=Number(
18
+ requireResolved(input,"fileSize"));await checkUploadQuota(ctx,size);const{uploadUrl,uploadKey,contentType}=issuedStaged(await ctx.send(upload.issue));let registerSent=false;try{const bytes=fs.readFileSync(file);if(bytes.byteLength!==size){throw new UsageError(`\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u4E2D\u306B\u30D5\u30A1\u30A4\u30EB\u306E\u5927\u304D\u3055\u304C\u5909\u308F\u308A\u307E\u3057\u305F\uFF08${size} \u2192 ${bytes.byteLength} \u30D0\u30A4\u30C8\uFF09: ${file}`)}await ctx.putSigned(uploadUrl,
19
+ bytes,contentType);registerSent=true;return await upload.register(uploadKey)}catch(err){const refused=err instanceof ApiError&&err.status>=400&&err.status<500||err instanceof NotLoggedInError||err instanceof SessionExpiredError;ctx.warn(registerSent&&!refused?`${upload.label}\u306E\u767B\u9332\u306F\u9001\u4FE1\u3057\u307E\u3057\u305F\u304C\u3001\u6210\u529F\u3092\u78BA\u304B\u3081\u3089\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u6253\u3061\u76F4\u3059\u524D\u306B ${upload.retry} \u3067\u767B\u9332\u3055\u308C\u305F\u304B\u3092\u78BA\
20
+ \u304B\u3081\u3066\u304F\u3060\u3055\u3044\uFF08\u4E8C\u91CD\u306B\u767B\u9332\u3055\u308C\u308B\u3053\u3068\u304C\u3042\u308A\u307E\u3059\uFF09\u3002
21
+ `:`${upload.label}\u306F\u767B\u9332\u3055\u308C\u3066\u3044\u307E\u305B\u3093\uFF08${registerSent?"\u30B5\u30FC\u30D0\u304C\u767B\u9332\u3092\u65AD\u308A\u307E\u3057\u305F\u3002":""}\u9001\u3063\u305F\u30D5\u30A1\u30A4\u30EB\u306F\u66F8\u985E\u3068\u3057\u3066\u6210\u7ACB\u3057\u3066\u3044\u306A\u3044\u4E00\u6642\u30D5\u30A1\u30A4\u30EB\u3067\u3001\u3069\u306E\u4E00\u89A7\u306B\u3082\u51FA\u307E\u305B\u3093\uFF09\u3002\u539F\u56E0\u3092\u53D6\u308A\u9664\u3044\u3066\u304B\u3089\u3001\u3082\u3046\u4E00\u5EA6\u540C\u3058\u30B3\u30DE\u30F3\u30C9\u3092\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002
22
+ `);throw err}}function uploadPdf(input,ctx,retry,register){return uploadStaged(input,ctx,{label:"\u5951\u7D04\u66F8",issue:uploadUrlPlan(input),retry,register})}async function preparePdf(input,ctx,op){const pdf=localPdf(input,docUsage(op));const prepared=await prepareCustomerFlag(input,ctx,docUsage(op));return withResolved(prepared,{file:pdf.file,fileName:pdf.name,fileSize:String(pdf.size)})}var CONTRACT_EDIT_FORBIDDEN=childForbidden("\u5951\u7D04\u66F8","edit");async function createContract(input,ctx){
23
+ const body=fieldBody(input,CONTRACT_FIELDS);return uploadPdf(input,ctx,`twp customer contract list --customer ${requireResolved(input,"companyId")}`,async uploadKey=>{const created=contractOf(await ctx.send({method:"POST",path:companyBase(input,"contract-documents"),body:{...body,upload_key:uploadKey,file_name:requireResolved(input,"fileName")}}),"\u5951\u7D04\u66F8\u306E\u767B\u9332");return{result:true,contract_document:created}})}async function addVersion(input,ctx){const target=docPath(input,
24
+ "add-version");const before=contractOf(await ctx.send({method:"GET",path:target}),"\u5951\u7D04\u66F8");const previous=typeof before["current_version"]==="number"?before["current_version"]:0;return uploadPdf(input,ctx,`twp customer contract get ${docId(input,"add-version")} --customer ${requireResolved(input,"companyId")}`,async uploadKey=>{const after=contractOf(await ctx.send({method:"POST",path:`${target}/versions`,body:{upload_key:uploadKey,file_name:requireResolved(input,"fileName")}}),"\u7248\u306E\u5DEE\
25
+ \u66FF\u3048");const current=after["current_version"];if(typeof current!=="number"||current<=previous){throw new ApiResponseError(`\u7248\u306E\u5DEE\u66FF\u3048\u306E\u5FDC\u7B54\u3067\u73FE\u884C\u7248\u304C\u9032\u3093\u3067\u3044\u307E\u305B\u3093\uFF08\u5DEE\u66FF\u3048\u524D ${previous} \u2192 \u5FDC\u7B54 ${String(current)}\uFF09\u3002\u63A5\u7D9A\u5148\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002`)}return{result:true,contract_document:after}})}function contractSummary(body,what){
26
+ const doc=contractOf(body,what);return{...pick(doc,CONTRACT_COLUMNS),versions:versionsOf(doc).length}}var contractResource={name:"contract",summary:"\u9867\u5BA2\u306E\u5951\u7D04\u66F8\uFF08\u4E00\u89A7\u30FB\u8A73\u7D30\u30FBPDF \u306E\u767B\u9332\u30FB\u7248\u306E\u5DEE\u66FF\u3048\u30FB\u66F4\u65B0\u30FB\u524A\u9664\u30FB\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9\uFF09",operations:[{name:"list",summary:"\u9867\u5BA2\u306E\u5951\u7D04\u66F8\u3092\u4E00\u89A7\u3059\u308B",usage:"twp customer contrac\
27
+ t list --customer <\u9867\u5BA2>",description:`\u9867\u5BA2\u306B\u767B\u9332\u3055\u308C\u305F\u5951\u7D04\u66F8\uFF08\u524A\u9664\u3057\u305F\u3082\u306E\u3092\u9664\u304F\uFF09\u3092\u3059\u3079\u3066\u8FD4\u3057\u307E\u3059\uFF08\u3053\u306E API \u306F\u30DA\u30FC\u30B8\u30F3\u30B0\u3092\u6301\u3061\u307E\u305B\u3093\uFF09\u3002
28
+ \u898B\u7A4D\u306B\u7D10\u3065\u304F\u6848\u4EF6\u66F8\u985E\u306F\u542B\u307F\u307E\u305B\u3093\uFF08twp customer case-document list\uFF09\u3002
29
+
30
+ --output json \u306F API \u304C\u8FD4\u3059\u5168\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u51FA\u3057\u307E\u3059\u3002
31
+ --output table / text / tsv \u306F\u8981\u7D04\u5217\uFF08${CONTRACT_COLUMNS.join(" / ")}\uFF09\u3067\u3059\u3002`,flags:[CUSTOMER_FLAG],forbidden:VIEW_FORBIDDEN("\u5951\u7D04\u66F8"),async prepare(input,ctx){noArgs(input,"list",docUsage("list"));return prepareCustomerFlag(input,ctx,docUsage("list"))},plan:input=>({method:"GET",path:companyBase(input,"contract-documents")}),summarize:body=>itemsOf(body,"\u5951\u7D04\u66F8\u4E00\u89A7").map(row=>pick(row,CONTRACT_COLUMNS)),raw:body=>itemsOf(body,
32
+ "\u5951\u7D04\u66F8\u4E00\u89A7")},{name:"get",summary:"\u5951\u7D04\u66F81\u4EF6\u306E\u8A73\u7D30\u3092\u8868\u793A\u3059\u308B\uFF08\u73FE\u884C\u7248\u30FB\u904E\u53BB\u7248\u3092\u542B\u3080\uFF09",usage:"twp customer contract get <\u66F8\u985EID> --customer <\u9867\u5BA2>",description:`${CONTRACT_REF_HELP}
33
+
34
+ --output json \u306F\u73FE\u884C\u7248\u30FB\u904E\u53BB\u7248\uFF08versions\uFF09\u3092\u542B\u3080\u5168\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u51FA\u3057\u307E\u3059\u3002
35
+ --output table / text / tsv \u306F\u8981\u7D04\u5217\uFF08${CONTRACT_COLUMNS.join(" / ")} / versions\uFF1D\u7248\u306E\u6570\uFF09\u3067\u3059\u3002
36
+ \u7248\u3054\u3068\u306E\u5217\u306F ${VERSION_COLUMNS.join(" / ")} \u3067\u3059\uFF08--output json\uFF09\u3002`,flags:[CUSTOMER_FLAG],forbidden:VIEW_FORBIDDEN("\u5951\u7D04\u66F8"),async prepare(input,ctx){docId(input,"get");return prepareCustomerFlag(input,ctx,docUsage("get"))},plan:input=>({method:"GET",path:docPath(input,"get")}),summarize:body=>contractSummary(body,"\u5951\u7D04\u66F8"),raw:body=>contractOf(body,"\u5951\u7D04\u66F8")},{name:"create",summary:"PDF \u3092\u9867\u5BA2\u306E\u5951\u7D04\u66F8\u3068\u3057\u3066\u767B\u9332\u3059\u308B\uFF08\u5BB9\u91CF\u691C\u67FB\u30FB\u8EE2\u9001\u30FB\u767B\u9332\u30921\u30B3\
37
+ \u30DE\u30F3\u30C9\u3067\uFF09",usage:"twp customer contract create --customer <\u9867\u5BA2> --file <\u30D1\u30B9.pdf> --type <\u7A2E\u5225> --name <\u66F8\u985E\u540D>",description:`--customer\u30FB--file\u30FB--type\uFF08${CONTRACT_TYPE_HELP}\uFF09\u30FB--name \u304C\u5FC5\u9808\u3067\u3059\u3002
38
+
39
+ \u6B21\u306E\u9806\u306B\u9001\u308A\u307E\u3059\u3002
40
+ 0. POST /api/v2/storage/check-upload\uFF08\u30C6\u30CA\u30F3\u30C8\u306E\u5BB9\u91CF\u691C\u67FB\u3002\u8D85\u904E\u306A\u3089\u4F55\u3082\u9001\u3089\u305A\u306B\u6B62\u307E\u308A\u307E\u3059\uFF09
41
+ 1. POST \u2026/contract-documents/upload-url\uFF08\u7F72\u540DURL\u306E\u767A\u884C\uFF09
42
+ 2. \u7F72\u540DURL\u3078 PUT\uFF08PDF \u672C\u4F53\u3002TWP \u306E\u8A8D\u8A3C\u60C5\u5831\u306F\u9001\u308A\u307E\u305B\u3093\uFF09
43
+ 3. POST \u2026/contract-documents\uFF08\u66F8\u985E\u306E\u767B\u9332\u3002\u3053\u3053\u3067\u5951\u7D04\u66F8\u304C\u6210\u7ACB\u3057\u307E\u3059\uFF09
44
+ PDF \u4EE5\u5916\uFF08\u30D5\u30A1\u30A4\u30EB\u540D\u304C .pdf \u3067\u7D42\u308F\u3089\u306A\u3044\u30FB\u4E2D\u8EAB\u306E\u5148\u982D\u304C %PDF- \u3067\u306A\u3044\uFF09\u306F\u3001\u4F55\u3082\u9001\u3089\u305A\u306B\u6B62\u3081\u307E\u3059\uFF08\u30B5\u30FC\u30D0\u3082\u540C\u3058\u6761\u4EF6\u3067\u65AD\u308A\u307E\u3059\uFF09\u3002
45
+ --dry-run \u306F 1 \u306E\u30EA\u30AF\u30A8\u30B9\u30C8\u3060\u3051\u3092\u8868\u793A\u3057\u307E\u3059\uFF082 \u4EE5\u964D\u306F 1 \u306E\u5FDC\u7B54\u306B\u4F9D\u5B58\u3059\u308B\u305F\u3081\uFF09\u3002
46
+ \u9867\u5BA2\u7BA1\u7406\u306E\u6A29\u9650\u304C\u300C\u7DE8\u96C6\u8005\u300D\u4EE5\u4E0A\u3067\u3042\u308B\u3053\u3068\u304C\u8981\u308A\u307E\u3059\u3002`,flags:[CUSTOMER_FLAG,FILE_FLAG,...createFlags(CONTRACT_FIELDS)],forbidden:CONTRACT_EDIT_FORBIDDEN,async prepare(input,ctx){noArgs(input,"create",docUsage("create"));fieldBody(input,CONTRACT_FIELDS);for(const flag of["--type","--name"]){if(!input.flags.has(flag))throw new UsageError(`${flag} \u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044`,
47
+ docUsage("create"))}return preparePdf(input,ctx,"create")},plan:uploadUrlPlan,plannedNotes:input=>[`\u5B9F\u884C\u6642\u306F\u3001\u3053\u306E\u524D\u306B\u5BB9\u91CF\u691C\u67FB\uFF08POST /api/v2/storage/check-upload\uFF09\u3092\u9001\u308A\u3001\u3053\u306E\u3042\u3068\u7F72\u540DURL\u3078 ${requireResolved(input,"fileSize")} \u30D0\u30A4\u30C8\u3092 PUT \u3057\u3066\u304B\u3089\u3001POST ${companyBase(input,"contract-documents")} \u3067\u5951\u7D04\u66F8\u3092\u767B\u9332\u3057\u307E\u3059\u3002`],
48
+ execute:createContract,summarize:body=>contractSummary(body,"\u5951\u7D04\u66F8\u306E\u767B\u9332"),raw:body=>contractOf(body,"\u5951\u7D04\u66F8\u306E\u767B\u9332")},{name:"add-version",summary:"\u5951\u7D04\u66F8\u306B\u65B0\u3057\u3044\u7248\u306E PDF \u3092\u767B\u9332\u3059\u308B\uFF08\u5DEE\u66FF\u3048\u3002\u904E\u53BB\u7248\u306F\u6B8B\u308A\u307E\u3059\uFF09",usage:"twp customer contract add-version <\u66F8\u985EID> --customer <\u9867\u5BA2> --file <\u30D1\u30B9.pdf>",description:`${CONTRACT_REF_HELP}\
49
+
50
+
51
+ \u66F8\u985E\u304C\u3053\u306E\u9867\u5BA2\u306B\u3042\u308B\u3053\u3068\u3092\u78BA\u304B\u3081\u3066\u304B\u3089\u3001\u5BB9\u91CF\u691C\u67FB \u2192 \u7F72\u540DURL\u306E\u767A\u884C \u2192 PUT \u2192 POST \u2026/{\u66F8\u985EID}/versions \u306E\u9806\u306B\u9001\u308A\u307E\u3059\u3002
52
+ \u767B\u9332\u3057\u305F PDF \u304C\u73FE\u884C\u7248\u306B\u306A\u308A\u3001\u305D\u308C\u307E\u3067\u306E\u7248\u306F\u904E\u53BB\u7248\u3068\u3057\u3066\u6B8B\u308A\u307E\u3059\uFF08twp customer contract get \u306E versions\uFF09\u3002
53
+ \u5FDC\u7B54\u3067\u73FE\u884C\u7248\u306E\u756A\u53F7\u304C\u9032\u3093\u3060\u3053\u3068\u3092\u78BA\u304B\u3081\u3066\u304B\u3089\u6210\u529F\u3092\u540D\u4E57\u308A\u307E\u3059\u3002
54
+ PDF \u4EE5\u5916\u306F\u4F55\u3082\u9001\u3089\u305A\u306B\u6B62\u3081\u307E\u3059\u3002--dry-run \u306F\u7F72\u540DURL\u306E\u767A\u884C\u3060\u3051\u3092\u8868\u793A\u3057\u307E\u3059\u3002
55
+ \u9867\u5BA2\u7BA1\u7406\u306E\u6A29\u9650\u304C\u300C\u7DE8\u96C6\u8005\u300D\u4EE5\u4E0A\u3067\u3042\u308B\u3053\u3068\u304C\u8981\u308A\u307E\u3059\u3002`,flags:[CUSTOMER_FLAG,FILE_FLAG],forbidden:CONTRACT_EDIT_FORBIDDEN,async prepare(input,ctx){docId(input,"add-version");return preparePdf(input,ctx,"add-version")},plan:uploadUrlPlan,plannedNotes:input=>[`\u5B9F\u884C\u6642\u306F\u3001\u3053\u306E\u524D\u306B GET ${docPath(input,"add-version")}\uFF08\u66F8\u985E\u306E\u78BA\u8A8D\uFF09\u3068\u5BB9\u91CF\u691C\u67FB\u3092\u9001\u308A\u3001\u3053\u306E\u3042\u3068\u7F72\u540DURL\u3078 ${requireResolved(
56
+ input,"fileSize")} \u30D0\u30A4\u30C8\u3092 PUT \u3057\u3066\u304B\u3089\u3001POST ${docPath(input,"add-version")}/versions \u3067\u7248\u3092\u767B\u9332\u3057\u307E\u3059\u3002`],execute:addVersion,summarize:body=>contractSummary(body,"\u7248\u306E\u5DEE\u66FF\u3048"),raw:body=>contractOf(body,"\u7248\u306E\u5DEE\u66FF\u3048")},{name:"update",summary:"\u5951\u7D04\u66F8\u306E\u66F8\u985E\u540D\u30FB\u7A2E\u5225\u3092\u5909\u66F4\u3059\u308B\uFF08PDF \u306F\u5909\u308F\u308A\u307E\u305B\u3093\uFF09",
57
+ usage:"twp customer contract update <\u66F8\u985EID> --customer <\u9867\u5BA2> [--name <\u66F8\u985E\u540D>] [--type <\u7A2E\u5225>]",description:`${CONTRACT_REF_HELP}
58
+
59
+ \u6307\u5B9A\u3057\u305F\u9805\u76EE\u3060\u3051\u3092\u5909\u66F4\u3057\u307E\u3059\u3002\u5909\u66F4\u3059\u308B\u9805\u76EE\u30921\u3064\u3082\u6307\u5B9A\u3057\u306A\u3044\u3068\u30A8\u30E9\u30FC\u306B\u306A\u308A\u307E\u3059\u3002
60
+ PDF \u3092\u5DEE\u3057\u66FF\u3048\u308B\u306A\u3089 twp customer contract add-version \u3092\u4F7F\u3044\u307E\u3059\u3002`,flags:[CUSTOMER_FLAG,...updateFlags(CONTRACT_FIELDS)],forbidden:CONTRACT_EDIT_FORBIDDEN,async prepare(input,ctx){if(!hasAnyField(input,CONTRACT_FIELDS))throw new UsageError("\u5909\u66F4\u3059\u308B\u9805\u76EE\u30921\u3064\u4EE5\u4E0A\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044",docUsage("update"));fieldBody(input,CONTRACT_FIELDS);docId(input,"update");return prepareCustomerFlag(
61
+ input,ctx,docUsage("update"))},plan:input=>({method:"PUT",path:docPath(input,"update"),body:fieldBody(input,CONTRACT_FIELDS)}),summarize:body=>contractSummary(body,"\u5951\u7D04\u66F8\u306E\u66F4\u65B0"),raw:body=>contractOf(body,"\u5951\u7D04\u66F8\u306E\u66F4\u65B0")},{name:"delete",summary:"\u5951\u7D04\u66F8\u3092\u524A\u9664\u3059\u308B\uFF08\u5168\u7248\u3002\u9867\u5BA2\u7BA1\u7406\u306E\u7BA1\u7406\u8005\u306E\u307F\u30FB--yes \u304C\u8981\u308B\uFF09",usage:"twp customer contract delete\
62
+ <\u66F8\u985EID> --customer <\u9867\u5BA2> --yes",description:`${CONTRACT_REF_HELP}
63
+
64
+ \u66F8\u985E\u3092\u904E\u53BB\u7248\u3054\u3068\u524A\u9664\u3057\u307E\u3059\uFF08\u30B5\u30FC\u30D0\u306F\u8AD6\u7406\u524A\u9664\u3067\u3001\u4E00\u89A7\u30FB\u8A73\u7D30\u30FB\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9\u304B\u3089\u6D88\u3048\u307E\u3059\uFF09\u3002
65
+ \u9867\u5BA2\uFF08\u53D6\u5F15\u5148\uFF09\u3092\u524A\u9664\u3059\u308B\u524D\u306B\u3001\u305D\u306E\u9867\u5BA2\u306E\u5951\u7D04\u66F8\u3092\u6D88\u3059\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\uFF08\u6B8B\u3063\u3066\u3044\u308B\u3068\u30B5\u30FC\u30D0\u304C\u9867\u5BA2\u306E\u524A\u9664\u3092\u65AD\u308A\u307E\u3059\uFF09\u3002`,destructive:true,flags:[CUSTOMER_FLAG],forbidden:childForbidden("\u5951\u7D04\u66F8","delete"),async prepare(input,ctx){docId(input,"delete");return prepareCustomerFlag(
66
+ input,ctx,docUsage("delete"))},plan:input=>({method:"DELETE",path:docPath(input,"delete")}),summarize:body=>acknowledgement(body,"\u5951\u7D04\u66F8\u524A\u9664"),raw:body=>acknowledgement(body,"\u5951\u7D04\u66F8\u524A\u9664")},{name:"download",summary:"\u5951\u7D04\u66F8\u306E PDF \u3092\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9\u3057\u3066\u30D5\u30A1\u30A4\u30EB\u3078\u66F8\u304D\u51FA\u3059\uFF08\u65E2\u5B9A\u306F\u73FE\u884C\u7248\uFF09",usage:"twp customer contract download <\u66F8\u985EID> --customer <\u9867\
67
+ \u5BA2> --out <\u30D1\u30B9> [--rev <\u7248\u756A\u53F7>] [--force]",description:`${CONTRACT_REF_HELP}
68
+
69
+ \u66F8\u304D\u51FA\u3057\u5148\u306F --out \u3067\u5FC5\u305A\u6307\u5B9A\u3057\u307E\u3059\uFF08\u6A19\u6E96\u51FA\u529B\u3078\u306F\u51FA\u3057\u307E\u305B\u3093\uFF09\u3002\u65E2\u5B58\u30D5\u30A1\u30A4\u30EB\u306F --force \u304C\u7121\u3051\u308C\u3070\u4E0A\u66F8\u304D\u3057\u307E\u305B\u3093\u3002
70
+ \u904E\u53BB\u7248\u306F --rev \u3067\u7248\u756A\u53F7\u3092\u6307\u5B9A\u3057\u307E\u3059\uFF08twp customer contract get \u306E versions \u306E version_number\uFF09\u3002`,flags:[CUSTOMER_FLAG,OUT_FLAG,REV_FLAG,FORCE_FLAG],forbidden:VIEW_FORBIDDEN("\u5951\u7D04\u66F8"),download:{outFlag:OUT_FLAG.name,forceFlag:FORCE_FLAG.name},async prepare(input,ctx){docId(input,"download");revOf(input);return prepareCustomerFlag(input,ctx,docUsage("download"))},plan:input=>({method:"GET",path:`${docPath(input,
71
+ "download")}/download`,query:{version:revOf(input)}}),summarize:body=>body,raw:body=>body}]};function revOf(input,usage=docUsage("download")){const raw=input.flags.get(REV_FLAG.name);if(raw===void 0)return void 0;const value=/^\d+$/.test(raw.trim())?Number(raw.trim()):Number.NaN;if(!Number.isSafeInteger(value)||value<1)throw new UsageError(`--rev \u306F 1 \u4EE5\u4E0A\u306E\u6574\u6570\u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044: ${raw}`,usage);return value}var caseDocumentResource={name:"\
72
+ case-document",summary:"\u9867\u5BA2\u306E\u6848\u4EF6\u66F8\u985E\uFF08\u898B\u7A4D\u3092\u307E\u305F\u3044\u3060\u4E00\u89A7\u306E\u307F\uFF09",operations:[{name:"list",summary:"\u9867\u5BA2\u306E\u6848\u4EF6\u66F8\u985E\u3092\u898B\u7A4D\u3092\u307E\u305F\u3044\u3067\u4E00\u89A7\u3059\u308B",usage:"twp customer case-document list --customer <\u9867\u5BA2>",description:`\u9867\u5BA2\u306E\u3059\u3079\u3066\u306E\u898B\u7A4D\u306B\u7D10\u3065\u304F\u6848\u4EF6\u66F8\u985E\u3092\u8FD4\u3057\u307E\u3059\uFF08\u3053\u306E API \u306F\u30DA\u30FC\u30B8\u30F3\u30B0\u3092\u6301\u3061\u307E\u305B\u3093\uFF09\u3002
73
+ \u767B\u9332\u30FB\u5DEE\u66FF\u3048\u30FB\u524A\u9664\u30FB\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9\u306F\u898B\u7A4D\u3054\u3068\u306E\u64CD\u4F5C\u3067\u3001\u3053\u306E\u30B3\u30DE\u30F3\u30C9\u3067\u306F\u6271\u3044\u307E\u305B\u3093\u3002
74
+
75
+ --output json \u306F API \u304C\u8FD4\u3059\u5168\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u51FA\u3057\u307E\u3059\u3002
76
+ --output table / text / tsv \u306F\u8981\u7D04\u5217\uFF08${CASE_COLUMNS.join(" / ")}\uFF09\u3067\u3059\u3002`,flags:[CUSTOMER_FLAG],forbidden:VIEW_FORBIDDEN("\u6848\u4EF6\u66F8\u985E"),async prepare(input,ctx){noArgs(input,"list",usageOf("case-document","list"));return prepareCustomerFlag(input,ctx,usageOf("case-document","list"))},plan:input=>({method:"GET",path:companyBase(input,"case-documents")}),summarize:body=>itemsOf(body,"\u6848\u4EF6\u66F8\u985E\u4E00\u89A7").map(row=>pick(row,CASE_COLUMNS)),
77
+ raw:body=>itemsOf(body,"\u6848\u4EF6\u66F8\u985E\u4E00\u89A7")}]};var CAMPAIGNS_PATH=`${CUSTOMERS_PATH}/campaigns`;var CAMPAIGN_COLUMNS=["id","name","description","sort_order","is_active","updated_at"];var CAMPAIGN_FIELDS=[{kind:"text",flag:"--name",key:"name",label:"\u65BD\u7B56\u540D",maxChars:255,summary:"\u65BD\u7B56\u540D\uFF08create \u3067\u306F\u5FC5\u9808\uFF09"},{kind:"text",flag:"--description",key:"description",label:"\u8AAC\u660E",maxChars:1e3,summary:"\u8AAC\u660E\uFF081,000 \u6587\u5B57\u307E\u3067\uFF09"},
78
+ {kind:"integer",flag:"--sort-order",key:"sort_order",label:"\u4E26\u3073\u9806",min:0,summary:"\u4E26\u3073\u9806\uFF080 \u4EE5\u4E0A\u306E\u6574\u6570\u3002\u5C0F\u3055\u3044\u307B\u3069\u5148\uFF09"},{kind:"boolean",flag:"--active",key:"is_active",summary:"\u6709\u52B9\u306B\u3059\u308B\u304B\uFF08true / false\uFF09"}];var campaignUsage=op=>usageOf("campaign",op);var campaignId=(input,op)=>singleId(input,"\u65BD\u7B56",campaignUsage(op),"twp customer campaign list \u306E id \u5217\u306E\u5024\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002");
79
+ var campaignPath=(input,op)=>`${CAMPAIGNS_PATH}/${encodeURIComponent(campaignId(input,op))}`;var CAMPAIGN_ADMIN_FORBIDDEN=levelForbidden(CUSTOMER_LICENSE,"\u65BD\u7B56\u306E\u4F5C\u6210\u30FB\u66F4\u65B0\u30FB\u524A\u9664\u306B\u306F\u9867\u5BA2\u7BA1\u7406\u306E\u6A29\u9650\u304C\u300C\u7BA1\u7406\u8005\u300D\u3067\u3042\u308B\u3053\u3068\u304C\u8981\u308A\u307E\u3059\u3002\u30C6\u30CA\u30F3\u30C8\u7BA1\u7406\u8005\u306B\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002");function campaignOf(body,what){
80
+ const data=isRecord(body)?body["data"]:void 0;if(!isRecord(body)||body["result"]!==true||!isRecord(data)||typeof data["id"]!=="string"){throw new ApiResponseError(`${what}\u306E\u5FDC\u7B54\u306B data.id \u304C\u3042\u308A\u307E\u305B\u3093\u3002\u63A5\u7D9A\u5148\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002`)}return data}var campaignResource={name:"campaign",summary:"\u65BD\u7B56\uFF08\u30AD\u30E3\u30F3\u30DA\u30FC\u30F3\uFF09\u30DE\u30B9\u30BF\u306E\u4E00\u89A7\u30FB\u8A73\u7D30\u30FB\u4F5C\u6210\u30FB\u66F4\u65B0\u30FB\u524A\u9664\uFF08\u4F5C\u6210\u30FB\u66F4\u65B0\u30FB\u524A\u9664\u306F\u7BA1\u7406\u8005\u306E\u307F\uFF09",
81
+ operations:[{name:"list",summary:"\u65BD\u7B56\u3092\u4E26\u3073\u9806\u306B\u4E00\u89A7\u3059\u308B",usage:"twp customer campaign list [--keyword <\u8A9E>] [--active true|false]",description:`\u65BD\u7B56\u3092\u4E26\u3073\u9806\uFF08sort_order\uFF09\u306E\u6607\u9806\u306B\u3001\u30C6\u30CA\u30F3\u30C8\u306E\u5168\u4EF6\u3092\u8FD4\u3057\u307E\u3059\uFF08\u3053\u306E API \u306F\u30DA\u30FC\u30B8\u30F3\u30B0\u3092\u6301\u3061\u307E\u305B\u3093\uFF09\u3002
82
+ --keyword \u306F\u65BD\u7B56\u540D\u30FB\u8AAC\u660E\u306E\u90E8\u5206\u4E00\u81F4\u3067\u3059\u3002--active \u3067\u6709\u52B9\u30FB\u7121\u52B9\u3092\u7D5E\u308A\u8FBC\u307F\u307E\u3059\u3002
83
+ \u65BD\u7B56\u306E ID \u306F\u3001\u62C5\u5F53\u8005\u30FB\u30A2\u30D7\u30ED\u30FC\u30C1\u5148\u306E\u7D5E\u308A\u8FBC\u307F\uFF08twp customer people list --campaign / twp prospect list --campaign\uFF09\u306B\u4F7F\u3044\u307E\u3059\u3002
84
+
85
+ --output json \u306F API \u304C\u8FD4\u3059\u5168\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u51FA\u3057\u307E\u3059\u3002
86
+ --output table / text / tsv \u306F\u8981\u7D04\u5217\uFF08${CAMPAIGN_COLUMNS.join(" / ")}\uFF09\u3067\u3059\u3002`,flags:[{name:"--keyword",summary:"\u65BD\u7B56\u540D\u30FB\u8AAC\u660E\u306E\u90E8\u5206\u4E00\u81F4\u3067\u7D5E\u308A\u8FBC\u3080",takesValue:true,placeholder:"<\u8A9E>"},{name:"--active",summary:"\u6709\u52B9\uFF08true\uFF09\u30FB\u7121\u52B9\uFF08false\uFF09\u3067\u7D5E\u308A\u8FBC\u3080",takesValue:true,placeholder:"<true|false>"}],forbidden:VIEW_FORBIDDEN("\u65BD\u7B56"),plan(input){
87
+ noArgs(input,"list",campaignUsage("list"));const active=input.flags.get("--active");return{method:"GET",path:CAMPAIGNS_PATH,query:{keyword:nonEmpty(input.flags,"--keyword"),is_active:active===void 0?void 0:booleanText("--active",active)?"1":"0"}}},summarize:body=>itemsOf(body,"\u65BD\u7B56\u4E00\u89A7").map(row=>pick(row,CAMPAIGN_COLUMNS)),raw:body=>itemsOf(body,"\u65BD\u7B56\u4E00\u89A7")},{name:"get",summary:"\u65BD\u7B561\u4EF6\u306E\u8A73\u7D30\u3092\u8868\u793A\u3059\u308B",usage:"twp custo\
88
+ mer campaign get <\u65BD\u7B56ID>",description:"\u65BD\u7B56\u306E ID \u306F twp customer campaign list \u306E id \u5217\u306E\u5024\u3067\u3059\u3002",flags:[],forbidden:VIEW_FORBIDDEN("\u65BD\u7B56"),plan:input=>({method:"GET",path:campaignPath(input,"get")}),summarize:body=>pick(campaignOf(body,"\u65BD\u7B56"),CAMPAIGN_COLUMNS),raw:body=>campaignOf(body,"\u65BD\u7B56")},{name:"create",summary:"\u65BD\u7B56\u3092\u4F5C\u6210\u3059\u308B\uFF08\u9867\u5BA2\u7BA1\u7406\u306E\u7BA1\u7406\u8005\u306E\u307F\uFF09",
89
+ usage:"twp customer campaign create --name <\u65BD\u7B56\u540D> [--description <\u8AAC\u660E>] [--sort-order <\u6574\u6570>] [--active true|false]",description:"--name \u304C\u5FC5\u9808\u3067\u3059\u3002\u4F5C\u6210\u3057\u305F\u65BD\u7B56\u306E ID \u304C\u8FD4\u308A\u307E\u3059\u3002",flags:createFlags(CAMPAIGN_FIELDS),forbidden:CAMPAIGN_ADMIN_FORBIDDEN,plan(input){noArgs(input,"create",campaignUsage("create"));if(!input.flags.has("--name"))throw new UsageError("--name \u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044",
90
+ campaignUsage("create"));return{method:"POST",path:CAMPAIGNS_PATH,body:fieldBody(input,CAMPAIGN_FIELDS)}},summarize:body=>pick(campaignOf(body,"\u65BD\u7B56\u306E\u4F5C\u6210"),CAMPAIGN_COLUMNS),raw:body=>campaignOf(body,"\u65BD\u7B56\u306E\u4F5C\u6210")},{name:"update",summary:"\u65BD\u7B56\u3092\u66F4\u65B0\u3059\u308B\uFF08\u9867\u5BA2\u7BA1\u7406\u306E\u7BA1\u7406\u8005\u306E\u307F\uFF09",usage:"twp customer campaign update <\u65BD\u7B56ID> [--name <\u65BD\u7B56\u540D>] [--description <\u8AAC\u660E>] [--sort-order <\u6574\u6570>] [--ac\
91
+ tive true|false]",description:"\u6307\u5B9A\u3057\u305F\u9805\u76EE\u3060\u3051\u3092\u5909\u66F4\u3057\u307E\u3059\u3002\u5909\u66F4\u3059\u308B\u9805\u76EE\u30921\u3064\u3082\u6307\u5B9A\u3057\u306A\u3044\u3068\u30A8\u30E9\u30FC\u306B\u306A\u308A\u307E\u3059\u3002",flags:updateFlags(CAMPAIGN_FIELDS),forbidden:CAMPAIGN_ADMIN_FORBIDDEN,plan(input){if(!hasAnyField(input,CAMPAIGN_FIELDS))throw new UsageError("\u5909\u66F4\u3059\u308B\u9805\u76EE\u30921\u3064\u4EE5\u4E0A\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044",
92
+ campaignUsage("update"));return{method:"PUT",path:campaignPath(input,"update"),body:fieldBody(input,CAMPAIGN_FIELDS)}},summarize:body=>pick(campaignOf(body,"\u65BD\u7B56\u306E\u66F4\u65B0"),CAMPAIGN_COLUMNS),raw:body=>campaignOf(body,"\u65BD\u7B56\u306E\u66F4\u65B0")},{name:"delete",summary:"\u65BD\u7B56\u3092\u524A\u9664\u3059\u308B\uFF08\u9867\u5BA2\u7BA1\u7406\u306E\u7BA1\u7406\u8005\u306E\u307F\u30FB--yes \u304C\u8981\u308B\uFF09",usage:"twp customer campaign delete <\u65BD\u7B56ID> --yes",description:"\
93
+ \u65BD\u7B561\u4EF6\u3092\u524A\u9664\u3057\u307E\u3059\u3002\n\u30B5\u30FC\u30D0\u306F\u62C5\u5F53\u8005\u30FB\u30A2\u30D7\u30ED\u30FC\u30C1\u5148\u304B\u3089\u306E\u53C2\u7167\u3092\u691C\u67FB\u305B\u305A\u306B\u6D88\u3057\u307E\u3059\uFF08\u305D\u308C\u3089\u306B\u4ED8\u3044\u305F\u65BD\u7B56\u306E ID \u306F\u305D\u306E\u307E\u307E\u6B8B\u308A\u307E\u3059\uFF09\u3002\n\u53C2\u7167\u3092\u6B8B\u3057\u305F\u307E\u307E\u6B62\u3081\u308B\u306A\u3089\u3001\u524A\u9664\u3067\u306F\u306A\u304F twp customer campaign update <\u65BD\u7B56ID> --active false \u3067\u7121\u52B9\u306B\u3057\u307E\u3059\u3002",
94
+ destructive:true,flags:[],forbidden:CAMPAIGN_ADMIN_FORBIDDEN,plan:input=>({method:"DELETE",path:campaignPath(input,"delete")}),summarize:body=>acknowledgement(body,"\u65BD\u7B56\u524A\u9664"),raw:body=>acknowledgement(body,"\u65BD\u7B56\u524A\u9664")}]};var customerDocumentSubresources=[contractResource,caseDocumentResource,campaignResource];export{OUT_FLAG,FORCE_FLAG,REV_FLAG,singleId,uploadStaged,revOf,customerDocumentSubresources};
@@ -1,6 +1,6 @@
1
1
  import { createRequire as __twpCreateRequire } from 'node:module';
2
2
  const require = __twpCreateRequire(import.meta.url);
3
- import{isModeId,isPermissionModeId}from"./chunk-NAUH75MM.js";import{API_TOKEN,HELP_TOKEN,isDomainName}from"./chunk-O4NSYHR4.js";import{splitFlagToken}from"./chunk-QQRJLH6B.js";var BUILTIN_COMMANDS=["login","logout","whoami","update","task-loop"];var TASK_LOOP_ACTIONS=["run","status","stop","schedule","setup","charter","skill"];var VALUE_FLAGS=new Set(["-p","--print","--profile","--tenant","--mode","--permission-mode","--model","--allowed-tools","--disallowed-tools","--project","--engine","--interval","--max-cycles","--ai","--workspace","--ai-config-file","--now","--counts","--gate","--file","--out","--revision","--dir","--output","--query"]);var BOOLEAN_FLAGS=new Set(
3
+ import{isModeId,isPermissionModeId}from"./chunk-NAUH75MM.js";import{API_TOKEN,HELP_TOKEN,isDomainName}from"./chunk-UVUVEL3B.js";import{splitFlagToken}from"./chunk-QQRJLH6B.js";var BUILTIN_COMMANDS=["login","logout","whoami","update","task-loop"];var TASK_LOOP_ACTIONS=["run","status","stop","schedule","setup","charter","skill"];var VALUE_FLAGS=new Set(["-p","--print","--profile","--tenant","--mode","--permission-mode","--model","--allowed-tools","--disallowed-tools","--project","--engine","--interval","--max-cycles","--ai","--workspace","--ai-config-file","--now","--counts","--gate","--file","--out","--revision","--dir","--output","--query"]);var BOOLEAN_FLAGS=new Set(
4
4
  ["-h","--help","-v","--version","--no-tui","--doctor","--password","--token","--no-browser","--safe","--daemon","--force-runner","--force","--drain","--yes","-y","--no-ai-config-file","--verbose","--all","--dry-run","--debug","--refresh"]);function dispatch(argv,limit=2){const tokens=[];const indexes=[];let truncated=false;for(let i=0;i<argv.length;i++){const arg=argv[i];if(arg===void 0)continue;if(arg.startsWith("-")&&arg!=="-"){const{name,value:inline}=splitFlagToken(arg);if(BOOLEAN_FLAGS.has(
5
5
  name)){if(inline!==void 0){truncated=true;break}continue}if(VALUE_FLAGS.has(name)){if(inline!==void 0)continue;const next=argv[i+1];if(next!==void 0&&(!next.startsWith("-")||next==="-"))i++;continue}truncated=true;break}if(arg===""||arg==="-")continue;if(tokens.length>=limit)break;tokens.push(arg);indexes.push(i)}return{tokens,indexes,truncated}}function isBuiltin(token){return token!==void 0&&BUILTIN_COMMANDS.includes(token)}function isTaskLoopAction(token){return token!==void 0&&TASK_LOOP_ACTIONS.
6
6
  includes(token)}function resolveRoute(result){const{tokens,indexes}=result;const[first,second]=tokens;const firstIndex=indexes[0];if(first===void 0||firstIndex===void 0)return{kind:"none",consumed:[]};const consumed=[firstIndex];const secondIndex=indexes[1];if(isBuiltin(first)){if(first==="task-loop"&&isTaskLoopAction(second)){if(secondIndex!==void 0)consumed.push(secondIndex);return{kind:"builtin",command:first,action:second,consumed}}return{kind:"builtin",command:first,...first==="task-loop"?{
@@ -1,7 +1,7 @@
1
1
  import { createRequire as __twpCreateRequire } from 'node:module';
2
2
  const require = __twpCreateRequire(import.meta.url);
3
- import{evaluateQuery}from"./chunk-GDM2QUBL.js";import{renderDocument,renderOutput}from"./chunk-FEOST3GF.js";import{redactSecretValues,redactSecrets,withDebug}from"./chunk-BUZKNZ45.js";import{loadDomain}from"./chunk-GLBQAXWC.js";import{parseOperationArgs}from"./chunk-IOGVQVGD.js";import{Resolver,requireDefaultProject}from"./chunk-ZST7XESB.js";import{ApiError,MultipartBody,TwpApiClient,appendQuery}from"./chunk-IF2K4PM5.js";import{ResolveError}from"./chunk-GMBJTG6A.js";
4
- import{GLOBAL_OPTIONS_HELP}from"./chunk-TAN5I2DP.js";import{AuthSession,NotLoggedInError,SessionExpiredError,loadCredentials}from"./chunk-XNLIEUAW.js";import{httpFetch}from"./chunk-J7QYPKVK.js";import{effectiveApiUrl,loadUserConfig,resolveConfiguredOutput,resolveProfile}from"./chunk-4VZKNEVN.js";import{HELP_TOKEN}from"./chunk-O4NSYHR4.js";import{OUTPUT_FORMATS,resolveOutputFormat}from"./chunk-K2ONOH3L.js";import{stringWidth}from"./chunk-WVS4W5FY.js";import{
3
+ import{loadDomain}from"./chunk-TLN3JSEC.js";import{evaluateQuery}from"./chunk-GDM2QUBL.js";import{renderDocument,renderOutput}from"./chunk-FEOST3GF.js";import{redactSecretValues,redactSecrets,withDebug}from"./chunk-BUZKNZ45.js";import{parseOperationArgs}from"./chunk-IOGVQVGD.js";import{Resolver,requireDefaultProject}from"./chunk-ELXDRPDV.js";import{ApiError,MultipartBody,TwpApiClient,appendQuery}from"./chunk-IF2K4PM5.js";import{ResolveError}from"./chunk-GMBJTG6A.js";
4
+ import{GLOBAL_OPTIONS_HELP}from"./chunk-I4ARX6NM.js";import{AuthSession,NotLoggedInError,SessionExpiredError,loadCredentials}from"./chunk-XNLIEUAW.js";import{httpFetch}from"./chunk-J7QYPKVK.js";import{effectiveApiUrl,loadUserConfig,resolveConfiguredOutput,resolveProfile}from"./chunk-4VZKNEVN.js";import{HELP_TOKEN}from"./chunk-UVUVEL3B.js";import{OUTPUT_FORMATS,resolveOutputFormat}from"./chunk-K2ONOH3L.js";import{stringWidth}from"./chunk-WVS4W5FY.js";import{
5
5
  stripTerminalControls}from"./chunk-NHYMHCAT.js";import{DEFAULT_MAX_ITEMS,DEFAULT_MAX_PAGES,nextPageNotes,positiveInteger,shellQuote}from"./chunk-5R4SEO3I.js";import{ApiRejectedError,ApiResponseError,EXIT_API_CLIENT,EXIT_API_SERVER,EXIT_AUTH,EXIT_FAILURE,EXIT_OK,EXIT_USAGE,NetworkError,UsageError}from"./chunk-7WSNIXTQ.js";import fs from"fs";import path from"path";var NO_REDACT_FLAG={name:"--no-redact",summary:"\u5FDC\u7B54\u306E\u4F0F\u5B57\u5316\u3092\u89E3\u9664\u3057\u3066\u751F\u306E\u5024\u3092\u51FA\u3059\uFF08\u9375\u306E\u53D7\u3051\u53D6\u308A\u7B49\uFF09",takesValue:false};var NO_REDACT_NOTICE="\u6CE8\u8A18: --no-redact \u306E\u305F\u3081\u51FA\u529B\u3092\u4F0F\u5B57\u5316\u3057\u307E\u305B\u3093\uFF08\u7AEF\u672B\u3068\u30ED\u30B0\u306B\u5E73\u6587\u3067\u6B8B\u308A\u307E\u3059\uFF09\u3002";function withCommonFlags(flags){return flags.some(flag=>flag.
6
6
  name===NO_REDACT_FLAG.name)?flags:[...flags,NO_REDACT_FLAG]}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?"":`
7
7
  \u64CD\u4F5C:
@@ -16,8 +16,8 @@ ${alignedList(subresources.map(sub=>[`${sub.name} <\u64CD\u4F5C>`,sub.summary]))
16
16
  twp ${path2} <\u64CD\u4F5C> ${HELP_TOKEN} \u305D\u306E\u64CD\u4F5C\u306E\u8A73\u3057\u3044\u30D8\u30EB\u30D7
17
17
  ${operationSection}${subSection}
18
18
  ${GLOBAL_OPTIONS_HELP}
19
- `}function renderOperationHelp(op,path2){const sections=[`twp ${path2} ${op.name} \u2014 ${op.summary}`,"","\u4F7F\u3044\u65B9:",` ${op.usage}`];if(op.description!==void 0){sections.push("",...op.description.split("\n"))}if(op.destructive===true){sections.push("","\u26A0 \u7834\u58CA\u7684\u306A\u64CD\u4F5C\u3067\u3059\u3002\u5B9F\u884C\u3059\u308B\u306B\u306F --yes \u304C\u5FC5\u8981\u3067\u3059\u3002")}const flags=withCommonFlags(op.flags);if(flags.length>0){sections.push("","\u30AA\u30D7\u30B7\u30E7\u30F3:",
20
- alignedList(flags.map(flag=>[flag.takesValue?`${flag.name} ${flag.placeholder??"<\u5024>"}`:flag.name,flag.summary])))}sections.push("",GLOBAL_OPTIONS_HELP,"");return sections.join("\n")}function renderUnknownOperation(resource,path2,attempted){const names=[...resource.operations.map(op=>op.name),...subresourcesOf(resource).map(sub=>`${sub.name} <\u64CD\u4F5C>`)].join(" / ");return attempted===void 0?`twp ${path2} \u306B\u306F\u64CD\u4F5C\u306E\u6307\u5B9A\u304C\u5FC5\u8981\u3067\u3059\uFF08${names}\
19
+ `}function renderOperationHelp(op,path2){const sections=[`twp ${path2} ${op.name} \u2014 ${op.summary}`,"","\u4F7F\u3044\u65B9:",` ${op.usage}`];if(op.description!==void 0){sections.push("",...op.description.split("\n"))}if(op.destructive===true){sections.push("",`\u26A0 ${op.confirmation??"\u7834\u58CA\u7684\u306A\u64CD\u4F5C"}\u3067\u3059\u3002\u5B9F\u884C\u3059\u308B\u306B\u306F --yes \u304C\u5FC5\u8981\u3067\u3059\u3002`)}const flags=withCommonFlags(op.flags);if(flags.length>0){sections.push(
20
+ "","\u30AA\u30D7\u30B7\u30E7\u30F3:",alignedList(flags.map(flag=>[flag.takesValue?`${flag.name} ${flag.placeholder??"<\u5024>"}`:flag.name,flag.summary])))}sections.push("",GLOBAL_OPTIONS_HELP,"");return sections.join("\n")}function renderUnknownOperation(resource,path2,attempted){const names=[...resource.operations.map(op=>op.name),...subresourcesOf(resource).map(sub=>`${sub.name} <\u64CD\u4F5C>`)].join(" / ");return attempted===void 0?`twp ${path2} \u306B\u306F\u64CD\u4F5C\u306E\u6307\u5B9A\u304C\u5FC5\u8981\u3067\u3059\uFF08${names}\
21
21
  \uFF09\u3002\u8A73\u3057\u304F\u306F twp ${path2} ${HELP_TOKEN}`:`twp ${path2} \u306B\u300C${attempted}\u300D\u3068\u3044\u3046\u64CD\u4F5C\u306F\u3042\u308A\u307E\u305B\u3093\uFF08${names}\uFF09\u3002\u8A73\u3057\u304F\u306F twp ${path2} ${HELP_TOKEN}`}var writeOut=text=>void process.stdout.write(text);var writeErr=text=>void process.stderr.write(text);function line(text){return text===""?"":text.endsWith("\n")?text:`${text}
22
22
  `}function outputValue(operation,format,body){return format==="json"?operation.raw(body):operation.summarize(body)}function requiresYes(operation,yes){return operation.destructive===true&&!yes}function exitCodeForStatus(status){if(status===401)return EXIT_AUTH;if(status===429)return EXIT_API_SERVER;if(status>=400&&status<500)return EXIT_API_CLIENT;return EXIT_API_SERVER}function exitCodeFor(err){if(err instanceof UsageError)return EXIT_USAGE;if(err instanceof NotLoggedInError||err instanceof SessionExpiredError)
23
23
  return EXIT_AUTH;if(err instanceof ApiError)return exitCodeForStatus(err.status);if(err instanceof ApiRejectedError)return EXIT_API_CLIENT;if(err instanceof ApiResponseError||err instanceof NetworkError)return EXIT_API_SERVER;if(err instanceof ResolveError){return err.status===null?EXIT_API_SERVER:exitCodeForStatus(err.status)}return EXIT_FAILURE}function safeText(text){return redactSecrets(stripTerminalControls(text))}function reportError(err,format,code,write=writeErr){const message=safeText(err instanceof
@@ -45,9 +45,9 @@ resolved);return resolved}}}async function runDomain(options){const{globals}=opt
45
45
  null){throw new UsageError(`--output \u306B\u300C${globals.output??""}\u300D\u306F\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093`,`\u6307\u5B9A\u3067\u304D\u308B\u306E\u306F ${OUTPUT_FORMATS.join(" / ")} \u3067\u3059`)}const domain=await loadDomain(options.domain);if(options.operation===HELP_TOKEN||options.help&&options.operation===void 0){const[extra,...rest2]=options.argv;if(extra===void 0){out(renderResourceHelp(domain,domain.name));return EXIT_OK}const target=domain.subresources?.find(resource2=>resource2.
46
46
  name===extra);if(target===void 0||rest2.length>0){throw new UsageError(renderUnknownOperation(domain,domain.name,extra))}out(renderResourceHelp(target,`${domain.name} ${extra}`));return EXIT_OK}const sub=domain.subresources?.find(resource2=>resource2.name===options.operation);const resource=sub??domain;const path2=sub===void 0?domain.name:`${domain.name} ${sub.name}`;const operationName=sub===void 0?options.operation:options.argv[0];const rest=sub===void 0?options.argv:options.argv.slice(1);if(sub!==
47
47
  void 0&&(operationName===HELP_TOKEN||options.help&&operationName===void 0)){out(renderResourceHelp(sub,path2));return EXIT_OK}const operation=resource.operations.find(op=>op.name===operationName);if(operation===void 0){throw new UsageError(renderUnknownOperation(resource,path2,operationName))}forbidden=operation.forbidden;rejected=operation.rejected;if(options.help||rest[0]===HELP_TOKEN){out(renderOperationHelp(operation,path2));return EXIT_OK}const input=parseOperationArgs(rest,withCommonFlags(
48
- operation.flags));const noRedact=input.flags.has("--no-redact");if(!globals.dryRun&&requiresYes(operation,globals.yes)){throw new UsageError(`twp ${path2} ${operation.name} \u306F\u7834\u58CA\u7684\u306A\u64CD\u4F5C\u3067\u3059\u3002\u5B9F\u884C\u3059\u308B\u306B\u306F --yes \u3092\u4ED8\u3051\u3066\u304F\u3060\u3055\u3044\u3002`)}const paging=resolvePaging(operation,path2,input);const downloadTarget=operation.download===void 0?void 0:resolveDownloadTarget(operation.download,path2,operation.name,
49
- input);const stored=loadCredentials(profile.name);const apiUrl=effectiveApiUrl(profile,stored?.api_url);const transport=options.fetchImpl??httpFetch;const fetchImpl=globals.debug?withDebug(transport,{write:errOut}):transport;const session=new AuthSession(profile.name,apiUrl,process.env,fetchImpl);const client=new TwpApiClient(apiUrl,session,fetchImpl,options.version);const ctx=buildPrepareContext({resolver:new Resolver(client,{profile:profile.name,refresh:globals.refresh,...profileAliases(profile.
50
- name)}),profileName:profile.name,env:process.env,cwd:process.cwd()});const prepared=operation.prepare===void 0?input:await operation.prepare(input,ctx);const plan=operation.plan(prepared);if(operation.execute!==void 0&&(operation.download!==void 0||operation.paging!==void 0||operation.fetchCached!==void 0)){throw new Error(`twp ${path2} ${operation.name}: execute \u306F download / paging / fetchCached \u3068\u540C\u6642\u306B\u5BA3\u8A00\u3067\u304D\u307E\u305B\u3093\uFF08\u914D\u7DDA\u306E\u8AA4\u308A\uFF09`)}
48
+ operation.flags));const noRedact=input.flags.has("--no-redact");if(!globals.dryRun&&requiresYes(operation,globals.yes)){throw new UsageError(`twp ${path2} ${operation.name} \u306F${operation.confirmation??"\u7834\u58CA\u7684\u306A\u64CD\u4F5C"}\u3067\u3059\u3002\u5B9F\u884C\u3059\u308B\u306B\u306F --yes \u3092\u4ED8\u3051\u3066\u304F\u3060\u3055\u3044\u3002`)}const paging=resolvePaging(operation,path2,input);const downloadTarget=operation.download===void 0?void 0:resolveDownloadTarget(operation.
49
+ download,path2,operation.name,input);const stored=loadCredentials(profile.name);const apiUrl=effectiveApiUrl(profile,stored?.api_url);const transport=options.fetchImpl??httpFetch;const fetchImpl=globals.debug?withDebug(transport,{write:errOut}):transport;const session=new AuthSession(profile.name,apiUrl,process.env,fetchImpl);const client=new TwpApiClient(apiUrl,session,fetchImpl,options.version);const ctx=buildPrepareContext({resolver:new Resolver(client,{profile:profile.name,refresh:globals.refresh,
50
+ ...profileAliases(profile.name)}),profileName:profile.name,env:process.env,cwd:process.cwd()});const prepared=operation.prepare===void 0?input:await operation.prepare(input,ctx);const plan=operation.plan(prepared);if(operation.execute!==void 0&&(operation.download!==void 0||operation.paging!==void 0||operation.fetchCached!==void 0)){throw new Error(`twp ${path2} ${operation.name}: execute \u306F download / paging / fetchCached \u3068\u540C\u6642\u306B\u5BA3\u8A00\u3067\u304D\u307E\u305B\u3093\uFF08\u914D\u7DDA\u306E\u8AA4\u308A\uFF09`)}
51
51
  if(operation.narrow!==void 0&&(operation.execute!==void 0||operation.download!==void 0||operation.fetchCached!==void 0)){throw new Error(`twp ${path2} ${operation.name}: narrow \u306F execute / download / fetchCached \u3068\u540C\u6642\u306B\u5BA3\u8A00\u3067\u304D\u307E\u305B\u3093\uFF08\u914D\u7DDA\u306E\u8AA4\u308A\uFF09`)}if(operation.invalidates!==void 0&&(operation.fetchCached!==void 0||plan.method==="GET")){throw new Error(`twp ${path2} ${operation.name}: invalidates \u306F\u66F8\u304D\u8FBC\u307F\u306E\u64CD\u4F5C\u306B\u3060\u3051\u5BA3\u8A00\u3067\u304D\u307E\u3059\uFF08\u914D\u7DDA\u306E\
52
52
  \u8AA4\u308A\uFF09`)}if(operation.fetchCached!==void 0&&(operation.download!==void 0||operation.paging!==void 0||operation.destructive===true||plan.method!=="GET")){throw new Error(`twp ${path2} ${operation.name}: fetchCached \u306F\u9001\u4FE1\u3057\u306A\u3044\u8AAD\u307F\u53D6\u308A\u5C02\u7528\u306E\u64CD\u4F5C\u306B\u3060\u3051\u5BA3\u8A00\u3067\u304D\u307E\u3059\uFF08\u914D\u7DDA\u306E\u8AA4\u308A\uFF09`)}for(const note of operation.plannedNotes?.(prepared)??[])errOut(`${safeText(note)}
53
53
  `);if(noRedact)errOut(`${NO_REDACT_NOTICE}