@tocca-systems/twp-cli 0.157.1 → 0.158.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 +6 -0
- package/README.md +11 -8
- package/command-model/_routes.json +33 -0
- package/command-model/api-key.json +2 -2
- package/command-model/budget.json +6 -4
- package/command-model/desktop-release.json +2 -1
- package/command-model/equipment-category.json +2 -2
- package/command-model/equipment-status.json +2 -2
- package/command-model/floor-map-calendar-booking.json +6 -0
- package/command-model/floor-map-calendar-status.json +2 -1
- package/command-model/floor-map.json +1 -1
- package/command-model/index.json +16 -12
- package/command-model/media-file.json +2 -2
- package/command-model/microsoft-graph-proxy-v2.json +6 -4
- package/command-model/my-training.json +2 -0
- package/command-model/ojt-plan.json +2 -1
- package/command-model/private-agent-loop.json +13 -0
- package/command-model/private-task.json +3 -2
- package/command-model/project-task.json +3 -3
- package/command-model/project.json +2 -2
- package/command-model/sales-ai-review-criterion-proposal.json +1 -1
- package/command-model/sales-ai-review-knowledge-pr.json +1 -1
- package/command-model/saved-tab.json +3 -3
- package/command-model/survey.json +2 -1
- package/command-model/system-component-master.json +9 -0
- package/command-model/task-recurrence.json +1 -1
- package/command-model/training-master.json +2 -2
- package/command-model/user-list-item-order.json +1 -0
- package/command-model/user-preferences.json +6 -0
- package/command-model/user-ui-settings.json +7 -0
- package/command-model/worker-agent.json +2 -2
- package/dist/{api-command-6HRXP2YK.js → api-command-2Z2H462U.js} +1 -1
- package/dist/{app-66NNGNL7.js → app-XP2E425N.js} +1 -1
- package/dist/budget-GNKRQFYQ.js +5 -0
- package/dist/{chunk-HS3BBJBF.js → chunk-E7TTXK27.js} +3 -3
- package/dist/{chunk-YZSPEVDK.js → chunk-N4M7KM6M.js} +1 -1
- package/dist/{chunk-3RH5KOFK.js → chunk-X6ZCO3QD.js} +62 -42
- package/dist/cli.js +10 -8
- package/dist/{commands-4S2VWF45.js → commands-Y7TV67QN.js} +1 -1
- package/dist/{github-git-BMBK7E2A.js → github-git-RJSZNVGE.js} +1 -1
- package/dist/{holiday-XJCSHCGE.js → holiday-WOGBAL7M.js} +1 -1
- package/dist/{media-7W4GOYNS.js → media-H3N6OUL3.js} +1 -1
- package/dist/{registry-DABXSURV.js → registry-HDW7TOLI.js} +1 -1
- package/dist/{run-54O7TMZE.js → run-XYRBN4AI.js} +1 -1
- package/package.json +1 -1
- package/dist/budget-QNLGIQKK.js +0 -5
|
@@ -7,10 +7,10 @@ args.length>0)throw new UsageError(`${op} \u306F\u4F4D\u7F6E\u5F15\u6570\u3092\u
|
|
|
7
7
|
if(!isRecord(data))throw new ApiResponseError(`${what}\u306E\u5FDC\u7B54\u306B data \u304C\u3042\u308A\u307E\u305B\u3093\u3002\u63A5\u7D9A\u5148\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002`);return data}function dataRows(body,what){const data=envelope(body,what)["data"];if(!Array.isArray(data)||!data.every(isRecord))throw new ApiResponseError(`${what}\u306E\u5FDC\u7B54\u306B data \u914D\u5217\u304C\u3042\u308A\u307E\u305B\u3093\u3002\u63A5\u7D9A\u5148\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002`);
|
|
8
8
|
return data}var YEAR_FLAG={name:"--year",summary:`\u5E74\u5EA6\uFF08YYYY\u30FB${YEAR_MIN}\u301C${YEAR_MAX}\u3002\u7701\u304F\u3068\u30B5\u30FC\u30D0\u306E\u4ECA\u5E74\uFF1D\u66A6\u5E74\uFF09`,takesValue:true,placeholder:"<YYYY>"};var TEMPLATE_YEAR_FLAG={name:"--year",summary:`\u305D\u306E\u5E74\u5EA6\u306B\u5728\u7C4D\u3057\u3066\u3044\u305F\u90E8\u7F72\u3092\u4E26\u3079\u308B\uFF08YYYY\u3002\u7701\u304F\u3068\u4ECA\u65E5\u6642\u70B9\u3067\u6709\u52B9\u306A\u90E8\u7F72\uFF09`,takesValue:true,placeholder:"\
|
|
9
9
|
<YYYY>"};var REQUIRED_YEAR_FLAG={name:"--year",summary:`\u5E74\u5EA6\uFF08YYYY\u30FB${YEAR_MIN}\u301C${YEAR_MAX}\u30FB\u5FC5\u9808\uFF09`,takesValue:true,placeholder:"<YYYY>"};var START_MONTH_FLAG={name:"--start-month",summary:"\u671F\u9996\u6708\uFF081\u301C12\u3002\u7701\u304F\u3068\u30C6\u30CA\u30F3\u30C8\u306E\u671F\u9996\u6708\uFF09",takesValue:true,placeholder:"<\u6708>"};var RELIABILITY_FLAG={name:"--reliability",summary:"\u58F2\u4E0A\u898B\u8FBC\u306B\u542B\u3081\u308B\u898B\u7A4D\u306E\u78BA\u5EA6\u30B3\u30FC\u30C9\uFF08\u8907\u6570\u56DE\u6307\u5B9A\u53EF\u3002\u7701\u304F\u3068\u30B5\u30FC\u30D0\u306E\u65E2\u5B9A\u3002\u9069\u7528\u3055\u308C\u305F\u78BA\u5EA6\u306F stderr \u306B\u51FA\u308B\uFF09",
|
|
10
|
-
takesValue:true,placeholder:"<\u78BA\u5EA6>",repeatable:true};var DEPARTMENT_FLAG={name:"--department",summary:"\u90E8\u7F72\uFF08\u540D\u524D\u30FB\u30B3\u30FC\u30C9\u30FBID\uFF09",takesValue:true,placeholder:"<\u90E8\u7F72>"};function fiscalYear(input,required){const raw=nonEmpty(input.flags,
|
|
11
|
-
const year=Number(value);if(!/^\d{4}$/.test(value)||year<YEAR_MIN||year>YEAR_MAX)throw new UsageError(
|
|
12
|
-
\u3044: ${raw}`);return month}function reliabilities(input){const values=repeatedValues(input,RELIABILITY_FLAG.name).map(v=>v.trim());if(values.some(v=>v===""||v.includes(",")))throw new UsageError("--reliability \u306F\u78BA\u5EA6\u30921\u3064\u305A\u3064\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\uFF08\u30AB\u30F3\u30DE\u533A\u5207\u308A\u306B\u3057\u306A\u3044\uFF09");return values.length===0?void 0:values.join(",")}function periodQuery(input,withReliability){
|
|
13
|
-
input,false),start_month:startMonth(input),...withReliability?{estimate_reliabilities:reliabilities(input)}:{}}}function periodNotes(input){const lines=[];if(!input.flags.has("--year"))lines.push("--year \u3092\u7701\u3044\u305F\u306E\u3067\u3001\u30B5\u30FC\u30D0\u306E\u4ECA\u5E74\uFF08\u66A6\u5E74\uFF09\u306E\u5E74\u5EA6\u306B\u306A\u308A\u307E\u3059\uFF08\u671F\u9996\u6708\u304C4\u6708\u306A\u3089\u30011\u301C3\u6708\u306B\u7701\u304F\u3068\u7FCC\u5E74\u5EA6\u3067\u3059\u3002\u9069\u7528\u3055\u308C\u305F\u5E74\u5EA6\u306F\u5FDC\u7B54\u306E\u5F8C\u306B\u51FA\u307E\u3059\uFF09\u3002");
|
|
10
|
+
takesValue:true,placeholder:"<\u78BA\u5EA6>",repeatable:true};var DEPARTMENT_FLAG={name:"--department",summary:"\u90E8\u7F72\uFF08\u540D\u524D\u30FB\u30B3\u30FC\u30C9\u30FBID\uFF09",takesValue:true,placeholder:"<\u90E8\u7F72>"};function fiscalYear(input,required,flag="--year"){const raw=nonEmpty(input.flags,flag);if(raw===void 0){if(required)throw new UsageError(`${flag} <YYYY> \u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\uFF08\u5BFE\u8C61\u306E\u5E74\u5EA6\uFF09`);return void 0}const value=raw.
|
|
11
|
+
trim();const year=Number(value);if(!/^\d{4}$/.test(value)||year<YEAR_MIN||year>YEAR_MAX)throw new UsageError(`${flag} \u306F ${YEAR_MIN}\u301C${YEAR_MAX} \u306E\u897F\u66A64\u6841\u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044: ${raw}`);return year}function startMonth(input){const raw=nonEmpty(input.flags,"--start-month");if(raw===void 0)return void 0;const value=raw.trim();const month=Number(value);if(!/^\d{1,2}$/.test(value)||month<1||month>12)throw new UsageError(`--start-month \u306F 1\u301C12 \
|
|
12
|
+
\u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044: ${raw}`);return month}function reliabilities(input){const values=repeatedValues(input,RELIABILITY_FLAG.name).map(v=>v.trim());if(values.some(v=>v===""||v.includes(",")))throw new UsageError("--reliability \u306F\u78BA\u5EA6\u30921\u3064\u305A\u3064\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\uFF08\u30AB\u30F3\u30DE\u533A\u5207\u308A\u306B\u3057\u306A\u3044\uFF09");return values.length===0?void 0:values.join(",")}function periodQuery(input,withReliability){
|
|
13
|
+
return{fiscal_year:fiscalYear(input,false),start_month:startMonth(input),...withReliability?{estimate_reliabilities:reliabilities(input)}:{}}}function periodNotes(input){const lines=[];if(!input.flags.has("--year"))lines.push("--year \u3092\u7701\u3044\u305F\u306E\u3067\u3001\u30B5\u30FC\u30D0\u306E\u4ECA\u5E74\uFF08\u66A6\u5E74\uFF09\u306E\u5E74\u5EA6\u306B\u306A\u308A\u307E\u3059\uFF08\u671F\u9996\u6708\u304C4\u6708\u306A\u3089\u30011\u301C3\u6708\u306B\u7701\u304F\u3068\u7FCC\u5E74\u5EA6\u3067\u3059\u3002\u9069\u7528\u3055\u308C\u305F\u5E74\u5EA6\u306F\u5FDC\u7B54\u306E\u5F8C\u306B\u51FA\u307E\u3059\uFF09\u3002");
|
|
14
14
|
return lines}function reliabilityNotes(applied,input){if(!Array.isArray(applied))return[];const used=new Set(applied.map(String));const appliedText=applied.map(String).join(", ");const requested=[...new Set(repeatedValues(input,RELIABILITY_FLAG.name).map(v=>v.trim()).map(v=>/^\d$/.test(v)?`0${v}`:v))];const dropped=requested.filter(v=>!used.has(v));if(dropped.length===0)return[`\u58F2\u4E0A\u898B\u8FBC\u306B\u542B\u3081\u305F\u78BA\u5EA6: ${appliedText}`];const allDropped=dropped.length===requested.
|
|
15
15
|
length;return[`\u26A0 \u6307\u5B9A\u3057\u305F\u78BA\u5EA6\u306E\u3046\u3061 ${dropped.join(", ")} \u306F\u4F7F\u308F\u308C\u307E\u305B\u3093\u3067\u3057\u305F\uFF08\u30B5\u30FC\u30D0\u304C\u77E5\u3089\u306A\u3044\u78BA\u5EA6\u3067\u3059\uFF09\u3002${allDropped?"\u6307\u5B9A\u304C\u3059\u3079\u3066\u4F7F\u3048\u306A\u304B\u3063\u305F\u306E\u3067\u3001\u30B5\u30FC\u30D0\u306E\u65E2\u5B9A":"\u58F2\u4E0A\u898B\u8FBC\u306B\u542B\u3081\u305F\u78BA\u5EA6"}: ${appliedText}`]}function basisNotes(data){const basis=isRecord(
|
|
16
16
|
data["basis"])?data["basis"]:{};const legacy=Array.isArray(basis["labor_legacy_share_year_months"])?basis["labor_legacy_share_year_months"].map(String):[];return legacy.length===0?[]:[`\u4EBA\u4EF6\u8CBB\u5B9F\u7E3E\u306E\u90E8\u7F72\u5225\u5185\u8A33\u304C\u65E7\u65B9\u5F0F\uFF08\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u5358\u4F4D\u306E\u6309\u5206\uFF09\u306E\u6708\u304C\u3042\u308A\u307E\u3059: ${legacy.join(", ")}\uFF08\u53CE\u652F\u5206\u6790\u306E\u6570\u5B57\u3068\u98DF\u3044\u9055\u3046\u3053\u3068\u304C\u3042\u308A\u307E\u3059\uFF09`]}
|
|
@@ -79,46 +79,66 @@ GET /api/v2/budget/targets/import-template\u3002\u90E8\u7F72\u3054\u3068\u306B1\
|
|
|
79
79
|
flags:[OUT_FLAG,FORCE_FLAG,TEMPLATE_YEAR_FLAG,START_MONTH_FLAG],download:{outFlag:OUT_FLAG.name,forceFlag:FORCE_FLAG.name},forbidden:FORBIDDEN,plan:input=>{noArgs(input,"target import-template");return{method:"GET",path:`${PATH}/targets/import-template`,query:periodQuery(input,false)}},summarize:body=>body,raw:body=>body};var targetResource={name:"target",summary:"\u5E74\u5EA6\u306E\u76EE\u6A19\uFF08\u4E00\u89A7\u30FB\u307E\u3068\u3081\u3066\u767B\u9332\u30FB\u524D\u5E74\u5EA6\u304B\u3089\u306E\u30B3\u30D4\u30FC\u30FBCSV \u306E\u53D6\u308A\u8FBC\u307F\u3068\u96DB\u5F62\uFF09",
|
|
80
80
|
operations:[targetListOperation,targetSetOperation,copyOperation,targetImportOperation,templateOperation]};var ALLOCATION_COLUMNS=["department_id","department_name","allocation_type","percentage","amount","periods","note","updated_at"];var NOTE_MAX=2e3;var PROJECT_FLAG={name:"--project",summary:"\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\uFF08\u30B3\u30FC\u30C9\u30FBID\u3002\u7701\u304F\u3068\u65E2\u5B9A\u306E\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\uFF09",takesValue:true,placeholder:"<\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8>"};
|
|
81
81
|
var SPLIT_FLAG={name:"--split",summary:"<\u90E8\u7F72>=<\u6BD4\u7387>%\uFF08\u6BD4\u7387\uFF09\u304B <\u90E8\u7F72>=<\u91D1\u984D>\uFF08\u5186\uFF09\u3002\u8907\u6570\u56DE\u6307\u5B9A\u53EF",takesValue:true,placeholder:"<\u90E8\u7F72>=<\u5024>",repeatable:true};var CLEAR_FLAG={name:"--clear",summary:"\u6309\u5206\u3092\u3059\u3079\u3066\u6D88\u3059\uFF08--split \u3068\u540C\u6642\u306B\u6307\u5B9A\u3067\u304D\u306A\u3044\uFF09",takesValue:false};var ALLOCATION_FILE_FLAG={name:"--file",summary:"\
|
|
82
|
-
\u6309\u5206\u306E JSON\uFF08\u671F\u9593 periods \u3092\u542B\u3081\u3089\u308C\u308B\u30FB--split / --clear \u3068\u540C\u6642\u306B\u6307\u5B9A\u3067\u304D\u306A\u3044\uFF09",takesValue:true,placeholder:"<JSON>"};
|
|
83
|
-
|
|
84
|
-
if(
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
if(
|
|
92
|
-
|
|
93
|
-
length
|
|
94
|
-
\uFF09`);
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
length>0)
|
|
82
|
+
\u6309\u5206\u306E JSON\uFF08\u671F\u9593 periods \u3092\u542B\u3081\u3089\u308C\u308B\u30FB--split / --clear \u3068\u540C\u6642\u306B\u6307\u5B9A\u3067\u304D\u306A\u3044\uFF09",takesValue:true,placeholder:"<JSON>"};var FISCAL_YEAR_FLAG={name:"--fiscal-year",summary:`\u4F1A\u8A08\u5E74\u5EA6\uFF08YYYY\u30FB\u671F\u9996\u6708\u306E\u5C5E\u3059\u308B\u5E74\u3002\u7701\u304F\u3068\u30B5\u30FC\u30D0\u306E\u73FE\u5728\u306E\u4F1A\u8A08\u5E74\u5EA6\u3002--year \u3067\u3082\u53EF\uFF09`,takesValue:true,
|
|
83
|
+
placeholder:"<YYYY>"};var REQUIRED_FISCAL_YEAR_FLAG={...FISCAL_YEAR_FLAG,summary:"\u4F1A\u8A08\u5E74\u5EA6\uFF08YYYY\u30FB\u671F\u9996\u6708\u306E\u5C5E\u3059\u308B\u5E74\u30FB\u5FC5\u9808\u3002--year \u3067\u3082\u53EF\uFF09"};var ALLOCATION_YEAR_ALIAS_FLAG={name:"--year",summary:"--fiscal-year \u3068\u540C\u3058",takesValue:true,placeholder:"<YYYY>"};function allocationFiscalYear(input,required){const fiscal=fiscalYear(input,false,FISCAL_YEAR_FLAG.name);const year=fiscalYear(input,false,ALLOCATION_YEAR_ALIAS_FLAG.
|
|
84
|
+
name);if(fiscal!==void 0&&year!==void 0&&fiscal!==year){throw new UsageError(`--fiscal-year\uFF08${fiscal}\uFF09\u3068 --year\uFF08${year}\uFF09\u304C\u98DF\u3044\u9055\u3063\u3066\u3044\u307E\u3059\u3002\u3069\u3061\u3089\u304B1\u3064\u306B\u3057\u3066\u304F\u3060\u3055\u3044`)}const value=fiscal??year;if(value===void 0&&required)throw new UsageError("--fiscal-year <YYYY> \u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\uFF08\u5BFE\u8C61\u306E\u4F1A\u8A08\u5E74\u5EA6\uFF09");return value}
|
|
85
|
+
function appliedFiscalYear(body){return isRecord(body)&&typeof body["fiscal_year"]==="number"?body["fiscal_year"]:void 0}var OUT_OF_YEAR_HINT="\u671F\u9593\uFF08periods\uFF09\u306F\u4F1A\u8A08\u5E74\u5EA6\u306E\u7BC4\u56F2\u306E\u6708\u3060\u3051\u3092\u6307\u5B9A\u3067\u304D\u307E\u3059\u3002\u5E74\u5EA6\u5916\u306E\u6708\u3092\u542B\u3081\u308B\u3068\u30B5\u30FC\u30D0\u304C 422 \u30671\u4EF6\u3082\u66F8\u304B\u305A\u3001\u7406\u7531\uFF08\u4F8B: \u671F\u9593\u306F\u4F1A\u8A08\u5E74\u5EA6\u306E\u7BC4\u56F2\uFF082026-02\u301C2027-01\uFF09\u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\uFF09\u3092\u51FA\u3057\u3066\u7D42\u4E86\u30B3\u30FC\u30C9 3 \u3067\u7D42\u308F\u308A\u307E\u3059\u3002\n";
|
|
86
|
+
function parseSplit(raw){const at=raw.lastIndexOf("=");const ref=at<0?"":raw.slice(0,at).trim();const valueText=at<0?"":raw.slice(at+1).trim();const bad=new UsageError(`--split \u306F <\u90E8\u7F72>=<\u6BD4\u7387>%\uFF080\u301C100\uFF09\u304B <\u90E8\u7F72>=<\u91D1\u984D>\uFF080 \u4EE5\u4E0A\u306E\u6574\u6570\u30FB\u5186\uFF09\u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044: ${raw}`,usageOf("allocation set"));if(ref==="")throw bad;if(valueText.endsWith("%")){const number=valueText.slice(0,
|
|
87
|
+
-1).trim();const value2=Number(number);if(!/^\d+(\.\d+)?$/.test(number)||value2>100)throw bad;return{ref,type:"percentage",value:value2}}const value=Number(valueText);if(!/^\d+$/.test(valueText)||value>AMOUNT_MAX)throw bad;return{ref,type:"amount",value}}function valueLabel(row){return row.allocation_type==="amount"?yen(row.amount):`${text(row.percentage)}%`}function periodsLabel(periods){if(!Array.isArray(periods))return"";return periods.filter(isRecord).map(period=>`${text(period["start_month"])}\
|
|
88
|
+
\u301C${text(period["end_month"])}: ${valueLabel(period)}${noteLabel(period["note"])}`).join(" / ")}function noteLabel(note){const flat=typeof note==="string"?note.replace(/\s+/g," ").trim():"";return flat===""?"":`\uFF08\u5099\u8003: ${flat}\uFF09`}function splitLabel(row){const periods=periodsLabel(row.periods);return periods===""?valueLabel(row):`\u671F\u9593\u3064\u304D\uFF08${periods}\u30FB\u671F\u9593\u5916\u306F\u6309\u5206\u306A\u3057\uFF09`}function hasPeriods(row){return Array.isArray(
|
|
89
|
+
row["periods"])&&row["periods"].length>0}function allocationSummary(row,columns){const picked=pick(row,columns);if("periods"in picked)picked["periods"]=periodsLabel(row["periods"]);return picked}var ALLOCATION_ROW_KEYS=new Set(["department","department_id","allocation_type","percentage","amount","periods","note"]);var ALLOCATION_READONLY_KEYS=new Set(["project_id","department_name","created_at","updated_at"]);var PERIOD_KEYS=new Set(["start_month","end_month","allocation_type","percentage","amou\
|
|
90
|
+
nt","note"]);var MONTH_PATTERN=/^\d{4}-(0[1-9]|1[0-2])$/;function allocationNote(item,at,errors){const note=item["note"];if(note===void 0||note===null||note==="")return{};if(typeof note!=="string"){errors.push(`${at}: note \u306F\u6587\u5B57\u5217\u3067\u3059`);return{}}if(note.length>NOTE_MAX){errors.push(`${at}: note \u306F ${NOTE_MAX} \u6587\u5B57\u307E\u3067\u3067\u3059\uFF08${note.length} \u6587\u5B57\uFF09`);return{}}return{note}}function allocationValue(item,at,errors){const type=item["al\
|
|
91
|
+
location_type"]??"percentage";if(type!=="percentage"&&type!=="amount"){errors.push(`${at}: allocation_type \u306F percentage \u304B amount \u3067\u3059`);return void 0}if(type==="amount"){const amount=item["amount"];if(typeof amount!=="number"||!Number.isInteger(amount)||amount<0||amount>AMOUNT_MAX){errors.push(`${at}: amount \u306F 0 \u4EE5\u4E0A\u306E\u6574\u6570\uFF08\u5186\uFF09\u3067\u3059`);return void 0}return{allocation_type:"amount",amount}}const percentage=item["percentage"];if(typeof percentage!==
|
|
92
|
+
"number"||!Number.isFinite(percentage)||percentage<0||percentage>100){errors.push(`${at}: percentage \u306F 0\u301C100 \u306E\u6570\u5024\u3067\u3059`);return void 0}return{allocation_type:"percentage",percentage}}function parseAllocationRows(raw){const list=isRecord(raw)&&Array.isArray(raw["allocations"])?raw["allocations"]:raw;if(!Array.isArray(list))return{rows:[],errors:['JSON \u306F\u6309\u5206\u306E\u914D\u5217\uFF08\u307E\u305F\u306F {"allocations": [...]}\uFF09\u306B\u3057\u3066\u304F\u3060\u3055\u3044']};
|
|
93
|
+
if(list.length===0)return{rows:[],errors:["\u6309\u5206\u304C1\u4EF6\u3082\u3042\u308A\u307E\u305B\u3093\uFF08\u6309\u5206\u3092\u3059\u3079\u3066\u6D88\u3059\u306A\u3089 --clear\uFF09"]};const rows=[];const errors=[];list.forEach((item,index)=>{const at=`${index+1} \u4EF6\u76EE`;if(!isRecord(item)){errors.push(`${at}: \u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u3067\u306F\u3042\u308A\u307E\u305B\u3093`);return}const before=errors.length;const unknown=Object.keys(item).filter(key=>!ALLOCATION_ROW_KEYS.
|
|
94
|
+
has(key)&&!ALLOCATION_READONLY_KEYS.has(key));if(unknown.length>0)errors.push(`${at}: \u4F7F\u3048\u306A\u3044\u9805\u76EE\u304C\u3042\u308A\u307E\u3059: ${unknown.join(", ")}\uFF08\u4F7F\u3048\u308B\u306E\u306F ${[...ALLOCATION_ROW_KEYS].join(" / ")}\uFF09`);const hasName=item["department"]!==void 0;const hasId=item["department_id"]!==void 0;const ref=hasName?item["department"]:item["department_id"];if(hasName===hasId)errors.push(`${at}: department\uFF08\u540D\u524D\u30FB\u30B3\u30FC\u30C9\u30FBID\uFF09\u304B department_id \u306E\u3069\u3061\u3089\u304B\u4E00\u65B9\u3092\u66F8\u3044\u3066\u304F\u3060\u3055\u3044`);else if(typeof ref!==
|
|
95
|
+
"string")errors.push(`${at}: \u90E8\u7F72\u306F\u6587\u5B57\u5217\uFF08\u540D\u524D\u30FB\u30B3\u30FC\u30C9\u30FBID\uFF09\u3067\u66F8\u3044\u3066\u304F\u3060\u3055\u3044`);else if(ref.trim()==="")errors.push(`${at}: \u90E8\u7F72\u304C\u7A7A\u3067\u3059`);const rawPeriods=item["periods"]??[];const periods=[];if(!Array.isArray(rawPeriods))errors.push(`${at}: periods \u306F\u671F\u9593\u306E\u914D\u5217\u3067\u3059\uFF08\u5168\u671F\u9593\u306A\u3089\u7701\u304F\u304B []\uFF09`);else{rawPeriods.forEach(
|
|
96
|
+
(period,j)=>{const where=`${at} \u306E periods ${j+1} \u4EF6\u76EE`;if(!isRecord(period)){errors.push(`${where}: \u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u3067\u306F\u3042\u308A\u307E\u305B\u3093`);return}const extra=Object.keys(period).filter(key=>!PERIOD_KEYS.has(key));if(extra.length>0)errors.push(`${where}: \u4F7F\u3048\u306A\u3044\u9805\u76EE\u304C\u3042\u308A\u307E\u3059: ${extra.join(", ")}\uFF08\u4F7F\u3048\u308B\u306E\u306F ${[...PERIOD_KEYS].join(" / ")}\uFF09`);const month=key=>{const v=period[key]??
|
|
97
|
+
null;if(v===null||v==="")return null;if(typeof v!=="string"||!MONTH_PATTERN.test(v)){errors.push(`${where}: ${key} \u306F YYYY-MM \u304B null \u3067\u3059\uFF08null \u306F${key==="start_month"?"\u958B\u59CB\u306E\u4E0B\u9650\u306A\u3057":"\u7D42\u4E86\u306E\u4E0A\u9650\u306A\u3057"}\uFF09`);return null}return v};const start=month("start_month");const end=month("end_month");if(start!==null&&end!==null&&start>end)errors.push(`${where}: \u7D42\u4E86\u6708\u306F\u958B\u59CB\u6708\u4EE5\u964D\u306B\u3057\u3066\u304F\u3060\u3055\u3044`);
|
|
98
|
+
const value2=allocationValue(period,where,errors);const note2=allocationNote(period,where,errors);if(value2!==void 0)periods.push({start_month:start,end_month:end,...value2,...note2})})}const rowValueGiven=item["allocation_type"]!==void 0||item["percentage"]!==void 0||item["amount"]!==void 0;const periodRow=Array.isArray(rawPeriods)&&rawPeriods.length>0;const value=!periodRow||rowValueGiven?allocationValue(item,at,errors):void 0;const note=allocationNote(item,at,errors);if(errors.length>before||
|
|
99
|
+
typeof ref!=="string")return;rows.push({ref:ref.trim(),...value??{},...periods.length>0?{periods}:{},...note})});return{rows,errors}}var UNREADABLE="unreadable";async function prepareAllocationSet(input,ctx){const usage=usageOf("allocation set");noArgs(input,"allocation set");const raws=repeatedValues(input,SPLIT_FLAG.name);const clear=input.flags.has(CLEAR_FLAG.name);const file=nonEmpty(input.flags,ALLOCATION_FILE_FLAG.name);if([clear,raws.length>0,file!==void 0].filter(Boolean).length>1)throw new UsageError(
|
|
100
|
+
"--split\u30FB--file\u30FB--clear \u306F\u3069\u308C\u304B1\u3064\u3060\u3051\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044",usage);if(!clear&&raws.length===0&&file===void 0){throw new UsageError("\u6309\u5206\u3092 --split <\u90E8\u7F72>=<\u5024> \u304B --file <JSON> \u30671\u3064\u4EE5\u4E0A\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\uFF08\u6309\u5206\u3092\u3059\u3079\u3066\u6D88\u3059\u306A\u3089 --clear\uFF09",usage)}const parsed=raws.map(parseSplit).map(({ref,type,value})=>type==="a\
|
|
101
|
+
mount"?{ref,allocation_type:"amount",amount:value}:{ref,allocation_type:"percentage",percentage:value});const errors=[];let year=allocationFiscalYear(input,false);if(file!==void 0){const raw=readSetFile(file,usage);const fileYear=isRecord(raw)&&typeof raw["fiscal_year"]==="number"?raw["fiscal_year"]:void 0;if(year!==void 0&&fileYear!==void 0&&year!==fileYear){throw new UsageError(`--fiscal-year\uFF08${year}\uFF09\u3068 --file \u306E fiscal_year\uFF08${fileYear}\uFF09\u304C\u98DF\u3044\u9055\u3063\u3066\u3044\u307E\u3059\uFF081\u4EF6\u3082\u9001\u3063\u3066\u3044\u307E\u305B\u3093\uFF09`,
|
|
102
|
+
usage)}year??=fileYear;const fromFile=parseAllocationRows(raw);errors.push(...fromFile.errors);parsed.push(...fromFile.rows)}if(errors.length>0)throw new UsageError(`--file \u306B\u8AA4\u308A\u304C\u3042\u308A\u307E\u3059\uFF081\u4EF6\u3082\u9001\u3063\u3066\u3044\u307E\u305B\u3093\uFF09:
|
|
99
103
|
${errors.map(e=>` - ${e}`).join("\n")}`,usage);const projectId=await ctx.projectId(nonEmpty(input.flags,PROJECT_FLAG.name));const splits=[];for(const{ref,...rest}of parsed){const department=await ctx.resolver.department(ref,file===void 0?SPLIT_FLAG.name:"department");if(splits.some(s=>s.department_id===department.id)){throw new UsageError(`\u540C\u3058\u90E8\u7F72\u304C2\u56DE\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u3059: ${department.name}\uFF08\u540C\u3058\u90E8\u7F72\u306E\u671F\u9593\u9055\u3044\u306F1\u884C\u306E periods \u306B\u4E26\u3079\u3066\u304F\u3060\u3055\u3044\uFF09`,
|
|
100
|
-
usage)}splits.push({department_id:department.id,...rest})}let before;try{
|
|
101
|
-
\u306E\u6309\u5206\u304C${before===void 0?"\u6B8B\u3063\u3066\u3044\u308B\u304B\u3082\u3057\u308C\u307E\u305B\u3093":` ${before.length} \u4EF6\u3042\u308A\u307E\u3059`}\uFF09`,usage)}const names=new Map((await ctx.resolver.departments()).map(d=>[d.id,d.name]));const label=id=>names.get(String(id))??String(id);const lostPeriods=(before??[]).filter(row=>hasPeriods(row)&&!splits.
|
|
102
|
-
\u306E\u90E8\u7F72\u6309\u5206\u3092\u3059\u3079\u3066\u6D88\u3057\u307E\u3059:`:`\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8 ${projectId} \u306E\u90E8\u7F72\u6309\u5206\u3092\u5168\u4EF6\u7F6E\u304D\u63DB\u3048\u307E\u3059\uFF08\u6307\u5B9A\u3057\u306A\u304B\u3063\u305F\u90E8\u7F72\u306E\u6309\u5206\u306F\u6D88\u3048\u307E\u3059\
|
|
103
|
-
before.length===0?[" \u7F6E\u63DB\u524D: \u306A\u3057"]:before.map(row=>` \u7F6E\u63DB\u524D: ${label(row["department_id"])} ${splitLabel(row)}`),...clear?[" \u7F6E\u63DB\u5F8C: \u306A\u3057"]:splits.map(s=>` \u7F6E\
|
|
104
|
-
\u3067\u9001\u308A\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\uFF09`]:[]];if(before!==void 0&&before.length>0)notes.push(` \u7F6E\u63DB\u524D\u306E\u6309\u5206\u306F\u9001\u308B\u76F4\u524D\u306B ${allocationBackupDir()}
|
|
105
|
-
|
|
106
|
-
function
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
104
|
+
usage)}splits.push({department_id:department.id,...rest})}let before;let targetYear=year;try{const body=await ctx.resolver.salesJson(allocationListPath(projectId,year),"\u90E8\u7F72\u6309\u5206");before=dataRows(body,"\u90E8\u7F72\u6309\u5206");targetYear??=appliedFiscalYear(body)}catch(err){if(!(err instanceof ApiError&&err.status===403))throw err}if(clear&&nonEmpty(input.flags,PROJECT_FLAG.name)===void 0&&(before===void 0||before.length>0)){throw new UsageError(`--clear \u3067\u6309\u5206\u3092\u3059\u3079\u3066\u6D88\u3059\u3068\u304D\u306F --project \
|
|
105
|
+
\u3092\u660E\u793A\u3057\u3066\u304F\u3060\u3055\u3044\uFF08\u65E2\u5B9A\u306E\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8 ${projectId} \u306E\u6309\u5206\u304C${before===void 0?"\u6B8B\u3063\u3066\u3044\u308B\u304B\u3082\u3057\u308C\u307E\u305B\u3093":` ${before.length} \u4EF6\u3042\u308A\u307E\u3059`}\uFF09`,usage)}const names=new Map((await ctx.resolver.departments()).map(d=>[d.id,d.name]));const label=id=>names.get(String(id))??String(id);const lostPeriods=(before??[]).filter(row=>hasPeriods(row)&&!splits.
|
|
106
|
+
some(s=>s.department_id===String(row["department_id"])&&(s.periods?.length??0)>0));const notes=[clear?`\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8 ${projectId} \u306E${yearLabel(targetYear)}\u90E8\u7F72\u6309\u5206\u3092\u3059\u3079\u3066\u6D88\u3057\u307E\u3059\uFF08\u307B\u304B\u306E\u5E74\u5EA6\u306E\u6309\u5206\u306F\u5909\u308F\u308A\u307E\u305B\u3093\uFF09:`:`\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8 ${projectId} \u306E${yearLabel(targetYear)}\u90E8\u7F72\u6309\u5206\u3092\u5168\u4EF6\u7F6E\u304D\u63DB\u3048\u307E\u3059\uFF08\u6307\u5B9A\u3057\u306A\u304B\u3063\u305F\u90E8\u7F72\u306E\u6309\u5206\u306F\u6D88\u3048\u307E\u3059\u3002\u307B\u304B\u306E\u5E74\u5EA6\u306E\u6309\u5206\u306F\u5909\u308F\u308A\u307E\u305B\u3093\uFF09:`,
|
|
107
|
+
...before===void 0?[" \u7F6E\u63DB\u524D: \u8AAD\u3081\u307E\u305B\u3093\uFF08\u3053\u306E\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u3092\u95B2\u89A7\u3067\u304D\u306A\u3044\u305F\u3081\u3002\u65E2\u5B58\u306E\u6309\u5206\u306F\u5168\u90E8\u7F6E\u304D\u63DB\u308F\u308A\u307E\u3059\uFF09"]:before.length===0?[" \u7F6E\u63DB\u524D: \u306A\u3057"]:before.map(row=>` \u7F6E\u63DB\u524D: ${label(row["department_id"])} ${splitLabel(row)}`),...clear?[" \u7F6E\u63DB\u5F8C: \u306A\u3057"]:splits.map(s=>` \u7F6E\
|
|
108
|
+
\u63DB\u5F8C: ${label(s.department_id)} ${splitLabel(s)}`),...lostPeriods.length>0?[` \u671F\u9593\u306E\u8A2D\u5B9A\u304C\u6D88\u3048\u307E\u3059: ${lostPeriods.map(row=>label(row["department_id"])).join("\u30FB")}\uFF08\u6B8B\u3059\u306A\u3089 twp budget allocation list --output json \u306E periods \u3092 --file \u3067\u9001\u308A\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\uFF09`]:[]];if(before!==void 0&&before.length>0)notes.push(` \u7F6E\u63DB\u524D\u306E\u6309\u5206\u306F\u9001\u308B\u76F4\u524D\u306B ${allocationBackupDir()}\
|
|
109
|
+
\u3078\u9000\u907F\u3057\u307E\u3059\uFF08--dry-run \u3067\u306F\u9000\u907F\u3057\u307E\u305B\u3093\uFF09`);return withResolved(input,{projectId,body:JSON.stringify({project_id:projectId,...targetYear===void 0?{}:{fiscal_year:targetYear},allocations:splits}),notes:JSON.stringify(notes),before:before===void 0?UNREADABLE:JSON.stringify(before),fiscalYear:targetYear===void 0?UNREADABLE:String(targetYear)})}function allocationListPath(projectId,year){return`${PATH}/allocations?project_id=${encodeURIComponent(
|
|
110
|
+
projectId)}${year===void 0?"":`&fiscal_year=${year}`}`}function yearLabel(year){return year===void 0?"\u73FE\u5728\u306E\u4F1A\u8A08\u5E74\u5EA6\u306E":` ${year} \u5E74\u5EA6\u306E`}function resolvedYear(input){const raw=requireResolved(input,"fiscalYear");return raw===UNREADABLE?void 0:Number(raw)}function allocationBackupDir(env=process.env){return path.join(twpHomeDir(env),"backups","budget-allocations")}function allocationBackupRows(before){return before.map(row=>{const picked={};for(const key of[
|
|
111
|
+
...ALLOCATION_ROW_KEYS,"department_name"]){if(key==="department"||row[key]===void 0)continue;picked[key]=key==="periods"&&Array.isArray(row[key])?row[key].map(period=>isRecord(period)?Object.fromEntries(Object.entries(period).filter(([k])=>PERIOD_KEYS.has(k))):period):row[key]}return picked})}function writeAllocationBackup(projectId,before,now=new Date,env=process.env,fiscalYear2){ensureTwpHome(env);const dir=allocationBackupDir(env);fs.mkdirSync(dir,{recursive:true,mode:448});const stamp=now.toISOString().
|
|
112
|
+
replace(/[-:]/g,"").replace(".","");const file=path.join(dir,`${projectId}-${stamp}.json`);const content={project_id:projectId,...fiscalYear2===void 0?{}:{fiscal_year:fiscalYear2},saved_at:now.toISOString(),allocations:allocationBackupRows(before)};fs.writeFileSync(file,`${JSON.stringify(content,null,2)}
|
|
113
|
+
`,{mode:384,flag:"wx"});return file}function planAllocationSet(input){return{method:"POST",path:`${PATH}/allocations`,body:JSON.parse(requireResolved(input,"body"))}}function backupBeforeSend(input,ctx){const projectId=requireResolved(input,"projectId");const rawBefore=requireResolved(input,"before");const year=resolvedYear(input);const before=rawBefore===UNREADABLE?void 0:JSON.parse(rawBefore);if(before!==void 0&&before.length>0){let file;try{file=writeAllocationBackup(projectId,before,new Date,
|
|
114
|
+
process.env,year)}catch(err){throw new Error(`\u7F6E\u63DB\u524D\u306E\u6309\u5206\u3092\u9000\u907F\u3067\u304D\u306A\u304B\u3063\u305F\u305F\u3081\u9001\u308A\u307E\u305B\u3093\u3067\u3057\u305F\uFF08${err instanceof Error?err.message:String(err)}\uFF09`,{cause:err})}ctx.warn(`\u7F6E\u63DB\u524D\u306E\u6309\u5206\uFF08${before.length} \u4EF6\uFF09\u3092\u9000\u907F\u3057\u307E\u3057\u305F: ${file}`);ctx.warn(`\u5143\u306B\u623B\u3059\u306A\u3089: twp budget allocation set --project ${projectId}${year===
|
|
115
|
+
void 0?"":` --fiscal-year ${year}`} --file ${file} --yes`)}else if(before===void 0){ctx.warn("\u7F6E\u63DB\u524D\u306E\u6309\u5206\u3092\u8AAD\u3081\u306A\u304B\u3063\u305F\u305F\u3081\u9000\u907F\u3057\u3066\u3044\u307E\u305B\u3093\uFF08\u5143\u306B\u623B\u3059\u624B\u6BB5\u304C\u3042\u308A\u307E\u305B\u3093\uFF09")}}async function executeAllocationSet(input,ctx){backupBeforeSend(input,ctx);return ctx.send(planAllocationSet(input))}async function prepareAllocationCopy(input,ctx){noArgs(input,"a\
|
|
116
|
+
llocation copy-previous-year");const year=allocationFiscalYear(input,true);const projectId=await ctx.projectId(nonEmpty(input.flags,PROJECT_FLAG.name));const read=async y=>{try{return dataRows(await ctx.resolver.salesJson(allocationListPath(projectId,y),"\u90E8\u7F72\u6309\u5206"),"\u90E8\u7F72\u6309\u5206")}catch(err){if(!(err instanceof ApiError&&err.status===403))throw err;return void 0}};const before=await read(year);const source=await read(year-1);const names=new Map((await ctx.resolver.departments()).
|
|
117
|
+
map(d=>[d.id,d.name]));const label=id=>names.get(String(id))??String(id);const rows=(prefix,list)=>list===void 0?[` ${prefix}: \u8AAD\u3081\u307E\u305B\u3093\uFF08\u3053\u306E\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u3092\u95B2\u89A7\u3067\u304D\u306A\u3044\u305F\u3081\uFF09`]:list.length===0?[` ${prefix}: \u306A\u3057`]:list.map(row=>` ${prefix}: ${label(row["department_id"])} ${splitLabel(row)}`);const notes=[`\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8 ${projectId} \u306E ${year} \u5E74\u5EA6\u306E\u90E8\u7F72\u6309\u5206\u3092\u3001${year-
|
|
118
|
+
1} \u5E74\u5EA6\u306E\u6309\u5206\u3067\u7F6E\u304D\u63DB\u3048\u307E\u3059\uFF08\u671F\u9593\u306F1\u5E74\u305A\u3089\u3057\u3066\u5199\u3057\u307E\u3059\u3002\u307B\u304B\u306E\u5E74\u5EA6\u306F\u5909\u308F\u308A\u307E\u305B\u3093\uFF09:`,...rows(`${year-1} \u5E74\u5EA6\uFF08\u30B3\u30D4\u30FC\u5143\uFF09`,source),...rows(`${year} \u5E74\u5EA6\uFF08\u7F6E\u63DB\u524D\uFF09`,before),...source!==void 0&&source.length===0?[` ${year-1} \u5E74\u5EA6\u306E\u6309\u5206\u304C\u7121\u3044\u306E\u3067\u3001\u4F55\u3082\u30B3\u30D4\u30FC\u3055\u308C\u305A ${year}\
|
|
119
|
+
\u5E74\u5EA6\u306E\u6309\u5206\u3082\u305D\u306E\u307E\u307E\u3067\u3059`]:[]];const replaced=source!==void 0&&source.length===0?[]:before;if(replaced!==void 0&&replaced.length>0)notes.push(` \u7F6E\u63DB\u524D\u306E\u6309\u5206\u306F\u9001\u308B\u76F4\u524D\u306B ${allocationBackupDir()} \u3078\u9000\u907F\u3057\u307E\u3059\uFF08--dry-run \u3067\u306F\u9000\u907F\u3057\u307E\u305B\u3093\uFF09`);return withResolved(input,{projectId,body:JSON.stringify({project_id:projectId,fiscal_year:year}),notes:JSON.
|
|
120
|
+
stringify(notes),before:replaced===void 0?UNREADABLE:JSON.stringify(replaced),fiscalYear:String(year)})}function planAllocationCopy(input){return{method:"POST",path:`${PATH}/allocations/copy-previous-year`,body:JSON.parse(requireResolved(input,"body"))}}var allocationResource={name:"allocation",summary:"\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u306E\u90E8\u7F72\u6309\u5206\uFF08\u4E88\u5B9F\u306E\u90E8\u7F72\u5225\u306E\u58F2\u4E0A\u306E\u914D\u308A\u65B9\u30FB\u4F1A\u8A08\u5E74\u5EA6\u3054\u3068\u306E\u4E00\u89A7\u3068\u5168\u4EF6\u7F6E\u63DB\u30FB\u524D\u5E74\u5EA6\u30B3\u30D4\u30FC\uFF09",
|
|
121
|
+
operations:[{name:"list",summary:"\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u306E\u90E8\u7F72\u6309\u5206\u3092\u8868\u793A\u3059\u308B",usage:"twp budget allocation list [--project <\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8>] [--fiscal-year <YYYY>]",description:`GET /api/v2/budget/allocations\u3002\u6309\u5206\u304C\u7121\u3051\u308C\u3070\u7A7A\u306E\u4E00\u89A7\u3067\u3059\uFF08\u3053\u306E API \u306F\u30DA\u30FC\u30B8\u30F3\u30B0\u3092\u6301\u3061\u307E\u305B\u3093\uFF09\u3002
|
|
122
|
+
\u6309\u5206\u306F\u4F1A\u8A08\u5E74\u5EA6\u3054\u3068\u306B\u6301\u3061\u307E\u3059\uFF08TWP-9324\uFF09\u3002--fiscal-year\uFF08--year \u3067\u3082\u53EF\uFF09\u3067\u305D\u306E\u5E74\u5EA6\u306E\u6309\u5206\u3092\u51FA\u3057\u3001\u7701\u304F\u3068\u30B5\u30FC\u30D0\u306E\u73FE\u5728\u306E\u4F1A\u8A08\u5E74\u5EA6\u3067\u3059\u3002
|
|
123
|
+
\u5E74\u5EA6\u306F\u671F\u9996\u6708\uFF08\u30C6\u30CA\u30F3\u30C8\u8A2D\u5B9A\uFF09\u306E\u5C5E\u3059\u308B\u5E74\u3067\u30012\u6708\u59CB\u307E\u308A\u306A\u3089 2026 \u5E74\u5EA6\uFF1D2026-02\u301C2027-01 \u3067\u3059\u3002\u9069\u7528\u3055\u308C\u305F\u5E74\u5EA6\u306F stderr \u306B\u51FA\u307E\u3059\u3002
|
|
111
124
|
\u6309\u5206\u306F\u884C\u3054\u3068\u306B\u6BD4\u7387\uFF08percentage\u30FB%\uFF09\u304B\u91D1\u984D\uFF08amount\u30FB\u5186\uFF09\u306E\u3069\u3061\u3089\u304B\u3067\u3001\u4F7F\u308F\u306A\u3044\u5074\u306F 0 \u3067\u3059\u3002
|
|
112
125
|
\u671F\u9593\uFF08periods\uFF09\u3092\u6301\u3064\u884C\u306F\u3001\u305D\u306E\u671F\u9593\u306E\u6708\u3060\u3051\u671F\u9593\u3054\u3068\u306E\u5024\u3067\u6309\u5206\u3057\u3001\u884C\u306E\u5024\u306F\u4F7F\u3044\u307E\u305B\u3093\uFF08\u671F\u9593\u5916\u306E\u6708\u306F\u305D\u306E\u90E8\u7F72\u306B\u6309\u5206\u3057\u307E\u305B\u3093\uFF09\u3002
|
|
113
|
-
periods \u304C\u7A7A\u306E\u884C\u306F\
|
|
114
|
-
\uFF08\u958B\u59CB\u30FB\u7D42\u4E86\u306E\u7A7A\u6B04\u306F\
|
|
126
|
+
periods \u304C\u7A7A\u306E\u884C\u306F\u305D\u306E\u4F1A\u8A08\u5E74\u5EA6\u306E\u5168\u6708\u306B\u52B9\u304D\u307E\u3059\uFF08\u307B\u304B\u306E\u5E74\u5EA6\u306B\u306F\u52B9\u304D\u307E\u305B\u3093\uFF09\u3002table / text / tsv \u306E periods \u5217\u306F\u300C2026-11\u301C2027-01: 300,000 \u5186\u300D\u306E\u5F62\u3067\u3059
|
|
127
|
+
\uFF08\u958B\u59CB\u30FB\u7D42\u4E86\u306E\u7A7A\u6B04\u306F\u5E74\u5EA6\u306E\u59CB\u3081\u30FB\u7D42\u308F\u308A\u307E\u3067\uFF09\u3002--output json \u306F periods \u3092\u305D\u306E\u307E\u307E\u51FA\u3059\u306E\u3067\u3001set --file \u306B\u305D\u306E\u307E\u307E\u6E21\u305B\u307E\u3059\u3002
|
|
115
128
|
note \u306F\u90E8\u7F72\uFF08\u884C\uFF09\u306E\u5099\u8003\u3001periods \u306E\u5404\u8981\u7D20\u306E note \u306F\u671F\u9593\u306E\u5099\u8003\u3067\u3059\uFF08\u8A08\u7B97\u6839\u62E0\u306E\u81EA\u7531\u8A18\u8FF0\u30FB\u96C6\u8A08\u306B\u306F\u4F7F\u308F\u308C\u307E\u305B\u3093\u3002TWP-9323\uFF09\u3002
|
|
116
129
|
table / text / tsv \u3067\u306F\u671F\u9593\u306E\u5099\u8003\u3092 periods \u5217\u306E\u300C\uFF08\u5099\u8003: \u2026\uFF09\u300D\u306B\u51FA\u3057\u307E\u3059\u3002--output json \u306E note \u3082\u305D\u306E\u307E\u307E set --file \u306B\u6E21\u305B\u307E\u3059\u3002
|
|
117
|
-
--output table / text / tsv \u306F\u8981\u7D04\u5217\uFF08${ALLOCATION_COLUMNS.join(" / ")}\uFF09\u3067\u3059\u3002`,flags:[PROJECT_FLAG],forbidden:FORBIDDEN,async prepare(input,ctx){noArgs(input,"allocation list");return withResolved(input,{projectId:await ctx.projectId(nonEmpty(input.flags,PROJECT_FLAG.name))})},plan:input=>({method:"GET",path:`${PATH}/
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
\
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
130
|
+
--output table / text / tsv \u306F\u8981\u7D04\u5217\uFF08${ALLOCATION_COLUMNS.join(" / ")}\uFF09\u3067\u3059\u3002`,flags:[PROJECT_FLAG,FISCAL_YEAR_FLAG,ALLOCATION_YEAR_ALIAS_FLAG],forbidden:FORBIDDEN,async prepare(input,ctx){noArgs(input,"allocation list");const year=allocationFiscalYear(input,false);return withResolved(input,{projectId:await ctx.projectId(nonEmpty(input.flags,PROJECT_FLAG.name)),fiscalYear:year===void 0?UNREADABLE:String(year)})},plan:input=>({method:"GET",path:`${PATH}/alloc\
|
|
131
|
+
ations`,query:{project_id:requireResolved(input,"projectId"),fiscal_year:resolvedYear(input)}}),summarize:body=>dataRows(body,"\u90E8\u7F72\u6309\u5206").map(row=>allocationSummary(row,ALLOCATION_COLUMNS)),raw:body=>dataRows(body,"\u90E8\u7F72\u6309\u5206"),notes:body=>[...appliedFiscalYear(body)===void 0?[]:[`${appliedFiscalYear(body)} \u5E74\u5EA6\u306E\u90E8\u7F72\u6309\u5206\u3067\u3059`],...dataRows(body,"\u90E8\u7F72\u6309\u5206").length===0?["\u90E8\u7F72\u6309\u5206\u306F\u3042\u308A\u307E\u305B\u3093"]:
|
|
132
|
+
[]]},{name:"set",summary:"\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u306E\u90E8\u7F72\u6309\u5206\u3092\u5168\u4EF6\u7F6E\u304D\u63DB\u3048\u308B\uFF08\u671F\u9593\u306F --file\u30FB--clear \u3067\u5168\u90E8\u6D88\u3059\u30FB--yes \u304C\u8981\u308B\uFF09",usage:"twp budget allocation set [--project <\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8>] [--fiscal-year <YYYY>] (--split <\u90E8\u7F72>=<\u5024>... | --file <JSON> | --clear) --yes",description:'POST /api/v2/budget/allocations \u3067\u3001\u305D\u306E\u4F1A\u8A08\u5E74\u5EA6\u306E\u6309\u5206\u3092**\u5168\u4EF6\u7F6E\u304D\u63DB\u3048\u307E\u3059**\uFF08\
|
|
133
|
+
\u6307\u5B9A\u3057\u306A\u304B\u3063\u305F\u90E8\u7F72\u306E\u6309\u5206\u306F\u6D88\u3048\u307E\u3059\uFF09\u3002\n\u6309\u5206\u306F\u4F1A\u8A08\u5E74\u5EA6\u3054\u3068\u306B\u6301\u3061\u3001\u307B\u304B\u306E\u5E74\u5EA6\u306E\u6309\u5206\u306F\u5909\u308F\u308A\u307E\u305B\u3093\uFF08TWP-9324\uFF09\u3002--fiscal-year\uFF08--year \u3067\u3082\u53EF\uFF09\u3067\u5E74\u5EA6\u3092\u6307\u5B9A\u3057\u3001\n\u7701\u304F\u3068\u30B5\u30FC\u30D0\u306E\u73FE\u5728\u306E\u4F1A\u8A08\u5E74\u5EA6\u3067\u3059\uFF08\u9001\u308B\u524D\u306B\u8AAD\u3093\u3060\u5E74\u5EA6\u3092\u672C\u6587\u306B\u56FA\u5B9A\u3057\u3066\u9001\u308A\u307E\u3059\uFF09\u3002\n--split <\u90E8\u7F72>=60% \u306F\u6BD4\u7387\u3001--split <\u90E8\u7F72>=500000 \u306F\u91D1\u984D\uFF08\u5186\uFF09\u3067\u3059\u3002\u884C\u3054\u3068\u306B\u6DF7\u305C\u3089\u308C\u307E\u3059\u3002--clear \u306F\u6309\u5206\u3092\u3059\u3079\u3066\u6D88\u3057\u307E\u3059\u3002\n\u671F\u9593\uFF08periods\uFF09\u306F --file <JSON> \u3067\u6307\u5B9A\u3057\u307E\u3059\u3002JSON \u306F\u6309\u5206\u306E\u914D\u5217\uFF08{"allocations": [...]} \u3067\u3082\u53EF\uFF09\u3067\u3001\u90E8\u7F72\u306F\u540D\u524D\u30FB\u30B3\u30FC\u30C9\u30FBID \u306E\u3044\u305A\u308C\u304B\u3067\u66F8\u3051\u307E\u3059:\n [{"department": "\u958B\u767A\u90E8", "allocation_type": "percentage", "percentage": 100},\n {"department": "\u55B6\u696D\u90E8", "periods": [{"start_month": "2026-11", "end_month": "2027-01", "allocation_type":\
|
|
134
|
+
"amount", "amount": 300000}]}]\nperiods \u306F\u7701\u7565\u53EF\u3067\u3001\u7701\u304F\u3068\u305D\u306E\u4F1A\u8A08\u5E74\u5EA6\u306E\u5168\u6708\u306B\u52B9\u304D\u307E\u3059\u3002start_month / end_month \u306F YYYY-MM \u3067\u3001null \u306F\u5E74\u5EA6\u306E\u59CB\u3081\u30FB\u7D42\u308F\u308A\u307E\u3067\u3067\u3059\u3002\n'+OUT_OF_YEAR_HINT+'\u671F\u9593\u3092\u6301\u3064\u884C\u306F\u671F\u9593\u5916\u306E\u6708\u306B\u6309\u5206\u3057\u307E\u305B\u3093\u3002\u540C\u3058\u90E8\u7F72\u306E\u671F\u9593\u306F\u91CD\u306D\u3089\u308C\u307E\u305B\u3093\uFF081\u90E8\u7F721\u884C\u3067 periods \u306B\u4E26\u3079\u307E\u3059\uFF09\u3002\n\u884C\u3068 periods \u306E\u5404\u8981\u7D20\u306B note\uFF08\u5099\u8003\u30FB2000 \u6587\u5B57\u307E\u3067\u30FB\u6539\u884C\u53EF\uFF09\u3092\u66F8\u3051\u307E\u3059\u3002\u96C6\u8A08\u306B\u306F\u4F7F\u308F\u308C\u307E\u305B\u3093\u3002\u7701\u304F\u3068\u5099\u8003\u306A\u3057\u3067\u4FDD\u5B58\u3055\u308C\u307E\u3059\uFF08TWP-9323\uFF09\u3002\n**\u5168\u4EF6\u7F6E\u63DB\
|
|
135
|
+
\u306A\u306E\u3067\u3001--split / --clear \u3067\u9001\u308B\u3068\u4ECA\u3042\u308B\u671F\u9593\u306E\u8A2D\u5B9A\u3082\u6D88\u3048\u307E\u3059\u3002** \u671F\u9593\u3092\u6B8B\u3059\u306A\u3089 twp budget allocation list --output json \u306E\u7D50\u679C\u3092\n\u76F4\u3057\u3066 --file \u3067\u9001\u308A\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\uFF08project_id / department_name / created_at / updated_at \u306F\u7121\u8996\u3057\u307E\u3059\uFF09\u3002\n--file \u306E JSON \u304C {"fiscal_year": 2026, "allocations": [...]}\uFF08\u9000\u907F\u30D5\u30A1\u30A4\u30EB\u306E\u5F62\uFF09\u306A\u3089\u3001--fiscal-year \u3092\u7701\u3044\u305F\u3068\u304D\u305D\u306E\u5E74\u5EA6\u306B\u9001\u308A\u307E\u3059\uFF08\u6307\u5B9A\u3068\u98DF\u3044\u9055\u3048\u3070\u9001\u308A\u307E\u305B\u3093\uFF09\u3002\n\u6BD4\u7387\u306E\u5408\u8A08\u306F\u30B5\u30FC\u30D0\u304C\u753B\u9762\u3068\u540C\u3058\u898F\u5247\u3067\u691C\u67FB\u3057\u307E\u3059\uFF08\u6BD4\u7387\u3060\u3051\u306A\u3089\u5408\u8A08 100%\u3001\u91D1\u984D\u306E\u884C\u3092\u542B\u3080\u306A\u3089\u6BD4\u7387\u306E\u5408\u8A08\u304C 100% \u4EE5\u4E0B\u3002\u671F\u9593\u304C\u3042\u308C\u3070\u6708\u3054\u3068\uFF09\u3002\n\u9055\u53CD\u3059\u308B\u3068 422 \u30671\u4EF6\u3082\u66F8\u304B\u305A\u3001\u7406\u7531\uFF08\u4F8B: \u6309\u5206\u6BD4\u7387\u306E\u5408\u8A08\u3092100%\u306B\u3057\u3066\u304F\u3060\u3055\u3044\u3002\uFF09\u3092\u51FA\u3057\u3066\u7D42\u4E86\u30B3\u30FC\u30C9 3 \u3067\u7D42\u308F\u308A\u307E\u3059\u3002\n\u9001\u308B\u524D\u306B\u7F6E\u63DB\u524D\u3068\u7F6E\u63DB\u5F8C\u306E\u6309\u5206\u3092 stderr \u306B\u51FA\u3057\u307E\u3059\uFF08--dry-run \u3067\u3082\u51FA\u307E\u3059\uFF09\u3002\n\u7F6E\u63DB\u524D\u306E\u6309\u5206\u304C1\u4EF6\u4EE5\u4E0A\u3042\u308C\
|
|
136
|
+
\u3070\u3001\u9001\u308B\u76F4\u524D\u306B ~/.twp/backups/budget-allocations/<project_id>-<\u6642\u523B>.json \u3078\u9000\u907F\u3057\u3001\n\u623B\u3059\u30B3\u30DE\u30F3\u30C9\uFF08twp budget allocation set --project <project_id> --fiscal-year <\u5E74\u5EA6> --file <\u9000\u907F\u5148> --yes\uFF09\u3092 stderr \u306B\u51FA\u3057\u307E\u3059\uFF08--dry-run \u3067\u306F\u9000\u907F\u3057\u307E\u305B\u3093\uFF09\u3002\n--clear \u306F\u3001\u7F6E\u63DB\u524D\u306E\u6309\u5206\u304C1\u4EF6\u4EE5\u4E0A\u3042\u308B\uFF08\u307E\u305F\u306F\u8AAD\u3081\u306A\u3044\uFF09\u3068\u304D --project \u306E\u660E\u793A\u304C\u8981\u308A\u307E\u3059\uFF08\u65E2\u5B9A\u306E\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u306E\u307E\u307E\u5168\u90E8\u6D88\u3055\u306A\u3044\uFF09\u3002\n \u4F8B: twp budget allocation set --project SAMPLE --split \u958B\u767A\u90E8=60% --split \u55B6\u696D\u90E8=40% --yes\n'+
|
|
137
|
+
EDIT_HINT,destructive:true,confirmation:"\u90E8\u7F72\u6309\u5206\u3092\u5168\u4EF6\u7F6E\u304D\u63DB\u3048\u308B\u64CD\u4F5C",flags:[PROJECT_FLAG,FISCAL_YEAR_FLAG,ALLOCATION_YEAR_ALIAS_FLAG,SPLIT_FLAG,ALLOCATION_FILE_FLAG,CLEAR_FLAG],forbidden:FORBIDDEN,prepare:prepareAllocationSet,plan:planAllocationSet,execute:executeAllocationSet,plannedNotes:input=>JSON.parse(requireResolved(input,"notes")),summarize:body=>dataRows(body,"\u90E8\u7F72\u6309\u5206").map(row=>allocationSummary(row,ALLOCATION_COLUMNS.
|
|
138
|
+
filter(column=>column!=="department_name"))),raw:body=>dataRows(body,"\u90E8\u7F72\u6309\u5206"),notes:body=>[`${appliedFiscalYear(body)===void 0?"":`${appliedFiscalYear(body)} \u5E74\u5EA6\u306E`}\u90E8\u7F72\u6309\u5206\u3092 ${dataRows(body,"\u90E8\u7F72\u6309\u5206").length} \u4EF6\u306B\u3057\u307E\u3057\u305F`]},{name:"copy-previous-year",summary:"\u524D\u5E74\u5EA6\u306E\u90E8\u7F72\u6309\u5206\u3092\u305D\u306E\u4F1A\u8A08\u5E74\u5EA6\u3078\u30B3\u30D4\u30FC\u3059\u308B\uFF08\u305D\u306E\u5E74\u5EA6\u306E\u6309\u5206\u306F\u7F6E\u304D\u63DB\u308F\u308B\u30FB--yes \u304C\u8981\u308B\uFF09",
|
|
139
|
+
usage:"twp budget allocation copy-previous-year [--project <\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8>] --fiscal-year <YYYY> --yes",description:"POST /api/v2/budget/allocations/copy-previous-year \u3067\u3001--fiscal-year \u306E\u524D\u5E74\u5EA6\u306B\u52B9\u3044\u3066\u3044\u305F\u6309\u5206\u3092\u305D\u306E\u5E74\u5EA6\u3078\u5199\u3057\u307E\u3059\uFF08TWP-9324\uFF09\u3002\n**\u30B3\u30D4\u30FC\u5148\u306E\u5E74\u5EA6\u306E\u6309\u5206\u306F\u5168\u4EF6\u7F6E\u304D\u63DB\u308F\u308A\u307E\u3059\u3002** \u307B\u304B\u306E\u5E74\u5EA6\uFF08\u30B3\u30D4\u30FC\u5143\u3092\u542B\u3080\uFF09\u306F\u5909\u308F\u308A\u307E\u305B\u3093\u3002\u671F\u9593\uFF08periods\uFF09\u3068\u5099\u8003\u3082\u5199\u3057\u3001\u671F\u9593\u306E\u6708\u306F1\u5E74\u305A\u3089\u3057\u307E\u3059\u3002\n\u524D\u5E74\u5EA6\u306B\u6309\u5206\u304C\u7121\u3051\u308C\u3070\u4F55\u3082\u30B3\u30D4\u30FC\u305B\u305A\u3001\u30B3\u30D4\u30FC\u5148\u306E\u6309\u5206\u3082\u305D\u306E\u307E\u307E\u3067\u3059\uFF08copied_count \u304C 0\uFF09\u3002--fiscal-year\uFF08--year \u3067\u3082\u53EF\uFF09\u306F\u5FC5\u9808\u3067\u3059\u3002\n\u9001\u308B\u524D\u306B\u30B3\u30D4\u30FC\u5143\u3068\u30B3\u30D4\u30FC\u5148\uFF08\u7F6E\u63DB\u524D\uFF09\u306E\u6309\u5206\u3092 stderr \u306B\u51FA\u3057\u307E\u3059\uFF08--dry-run \u3067\u3082\u51FA\u307E\u3059\uFF09\u3002\u7F6E\u63DB\u524D\u304C1\u4EF6\u4EE5\u4E0A\u3042\u308C\u3070\n~/.twp/backups/budget-allocati\
|
|
140
|
+
ons/ \u3078\u9000\u907F\u3057\u3001\u623B\u3059\u30B3\u30DE\u30F3\u30C9\u3092 stderr \u306B\u51FA\u3057\u307E\u3059\uFF08--dry-run \u3067\u306F\u9000\u907F\u3057\u307E\u305B\u3093\uFF09\u3002\n\u6A29\u9650\u306F set \u3068\u540C\u3058\u3067\u3059\uFF08\u4E88\u5B9F\u306E\u7DE8\u96C6\u6A29\u9650\u304B\u3001\u305D\u306E\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u306E\u7BA1\u7406\u8005\uFF09\u3002\n \u4F8B: twp budget allocation copy-previous-year --project SAMPLE --fiscal-year 2027 --yes\n"+EDIT_HINT,destructive:true,
|
|
141
|
+
confirmation:"\u90E8\u7F72\u6309\u5206\u3092\u524D\u5E74\u5EA6\u304B\u3089\u30B3\u30D4\u30FC\u3057\u3066\u305D\u306E\u5E74\u5EA6\u306E\u6309\u5206\u3092\u7F6E\u304D\u63DB\u3048\u308B\u64CD\u4F5C",flags:[PROJECT_FLAG,REQUIRED_FISCAL_YEAR_FLAG,ALLOCATION_YEAR_ALIAS_FLAG],forbidden:FORBIDDEN,prepare:prepareAllocationCopy,plan:planAllocationCopy,async execute(input,ctx){backupBeforeSend(input,ctx);return ctx.send(planAllocationCopy(input))},plannedNotes:input=>JSON.parse(requireResolved(input,"notes")),
|
|
142
|
+
summarize:body=>dataRows(body,"\u90E8\u7F72\u6309\u5206").map(row=>allocationSummary(row,ALLOCATION_COLUMNS.filter(column=>column!=="department_name"))),raw:body=>dataRows(body,"\u90E8\u7F72\u6309\u5206"),notes:body=>{const copied=isRecord(body)&&typeof body["copied_count"]==="number"?body["copied_count"]:dataRows(body,"\u90E8\u7F72\u6309\u5206").length;const year=appliedFiscalYear(body);return[copied===0?`\u524D\u5E74\u5EA6\u306E\u90E8\u7F72\u6309\u5206\u304C\u7121\u3044\u305F\u3081\u3001\u4F55\u3082\u30B3\u30D4\u30FC\u3057\u3066\u3044\u307E\u305B\u3093${year===
|
|
143
|
+
void 0?"":`\uFF08${year} \u5E74\u5EA6\u306E\u6309\u5206\u306F\u305D\u306E\u307E\u307E\uFF09`}`:`\u524D\u5E74\u5EA6\u304B\u3089\u90E8\u7F72\u6309\u5206\u3092 ${copied} \u4EF6\u30B3\u30D4\u30FC\u3057\u307E\u3057\u305F${year===void 0?"":`\uFF08${year} \u5E74\u5EA6\uFF09`}`]}}]};var budgetDomain={name:"budget",summary:"\u4E88\u5B9F\u7BA1\u7406\uFF08\u5E74\u5EA6\u306E\u76EE\u6A19\u30FB\u30C0\u30C3\u30B7\u30E5\u30DC\u30FC\u30C9\u30FB\u30B5\u30DE\u30EA\u30FC\u30FB\u5185\u8A33\u30FBCSV \u51FA\u529B\u3001\u76EE\u6A19\u306E\u767B\u9332\u3068\u53D6\u308A\u8FBC\u307F\u3001\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u306E\u90E8\u7F72\u6309\u5206\uFF09",
|
|
144
|
+
operations:[dashboardOperation,summaryOperation,breakdownOperation,unassignedOperation,exportOperation],subresources:[targetResource,allocationResource]};export{fiscalYear,dashboardRows,breakdownRows,parseTargetRows,overwriteLines,importRejection,allocationFiscalYear,parseSplit,periodsLabel,parseAllocationRows,allocationBackupDir,allocationBackupRows,writeAllocationBackup,budgetDomain};
|
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{taskLoopHelp}from"./chunk-3AY5P4CN.js";import{GLOBAL_OPTIONS_HELP}from"./chunk-TZL2342W.js";import"./chunk-RMFLTSOV.js";import{parseArgv,quietFromEnv}from"./chunk-UHE6HW5D.js";import"./chunk-2LOT54OO.js";import"./chunk-NJL3H2BB.js";import"./chunk-F3UL5POS.js";import"./chunk-SAJP6TFS.js";import{formatUnknownArgs}from"./chunk-OKATZ4SN.js";import"./chunk-VSJBJXZO.js";var VERSION=true?"0.
|
|
4
|
+
import{taskLoopHelp}from"./chunk-3AY5P4CN.js";import{GLOBAL_OPTIONS_HELP}from"./chunk-TZL2342W.js";import"./chunk-RMFLTSOV.js";import{parseArgv,quietFromEnv}from"./chunk-UHE6HW5D.js";import"./chunk-2LOT54OO.js";import"./chunk-NJL3H2BB.js";import"./chunk-F3UL5POS.js";import"./chunk-SAJP6TFS.js";import{formatUnknownArgs}from"./chunk-OKATZ4SN.js";import"./chunk-VSJBJXZO.js";var VERSION=true?"0.158.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
|
|
@@ -616,9 +616,11 @@ import{taskLoopHelp}from"./chunk-3AY5P4CN.js";import{GLOBAL_OPTIONS_HELP}from"./
|
|
|
616
616
|
twp budget target import-template
|
|
617
617
|
\u53D6\u308A\u8FBC\u307F\u7528 CSV \u306E\u96DB\u5F62\u3092\u66F8\u304D\u51FA\u3059\uFF08--out \u5FC5\u9808\uFF09
|
|
618
618
|
twp budget allocation list
|
|
619
|
-
\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u306E\u90E8\u7F72\u6309\u5206\u3092\u8868\u793A\u3059\u308B
|
|
619
|
+
\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u306E\u90E8\u7F72\u6309\u5206\u3092\u8868\u793A\u3059\u308B\uFF08--fiscal-year \u3067\u4F1A\u8A08\u5E74\u5EA6\uFF09
|
|
620
620
|
twp budget allocation set
|
|
621
|
-
\u90E8\u7F72\u6309\u5206\u3092\u5168\u4EF6\u7F6E\u304D\u63DB\u3048\u308B\uFF08\u671F\u9593\u306F --file\u30FB--clear \u3067\u5168\u90E8\u6D88\u3059\u30FB--yes \u304C\u8981\u308B\uFF09
|
|
621
|
+
\u305D\u306E\u4F1A\u8A08\u5E74\u5EA6\u306E\u90E8\u7F72\u6309\u5206\u3092\u5168\u4EF6\u7F6E\u304D\u63DB\u3048\u308B\uFF08\u671F\u9593\u306F --file\u30FB--clear \u3067\u5168\u90E8\u6D88\u3059\u30FB--yes \u304C\u8981\u308B\uFF09
|
|
622
|
+
twp budget allocation copy-previous-year
|
|
623
|
+
\u524D\u5E74\u5EA6\u306E\u90E8\u7F72\u6309\u5206\u3092\u305D\u306E\u4F1A\u8A08\u5E74\u5EA6\u3078\u5199\u3059\uFF08\u7F6E\u304D\u63DB\u3048\u308B\u30FB--yes \u304C\u8981\u308B\uFF09
|
|
622
624
|
twp leave list \u81EA\u5206\u306E\u6709\u7D66\u306E\u53D6\u5F97\u5C65\u6B74\u3068\u6B8B\u65E5\u6570
|
|
623
625
|
twp leave grants [<\u30E6\u30FC\u30B6\u30FC>]
|
|
624
626
|
\u6709\u7D66\u306E\u4ED8\u4E0E\u5C65\u6B74\uFF08\u7701\u7565\u3067\u81EA\u5206\u30FB\u4ED6\u306E\u4EBA\u306F\u6709\u7D66\u7BA1\u7406\u306E\u6A29\u9650\u304B\u4E0A\u9577\uFF09
|
|
@@ -2003,19 +2005,19 @@ TUI \u5185:
|
|
|
2003
2005
|
\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
|
|
2004
2006
|
`;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
|
|
2005
2007
|
`);process.exit(1)}ignoreEpipe(process.stdout);ignoreEpipe(process.stderr);if(process.env["TWP_AUTO_UPDATE_WORKER"]==="1"){const{runAutoUpdateWorker}=await import("./auto-update-worker-3XBEWI2S.js");await runAutoUpdateWorker().catch(()=>void 0);return}const[first,...rest]=process.argv.slice(2);if(first==="__complete"||first==="completion"){const completion=await import("./completion-PM7YWWPC.js");if(first==="completion"){process.exitCode=completion.runCompletion(rest,process.stdout,process.stderr);return}
|
|
2006
|
-
const[{loadDomain},{loadUserConfig}]=await Promise.all([import("./registry-
|
|
2007
|
-
exitCode=await runLocalLoopCommand(rest);return}if(first==="github"&&(rest[0]==="git-credential"||rest[0]==="git-remote")){const autoUpdate2=await import("./auto-update-BMSE3HPE.js");autoUpdate2.registerRunning();const{runGithubGit}=await import("./github-git-
|
|
2008
|
+
const[{loadDomain},{loadUserConfig}]=await Promise.all([import("./registry-HDW7TOLI.js"),import("./config-GSFQMKHE.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-BMSE3HPE.js");autoUpdate2.registerRunning();const{runLocalLoopCommand}=await import("./commands-Y7TV67QN.js");process.
|
|
2009
|
+
exitCode=await runLocalLoopCommand(rest);return}if(first==="github"&&(rest[0]==="git-credential"||rest[0]==="git-remote")){const autoUpdate2=await import("./auto-update-BMSE3HPE.js");autoUpdate2.registerRunning();const{runGithubGit}=await import("./github-git-RJSZNVGE.js");process.exitCode=await runGithubGit(rest[0],rest.slice(1),{version:VERSION});return}if(first==="configure"){const autoUpdate2=await import("./auto-update-BMSE3HPE.js");autoUpdate2.registerRunning();autoUpdate2.onStartup(VERSION);
|
|
2008
2010
|
const{runConfigure}=await import("./configure-YEMITNPD.js");process.exitCode=await runConfigure(rest);return}const args=parseArgv(process.argv.slice(2));if(args.command==="version"){process.stdout.write(`${VERSION}
|
|
2009
2011
|
`);return}if(args.command==="help"){process.stdout.write(HELP);return}if(args.command==="task-loop"&&args.taskLoopHelp===true){process.stdout.write(taskLoopHelp(HELP,args.taskLoopActionExplicit===true?args.taskLoopAction:void 0));return}if(args.movedCommand!==void 0){const{MOVED_QUEUE_COMMAND_MESSAGE}=await import("./dispatch-ONKTW23I.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(
|
|
2010
2012
|
args.unknown)}
|
|
2011
2013
|
|
|
2012
|
-
${HELP}`);process.exitCode=2;return}const autoUpdate=await import("./auto-update-BMSE3HPE.js");autoUpdate.registerRunning();if(args.command==="task-loop"&&args.taskLoopAction!=="capacity"){process.env[autoUpdate.DISABLE_ENV]="1"}else if(autoUpdate.isStdinDelegatedLaunch(args.command,args.inputFormat)){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-
|
|
2013
|
-
process.exitCode=await runDomain({domain:args.domain,...args.operation!==void 0?{operation:args.operation}:{},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-
|
|
2014
|
+
${HELP}`);process.exitCode=2;return}const autoUpdate=await import("./auto-update-BMSE3HPE.js");autoUpdate.registerRunning();if(args.command==="task-loop"&&args.taskLoopAction!=="capacity"){process.env[autoUpdate.DISABLE_ENV]="1"}else if(autoUpdate.isStdinDelegatedLaunch(args.command,args.inputFormat)){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-XYRBN4AI.js");
|
|
2015
|
+
process.exitCode=await runDomain({domain:args.domain,...args.operation!==void 0?{operation:args.operation}:{},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-2Z2H462U.js");
|
|
2014
2016
|
process.exitCode=await runApiCommand({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,quiet:args.quiet||quietFromEnv(process.env)},version:VERSION});return}if(args.command==="update"){const{runUpdate}=await import("./update-IOD4ZXFF.js");process.exitCode=await runUpdate({...args.profile!==void 0?{profile:args.
|
|
2015
2017
|
profile}:{},version:VERSION});return}if(args.command==="login"||args.command==="logout"||args.command==="whoami"){const{runLogin,runLogout,runWhoami}=await import("./commands-YTWSEJPL.js");const options={profile:args.profile,method:args.loginMethod,tenant:args.tenant,noBrowser:args.loginNoBrowser,start:args.loginStart,...args.loginCode!==void 0?{code:args.loginCode}:{},...args.loginCodeFile!==void 0?{codeFile:args.loginCodeFile}:{},cliVersion:VERSION,force:args.logoutForce,...args.output!==void 0?
|
|
2016
2018
|
{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}if(args.command==="task-loop"){const{runTaskLoop}=await import("./commands-AJGBNBFE.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.
|
|
2017
2019
|
forceRunner,force:args.stopForce,drain:args.stopDrain,engine:args.engine,version:VERSION,verbose:args.verbose,scheduleNow:args.scheduleNow,scheduleCounts:args.scheduleCounts,scheduleGate:args.scheduleGate,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.
|
|
2018
2020
|
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,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.
|
|
2019
2021
|
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-NKFL7NUB.js");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.inputFormat!==void 0?
|
|
2020
|
-
{inputFormat:args.inputFormat}:{},...args.outputFormat!==void 0?{outputFormat:args.outputFormat}:{},...args.permissionPrompt!==void 0?{permissionPrompt:args.permissionPrompt}:{},...args.model!==void 0?{model:args.model}:{},...args.profile!==void 0?{profile:args.profile}:{},version:VERSION});return}const{startTui}=await import("./app-
|
|
2022
|
+
{inputFormat:args.inputFormat}:{},...args.outputFormat!==void 0?{outputFormat:args.outputFormat}:{},...args.permissionPrompt!==void 0?{permissionPrompt:args.permissionPrompt}:{},...args.model!==void 0?{model:args.model}:{},...args.profile!==void 0?{profile:args.profile}:{},version:VERSION});return}const{startTui}=await import("./app-XP2E425N.js");await startTui({mode:args.mode,permissionMode:args.permissionMode,allowedTools:args.allowedTools,disallowedTools:args.disallowedTools,model:args.
|
|
2021
2023
|
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.158.0":"0.0.0-dev"};const{validatePublicOptions}=await import("./console-public-FZ4UCSNM.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","TWP_DELEGATED_TOKEN"];function aiEnv(env){const out={...env};for(const k of STRIPPED_ENV_KEYS)delete out[k];
|
|
@@ -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-XYRBN4AI.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{parseCsvRecords}from"./chunk-ZEN45YS7.js";import{importRejection}from"./chunk-
|
|
3
|
+
import{parseCsvRecords}from"./chunk-ZEN45YS7.js";import{importRejection}from"./chunk-X6ZCO3QD.js";import{decodeCsvText}from"./chunk-OMW6BBAY.js";import"./chunk-7YYTTJSI.js";import"./chunk-7GRBFIJC.js";import"./chunk-O756DX6D.js";import"./chunk-MIGCXBCV.js";import"./chunk-YLF4S4MC.js";import"./chunk-CHT6EP5C.js";import"./chunk-V5WDGX4S.js";import"./chunk-W4NLJ2YK.js";import"./chunk-BD7O73GK.js";import"./chunk-6NHLWYI2.js";
|
|
4
4
|
import"./chunk-WGBSVOTQ.js";import{ApiError,MultipartBody}from"./chunk-3CEGTEI3.js";import"./chunk-CJFIIGSH.js";import"./chunk-HVZUXLQ4.js";import"./chunk-YJP4FUY4.js";import"./chunk-SBRTBKEZ.js";import{nonEmpty}from"./chunk-TDO6V3ZW.js";import{requireResolved,singleRef,withResolved}from"./chunk-7DCWZ2NF.js";import{acknowledgement,isRecord,pick}from"./chunk-HCTPCUST.js";import{ApiResponseError,UsageError}from"./chunk-STILP3Z6.js";import"./chunk-J7QYPKVK.js";
|
|
5
5
|
import"./chunk-YMM2AVTL.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 NAME="holiday";var LABEL="\u795D\u65E5";var READ_PATH="/api/v2/holidays";var ADMIN_PATH="/api/v2/admin/tenant/holidays";var DATE_RE=/^\d{4}-\d{2}-\d{2}$/;var YEAR_RE=/^\d{4}$/;var NAME_MAX=100;var IMPORT_MAX_BYTES=1024*1024;var SHOWN_DIFF=30;var COLUMNS=["date","name"];var IMPACT="\u795D\u65E5\u306F\u52E4\u6020\u306E\u96C6\u8A08\uFF08\u4F11\u65E5\u52B4\u50CD\u30FB\u6240\u5B9A\u65E5\u6570\uFF09\u3068\u55B6\u696D\u65E5\u6570\u306E\u8A08\u7B97\u306B\u52B9\u304D\u307E\u3059\u3002\u7DE0\u3081\u6E08\u307F\u306E\u6708\u306E\u795D\u65E5\u3092\u5909\u3048\u3066\u3082\u3001\u7DE0\u3081\u305F\u96C6\u8A08\u306F\u81EA\u52D5\u3067\u306F\u76F4\u308A\u307E\u305B\u3093\u3002";
|
|
6
6
|
var FORBIDDEN=`\u7BA1\u7406\u8005\u306E\u6A29\u9650\u304C\u5FC5\u8981\u3067\u3059\u3002${LABEL}\u306E\u4F5C\u6210\u30FB\u66F4\u65B0\u30FB\u524A\u9664\u30FBCSV \u306E\u51FA\u3057\u5165\u308C\u306F\u7BA1\u7406\u8005\u3060\u3051\u304C\u884C\u3048\u307E\u3059`;var DATE_FLAG={name:"--date",summary:"\u5BFE\u8C61\u306E\u65E5\u4ED8\uFF08\u4F4D\u7F6E\u5F15\u6570\u306E\u4EE3\u308F\u308A\u306B\u4F7F\u3048\u308B\uFF09",takesValue:true,placeholder:"<YYYY-MM-DD>"};var NAME_FLAG={name:"--name",summary:`\u795D\u65E5\u540D\uFF08${NAME_MAX}\
|
|
@@ -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-N4M7KM6M.js";import"./chunk-E7TTXK27.js";import"./chunk-PAJAEUPA.js";import"./chunk-P4QSPSOQ.js";import"./chunk-Q3B65OFC.js";import{contentTypeFor,inspectLocalFile}from"./chunk-P5GATGRB.js";import{checkUploadQuota}from"./chunk-GNSZOYBQ.js";import{parseWaitOptions,waitUntilTerminal}from"./chunk-3EFJQDC4.js";import{readBody}from"./chunk-V5WDGX4S.js";import"./chunk-W4NLJ2YK.js";import"./chunk-BD7O73GK.js";
|
|
4
4
|
import{repeatedValues}from"./chunk-6NHLWYI2.js";import"./chunk-WGBSVOTQ.js";import{ApiError}from"./chunk-3CEGTEI3.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-TDO6V3ZW.js";import{requireResolved,singleRef,withResolved}from"./chunk-7DCWZ2NF.js";
|
|
5
5
|
import{acknowledgement,isRecord,pick}from"./chunk-HCTPCUST.js";import{ApiRejectedError,ApiResponseError,NetworkError,UsageError,WaitTimeoutError}from"./chunk-STILP3Z6.js";import"./chunk-TZL2342W.js";import"./chunk-RMFLTSOV.js";import"./chunk-3WPPJAUV.js";import"./chunk-GWVREACM.js";import"./chunk-J7QYPKVK.js";import"./chunk-YMM2AVTL.js";import"./chunk-RZVI6PMW.js";import"./chunk-F3UL5POS.js";import"./chunk-OKATZ4SN.js";import"./chunk-RKBUJKI5.js";
|
|
6
6
|
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-E7TTXK27.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,PAGING_RETRY_WAIT_SECONDS,buildPrepareContext,checkOutTarget,exitCodeFor,fetchAllPages,outputValue,pagingClock,reportError,requiresYes,resolvePaging,runDomain}from"./chunk-
|
|
3
|
+
import{CURATED_PAGING_VOCABULARY,PAGING_RETRY_WAIT_SECONDS,buildPrepareContext,checkOutTarget,exitCodeFor,fetchAllPages,outputValue,pagingClock,reportError,requiresYes,resolvePaging,runDomain}from"./chunk-N4M7KM6M.js";import"./chunk-E7TTXK27.js";import"./chunk-PAJAEUPA.js";import"./chunk-P4QSPSOQ.js";import"./chunk-Q3B65OFC.js";import"./chunk-W4NLJ2YK.js";import"./chunk-BD7O73GK.js";import"./chunk-6NHLWYI2.js";import"./chunk-WGBSVOTQ.js";import"./chunk-3CEGTEI3.js";
|
|
4
4
|
import"./chunk-CJFIIGSH.js";import"./chunk-HVZUXLQ4.js";import"./chunk-YJP4FUY4.js";import"./chunk-SBRTBKEZ.js";import"./chunk-TDO6V3ZW.js";import"./chunk-HCTPCUST.js";import"./chunk-STILP3Z6.js";import"./chunk-TZL2342W.js";import"./chunk-3WPPJAUV.js";import"./chunk-GWVREACM.js";import"./chunk-J7QYPKVK.js";import"./chunk-YMM2AVTL.js";import"./chunk-RZVI6PMW.js";import"./chunk-F3UL5POS.js";import"./chunk-OKATZ4SN.js";
|
|
5
5
|
import"./chunk-RKBUJKI5.js";import"./chunk-UREA4ZIG.js";import"./chunk-NHYMHCAT.js";import"./chunk-VSJBJXZO.js";export{CURATED_PAGING_VOCABULARY,PAGING_RETRY_WAIT_SECONDS,buildPrepareContext,checkOutTarget,exitCodeFor,fetchAllPages,outputValue,pagingClock,reportError,requiresYes,resolvePaging,runDomain};
|
package/package.json
CHANGED
package/dist/budget-QNLGIQKK.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { createRequire as __twpCreateRequire } from 'node:module';
|
|
2
|
-
const require = __twpCreateRequire(import.meta.url);
|
|
3
|
-
import{allocationBackupDir,allocationBackupRows,breakdownRows,budgetDomain,dashboardRows,fiscalYear,importRejection,overwriteLines,parseAllocationRows,parseSplit,parseTargetRows,periodsLabel,writeAllocationBackup}from"./chunk-3RH5KOFK.js";import"./chunk-7YYTTJSI.js";import"./chunk-7GRBFIJC.js";import"./chunk-O756DX6D.js";import"./chunk-MIGCXBCV.js";import"./chunk-YLF4S4MC.js";import"./chunk-CHT6EP5C.js";import"./chunk-V5WDGX4S.js";import"./chunk-W4NLJ2YK.js";
|
|
4
|
-
import"./chunk-BD7O73GK.js";import"./chunk-6NHLWYI2.js";import"./chunk-WGBSVOTQ.js";import"./chunk-3CEGTEI3.js";import"./chunk-CJFIIGSH.js";import"./chunk-HVZUXLQ4.js";import"./chunk-YJP4FUY4.js";import"./chunk-SBRTBKEZ.js";import"./chunk-TDO6V3ZW.js";import"./chunk-7DCWZ2NF.js";import"./chunk-HCTPCUST.js";import"./chunk-STILP3Z6.js";import"./chunk-J7QYPKVK.js";import"./chunk-YMM2AVTL.js";import"./chunk-RZVI6PMW.js";
|
|
5
|
-
import"./chunk-OKATZ4SN.js";import"./chunk-NHYMHCAT.js";import"./chunk-VSJBJXZO.js";export{allocationBackupDir,allocationBackupRows,breakdownRows,budgetDomain,dashboardRows,fiscalYear,importRejection,overwriteLines,parseAllocationRows,parseSplit,parseTargetRows,periodsLabel,writeAllocationBackup};
|