@tocca-systems/twp-cli 0.59.0 → 0.60.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.public.md +4 -0
- package/dist/{api-command-2A6DKYCV.js → api-command-EK36OA7H.js} +1 -1
- package/dist/{app-BJJNFWE7.js → app-IBNHYZ6Q.js} +1 -1
- package/dist/{chunk-EHWPJSDJ.js → chunk-5543BC4H.js} +5 -5
- package/dist/{chunk-BNIEC3JM.js → chunk-B4O5MGOV.js} +2 -2
- package/dist/cli.js +6 -6
- package/dist/{expense-FRSJQ43Y.js → expense-M6CDGLYD.js} +34 -19
- package/dist/{media-ZTCT7ZOS.js → media-ZNQZTGNM.js} +1 -1
- package/dist/{registry-7EACQX2P.js → registry-4RF6EDQV.js} +1 -1
- package/dist/{run-WF2DJXZG.js → run-37FDHPZD.js} +1 -1
- package/package.json +1 -1
package/CHANGELOG.public.md
CHANGED
|
@@ -11,6 +11,10 @@
|
|
|
11
11
|
`CHANGELOG.md` に残してあります。顧客向けの履歴は public 公開以降を対象とします。
|
|
12
12
|
-->
|
|
13
13
|
|
|
14
|
+
## 0.60.0
|
|
15
|
+
|
|
16
|
+
通勤交通費を、出勤打刻のある日から日ごとの区分を埋めて保存できるようになりました(`twp expense commuting save --from-attendance`)。
|
|
17
|
+
|
|
14
18
|
## 0.59.0
|
|
15
19
|
|
|
16
20
|
エージェントループが、スキルの直近の実行結果を全実行機ぶん集計して計画に使うようになりました(ループ設定 `outcomes` を設定したプロジェクトのみ)。
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire as __twpCreateRequire } from 'node:module';
|
|
2
2
|
const require = __twpCreateRequire(import.meta.url);
|
|
3
|
-
import{CommandModelMissingError,MAX_REPORTED_VIOLATIONS,loadCommandModelDomain,loadCommandModelRoutes,validateBody,validateQuery}from"./chunk-NZ7WI4RZ.js";import{describeWaitResult,parseWaitOptions,waitUntilTerminal}from"./chunk-WVCEKC7V.js";import{NO_REDACT_FLAG,NO_REDACT_NOTICE,exitCodeFor,fetchAllPages,reportError}from"./chunk-
|
|
3
|
+
import{CommandModelMissingError,MAX_REPORTED_VIOLATIONS,loadCommandModelDomain,loadCommandModelRoutes,validateBody,validateQuery}from"./chunk-NZ7WI4RZ.js";import{describeWaitResult,parseWaitOptions,waitUntilTerminal}from"./chunk-WVCEKC7V.js";import{NO_REDACT_FLAG,NO_REDACT_NOTICE,exitCodeFor,fetchAllPages,reportError}from"./chunk-5543BC4H.js";import"./chunk-B4O5MGOV.js";import{evaluateQuery}from"./chunk-GFLGXGWE.js";import{renderOutput}from"./chunk-YXVN6OCH.js";
|
|
4
4
|
import{redactSecretValues,redactSecrets,withDebug}from"./chunk-UFGJSWKU.js";import"./chunk-Q3B65OFC.js";import{parseOperationArgs,repeatedValues}from"./chunk-RX5HWI4L.js";import{DEFAULT_MAX_ITEMS,DEFAULT_MAX_PAGES,envelopePaging,isPageNumberEnvelope,pageRangeNotes,positiveInteger,readEnvelopeCursor,readPageNumberCursor,shellQuote}from"./chunk-MI6HVYR2.js";import{readBody}from"./chunk-6LSQCOCJ.js";import"./chunk-VELLV6DJ.js";import"./chunk-HVZUXLQ4.js";import{
|
|
5
5
|
ApiError,TwpApiClient,appendQuery}from"./chunk-JA5A6UJ2.js";import"./chunk-QBGEYQ2I.js";import"./chunk-II5RVJQN.js";import"./chunk-3ZRMMBP5.js";import{ApiResponseError,EXIT_OK,EXIT_WAIT_TIMEOUT,NetworkError,UsageError}from"./chunk-VFPY2A23.js";import{GLOBAL_OPTIONS_HELP}from"./chunk-YLM54X35.js";import{AuthSession,NotLoggedInError,SessionExpiredError,loadCredentials}from"./chunk-XNLIEUAW.js";import{httpFetch}from"./chunk-J7QYPKVK.js";import{effectiveApiUrl,
|
|
6
6
|
resolveConfiguredOutput,resolveProfile}from"./chunk-4VZKNEVN.js";import"./chunk-RZVI6PMW.js";import{HELP_TOKEN}from"./chunk-QZBE4KC2.js";import"./chunk-QQRJLH6B.js";import{OUTPUT_FORMATS,resolveOutputFormat}from"./chunk-74BPZOKU.js";import"./chunk-UREA4ZIG.js";import{stripTerminalControls}from"./chunk-NHYMHCAT.js";import"./chunk-VSJBJXZO.js";var MIN_SEGMENT_CHARS=3;var parsedCache=new WeakMap;function splitSegments(path){return path.split("/").filter(segment=>segment!=="")}function parseRoutes(routes){const cached=parsedCache.get(routes);if(cached!==void 0)return cached;const parsed=[];for(const[key,domain]of Object.entries(routes.routes)){const space=key.indexOf(" ");if(space<=0)continue;const template=key.slice(space+1);parsed.push({method:key.slice(0,space),template,domain,segments:splitSegments(template).map(segment=>/^\{[^/{}]+\}$/.
|
|
@@ -1212,7 +1212,7 @@ cwd()){const listed=await gitListFiles(cwd2);const raw=listed??await walkFiles(c
|
|
|
1212
1212
|
1;const after=/^[^\s]*/.exec(text.slice(cursor))?.[0]??"";return{query,start,end:cursor+after.length}}var TWP_SLASH_ROUTES={"/tasks":{domain:"task",operation:"list"},"/task":{domain:"task",operation:"get"},"/projects":{domain:"project",operation:"list"}};function isTwpSlashCommand(name){return Object.hasOwn(TWP_SLASH_ROUTES,name)}async function runTwpSlashCommand(name,args,deps){const route=TWP_SLASH_ROUTES[name];if(!Object.hasOwn(TWP_SLASH_ROUTES,name)||route===void 0){return{code:2,out:"",err:`\u4E0D\u660E\u306A\u30B3\u30DE\u30F3\u30C9: ${name}
|
|
1213
1213
|
`}}const parsed=parseArgv([route.domain,route.operation,...args]);if(parsed.command!=="domain"||parsed.domain!==route.domain){return{code:2,out:"",err:`${name}: \u3053\u306E\u5F15\u6570\u306F\u4F7F\u3048\u307E\u305B\u3093\uFF08${args.join(" ")}\uFF09
|
|
1214
1214
|
`}}if(parsed.unknown.length>0){return{code:2,out:"",err:`\u4E0D\u660E\u306A\u5F15\u6570: ${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-
|
|
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-37FDHPZD.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{loadDomain}from"./chunk-
|
|
3
|
+
import{loadDomain}from"./chunk-B4O5MGOV.js";import{evaluateQuery}from"./chunk-GFLGXGWE.js";import{renderDocument,renderOutput}from"./chunk-YXVN6OCH.js";import{redactSecretValues,redactSecrets,withDebug}from"./chunk-UFGJSWKU.js";import{JsonBodyWithView}from"./chunk-Q3B65OFC.js";import{parseOperationArgs}from"./chunk-RX5HWI4L.js";import{DEFAULT_MAX_ITEMS,DEFAULT_MAX_PAGES,nextPageNotes,positiveInteger,shellQuote}from"./chunk-MI6HVYR2.js";import{Resolver,requireDefaultProject}from"./chunk-VELLV6DJ.js";
|
|
4
4
|
import{ResolveError}from"./chunk-HVZUXLQ4.js";import{ApiError,MultipartBody,TwpApiClient,appendQuery}from"./chunk-JA5A6UJ2.js";import{isRecord}from"./chunk-3ZRMMBP5.js";import{ApiRejectedError,ApiResponseError,EXIT_API_CLIENT,EXIT_API_SERVER,EXIT_AUTH,EXIT_FAILURE,EXIT_OK,EXIT_USAGE,EXIT_WAIT_TIMEOUT,NetworkError,UsageError,WaitTimeoutError}from"./chunk-VFPY2A23.js";import{GLOBAL_OPTIONS_HELP}from"./chunk-YLM54X35.js";import{AuthSession,NotLoggedInError,SessionExpiredError,
|
|
5
5
|
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-QZBE4KC2.js";import{OUTPUT_FORMATS,resolveOutputFormat}from"./chunk-74BPZOKU.js";import{stringWidth}from"./chunk-UREA4ZIG.js";import{stripTerminalControls}from"./chunk-NHYMHCAT.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?"":`
|
|
@@ -53,12 +53,12 @@ defaultOperation} \u304C\u3042\u308A\u307E\u305B\u3093`);rest=operationName===vo
|
|
|
53
53
|
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.download,path2,operation.name,input);const stored=loadCredentials(
|
|
54
54
|
profile.name);const apiUrl=effectiveApiUrl(profile,stored?.api_url);const transport=options.fetchImpl??httpFetch;const fetchImpl=globals.debug?withDebug(transport,{write:errOut,...operation.sensitiveBody!==void 0?{omitBodies:operation.sensitiveBody}:{}}):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.
|
|
55
55
|
refresh,...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`)}
|
|
56
|
-
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.preview!==void 0&&(operation.fetchCached!==void 0||operation.download!==void 0
|
|
57
|
-
\
|
|
58
|
-
|
|
56
|
+
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.preview!==void 0&&(operation.fetchCached!==void 0||operation.download!==void 0)){throw new Error(`twp ${path2} ${operation.name}: preview \u306F\u66F8\u304D\u8FBC\u307F\u306E\u64CD\u4F5C\u306B\u3060\u3051\u5BA3\u8A00\u3067\u304D\u307E\u3059\uFF08\u914D\u7DDA\u306E\
|
|
57
|
+
\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\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.
|
|
58
|
+
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)}
|
|
59
59
|
`);if(noRedact)errOut(`${NO_REDACT_NOTICE}
|
|
60
60
|
`);const executeCtx={send:next=>send(client,apiUrl,next),putSigned:(url,bytes,contentType)=>putSigned(fetchImpl,url,bytes,contentType),putRange:(url,bytes,start,total)=>putRange(fetchImpl,url,bytes,start,total),downloadSigned:async(url,target)=>{const received=await getSigned(fetchImpl,url);writeTarget(target,received.bytes);return{path:target.out,size:received.bytes.byteLength,contentType:received.contentType}},warn:text=>errOut(`${safeText(text)}
|
|
61
|
-
`)};if(operation.preview!==void 0){const checked=await operation.preview(prepared,executeCtx);for(const note of checked.notes)errOut(`${safeText(note)}
|
|
61
|
+
`)};if(operation.preview!==void 0&&plan.method!=="GET"){const checked=await operation.preview(prepared,executeCtx);for(const note of checked.notes)errOut(`${safeText(note)}
|
|
62
62
|
`);for(const warning of checked.warnings)errOut(`${safeText(`\u8B66\u544A: ${warning}`)}
|
|
63
63
|
`);if(!globals.dryRun&&checked.warnings.length>0&&!globals.yes){throw new UsageError(`twp ${path2} ${operation.name}: \u6574\u5408\u306E\u8B66\u544A\u304C ${checked.warnings.length} \u4EF6\u3042\u308B\u305F\u3081\u9001\u308A\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u5185\u5BB9\u3092\u78BA\u304B\u3081\u305F\u3046\u3048\u3067\u9001\u308B\u306A\u3089 --yes \u3092\u4ED8\u3051\u3066\u304F\u3060\u3055\u3044\u3002`)}}if(globals.dryRun){out(line(renderOutput(dryRunValue(apiUrl,plan,noRedact?void 0:operation.
|
|
64
64
|
sensitiveBody),format,noRedact)));return EXIT_OK}let body;let paged;try{if(operation.execute!==void 0){body=await operation.execute(prepared,executeCtx)}else if(operation.fetchCached!==void 0){body=await operation.fetchCached(prepared,ctx)}else if(operation.download!==void 0&&downloadTarget!==void 0){assertWritableTarget(downloadTarget,operation.download.forceFlag);const signedUrl=operation.download.signedUrl;body=await download({client,apiUrl,plan,target:downloadTarget,...signedUrl===void 0?{}:
|
|
@@ -2,8 +2,8 @@ import { createRequire as __twpCreateRequire } from 'node:module';
|
|
|
2
2
|
const require = __twpCreateRequire(import.meta.url);
|
|
3
3
|
var LOADERS={agent:async()=>(await import("./agent-VNXVD6RC.js")).agentDomain,"agent-loop":async()=>(await import("./agent-loop-DFTHXSGN.js")).agentLoopDomain,"ai-review-reason":async()=>(await import("./sales-ai-review-ISVBOO3X.js")).aiReviewReasonDomain,analysis:async()=>(await import("./analysis-QKYJFPGB.js")).analysisDomain,announcement:async()=>(await import("./announcement-VIPUV4NC.js")).announcementDomain,attendance:async()=>(await import("./attendance-correct-QYUMTKPG.js")).attendanceDomainWithRecords,
|
|
4
4
|
backlog:async()=>(await import("./backlog-XK4BUZBI.js")).backlogDomain,budget:async()=>(await import("./budget-NKSYQOBP.js")).budgetDomain,"business-place":async()=>(await import("./sales-master-EPMRXFKQ.js")).businessPlaceDomain,company:async()=>(await import("./company-MM7RMYG3.js")).companyDomain,contract:async()=>(await import("./contract-542CVLOG.js")).contractDomain,customer:async()=>(await import("./company-MM7RMYG3.js")).customerDomain,department:async()=>(await import("./department-ONWETRFN.js")).
|
|
5
|
-
departmentDomain,deposit:async()=>(await import("./deposit-Q2LJYA2P.js")).depositDomain,estimate:async()=>(await import("./estimate-QG7UDIXA.js")).estimateDomain,evaluation:async()=>(await import("./evaluation-VHYRW3OL.js")).evaluationDomain,expense:async()=>(await import("./expense-
|
|
6
|
-
invoiceDomain,"job-title":async()=>(await import("./job-title-2BITEYIJ.js")).jobTitleDomain,leave:async()=>(await import("./leave-TDXLDGQB.js")).leaveDomain,media:async()=>(await import("./media-
|
|
5
|
+
departmentDomain,deposit:async()=>(await import("./deposit-Q2LJYA2P.js")).depositDomain,estimate:async()=>(await import("./estimate-QG7UDIXA.js")).estimateDomain,evaluation:async()=>(await import("./evaluation-VHYRW3OL.js")).evaluationDomain,expense:async()=>(await import("./expense-M6CDGLYD.js")).expenseDomain,"goal-sheet":async()=>(await import("./evaluation-VHYRW3OL.js")).goalSheetDomain,inquiry:async()=>(await import("./inquiry-LPATWSTM.js")).inquiryDomain,invoice:async()=>(await import("./invoice-NMEPTMJ2.js")).
|
|
6
|
+
invoiceDomain,"job-title":async()=>(await import("./job-title-2BITEYIJ.js")).jobTitleDomain,leave:async()=>(await import("./leave-TDXLDGQB.js")).leaveDomain,media:async()=>(await import("./media-ZNQZTGNM.js")).mediaDomain,meeting:async()=>(await import("./knowledge-J5NYT7M7.js")).meetingDomain,note:async()=>(await import("./knowledge-J5NYT7M7.js")).noteDomain,notification:async()=>(await import("./notification-2YYO4OOJ.js")).notificationDomain,onedrive:async()=>(await import("./onedrive-UBSHXVYS.js")).
|
|
7
7
|
onedriveDomain,outlook:async()=>(await import("./outlook-ODZD27J5.js")).outlookDomain,payee:async()=>(await import("./sales-master-EPMRXFKQ.js")).payeeDomain,position:async()=>(await import("./position-2KKBZTPJ.js")).positionDomain,project:async()=>(await import("./project-AYQUMBJD.js")).projectDomain,prospect:async()=>(await import("./prospect-MW4URE6T.js")).prospectDomain,purchase:async()=>(await import("./purchase-IJCP43IQ.js")).purchaseDomain,qualification:async()=>(await import("./skill-OAUTVWTM.js")).
|
|
8
8
|
qualificationDomain,receivable:async()=>(await import("./receivable-PD3KXJA5.js")).receivableDomain,report:async()=>(await import("./report-3LW27YHM.js")).reportDomain,"rounding-setting":async()=>(await import("./sales-numbering-U6DSHKKM.js")).roundingSettingDomain,"seal-impression":async()=>(await import("./sales-master-EPMRXFKQ.js")).sealImpressionDomain,search:async()=>(await import("./search-LU5ELPON.js")).searchDomain,shift:async()=>(await import("./attendance-lists-JDQX4GIC.js")).shiftDomain,
|
|
9
9
|
skill:async()=>(await import("./skill-OAUTVWTM.js")).skillDomain,storage:async()=>(await import("./storage-AQDCEBDJ.js")).storageDomain,"supplier-payment":async()=>(await import("./supplier-payment-OYIOW7NR.js")).supplierPaymentDomain,support:async()=>(await import("./support-JG43SGOY.js")).supportDomain,task:async()=>(await import("./task-XY3SVQJS.js")).taskDomain,teams:async()=>(await import("./teams-5EXL65HN.js")).teamsDomain,user:async()=>(await import("./user-C2M3K236.js")).
|
package/dist/cli.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __twpCreateRequire } from 'node:module';
|
|
3
3
|
const require = __twpCreateRequire(import.meta.url);
|
|
4
|
-
import{GLOBAL_OPTIONS_HELP}from"./chunk-YLM54X35.js";import{parseArgv}from"./chunk-5BDE3A3N.js";import"./chunk-2LOT54OO.js";import"./chunk-QZBE4KC2.js";import"./chunk-QQRJLH6B.js";import"./chunk-VSJBJXZO.js";var VERSION=true?"0.
|
|
4
|
+
import{GLOBAL_OPTIONS_HELP}from"./chunk-YLM54X35.js";import{parseArgv}from"./chunk-5BDE3A3N.js";import"./chunk-2LOT54OO.js";import"./chunk-QZBE4KC2.js";import"./chunk-QQRJLH6B.js";import"./chunk-VSJBJXZO.js";var VERSION=true?"0.60.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
|
|
@@ -388,7 +388,7 @@ import{GLOBAL_OPTIONS_HELP}from"./chunk-YLM54X35.js";import{parseArgv}from"./chu
|
|
|
388
388
|
twp expense commuting attendance
|
|
389
389
|
\u6708\u306E\u81EA\u5206\u306E\u6709\u7D66\u30FB\u30EA\u30E2\u30FC\u30C8\u30FB\u52E4\u52D9\u5909\u66F4\uFF08\u533A\u5206\u3092\u6C7A\u3081\u308B\u6750\u6599\u30FB--month\uFF09
|
|
390
390
|
twp expense commuting save
|
|
391
|
-
\u6708\u306E\u65E5\u3054\u3068\u306E\u533A\u5206\u3092\u4E0B\u66F8\u304D\u306B\u4FDD\u5B58\uFF08--content-file\u30FB--generate-cli-skeleton\uFF09
|
|
391
|
+
\u6708\u306E\u65E5\u3054\u3068\u306E\u533A\u5206\u3092\u4E0B\u66F8\u304D\u306B\u4FDD\u5B58\uFF08--content-file\u30FB--from-attendance\u30FB--generate-cli-skeleton\uFF09
|
|
392
392
|
twp expense commuting apply <ID>
|
|
393
393
|
\u4FDD\u5B58\u3057\u305F\u6708\u3092\u30EF\u30FC\u30AF\u30D5\u30ED\u30FC\u3067\u7533\u8ACB\u3059\u308B\uFF08--yes \u304C\u8981\u308B\uFF09
|
|
394
394
|
twp expense commuting cancel <ID>
|
|
@@ -1115,14 +1115,14 @@ TUI \u5185:
|
|
|
1115
1115
|
\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
|
|
1116
1116
|
`;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
|
|
1117
1117
|
`);process.exit(1)}ignoreEpipe(process.stdout);ignoreEpipe(process.stderr);if(process.env["TWP_AUTO_UPDATE_WORKER"]==="1"){const{runAutoUpdateWorker}=await import("./auto-update-worker-VG77U4UA.js");await runAutoUpdateWorker().catch(()=>void 0);return}const[first,...rest]=process.argv.slice(2);if(first==="__complete"||first==="completion"){const completion=await import("./completion-WKXK7VGT.js");if(first==="completion"){process.exitCode=completion.runCompletion(rest,process.stdout,process.stderr);return}
|
|
1118
|
-
const[{loadDomain},{loadUserConfig}]=await Promise.all([import("./registry-
|
|
1118
|
+
const[{loadDomain},{loadUserConfig}]=await Promise.all([import("./registry-4RF6EDQV.js"),import("./config-3CNEQ7KN.js")]);process.exitCode=await completion.runComplete(rest,process.stdout,{loadDomain,profileNames:()=>Object.keys(loadUserConfig().profiles??{})});return}if(first==="configure"){const autoUpdate2=await import("./auto-update-YMI3F44R.js");autoUpdate2.registerRunning();autoUpdate2.onStartup(VERSION);const{runConfigure}=await import("./configure-3H3CGGBI.js");process.exitCode=
|
|
1119
1119
|
await runConfigure(rest);return}const args=parseArgv(process.argv.slice(2));if(args.command==="version"){process.stdout.write(`${VERSION}
|
|
1120
1120
|
`);return}if(args.command==="help"){process.stdout.write(HELP);return}if(args.unknown.length>0){process.stderr.write(`\u4E0D\u660E\u306A\u5F15\u6570: ${args.unknown.join(" ")}
|
|
1121
1121
|
|
|
1122
|
-
${HELP}`);process.exitCode=2;return}const autoUpdate=await import("./auto-update-YMI3F44R.js");autoUpdate.registerRunning();if(args.command==="task-loop"){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-
|
|
1123
|
-
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},version:VERSION});return}if(args.command==="api"){const{runApiCommand}=await import("./api-command-
|
|
1122
|
+
${HELP}`);process.exitCode=2;return}const autoUpdate=await import("./auto-update-YMI3F44R.js");autoUpdate.registerRunning();if(args.command==="task-loop"){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-37FDHPZD.js");process.exitCode=await runDomain({domain:args.domain,...args.operation!==void 0?{operation:args.operation}:{},argv:args.domainArgv,help:args.
|
|
1123
|
+
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},version:VERSION});return}if(args.command==="api"){const{runApiCommand}=await import("./api-command-EK36OA7H.js");process.exitCode=await runApiCommand({argv:args.domainArgv,help:args.domainHelp,globals:{...args.profile!==void 0?{profile:args.profile}:{},...args.output!==
|
|
1124
1124
|
void 0?{output:args.output}:{},...args.query!==void 0?{query:args.query}:{},dryRun:args.dryRun,debug:args.debug,yes:args.yes},version:VERSION});return}if(args.command==="update"){const{runUpdate}=await import("./update-NCAVUXSX.js");process.exitCode=await runUpdate({...args.profile!==void 0?{profile:args.profile}:{},version:VERSION});return}if(args.command==="login"||args.command==="logout"||args.command==="whoami"){const{runLogin,runLogout,runWhoami}=await import("./commands-EYEMPZJX.js");
|
|
1125
1125
|
const options={profile:args.profile,method:args.loginMethod,tenant:args.tenant,noBrowser:args.loginNoBrowser,cliVersion:VERSION,force:args.logoutForce,...args.output!==void 0?{output:args.output}:{},...args.query!==void 0?{query:args.query}:{}};const runner=args.command==="login"?runLogin:args.command==="logout"?runLogout:runWhoami;process.exitCode=await runner(options);return}if(args.command==="task-loop"){const{runTaskLoop}=await import("./commands-5E6DNXCQ.js");process.exitCode=await runTaskLoop(
|
|
1126
1126
|
{action:args.taskLoopAction??"run",project:args.project,profile:args.profile,safe:args.safe,daemon:args.daemon,interval:args.interval,maxCycles:args.maxCycles,forceRunner:args.forceRunner,force:args.stopForce,drain:args.stopDrain,engine:args.engine,version:VERSION,verbose:args.verbose,scheduleNow:args.scheduleNow,scheduleCounts:args.scheduleCounts,scheduleGate:args.scheduleGate,charterOp:args.charterOp,charterInput:args.charterFile,charterOutput:args.charterOut,charterRevision:args.charterRevision,
|
|
1127
1127
|
skillOp:args.skillOp,skillName:args.skillName,skillAll:args.skillAll,skillDir:args.skillDir,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-VS52YK26.js");process.exitCode=await runOneShot({prompt:args.prompt??"",fromStdin:args.promptFromStdin,mode:args.mode??"dev",...args.permissionMode!==void 0?{permissionMode:args.permissionMode}:{},allowedTools:args.
|
|
1128
|
-
allowedTools,disallowedTools:args.disallowedTools,...args.model!==void 0?{model:args.model}:{},...args.profile!==void 0?{profile:args.profile}:{},version:VERSION});return}const{startTui}=await import("./app-
|
|
1128
|
+
allowedTools,disallowedTools:args.disallowedTools,...args.model!==void 0?{model:args.model}:{},...args.profile!==void 0?{profile:args.profile}:{},version:VERSION});return}const{startTui}=await import("./app-IBNHYZ6Q.js");await startTui({mode:args.mode,permissionMode:args.permissionMode,allowedTools:args.allowedTools,disallowedTools:args.disallowedTools,model:args.model,profile:args.profile,noTui:args.noTui||!process.stdout.isTTY,doctor:args.doctor,version:VERSION})}await main();
|
|
@@ -6,9 +6,10 @@ _round_trips","total_one_ways","total_amount","updated_at"];var GET_COLUMNS=["id
|
|
|
6
6
|
var ADMIN_FORBIDDEN=body=>body?.error==="permission_denied"?LICENSE:"\u7D4C\u8CBB\u306E\u7BA1\u7406\u8005\u306E\u6A29\u9650\u304C\u5FC5\u8981\u3067\u3059\uFF08\u30C6\u30CA\u30F3\u30C8\u306E\u7BA1\u7406\u8005\u304B\u3001\u7D4C\u8CBB\u306E\u6A29\u9650\u304C\u300C\u7BA1\u7406\u8005\u300D\u306E\u4EBA\u3060\u3051\u304C\u4F7F\u3048\u307E\u3059\uFF09\u3002\u30C6\u30CA\u30F3\u30C8\u7BA1\u7406\u8005\u306B\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044";var MONTH_FLAG={name:"--month",summary:"\u5BFE\u8C61\u306E\u5E74\u6708\uFF08YYYY-\
|
|
7
7
|
MM\uFF09",takesValue:true,placeholder:"<YYYY-MM>"};var ID_FLAG={name:"--id",summary:"\u5BFE\u8C61\u306E\u901A\u52E4\u4EA4\u901A\u8CBB\u306E ID\uFF08\u4F4D\u7F6E\u5F15\u6570\u306E\u4EE3\u308F\u308A\u306B\u4F7F\u3048\u308B\uFF09",takesValue:true,placeholder:"<ID>"};var COMMENT_FLAG={name:"--comment",summary:`\u7533\u8ACB\u306E\u30B3\u30E1\u30F3\u30C8\uFF08${String(COMMENT_MAX)} \u6587\u5B57\u4EE5\u5185\uFF09`,takesValue:true,placeholder:"<\u30B3\u30E1\u30F3\u30C8>"};var OUT_FLAG={name:"--out",summary:"\
|
|
8
8
|
\u66F8\u304D\u51FA\u3057\u5148\u306E\u30D5\u30A1\u30A4\u30EB\u30D1\u30B9\uFF08\u5FC5\u9808\uFF09",takesValue:true,placeholder:"<\u30D1\u30B9>"};var FORCE_FLAG={name:"--force",summary:"\u65E2\u5B58\u306E\u30D5\u30A1\u30A4\u30EB\u3092\u4E0A\u66F8\u304D\u3059\u308B",takesValue:false};var CONTENT_FILE_FLAG={name:"--content-file",summary:"\u65E5\u3054\u3068\u306E\u533A\u5206\u3068\u30B3\u30E1\u30F3\u30C8\u306E JSON \u30D5\u30A1\u30A4\u30EB\uFF08- \u3067\u6A19\u6E96\u5165\u529B\uFF09",takesValue:true,
|
|
9
|
-
placeholder:"<\u30D1\u30B9>"};var SKELETON_FLAG={name:"--generate-cli-skeleton",summary:"--content-file \u306E\u3072\u306A\u5F62\u3092\u51FA\u3057\u3066\u7D42\u4E86\u3059\u308B\uFF08\u4FDD\u5B58\u3057\u306A\u3044\uFF09",takesValue:false};var
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
placeholder:"<\u30D1\u30B9>"};var SKELETON_FLAG={name:"--generate-cli-skeleton",summary:"--content-file \u306E\u3072\u306A\u5F62\u3092\u51FA\u3057\u3066\u7D42\u4E86\u3059\u308B\uFF08\u4FDD\u5B58\u3057\u306A\u3044\uFF09",takesValue:false};var FROM_ATTENDANCE_FLAG={name:"--from-attendance",summary:"\u65E5\u3054\u3068\u306E\u533A\u5206\u3092\u51FA\u52E4\u6253\u523B\u304B\u3089\u57CB\u3081\u308B\uFF08\u753B\u9762\u306E\u300C\u51FA\u52E4\u65E5\u304B\u3089\u53CD\u6620\u300D\u3068\u540C\u3058 API\uFF09",
|
|
10
|
+
takesValue:false};var ID_USAGE=op=>`twp expense commuting ${op} <ID> --yes`;var LIST_USAGE="twp expense commuting list [--limit <\u4EF6\u6570>] | list --all-users [--month <YYYY-MM>] [--status draft|pending|approved|rejected]";var GET_USAGE="twp expense commuting get (--month <YYYY-MM> | <ID>)";var SAVE_USAGE="twp expense commuting save --month <YYYY-MM> (--content-file <\u30D1\u30B9> | --from-attendance | --generate-cli-skeleton [--from-attendance])";var APPLY_USAGE="twp expense commuting apply\
|
|
11
|
+
<ID> [--workflow <\u7533\u8ACB\u66F8>] [--comment <\u30B3\u30E1\u30F3\u30C8>] --yes";var EXPORT_USAGE="twp expense commuting export --month <YYYY-MM> --out <\u30D1\u30B9.csv> [--force] [--include-hidden]";var OPAQUE_400="\u65AD\u3089\u308C\u305F\u7406\u7531\u306F\u30B5\u30FC\u30D0\u304C\u8FD4\u3055\u306A\u3044\u3053\u3068\u304C\u3042\u308A\u307E\u3059\uFF08\u672C\u756A\u3067\u306F\u300C\u30B5\u30FC\u30D0\u30FC\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F\u300D\u306B\u306A\u308A\u307E\u3059\uFF09\u3002\n \u305D\u306E\u3068\u304D\u306F twp expense commuting get <ID> \u3067\u72B6\u614B\uFF08status\uFF09\u3092\u78BA\u304B\u3081\u3066\u304F\u3060\u3055\u3044\u3002";
|
|
12
|
+
var CONTENT_HELP=`\u5185\u5BB9\uFF08--content-file\uFF09\u306F JSON \u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u3067\u3001\u30AD\u30FC\u306F daily_entries \u3068 comment \u3060\u3051\u3067\u3059\u3002
|
|
12
13
|
daily_entries \u306F\u65E5\uFF08"01"\u301C\u6708\u672B\u3002"1" \u306E\u3088\u3046\u306B1\u6841\u3067\u3082\u53EF\uFF09\u2192 \u533A\u5206\uFF08round_trip\uFF1D\u5F80\u5FA9 / one_way\uFF1D\u7247\u9053 / "" \u304B null\uFF1D\u901A\u52E4\u306A\u3057\uFF09\u3002
|
|
13
14
|
\u66F8\u304B\u306A\u304B\u3063\u305F\u65E5\u306F\u300C\u901A\u52E4\u306A\u3057\u300D\u3067\u9001\u308A\u307E\u3059\uFF08\u753B\u9762\u306E\u4FDD\u5B58\u3068\u540C\u3058\u304F\u3001\u6708\u306E\u5168\u65E5\u3092\u9001\u308A\u307E\u3059\uFF09\u3002
|
|
14
15
|
comment \u306F ${String(COMMENT_MAX)} \u6587\u5B57\u4EE5\u5185\uFF08\u7701\u304F\u3068\u4ECA\u306E\u30B3\u30E1\u30F3\u30C8\u3092\u5909\u3048\u307E\u305B\u3093\uFF09\u3002`;function dataOf(body,what){if(!isRecord(body)||!("data"in body)){throw new ApiResponseError(`${what}\u306E\u5FDC\u7B54\u306E\u5F62\u304C\u60F3\u5B9A\u3068\u9055\u3044\u307E\u3059\u3002\u63A5\u7D9A\u5148\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002`)}return body["data"]}function rowsOf(body,what){const data=dataOf(
|
|
@@ -21,9 +22,12 @@ includes(key)).map(key=>`${key}\uFF08\u9001\u308C\u306A\u3044\u9805\u76EE\u3067\
|
|
|
21
22
|
test(key)?Number(key):0;const normalized=String(day).padStart(2,"0");if(!/^\d{1,2}$/.test(key)){problems.push(`daily_entries.${key}\uFF08\u65E5\u306F1\u301C2\u6841\u306E\u6570\u5B57\u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u4F8B: "01" / "1"\uFF09`)}else if(day<1||day>lastDay){problems.push(`daily_entries.${key}\uFF08${month} \u306B\u7121\u3044\u65E5\u3067\u3059\u3002"01"\u301C"${String(lastDay)}" \u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\uFF09`)}else if(seen.has(normalized)){
|
|
22
23
|
problems.push(`daily_entries.${key}\uFF08${normalized} \u65E5\u304C\u91CD\u8907\u3057\u3066\u3044\u307E\u3059\uFF09`)}else if(typeof value!=="string"||!ENTRY_VALUES.includes(value)){problems.push(`daily_entries.${key}\uFF08\u533A\u5206\u306F round_trip / one_way / "" \u306E\u3069\u308C\u304B\u3067\u3059\uFF09`)}else{seen.add(normalized);entries[normalized]=value}}const comment=parsed["comment"];if(comment!==void 0&&comment!==null&&typeof comment!=="string")problems.push("comment\uFF08\u6587\u5B57\u5217\u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\uFF09");
|
|
23
24
|
if(typeof comment==="string"&&[...comment].length>COMMENT_MAX)problems.push(`comment\uFF08${String(COMMENT_MAX)} \u6587\u5B57\u3092\u8D85\u3048\u3066\u3044\u307E\u3059\uFF09`);if(problems.length>0){throw new UsageError(`\u901A\u52E4\u4EA4\u901A\u8CBB\u306E\u5185\u5BB9\u306B\u9001\u308C\u306A\u3044\u5024\u304C\u3042\u308A\u307E\u3059\uFF08${source}\uFF09: ${problems.join(", ")}`,CONTENT_HELP)}return{daily_entries:entries,...typeof comment==="string"?{comment}:{}}}function countEntries(entries){const values=Object.
|
|
24
|
-
values(entries);return{roundTrips:values.filter(v=>v==="round_trip").length,oneWays:values.filter(v=>v==="one_way").length}}
|
|
25
|
-
const
|
|
26
|
-
|
|
25
|
+
values(entries);return{roundTrips:values.filter(v=>v==="round_trip").length,oneWays:values.filter(v=>v==="one_way").length}}function draftEntriesOf(body,month){const raw=isRecord(body)?body["daily_entries"]:void 0;if(!isRecord(raw)){throw new ApiResponseError("\u51FA\u52E4\u65E5\u304B\u3089\u306E\u4E0B\u66F8\u304D\u306E\u5FDC\u7B54\u306E\u5F62\u304C\u60F3\u5B9A\u3068\u9055\u3044\u307E\u3059\uFF08daily_entries \u304C\u3042\u308A\u307E\u305B\u3093\uFF09\u3002\u63A5\u7D9A\u5148\u304C\u53E4\u3044\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059\u3002")}
|
|
26
|
+
const entries=emptyEntries(month);const problems=[];for(const[day,rawValue]of Object.entries(raw)){const value=rawValue===null?"":rawValue;if(!(day in entries))problems.push(`${day}\uFF08${month} \u306B\u7121\u3044\u65E5\uFF09`);else if(typeof value!=="string"||!ENTRY_VALUES.includes(value))problems.push(`${day}\uFF08\u77E5\u3089\u306A\u3044\u533A\u5206\uFF09`);else entries[day]=value}if(problems.length>0){throw new ApiResponseError(`\u51FA\u52E4\u65E5\u304B\u3089\u306E\u4E0B\u66F8\u304D\u306E\u5FDC\u7B54\u306B\u60F3\u5B9A\u5916\u306E\u5024\u304C\u3042\u308A\u307E\u3059: ${problems.
|
|
27
|
+
join(", ")}\u3002\u63A5\u7D9A\u5148\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002`)}return entries}function draftPlan(month){return{method:"GET",path:`${BASE}/${month}/draft-from-attendance`}}function currentEntriesOf(body){const data=dataOf(body,"\u901A\u52E4\u4EA4\u901A\u8CBB");return isRecord(data)&&isRecord(data["daily_entries"])?data["daily_entries"]:{}}function overwrittenDays(current,draft){return Object.entries(current).filter(([day,value])=>typeof value==="string"&&value!==
|
|
28
|
+
""&&(draft[day]??"")!==value).map(([day])=>day).sort()}var BOM=String.fromCharCode(65279);var FORMULA_START=/[=+\-@\t\r]/;var SIGNED_NUMBER=/^[+-]\d+(\.\d+)?([eE][+-]?\d+)?$/;function cellValueAt(body,start,quoted){let value="";for(let i=start;i<body.length;i+=1){const ch=body[i];if(quoted){if(ch==='"'){if(body[i+1]!=='"')break;i+=1}}else if(ch===","||ch==="\n"||ch==="\r"){break}value+=ch}return value}function needsGuard(body,start,quoted){const first=body[start];if(first===void 0||!FORMULA_START.
|
|
29
|
+
test(first))return false;if(first==="+"||first==="-")return!SIGNED_NUMBER.test(cellValueAt(body,start,quoted));return true}function neutralizeCsvFormulas(text){const hasBom=text.startsWith(BOM);const body=hasBom?text.slice(BOM.length):text;let out="";let atFieldStart=true;let quoted=false;for(let i=0;i<body.length;i+=1){const ch=body[i];if(quoted){if(ch==='"'){if(body[i+1]==='"'){out+='""';i+=1;continue}quoted=false}out+=ch;continue}if(atFieldStart){atFieldStart=false;if(ch==='"'){quoted=true;out+=
|
|
30
|
+
ch;const next=body[i+1];if(next!==void 0&&next!=='"'&&needsGuard(body,i+1,true))out+="'";continue}if(ch!=="\r"&&needsGuard(body,i,false))out+="'"}out+=ch;if(ch===","||ch==="\n")atFieldStart=true}return(hasBom?BOM:"")+out}function neutralizeCsvBytes(bytes){let text;try{text=new TextDecoder("utf-8",{fatal:true,ignoreBOM:true}).decode(bytes)}catch{throw new ApiResponseError("\u901A\u52E4\u4EA4\u901A\u8CBB\u306E CSV \u304C UTF-8 \u3068\u3057\u3066\u8AAD\u3081\u307E\u305B\u3093\u3002\u63A5\u7D9A\u5148\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002")}
|
|
27
31
|
return new TextEncoder().encode(neutralizeCsvFormulas(text))}function listPlan(input){const status=input.flags.get("--status")?.trim();if(!input.flags.has("--all-users")){if(input.flags.has(MONTH_FLAG.name)||status!==void 0){throw new UsageError("--month \u3068 --status \u306F --all-users\uFF08\u30C6\u30CA\u30F3\u30C8\u5168\u54E1\u306E\u5206\uFF09\u3068\u4E00\u7DD2\u306B\u3060\u3051\u4F7F\u3048\u307E\u3059",LIST_USAGE)}const raw=input.flags.get("--limit");if(raw===void 0)return{method:"GET",path:BASE};
|
|
28
32
|
const limit=/^\d+$/.test(raw.trim())?Number(raw.trim()):0;if(limit<1||limit>LIST_LIMIT_MAX){throw new UsageError(`--limit \u306F 1\u301C${String(LIST_LIMIT_MAX)} \u306E\u6574\u6570\u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\uFF08\u53D7\u3051\u53D6\u3063\u305F\u5024: ${raw}\uFF09`,LIST_USAGE)}return{method:"GET",path:BASE,query:{limit}}}if(input.flags.has("--limit"))throw new UsageError("--limit \u306F\u81EA\u5206\u306E\u5206\u306E\u4E00\u89A7\u3060\u3051\u3067\u4F7F\u3048\u307E\u3059\uFF08--all-users \u306F\u8A72\u5F53\u3092\u5168\u4EF6\u8FD4\u3057\u307E\u3059\uFF09",
|
|
29
33
|
LIST_USAGE);if(status!==void 0&&!STATUSES.includes(status)){throw new UsageError(`--status \u306F ${STATUSES.join(" / ")} \u306E\u3069\u308C\u304B\u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\uFF08\u53D7\u3051\u53D6\u3063\u305F\u5024: ${status}\uFF09`,LIST_USAGE)}const month=monthFlag(input.flags);return{method:"GET",path:`${BASE}/admin/list`,query:{...month===void 0?{}:{year_month:month},...status===void 0?{}:{status}}}}var listOperation={name:"list",summary:"\u901A\u52E4\u4EA4\u901A\u8CBB\u306E\u4E00\u89A7\uFF08\u81EA\u5206\u306E\u5206\u30FB--all-users \
|
|
@@ -40,25 +44,36 @@ data))throw new ApiResponseError("\u6708\u306E\u52E4\u6020\u60C5\u5831\u306E\u5F
|
|
|
40
44
|
["label","source","state","note"])})}return rows}var attendanceOperation={name:"attendance",summary:"\u6708\u306E\u81EA\u5206\u306E\u52E4\u6020\u60C5\u5831\uFF08\u6709\u7D66\u30FB\u30EA\u30E2\u30FC\u30C8\u30FB\u52E4\u52D9\u5909\u66F4\uFF09\u3092\u65E5\u3054\u3068\u306B\u8868\u793A\u3059\u308B",usage:"twp expense commuting attendance --month <YYYY-MM>",description:"\u753B\u9762\u306E\u65E5\u5225\u901A\u52E4\u533A\u5206\u306B\u4F75\u8A18\u3055\u308C\u308B\u3001\u81EA\u5206\u306E\u52E4\u6020\u60C5\u5831\u3067\u3059\uFF08GET /api/v2/expense/commuting/{YYYY-MM}/attendance\uFF09\u3002\n\u6709\u7D66\uFF08source=paid_leave\uFF09\u30FB\u30EA\u30E2\u30FC\u30C8\uFF08remote\uFF09\u30FB\u52E4\u52D9\u5909\u66F4\uFF08work_change\uFF09\u304C\u3042\
|
|
41
45
|
\u308B\u65E5\u3060\u3051\u304C\u4E26\u3073\u307E\u3059\uFF08\u4F55\u3082\u7121\u3044\u65E5\u306F\u51FA\u307E\u305B\u3093\uFF09\u3002\nstate \u304C pending \u306E\u3082\u306E\u306F\u7533\u8ACB\u4E2D\u3067\u3059\u3002\u65E5\u3054\u3068\u306E\u533A\u5206\u3092\u6C7A\u3081\u308B\u6750\u6599\u3067\u3001\u3053\u306E\u64CD\u4F5C\u306F\u4F55\u3082\u4FDD\u5B58\u3057\u307E\u305B\u3093\u3002\n--output json \u306F\u65E5\u4ED8 \u2192 \u9805\u76EE\u306E\u914D\u5217\uFF08API \u306E data \u305D\u306E\u3082\u306E\uFF09\u3092\u51FA\u3057\u307E\u3059\u3002",
|
|
42
46
|
flags:[MONTH_FLAG],forbidden:USER_FORBIDDEN,plan:input=>({method:"GET",path:`${BASE}/${requiredMonth(input,"twp expense commuting attendance --month <YYYY-MM>")}/attendance`}),summarize:attendanceRows,raw:body=>dataOf(body,"\u6708\u306E\u52E4\u6020\u60C5\u5831"),notes:body=>attendanceRows(body).length===0?["\u3053\u306E\u6708\u306B\u306F\u6709\u7D66\u30FB\u30EA\u30E2\u30FC\u30C8\u30FB\u52E4\u52D9\u5909\u66F4\u304C\u3042\u308A\u307E\u305B\u3093\uFF08\u51FA\u52E4\u65E5\u306E\u4E00\u89A7\u3067\u306F\u306A\u3044\u306E\u3067\u3001\u901A\u5E38\u306E\u51FA\u52E4\u65E5\u306F\u51FA\u307E\u305B\u3093\uFF09"]:
|
|
43
|
-
[]};async function prepareSave(input){const month=requiredMonth(input,SAVE_USAGE);const wantsSkeleton=input.flags.has(SKELETON_FLAG.name);if(wantsSkeleton&&input.flags.has(CONTENT_FILE_FLAG.name)){throw new UsageError("--generate-cli-skeleton \u3068 --content-file \u306F\u540C\u6642\u306B\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093",SAVE_USAGE)}if(
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
return
|
|
47
|
-
|
|
47
|
+
[]};async function prepareSave(input){const month=requiredMonth(input,SAVE_USAGE);const wantsSkeleton=input.flags.has(SKELETON_FLAG.name);if(wantsSkeleton&&input.flags.has(CONTENT_FILE_FLAG.name)){throw new UsageError("--generate-cli-skeleton \u3068 --content-file \u306F\u540C\u6642\u306B\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093",SAVE_USAGE)}if(input.flags.has(FROM_ATTENDANCE_FLAG.name)&&input.flags.has(CONTENT_FILE_FLAG.name)){throw new UsageError("--from-attendance \u3068 --content-file \u306F\u540C\u6642\u306B\u6307\u5B9A\u3067\u304D\u307E\u305B\
|
|
48
|
+
\u3093",`\u51FA\u52E4\u65E5\u304B\u3089\u57CB\u3081\u305F\u3046\u3048\u3067\u624B\u76F4\u3057\u3059\u308B\u306A\u3089\u3001twp expense commuting save --month ${month} --generate-cli-skeleton --from-attendance \u3067\u3072\u306A\u5F62\u3092\u51FA\u3057\u3066\u304B\u3089 --content-file \u3067\u4FDD\u5B58\u3057\u3066\u304F\u3060\u3055\u3044\u3002`)}if(wantsSkeleton||input.flags.has(FROM_ATTENDANCE_FLAG.name))return input;const text=await readBody(input,{flag:"--content",fileFlag:CONTENT_FILE_FLAG.name,
|
|
49
|
+
label:"\u901A\u52E4\u4EA4\u901A\u8CBB\u306E\u5185\u5BB9",maxChars:CONTENT_MAX_CHARS,usage:SAVE_USAGE});if(text===void 0){throw new UsageError("\u901A\u52E4\u4EA4\u901A\u8CBB\u306E\u5185\u5BB9\u3092 --content-file <\u30D1\u30B9> \u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044",`\u3072\u306A\u5F62\u306F twp expense commuting save --month ${month} --generate-cli-skeleton \u3067\u51FA\u305B\u307E\u3059\u3002`)}const content=parseCommutingContent(text,month,`${CONTENT_FILE_FLAG.name} ${input.flags.
|
|
50
|
+
get(CONTENT_FILE_FLAG.name)??""}`);return withResolved(input,{body:JSON.stringify({year_month:month,...content})})}var DRAFT_PLACEHOLDER="<GET draft-from-attendance \u306E daily_entries\uFF08\u6708\u306E\u5168\u65E5\uFF09>";function savePlan(input){const month=requiredMonth(input,SAVE_USAGE);if(input.flags.has(SKELETON_FLAG.name))return{method:"GET",path:`${BASE}/${month}`};if(input.flags.has(FROM_ATTENDANCE_FLAG.name))return{method:"POST",path:BASE,body:{year_month:month,daily_entries:DRAFT_PLACEHOLDER}};
|
|
51
|
+
return{method:"POST",path:BASE,body:JSON.parse(requireResolved(input,"body"))}}async function executeSave(input,ctx){const month=requiredMonth(input,SAVE_USAGE);const skeleton=input.flags.has(SKELETON_FLAG.name);if(!input.flags.has(FROM_ATTENDANCE_FLAG.name))return{skeleton,month,body:await ctx.send(savePlan(input))};const draft=draftEntriesOf(await ctx.send(draftPlan(month)),month);if(skeleton)return{skeleton,month,body:await ctx.send(savePlan(input)),draft};return{skeleton,month,body:await ctx.
|
|
52
|
+
send({method:"POST",path:BASE,body:{year_month:month,daily_entries:draft}}),draft}}async function previewSave(input,ctx){if(!input.flags.has(FROM_ATTENDANCE_FLAG.name)||input.flags.has(SKELETON_FLAG.name))return{notes:[],warnings:[]};const month=requiredMonth(input,SAVE_USAGE);const draft=draftEntriesOf(await ctx.send(draftPlan(month)),month);const changed=overwrittenDays(currentEntriesOf(await ctx.send({method:"GET",path:`${BASE}/${month}`})),draft);const notes=[`\u51FA\u52E4\u65E5\u304B\u3089\u5F80\u5FA9 ${String(
|
|
53
|
+
countEntries(draft).roundTrips)} \u65E5\u306B\u306A\u308A\u307E\u3059\uFF08\u6253\u523B\u306E\u7121\u3044\u65E5\u30FB\u30EA\u30E2\u30FC\u30C8\u30FB\u5168\u4F11\u306E\u6709\u7D66\u306E\u65E5\u306F\u901A\u52E4\u306A\u3057\uFF09`];if(changed.length===0)return{notes,warnings:[]};return{notes,warnings:[`${month} \u3067\u65E2\u306B\u9078\u3093\u3067\u3042\u308B\u533A\u5206\u304C ${String(changed.length)} \u65E5\u3076\u3093\u5909\u308F\u308A\u307E\u3059\uFF08${changed.join(", ")} \u65E5\uFF09\u3002\u7247\u9053\u306A\u3069\u306E\u624B\u76F4\u3057\u3082\u51FA\u52E4\u65E5\u304B\u3089\u306E\u4E0B\u66F8\u304D\u3067\
|
|
54
|
+
\u7F6E\u304D\u63DB\u308F\u308A\u307E\u3059`]}}function saveResult(value){if(!isRecord(value)||typeof value["skeleton"]!=="boolean"||typeof value["month"]!=="string"){throw new Error("\u5185\u90E8\u30A8\u30E9\u30FC: commuting save \u306E\u5FDC\u7B54\u306B\u5370\u304C\u3042\u308A\u307E\u305B\u3093\uFF08execute \u306E\u914D\u7DDA\u6F0F\u308C\uFF09")}return value}function skeletonOf(result){const data=dataOf(result.body,"\u901A\u52E4\u4EA4\u901A\u8CBB");const entries=emptyEntries(result.month);if(isRecord(
|
|
55
|
+
data)&&isRecord(data["daily_entries"])){for(const[day,value]of Object.entries(data["daily_entries"])){if(day in entries&&typeof value==="string")entries[day]=value}}if(result.draft!==void 0)Object.assign(entries,result.draft);return{daily_entries:entries,comment:isRecord(data)&&typeof data["comment"]==="string"?data["comment"]:""}}var saveOperation={name:"save",summary:"\u6708\u306E\u901A\u52E4\u4EA4\u901A\u8CBB\u3092\u4E0B\u66F8\u304D\u3068\u3057\u3066\u4FDD\u5B58\u3059\u308B\uFF08\u7121\u3051\u308C\u3070\u4F5C\u308A\u3001\u3042\u308C\u3070\u4E0A\u66F8\u304D\uFF09",
|
|
56
|
+
usage:SAVE_USAGE,description:`\u753B\u9762\u306E\u300C\u4FDD\u5B58\u300D\u3068\u540C\u3058\u304F POST /api/v2/expense/commuting \u3092\u9001\u308A\u307E\u3059\uFF08\u540C\u3058\u6708\u304C\u3042\u308C\u3070\u4E0A\u66F8\u304D\u30FB\u7121\u3051\u308C\u3070\u4F5C\u6210\uFF09\u3002
|
|
48
57
|
\u4E0A\u66F8\u304D\u3067\u304D\u308B\u306E\u306F\u4E0B\u66F8\u304D\uFF08draft\uFF09\u3068\u5DEE\u3057\u623B\u3057\uFF08rejected\uFF09\u3060\u3051\u3067\u3001\u5DEE\u3057\u623B\u3057\u306F\u4FDD\u5B58\u3059\u308B\u3068\u4E0B\u66F8\u304D\u306B\u623B\u308A\u307E\u3059\u3002
|
|
49
58
|
\u7533\u8ACB\u4E2D\u30FB\u627F\u8A8D\u6E08\u307F\u306E\u6708\u306F\u30B5\u30FC\u30D0\u304C\u65AD\u308A\u307E\u3059\uFF08\u7D42\u4E86\u30B3\u30FC\u30C9 3\uFF09\u3002\u7247\u9053\u306E\u91D1\u984D\u30FB\u7D4C\u8DEF\u306F\u5951\u7D04\u306E\u901A\u52E4\u60C5\u5831\u304B\u3089\u5165\u308A\u307E\u3059\u3002
|
|
50
59
|
${OPAQUE_400}
|
|
51
60
|
${CONTENT_HELP}
|
|
52
61
|
--generate-cli-skeleton \u306F\u4ECA\u306E\u6708\u306E\u5185\u5BB9\uFF08\u7121\u3051\u308C\u3070\u5168\u65E5\u304C\u7A7A\uFF09\u3092 --content-file \u306E\u5F62\u3067\u51FA\u3057\u307E\u3059\uFF08\u4F55\u3082\u4FDD\u5B58\u3057\u307E\u305B\u3093\uFF09\u3002
|
|
53
62
|
\u4F8B: twp expense commuting save --month 2026-10 --generate-cli-skeleton --output json > commuting.json
|
|
63
|
+
--from-attendance \u306F\u753B\u9762\u306E\u300C\u51FA\u52E4\u65E5\u304B\u3089\u53CD\u6620\u300D\u3068\u540C\u3058\u304F\u3001\u51FA\u52E4\u6253\u523B\u306E\u3042\u308B\u65E5\u3092\u5F80\u5FA9\u306B\u3057\u305F\u4E0B\u66F8\u304D\u3067\u6708\u306E\u5168\u65E5\u3092\u7F6E\u304D\u63DB\u3048\u3066\u4FDD\u5B58\u3057\u307E\u3059
|
|
64
|
+
\uFF08GET /api/v2/expense/commuting/{YYYY-MM}/draft-from-attendance\u3002\u30EA\u30E2\u30FC\u30C8\u30FB\u5168\u4F11\u306E\u6709\u7D66\u30FB\u6253\u523B\u306E\u7121\u3044\u65E5\u306F\u901A\u52E4\u306A\u3057\u3002\u30B3\u30E1\u30F3\u30C8\u306F\u5909\u3048\u307E\u305B\u3093\uFF09\u3002
|
|
65
|
+
\u65E2\u306B\u9078\u3093\u3067\u3042\u308B\u533A\u5206\u304C\u5909\u308F\u308B\u65E5\u304C\u3042\u308C\u3070 --yes \u304C\u8981\u308A\u307E\u3059\uFF08\u753B\u9762\u306E\u4E0A\u66F8\u304D\u78BA\u8A8D\u3068\u540C\u3058\uFF09\u3002--dry-run \u3067\u3082\u4E0B\u66F8\u304D\u3068\u4ECA\u306E\u6708\u306F\u8AAD\u307F\u307E\u3059\u3002
|
|
66
|
+
--generate-cli-skeleton \u3068\u4F75\u305B\u308B\u3068\u3001\u4E0B\u66F8\u304D\u3092\u57CB\u3081\u305F\u3072\u306A\u5F62\u3092\u51FA\u3057\u307E\u3059\uFF08\u7247\u9053\u306E\u65E5\u306A\u3069\u3092\u624B\u76F4\u3057\u3057\u3066\u304B\u3089 --content-file \u3067\u4FDD\u5B58\uFF09\u3002
|
|
54
67
|
\u65E5\u3054\u3068\u306E\u533A\u5206\u3092\u6C7A\u3081\u308B\u6750\u6599\u306F twp expense commuting attendance\uFF08\u6709\u7D66\u30FB\u30EA\u30E2\u30FC\u30C8\u30FB\u52E4\u52D9\u5909\u66F4\u306E\u65E5\uFF09\u3067\u3059\u3002
|
|
55
|
-
\u4FDD\u5B58\u3057\u305F\u3060\u3051\u3067\u306F\u7533\u8ACB\u3055\u308C\u307E\u305B\u3093\u3002\u7533\u8ACB\u306F twp expense commuting apply <ID>\u3002`,flags:[MONTH_FLAG,CONTENT_FILE_FLAG,SKELETON_FLAG],forbidden:USER_FORBIDDEN,prepare:prepareSave,plan:savePlan,plannedNotes
|
|
56
|
-
|
|
57
|
-
skeleton)
|
|
58
|
-
return[
|
|
59
|
-
`\
|
|
60
|
-
|
|
61
|
-
|
|
68
|
+
\u4FDD\u5B58\u3057\u305F\u3060\u3051\u3067\u306F\u7533\u8ACB\u3055\u308C\u307E\u305B\u3093\u3002\u7533\u8ACB\u306F twp expense commuting apply <ID>\u3002`,flags:[MONTH_FLAG,CONTENT_FILE_FLAG,FROM_ATTENDANCE_FLAG,SKELETON_FLAG],forbidden:USER_FORBIDDEN,prepare:prepareSave,plan:savePlan,plannedNotes(input){const fromAttendance=input.flags.has(FROM_ATTENDANCE_FLAG.name);if(input.flags.has(SKELETON_FLAG.name)){return[fromAttendance?"\u5B9F\u884C\u6642\u306F\u3001\u3053\u306E\u524D\u306B\u51FA\u52E4\u65E5\u304B\u3089\u306E\u4E0B\u66F8\u304D\uFF08GET \u2026/draft-from-attendance\uFF09\u3092\u8AAD\u307F\u307E\u3059\u3002\u3069\u3061\u3089\u3082\u8AAD\u3080\u3060\u3051\u3067\u3001\u4F55\u3082\u4FDD\u5B58\
|
|
69
|
+
\u3057\u307E\u305B\u3093":"\u4ECA\u306E\u6708\u306E\u5185\u5BB9\u3092\u8AAD\u3080\u3060\u3051\u3067\u3001\u4F55\u3082\u4FDD\u5B58\u3057\u307E\u305B\u3093"]}return fromAttendance?["\u5B9F\u884C\u6642\u306F\u3001\u3053\u306E\u524D\u306B\u51FA\u52E4\u65E5\u304B\u3089\u306E\u4E0B\u66F8\u304D\uFF08GET \u2026/draft-from-attendance\uFF09\u3092\u8AAD\u307F\u3001\u305D\u306E daily_entries \u3092\u9001\u308A\u307E\u3059"]:[]},preview:previewSave,execute:executeSave,summarize(value){const result=saveResult(
|
|
70
|
+
value);if(result.skeleton)return skeletonOf(result);return pick(recordOf(result.body,"\u901A\u52E4\u4EA4\u901A\u8CBB\u306E\u4FDD\u5B58"),GET_COLUMNS)},raw(value){const result=saveResult(value);return result.skeleton?skeletonOf(result):recordOf(result.body,"\u901A\u52E4\u4EA4\u901A\u8CBB\u306E\u4FDD\u5B58")},notes(value){const result=saveResult(value);if(result.skeleton){const{roundTrips,oneWays}=countEntries(skeletonOf(result)["daily_entries"]);const head=result.draft===void 0?`${result.month} \u306E\
|
|
71
|
+
\u3072\u306A\u5F62\u3067\u3059`:`${result.month} \u306E\u51FA\u52E4\u65E5\u304B\u3089\u57CB\u3081\u305F\u3072\u306A\u5F62\u3067\u3059`;return[`${head}\uFF08\u5F80\u5FA9 ${String(roundTrips)} \u65E5\u30FB\u7247\u9053 ${String(oneWays)} \u65E5\uFF09\u3002daily_entries \u3092\u57CB\u3081\u3066\u304B\u3089 twp expense commuting save --month ${result.month} --content-file <\u30D1\u30B9> \u3067\u4FDD\u5B58\u3057\u3066\u304F\u3060\u3055\u3044`]}const saved=recordOf(result.body,"\u901A\u52E4\u4EA4\u901A\u8CBB\u306E\u4FDD\u5B58");
|
|
72
|
+
const drafted=result.draft===void 0?[]:[`\u51FA\u52E4\u65E5\u304B\u3089\u5F80\u5FA9 ${String(countEntries(result.draft).roundTrips)} \u65E5\u3067\u4FDD\u5B58\u3057\u307E\u3057\u305F`];return[...serverMessage(result.body),...drafted,`\u7533\u8ACB\u306F twp expense commuting apply ${String(saved["id"])} --yes`]}};async function commutingWorkflowId(input,ctx){const ref=input.flags.get("--workflow")?.trim();if(ref!==void 0&&ref!==""){return UUID_RE.test(ref)?ref:(await ctx.resolver.workflow(ref,"--w\
|
|
73
|
+
orkflow",WORKFLOW_CATEGORY)).id}const candidates=await ctx.resolver.applicableWorkflows(WORKFLOW_CATEGORY);if(candidates.length===1)return candidates[0].id;if(candidates.length===0){throw new UsageError(`\u7533\u8ACB\u3067\u304D\u308B\u901A\u52E4\u4EA4\u901A\u8CBB\u306E\u7533\u8ACB\u66F8\u304C\u3042\u308A\u307E\u305B\u3093\uFF08twp workflow applicable --category ${WORKFLOW_CATEGORY} \u304C0\u4EF6\uFF09`,"\u30C6\u30CA\u30F3\u30C8\u306E\u7BA1\u7406\u8005\u306B\u3001\u901A\u52E4\u4EA4\u901A\u8CBB\u306E\u30EF\u30FC\u30AF\u30D5\u30ED\u30FC\u306E\u8A2D\u5B9A\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002")}
|
|
74
|
+
throw new UsageError(`\u901A\u52E4\u4EA4\u901A\u8CBB\u306E\u7533\u8ACB\u66F8\u304C ${String(candidates.length)} \u4EF6\u3042\u308A\u307E\u3059\u3002--workflow \u3067\u540D\u524D\u304B ID \u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044: ${candidates.map(row=>`${row.name}\uFF08${row.id}\uFF09`).join(" / ")}`,APPLY_USAGE)}async function prepareApply(input,ctx){const id=targetId(input,APPLY_USAGE);const comment=input.flags.get(COMMENT_FLAG.name);if(comment!==void 0&&[...comment].length>COMMENT_MAX){
|
|
75
|
+
throw new UsageError(`--comment \u306F ${String(COMMENT_MAX)} \u6587\u5B57\u4EE5\u5185\u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044`,APPLY_USAGE)}return withResolved(input,{id,workflowId:await commutingWorkflowId(input,ctx)})}var applyOperation={name:"apply",summary:"\u4FDD\u5B58\u3057\u305F\u901A\u52E4\u4EA4\u901A\u8CBB\u3092\u30EF\u30FC\u30AF\u30D5\u30ED\u30FC\u3067\u7533\u8ACB\u3059\u308B\uFF08--yes \u304C\u8981\u308B\uFF09",usage:APPLY_USAGE,description:`POST /api/v2/expense/commuti\
|
|
76
|
+
ng/{id}/apply \u3092\u9001\u308A\u307E\u3059\u3002\u7533\u8ACB\u3059\u308B\u3068\u627F\u8A8D\u8005\u3078\u901A\u77E5\u304C\u5C4A\u304D\u3001\u53D6\u308A\u6D88\u3059\u307E\u3067\u7DE8\u96C6\u3067\u304D\u307E\u305B\u3093\u3002
|
|
62
77
|
\u7533\u8ACB\u3059\u308B\u306E\u306F\u4FDD\u5B58\u6E08\u307F\u306E\u5185\u5BB9\u3067\u3059\uFF08\u5148\u306B twp expense commuting save \u3067\u4FDD\u5B58\u3057\u3066\u304F\u3060\u3055\u3044\uFF09\u3002\u4E0B\u66F8\u304D\u30FB\u5DEE\u3057\u623B\u3057\u3060\u3051\u304C\u7533\u8ACB\u3067\u304D\u307E\u3059\u3002
|
|
63
78
|
--workflow \u3092\u7701\u304F\u3068\u3001\u7533\u8ACB\u3067\u304D\u308B\u901A\u52E4\u4EA4\u901A\u8CBB\u306E\u7533\u8ACB\u66F8\u304C1\u3064\u3060\u3051\u306E\u3068\u304D\u305D\u308C\u3092\u4F7F\u3044\u307E\u3059\u3002\u8907\u6570\u3042\u308C\u3070 --workflow \u3067\u9078\u3093\u3067\u304F\u3060\u3055\u3044
|
|
64
79
|
\uFF08\u5019\u88DC\u306F twp workflow applicable --category ${WORKFLOW_CATEGORY}\uFF09\u3002
|
|
@@ -72,4 +87,4 @@ confirmation:"\u53D6\u308A\u6D88\u305B\u306A\u3044\u524A\u9664",method:"DELETE",
|
|
|
72
87
|
\u5217\u306B\u627F\u8A8D\u6E08\u307F\u306E\u533A\u5206\uFF08\u5F80\u5FA9\u30FB\u7247\u9053\uFF09\u304C\u5165\u308A\u307E\u3059\u3002\n\u627F\u8A8D\u6E08\u307F\u3067\u306A\u3044\u4EBA\u3082\u884C\u306F\u51FA\u307E\u3059\uFF08\u65E5\u5225\u306F\u7A7A\uFF09\u3002--include-hidden \u3067\u975E\u8868\u793A\u306E\u30E6\u30FC\u30B6\u30FC\u3082\u542B\u3081\u307E\u3059\u3002\n= + - @ \u3067\u59CB\u307E\u308B\u30BB\u30EB\uFF08+ - \u306F\u6570\u5024\u3092\u9664\u304F\uFF09\u306E\u5148\u982D\u306B ' \u3092\u4ED8\u3051\u3066\u3001\u8868\u8A08\u7B97\u30BD\u30D5\u30C8\u304C\u5F0F\u3068\u3057\u3066\u8AAD\u307E\u306A\u3044\u3088\u3046\u306B\u3057\u307E\u3059\uFF08twp user export \u3068\u540C\u3058\u3002\n \u30B5\u30FC\u30D0\u3082\u540C\u3058\u7121\u5BB3\u5316\u3092\u3057\u3066\u3044\u308B\u306E\u3067\u3001\u65E2\u306B ' \u4ED8\u304D\u306E\u30BB\u30EB\u306B\u306F\u91CD\u306D\u307E\u305B\u3093\uFF09\u3002\n\u65E2\u5B58\u306E\u30D5\u30A1\u30A4\u30EB\u306F\u4E0A\u66F8\u304D\u3057\u307E\u305B\u3093\uFF08\u4E0A\u66F8\u304D\u3059\u308B\u306A\u3089 --force\uFF09\u3002",
|
|
73
88
|
flags:[MONTH_FLAG,OUT_FLAG,FORCE_FLAG,{name:"--include-hidden",summary:"\u975E\u8868\u793A\u306E\u30E6\u30FC\u30B6\u30FC\u3082\u542B\u3081\u308B",takesValue:false}],download:{outFlag:OUT_FLAG.name,forceFlag:FORCE_FLAG.name,transform:neutralizeCsvBytes},forbidden:ADMIN_FORBIDDEN,plan:input=>({method:"GET",path:`${BASE}/admin/export`,query:{year_month:requiredMonth(input,EXPORT_USAGE),...input.flags.has("--include-hidden")?{include_hidden:"1"}:{}}}),summarize:body=>body,raw:body=>body};var commutingResource={
|
|
74
89
|
name:"commuting",summary:"\u901A\u52E4\u4EA4\u901A\u8CBB\uFF08\u6708\u3054\u3068\u306E\u65E5\u5225\u533A\u5206\u306E\u4FDD\u5B58\u30FB\u7533\u8ACB\u30FB\u53D6\u6D88\u30FB\u524A\u9664\u3068\u3001\u7BA1\u7406\u8005\u306E\u4E00\u89A7\u30FBCSV\uFF09",operations:[listOperation,getOperation,attendanceOperation,saveOperation,applyOperation,cancelOperation,deleteOperation,exportOperation]};var expenseDomain={name:"expense",summary:"\u7D4C\u8CBB\uFF08\u901A\u52E4\u4EA4\u901A\u8CBB\uFF09",operations:[],subresources:[
|
|
75
|
-
commutingResource]};export{expenseDomain,neutralizeCsvFormulas,parseCommutingContent};
|
|
90
|
+
commutingResource]};export{draftEntriesOf,expenseDomain,neutralizeCsvFormulas,overwrittenDays,parseCommutingContent};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire as __twpCreateRequire } from 'node:module';
|
|
2
2
|
const require = __twpCreateRequire(import.meta.url);
|
|
3
|
-
import{parseWaitOptions,waitUntilTerminal}from"./chunk-WVCEKC7V.js";import{checkOutTarget}from"./chunk-
|
|
3
|
+
import{parseWaitOptions,waitUntilTerminal}from"./chunk-WVCEKC7V.js";import{checkOutTarget}from"./chunk-5543BC4H.js";import"./chunk-B4O5MGOV.js";import"./chunk-GFLGXGWE.js";import"./chunk-YXVN6OCH.js";import"./chunk-UFGJSWKU.js";import"./chunk-Q3B65OFC.js";import{contentTypeFor,inspectLocalFile}from"./chunk-I4TR55UF.js";import{checkUploadQuota}from"./chunk-V64CGX7V.js";import"./chunk-GY7KI5E5.js";import{repeatedValues}from"./chunk-RX5HWI4L.js";
|
|
4
4
|
import{LIST_FLAGS,LIST_PAGING_HELP,envelopePaging,nonEmpty,positiveInteger,readEnvelopeCursor,shellQuote}from"./chunk-MI6HVYR2.js";import{readBody}from"./chunk-6LSQCOCJ.js";import"./chunk-VELLV6DJ.js";import{collapsesInUrlPath,isSafePathSegment}from"./chunk-HVZUXLQ4.js";import{ApiError}from"./chunk-JA5A6UJ2.js";import"./chunk-QBGEYQ2I.js";import{requireResolved,singleRef,withResolved}from"./chunk-PS5QFKHB.js";import"./chunk-II5RVJQN.js";import{acknowledgement,
|
|
5
5
|
isRecord,pick}from"./chunk-3ZRMMBP5.js";import{ApiRejectedError,ApiResponseError,NetworkError,UsageError,WaitTimeoutError}from"./chunk-VFPY2A23.js";import"./chunk-YLM54X35.js";import"./chunk-XNLIEUAW.js";import"./chunk-J7QYPKVK.js";import"./chunk-4VZKNEVN.js";import"./chunk-RZVI6PMW.js";import"./chunk-QZBE4KC2.js";import"./chunk-QQRJLH6B.js";import"./chunk-74BPZOKU.js";import"./chunk-UREA4ZIG.js";import"./chunk-NHYMHCAT.js";
|
|
6
6
|
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-B4O5MGOV.js";import"./chunk-VSJBJXZO.js";export{loadDomain};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { createRequire as __twpCreateRequire } from 'node:module';
|
|
2
2
|
const require = __twpCreateRequire(import.meta.url);
|
|
3
|
-
import{CURATED_PAGING_VOCABULARY,buildPrepareContext,checkOutTarget,exitCodeFor,fetchAllPages,outputValue,reportError,requiresYes,resolvePaging,runDomain}from"./chunk-
|
|
3
|
+
import{CURATED_PAGING_VOCABULARY,buildPrepareContext,checkOutTarget,exitCodeFor,fetchAllPages,outputValue,reportError,requiresYes,resolvePaging,runDomain}from"./chunk-5543BC4H.js";import"./chunk-B4O5MGOV.js";import"./chunk-GFLGXGWE.js";import"./chunk-YXVN6OCH.js";import"./chunk-UFGJSWKU.js";import"./chunk-Q3B65OFC.js";import"./chunk-RX5HWI4L.js";import"./chunk-MI6HVYR2.js";import"./chunk-VELLV6DJ.js";import"./chunk-HVZUXLQ4.js";import"./chunk-JA5A6UJ2.js";
|
|
4
4
|
import"./chunk-QBGEYQ2I.js";import"./chunk-II5RVJQN.js";import"./chunk-3ZRMMBP5.js";import"./chunk-VFPY2A23.js";import"./chunk-YLM54X35.js";import"./chunk-XNLIEUAW.js";import"./chunk-J7QYPKVK.js";import"./chunk-4VZKNEVN.js";import"./chunk-RZVI6PMW.js";import"./chunk-QZBE4KC2.js";import"./chunk-QQRJLH6B.js";import"./chunk-74BPZOKU.js";import"./chunk-UREA4ZIG.js";import"./chunk-NHYMHCAT.js";import"./chunk-VSJBJXZO.js";export{CURATED_PAGING_VOCABULARY,buildPrepareContext,checkOutTarget,exitCodeFor,fetchAllPages,outputValue,reportError,requiresYes,resolvePaging,runDomain};
|