@tocca-systems/twp-cli 0.36.0 → 0.37.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 +5 -2
- package/dist/{api-command-YUZFGC2W.js → api-command-NLV55HVW.js} +2 -2
- package/dist/{app-NIJ3MAGU.js → app-MED2NINK.js} +2 -2
- package/dist/attendance-ZWVZGVBE.js +3 -0
- package/dist/{attendance-lists-PR6NQDQB.js → attendance-lists-F2KTIJZA.js} +1 -1
- package/dist/{backlog-2VHFVU5C.js → backlog-33ELMSV6.js} +1 -1
- package/dist/{chunk-MQ3WFH54.js → chunk-4CVLBR42.js} +1 -1
- package/dist/{chunk-DCGL7XJF.js → chunk-KA3EE4TJ.js} +1 -1
- package/dist/{chunk-R5HF6LTR.js → chunk-KSWRKHKU.js} +1 -1
- package/dist/chunk-R64SA5WZ.js +6 -0
- package/dist/{chunk-PLBOUQE7.js → chunk-SN6YG4SF.js} +1 -1
- package/dist/{workflow-QWVZH4NG.js → chunk-U6GEC6KI.js} +12 -13
- package/dist/{chunk-BU3NOAYC.js → chunk-WYBJLRTG.js} +16 -14
- package/dist/{chunk-DBIDYOKW.js → chunk-ZST7XESB.js} +3 -1
- package/dist/cli.js +7 -6
- package/dist/{company-6HMFGVPJ.js → company-DH4H6HXD.js} +2 -2
- package/dist/{department-DH5YABBF.js → department-NEDSHJJK.js} +1 -1
- package/dist/{inquiry-67OW3HBZ.js → inquiry-CUK2LWQK.js} +1 -1
- package/dist/{job-title-YEIANJNC.js → job-title-USZK3QZS.js} +1 -1
- package/dist/leave-6UB43UT5.js +62 -0
- package/dist/{media-NZD6J7KE.js → media-3L4JSXC6.js} +1 -1
- package/dist/{notification-BQ4ODX6U.js → notification-MCABOEFM.js} +1 -1
- package/dist/{oneshot-GCQYYNIH.js → oneshot-RYWJ6ECA.js} +1 -1
- package/dist/{position-WR5YODDU.js → position-D7BUAIH4.js} +1 -1
- package/dist/{prospect-YZUHE7PL.js → prospect-MOBECADA.js} +1 -1
- package/dist/{registry-3O2KBG5I.js → registry-XXUXBYEE.js} +1 -1
- package/dist/{report-SGAVGU4G.js → report-U2ZFPO33.js} +1 -1
- package/dist/{run-WXHHCFT7.js → run-65ZPZ5FD.js} +1 -1
- package/dist/{sales-OFEVE2PG.js → sales-2WX46SHN.js} +1 -1
- package/dist/{task-IE7DNU34.js → task-KPRX3OQX.js} +2 -2
- package/dist/{user-UJIB3SCU.js → user-VY35MTY3.js} +1 -1
- package/dist/workflow-5DFICP3M.js +4 -0
- package/package.json +1 -1
- package/dist/attendance-LM3Q4TAU.js +0 -3
- package/dist/chunk-XNW2UNWQ.js +0 -6
- package/dist/leave-XXDCHUGK.js +0 -19
package/CHANGELOG.public.md
CHANGED
|
@@ -11,6 +11,12 @@
|
|
|
11
11
|
`CHANGELOG.md` に残してあります。顧客向けの履歴は public 公開以降を対象とします。
|
|
12
12
|
-->
|
|
13
13
|
|
|
14
|
+
## 0.37.0
|
|
15
|
+
|
|
16
|
+
有給休暇の申請を CLI から行えるようになりました(`twp leave request`)。日付か期間と取得種別を指定すると、有給休暇の申請書で申請を作って提出します。勤怠が締め済みの月には申請を送りません。
|
|
17
|
+
|
|
18
|
+
`twp workflow instance create` / `apply` のヘルプを、サーバが申請書の申請可否と必須の入力項目を検査するようになったことに合わせて直しました。
|
|
19
|
+
|
|
14
20
|
## 0.36.0
|
|
15
21
|
|
|
16
22
|
顧客管理の操作が CLI からひととおりできるようになりました。担当者・対応履歴の詳細、最近の対応の一覧、名刺画像の登録と裏面メモ、企業をまたいだ人物の一覧と CSV 書き出し、登録前の類似企業検索、仕入先を含む取引先企業の登録・更新・削除ができます。
|
package/README.md
CHANGED
|
@@ -27,7 +27,7 @@ TWP(Tocca Working Platform)を、ターミナルから使うための CLI
|
|
|
27
27
|
| **できる** | `twp estimate` / `twp invoice` による販売管理の見積・請求の一覧(語・ステータス・取引先・プロジェクト・担当者・日付・回収状況で絞り込み)と詳細、`twp company` / `twp customer` による取引先企業・顧客の一覧と詳細(名前でも指定できます)、`twp customer` による顧客の登録・更新・削除(担当者・対応履歴ごと。ID を並べたファイルでの一括削除を含む)と担当者・対応履歴の一覧・詳細・登録・更新・削除、全顧客の最近の対応、名刺画像の登録・裏面メモ・削除、企業をまたいだ人物の一覧・詳細・CSV 書き出し、登録前の類似企業検索、`twp company` による取引先企業(仕入先を含む)の登録・更新・削除、`twp prospect` によるアプローチ先(見込客)の一覧・登録・更新・削除・CSV での一括登録と書き出し・重複確認・顧客への昇格と対応履歴の記録。販売管理・顧客管理の権限が要ります |
|
|
28
28
|
| **できる** | `twp media` によるメディアライブラリのファイルのアップロード・一覧・ダウンロード・削除(ゴミ箱へ移す)・一括操作(公開・非公開・アーカイブ・移動・削除・復元・ZIP ダウンロード)、`twp storage get` によるストレージ使用量の確認(管理者) |
|
|
29
29
|
| **できる** | `twp attendance` による自分の勤怠の参照(いまの打刻状態・打刻の履歴・月の勤怠表)と打刻、管理者向けの残業サマリ(36協定を含む)・締め状況の参照 |
|
|
30
|
-
| **できる** | `twp leave`
|
|
30
|
+
| **できる** | `twp leave` による有給の残日数・取得履歴・付与履歴の参照と有給の申請(`twp leave request`)、`twp workchange list` / `twp shift list` による月の勤務変更・シフトの参照(`--me` で自分の分・無ければ全員分=勤怠の管理者) |
|
|
31
31
|
| **できる** | `twp workflow` による、自分が申請できる申請書・申請書の定義(管理者)・自分の申請・承認履歴・自分の承認待ちの参照(申請書は名前でも指定できます)と、申請の起票・提出・更新・削除、承認・却下・差し戻し・取下げ |
|
|
32
32
|
| **できる** | `twp report` による自分のレポート(日報)の一覧(フォーマット・状態・語で絞り込み)・詳細と、下書きの作成(フォーマットの入力項目から雛形を出せます)・更新・提出、使えるレポートフォーマットの一覧 |
|
|
33
33
|
| **できる** | `twp task-loop` による、TWP のタスクキューを手元の AI CLI に実行させる常駐ループ |
|
|
@@ -497,14 +497,17 @@ twp attendance closings list [--month <YYYY-MM>] [--include-hidden]
|
|
|
497
497
|
```bash
|
|
498
498
|
twp leave list
|
|
499
499
|
twp leave grants [<ユーザー> | --user <ユーザー>]
|
|
500
|
+
twp leave request (--date <YYYY-MM-DD> | --from <YYYY-MM-DD> --to <YYYY-MM-DD>) [--type full_day|half_day_am|half_day_pm|hourly] [--hours <時間>] [--reason <理由>] [--title <件名>] [--workflow <申請書>] [--draft]
|
|
500
501
|
twp workchange list [--month <YYYY-MM>] [--me]
|
|
501
502
|
twp shift list [--month <YYYY-MM>] [--me]
|
|
502
503
|
```
|
|
503
504
|
|
|
505
|
+
- `leave request` は有給休暇の申請書(ワークフロー)で下書きを作って提出します(`--draft` なら下書きで止める)。申請書ごとに選べる種別・項目が違うので、送る前に申請書の定義を読んで合わせ、合わないもの(期間の項目が無い申請書への `--from` / `--to`、選択肢に無い種別)は送らずに止めます。対象の月の自分の勤怠が締め済みなら送りません。有給休暇の申請書が複数あるテナントでは `--workflow` で選びます
|
|
506
|
+
|
|
504
507
|
- `leave list` は自分の有給の取得履歴で、残日数・取得率・年5日の取得義務の達成状況は stderr に出します
|
|
505
508
|
- `leave grants` は `<ユーザー>` を省略するか `me` なら自分の付与履歴です。他の人の分は、有給管理の権限を持つ人か、その人の上長だけが見られます
|
|
506
509
|
- `workchange list` / `shift list` は `--me` で自分の分、無ければ全員分です(全員分は勤怠の管理者権限が要り、無ければその旨を案内して終了コード 3)。`--month` が無ければ今月です
|
|
507
|
-
-
|
|
510
|
+
- 勤務変更やシフトの登録はできません(画面から行ってください。有給の申請は `leave request` でできます)
|
|
508
511
|
|
|
509
512
|
### ワークフロー(申請)を見る・出す・承認する
|
|
510
513
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire as __twpCreateRequire } from 'node:module';
|
|
2
2
|
const require = __twpCreateRequire(import.meta.url);
|
|
3
|
-
import{CommandModelMissingError,MAX_REPORTED_VIOLATIONS,loadCommandModelDomain,loadCommandModelRoutes,validateBody,validateQuery}from"./chunk-NZ7WI4RZ.js";import{NO_REDACT_FLAG,NO_REDACT_NOTICE,exitCodeFor,fetchAllPages,reportError}from"./chunk-
|
|
4
|
-
import{parseOperationArgs,repeatedValues}from"./chunk-IOGVQVGD.js";import"./chunk-
|
|
3
|
+
import{CommandModelMissingError,MAX_REPORTED_VIOLATIONS,loadCommandModelDomain,loadCommandModelRoutes,validateBody,validateQuery}from"./chunk-NZ7WI4RZ.js";import{NO_REDACT_FLAG,NO_REDACT_NOTICE,exitCodeFor,fetchAllPages,reportError}from"./chunk-KSWRKHKU.js";import{renderOutput}from"./chunk-6NEQ6PZZ.js";import{redactSecretValues,withDebug}from"./chunk-BUZKNZ45.js";import"./chunk-R64SA5WZ.js";import{evaluateQuery}from"./chunk-GDM2QUBL.js";import{readBody}from"./chunk-HGTG5XQ7.js";
|
|
4
|
+
import{parseOperationArgs,repeatedValues}from"./chunk-IOGVQVGD.js";import"./chunk-ZST7XESB.js";import{ApiError,TwpApiClient,appendQuery}from"./chunk-IF2K4PM5.js";import"./chunk-GMBJTG6A.js";import{GLOBAL_OPTIONS_HELP}from"./chunk-TAN5I2DP.js";import{AuthSession,NotLoggedInError,SessionExpiredError,loadCredentials}from"./chunk-XNLIEUAW.js";import{httpFetch}from"./chunk-J7QYPKVK.js";import{effectiveApiUrl,resolveConfiguredOutput,resolveProfile}from"./chunk-4VZKNEVN.js";
|
|
5
5
|
import{HELP_TOKEN}from"./chunk-523KROGI.js";import"./chunk-QQRJLH6B.js";import{OUTPUT_FORMATS,resolveOutputFormat}from"./chunk-K2ONOH3L.js";import"./chunk-WVS4W5FY.js";import{stripTerminalControls}from"./chunk-NHYMHCAT.js";import{DEFAULT_MAX_ITEMS,DEFAULT_MAX_PAGES,envelopePaging,positiveInteger,readEnvelopeCursor,shellQuote}from"./chunk-R53CMVWR.js";import"./chunk-II5RVJQN.js";import{EXIT_OK,NetworkError,UsageError}from"./chunk-7WSNIXTQ.js";import"./chunk-RZVI6PMW.js";
|
|
6
6
|
import"./chunk-VSJBJXZO.js";var MIN_SEGMENT_CHARS=3;var parsedCache=new WeakMap;function splitSegments(path){return path.split("/").filter(segment=>segment!=="")}function parseRoutes(routes){const cached=parsedCache.get(routes);if(cached!==void 0)return cached;const parsed=[];for(const[key,domain]of Object.entries(routes.routes)){const space=key.indexOf(" ");if(space<=0)continue;const template=key.slice(space+1);parsed.push({method:key.slice(0,space),template,domain,segments:splitSegments(template).map(segment=>/^\{[^/{}]+\}$/.
|
|
7
7
|
test(segment)?null:segment)})}parsedCache.set(routes,parsed);return parsed}function matches(route,segments){if(route.segments.length!==segments.length)return false;return route.segments.every((literal,i)=>literal===null||literal===segments[i])}function compareSpecificity(a,b){const literals=route=>route.segments.filter(segment=>segment!==null).length;const diff=literals(b)-literals(a);if(diff!==0)return diff;for(let i=0;i<a.segments.length;i+=1){const aLiteral=a.segments[i]!==null;const bLiteral=b.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire as __twpCreateRequire } from 'node:module';
|
|
2
2
|
const require = __twpCreateRequire(import.meta.url);
|
|
3
3
|
import{RESIDENT_TOKEN_CAP,activateModeFiles,activatePermissionSettings,buildResidentSet,buildSystemPrompt,createAuditLogger,createTwpToolkit,currentBranch,describeAuditLog,describeToolCatalog,displayCwd,executeTool,findProjectTwpSubdir,localTools,lstatOrNull,parseFrontMatter,parseRule,persistProjectAllow,projectPermissionsPath,projectRootFor,readFileTool,residentInputs,resolveGitExecutable,runTurn,secretReason}from"./chunk-HAIZHSNZ.js";import"./chunk-NZ7WI4RZ.js";import"./chunk-BUZKNZ45.js";
|
|
4
|
-
import{buildDiffLines,diffStat}from"./chunk-VRBI2NPI.js";import{require_fuzzysort}from"./chunk-DIMZRTLE.js";import"./chunk-
|
|
4
|
+
import{buildDiffLines,diffStat}from"./chunk-VRBI2NPI.js";import{require_fuzzysort}from"./chunk-DIMZRTLE.js";import"./chunk-ZST7XESB.js";import"./chunk-IF2K4PM5.js";import"./chunk-GMBJTG6A.js";import{RelayError,builtinCatalog,createRuntime,loadCachedCatalog,modelLabel,pickModel,toModelInfos}from"./chunk-PWXXCLVZ.js";import"./chunk-D233KKXW.js";import"./chunk-XNLIEUAW.js";import{proxyDiagnostics}from"./chunk-J7QYPKVK.js";import{checkMinSupportedVersion,
|
|
5
5
|
isBelowMinSupported,minSupportedBlockMessage}from"./chunk-DXXFUNYN.js";import"./chunk-4VZKNEVN.js";import{parseArgv}from"./chunk-VQMR5UTD.js";import{applyPermissionMode,checkPermission,describePermissionMode,getMode,isModeId,modeSource,nextMode}from"./chunk-NAUH75MM.js";import"./chunk-523KROGI.js";import"./chunk-QQRJLH6B.js";import{isFullWidth,isWide,stringWidth,stripAnsi}from"./chunk-WVS4W5FY.js";import{stripTerminalControls}from"./chunk-NHYMHCAT.js";
|
|
6
6
|
import"./chunk-N2UVRM3Z.js";import"./chunk-II5RVJQN.js";import"./chunk-7WSNIXTQ.js";import"./chunk-PMOUHEJQ.js";import{configReadDirs,twpHomeDir}from"./chunk-RZVI6PMW.js";import{__commonJS,__export,__require,__toESM}from"./chunk-VSJBJXZO.js";var require_react_production=__commonJS({"node_modules/react/cjs/react.production.js"(exports){"use strict";var REACT_ELEMENT_TYPE=Symbol.for("react.transitional.element");var REACT_PORTAL_TYPE=Symbol.for("react.portal");var REACT_FRAGMENT_TYPE=Symbol.for("react.fragment");var REACT_STRICT_MODE_TYPE=Symbol.for("react.strict_mode");var REACT_PROFILER_TYPE=Symbol.for("react.profiler");var REACT_CONSUMER_TYPE=Symbol.for("react.consumer");var REACT_CONTEXT_TYPE=Symbol.for("react.context");var REACT_FORWARD_REF_TYPE=Symbol.
|
|
7
7
|
for("react.forward_ref");var REACT_SUSPENSE_TYPE=Symbol.for("react.suspense");var REACT_MEMO_TYPE=Symbol.for("react.memo");var REACT_LAZY_TYPE=Symbol.for("react.lazy");var REACT_ACTIVITY_TYPE=Symbol.for("react.activity");var REACT_VIEW_TRANSITION_TYPE=Symbol.for("react.view_transition");var MAYBE_ITERATOR_SYMBOL=Symbol.iterator;function getIteratorFn(maybeIterable){if(null===maybeIterable||"object"!==typeof maybeIterable)return null;maybeIterable=MAYBE_ITERATOR_SYMBOL&&maybeIterable[MAYBE_ITERATOR_SYMBOL]||
|
|
@@ -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-65ZPZ5FD.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",
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { createRequire as __twpCreateRequire } from 'node:module';
|
|
2
|
+
const require = __twpCreateRequire(import.meta.url);
|
|
3
|
+
import{PUNCH_TYPES,assertCurrentMonthOpen,assertMonthsOpen,attendanceDomain,hoursMinutes}from"./chunk-WYBJLRTG.js";import"./chunk-ZN5EFDH7.js";import"./chunk-ZWVYVS2A.js";import"./chunk-7WSNIXTQ.js";import"./chunk-VSJBJXZO.js";export{PUNCH_TYPES,assertCurrentMonthOpen,assertMonthsOpen,attendanceDomain,hoursMinutes};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire as __twpCreateRequire } from 'node:module';
|
|
2
2
|
const require = __twpCreateRequire(import.meta.url);
|
|
3
|
-
import{hoursMinutes,monthFlag}from"./chunk-
|
|
3
|
+
import{hoursMinutes,monthFlag}from"./chunk-WYBJLRTG.js";import"./chunk-ZN5EFDH7.js";import{isRecord,pick}from"./chunk-ZWVYVS2A.js";import{ApiResponseError,UsageError}from"./chunk-7WSNIXTQ.js";import"./chunk-VSJBJXZO.js";var MONTH_FLAG={name:"--month",summary:"\u5BFE\u8C61\u306E\u5E74\u6708\uFF08YYYY-MM\uFF09",takesValue:true,placeholder:"<YYYY-MM>"};var ME_FLAG={name:"--me",summary:"\u81EA\u5206\u306E\u5206\u3060\u3051\u3092\u8868\u793A\u3059\u308B\uFF08\u7121\u3051\u308C\u3070\u5168\u54E1\u5206\u30FB\u7BA1\u7406\u8005\uFF09",takesValue:false};var FORBIDDEN_ADMIN="\u6A29\u9650\u304C\u8DB3\u308A\u307E\u305B\u3093\u3002\u5168\u54E1\u5206\uFF08--me \u306A\u3057\uFF09\u306F\u52E4\u6020\u306E\u7BA1\u7406\u8005\u6A29\u9650\uFF08\u52E4\u6020: \u7BA1\u7406\u8005\uFF09\u3001\u81EA\u5206\u306E\u5206\uFF08--me\uFF09\u306F\u52E4\u6020\u306E\u5229\u7528\u6A29\u9650\u304C\u8981\u308A\u307E\u3059\u3002\u30C6\u30CA\u30F3\u30C8\u306E\u7BA1\u7406\u8005\u306B\u6A29\u9650\u306E\u4ED8\u4E0E\u3092\u4F9D\u983C\u3057\u3066\u304F\u3060\u3055\u3044";
|
|
4
4
|
function listBody(spec,body){if(!isRecord(body)||!Array.isArray(body[spec.key])){throw new ApiResponseError(`${spec.label}\u306E\u5FDC\u7B54\u306B ${spec.key} \u304C\u3042\u308A\u307E\u305B\u3093\u3002\u63A5\u7D9A\u5148\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002`)}return body}function monthListOperation(spec){const usage=`twp ${spec.domain} list [--month <YYYY-MM>] [--me]`;return{name:"list",summary:`\u6708\u306E${spec.label}\u3092\u4E00\u89A7\u3059\u308B\uFF08--me \u3067\u81EA\u5206\u306E\u5206\u30FB\u7121\u3051\u308C\u3070\u5168\u54E1\u5206\uFF1D\u7BA1\u7406\u8005\uFF09`,
|
|
5
5
|
usage,description:`GET ${spec.path} \u3092\u8868\u793A\u3057\u307E\u3059\uFF08\u5168\u54E1\u5206\u30FB\u52E4\u6020\u306E\u7BA1\u7406\u8005\u6A29\u9650\u304C\u5FC5\u8981\uFF09\u3002--me \u3092\u4ED8\u3051\u308B\u3068 GET ${spec.path}/me\uFF08\u81EA\u5206\u306E\u5206\uFF09\u3067\u3059\u3002
|
|
6
6
|
--month \u304C\u7121\u3051\u308C\u3070\u4ECA\u6708\u3067\u3059\uFF08\u30C6\u30CA\u30F3\u30C8\u306E\u696D\u52D9\u65E5\u306E\u533A\u5207\u308A\u3067\u30B5\u30FC\u30D0\u304C\u6C7A\u3081\u307E\u3059\uFF09\u3002
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire as __twpCreateRequire } from 'node:module';
|
|
2
2
|
const require = __twpCreateRequire(import.meta.url);
|
|
3
|
-
import{readBody}from"./chunk-HGTG5XQ7.js";import{BACKLOG_BASE_PATH,BACKLOG_PROJECT_SCOPE_LABEL,BACKLOG_SCOPE_LABEL,backlogSpacePath,isExactNumericId,resolveNamed}from"./chunk-
|
|
3
|
+
import{readBody}from"./chunk-HGTG5XQ7.js";import{BACKLOG_BASE_PATH,BACKLOG_PROJECT_SCOPE_LABEL,BACKLOG_SCOPE_LABEL,backlogSpacePath,isExactNumericId,resolveNamed}from"./chunk-ZST7XESB.js";import"./chunk-IF2K4PM5.js";import"./chunk-GMBJTG6A.js";import"./chunk-J7QYPKVK.js";import"./chunk-4VZKNEVN.js";import"./chunk-NHYMHCAT.js";import"./chunk-II5RVJQN.js";import{requireResolved,singleRef,withResolved}from"./chunk-ZN5EFDH7.js";import{isRecord,pick}from"./chunk-ZWVYVS2A.js";
|
|
4
4
|
import{ApiResponseError,UsageError}from"./chunk-7WSNIXTQ.js";import"./chunk-RZVI6PMW.js";import"./chunk-VSJBJXZO.js";var DEFAULT_COUNT=20;var MAX_COUNT=100;var NUMERIC=/^[0-9]+$/;var ISSUE_REF=/^(?:[A-Za-z0-9_]+-[0-9]+|[0-9]+)$/;var DATE=/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/;var SPACE_COLUMNS=["id","space_url"];var PROJECT_COLUMNS=["id","projectKey","name"];var ISSUE_LIST_COLUMNS=["issueKey","summary","status","assignee","priority","dueDate","updated","descriptionTruncated"];var ISSUE_GET_COLUMNS=["id","issueKey","projectId","summary","description","descriptionTruncated","status","issueType","priority","assignee","cr\
|
|
5
5
|
eatedUser","parentIssueId","startDate","dueDate","estimatedHours","actualHours","created","updated"];var COMMENT_COLUMNS=["id","created","createdUserId","createdUser","content","changeLog"];function commentRow(row){const source=isRecord(row)?row:{};const user=isRecord(source["createdUser"])?source["createdUser"]:{};return pick({...source,createdUserId:user["id"]??null,createdUser:user["name"]??null},COMMENT_COLUMNS)}var ATTACHMENT_COLUMNS=["id","name","size","contentType","createdUserId","create\
|
|
6
6
|
dUser","created"];var STATUS_COLUMNS=["id","name","color"];var USER_COLUMNS=["id","userId","name","mailAddress","roleType"];var SPACE_FLAG={name:"--space",summary:"Backlog \u30B9\u30DA\u30FC\u30B9\uFF08ID / \u30B9\u30DA\u30FC\u30B9URL / \u30B5\u30D6\u30C9\u30E1\u30A4\u30F3\uFF09\u3002\u767B\u9332\u304C1\u4EF6\u306A\u3089\u7701\u7565\u3067\u304D\u307E\u3059",takesValue:true,placeholder:"<ID|URL>"};var BODY_MAX_CHARS=1e5;var BODY_FLAGS=[{name:"--body-file",summary:"\u672C\u6587\u3092\u30D5\u30A1\u30A4\u30EB\u304B\u3089\u8AAD\u3080\uFF08- \u3067\u6A19\u6E96\u5165\u529B\uFF09\u3002\u6539\u884C\u30FBMarkdown\
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire as __twpCreateRequire } from 'node:module';
|
|
2
2
|
const require = __twpCreateRequire(import.meta.url);
|
|
3
|
-
import{readCsvFileText}from"./chunk-I6DWJXPC.js";import{contentTypeFor,inspectLocalFile,issued}from"./chunk-VECUCVIY.js";import{checkUploadQuota}from"./chunk-DDKZ5IPT.js";import{featureLicenseGuidance}from"./chunk-
|
|
3
|
+
import{readCsvFileText}from"./chunk-I6DWJXPC.js";import{contentTypeFor,inspectLocalFile,issued}from"./chunk-VECUCVIY.js";import{checkUploadQuota}from"./chunk-DDKZ5IPT.js";import{featureLicenseGuidance}from"./chunk-SN6YG4SF.js";import{createFlags,fieldBody,hasAnyField,updateFlags}from"./chunk-KA3EE4TJ.js";import{CUSTOMERS_PATH,SALES_COMPANIES_PATH,isExactNumericId}from"./chunk-ZST7XESB.js";import{ApiError,errorListMessages}from"./chunk-IF2K4PM5.js";import{
|
|
4
4
|
isSafePathSegment}from"./chunk-GMBJTG6A.js";import{LIST_FLAGS,LIST_PAGING_HELP,envelopePaging,nonEmpty,positiveInteger}from"./chunk-R53CMVWR.js";import{requireResolved,singleRef,withResolved}from"./chunk-ZN5EFDH7.js";import{acknowledgement,isRecord,pick}from"./chunk-ZWVYVS2A.js";import{ApiRejectedError,ApiResponseError,UsageError}from"./chunk-7WSNIXTQ.js";import fs from"fs";import path from"path";function levelForbidden(licenseGuidance,levelGuidance){return body=>body?.error==="permission_denied"?licenseGuidance:levelGuidance}var COMPANY_LICENSE="\u53D6\u5F15\u5148\u3092\u6271\u3046\u306B\u306F\u8CA9\u58F2\u7BA1\u7406\u304B\u9867\u5BA2\u7BA1\u7406\u306E\u6A29\u9650\u304C\u8981\u308A\u307E\u3059\u304C\u3001\u3069\u3061\u3089\u3082\u3042\u308A\u307E\u305B\u3093\u3002\u30C6\u30CA\u30F3\u30C8\u304C\u3069\u3061\u3089\u3082\u5951\u7D04\u3057\u3066\u3044\u306A\u3044\u304B\u3001\u3042\u306A\u305F\u306E\u6A29\u9650\u304C\u3069\u3061\u3089\u3082\u300C\u306A\u3057\u300D\u306B\u306A\u3063\u3066\u3044\u307E\u3059\u3002\u30C6\u30CA\u30F3\u30C8\u7BA1\u7406\u8005\u306B\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002";
|
|
5
5
|
var CUSTOMER_LICENSE=featureLicenseGuidance("\u9867\u5BA2\u7BA1\u7406");var COMPANY_WRITE_FORBIDDEN=levelForbidden(COMPANY_LICENSE,"\u9867\u5BA2\u306E\u4F5C\u6210\u30FB\u66F4\u65B0\u306B\u306F\u3001\u9867\u5BA2\u7BA1\u7406\u306E\u6A29\u9650\u304C\u300C\u7DE8\u96C6\u8005\u300D\u4EE5\u4E0A\u304B\u3001\u8CA9\u58F2\u7BA1\u7406\u306E\u6A29\u9650\u304C\u300C\u30E1\u30F3\u30D0\u30FC\u300D\u4EE5\u4E0A\u306E\u3069\u3061\u3089\u304B\u304C\u8981\u308A\u307E\u3059\u3002\u30C6\u30CA\u30F3\u30C8\u7BA1\u7406\u8005\u306B\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002");
|
|
6
6
|
var LEVEL_LABELS={admin:"\u7BA1\u7406\u8005",editor:"\u7DE8\u96C6\u8005",viewer:"\u95B2\u89A7\u8005",none:"\u306A\u3057"};var CHILD_DELETE_NEEDS="\u62C5\u5F53\u8005\u30FB\u5BFE\u5FDC\u5C65\u6B74\u306E\u524A\u9664\u306B\u306F\u9867\u5BA2\u7BA1\u7406\u306E\u6A29\u9650\u304C\u300C\u7BA1\u7406\u8005\u300D\u3067\u3042\u308B\u3053\u3068\u304C\u8981\u308A\u307E\u3059";var CUSTOMER_DELETE_FORBIDDEN=levelForbidden(COMPANY_LICENSE,"\u9867\u5BA2\u306E\u524A\u9664\u306B\u306F\u3001\u4F01\u696D\u306E\u524A\u9664\u306B\u9867\u5BA2\u7BA1\u7406\u306E\u300C\u7BA1\u7406\u8005\u300D\u304B\u8CA9\u58F2\u7BA1\u7406\u306E\u300C\u30E1\u30F3\u30D0\u30FC\u300D\u4EE5\u4E0A\u3001\u62C5\u5F53\u8005\u30FB\u5BFE\u5FDC\u5C65\u6B74\u306E\u524A\u9664\u306B\u9867\u5BA2\u7BA1\u7406\u306E\u300C\u7BA1\u7406\u8005\u300D\u304C\u8981\u308A\u307E\u3059\u3002\u30C6\u30CA\u30F3\u30C8\u7BA1\u7406\u8005\
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire as __twpCreateRequire } from 'node:module';
|
|
2
2
|
const require = __twpCreateRequire(import.meta.url);
|
|
3
|
-
import{booleanText,boundedText,isoDate}from"./chunk-UDPJ2IGK.js";import{ORG_MASTER_LIMIT}from"./chunk-
|
|
3
|
+
import{booleanText,boundedText,isoDate}from"./chunk-UDPJ2IGK.js";import{ORG_MASTER_LIMIT}from"./chunk-ZST7XESB.js";import{ULID_RE,UUID_RE,isSafePathSegment}from"./chunk-GMBJTG6A.js";import{nonEmpty,positiveInteger}from"./chunk-R53CMVWR.js";import{requireResolved,singleRef,withResolved}from"./chunk-ZN5EFDH7.js";import{acknowledgement,isRecord,pick}from"./chunk-ZWVYVS2A.js";import{ApiResponseError,UsageError}from"./chunk-7WSNIXTQ.js";var CLEAR_DATE="none";function placeholderOf(field){switch(field.kind){case"text":return`<${field.label}>`;case"integer":return"<\u6574\u6570>";case"boolean":return"<true|false>";case"enum":return`<${field.values.join("|")}>`;case"date":return`<YYYY-MM-DD|${CLEAR_DATE}>`;case"ref":return field.placeholder}}function createFlags(fields){return fields.map(field=>({name:field.flag,summary:field.summary,takesValue:true,placeholder:placeholderOf(field)}))}function updateFlags(fields){const flags=[];for(const field of fields){
|
|
4
4
|
flags.push({name:field.flag,summary:field.summary,takesValue:true,placeholder:placeholderOf(field)});if(field.kind==="ref")flags.push({name:field.clearFlag,summary:field.clearSummary,takesValue:false})}return flags}function integerValue(field,raw){const trimmed=raw.trim();const value=/^\d+$/.test(trimmed)?Number(trimmed):Number.NaN;const tooLarge=field.max!==void 0&&value>field.max;if(!Number.isSafeInteger(value)||value<field.min||tooLarge){const range=field.max!==void 0?`${field.min} \u4EE5\u4E0A ${field.
|
|
5
5
|
max} \u4EE5\u4E0B`:`${field.min} \u4EE5\u4E0A`;throw new UsageError(`${field.flag} \u306F ${range}\u306E\u6574\u6570\u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044: ${raw}`,`${field.label}\u3092\u6574\u6570\u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002`)}return value}function fieldBody(input,fields){const body={};for(const field of fields){switch(field.kind){case"text":{const value=boundedText(input,field.flag,{maxChars:field.maxChars,label:field.label});if(value!==void 0)body[field.
|
|
6
6
|
key]=value;break}case"integer":{const raw=input.flags.get(field.flag);if(raw!==void 0)body[field.key]=integerValue(field,raw);break}case"boolean":{const raw=input.flags.get(field.flag);if(raw!==void 0)body[field.key]=booleanText(field.flag,raw);break}case"enum":{const raw=input.flags.get(field.flag);if(raw===void 0)break;const value=raw.trim().toLowerCase();if(!field.values.includes(value)){throw new UsageError(`${field.flag} \u306B\u300C${raw}\u300D\u306F\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093`,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire as __twpCreateRequire } from 'node:module';
|
|
2
2
|
const require = __twpCreateRequire(import.meta.url);
|
|
3
|
-
import{renderOutput}from"./chunk-6NEQ6PZZ.js";import{redactSecretValues,redactSecrets,withDebug}from"./chunk-BUZKNZ45.js";import{loadDomain}from"./chunk-
|
|
3
|
+
import{renderOutput}from"./chunk-6NEQ6PZZ.js";import{redactSecretValues,redactSecrets,withDebug}from"./chunk-BUZKNZ45.js";import{loadDomain}from"./chunk-R64SA5WZ.js";import{evaluateQuery}from"./chunk-GDM2QUBL.js";import{parseOperationArgs}from"./chunk-IOGVQVGD.js";import{Resolver,requireDefaultProject}from"./chunk-ZST7XESB.js";import{ApiError,MultipartBody,TwpApiClient,appendQuery}from"./chunk-IF2K4PM5.js";import{ResolveError}from"./chunk-GMBJTG6A.js";
|
|
4
4
|
import{GLOBAL_OPTIONS_HELP}from"./chunk-TAN5I2DP.js";import{AuthSession,NotLoggedInError,SessionExpiredError,loadCredentials}from"./chunk-XNLIEUAW.js";import{httpFetch}from"./chunk-J7QYPKVK.js";import{effectiveApiUrl,loadUserConfig,resolveConfiguredOutput,resolveProfile}from"./chunk-4VZKNEVN.js";import{HELP_TOKEN}from"./chunk-523KROGI.js";import{OUTPUT_FORMATS,resolveOutputFormat}from"./chunk-K2ONOH3L.js";import{stringWidth}from"./chunk-WVS4W5FY.js";import{
|
|
5
5
|
stripTerminalControls}from"./chunk-NHYMHCAT.js";import{DEFAULT_MAX_ITEMS,DEFAULT_MAX_PAGES,nextPageNotes,positiveInteger,shellQuote}from"./chunk-R53CMVWR.js";import{ApiRejectedError,ApiResponseError,EXIT_API_CLIENT,EXIT_API_SERVER,EXIT_AUTH,EXIT_FAILURE,EXIT_OK,EXIT_USAGE,NetworkError,UsageError}from"./chunk-7WSNIXTQ.js";import fs from"fs";import path from"path";var NO_REDACT_FLAG={name:"--no-redact",summary:"\u5FDC\u7B54\u306E\u4F0F\u5B57\u5316\u3092\u89E3\u9664\u3057\u3066\u751F\u306E\u5024\u3092\u51FA\u3059\uFF08\u9375\u306E\u53D7\u3051\u53D6\u308A\u7B49\uFF09",takesValue:false};var NO_REDACT_NOTICE="\u6CE8\u8A18: --no-redact \u306E\u305F\u3081\u51FA\u529B\u3092\u4F0F\u5B57\u5316\u3057\u307E\u305B\u3093\uFF08\u7AEF\u672B\u3068\u30ED\u30B0\u306B\u5E73\u6587\u3067\u6B8B\u308A\u307E\u3059\uFF09\u3002";function withCommonFlags(flags){return flags.some(flag=>flag.
|
|
6
6
|
name===NO_REDACT_FLAG.name)?flags:[...flags,NO_REDACT_FLAG]}function alignedList(entries,indent=" "){const width=entries.reduce((max,[left])=>Math.max(max,stringWidth(left)),0);return entries.map(([left,right])=>`${indent}${left}${" ".repeat(Math.max(0,width-stringWidth(left)))} ${right}`).join("\n")}function subresourcesOf(resource){return resource.subresources??[]}function renderResourceHelp(resource,path2){const subresources=subresourcesOf(resource);const operationSection=resource.operations.length===0?"":`
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { createRequire as __twpCreateRequire } from 'node:module';
|
|
2
|
+
const require = __twpCreateRequire(import.meta.url);
|
|
3
|
+
var LOADERS={"agent-loop":async()=>(await import("./agent-loop-SP2UKXIG.js")).agentLoopDomain,attendance:async()=>(await import("./attendance-ZWVZGVBE.js")).attendanceDomain,backlog:async()=>(await import("./backlog-33ELMSV6.js")).backlogDomain,company:async()=>(await import("./company-DH4H6HXD.js")).companyDomain,customer:async()=>(await import("./company-DH4H6HXD.js")).customerDomain,department:async()=>(await import("./department-NEDSHJJK.js")).departmentDomain,estimate:async()=>(await import("./sales-2WX46SHN.js")).
|
|
4
|
+
estimateDomain,inquiry:async()=>(await import("./inquiry-CUK2LWQK.js")).inquiryDomain,invoice:async()=>(await import("./sales-2WX46SHN.js")).invoiceDomain,"job-title":async()=>(await import("./job-title-USZK3QZS.js")).jobTitleDomain,leave:async()=>(await import("./leave-6UB43UT5.js")).leaveDomain,media:async()=>(await import("./media-3L4JSXC6.js")).mediaDomain,notification:async()=>(await import("./notification-MCABOEFM.js")).notificationDomain,position:async()=>(await import("./position-D7BUAIH4.js")).
|
|
5
|
+
positionDomain,project:async()=>(await import("./project-ROLQ535L.js")).projectDomain,prospect:async()=>(await import("./prospect-MOBECADA.js")).prospectDomain,report:async()=>(await import("./report-U2ZFPO33.js")).reportDomain,shift:async()=>(await import("./attendance-lists-F2KTIJZA.js")).shiftDomain,storage:async()=>(await import("./storage-ANKKJJJO.js")).storageDomain,task:async()=>(await import("./task-KPRX3OQX.js")).taskDomain,user:async()=>(await import("./user-VY35MTY3.js")).
|
|
6
|
+
userDomain,workchange:async()=>(await import("./attendance-lists-F2KTIJZA.js")).workchangeDomain,workflow:async()=>(await import("./workflow-5DFICP3M.js")).workflowDomain};async function loadDomain(name){return LOADERS[name]()}export{loadDomain};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire as __twpCreateRequire } from 'node:module';
|
|
2
2
|
const require = __twpCreateRequire(import.meta.url);
|
|
3
|
-
import{repeatedValues}from"./chunk-IOGVQVGD.js";import{isoDate}from"./chunk-UDPJ2IGK.js";import{SALES_ESTIMATES_PATH,SALES_INVOICES_PATH,isExactNumericId,resolveNamed}from"./chunk-
|
|
3
|
+
import{repeatedValues}from"./chunk-IOGVQVGD.js";import{isoDate}from"./chunk-UDPJ2IGK.js";import{SALES_ESTIMATES_PATH,SALES_INVOICES_PATH,isExactNumericId,resolveNamed}from"./chunk-ZST7XESB.js";import{LIST_PAGING_HELP,PAGE_NUMBER_LIST_FLAGS,PAGE_NUMBER_PAGING_HELP,STABLE_PAGE_ORDER,nonEmpty,pageNumberPaging,pageNumberQuery,pageRangeNotes}from"./chunk-R53CMVWR.js";import{withResolved}from"./chunk-ZN5EFDH7.js";import{isRecord,pick}from"./chunk-ZWVYVS2A.js";import{
|
|
4
4
|
ApiResponseError,UsageError}from"./chunk-7WSNIXTQ.js";var ESTIMATE_STATUSES={new:"\u4F5C\u6210\u4E2D",create_completed:"\u4F5C\u6210\u5B8C\u4E86",in_progress:"\u7533\u8ACB\u4E2D",approved:"\u627F\u8A8D\u6E08",submitted:"\u63D0\u793A\u6E08",rejected:"\u5DEE\u3057\u623B\u3057",deleted:"\u524A\u9664\u6E08"};var INVOICE_STATUSES={new:"\u4F5C\u6210\u4E2D",create_completed:"\u4F5C\u6210\u5B8C\u4E86",in_progress:"\u7533\u8ACB\u4E2D",approved:"\u627F\u8A8D\u6E08",rejected:"\u5DEE\u3057\u623B\u3057",submitted:"\u63D0\u793A\u6E08",manager_confirmation:"\u6848\u4EF6\u62C5\u5F53\u8005\
|
|
5
5
|
_\u6848\u4EF6\u5185\u5BB9\u30FB\u91D1\u984D\u78BA\u8A8D",invoice_issued:"\u8ACB\u6C42\u66F8\u767A\u884C\u6E08",sent_to_client:"\u5148\u65B9\u9001\u4ED8\u6E08",archived:"\u4FDD\u7BA1\u6E08",deleted:"\u524A\u9664\u6E08",cancelled:"\u53D6\u6D88\uFF08\u7121\u52B9\uFF09",lost:"\u5931\u6CE8"};var ALLOCATION_STATUSES={unallocated:"\u672A\u56DE\u53CE",allocated:"\u56DE\u53CE\u6E08"};function statusRefs(table){return Object.entries(table).map(([code,name])=>({id:code,name,code}))}function statusHelp(table){
|
|
6
6
|
return Object.entries(table).map(([code,name])=>`${code}\uFF08${name}\uFF09`).join(" / ")}function licenseForbidden(guidance){return body=>body?.error==="permission_denied"?guidance:void 0}function featureLicenseGuidance(feature){return`${feature}\u3092\u4F7F\u3046\u6A29\u9650\u304C\u3042\u308A\u307E\u305B\u3093\u3002\u30C6\u30CA\u30F3\u30C8\u304C${feature}\u3092\u5951\u7D04\u3057\u3066\u3044\u306A\u3044\u304B\u3001\u3042\u306A\u305F\u306E${feature}\u306E\u6A29\u9650\u304C\u300C\u306A\u3057\u300D\u306B\u306A\u3063\u3066\u3044\u307E\u3059\u3002\u30C6\u30CA\u30F3\u30C8\u7BA1\u7406\u8005\u306B\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002`}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { createRequire as __twpCreateRequire } from 'node:module';
|
|
2
2
|
const require = __twpCreateRequire(import.meta.url);
|
|
3
|
-
import{readBody}from"./chunk-HGTG5XQ7.js";import{WORKFLOWS_PATH}from"./chunk-
|
|
4
|
-
import{acknowledgement,isRecord,pick}from"./chunk-ZWVYVS2A.js";import{ApiResponseError,UsageError}from"./chunk-7WSNIXTQ.js";import"./chunk-RZVI6PMW.js";import"./chunk-VSJBJXZO.js";var WORKFLOW_FLAG={name:"--workflow",summary:"\u7533\u8ACB\u66F8\uFF08\u30EF\u30FC\u30AF\u30D5\u30ED\u30FC\uFF09\u306E\u540D\u524D\u304B ID \u3067\u7D5E\u308A\u8FBC\u3080",takesValue:true,placeholder:"<\u30EF\u30FC\u30AF\u30D5\u30ED\u30FC>"};var CATEGORIES={undefined:"\u6C4E\u7528",paid_holiday:"\u6709\u7D66\u4F11\u6687",substitute_holiday:"\u632F\u66FF\u4F11\u6687",comp_holiday:"\u4EE3\u4F11",absence:"\u6B20\u52E4",special_holiday:"\u7279\u5225\u4F11\u6687",other_leave:"\u305D\u306E\u4ED6\u4F11\u6687\u30FB\u6B20\u52E4",
|
|
3
|
+
import{readBody}from"./chunk-HGTG5XQ7.js";import{WORKFLOWS_PATH}from"./chunk-ZST7XESB.js";import{UUID_RE,isSafePathSegment}from"./chunk-GMBJTG6A.js";import{LIST_FLAGS,LIST_PAGING_HELP,envelopePaging,nonEmpty,positiveInteger}from"./chunk-R53CMVWR.js";import{requireResolved,singleRef,withResolved}from"./chunk-ZN5EFDH7.js";import{acknowledgement,isRecord,pick}from"./chunk-ZWVYVS2A.js";import{ApiResponseError,UsageError}from"./chunk-7WSNIXTQ.js";var WORKFLOW_FLAG={name:"--workflow",summary:"\u7533\u8ACB\u66F8\uFF08\u30EF\u30FC\u30AF\u30D5\u30ED\u30FC\uFF09\u306E\u540D\u524D\u304B ID \u3067\u7D5E\u308A\u8FBC\u3080",takesValue:true,placeholder:"<\u30EF\u30FC\u30AF\u30D5\u30ED\u30FC>"};var CATEGORIES={undefined:"\u6C4E\u7528",paid_holiday:"\u6709\u7D66\u4F11\u6687",substitute_holiday:"\u632F\u66FF\u4F11\u6687",comp_holiday:"\u4EE3\u4F11",absence:"\u6B20\u52E4",special_holiday:"\u7279\u5225\u4F11\u6687",other_leave:"\u305D\u306E\u4ED6\u4F11\u6687\u30FB\u6B20\u52E4",
|
|
5
4
|
sales:"\u53D6\u5F15",commuting_expenses:"\u901A\u52E4\u4EA4\u901A\u8CBB",cms_publish:"\u30B3\u30F3\u30C6\u30F3\u30C4\u516C\u958B",equipment_lending:"\u5099\u54C1\u8CB8\u51FA",ai_tool_license:"AI\u30C4\u30FC\u30EB\u30E9\u30A4\u30BB\u30F3\u30B9",qualification_bonus:"\u5408\u683C\u304A\u795D\u3044\u91D1"};var CATEGORY_HELP=`\u30AB\u30C6\u30B4\u30EA: ${Object.entries(CATEGORIES).map(([key,label])=>`${key}\uFF08${label}\uFF09`).join(" / ")}`;var WORKFLOW_STATUSES=["active","inactive","draft"];var INSTANCE_STATUSES=[
|
|
6
5
|
"new","in_progress","approved","rejected","canceled","sent_back"];var INSTANCE_STATUS_HELP="\u72B6\u614B: new\uFF08\u4E0B\u66F8\u304D\uFF09/ in_progress\uFF08\u627F\u8A8D\u5F85\u3061\uFF09/ approved\uFF08\u627F\u8A8D\u6E08\u307F\uFF09/ rejected\uFF08\u5374\u4E0B\uFF09/ canceled\uFF08\u53D6\u6D88\uFF09/ sent_back\uFF08\u5DEE\u3057\u623B\u3057\uFF09";var WORKFLOW_COLUMNS=["id","name","defined_category","status","is_hidden","valid_from","valid_to"];var WORKFLOW_ADMIN_COLUMNS=[...WORKFLOW_COLUMNS,"s\
|
|
7
6
|
tep_count"];var WORKFLOW_GET_COLUMNS=["id","name","defined_category","status","is_hidden","valid_from","valid_to","description"];var INSTANCE_COLUMNS=["id","title","workflow_name","status","current_step_no","applicant_name","applied_at","completed_at"];var INSTANCE_GET_COLUMNS=["id","title","workflow_id","workflow_name","status","current_step_no","applicant_name","applied_at","completed_at","can_approve","is_editable","is_cancelable"];var PENDING_COLUMNS=["id","title","workflow_name","applicant_\
|
|
@@ -36,16 +35,16 @@ includes(key));if(unknown.length>0){throw new UsageError(`\u7533\u8ACB\u5185\u5B
|
|
|
36
35
|
CONTENT_HELP)}return parsed}async function readContent(input,usage){const text=await readBody(input,{flag:"--content",fileFlag:CONTENT_FILE_FLAG.name,label:"\u7533\u8ACB\u5185\u5BB9",maxChars:CONTENT_MAX_CHARS,usage});return text===void 0?void 0:parseInstanceContent(text,`${CONTENT_FILE_FLAG.name} ${input.flags.get(CONTENT_FILE_FLAG.name)??""}`,usage)}function createInstancePlan(workflowId2,content={}){return{method:"POST",path:INSTANCES_PATH,body:{...content,workflow_id:workflowId2}}}function applyInstancePlan(instanceId){
|
|
37
36
|
return{method:"POST",path:idPath(INSTANCES_PATH,instanceId,"\u7533\u8ACB")+"/apply",body:{}}}function writtenInstance(body){return objectOf(body,"instance","\u7533\u8ACB")}function serverMessage(body){return isRecord(body)&&typeof body["message"]==="string"&&body["message"]!==""?[body["message"]]:[]}var WRITE_COLUMNS=["id","title","workflow_name","status","current_step_no","applied_at","completed_at"];function columnList(definition){if(definition===void 0||definition===null||definition==="")return[];
|
|
38
37
|
if(typeof definition==="string"){try{return columnList(JSON.parse(definition))}catch{return void 0}}if(Array.isArray(definition))return definition;if(!isRecord(definition))return void 0;const list=definition["form_column_list"]??definition["fields"];return Array.isArray(list)?list:void 0}function str(value){return typeof value==="string"&&value!==""?value:void 0}function formColumns(workflow){const list=columnList(workflow["form_definition"]);const columns=list?.map(column=>{if(!isRecord(column))
|
|
39
|
-
return void 0;const name=str(column["name"])??str(column["column_name"]);if(name===void 0)return void 0;const
|
|
40
|
-
required"]===true,options,defaultValue:column["default_value"]}});if(columns===void 0||columns.some(column=>column===void 0)){throw new ApiResponseError("\u7533\u8ACB\u66F8\u306E form_definition \u3092\u8AAD\u3081\u307E\u305B\u3093\u3002\u63A5\u7D9A\u5148\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002")}return columns}var MULTI_VALUE_TYPES=new Set(
|
|
41
|
-
[]:column.type==="boolean"?false:null;const value=column.defaultValue;if(value===void 0||value===null||value==="")return fallback;if(multi!==Array.isArray(value))return fallback;return value}function skeleton(body){const workflow=objectOf(body,"workflow","\u30EF\u30FC\u30AF\u30D5\u30ED\u30FC\u8A73\u7D30");const formData={};for(const column of formColumns(workflow))
|
|
42
|
-
const columns=formColumns(objectOf(body,"workflow","\u30EF\u30FC\u30AF\u30D5\u30ED\u30FC\u8A73\u7D30"));if(columns.length===0)return["\u3053\u306E\u7533\u8ACB\u66F8\u306B\u5165\u529B\u9805\u76EE\u306F\u3042\u308A\u307E\u305B\u3093\uFF08form_data \u306F\u7A7A\u306E\u307E\u307E\u3067\u7533\u8ACB\u3067\u304D\u307E\u3059\uFF09"];return[`\u5165\u529B\u9805\u76EE: ${String(
|
|
43
|
-
\uFF08${column.type??"\u578B\u4E0D\u660E"}${column.required?"\u30FB\u5FC5\u9808":""}\uFF09${column.options.length>0?` \u9078\u629E\u80A2: ${column.options.join(" / ")}`:""}`),"\u5FC5\u9808\u306E\u9805\u76EE\
|
|
44
|
-
skeleton"]!=="boolean"){throw new Error("\u5185\u90E8\u30A8\u30E9\u30FC: instance create \u306E\u5FDC\u7B54\u306B\u5370\u304C\u3042\u308A\u307E\u305B\u3093\uFF08execute \u306E\u914D\u7DDA\u6F0F\u308C\uFF09")}return value}function createOperationPlan(input){const id=requireResolved(input,"workflowId");if(input.flags.has(SKELETON_FLAG.name))return{method:"GET",path:idPath(WORKFLOWS_PATH,id,"\u30EF\u30FC\u30AF\u30D5\u30ED\u30FC")};const raw=input.
|
|
45
|
-
void 0?{}:JSON.parse(raw))}var CREATE_USAGE="twp workflow instance create --workflow <\u30EF\u30FC\u30AF\u30D5\u30ED\u30FC> [--content-file <\u30D1\u30B9>] [--generate-cli-skeleton]";var APPLY_USAGE="twp workflow instance apply <\u7533\u8ACBID>";var UPDATE_USAGE="twp workflow instance update <\u7533\u8ACBID> --content-file <\u30D1\u30B9>";var DELETE_USAGE="twp workflow instance delete <\u7533\u8ACBID> --yes";var instanceWriteOperations=[{name:"
|
|
46
|
-
apply\uFF09",usage:CREATE_USAGE,description:`POST /api/v2/workflows/instances \u3067\u7533\u8ACB\u3092\u4E0B\u66F8\u304D\uFF08\u72B6\u614B new\uFF09\u3068\u3057\u3066\u4F5C\u308A\u307E\u3059\u3002\u627F\u8A8D\u8005\u3078\u306F\u307E\u3060\u5C4A\u304D\u307E\u305B\u3093\u3002
|
|
38
|
+
return void 0;const name=str(column["name"])??str(column["column_name"]);if(name===void 0)return void 0;const choices=Array.isArray(column["options"])?column["options"].flatMap(option=>{if(typeof option==="string")return[{key:option,label:null}];if(!isRecord(option)||option["is_legacy"]===true)return[];return[{key:String(option["key"]),label:String(option["value"])}]}):[];const options=choices.map(choice=>choice.label===null?choice.key:`${choice.key}=${choice.label}`);return{name,displayName:str(
|
|
39
|
+
column["display_name"])??str(column["label"])??"",type:str(column["type"])??str(column["column_type"]),required:column["required"]===true,options,optionKeys:choices.map(choice=>choice.key),defaultValue:column["default_value"]}});if(columns===void 0||columns.some(column=>column===void 0)){throw new ApiResponseError("\u7533\u8ACB\u66F8\u306E form_definition \u3092\u8AAD\u3081\u307E\u305B\u3093\u3002\u63A5\u7D9A\u5148\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002")}return columns}var MULTI_VALUE_TYPES=new Set(
|
|
40
|
+
["checkbox","tag"]);function emptyValue(column){const multi=column.type!==void 0&&MULTI_VALUE_TYPES.has(column.type);const fallback=multi?[]:column.type==="boolean"?false:null;const value=column.defaultValue;if(value===void 0||value===null||value==="")return fallback;if(multi!==Array.isArray(value))return fallback;return value}function skeleton(body){const workflow=objectOf(body,"workflow","\u30EF\u30FC\u30AF\u30D5\u30ED\u30FC\u8A73\u7D30");const formData={};for(const column of formColumns(workflow))
|
|
41
|
+
formData[column.name]=emptyValue(column);return{title:workflow["name"]??null,description:null,form_data:formData}}function skeletonNotes(body){const columns=formColumns(objectOf(body,"workflow","\u30EF\u30FC\u30AF\u30D5\u30ED\u30FC\u8A73\u7D30"));if(columns.length===0)return["\u3053\u306E\u7533\u8ACB\u66F8\u306B\u5165\u529B\u9805\u76EE\u306F\u3042\u308A\u307E\u305B\u3093\uFF08form_data \u306F\u7A7A\u306E\u307E\u307E\u3067\u7533\u8ACB\u3067\u304D\u307E\u3059\uFF09"];return[`\u5165\u529B\u9805\u76EE: ${String(
|
|
42
|
+
columns.length)} \u9805\u76EE\uFF08form_data \u306E\u30AD\u30FC\uFF09`,...columns.map(column=>` ${column.name}: ${column.displayName}\uFF08${column.type??"\u578B\u4E0D\u660E"}${column.required?"\u30FB\u5FC5\u9808":""}\uFF09${column.options.length>0?` \u9078\u629E\u80A2: ${column.options.join(" / ")}`:""}`),"\u5FC5\u9808\u306E\u9805\u76EE\u304C\u7A7A\u306E\u307E\u307E\u3060\u3068\u3001\u63D0\u51FA\uFF08twp workflow instance apply\uFF09\u3067\u30B5\u30FC\u30D0\u304C\u65AD\u308A\u307E\u3059\u3002\u4E0B\u66F8\u304D\u306F\u7A7A\u306E\u307E\u307E\u3067\u3082\u4F5C\u308C\u307E\u3059"]}
|
|
43
|
+
function createResult(value){if(!isRecord(value)||typeof value["skeleton"]!=="boolean"){throw new Error("\u5185\u90E8\u30A8\u30E9\u30FC: instance create \u306E\u5FDC\u7B54\u306B\u5370\u304C\u3042\u308A\u307E\u305B\u3093\uFF08execute \u306E\u914D\u7DDA\u6F0F\u308C\uFF09")}return value}function createOperationPlan(input){const id=requireResolved(input,"workflowId");if(input.flags.has(SKELETON_FLAG.name))return{method:"GET",path:idPath(WORKFLOWS_PATH,id,"\u30EF\u30FC\u30AF\u30D5\u30ED\u30FC")};const raw=input.
|
|
44
|
+
resolved?.["content"];return createInstancePlan(id,raw===void 0?{}:JSON.parse(raw))}var CREATE_USAGE="twp workflow instance create --workflow <\u30EF\u30FC\u30AF\u30D5\u30ED\u30FC> [--content-file <\u30D1\u30B9>] [--generate-cli-skeleton]";var APPLY_USAGE="twp workflow instance apply <\u7533\u8ACBID>";var UPDATE_USAGE="twp workflow instance update <\u7533\u8ACBID> --content-file <\u30D1\u30B9>";var DELETE_USAGE="twp workflow instance delete <\u7533\u8ACBID> --yes";var instanceWriteOperations=[{name:"\
|
|
45
|
+
create",summary:"\u7533\u8ACB\u3092\u4E0B\u66F8\u304D\u3067\u4F5C\u308B\uFF08\u63D0\u51FA\u306F twp workflow instance apply\uFF09",usage:CREATE_USAGE,description:`POST /api/v2/workflows/instances \u3067\u7533\u8ACB\u3092\u4E0B\u66F8\u304D\uFF08\u72B6\u614B new\uFF09\u3068\u3057\u3066\u4F5C\u308A\u307E\u3059\u3002\u627F\u8A8D\u8005\u3078\u306F\u307E\u3060\u5C4A\u304D\u307E\u305B\u3093\u3002
|
|
47
46
|
--workflow \u306F\u7533\u8ACB\u66F8\u306E\u540D\u524D\u304B ID\uFF08UUID\uFF09\u3067\u3059\u3002\u540D\u524D\u306F\u81EA\u5206\u304C\u7533\u8ACB\u3067\u304D\u308B\u7533\u8ACB\u66F8\u304B\u3089\u5B8C\u5168\u4E00\u81F4\u3067\u63A2\u3057\u307E\u3059
|
|
48
|
-
\uFF08\u975E\u8868\u793A\u306E\u7533\u8ACB\u66F8\u306F ID \u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\uFF09\u3002
|
|
47
|
+
\uFF08\u975E\u8868\u793A\u306E\u7533\u8ACB\u66F8\u306F ID \u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\uFF09\u3002ID \u3067\u6307\u3057\u3066\u3082\u3001\u7121\u52B9\u30FB\u6709\u52B9\u671F\u9593\u5916\u30FB\u7533\u8ACB\u5BFE\u8C61\u8005\u5916\u306E\u7533\u8ACB\u66F8\u306F\u30B5\u30FC\u30D0\u304C\u65AD\u308A\u307E\u3059\u3002
|
|
49
48
|
--content-file \u3092\u7701\u304F\u3068\u3001\u30BF\u30A4\u30C8\u30EB\u306F\u7533\u8ACB\u66F8\u306E\u540D\u524D\u30FB\u5165\u529B\u9805\u76EE\u306F\u7A7A\u306E\u4E0B\u66F8\u304D\u306B\u306A\u308A\u307E\u3059\u3002
|
|
50
49
|
|
|
51
50
|
${CONTENT_HELP}
|
|
@@ -58,7 +57,7 @@ ${CONTENT_HELP}
|
|
|
58
57
|
CREATE_USAGE)}const content=wantsSkeleton?void 0:await readContent(input,CREATE_USAGE);const ref=nonEmpty(input.flags,WORKFLOW_FLAG.name);if(ref===void 0){throw new UsageError("\u7533\u8ACB\u66F8\u3092 --workflow <\u540D\u524D|ID> \u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044",CREATE_USAGE)}return withResolved(input,{workflowId:await workflowId(ref.trim(),ctx,WORKFLOW_FLAG.name),...content===void 0?{}:{content:JSON.stringify(content)}})},plan:createOperationPlan,execute:async(input,ctx)=>({
|
|
59
58
|
skeleton:input.flags.has(SKELETON_FLAG.name),body:await ctx.send(createOperationPlan(input))}),plannedNotes:input=>input.flags.has(SKELETON_FLAG.name)?["\u7533\u8ACB\u66F8\u306E\u5B9A\u7FA9\u3092\u8AAD\u3080\u3060\u3051\u3067\u3001\u7533\u8ACB\u306F\u4F5C\u308A\u307E\u305B\u3093"]:["\u4E0B\u66F8\u304D\u3068\u3057\u3066\u4F5C\u308A\u307E\u3059\uFF08\u63D0\u51FA\u306F twp workflow instance apply\uFF09"],summarize(value){const result=createResult(value);return result.skeleton?skeleton(result.body):
|
|
60
59
|
pick(writtenInstance(result.body),WRITE_COLUMNS)},raw(value){const result=createResult(value);return result.skeleton?skeleton(result.body):writtenInstance(result.body)},notes(value){const result=createResult(value);return result.skeleton?skeletonNotes(result.body):serverMessage(result.body)}},{name:"apply",summary:"\u4E0B\u66F8\u304D\uFF08\u307E\u305F\u306F\u5DEE\u3057\u623B\u3057\u30FB\u5374\u4E0B\u3055\u308C\u305F\u7533\u8ACB\uFF09\u3092\u63D0\u51FA\u3059\u308B",usage:APPLY_USAGE,description:"\
|
|
61
|
-
POST /api/v2/workflows/instances/{id}/apply \u3067\u7533\u8ACB\u3092\u63D0\u51FA\u3057\u307E\u3059\u3002\u6700\u521D\u306E\u627F\u8A8D\u8005\u3078\u901A\u77E5\u304C\u5C4A\u304D\u307E\u3059\u3002\n\u63D0\u51FA\u3067\u304D\u308B\u306E\u306F\u81EA\u5206\u306E\u4E0B\u66F8\u304D\uFF08new\uFF09\u30FB\u5DEE\u3057\u623B\u3055\u308C\u305F\u7533\u8ACB\uFF08sent_back\uFF09\u30FB\u5374\u4E0B\u3055\u308C\u305F\u7533\u8ACB\uFF08rejected\uFF09\u3067\u3059\u3002\n\u5185\u5BB9\u306F\u4ECA\u306E\u7533\u8ACB\u306E\u307E\u307E\u9001\u308A\u307E\u3059\uFF08\u5909\u3048\u308B\u306A\u3089\u5148\u306B twp workflow instance update\uFF09\u3002\n\
|
|
60
|
+
POST /api/v2/workflows/instances/{id}/apply \u3067\u7533\u8ACB\u3092\u63D0\u51FA\u3057\u307E\u3059\u3002\u6700\u521D\u306E\u627F\u8A8D\u8005\u3078\u901A\u77E5\u304C\u5C4A\u304D\u307E\u3059\u3002\n\u63D0\u51FA\u3067\u304D\u308B\u306E\u306F\u81EA\u5206\u306E\u4E0B\u66F8\u304D\uFF08new\uFF09\u30FB\u5DEE\u3057\u623B\u3055\u308C\u305F\u7533\u8ACB\uFF08sent_back\uFF09\u30FB\u5374\u4E0B\u3055\u308C\u305F\u7533\u8ACB\uFF08rejected\uFF09\u3067\u3059\u3002\n\u5185\u5BB9\u306F\u4ECA\u306E\u7533\u8ACB\u306E\u307E\u307E\u9001\u308A\u307E\u3059\uFF08\u5909\u3048\u308B\u306A\u3089\u5148\u306B twp workflow instance update\uFF09\u3002\n\u5FC5\u9808\u306E\u5165\u529B\u9805\u76EE\u304C\u7A7A\u3060\u3068\u3001\u30B5\u30FC\u30D0\u304C\u63D0\u51FA\u3092\u65AD\u308A\u307E\u3059\uFF08\u300C\u25EF\u25EF\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044\u300D\uFF09\u3002\u7A7A\u767D\u3060\u3051\u306E\u6587\u5B57\u5217\u3082\u7A7A\u3068\u307F\u306A\u3055\u308C\u307E\u3059\u3002\n\u4E0B\u66F8\u304D\u304B\u3089\u306E\u6700\u521D\u306E\u63D0\u51FA\u3067\u306F\u3001\u305D\u306E\u7533\u8ACB\u66F8\u3092\u4ECA\u3082\u7533\u8ACB\u3067\u304D\u308B\u304B\uFF08\u72B6\u614B\u30FB\u6709\u52B9\u671F\u9593\u30FB\u7533\u8ACB\u5BFE\u8C61\u8005\uFF09\u3082\u6539\u3081\u3066\u691C\u67FB\u3055\u308C\u307E\u3059\u3002\n \u57CB\u307E\u3063\u3066\u3044\u308B\u304B\u306F twp workflow instance get <\u7533\u8ACBID> --output json \u306E form_data \u3067\u78BA\u304B\u3081\u3089\u308C\u307E\u3059\u3002",
|
|
62
61
|
flags:[],plan:input=>applyInstancePlan(instanceIdArg(input,APPLY_USAGE)),plannedNotes:()=>["\u63D0\u51FA\u3059\u308B\u3068\u627F\u8A8D\u8005\u3078\u901A\u77E5\u304C\u5C4A\u304D\u307E\u3059"],summarize:body=>pick(writtenInstance(body),WRITE_COLUMNS),raw:writtenInstance,notes:serverMessage},{name:"update",summary:"\u63D0\u51FA\u524D\uFF08\u4E0B\u66F8\u304D\u30FB\u5DEE\u3057\u623B\u3057\u30FB\u5374\u4E0B\uFF09\u306E\u7533\u8ACB\u306E\u5185\u5BB9\u3092\u66F8\u304D\u63DB\u3048\u308B",usage:UPDATE_USAGE,
|
|
63
62
|
description:"PUT /api/v2/workflows/instances/{id} \u3067\u7533\u8ACB\u306E\u5185\u5BB9\u3092\u66F8\u304D\u63DB\u3048\u307E\u3059\u3002\u66F8\u304D\u63DB\u3048\u3089\u308C\u308B\u306E\u306F\u81EA\u5206\u306E\u7533\u8ACB\u306E\u3046\u3061\u3001\n\u4E0B\u66F8\u304D\uFF08new\uFF09\u30FB\u5DEE\u3057\u623B\u3055\u308C\u305F\u7533\u8ACB\uFF08sent_back\uFF09\u30FB\u5374\u4E0B\u3055\u308C\u305F\u7533\u8ACB\uFF08rejected\uFF09\u3067\u3059\u3002\n\u30D5\u30A1\u30A4\u30EB\u306B\u66F8\u3044\u305F\u30AD\u30FC\u3060\u3051\u3092\u9001\u308A\u307E\u3059\uFF08\u66F8\u304B\u306A\u304B\u3063\u305F title / description \u306F\u5909\u308F\u308A\u307E\u305B\u3093\uFF09\u3002\n\u26A0\uFE0F form_data \u306F\u4E38\u3054\u3068\u7F6E\u304D\u63DB\u308F\u308A\u307E\u3059\uFF08\u9805\u76EE\u3054\u3068\u306E\u30DE\u30FC\u30B8\u3067\u306F\u3042\u308A\u307E\u305B\u3093\uFF09\u3002\u4ECA\u306E\u5024\u306F\n twp workflow instance get <\u7533\u8ACBID> --output json \u306E form_data \u3067\u53D6\u308C\u307E\u3059\u3002\n\n"+
|
|
64
63
|
CONTENT_HELP,flags:[CONTENT_FILE_FLAG],async prepare(input){instanceIdArg(input,UPDATE_USAGE);const content=await readContent(input,UPDATE_USAGE);if(content===void 0||Object.keys(content).length===0){throw new UsageError("\u66F8\u304D\u63DB\u3048\u308B\u5185\u5BB9\u3092 --content-file <\u30D1\u30B9> \u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\uFF08\u7A7A\u306E\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u3067\u306F\u4F55\u3082\u5909\u308F\u308A\u307E\u305B\u3093\uFF09",UPDATE_USAGE)}return withResolved(
|
|
@@ -97,4 +96,4 @@ return count}var approvalResource={name:"approval",summary:"\u627F\u8A8D\uFF08\u
|
|
|
97
96
|
--count \u306A\u3089 approvals/pending/count\uFF09\u3092\u8868\u793A\u3057\u307E\u3059\u3002\n\u81EA\u5206\u304C\u627F\u8A8D\u8005\u306E\u7533\u8ACB\u306B\u52A0\u3048\u3066\u3001\u4EE3\u7406\u627F\u8A8D\u3092\u4EFB\u3055\u308C\u305F\u7533\u8ACB\u3082\u51FA\u307E\u3059\uFF08delegated_from_user_id \u304C\u59D4\u4EFB\u5143\uFF09\u3002\n--count \u306E --output json \u306F {count} \u3067\u3059\u3002\n\u627F\u8A8D\u30FB\u5374\u4E0B\u30FB\u5DEE\u3057\u623B\u3057\u306F twp workflow approval approve / reject / send-back <\u7533\u8ACBID> \u3067\u3059\u3002",
|
|
98
97
|
flags:[{name:"--count",summary:"\u4EF6\u6570\u3060\u3051\u3092\u51FA\u3059",takesValue:false}],plan(input){noArgs(input,PENDING_USAGE);return{method:"GET",path:`${WORKFLOWS_PATH}/approvals/pending${input.flags.has("--count")?"/count":""}`}},summarize:body=>isRecord(body)&&"count"in body&&!("list"in body)?{count:pendingCount(body)}:listRows(body,"\u627F\u8A8D\u5F85\u3061").map(row=>pick(row,PENDING_COLUMNS)),raw:body=>isRecord(body)&&"count"in body&&!("list"in body)?{count:pendingCount(body)}:listRows(
|
|
99
98
|
body,"\u627F\u8A8D\u5F85\u3061"),notes:body=>isRecord(body)&&"count"in body&&!("list"in body)?[`\u627F\u8A8D\u5F85\u3061: ${String(pendingCount(body))} \u4EF6`]:countNote(listRows(body,"\u627F\u8A8D\u5F85\u3061"),"\u627F\u8A8D\u5F85\u3061")},...APPROVAL_ACTIONS.map(approvalOperation)]};var workflowDomain={name:"workflow",summary:"\u30EF\u30FC\u30AF\u30D5\u30ED\u30FC\uFF08\u7533\u8ACB\u66F8\u306E\u5B9A\u7FA9\u30FB\u7533\u8ACB\u30FB\u627F\u8A8D\uFF09\u306E\u53C2\u7167\u3068\u7533\u8ACB\u30FB\u627F\u8A8D\u306E\u64CD\u4F5C",
|
|
100
|
-
operations:workflowOperations,subresources:[instanceResource,approvalResource]};export{
|
|
99
|
+
operations:workflowOperations,subresources:[instanceResource,approvalResource]};export{parseInstanceContent,createInstancePlan,applyInstancePlan,writtenInstance,formColumns,workflowDomain};
|
|
@@ -14,19 +14,21 @@ return notes}function punchType(input){const[kind,...rest]=input.args;if(kind===
|
|
|
14
14
|
\u9055\u3044\u307E\u3059: ${kind}\uFF08${Object.keys(PUNCH_TYPES).join(" / ")} \u306E\u3069\u308C\u304B\uFF09`,PUNCH_USAGE)}return type}function punchBody(input){const body={type:punchType(input)};if(input.flags.has("--project"))body["project_id"]=requireResolved(input,"projectId");const task=input.flags.get("--task");if(task!==void 0){if(!UUID_PATTERN.test(task.trim())){throw new UsageError(`--task \u306F\u30BF\u30B9\u30AF\u306E ID\uFF08UUID\uFF09\u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\uFF08\u53D7\u3051\u53D6\u3063\u305F\u5024: ${task}\
|
|
15
15
|
\uFF09`,"ID \u306F twp task get <\u30AD\u30FC> --query id \u3067\u5206\u304B\u308A\u307E\u3059")}body["task_id"]=task.trim()}const memo=input.flags.get("--memo");if(memo!==void 0){if([...memo].length>MEMO_MAX){throw new UsageError(`--memo \u306F ${MEMO_MAX} \u6587\u5B57\u4EE5\u5185\u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\uFF08${[...memo].length} \u6587\u5B57\uFF09`,PUNCH_USAGE)}body["memo"]=memo}return body}function punchPlan(input){return{method:"POST",path:"/api/v1/attendance/pun\
|
|
16
16
|
ch",body:punchBody(input)}}async function assertCurrentMonthOpen(ctx){const sheet=timesheetBody(await ctx.send({method:"GET",path:"/api/v1/attendance/timesheet"}));if(sheet["is_closed"]===true){const at=typeof sheet["closed_at"]==="string"?`\uFF08${sheet["closed_at"]} \u306B\u7DE0\u3081\uFF09`:"";throw new ApiRejectedError(`${String(sheet["year_month"])} \u306F\u7DE0\u3081\u6E08\u307F\u306E\u305F\u3081\u6253\u523B\u3092\u9001\u308A\u307E\u305B\u3093\u3067\u3057\u305F${at}\u3002\u30B5\u30FC\u30D0\u306F\u7DE0\u3081\u6E08\u307F\u306E\u6708\u3078\u306E\u6253\u523B\u3092\u62D2\u5426\u305B\u305A\u7DE0\u3081\u306E\u96C6\
|
|
17
|
-
\u8A08\u3092\u6D17\u3044\u66FF\u3048\u308B\u306E\u3067\u3001CLI \u304C\u9001\u308B\u524D\u306B\u6B62\u3081\u3066\u3044\u307E\u3059\u3002\u7DE0\u3081\u306E\u89E3\u9664\u306F\u52E4\u6020\u306E\u7BA1\u7406\u8005\u306B\u4F9D\u983C\u3057\u3066\u304F\u3060\u3055\u3044\u3002`)}}async function
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
user_name"
|
|
23
|
-
user)?user:{};return pick({user_name:row["user_name"],
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
17
|
+
\u8A08\u3092\u6D17\u3044\u66FF\u3048\u308B\u306E\u3067\u3001CLI \u304C\u9001\u308B\u524D\u306B\u6B62\u3081\u3066\u3044\u307E\u3059\u3002\u7DE0\u3081\u306E\u89E3\u9664\u306F\u52E4\u6020\u306E\u7BA1\u7406\u8005\u306B\u4F9D\u983C\u3057\u3066\u304F\u3060\u3055\u3044\u3002`)}}async function assertMonthsOpen(ctx,months,action){for(const month of[...new Set(months)]){const sheet=timesheetBody(await ctx.send({method:"GET",path:"/api/v1/attendance/timesheet",query:{year_month:month}}));if(sheet["is_close\
|
|
18
|
+
d"]===true){const at=typeof sheet["closed_at"]==="string"?`\uFF08${sheet["closed_at"]} \u306B\u7DE0\u3081\uFF09`:"";throw new ApiRejectedError(`${month} \u306F\u7DE0\u3081\u6E08\u307F\u306E\u305F\u3081${action}\u3092\u9001\u308A\u307E\u305B\u3093\u3067\u3057\u305F${at}\u3002\u7DE0\u3081\u305F\u6708\u3078\u4F11\u6687\u3092\u8DB3\u3059\u3068\u78BA\u5B9A\u3057\u305F\u96C6\u8A08\u3068\u98DF\u3044\u9055\u3046\u306E\u3067\u3001CLI \u304C\u9001\u308B\u524D\u306B\u6B62\u3081\u3066\u3044\u307E\u3059\u3002\u7DE0\u3081\u306E\u89E3\u9664\u306F\u52E4\u6020\u306E\u7BA1\u7406\u8005\u306B\u4F9D\u983C\u3057\u3066\u304F\u3060\u3055\u3044\u3002`)}}}
|
|
19
|
+
async function punch(input,ctx){const plan=punchPlan(input);await assertCurrentMonthOpen(ctx);return ctx.send(plan)}function punchRecord(body){const record=isRecord(body)?body["record"]:void 0;if(!isRecord(record)||typeof record["type"]!=="string"){throw new ApiResponseError("\u6253\u523B\u306E\u5FDC\u7B54\u306B\u6253\u523B\u8A18\u9332\uFF08type\uFF09\u304C\u3042\u308A\u307E\u305B\u3093\u3002\u63A5\u7D9A\u5148\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002")}return record}var OVERTIME_USAGE="\
|
|
20
|
+
twp attendance overtime [--month <YYYY-MM>] [--agreement36]";var CLOSINGS_LIST_USAGE="twp attendance closings list [--month <YYYY-MM>] [--include-hidden]";var FORBIDDEN_ADMIN="\u52E4\u6020\u306E\u7BA1\u7406\u8005\u6A29\u9650\uFF08\u52E4\u6020: \u7BA1\u7406\u8005\uFF09\u304C\u5FC5\u8981\u3067\u3059\u3002\u30C6\u30CA\u30F3\u30C8\u306E\u7BA1\u7406\u8005\u306B\u6A29\u9650\u306E\u4ED8\u4E0E\u3092\u4F9D\u983C\u3057\u3066\u304F\u3060\u3055\u3044";var OVERTIME_SCOPE_NOTE="\u5BFE\u8C61\u306F\u3001\u3053\u306E\u6708\u306E\u7DE0\u3081\u30EC\u30B3\u30FC\u30C9\u304C\u3042\u308A\u3001\u8868\u793A\u5BFE\u8C61\u3067\u3001\u6709\u52B9\u306A\u5951\u7D04\u304C\u3042\
|
|
21
|
+
\u308B\u4EBA\u3060\u3051\u3067\u3059\uFF08\u8F09\u3063\u3066\u3044\u306A\u3044\u4EBA\u306F\u6B8B\u696D0\u3068\u3044\u3046\u610F\u5473\u3067\u306F\u3042\u308A\u307E\u305B\u3093\uFF09\u3002";var MONTH_FLAG={name:"--month",summary:"\u5BFE\u8C61\u306E\u5E74\u6708\uFF08YYYY-MM\uFF09",takesValue:true,placeholder:"<YYYY-MM>"};var OVERTIME_COLUMNS=["user_name","contract_type_name","overtime","legal_overtime","night_work","holiday_work","total_work","total_work_days","is_overtime_exempt","user_id"];var AGREEMENT36_COLUMNS=[
|
|
22
|
+
"user_name","alert_level","monthly_legal_overtime","monthly_percent","annual_legal_overtime","annual_percent","contract_type_name","user_id"];var CLOSING_COLUMNS=["user_name","closed_at","closed_by","logic_version","user_id","id"];function isAgreement36(input){return input.flags.has("--agreement36")}function overtimeBody(body,label){if(!isRecord(body)||!Array.isArray(body["users"])){throw new ApiResponseError(`${label}\u306E\u5FDC\u7B54\u306B users \u304C\u3042\u308A\u307E\u305B\u3093\u3002\u63A5\u7D9A\u5148\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002`)}
|
|
23
|
+
return body}function isAgreement36Body(body){return isRecord(body)&&isRecord(body["limits"])}function summarizeOvertimeUser(user){const row=isRecord(user)?user:{};return pick({user_name:row["user_name"],contract_type_name:row["contract_type_name"],overtime:hoursMinutes(row["overtime_minutes"]),legal_overtime:hoursMinutes(row["legal_overtime_minutes"]),night_work:hoursMinutes(row["night_work_minutes"]),holiday_work:hoursMinutes(row["holiday_work_minutes"]),total_work:hoursMinutes(row["total_work_\
|
|
24
|
+
minutes"]),total_work_days:row["total_work_days"],is_overtime_exempt:row["is_overtime_exempt"],user_id:row["user_id"]},OVERTIME_COLUMNS)}function summarizeAgreement36User(user){const row=isRecord(user)?user:{};return pick({user_name:row["user_name"],alert_level:row["alert_level"],monthly_legal_overtime:hoursMinutes(row["monthly_legal_overtime_minutes"]),monthly_percent:row["monthly_percent"],annual_legal_overtime:hoursMinutes(row["annual_legal_overtime_minutes"]),annual_percent:row["annual_perce\
|
|
25
|
+
nt"],contract_type_name:row["contract_type_name"],user_id:row["user_id"]},AGREEMENT36_COLUMNS)}function summarizeOvertime(body){if(isAgreement36Body(body)){return overtimeBody(body,"36\u5354\u5B9A\u30C0\u30C3\u30B7\u30E5\u30DC\u30FC\u30C9")["users"].map(summarizeAgreement36User)}return overtimeBody(body,"\u6B8B\u696D\u30B5\u30DE\u30EA")["users"].map(summarizeOvertimeUser)}function overtimeNotes(body){if(isAgreement36Body(body)){const sheet2=overtimeBody(body,"36\u5354\u5B9A\u30C0\u30C3\u30B7\u30E5\u30DC\u30FC\u30C9");
|
|
26
|
+
const limits=sheet2["limits"];const summary=isRecord(sheet2["summary"])?sheet2["summary"]:{};const counts=isRecord(summary["alert_counts"])?summary["alert_counts"]:{};const countText=Object.entries(counts).map(([level,n])=>`${level} ${String(n)}`).join(" / ");return[`${String(sheet2["year_month"])}\uFF08\u5E74\u5EA6\u958B\u59CB ${String(sheet2["fiscal_year_start"])}\uFF09\u306E36\u5354\u5B9A: \u5BFE\u8C61 ${String(summary["total_users"])} \u4EBA`+(countText===""?"":` / ${countText}`),`\u4E0A\u9650: \u6708 ${String(
|
|
27
|
+
hoursMinutes(limits["monthly_general_minutes"]))}\uFF08\u7279\u5225\u6761\u9805 ${String(hoursMinutes(limits["monthly_special_minutes"]))}\uFF09 / \u5E74 ${String(hoursMinutes(limits["annual_general_minutes"]))}\uFF08\u7279\u5225\u6761\u9805 ${String(hoursMinutes(limits["annual_special_minutes"]))}\uFF09\uFF08\u5168\u9805\u76EE\u306F --output json\uFF09`,OVERTIME_SCOPE_NOTE]}const sheet=overtimeBody(body,"\u6B8B\u696D\u30B5\u30DE\u30EA");const total=isRecord(sheet["total"])?sheet["total"]:{};return[
|
|
28
|
+
`${String(sheet["year_month"])} \u306E\u5408\u8A08\uFF08${String(total["user_count"])} \u4EBA\uFF09: \u6B8B\u696D ${String(hoursMinutes(total["overtime_minutes"]))} / \u6CD5\u5B9A\u5916\u6B8B\u696D ${String(hoursMinutes(total["legal_overtime_minutes"]))} / \u6DF1\u591C ${String(hoursMinutes(total["night_work_minutes"]))} / \u4F11\u65E5 ${String(hoursMinutes(total["holiday_work_minutes"]))}\uFF08\u5168\u9805\u76EE\u306F --output json \u306E total\uFF09`,OVERTIME_SCOPE_NOTE]}function closingsBody(body){
|
|
29
|
+
if(!isRecord(body)||!Array.isArray(body["closings"])){throw new ApiResponseError("\u7DE0\u3081\u72B6\u6CC1\u306E\u5FDC\u7B54\u306B closings \u304C\u3042\u308A\u307E\u305B\u3093\u3002\u63A5\u7D9A\u5148\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002")}return body}function closingsNotes(body){const sheet=closingsBody(body);const count=sheet["closings"].length;return[`${String(sheet["year_month"])} \u306B\u7DE0\u3081\u6E08\u307F\u306E\u4EBA: ${String(count)} \u4EBA\uFF08\u7DE0\u3081\u3066\u3044\u306A\u3044\u4EBA\u306F\u4E00\u89A7\u306B\u51FA\u307E\u305B\u3093\uFF09`]}
|
|
30
|
+
var overtimeOperation={name:"overtime",summary:"\u6708\u306E\u6B8B\u696D\u30B5\u30DE\u30EA\uFF08\u793E\u54E1\u5225\uFF09\u3092\u8868\u793A\u3059\u308B\u3002--agreement36 \u306736\u5354\u5B9A\u306E\u4E0A\u9650\u306B\u5BFE\u3059\u308B\u72B6\u6CC1\uFF08\u7BA1\u7406\u8005\uFF09",usage:OVERTIME_USAGE,description:"GET /api/v1/attendance/overtime \u3092\u8868\u793A\u3057\u307E\u3059\u3002--agreement36 \u3092\u4ED8\u3051\u308B\u3068 GET /api/v1/attendance/overtime/agreement36\n\uFF0836\u5354\u5B9A\u306E\u6708\u30FB\u5E74\u306E\u6CD5\u5B9A\u5916\u6B8B\u696D\u3068\u4E0A\u9650\u306B\u5BFE\u3059\u308B\u5272\u5408\u30FB\u8B66\u544A\u30EC\u30D9\u30EB\uFF09\u3092\u8868\u793A\u3057\u307E\u3059\u3002\n\u52E4\u6020\u306E\u7BA1\u7406\u8005\u6A29\u9650\u304C\u5FC5\u8981\u3067\u3059\uFF08\u7121\u3051\u308C\u3070\u7D42\u4E86\u30B3\u30FC\u30C9 3\uFF09\u3002\n--month \u304C\u7121\u3051\u308C\u3070\u4ECA\u6708\u3067\u3059\uFF08\u30C6\u30CA\
|
|
31
|
+
\u30F3\u30C8\u306E\u696D\u52D9\u65E5\u306E\u533A\u5207\u308A\u3067\u30B5\u30FC\u30D0\u304C\u6C7A\u3081\u307E\u3059\uFF09\u3002\u4ECA\u6708\u306F\u30EA\u30A2\u30EB\u30BF\u30A4\u30E0\u306E\u96C6\u8A08\u3001\u904E\u53BB\u306E\u6708\u306F\u7DE0\u3081\u305F\u6642\u70B9\u306E\u96C6\u8A08\u3067\u3059\u3002\n\u4E26\u3076\u306E\u306F\u3001\u305D\u306E\u6708\u306E\u7DE0\u3081\u30EC\u30B3\u30FC\u30C9\u304C\u3042\u308A\u3001\u8868\u793A\u5BFE\u8C61\u3067\u3001\u305D\u306E\u6708\u306B\u6709\u52B9\u306A\u5951\u7D04\u304C\u3042\u308B\u4EBA\u3060\u3051\u3067\u3059\uFF08\u8F09\u3063\u3066\u3044\u306A\u3044\u4EBA\u306F\u300C\u6B8B\u696D0\u300D\u3067\u306F\u3042\u308A\u307E\u305B\u3093\uFF09\u3002\n--output table / text / tsv \u306F\u793E\u54E1\u5225\u306E\u8981\u7D04\u5217\uFF08\u6642\u9593\u306F H:MM\uFF09\u3067\u3001\u5408\u8A08\u30FB\u4E0A\u9650\u306F stderr \u306B\u51FA\u3057\u307E\u3059\u3002\n--output json \u306F API \u304C\u8FD4\u3059\u5168\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u51FA\u3057\u307E\u3059\u3002",
|
|
30
32
|
flags:[MONTH_FLAG,{name:"--agreement36",summary:"36\u5354\u5B9A\u306E\u4E0A\u9650\u306B\u5BFE\u3059\u308B\u72B6\u6CC1\u3092\u8868\u793A\u3059\u308B",takesValue:false}],plan(input){noArgs(input,"overtime");const path=isAgreement36(input)?"/api/v1/attendance/overtime/agreement36":"/api/v1/attendance/overtime";return{method:"GET",path,query:{year_month:monthFlag(input.flags)}}},summarize:summarizeOvertime,raw:body=>overtimeBody(body,isAgreement36Body(body)?"36\u5354\u5B9A\u30C0\u30C3\u30B7\u30E5\u30DC\u30FC\u30C9":
|
|
31
33
|
"\u6B8B\u696D\u30B5\u30DE\u30EA"),notes:overtimeNotes,forbidden:FORBIDDEN_ADMIN};var closingsListOperation={name:"list",summary:"\u6708\u306E\u7DE0\u3081\u72B6\u6CC1\uFF08\u7DE0\u3081\u6E08\u307F\u306E\u4EBA\u306E\u4E00\u89A7\uFF09\u3092\u8868\u793A\u3059\u308B\uFF08\u7BA1\u7406\u8005\uFF09",usage:CLOSINGS_LIST_USAGE,description:"GET /api/v1/attendance/closings \u3092\u8868\u793A\u3057\u307E\u3059\u3002\u52E4\u6020\u306E\u7BA1\u7406\u8005\u6A29\u9650\u304C\u5FC5\u8981\u3067\u3059\uFF08\u7121\u3051\u308C\u3070\u7D42\u4E86\u30B3\u30FC\u30C9 3\uFF09\u3002\n\u4E26\u3076\u306E\u306F\u7DE0\u3081\u6E08\u307F\u306E\u4EBA\u3060\u3051\u3067\u3059\uFF08\u7DE0\u3081\u3066\u3044\u306A\u3044\u4EBA\u306F\u51FA\u307E\u305B\u3093\uFF09\u3002\u4EBA\u6570\u306F stderr \u306B\u51FA\u3057\u307E\u3059\u3002\n--month \u304C\u7121\u3051\u308C\u3070\u4ECA\u6708\u3067\u3059\uFF08\u30C6\u30CA\u30F3\u30C8\u306E\u696D\u52D9\u65E5\u306E\u533A\u5207\u308A\u3067\u30B5\u30FC\u30D0\u304C\u6C7A\u3081\u307E\u3059\uFF09\u3002\n--include-hi\
|
|
32
34
|
dden \u3092\u4ED8\u3051\u308B\u3068\u3001\u7121\u52B9\u5316\u6E08\u307F\u306E\u30E6\u30FC\u30B6\u30FC\u306E\u7DE0\u3081\u3082\u542B\u3081\u307E\u3059\u3002\n\u7DE0\u3081\u306E\u5B9F\u884C\u30FB\u89E3\u9664\u306F\u3067\u304D\u307E\u305B\u3093\uFF08\u7D66\u4E0E\u306E\u78BA\u5B9A\u306B\u52B9\u304F\u305F\u3081\u3001\u753B\u9762\u304B\u3089\u884C\u3063\u3066\u304F\u3060\u3055\u3044\uFF09\u3002\n--output json \u306F API \u304C\u8FD4\u3059\u5168\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u51FA\u3057\u307E\u3059\u3002",
|
|
@@ -44,4 +46,4 @@ flags:[{name:"--month",summary:"\u5BFE\u8C61\u306E\u5E74\u6708\uFF08YYYY-MM\uFF0
|
|
|
44
46
|
usage:PUNCH_USAGE,description:"POST /api/v1/attendance/punch \u3092\u9001\u308A\u307E\u3059\uFF08\u30ED\u30B0\u30A4\u30F3\u3057\u3066\u3044\u308B\u672C\u4EBA\u306E\u5206\uFF09\u3002\u6253\u523B\u6642\u523B\u306F\u30B5\u30FC\u30D0\u306E\u6642\u523B\u3067\u3059\u3002\n\u7A2E\u985E: clock-in\uFF08\u51FA\u52E4\uFF09/ clock-out\uFF08\u9000\u52E4\uFF09/ break-start\uFF08\u4F11\u61A9\u958B\u59CB\uFF09/ break-end\uFF08\u4F11\u61A9\u7D42\u4E86\uFF09/ switch\uFF08\u4F5C\u696D\u306E\u5207\u308A\u66FF\u3048\uFF09\u3002\n\u3044\u307E\u6253\u3066\u308B\u7A2E\u985E\u306F twp attendance status \u306E available_actions \u3067\u5206\u304B\u308A\u307E\u3059\u3002\n--project \u306F\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u306E\u30B3\u30FC\u30C9\u304B ID\u3001--task \u306F\u30BF\u30B9\u30AF\u306E ID\uFF08UUID\uFF09\u3067\u3059\u3002\n\u9001\u308B\u524D\u306B\u4ECA\u6708\u306E\u52E4\u6020\u8868\uFF08GET /api/v1/attendance/timesheet\uFF09\u3092\u898B\u3066\u3001\u7DE0\u3081\u6E08\u307F\u306A\u3089\u6253\u523B\u3092\u9001\u3089\u305A\u306B\u6B62\u3081\u307E\u3059\uFF08\u7D42\u4E86\u30B3\u30FC\u30C9 3\uFF09\u3002\n--dry-run \u306F\u6253\u523B\u306E\u30EA\u30AF\u30A8\u30B9\u30C8\u3060\u3051\u3092\u8868\u793A\u3057\u307E\u3059\uFF08\u7DE0\u3081\u306E\u78BA\u8A8D\u306F\u9001\u308A\u307E\u305B\u3093\uFF09\u3002\n\u904E\u53BB\u306E\u6642\u523B\u3067\u306E\u6253\u523B\u30FB\u6253\u523B\u306E\u4FEE\u6B63\u306F\u3067\u304D\u307E\u305B\u3093\uFF08\u753B\u9762\u304B\u3089\u884C\u3063\u3066\u304F\u3060\u3055\u3044\uFF09\u3002",
|
|
45
47
|
flags:[{name:"--project",summary:"\u4F5C\u696D\u3059\u308B\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\uFF08\u30B3\u30FC\u30C9\u307E\u305F\u306F ID\uFF09",takesValue:true,placeholder:"<\u30B3\u30FC\u30C9|ID>"},{name:"--task",summary:"\u4F5C\u696D\u3059\u308B\u30BF\u30B9\u30AF\u306E ID\uFF08UUID\uFF09",takesValue:true,placeholder:"<\u30BF\u30B9\u30AFID>"},{name:"--memo",summary:`\u30E1\u30E2\uFF08${MEMO_MAX} \u6587\u5B57\u4EE5\u5185\uFF09`,takesValue:true,placeholder:"<\u30E1\u30E2>"}],async prepare(input,ctx){
|
|
46
48
|
punchType(input);const explicit=input.flags.get("--project");if(explicit===void 0)return input;return withResolved(input,{projectId:await ctx.projectId(explicit)})},plan:punchPlan,plannedNotes:()=>["\u5B9F\u884C\u6642\u306F\u3001\u3053\u306E\u524D\u306B\u4ECA\u6708\u306E\u7DE0\u3081\u306E\u78BA\u8A8D\uFF08GET /api/v1/attendance/timesheet\uFF09\u3092\u9001\u308A\u3001\u7DE0\u3081\u6E08\u307F\u306A\u3089\u6253\u523B\u3092\u9001\u308A\u307E\u305B\u3093\u3002"],execute:punch,summarize:body=>{const status=isRecord(
|
|
47
|
-
body)&&isRecord(body["status"])?body["status"]:{};return{...pick(punchRecord(body),PUNCH_COLUMNS),status:status["status"]??null,status_label:status["status_label"]??null}},raw:body=>(punchRecord(body),body)},overtimeOperation],subresources:[closingsResource]};export{monthFlag,PUNCH_TYPES,hoursMinutes,assertCurrentMonthOpen,attendanceDomain};
|
|
49
|
+
body)&&isRecord(body["status"])?body["status"]:{};return{...pick(punchRecord(body),PUNCH_COLUMNS),status:status["status"]??null,status_label:status["status_label"]??null}},raw:body=>(punchRecord(body),body)},overtimeOperation],subresources:[closingsResource]};export{monthFlag,dateFlag,PUNCH_TYPES,hoursMinutes,assertCurrentMonthOpen,assertMonthsOpen,attendanceDomain};
|
|
@@ -44,7 +44,9 @@ failure} \u3067\u5931\u6557\u3057\u305F\u305F\u3081\u3001\u8868\u793A\u5BFE\u8C6
|
|
|
44
44
|
const query=new URLSearchParams({limit:"100"});if(cursor!==null)query.set("cursor",cursor);const res=await this.get(`${ADMIN_USERS_LIST_PATH}?${query.toString()}`);rows.push(...rawListFrom(res,"items","\u30E6\u30FC\u30B6\u30FC"));const body=isRecord(res.json)?res.json:{};if(body["has_more"]===false)break;const next=str(body["next_cursor"]);if(body["has_more"]!==true||next===null){throw new ResolveError("\u30E6\u30FC\u30B6\u30FC\u4E00\u89A7\u306E\u5FDC\u7B54\u306B has_more / next_cursor \u304C\u3042\u308A\u307E\u305B\u3093\u3002\u63A5\u7D9A\u5148\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002",
|
|
45
45
|
res.status)}cursor=next}return namedFromRows(rows,"\u30E6\u30FC\u30B6\u30FC",userRow)})}async department(input,flag="--department"){return resolveNamed(input,await this.departments(),{flag,label:"\u90E8\u7F72",scope:TENANT_SCOPE_LABEL})}async position(input,flag="--position"){return resolveNamed(input,await this.positions(),{flag,label:"\u5F79\u8077",scope:TENANT_SCOPE_LABEL})}async jobTitle(input,flag="--job-title"){return resolveNamed(input,await this.jobTitles(),{flag,label:"\u8077\u4F4D",scope:TENANT_SCOPE_LABEL})}async departments(){
|
|
46
46
|
return this.cached("departments",TENANT_CACHE_KEY,async()=>namedFromRows(masterList(await this.get(`${DEPARTMENTS_PATH}?limit=${ORG_MASTER_LIMIT}`),"\u90E8\u7F72"),"\u90E8\u7F72",codedMasterRow))}async positions(){return this.cached("positions",TENANT_CACHE_KEY,async()=>namedFromRows(masterList(await this.get(`${POSITIONS_PATH}?limit=${ORG_MASTER_LIMIT}`),"\u5F79\u8077"),"\u5F79\u8077",codedMasterRow))}async jobTitles(){return this.cached("job-titles",TENANT_CACHE_KEY,async()=>namedFromRows(masterList(
|
|
47
|
-
await this.get(`${JOB_TITLES_PATH}?limit=${ORG_MASTER_LIMIT}`),"\u8077\u4F4D"),"\u8077\u4F4D",codedMasterRow))}async workflow(input,flag="<\u30EF\u30FC\u30AF\u30D5\u30ED\u30FC>",category){return resolveNamed(input,await this.applicableWorkflows(category),{flag,label:category===void 0?"\u7533\u8ACB\u3067\u304D\u308B\u30EF\u30FC\u30AF\u30D5\u30ED\u30FC":`\u7533\u8ACB\u3067\u304D\u308B\u30EF\u30FC\u30AF\u30D5\u30ED\u30FC\uFF08${category}\uFF09`,scope:TENANT_SCOPE_LABEL})}async
|
|
47
|
+
await this.get(`${JOB_TITLES_PATH}?limit=${ORG_MASTER_LIMIT}`),"\u8077\u4F4D"),"\u8077\u4F4D",codedMasterRow))}async workflow(input,flag="<\u30EF\u30FC\u30AF\u30D5\u30ED\u30FC>",category){return resolveNamed(input,await this.applicableWorkflows(category),{flag,label:category===void 0?"\u7533\u8ACB\u3067\u304D\u308B\u30EF\u30FC\u30AF\u30D5\u30ED\u30FC":`\u7533\u8ACB\u3067\u304D\u308B\u30EF\u30FC\u30AF\u30D5\u30ED\u30FC\uFF08${category}\uFF09`,scope:TENANT_SCOPE_LABEL})}async workflowDefinition(id){
|
|
48
|
+
if(!isSafePathSegment(id)){throw new ResolveError(`\u30EF\u30FC\u30AF\u30D5\u30ED\u30FC ID \u3092\u30D1\u30B9\u306B\u4F7F\u3048\u307E\u305B\u3093: ${id}\u3002\u63A5\u7D9A\u5148\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002`)}const res=await this.get(`${WORKFLOWS_PATH}/${encodeURIComponent(id)}`);if(res.status===404){throw new ResolveError(`\u7533\u8ACB\u66F8\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093: ${id}`,404)}if(!res.ok){throw new ResolveError(`\u7533\u8ACB\u66F8\u306E\u5B9A\u7FA9\u3092\u53D6\u5F97\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F: ${id}\
|
|
49
|
+
\uFF08HTTP ${res.status}\uFF09\u3002\u63A5\u7D9A\u5148\u3068\u30ED\u30B0\u30A4\u30F3\u72B6\u614B\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002`,res.status)}const workflow=isRecord(res.json)?res.json["workflow"]:void 0;if(!isRecord(workflow)){throw new ResolveError("\u7533\u8ACB\u66F8\u306E\u5FDC\u7B54\u306B workflow \u304C\u3042\u308A\u307E\u305B\u3093\u3002\u63A5\u7D9A\u5148\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002",res.status)}return workflow}async applicableWorkflows(category){
|
|
48
50
|
const path2=category===void 0?`${WORKFLOWS_PATH}/applicable`:`${WORKFLOWS_PATH}/applicable/${encodeURIComponent(category)}`;const scope=category===void 0?"workflows-applicable":`workflows-applicable-${category}`;return this.cached(scope,TENANT_CACHE_KEY,async()=>{const res=await this.get(path2);const rows=rawListFrom(res,"list","\u30EF\u30FC\u30AF\u30D5\u30ED\u30FC");const sum=isRecord(res.json)?res.json["sum"]:void 0;if(typeof sum==="number"&&sum>rows.length){throw new ResolveError(`\u30EF\u30FC\u30AF\u30D5\u30ED\u30FC\u4E00\u89A7\u304C ${sum}\
|
|
49
51
|
\u4EF6\u4E2D ${rows.length} \u4EF6\u3067\u5207\u308A\u8A70\u3081\u3089\u308C\u305F\u305F\u3081\u3001\u540D\u524D\u3067\u89E3\u6C7A\u3067\u304D\u307E\u305B\u3093\u3002ID \u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002`,res.status)}return namedFromRows(rows,"\u30EF\u30FC\u30AF\u30D5\u30ED\u30FC",row=>({id:str(row["id"]),name:str(row["name"]),code:null}))})}async reportFormat(input,flag="--format",usableOnly=false){const load=async()=>rawListFrom(await this.get(`${REPORTS_PATH}/format\
|
|
50
52
|
s${usableOnly?"?include_unavailable=false":""}`),"formats","\u30EC\u30DD\u30FC\u30C8\u30D5\u30A9\u30FC\u30DE\u30C3\u30C8");const rows=usableOnly?await load():await this.cached("report-formats",TENANT_CACHE_KEY,load);return resolveNamed(input,namedFromRows(rows,"\u30EC\u30DD\u30FC\u30C8\u30D5\u30A9\u30FC\u30DE\u30C3\u30C8",row=>({id:str(row["id"]),name:str(row["name"]),code:str(row["code"])})),{flag,label:usableOnly?"\u4F5C\u6210\u3067\u304D\u308B\u30EC\u30DD\u30FC\u30C8\u30D5\u30A9\u30FC\u30DE\u30C3\u30C8":
|
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-TAN5I2DP.js";import{parseArgv}from"./chunk-VQMR5UTD.js";import"./chunk-NAUH75MM.js";import"./chunk-523KROGI.js";import"./chunk-QQRJLH6B.js";import"./chunk-VSJBJXZO.js";var VERSION=true?"0.
|
|
4
|
+
import{GLOBAL_OPTIONS_HELP}from"./chunk-TAN5I2DP.js";import{parseArgv}from"./chunk-VQMR5UTD.js";import"./chunk-NAUH75MM.js";import"./chunk-523KROGI.js";import"./chunk-QQRJLH6B.js";import"./chunk-VSJBJXZO.js";var VERSION=true?"0.37.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
|
|
@@ -159,6 +159,7 @@ import{GLOBAL_OPTIONS_HELP}from"./chunk-TAN5I2DP.js";import{parseArgv}from"./chu
|
|
|
159
159
|
twp leave list \u81EA\u5206\u306E\u6709\u7D66\u306E\u53D6\u5F97\u5C65\u6B74\u3068\u6B8B\u65E5\u6570
|
|
160
160
|
twp leave grants [<\u30E6\u30FC\u30B6\u30FC>]
|
|
161
161
|
\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
|
|
162
|
+
twp leave request \u6709\u7D66\u3092\u7533\u8ACB\u3059\u308B\uFF08--date \u304B --from/--to\u30FB--type\u30FB\u30EF\u30FC\u30AF\u30D5\u30ED\u30FC\u3067\u8D77\u7968\u3057\u3066\u63D0\u51FA\uFF09
|
|
162
163
|
twp workchange list \u6708\u306E\u52E4\u52D9\u5909\u66F4\uFF08--month\u30FB--me \u3067\u81EA\u5206\u306E\u5206\u30FB\u7121\u3051\u308C\u3070\u5168\u54E1\u5206\uFF1D\u7BA1\u7406\u8005\uFF09
|
|
163
164
|
twp shift list \u6708\u306E\u30B7\u30D5\u30C8\uFF08--month\u30FB--me \u3067\u81EA\u5206\u306E\u5206\u30FB\u7121\u3051\u308C\u3070\u5168\u54E1\u5206\uFF1D\u7BA1\u7406\u8005\uFF09
|
|
164
165
|
twp workflow applicable \u81EA\u5206\u304C\u7533\u8ACB\u3067\u304D\u308B\u7533\u8ACB\u66F8\uFF08--category \u3067\u30AB\u30C6\u30B4\u30EA\u306E\u7533\u8ACB\u66F8\u30FB\u975E\u8868\u793A\u3082\u542B\u3080\uFF09
|
|
@@ -430,14 +431,14 @@ TUI \u5185:
|
|
|
430
431
|
\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
|
|
431
432
|
`;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
|
|
432
433
|
`);process.exit(1)}ignoreEpipe(process.stdout);ignoreEpipe(process.stderr);if(process.env["TWP_AUTO_UPDATE_WORKER"]==="1"){const{runAutoUpdateWorker}=await import("./auto-update-worker-Y44TD6FD.js");await runAutoUpdateWorker().catch(()=>void 0);return}const[first,...rest]=process.argv.slice(2);if(first==="__complete"||first==="completion"){const completion=await import("./completion-DGJH42YO.js");if(first==="completion"){process.exitCode=completion.runCompletion(rest,process.stdout,process.stderr);return}
|
|
433
|
-
const[{loadDomain},{loadUserConfig}]=await Promise.all([import("./registry-
|
|
434
|
+
const[{loadDomain},{loadUserConfig}]=await Promise.all([import("./registry-XXUXBYEE.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-JNSBIQM6.js");autoUpdate2.registerRunning();autoUpdate2.onStartup(VERSION);const{runConfigure}=await import("./configure-PIOFJFL5.js");process.exitCode=
|
|
434
435
|
await runConfigure(rest);return}const args=parseArgv(process.argv.slice(2));if(args.command==="version"){process.stdout.write(`${VERSION}
|
|
435
436
|
`);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(" ")}
|
|
436
437
|
|
|
437
|
-
${HELP}`);process.exitCode=2;return}const autoUpdate=await import("./auto-update-JNSBIQM6.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-
|
|
438
|
-
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-
|
|
438
|
+
${HELP}`);process.exitCode=2;return}const autoUpdate=await import("./auto-update-JNSBIQM6.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-65ZPZ5FD.js");process.exitCode=await runDomain({domain:args.domain,...args.operation!==void 0?{operation:args.operation}:{},argv:args.domainArgv,help:args.
|
|
439
|
+
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-NLV55HVW.js");process.exitCode=await runApiCommand({argv:args.domainArgv,help:args.domainHelp,globals:{...args.profile!==void 0?{profile:args.profile}:{},...args.output!==
|
|
439
440
|
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-MAQJ6VWV.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-OABOHHNC.js");
|
|
440
441
|
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-M4B3MDUA.js");process.exitCode=await runTaskLoop(
|
|
441
442
|
{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,
|
|
442
|
-
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-
|
|
443
|
-
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-
|
|
443
|
+
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-RYWJ6ECA.js");process.exitCode=await runOneShot({prompt:args.prompt??"",fromStdin:args.promptFromStdin,mode:args.mode??"dev",...args.permissionMode!==void 0?{permissionMode:args.permissionMode}:{},allowedTools:args.
|
|
444
|
+
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-MED2NINK.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();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire as __twpCreateRequire } from 'node:module';
|
|
2
2
|
const require = __twpCreateRequire(import.meta.url);
|
|
3
|
-
import{COMPANY_FIELDS,COMPANY_LICENSE,CUSTOMER_FLAG,CUSTOMER_LICENSE,childForbidden,customerSubresources,customerWriteOperations,dataOf,levelForbidden,prepareCustomerFlag}from"./chunk-
|
|
4
|
-
import{repeatedValues}from"./chunk-IOGVQVGD.js";import{booleanText}from"./chunk-UDPJ2IGK.js";import{CUSTOMERS_PATH,SALES_COMPANIES_PATH,isExactNumericId}from"./chunk-
|
|
3
|
+
import{COMPANY_FIELDS,COMPANY_LICENSE,CUSTOMER_FLAG,CUSTOMER_LICENSE,childForbidden,customerSubresources,customerWriteOperations,dataOf,levelForbidden,prepareCustomerFlag}from"./chunk-4CVLBR42.js";import"./chunk-I6DWJXPC.js";import{inspectLocalFile}from"./chunk-VECUCVIY.js";import{checkUploadQuota}from"./chunk-DDKZ5IPT.js";import{featureLicenseGuidance,licenseForbidden}from"./chunk-SN6YG4SF.js";import{createFlags,fieldBody,hasAnyField,updateFlags}from"./chunk-KA3EE4TJ.js";
|
|
4
|
+
import{repeatedValues}from"./chunk-IOGVQVGD.js";import{booleanText}from"./chunk-UDPJ2IGK.js";import{CUSTOMERS_PATH,SALES_COMPANIES_PATH,isExactNumericId}from"./chunk-ZST7XESB.js";import{ApiError}from"./chunk-IF2K4PM5.js";import{isSafePathSegment}from"./chunk-GMBJTG6A.js";import{NotLoggedInError,SessionExpiredError}from"./chunk-XNLIEUAW.js";import"./chunk-J7QYPKVK.js";import"./chunk-4VZKNEVN.js";import"./chunk-QQRJLH6B.js";import"./chunk-NHYMHCAT.js";
|
|
5
5
|
import"./chunk-GY7KI5E5.js";import{LIST_FLAGS,LIST_PAGING_HELP,PAGE_NUMBER_LIST_FLAGS,PAGE_NUMBER_PAGING_HELP,STABLE_PAGE_ORDER,envelopePaging,nonEmpty,pageNumberPaging,pageNumberQuery,pageRangeNotes,positiveInteger}from"./chunk-R53CMVWR.js";import"./chunk-II5RVJQN.js";import{requireResolved,singleRef,withResolved}from"./chunk-ZN5EFDH7.js";import{acknowledgement,isRecord,pick}from"./chunk-ZWVYVS2A.js";import{ApiResponseError,UsageError}from"./chunk-7WSNIXTQ.js";
|
|
6
6
|
import"./chunk-RZVI6PMW.js";import"./chunk-VSJBJXZO.js";var CUSTOMER_FLAG_FIELD={kind:"boolean",flag:"--customer",key:"customer_flg",summary:"\u9867\u5BA2\u3068\u3057\u3066\u6271\u3046\u304B\uFF08true / false\uFF09"};var FIELDS=[...COMPANY_FIELDS,CUSTOMER_FLAG_FIELD];var COLUMNS=["id","company_name","company_name_kana","company_short_name","customer_flg","supplier_flg","tel","address1"];var WRITE_FORBIDDEN=levelForbidden(COMPANY_LICENSE,"\u53D6\u5F15\u5148\u306E\u4F5C\u6210\u30FB\u66F4\u65B0\u306B\u306F\u3001\u8CA9\u58F2\u7BA1\u7406\u306E\u6A29\u9650\u304C\u300C\u30E1\u30F3\u30D0\u30FC\u300D\u4EE5\u4E0A\u304B\u3001\u9867\u5BA2\u7BA1\u7406\u306E\u6A29\u9650\u304C\u300C\u7DE8\u96C6\u8005\u300D\u4EE5\u4E0A\u306E\u3069\u3061\u3089\u304B\u304C\u8981\u308A\u307E\u3059\u3002\u30C6\u30CA\u30F3\u30C8\u7BA1\u7406\u8005\u306B\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002");
|
|
7
7
|
var DELETE_FORBIDDEN=levelForbidden(COMPANY_LICENSE,"\u53D6\u5F15\u5148\u306E\u524A\u9664\u306B\u306F\u3001\u8CA9\u58F2\u7BA1\u7406\u306E\u6A29\u9650\u304C\u300C\u30E1\u30F3\u30D0\u30FC\u300D\u4EE5\u4E0A\u304B\u3001\u9867\u5BA2\u7BA1\u7406\u306E\u6A29\u9650\u304C\u300C\u7BA1\u7406\u8005\u300D\u306E\u3069\u3061\u3089\u304B\u304C\u8981\u308A\u307E\u3059\u3002\u30C6\u30CA\u30F3\u30C8\u7BA1\u7406\u8005\u306B\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002");var REF_HELP="<\u53D6\u5F15\u5148> \u306F\u4F01\u696D\u540D\u30FB\u7565\u79F0\u30FB\u30AB\u30CA\u306E\u5B8C\u5168\u4E00\u81F4\u304B\
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire as __twpCreateRequire } from 'node:module';
|
|
2
2
|
const require = __twpCreateRequire(import.meta.url);
|
|
3
|
-
import{cacheNote,createFlags,fieldBody,hasAnyField,idSegment,masterFields,masterItem,masterListOperation,masterRows,referencedDeleteGuidance,resolveRefFields,targetId,updateFlags}from"./chunk-
|
|
3
|
+
import{cacheNote,createFlags,fieldBody,hasAnyField,idSegment,masterFields,masterItem,masterListOperation,masterRows,referencedDeleteGuidance,resolveRefFields,targetId,updateFlags}from"./chunk-KA3EE4TJ.js";import"./chunk-UDPJ2IGK.js";import{DEPARTMENTS_PATH}from"./chunk-ZST7XESB.js";import"./chunk-IF2K4PM5.js";import"./chunk-GMBJTG6A.js";import"./chunk-J7QYPKVK.js";import"./chunk-4VZKNEVN.js";import"./chunk-NHYMHCAT.js";import"./chunk-R53CMVWR.js";
|
|
4
4
|
import"./chunk-II5RVJQN.js";import{withResolved}from"./chunk-ZN5EFDH7.js";import{acknowledgement,isRecord,pick}from"./chunk-ZWVYVS2A.js";import{ApiResponseError,UsageError}from"./chunk-7WSNIXTQ.js";import"./chunk-RZVI6PMW.js";import"./chunk-VSJBJXZO.js";var LABEL="\u90E8\u7F72";var LIST_COLUMNS=["id","code","name","parent_id","level","effective_status","valid_from","valid_to","member_count"];var GET_COLUMNS=["id","code","name","name_short","parent_id","level","sort","effective_status","valid_from","valid_to","description"];var TREE_COLUMNS=["depth","name","code","id","effective_status","valid_to"];var MEMBER_COLUMNS=["id","user_id","position_id","job_title_id","start_date","end_date","is_primary","is_current","effective_status"];var REF_FLAG={name:"\
|
|
5
5
|
--department",summary:"\u5BFE\u8C61\u306E\u90E8\u7F72\uFF08\u4F4D\u7F6E\u5F15\u6570\u306E\u4EE3\u308F\u308A\u306B\u4F7F\u3048\u308B\uFF09",takesValue:true,placeholder:"<\u90E8\u7F72>"};var REF_HELP="<\u90E8\u7F72> \u306F\u540D\u524D\u30FB\u30B3\u30FC\u30C9\u30FBID \u306E\u3069\u308C\u3067\u3082\u6307\u5B9A\u3067\u304D\u307E\u3059\uFF08\u540D\u524D\u304C\u8907\u6570\u306B\u4E00\u81F4\u3059\u308C\u3070\u5019\u88DC\u3092\u51FA\u3057\u3066\u6B62\u307E\u308A\u307E\u3059\uFF09\u3002\nID \u4EE5\u5916\u306F\u90E8\u7F72\u4E00\u89A7\uFF08\u65E2\u5B9A10\u5206\u30AD\u30E3\u30C3\u30B7\u30E5\u30FB--refresh \u3067\u53D6\u308A\u76F4\u3057\uFF09\u3068\u7167\u5408\u3057\u307E\u3059\u3002";
|
|
6
6
|
var FIELDS=masterFields(LABEL,[{kind:"text",flag:"--name-short",key:"name_short",label:"\u7565\u79F0",maxChars:50,summary:"\u7565\u79F0"},{kind:"ref",flag:"--parent",key:"parent_id",summary:"\u89AA\u90E8\u7F72\uFF08\u540D\u524D\u30FB\u30B3\u30FC\u30C9\u30FBID\uFF09",placeholder:"<\u90E8\u7F72>",clearFlag:"--no-parent",clearSummary:"\u89AA\u90E8\u7F72\u3092\u5916\u3057\u3066\u6700\u4E0A\u4F4D\u306B\u3059\u308B",resolve:(ctx,ref,flag)=>ctx.resolver.department(ref,flag)},{kind:"integer",flag:"--sor\
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire as __twpCreateRequire } from 'node:module';
|
|
2
2
|
const require = __twpCreateRequire(import.meta.url);
|
|
3
|
-
import{repeatedValues}from"./chunk-IOGVQVGD.js";import{booleanText,boundedText}from"./chunk-UDPJ2IGK.js";import{INQUIRY_CATEGORIES_PATH}from"./chunk-
|
|
3
|
+
import{repeatedValues}from"./chunk-IOGVQVGD.js";import{booleanText,boundedText}from"./chunk-UDPJ2IGK.js";import{INQUIRY_CATEGORIES_PATH}from"./chunk-ZST7XESB.js";import"./chunk-IF2K4PM5.js";import{UUID_RE,isSafePathSegment}from"./chunk-GMBJTG6A.js";import"./chunk-J7QYPKVK.js";import"./chunk-4VZKNEVN.js";import"./chunk-QQRJLH6B.js";import"./chunk-NHYMHCAT.js";import"./chunk-II5RVJQN.js";import{requireResolved,singleRef,withResolved}from"./chunk-ZN5EFDH7.js";
|
|
4
4
|
import{isRecord,pick}from"./chunk-ZWVYVS2A.js";import{ApiResponseError,UsageError}from"./chunk-7WSNIXTQ.js";import"./chunk-RZVI6PMW.js";import"./chunk-VSJBJXZO.js";var LABEL="\u554F\u3044\u5408\u308F\u305B\u30AB\u30C6\u30B4\u30EA";var LIST_COLUMNS=["id","category_code","title","sort","is_active","notification_user_count"];var GET_COLUMNS=["id","category_code","title","description","sort","is_active","notification_users"];var FORBIDDEN=`\u7BA1\u7406\u8005\u306E\u6A29\u9650\u304C\u5FC5\u8981\u3067\u3059\u3002${LABEL}\u306E\u8A73\u7D30\u30FB\u4F5C\u6210\u30FB\u66F4\u65B0\u306F\u554F\u3044\u5408\u308F\u305B\u6A5F\u80FD\u306E\u7BA1\u7406\u8005\u3060\u3051\u304C\u884C\u3048\u307E\u3059`;
|
|
5
5
|
var SORT_LAST="last";var CODE_RE=/^[a-zA-Z0-9_-]+$/;var REF_HELP="<\u30AB\u30C6\u30B4\u30EA> \u306F\u30AB\u30C6\u30B4\u30EA\u30B3\u30FC\u30C9\u30FB\u540D\u524D\uFF08title\uFF09\u30FBID \u306E\u3069\u308C\u3067\u3082\u6307\u5B9A\u3067\u304D\u307E\u3059\uFF08\u540D\u524D\u304C\u8907\u6570\u306B\u4E00\u81F4\u3059\u308C\u3070\u5019\u88DC\u3092\u51FA\u3057\u3066\u6B62\u307E\u308A\u307E\u3059\uFF09\u3002\nID \u4EE5\u5916\u306F\u30AB\u30C6\u30B4\u30EA\u4E00\u89A7\uFF08\u65E2\u5B9A10\u5206\u30AD\u30E3\u30C3\u30B7\u30E5\u30FB--refresh \u3067\u53D6\u308A\u76F4\u3057\uFF09\u3068\u7167\u5408\u3057\u307E\u3059\u3002";
|
|
6
6
|
var NOTIFY_HELP="--notify \u306F\u901A\u77E5\u5148\u306E\u30E6\u30FC\u30B6\u30FC\u3067\u3001\u8907\u6570\u56DE\u6307\u5B9A\u3067\u304D\u307E\u3059\u3002\u30E6\u30FC\u30B6\u30FC\u306F ID\u30FB\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u30FB\u793E\u54E1\u756A\u53F7\u30FB\u6C0F\u540D\u3067\u6307\u5B9A\u3067\u304D\u307E\u3059\n\uFF08ID \u4EE5\u5916\u306F\u30C6\u30CA\u30F3\u30C8\u306E\u30E6\u30FC\u30B6\u30FC\u4E00\u89A7\u3068\u7167\u5408\u3057\u307E\u3059\u3002\u7D44\u7E54\u7BA1\u7406\u8005\u3067\u306A\u3044\u5834\u5408\u306F ID \u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\uFF09\u3002";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire as __twpCreateRequire } from 'node:module';
|
|
2
2
|
const require = __twpCreateRequire(import.meta.url);
|
|
3
|
-
import{STATUS_VALUES,flatMasterDomain}from"./chunk-
|
|
3
|
+
import{STATUS_VALUES,flatMasterDomain}from"./chunk-KA3EE4TJ.js";import"./chunk-UDPJ2IGK.js";import{JOB_TITLES_PATH}from"./chunk-ZST7XESB.js";import"./chunk-IF2K4PM5.js";import"./chunk-GMBJTG6A.js";import"./chunk-J7QYPKVK.js";import"./chunk-4VZKNEVN.js";import"./chunk-NHYMHCAT.js";import"./chunk-R53CMVWR.js";import"./chunk-II5RVJQN.js";import"./chunk-ZN5EFDH7.js";import"./chunk-ZWVYVS2A.js";import"./chunk-7WSNIXTQ.js";import"./chunk-RZVI6PMW.js";
|
|
4
4
|
import"./chunk-VSJBJXZO.js";var jobTitleDomain=flatMasterDomain({name:"job-title",label:"\u8077\u4F4D",path:JOB_TITLES_PATH,itemKey:"job_title",summary:"\u8077\u4F4D\u30DE\u30B9\u30BF\uFF08\u4E00\u89A7\u30FB\u53D6\u5F97\u30FB\u4F5C\u6210\u30FB\u66F4\u65B0\u30FB\u524A\u9664\uFF09",listColumns:["id","code","name","sort_order","status","position_id","base_selling_price","base_cost_price"],getColumns:["id","code","name","name_short","sort_order","status","position_id","base_selling_price","base_cost_price","description"],fields:[
|
|
5
5
|
{kind:"text",flag:"--name-short",key:"name_short",label:"\u7565\u79F0",maxChars:50,summary:"\u7565\u79F0"},{kind:"integer",flag:"--sort-order",key:"sort_order",label:"\u8868\u793A\u9806",min:0,max:9999,summary:"\u8868\u793A\u9806\uFF080\u301C9999\uFF09"},{kind:"enum",flag:"--status",key:"status",values:STATUS_VALUES,summary:"\u72B6\u614B\uFF08active: \u6709\u52B9 / inactive: \u7121\u52B9\uFF09"},{kind:"text",flag:"--description",key:"description",label:"\u8AAC\u660E",maxChars:1e3,summary:"\u8AAC\u660E"},
|
|
6
6
|
{kind:"integer",flag:"--base-selling-price",key:"base_selling_price",label:"\u57FA\u6E96\u58F2\u4FA1",min:0,summary:"\u57FA\u6E96\u58F2\u4FA1\uFF080\u4EE5\u4E0A\u306E\u6574\u6570\uFF09"},{kind:"integer",flag:"--base-cost-price",key:"base_cost_price",label:"\u57FA\u6E96\u539F\u4FA1",min:0,summary:"\u57FA\u6E96\u539F\u4FA1\uFF080\u4EE5\u4E0A\u306E\u6574\u6570\uFF09"},{kind:"text",flag:"--skill-requirements",key:"skill_requirements",label:"\u30B9\u30AD\u30EB\u8981\u4EF6",maxChars:5e3,summary:"\u30B9\u30AD\u30EB\u8981\u4EF6"},
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { createRequire as __twpCreateRequire } from 'node:module';
|
|
2
|
+
const require = __twpCreateRequire(import.meta.url);
|
|
3
|
+
import{USER_REF_FLAG,USER_REF_HELP,userPath}from"./chunk-2M2JQ23W.js";import{applyInstancePlan,createInstancePlan,formColumns,writtenInstance}from"./chunk-U6GEC6KI.js";import{assertMonthsOpen,dateFlag}from"./chunk-WYBJLRTG.js";import"./chunk-HGTG5XQ7.js";import"./chunk-ZST7XESB.js";import{ApiError}from"./chunk-IF2K4PM5.js";import{UUID_RE}from"./chunk-GMBJTG6A.js";import{NotLoggedInError,SessionExpiredError}from"./chunk-XNLIEUAW.js";import"./chunk-J7QYPKVK.js";
|
|
4
|
+
import"./chunk-4VZKNEVN.js";import"./chunk-NHYMHCAT.js";import"./chunk-R53CMVWR.js";import"./chunk-II5RVJQN.js";import{requireResolved,singleRef,withResolved}from"./chunk-ZN5EFDH7.js";import{isRecord,pick}from"./chunk-ZWVYVS2A.js";import{ApiRejectedError,ApiResponseError,UsageError}from"./chunk-7WSNIXTQ.js";import"./chunk-RZVI6PMW.js";import"./chunk-VSJBJXZO.js";var LIST_USAGE="twp leave list";var GRANTS_USAGE="twp leave grants [<\u30E6\u30FC\u30B6\u30FC> | --user <\u30E6\u30FC\u30B6\u30FC>]";var USAGE_COLUMNS=["used_date","type_label","days","hours","status_label","reason","is_post_application","id"];var GRANT_COLUMNS=["grant_date","type_label","days","remaining_days","remaining_hours","expiry_date","status_label","reason","id"];function noArgs(input,operation){if(input.args.length>0){throw new UsageError(`${operation} \u306F\u4F4D\u7F6E\u5F15\u6570\u3092\u53D7\u3051\u53D6\u308A\u307E\u305B\u3093: ${input.
|
|
5
|
+
args.join(" ")}`,`twp leave ${operation} help`)}}function summaryBody(body){if(!isRecord(body)||!isRecord(body["summary"])){throw new ApiResponseError("\u6709\u7D66\u30B5\u30DE\u30EA\u306E\u5FDC\u7B54\u306B summary \u304C\u3042\u308A\u307E\u305B\u3093\u3002\u63A5\u7D9A\u5148\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002")}return body}function usagesBody(body){if(!isRecord(body)||!Array.isArray(body["usages"])){throw new ApiResponseError("\u6709\u7D66\u306E\u53D6\u5F97\u5C65\u6B74\u306E\u5FDC\u7B54\u306B usages \u304C\u3042\u308A\u307E\u305B\u3093\u3002\u63A5\u7D9A\u5148\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002")}
|
|
6
|
+
return body}function grantsBody(body){if(!isRecord(body)||!Array.isArray(body["grants"])){throw new ApiResponseError("\u6709\u7D66\u306E\u4ED8\u4E0E\u5C65\u6B74\u306E\u5FDC\u7B54\u306B grants \u304C\u3042\u308A\u307E\u305B\u3093\u3002\u63A5\u7D9A\u5148\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002")}return body}function listBody(body){const combined=isRecord(body)?body:{};return{summary:summaryBody(combined["summary"]),usages:usagesBody(combined["usages"])}}async function list(input,ctx){
|
|
7
|
+
const summary=summaryBody(await ctx.send(listPlan(input)));const usages=await ctx.send({method:"GET",path:"/api/v1/paid-leave/me/usages"});return{summary,usages}}function listPlan(input){noArgs(input,"list");return{method:"GET",path:"/api/v1/paid-leave/me"}}function listNotes(body){const{summary:sheet}=listBody(body);const summary=sheet["summary"];const hours=typeof summary["total_remaining_hours"]==="number"&&summary["total_remaining_hours"]>0?` ${String(summary["total_remaining_hours"])} \u6642\u9593`:
|
|
8
|
+
"";const notes=[`\u6709\u7D66\u306E\u6B8B\u308A: ${String(summary["total_remaining"])} \u65E5${hours}\uFF08\u4ED8\u4E0E ${String(summary["total_granted"])} \u65E5 / \u53D6\u5F97 ${String(summary["total_used"])} \u65E5 / \u5931\u52B9 ${String(summary["total_expired"])} \u65E5\uFF09\u30FB\u53D6\u5F97\u7387 ${String(sheet["usage_rate"])}%\uFF08\u5168\u9805\u76EE\u306F --output json \u306E summary\uFF09`];if(sheet["meets_minimum_requirement"]===true){notes.push(`\u5E745\u65E5\u306E\u53D6\u5F97\u7FA9\u52D9: \u9054\u6210\u6E08\u307F\uFF08${String(
|
|
9
|
+
summary["period_start"])}\u301C${String(summary["period_end"])}\uFF09`)}else if(sheet["meets_minimum_requirement"]===false){notes.push(`\u5E745\u65E5\u306E\u53D6\u5F97\u7FA9\u52D9: \u672A\u9054\u30FB\u3042\u3068 ${String(sheet["days_until_minimum_requirement"])} \u65E5\uFF08${String(summary["period_start"])}\u301C${String(summary["period_end"])}\uFF09`)}return notes}function grantsRef(input){const ref=singleRef(input,{flag:"--user",label:"\u30E6\u30FC\u30B6\u30FC",usage:GRANTS_USAGE,required:false});
|
|
10
|
+
return ref===void 0||ref==="me"?void 0:ref}function grantsNotes(body){const sheet=grantsBody(body);const adjustments=Array.isArray(sheet["carry_adjustments"])?sheet["carry_adjustments"].length:0;const notes=[`\u4ED8\u4E0E: ${String(sheet["grants"].length)} \u4EF6`];if(adjustments>0)notes.push(`\u7E70\u8D8A\u306E\u8ABF\u6574\u304C ${String(adjustments)} \u4EF6\u3042\u308A\u307E\u3059\uFF08--output json \u306E carry_adjustments\uFF09`);return notes}var REQUEST_USAGE="twp leave request (--date <YYY\
|
|
11
|
+
Y-MM-DD> | --from <YYYY-MM-DD> --to <YYYY-MM-DD>) [--type <\u7A2E\u5225>] [--hours <\u6642\u9593>] [--reason <\u7406\u7531>] [--title <\u4EF6\u540D>] [--workflow <\u7533\u8ACB\u66F8>] [--draft]";var LEAVE_TYPES={full_day:"\u5168\u4F11\uFF081\u65E5\uFF09",half_day_am:"\u5348\u524D\u534A\u4F11",half_day_pm:"\u5348\u5F8C\u534A\u4F11",hourly:"\u6642\u9593\u5358\u4F4D"};var LEGACY_TYPES={day_full:"full_day",day_half_before:"half_day_am",day_half_after:"half_day_pm"};var MAX_PERIOD_DAYS=366;var TYPE_HELP=`\
|
|
12
|
+
\u7A2E\u5225: ${Object.entries(LEAVE_TYPES).map(([key,label])=>`${key}\uFF08${label}\uFF09`).join(" / ")}\uFF08\u7701\u7565\u6642\u306F full_day\uFF09`;var FIELD_ALIASES={type:["paid_leave_type","leave_type","type","used_type"],date:["paid_leave_date","paid_leave_dates","leave_date","date","dates"],end:["paid_leave_end_date","paid_leave_date_to","leave_end_date"],hours:["paid_leave_hours","leave_hours","hours"],reason:["paid_leave_reason","leave_reason","reason","comment"],applyType:["apply_type",
|
|
13
|
+
"application_type","request_type"]};var REQUEST_FLAGS=[{name:"--date",summary:"\u53D6\u5F97\u65E5\uFF081\u65E5\u3060\u3051\u7533\u8ACB\u3059\u308B\uFF09",takesValue:true,placeholder:"<YYYY-MM-DD>"},{name:"--from",summary:"\u671F\u9593\u306E\u958B\u59CB\u65E5\uFF08--to \u3068\u7D44\u3067\u3002\u5168\u4F11\u306E\u307F\uFF09",takesValue:true,placeholder:"<YYYY-MM-DD>"},{name:"--to",summary:"\u671F\u9593\u306E\u7D42\u4E86\u65E5\uFF08--from \u3068\u7D44\u3067\uFF09",takesValue:true,placeholder:"<YYYY\
|
|
14
|
+
-MM-DD>"},{name:"--type",summary:"\u53D6\u5F97\u7A2E\u5225\uFF08full_day / half_day_am / half_day_pm / hourly\uFF09",takesValue:true,placeholder:"<\u7A2E\u5225>"},{name:"--hours",summary:"\u53D6\u5F97\u6642\u9593\uFF08--type hourly \u306E\u3068\u304D\uFF09",takesValue:true,placeholder:"<\u6642\u9593>"},{name:"--reason",summary:"\u53D6\u5F97\u7406\u7531",takesValue:true,placeholder:"<\u7406\u7531>"},{name:"--title",summary:"\u7533\u8ACB\u306E\u4EF6\u540D\uFF08\u7701\u7565\u6642\u306F\u7533\u8ACB\u66F8\u306E\u540D\u524D\uFF09",
|
|
15
|
+
takesValue:true,placeholder:"<\u4EF6\u540D>"},{name:"--workflow",summary:"\u4F7F\u3046\u7533\u8ACB\u66F8\uFF08\u6709\u7D66\u4F11\u6687\u306E\u7533\u8ACB\u66F8\u304C\u8907\u6570\u3042\u308B\u3068\u304D\u3002\u540D\u524D\u304B ID\uFF09",takesValue:true,placeholder:"<\u7533\u8ACB\u66F8>"},{name:"--draft",summary:"\u4E0B\u66F8\u304D\u3067\u6B62\u3081\u308B\uFF08\u63D0\u51FA\u3057\u306A\u3044\uFF09",takesValue:false}];function leaveRequest(input){if(input.args.length>0){throw new UsageError(`request \
|
|
16
|
+
\u306F\u4F4D\u7F6E\u5F15\u6570\u3092\u53D7\u3051\u53D6\u308A\u307E\u305B\u3093: ${input.args.join(" ")}`,REQUEST_USAGE)}const date=dateFlag(input.flags,"--date");const from=dateFlag(input.flags,"--from");const to=dateFlag(input.flags,"--to");if(date!==void 0&&(from!==void 0||to!==void 0)){throw new UsageError("--date \u3068 --from / --to \u306F\u540C\u6642\u306B\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093",REQUEST_USAGE)}if(date===void 0&&from===void 0&&to===void 0){throw new UsageError("\u53D6\u5F97\u65E5\u3092 --da\
|
|
17
|
+
te \u304B --from / --to \u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044",REQUEST_USAGE)}if(date===void 0&&(from===void 0||to===void 0)){throw new UsageError("\u671F\u9593\u306F --from \u3068 --to \u306E\u4E21\u65B9\u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044",REQUEST_USAGE)}const start=date??from;const end=to===void 0||to===start?void 0:to;if(end!==void 0&&end<start){throw new UsageError(`--to\uFF08${end}\uFF09\u304C --from\uFF08${start}\uFF09\u3088\u308A\u524D\u3067\u3059`,REQUEST_USAGE)}
|
|
18
|
+
if(end!==void 0&&(Date.parse(`${end}T00:00:00Z`)-Date.parse(`${start}T00:00:00Z`))/864e5+1>MAX_PERIOD_DAYS){throw new UsageError(`\u671F\u9593\u306F ${String(MAX_PERIOD_DAYS)} \u65E5\u4EE5\u5185\u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\uFF08${start}\u301C${end}\uFF09`,REQUEST_USAGE)}const rawType=input.flags.get("--type")?.trim()??"full_day";if(!Object.hasOwn(LEAVE_TYPES,rawType)){throw new UsageError(`--type \u306B\u6307\u5B9A\u3067\u304D\u306A\u3044\u5024\u3067\u3059: ${rawType}`,
|
|
19
|
+
TYPE_HELP)}if(end!==void 0&&rawType!=="full_day"){throw new UsageError(`\u671F\u9593\uFF08--from / --to\uFF09\u3067\u7533\u8ACB\u3067\u304D\u308B\u306E\u306F\u5168\u4F11\uFF08full_day\uFF09\u3060\u3051\u3067\u3059\uFF08${LEAVE_TYPES[rawType]}\u306F1\u65E5\u305A\u3064\u7533\u8ACB\u3057\u3066\u304F\u3060\u3055\u3044\uFF09`,REQUEST_USAGE)}const rawHours=input.flags.get("--hours");let hours;if(rawType==="hourly"){const text=rawHours?.trim()??"";hours=Number(text);if(!/^\d+(\.\d+)?$/.test(text)||hours<=
|
|
20
|
+
0){throw new UsageError("--type hourly \u306B\u306F --hours \u3067\u53D6\u5F97\u6642\u9593\uFF08\u4F8B: 2 / 1.5\uFF09\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044",REQUEST_USAGE)}}else if(rawHours!==void 0){throw new UsageError("--hours \u306F --type hourly \u306E\u3068\u304D\u3060\u3051\u6307\u5B9A\u3067\u304D\u307E\u3059",REQUEST_USAGE)}const reason=input.flags.get("--reason");return{start,end,type:rawType,hours,reason:reason===void 0||reason.trim()===""?void 0:reason}}function monthsBetween(start,end){
|
|
21
|
+
const months=[];let year=Number(start.slice(0,4));let month=Number(start.slice(5,7));const last=(end??start).slice(0,7);for(;;){const current=`${String(year)}-${String(month).padStart(2,"0")}`;months.push(current);if(current>=last)return months;month+=1;if(month>12){month=1;year+=1}}}function findColumn(columns,aliases){for(const alias of aliases){const column=columns.find(candidate=>candidate.name===alias);if(column!==void 0)return column}return void 0}function standardType(key){if(Object.hasOwn(
|
|
22
|
+
LEAVE_TYPES,key))return key;return Object.hasOwn(LEGACY_TYPES,key)?LEGACY_TYPES[key]:void 0}function leaveFormData(workflow,request2){const columns=formColumns(workflow);const name=typeof workflow["name"]==="string"?workflow["name"]:"\u7533\u8ACB\u66F8";const listed=columns.map(column=>column.name).join(", ")||"\uFF08\u7121\u3057\uFF09";const formData={};const typeColumn=findColumn(columns,FIELD_ALIASES.type);const dateColumn=findColumn(columns,FIELD_ALIASES.date);if(typeColumn===void 0||dateColumn===
|
|
23
|
+
void 0){throw new UsageError(`\u7533\u8ACB\u66F8\u300C${name}\u300D\u306B\u53D6\u5F97\u7A2E\u5225\u30FB\u53D6\u5F97\u65E5\u306E\u9805\u76EE\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\uFF08\u9805\u76EE: ${listed}\uFF09\u3002\u6709\u7D66\u4F11\u6687\u306E\u7533\u8ACB\u66F8\u304B\u78BA\u304B\u3081\u3066\u304F\u3060\u3055\u3044`,"twp workflow applicable --category paid_holiday")}if(typeColumn.optionKeys.length===0){formData[typeColumn.name]=request2.type}else{const key=typeColumn.optionKeys.find(
|
|
24
|
+
option=>standardType(option)===request2.type);if(key===void 0){throw new UsageError(`\u7533\u8ACB\u66F8\u300C${name}\u300D\u306E\u53D6\u5F97\u7A2E\u5225\u306B ${LEAVE_TYPES[request2.type]??request2.type}\uFF08${request2.type}\uFF09\u304C\u3042\u308A\u307E\u305B\u3093\uFF08\u9078\u629E\u80A2: ${typeColumn.options.join(" / ")}\uFF09`,TYPE_HELP)}formData[typeColumn.name]=key}formData[dateColumn.name]=request2.start;if(request2.end!==void 0){const endColumn=findColumn(columns,FIELD_ALIASES.end);if(endColumn===
|
|
25
|
+
void 0){throw new UsageError(`\u7533\u8ACB\u66F8\u300C${name}\u300D\u306B\u306F\u53D6\u5F97\u7D42\u4E86\u65E5\u306E\u9805\u76EE\u304C\u7121\u3044\u305F\u3081\u3001\u671F\u9593\u3067\u306F\u7533\u8ACB\u3067\u304D\u307E\u305B\u3093\uFF08\u9805\u76EE: ${listed}\uFF09\u3002--date \u30671\u65E5\u305A\u3064\u7533\u8ACB\u3057\u3066\u304F\u3060\u3055\u3044`,REQUEST_USAGE)}formData[endColumn.name]=request2.end}if(request2.hours!==void 0){const hoursColumn=findColumn(columns,FIELD_ALIASES.hours);if(hoursColumn===
|
|
26
|
+
void 0){throw new UsageError(`\u7533\u8ACB\u66F8\u300C${name}\u300D\u306B\u306F\u53D6\u5F97\u6642\u9593\u306E\u9805\u76EE\u304C\u3042\u308A\u307E\u305B\u3093\uFF08\u9805\u76EE: ${listed}\uFF09`,REQUEST_USAGE)}formData[hoursColumn.name]=request2.hours}if(request2.reason!==void 0){const reasonColumn=findColumn(columns,FIELD_ALIASES.reason);if(reasonColumn===void 0){throw new UsageError(`\u7533\u8ACB\u66F8\u300C${name}\u300D\u306B\u306F\u7406\u7531\u3092\u66F8\u304F\u9805\u76EE\u304C\u3042\u308A\u307E\u305B\u3093\uFF08\u9805\u76EE: ${listed}\
|
|
27
|
+
\uFF09\u3002--reason \u3092\u5916\u3057\u3066\u304F\u3060\u3055\u3044`,REQUEST_USAGE)}formData[reasonColumn.name]=request2.reason}const applyType=findColumn(columns,FIELD_ALIASES.applyType);if(applyType!==void 0&&applyType.optionKeys.includes("add"))formData[applyType.name]="add";for(const column of columns){const value=column.defaultValue;if(column.required&&!Object.hasOwn(formData,column.name)&&value!==void 0&&value!==null&&value!==""){formData[column.name]=value}}const missing=columns.filter(
|
|
28
|
+
column=>column.required&&!Object.hasOwn(formData,column.name));if(missing.length>0){throw new UsageError(`\u7533\u8ACB\u66F8\u300C${name}\u300D\u306B\u3001\u3053\u306E\u30B3\u30DE\u30F3\u30C9\u3067\u306F\u57CB\u3081\u3089\u308C\u306A\u3044\u5FC5\u9808\u9805\u76EE\u304C\u3042\u308A\u307E\u3059: ${missing.map(column=>`${column.name}\uFF08${column.displayName}\uFF09`).join(", ")}`,"twp workflow instance create --workflow <\u7533\u8ACB\u66F8> --generate-cli-skeleton \u3067\u4E0B\u66F8\u304D\u3092\u7D44\u307F\u7ACB\u3066\u3066\u304F\u3060\u3055\u3044")}
|
|
29
|
+
return formData}async function leaveWorkflowId(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,"--workflow","paid_holiday")).id}const candidates=await ctx.resolver.applicableWorkflows("paid_holiday");if(candidates.length===1)return candidates[0].id;if(candidates.length===0){throw new ApiRejectedError("\u7533\u8ACB\u3067\u304D\u308B\u6709\u7D66\u4F11\u6687\u306E\u7533\u8ACB\u66F8\u304C\u3042\u308A\u307E\u305B\u3093\uFF08twp workflow applicable --category paid_holiday \u304C0\u4EF6\uFF09\u3002\u30C6\u30CA\u30F3\u30C8\u306E\u7BA1\u7406\u8005\u306B\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044")}
|
|
30
|
+
throw new UsageError(`\u6709\u7D66\u4F11\u6687\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(" / ")}`,REQUEST_USAGE)}function requestParts(input){return{workflowId:requireResolved(input,"workflowId"),content:JSON.parse(requireResolved(input,"content")),months:JSON.parse(requireResolved(input,
|
|
31
|
+
"months"))}}function requestPlan(input){const{workflowId,content}=requestParts(input);return createInstancePlan(workflowId,content)}async function request(input,ctx){const{months}=requestParts(input);const plan=requestPlan(input);await assertMonthsOpen(ctx,months,"\u4F11\u6687\u306E\u7533\u8ACB");const created=await ctx.send(plan);if(input.flags.has("--draft"))return created;const written=isRecord(created)&&isRecord(created["instance"])?created["instance"]:void 0;const id=written?.["id"];if(typeof id!==
|
|
32
|
+
"string"){throw new ApiResponseError("\u8D77\u7968\u306E\u5FDC\u7B54\u306B\u7533\u8ACB\u306E id \u304C\u3042\u308A\u307E\u305B\u3093\u3002\u4E0B\u66F8\u304D\u304C\u4F5C\u3089\u308C\u3066\u3044\u308B\u53EF\u80FD\u6027\u304C\u3042\u308B\u306E\u3067 twp workflow instance list --status new \u3067\u78BA\u304B\u3081\u3066\u304F\u3060\u3055\u3044\u3002")}try{return await ctx.send(applyInstancePlan(id))}catch(error){if(submissionRejected(error)){ctx.warn(`\u4E0B\u66F8\u304D\uFF08\u7533\u8ACBID ${id}\uFF09\u306F\u4F5C\u6210\
|
|
33
|
+
\u6E08\u307F\u3067\u3059\u304C\u3001\u63D0\u51FA\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u76F4\u3057\u3066\u63D0\u51FA\u3059\u308B\u306A\u3089 twp workflow instance apply ${id}\u3001\u3084\u3081\u308B\u306A\u3089 twp workflow instance delete ${id} --yes \u3067\u6D88\u3057\u3066\u304F\u3060\u3055\u3044\uFF08\u3053\u306E\u30B3\u30DE\u30F3\u30C9\u3092\u6253\u3061\u76F4\u3059\u3068\u4E0B\u66F8\u304D\u304C\u3082\u30461\u4EF6\u3067\u304D\u307E\u3059\uFF09\u3002`)}else{ctx.warn(`\u4E0B\u66F8\u304D\uFF08\u7533\u8ACBID ${id}\
|
|
34
|
+
\uFF09\u306F\u4F5C\u6210\u6E08\u307F\u3067\u3059\u304C\u3001\u63D0\u51FA\u3067\u304D\u305F\u304B\u3069\u3046\u304B\u5206\u304B\u308A\u307E\u305B\u3093\u3002twp workflow instance get ${id} \u3067 status \u3092\u78BA\u304B\u3081\u3001new\uFF08\u4E0B\u66F8\u304D\uFF09\u306A\u3089 twp workflow instance apply ${id} \u3067\u63D0\u51FA\u3057\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002new \u4EE5\u5916\u306A\u3089\u63D0\u51FA\u6E08\u307F\u306A\u306E\u3067\u4F55\u3082\u3057\u306A\u3044\u3067\u304F\u3060\u3055\u3044\u3002`)}
|
|
35
|
+
throw error}}function submissionRejected(error){if(error instanceof NotLoggedInError||error instanceof SessionExpiredError)return true;return error instanceof ApiError&&error.status>=400&&error.status<500}function requestNotes(body){const instance=writtenInstance(body);const notes=isRecord(body)&&typeof body["message"]==="string"&&body["message"]!==""?[body["message"]]:[];if(instance["status"]==="new"){notes.push(`\u4E0B\u66F8\u304D\u3067\u6B62\u3081\u307E\u3057\u305F\u3002\u63D0\u51FA\u306F twp workflow instance apply ${String(
|
|
36
|
+
instance["id"])}`)}return notes}var requestOperation={name:"request",summary:"\u6709\u7D66\u4F11\u6687\u3092\u7533\u8ACB\u3059\u308B\uFF08\u30EF\u30FC\u30AF\u30D5\u30ED\u30FC\u3067\u8D77\u7968\u3057\u3066\u63D0\u51FA\uFF09",usage:REQUEST_USAGE,description:`\u6709\u7D66\u4F11\u6687\u306E\u7533\u8ACB\u66F8\uFF08\u30EF\u30FC\u30AF\u30D5\u30ED\u30FC\u306E\u30AB\u30C6\u30B4\u30EA paid_holiday\uFF09\u3067\u7533\u8ACB\u3092\u4F5C\u308A\u3001\u63D0\u51FA\u3057\u307E\u3059\u3002\u753B\u9762\u306E\u4F11\u6687\u7533\u8ACB\u3068\u540C\u3058\u304F
|
|
37
|
+
POST /api/v2/workflows/instances\uFF08\u4E0B\u66F8\u304D\uFF09\u2192 POST /api/v2/workflows/instances/{id}/apply\uFF08\u63D0\u51FA\uFF09\u3092\u9001\u308A\u307E\u3059\u3002
|
|
38
|
+
--draft \u3092\u4ED8\u3051\u308B\u3068\u4E0B\u66F8\u304D\u3067\u6B62\u3081\u307E\u3059\uFF08\u63D0\u51FA\u306F twp workflow instance apply <\u7533\u8ACBID>\uFF09\u3002
|
|
39
|
+
|
|
40
|
+
\u9001\u308B\u524D\u306B\u3001\u7533\u8ACB\u66F8\u306E\u5B9A\u7FA9\uFF08GET /api/v2/workflows/{id}\uFF09\u3092\u8AAD\u3093\u3067\u9805\u76EE\u3068\u9078\u629E\u80A2\u3092\u5408\u308F\u305B\u307E\u3059\u3002
|
|
41
|
+
\u7533\u8ACB\u66F8\u306B\u3088\u3063\u3066\u9078\u3079\u308B\u7A2E\u5225\u3084\u9805\u76EE\u304C\u9055\u3044\u3001\u5408\u308F\u306A\u3044\u3082\u306E\uFF08\u4F8B: \u671F\u9593\u306E\u9805\u76EE\u304C\u7121\u3044\u7533\u8ACB\u66F8\u306B --from / --to\uFF09\u306F\u9001\u3089\u305A\u306B\u6B62\u3081\u307E\u3059\u3002
|
|
42
|
+
${TYPE_HELP}
|
|
43
|
+
\u671F\u9593\uFF08--from / --to\uFF09\u306F\u5168\u4F11\u3060\u3051\u3067\u3059\u3002\u571F\u65E5\u795D\u65E5\u30FB\u6240\u5B9A\u4F11\u65E5\u306F\u6D88\u5316\u65E5\u6570\u306B\u6570\u3048\u307E\u305B\u3093\uFF08\u65E5\u6570\u306F\u753B\u9762\u306E\u671F\u9593\u30D7\u30EC\u30D3\u30E5\u30FC\u3068\u540C\u3058\u8A08\u7B97\uFF09\u3002
|
|
44
|
+
\u5BFE\u8C61\u306E\u6708\uFF08\u671F\u9593\u306A\u3089\u304B\u304B\u308B\u6708\u3059\u3079\u3066\uFF09\u306E\u81EA\u5206\u306E\u52E4\u6020\u304C\u7DE0\u3081\u6E08\u307F\u306A\u3089\u3001\u9001\u3089\u305A\u306B\u6B62\u3081\u307E\u3059\uFF08\u7D42\u4E86\u30B3\u30FC\u30C9 3\uFF09\u3002
|
|
45
|
+
|
|
46
|
+
--workflow \u3092\u7701\u304F\u3068\u3001\u7533\u8ACB\u3067\u304D\u308B\u6709\u7D66\u4F11\u6687\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
|
|
47
|
+
\uFF08\u5019\u88DC\u306F twp workflow applicable --category paid_holiday\uFF09\u3002
|
|
48
|
+
\u6B8B\u65E5\u6570\u306E\u4E0D\u8DB3\u30FB\u540C\u3058\u65E5\u306E\u91CD\u8907\u306F\u30B5\u30FC\u30D0\u304C\u63D0\u51FA\u6642\u306B\u65AD\u308A\u307E\u3059\uFF08\u7D42\u4E86\u30B3\u30FC\u30C9 3\uFF09\u3002\u305D\u306E\u3068\u304D\u4E0B\u66F8\u304D\u306F\u6B8B\u308B\u306E\u3067\u3001\u6848\u5185\u306B\u5F93\u3063\u3066\u6D88\u3059\u304B\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002
|
|
49
|
+
\u7533\u8ACB\u3067\u304D\u308B\u306E\u306F\u30ED\u30B0\u30A4\u30F3\u3057\u3066\u3044\u308B\u672C\u4EBA\u306E\u5206\u3060\u3051\u3067\u3059\u3002`,flags:REQUEST_FLAGS,async prepare(input,ctx){const leave=leaveRequest(input);const workflowId=await leaveWorkflowId(input,ctx);const workflow=await ctx.resolver.workflowDefinition(workflowId);if(workflow["defined_category"]!=="paid_holiday"){throw new UsageError(`\u7533\u8ACB\u66F8\u300C${String(workflow["name"])}\u300D\u306F\u6709\u7D66\u4F11\u6687\u306E\u7533\u8ACB\u66F8\u3067\u306F\u3042\u308A\u307E\u305B\u3093\uFF08\u30AB\u30C6\u30B4\u30EA: ${String(
|
|
50
|
+
workflow["defined_category"])}\uFF09`,"twp workflow applicable --category paid_holiday")}const title=input.flags.get("--title")?.trim();const content={...title===void 0||title===""?{}:{title},form_data:leaveFormData(workflow,leave)};return withResolved(input,{workflowId,content:JSON.stringify(content),months:JSON.stringify(monthsBetween(leave.start,leave.end))})},plan:requestPlan,plannedNotes:input=>{const{months}=requestParts(input);return[`\u3053\u306E\u524D\u306B ${months.join(" / ")} \u306E\u81EA\u5206\u306E\u52E4\u6020\u8868\
|
|
51
|
+
\uFF08GET /api/v1/attendance/timesheet?year_month=\u2026\uFF09\u3067\u7DE0\u3081\u3092\u78BA\u304B\u3081\u307E\u3059`,input.flags.has("--draft")?"\u4E0B\u66F8\u304D\u3067\u6B62\u3081\u307E\u3059\uFF08\u63D0\u51FA\u306F\u3057\u307E\u305B\u3093\uFF09":"\u7D9A\u3051\u3066\u63D0\u51FA\uFF08POST /api/v2/workflows/instances/{id}/apply\uFF09\u3092\u9001\u308A\u307E\u3059\u3002\u63D0\u51FA\u3059\u308B\u3068\u627F\u8A8D\u8005\u3078\u901A\u77E5\u304C\u5C4A\u304D\u307E\u3059"]},execute:request,summarize:body=>pick(
|
|
52
|
+
writtenInstance(body),["id","title","workflow_name","status","current_step_no","applied_at"]),raw:writtenInstance,notes:requestNotes};var leaveDomain={name:"leave",summary:"\u6709\u7D66\u4F11\u6687\uFF08\u81EA\u5206\u306E\u6B8B\u65E5\u6570\u3068\u53D6\u5F97\u5C65\u6B74\u30FB\u4ED8\u4E0E\u5C65\u6B74\u30FB\u7533\u8ACB\uFF09",operations:[{name:"list",summary:"\u81EA\u5206\u306E\u6709\u7D66\u306E\u53D6\u5F97\u5C65\u6B74\u3092\u4E00\u89A7\u3057\u3001\u6B8B\u65E5\u6570\u3092\u8868\u793A\u3059\u308B",usage:LIST_USAGE,
|
|
53
|
+
description:"GET /api/v1/paid-leave/me\uFF08\u6B8B\u65E5\u6570\u306E\u30B5\u30DE\u30EA\uFF09\u3068 GET /api/v1/paid-leave/me/usages\uFF08\u53D6\u5F97\u5C65\u6B74\uFF09\u3092\u8868\u793A\u3057\u307E\u3059\uFF08\u30ED\u30B0\u30A4\u30F3\u3057\u3066\u3044\u308B\u672C\u4EBA\u306E\u5206\uFF09\u3002\n--output table / text / tsv \u306F\u53D6\u5F97\u5C65\u6B74\u306E\u8981\u7D04\u5217\u3067\u3001\u6B8B\u65E5\u6570\u30FB\u53D6\u5F97\u7387\u30FB\u5E745\u65E5\u306E\u53D6\u5F97\u7FA9\u52D9\u306F stderr \u306B\u51FA\u3057\u307E\u3059\u3002\n--output json \u306F {summary, usages} \u306B2\u3064\u306E API \u306E\u5FDC\u7B54\u3092\u305D\u306E\u307E\u307E\u5165\u308C\u3066\u51FA\u3057\u307E\u3059\u3002\n\u6709\u7D66\u306E\u7533\u8ACB\u306F twp leave request \u3067\u884C\u3044\u307E\u3059\u3002",
|
|
54
|
+
flags:[],plan:listPlan,plannedNotes:()=>["\u5B9F\u884C\u6642\u306F\u3001\u7D9A\u3051\u3066\u53D6\u5F97\u5C65\u6B74\uFF08GET /api/v1/paid-leave/me/usages\uFF09\u3082\u9001\u308A\u307E\u3059\u3002"],execute:list,summarize:body=>listBody(body).usages["usages"].map(row=>pick(row,USAGE_COLUMNS)),raw:body=>listBody(body),notes:listNotes},{name:"grants",summary:"\u6709\u7D66\u306E\u4ED8\u4E0E\u5C65\u6B74\uFF08\u4ED8\u4E0E\u65E5\u30FB\u65E5\u6570\u30FB\u6B8B\u308A\u30FB\u6709\u52B9\u671F\u9650\uFF09\u3092\u8868\u793A\u3059\u308B",
|
|
55
|
+
usage:GRANTS_USAGE,description:`<\u30E6\u30FC\u30B6\u30FC> \u3092\u7701\u7565\u3059\u308B\u304B me \u3092\u6307\u5B9A\u3059\u308B\u3068 GET /api/v1/paid-leave/me/grants\uFF08\u672C\u4EBA\u306E\u5206\uFF09\u3001
|
|
56
|
+
\u305D\u308C\u4EE5\u5916\u306F GET /api/v1/paid-leave/users/{userId}/grants \u3092\u8868\u793A\u3057\u307E\u3059\u3002
|
|
57
|
+
\u4ED6\u306E\u4EBA\u306E\u4ED8\u4E0E\u5C65\u6B74\u306F\u3001\u6709\u7D66\u7BA1\u7406\u306E\u6A29\u9650\u3092\u6301\u3064\u4EBA\u304B\u3001\u305D\u306E\u4EBA\u306E\u4E0A\u9577\u3060\u3051\u304C\u898B\u3089\u308C\u307E\u3059\uFF08\u7121\u3051\u308C\u3070\u7D42\u4E86\u30B3\u30FC\u30C9 3\uFF09\u3002
|
|
58
|
+
\u6A29\u9650\u306B\u3088\u3063\u3066\u306F\u7406\u7531\uFF08reason\uFF09\u304C\u4F0F\u305B\u3089\u308C\u307E\u3059\u3002
|
|
59
|
+
${USER_REF_HELP}
|
|
60
|
+
--output json \u306F API \u304C\u8FD4\u3059\u5168\u30D5\u30A3\u30FC\u30EB\u30C9\uFF08\u7E70\u8D8A\u306E\u8ABF\u6574 carry_adjustments \u3092\u542B\u3080\uFF09\u3092\u51FA\u3057\u307E\u3059\u3002`,flags:[USER_REF_FLAG],async prepare(input,ctx){const ref=grantsRef(input);if(ref===void 0)return input;const user=await ctx.resolver.user(ref);return withResolved(input,{userId:user.id})},plan(input){if(grantsRef(input)===void 0)return{method:"GET",path:"/api/v1/paid-leave/me/grants"};requireResolved(input,
|
|
61
|
+
"userId");return{method:"GET",path:`/api/v1/paid-leave/users/${userPath(input,"/grants")}`}},summarize:body=>grantsBody(body)["grants"].map(row=>pick(row,GRANT_COLUMNS)),raw:body=>grantsBody(body),notes:grantsNotes,forbidden:"\u6A29\u9650\u304C\u8DB3\u308A\u307E\u305B\u3093\u3002\u81EA\u5206\u306E\u4ED8\u4E0E\u5C65\u6B74\u306F\u52E4\u6020\u306E\u5229\u7528\u6A29\u9650\u3001\u4ED6\u306E\u4EBA\u306E\u4ED8\u4E0E\u5C65\u6B74\u306F\u6709\u7D66\u7BA1\u7406\u306E\u6A29\u9650\u304B\u3001\u305D\u306E\u4EBA\u306E\u4E0A\u9577\u3067\u3042\u308B\u3053\u3068\u304C\u8981\u308A\u307E\u3059\u3002\u30C6\u30CA\u30F3\u30C8\u306E\u7BA1\u7406\u8005\u306B\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044"},
|
|
62
|
+
requestOperation]};export{leaveDomain,leaveFormData,monthsBetween};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire as __twpCreateRequire } from 'node:module';
|
|
2
2
|
const require = __twpCreateRequire(import.meta.url);
|
|
3
|
-
import{contentTypeFor,inspectLocalFile}from"./chunk-VECUCVIY.js";import{checkUploadQuota}from"./chunk-DDKZ5IPT.js";import"./chunk-
|
|
3
|
+
import{contentTypeFor,inspectLocalFile}from"./chunk-VECUCVIY.js";import{checkUploadQuota}from"./chunk-DDKZ5IPT.js";import"./chunk-ZST7XESB.js";import"./chunk-IF2K4PM5.js";import{isSafePathSegment}from"./chunk-GMBJTG6A.js";import"./chunk-J7QYPKVK.js";import"./chunk-4VZKNEVN.js";import"./chunk-NHYMHCAT.js";import"./chunk-GY7KI5E5.js";import{LIST_FLAGS,LIST_PAGING_HELP,envelopePaging,nonEmpty,positiveInteger}from"./chunk-R53CMVWR.js";import"./chunk-II5RVJQN.js";
|
|
4
4
|
import{requireResolved,singleRef,withResolved}from"./chunk-ZN5EFDH7.js";import{isRecord,pick}from"./chunk-ZWVYVS2A.js";import{ApiRejectedError,ApiResponseError,UsageError}from"./chunk-7WSNIXTQ.js";import"./chunk-RZVI6PMW.js";import"./chunk-VSJBJXZO.js";import crypto from"crypto";import fs from"fs";import path from"path";var SCOPE_PERSONAL="personal";var SCOPE_PROJECT="project";var LIST_COLUMNS=["id","file_name","content_type","file_size","folder_id","public_status","updated_at"];var UPLOAD_COLUMNS=["id","file_name","content_type","file_size","folder_id","scope","content_hash"];var FILE_FLAG={name:"--file",summary:"\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u3059\u308B\u30ED\u30FC\u30AB\u30EB\u30D5\u30A1\u30A4\u30EB\u306E\u30D1\u30B9\uFF08\u5FC5\u9808\uFF09",takesValue:true,placeholder:"<\u30D1\u30B9>"};var NAME_FLAG={
|
|
5
5
|
name:"--name",summary:"\u4FDD\u5B58\u3059\u308B\u30D5\u30A1\u30A4\u30EB\u540D\uFF08\u7701\u7565\u6642\u306F\u30ED\u30FC\u30AB\u30EB\u306E\u30D5\u30A1\u30A4\u30EB\u540D\u3002\u540C\u540D\u304C\u3042\u308B\u3068\u30B5\u30FC\u30D0\u304C\u5225\u540D\u306B\u3057\u307E\u3059\uFF09",takesValue:true,placeholder:"<\u30D5\u30A1\u30A4\u30EB\u540D>"};var CONTENT_TYPE_FLAG={name:"--content-type",summary:"Content-Type\uFF08\u7701\u7565\u6642\u306F\u62E1\u5F35\u5B50\u304B\u3089\u63A8\u5B9A\u3002\u4E0D\u660E\u306A\u3089 application/octet-stream\uFF09",
|
|
6
6
|
takesValue:true,placeholder:"<\u578B>"};var FOLDER_FLAG={name:"--folder",summary:"\u30D5\u30A9\u30EB\u30C0ID\uFF08\u7701\u7565\u6642\u306F\u30B9\u30B3\u30FC\u30D7\u306E\u6700\u4E0A\u4F4D\uFF09",takesValue:true,placeholder:"<\u30D5\u30A9\u30EB\u30C0ID>"};var MEDIA_PROJECT_FLAG={name:"--project",summary:"\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u306E\u30D5\u30A1\u30A4\u30EB\u3092\u5BFE\u8C61\u306B\u3059\u308B\uFF08\u30B3\u30FC\u30C9\u307E\u305F\u306F ID\uFF09\u3002\u7701\u7565\u6642\u306F\u81EA\u5206\u306E\u500B\u4EBA\u30D5\u30A1\u30A4\u30EB",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire as __twpCreateRequire } from 'node:module';
|
|
2
2
|
const require = __twpCreateRequire(import.meta.url);
|
|
3
|
-
import{boundedText}from"./chunk-UDPJ2IGK.js";import{NOTIFICATIONS_PATH}from"./chunk-
|
|
3
|
+
import{boundedText}from"./chunk-UDPJ2IGK.js";import{NOTIFICATIONS_PATH}from"./chunk-ZST7XESB.js";import"./chunk-IF2K4PM5.js";import{isSafePathSegment}from"./chunk-GMBJTG6A.js";import"./chunk-J7QYPKVK.js";import"./chunk-4VZKNEVN.js";import"./chunk-NHYMHCAT.js";import{LIST_FLAGS,LIST_PAGING_HELP,envelopePaging,nonEmpty,positiveInteger}from"./chunk-R53CMVWR.js";import"./chunk-II5RVJQN.js";import{requireResolved,withResolved}from"./chunk-ZN5EFDH7.js";
|
|
4
4
|
import{isRecord,pick}from"./chunk-ZWVYVS2A.js";import{ApiResponseError,UsageError}from"./chunk-7WSNIXTQ.js";import"./chunk-RZVI6PMW.js";import"./chunk-VSJBJXZO.js";var LABEL="\u901A\u77E5";var LIST_COLUMNS=["id","datetime","category_name","status_name","title"];var GET_COLUMNS=["id","datetime","category","category_name","status_name","read_time","title","content","url"];var CATEGORY_FLAG={name:"--category",summary:"\u901A\u77E5\u30AB\u30C6\u30B4\u30EA\u3067\u7D5E\u308A\u8FBC\u3080\uFF08\u30AD\u30FC\u304B\u540D\u524D\u3002twp notification categories \u3067\u4E00\u89A7\u3067\u304D\u308B\uFF09",takesValue:true,placeholder:"<\u30AB\u30C6\u30B4\u30EA>"};var CATEGORY_HELP="\
|
|
5
5
|
--category \u306F\u30AB\u30C6\u30B4\u30EA\u306E\u30AD\u30FC\uFF08workflow_approval\uFF09\u304B\u540D\u524D\uFF08\u30EF\u30FC\u30AF\u30D5\u30ED\u30FC\u627F\u8A8D\u4F9D\u983C\uFF09\u3067\u6307\u5B9A\u3067\u304D\u307E\u3059\u3002\n\u30AB\u30C6\u30B4\u30EA\u4E00\u89A7\u3068\u7167\u5408\u3059\u308B\u306E\u3067\u3001\u6253\u3061\u9593\u9055\u3048\u305F\u30AB\u30C6\u30B4\u30EA\u3092\u300C0\u4EF6\u300D\u3068\u3057\u3066\u8FD4\u3059\u3053\u3068\u306F\u3042\u308A\u307E\u305B\u3093\uFF08\u4E00\u89A7\u306F\u65E2\u5B9A10\u5206\u30AD\u30E3\u30C3\u30B7\u30E5\u30FB--refresh \u3067\u53D6\u308A\u76F4\u3057\uFF09\u3002";
|
|
6
6
|
async function resolveCategory(input,ctx){const raw=nonEmpty(input.flags,CATEGORY_FLAG.name);if(raw===void 0)return input;return withResolved(input,{category:(await ctx.resolver.notificationCategory(raw.trim())).id})}function noArgs(input,op){if(input.args.length>0){throw new UsageError(`${op} \u306F\u4F4D\u7F6E\u5F15\u6570\u3092\u53D6\u308A\u307E\u305B\u3093: ${input.args.join(" ")}`,`twp notification ${op} help`)}}function notificationId(input,op){const[raw,...rest]=input.args;const id=raw?.trim()??
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire as __twpCreateRequire } from 'node:module';
|
|
2
2
|
const require = __twpCreateRequire(import.meta.url);
|
|
3
|
-
import{activateModeFiles,activatePermissionSettings,buildResidentSet,buildSystemPrompt,createAuditLogger,createTwpToolkit,currentBranch,displayCwd,residentInputs,runTurn}from"./chunk-HAIZHSNZ.js";import"./chunk-NZ7WI4RZ.js";import"./chunk-BUZKNZ45.js";import"./chunk-
|
|
3
|
+
import{activateModeFiles,activatePermissionSettings,buildResidentSet,buildSystemPrompt,createAuditLogger,createTwpToolkit,currentBranch,displayCwd,residentInputs,runTurn}from"./chunk-HAIZHSNZ.js";import"./chunk-NZ7WI4RZ.js";import"./chunk-BUZKNZ45.js";import"./chunk-ZST7XESB.js";import"./chunk-IF2K4PM5.js";import"./chunk-GMBJTG6A.js";import{RelayError,createRuntime,pickModel}from"./chunk-PWXXCLVZ.js";import"./chunk-D233KKXW.js";import"./chunk-XNLIEUAW.js";
|
|
4
4
|
import"./chunk-J7QYPKVK.js";import{checkMinSupportedVersion,enforceMinSupportedVersion,floorNeedsRefresh}from"./chunk-DXXFUNYN.js";import"./chunk-4VZKNEVN.js";import{getMode}from"./chunk-NAUH75MM.js";import{stripTerminalControls}from"./chunk-NHYMHCAT.js";import"./chunk-N2UVRM3Z.js";import"./chunk-II5RVJQN.js";import"./chunk-7WSNIXTQ.js";import"./chunk-PMOUHEJQ.js";import"./chunk-RZVI6PMW.js";import"./chunk-VSJBJXZO.js";async function runOneShot(opts,deps={}){const out=deps.out??(text=>void process.stdout.write(stripTerminalControls(text)));const err=deps.err??(text=>void process.stderr.write(stripTerminalControls(text)));activateModeFiles(err);const permissionLayers=activatePermissionSettings(err,{...opts.allowedTools?{allowedTools:opts.allowedTools}:{},...opts.disallowedTools?{disallowedTools:opts.disallowedTools}:{}});const prompt=opts.fromStdin?await(deps.readStdin??readStdin)():opts.prompt;if(prompt.trim()===
|
|
5
5
|
""){err('\u30D7\u30ED\u30F3\u30D7\u30C8\u304C\u7A7A\u3067\u3059\u3002`twp -p "\u8CEA\u554F"`\uFF08`-p -` \u3067\u6A19\u6E96\u5165\u529B\uFF09\n');return 2}const runtime=deps.runtime??createRuntime({...opts.profile!==void 0?{profile:opts.profile}:{},...opts.model!==void 0?{model:opts.model}:{},cliVersion:opts.version});const cachedFloor=runtime.loadCachedFloor();if(await checkMinSupportedVersion({current:opts.version,cachedFloor:cachedFloor.minSupportedVersion,refresh:async()=>(await runtime.loadCatalog()).
|
|
6
6
|
minSupportedVersion,write:err})){return 1}if(!runtime.loggedIn){err("\u30ED\u30B0\u30A4\u30F3\u3057\u3066\u3044\u307E\u305B\u3093\u3002`twp login` \u3092\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002\n");return 1}let model=runtime.configuredModel??"";let catalog=null;if(model===""){catalog=await runtime.loadCatalog();const picked=pickModel(catalog,void 0);model=picked.model;if(catalog.source!=="server"){err(`\u26A0 \u30E2\u30C7\u30EB\u4E00\u89A7\u3092\u53D6\u5F97\u3067\u304D\u306A\u304B\u3063\u305F\u305F\u3081 ${model}\
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire as __twpCreateRequire } from 'node:module';
|
|
2
2
|
const require = __twpCreateRequire(import.meta.url);
|
|
3
|
-
import{STATUS_VALUES,booleanQuery,flatMasterDomain}from"./chunk-
|
|
3
|
+
import{STATUS_VALUES,booleanQuery,flatMasterDomain}from"./chunk-KA3EE4TJ.js";import"./chunk-UDPJ2IGK.js";import{POSITIONS_PATH}from"./chunk-ZST7XESB.js";import"./chunk-IF2K4PM5.js";import"./chunk-GMBJTG6A.js";import"./chunk-J7QYPKVK.js";import"./chunk-4VZKNEVN.js";import"./chunk-NHYMHCAT.js";import"./chunk-R53CMVWR.js";import"./chunk-II5RVJQN.js";import"./chunk-ZN5EFDH7.js";import"./chunk-ZWVYVS2A.js";import"./chunk-7WSNIXTQ.js";
|
|
4
4
|
import"./chunk-RZVI6PMW.js";import"./chunk-VSJBJXZO.js";var positionDomain=flatMasterDomain({name:"position",label:"\u5F79\u8077",path:POSITIONS_PATH,itemKey:"position",summary:"\u5F79\u8077\u30DE\u30B9\u30BF\uFF08\u4E00\u89A7\u30FB\u53D6\u5F97\u30FB\u4F5C\u6210\u30FB\u66F4\u65B0\u30FB\u524A\u9664\uFF09",listColumns:["id","code","name","rank","is_manager","status","user_count"],getColumns:["id","code","name","name_short","rank","is_manager","status","description"],fields:[{kind:"text",flag:"--name-short",key:"name_short",label:"\u7565\u79F0",maxChars:50,
|
|
5
5
|
summary:"\u7565\u79F0"},{kind:"integer",flag:"--rank",key:"rank",label:"\u30E9\u30F3\u30AF",min:0,max:9999,summary:"\u30E9\u30F3\u30AF\uFF080\u301C9999\u3002\u5927\u304D\u3044\u307B\u3069\u4E0A\u4F4D\uFF09"},{kind:"boolean",flag:"--manager",key:"is_manager",summary:"\u7BA1\u7406\u8077\u304B\uFF08true / false\uFF09"},{kind:"boolean",flag:"--can-view-personal-info",key:"can_view_personal_info",summary:"\u90E8\u4E0B\u306E\u500B\u4EBA\u60C5\u5831\u3092\u95B2\u89A7\u3067\u304D\u308B\u304B\uFF08true / false\uFF09"},
|
|
6
6
|
{kind:"boolean",flag:"--can-view-emergency-contact",key:"can_view_emergency_contact",summary:"\u90E8\u4E0B\u306E\u7DCA\u6025\u9023\u7D61\u5148\u3092\u95B2\u89A7\u3067\u304D\u308B\u304B\uFF08true / false\uFF09"},{kind:"boolean",flag:"--can-view-work-tel",key:"can_view_work_tel",summary:"\u90E8\u4E0B\u306E\u696D\u52D9\u7528\u96FB\u8A71\u756A\u53F7\u3092\u95B2\u89A7\u3067\u304D\u308B\u304B\uFF08true / false\uFF09"},{kind:"enum",flag:"--status",key:"status",values:STATUS_VALUES,summary:"\u72B6\u614B\uFF08active: \u6709\
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire as __twpCreateRequire } from 'node:module';
|
|
2
2
|
const require = __twpCreateRequire(import.meta.url);
|
|
3
|
-
import{CUSTOMER_LICENSE,INTERACTION_FIELDS,INTERACTION_TYPES,dataOf,levelForbidden}from"./chunk-
|
|
3
|
+
import{CUSTOMER_LICENSE,INTERACTION_FIELDS,INTERACTION_TYPES,dataOf,levelForbidden}from"./chunk-4CVLBR42.js";import"./chunk-I6DWJXPC.js";import"./chunk-VECUCVIY.js";import"./chunk-DDKZ5IPT.js";import"./chunk-SN6YG4SF.js";import{createFlags,fieldBody,hasAnyField,resolveRefFields,updateFlags}from"./chunk-KA3EE4TJ.js";import{repeatedValues}from"./chunk-IOGVQVGD.js";import"./chunk-UDPJ2IGK.js";import{PROSPECTS_PATH}from"./chunk-ZST7XESB.js";import{
|
|
4
4
|
MultipartBody}from"./chunk-IF2K4PM5.js";import{isSafePathSegment}from"./chunk-GMBJTG6A.js";import"./chunk-J7QYPKVK.js";import"./chunk-4VZKNEVN.js";import"./chunk-QQRJLH6B.js";import"./chunk-NHYMHCAT.js";import"./chunk-GY7KI5E5.js";import{LIST_FLAGS,LIST_PAGING_HELP,envelopePaging,nonEmpty,positiveInteger}from"./chunk-R53CMVWR.js";import"./chunk-II5RVJQN.js";import{requireResolved,singleRef,withResolved}from"./chunk-ZN5EFDH7.js";import{acknowledgement,
|
|
5
5
|
isRecord,pick}from"./chunk-ZWVYVS2A.js";import{ApiRejectedError,ApiResponseError,UsageError}from"./chunk-7WSNIXTQ.js";import"./chunk-RZVI6PMW.js";import"./chunk-VSJBJXZO.js";import fs from"fs";import path from"path";var VIEW_FORBIDDEN=levelForbidden(CUSTOMER_LICENSE,"\u30A2\u30D7\u30ED\u30FC\u30C1\u5148\u3092\u898B\u308B\u306B\u306F\u9867\u5BA2\u7BA1\u7406\u306E\u6A29\u9650\u304C\u8981\u308A\u307E\u3059\u3002\u30C6\u30CA\u30F3\u30C8\u7BA1\u7406\u8005\u306B\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002");var EDIT_FORBIDDEN=levelForbidden(CUSTOMER_LICENSE,"\u30A2\u30D7\u30ED\u30FC\u30C1\u5148\u306E\u767B\u9332\u30FB\u66F4\u65B0\u306B\u306F\u9867\u5BA2\u7BA1\u7406\u306E\u6A29\u9650\u304C\u300C\u7DE8\u96C6\u8005\u300D\u4EE5\u4E0A\u3067\u3042\u308B\u3053\u3068\u304C\u8981\u308A\u307E\u3059\u3002\u30C6\u30CA\u30F3\u30C8\u7BA1\u7406\u8005\u306B\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002");
|
|
6
6
|
function adminForbidden(what){return levelForbidden(CUSTOMER_LICENSE,`${what}\u306B\u306F\u9867\u5BA2\u7BA1\u7406\u306E\u6A29\u9650\u304C\u300C\u7BA1\u7406\u8005\u300D\u3067\u3042\u308B\u3053\u3068\u304C\u8981\u308A\u307E\u3059\uFF08\u300C\u7DE8\u96C6\u8005\u300D\u3067\u306F\u3067\u304D\u307E\u305B\u3093\uFF09\u3002\u30C6\u30CA\u30F3\u30C8\u7BA1\u7406\u8005\u306B\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002`)}var ASSIGNABLE_STATUSES=["new","approaching","responded","appointment","reject\
|
|
@@ -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-R64SA5WZ.js";import"./chunk-VSJBJXZO.js";export{loadDomain};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire as __twpCreateRequire } from 'node:module';
|
|
2
2
|
const require = __twpCreateRequire(import.meta.url);
|
|
3
|
-
import{charCount,readBody}from"./chunk-HGTG5XQ7.js";import{REPORTS_PATH}from"./chunk-
|
|
3
|
+
import{charCount,readBody}from"./chunk-HGTG5XQ7.js";import{REPORTS_PATH}from"./chunk-ZST7XESB.js";import"./chunk-IF2K4PM5.js";import{UUID_RE,isSafePathSegment}from"./chunk-GMBJTG6A.js";import"./chunk-J7QYPKVK.js";import"./chunk-4VZKNEVN.js";import"./chunk-NHYMHCAT.js";import{LIST_FLAGS,LIST_PAGING_HELP,envelopePaging,nonEmpty,positiveInteger}from"./chunk-R53CMVWR.js";import"./chunk-II5RVJQN.js";import{requireResolved,singleRef,withResolved}from"./chunk-ZN5EFDH7.js";
|
|
4
4
|
import{isRecord,pick}from"./chunk-ZWVYVS2A.js";import{ApiResponseError,UsageError}from"./chunk-7WSNIXTQ.js";import"./chunk-RZVI6PMW.js";import"./chunk-VSJBJXZO.js";var LABEL="\u30EC\u30DD\u30FC\u30C8";var STATUSES={new:"\u4E0B\u66F8\u304D",completed:"\u63D0\u51FA\u6E08\u307F",reviewed:"\u78BA\u8A8D\u6E08\u307F",rejected:"\u5DEE\u3057\u623B\u3057"};var STATUS_HELP=`\u72B6\u614B: ${Object.entries(STATUSES).map(([key,name])=>`${key}\uFF08${name}\uFF09`).join(" / ")}`;var TITLE_MAX_CHARS=200;var CONTENT_MAX_CHARS=1e6;var CONTENT_KEYS=["title","content"];var ULID_RE=/^[0-9A-HJKMNP-TV-Z]{26}$/i;var LIST_COLUMNS=["id","title","format_name","status","created_at","\
|
|
5
5
|
updated_at","completed_at"];var GET_COLUMNS=["id","title","format_name","status","status_label","created_at","updated_at","completed_at","reviewed_at","reviewed_by_name","rejected_by_name"];var WRITE_COLUMNS=["id","title","format_id","status","status_label","created_at","updated_at","completed_at"];var FORMAT_COLUMNS=["id","code","name","is_available","title_editable","writer","reviewer","admin"];var FORMAT_FLAG={name:"--format",summary:"\u30EC\u30DD\u30FC\u30C8\u30D5\u30A9\u30FC\u30DE\u30C3\u30C8\u306E\u540D\u524D\u30FB\u30B3\u30FC\u30C9\uFF08RF-000001\uFF09\u30FBID",
|
|
6
6
|
takesValue:true,placeholder:"<\u30D5\u30A9\u30FC\u30DE\u30C3\u30C8>"};var CONTENT_FILE_FLAG={name:"--content-file",summary:"\u30EC\u30DD\u30FC\u30C8\u306E\u5185\u5BB9\u306E JSON \u30D5\u30A1\u30A4\u30EB\uFF08title / content\u30FB- \u3067\u6A19\u6E96\u5165\u529B\uFF09",takesValue:true,placeholder:"<\u30D1\u30B9>"};var SKELETON_FLAG={name:"--generate-cli-skeleton",summary:"\u30D5\u30A9\u30FC\u30DE\u30C3\u30C8\u306E\u5165\u529B\u9805\u76EE\u304B\u3089 --content-file \u306E\u3072\u306A\u5F62\u3092\u51FA\u3057\u3066\u7D42\u4E86\u3059\u308B\uFF08\u30EC\u30DD\u30FC\u30C8\u306F\u4F5C\u3089\u306A\u3044\uFF09",
|
|
@@ -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,exitCodeFor,fetchAllPages,outputValue,reportError,requiresYes,resolvePaging,runDomain}from"./chunk-
|
|
3
|
+
import{CURATED_PAGING_VOCABULARY,buildPrepareContext,exitCodeFor,fetchAllPages,outputValue,reportError,requiresYes,resolvePaging,runDomain}from"./chunk-KSWRKHKU.js";import"./chunk-6NEQ6PZZ.js";import"./chunk-BUZKNZ45.js";import"./chunk-R64SA5WZ.js";import"./chunk-GDM2QUBL.js";import"./chunk-IOGVQVGD.js";import"./chunk-ZST7XESB.js";import"./chunk-IF2K4PM5.js";import"./chunk-GMBJTG6A.js";import"./chunk-TAN5I2DP.js";import"./chunk-XNLIEUAW.js";
|
|
4
4
|
import"./chunk-J7QYPKVK.js";import"./chunk-4VZKNEVN.js";import"./chunk-523KROGI.js";import"./chunk-QQRJLH6B.js";import"./chunk-K2ONOH3L.js";import"./chunk-WVS4W5FY.js";import"./chunk-NHYMHCAT.js";import"./chunk-R53CMVWR.js";import"./chunk-II5RVJQN.js";import"./chunk-7WSNIXTQ.js";import"./chunk-RZVI6PMW.js";import"./chunk-VSJBJXZO.js";export{CURATED_PAGING_VOCABULARY,buildPrepareContext,exitCodeFor,fetchAllPages,outputValue,reportError,requiresYes,resolvePaging,runDomain};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { createRequire as __twpCreateRequire } from 'node:module';
|
|
2
2
|
const require = __twpCreateRequire(import.meta.url);
|
|
3
|
-
import{estimateDomain,featureLicenseGuidance,invoiceDomain,licenseForbidden}from"./chunk-
|
|
3
|
+
import{estimateDomain,featureLicenseGuidance,invoiceDomain,licenseForbidden}from"./chunk-SN6YG4SF.js";import"./chunk-IOGVQVGD.js";import"./chunk-UDPJ2IGK.js";import"./chunk-ZST7XESB.js";import"./chunk-IF2K4PM5.js";import"./chunk-GMBJTG6A.js";import"./chunk-J7QYPKVK.js";import"./chunk-4VZKNEVN.js";import"./chunk-QQRJLH6B.js";import"./chunk-NHYMHCAT.js";import"./chunk-R53CMVWR.js";import"./chunk-II5RVJQN.js";import"./chunk-ZN5EFDH7.js";
|
|
4
4
|
import"./chunk-ZWVYVS2A.js";import"./chunk-7WSNIXTQ.js";import"./chunk-RZVI6PMW.js";import"./chunk-VSJBJXZO.js";export{estimateDomain,featureLicenseGuidance,invoiceDomain,licenseForbidden};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire as __twpCreateRequire } from 'node:module';
|
|
2
2
|
const require = __twpCreateRequire(import.meta.url);
|
|
3
|
-
import{charCount,readBody}from"./chunk-HGTG5XQ7.js";import{PROJECT_FLAG,TASK_REF_FLAG,TASK_REF_HELP,classifyTaskRef,rejectPrivateSurface,rejectRedundantProject,resolveTaskLocation,taskAttachmentResource,taskSurface,wantsPrivateSurface}from"./chunk-VECUCVIY.js";import"./chunk-DDKZ5IPT.js";import{createFlags,fieldBody,hasAnyField,updateFlags}from"./chunk-
|
|
4
|
-
import{PRIVATE_TASKS_PATH,TASK_MASTERS}from"./chunk-
|
|
3
|
+
import{charCount,readBody}from"./chunk-HGTG5XQ7.js";import{PROJECT_FLAG,TASK_REF_FLAG,TASK_REF_HELP,classifyTaskRef,rejectPrivateSurface,rejectRedundantProject,resolveTaskLocation,taskAttachmentResource,taskSurface,wantsPrivateSurface}from"./chunk-VECUCVIY.js";import"./chunk-DDKZ5IPT.js";import{createFlags,fieldBody,hasAnyField,updateFlags}from"./chunk-KA3EE4TJ.js";import{repeatedValues}from"./chunk-IOGVQVGD.js";import{boundedText,decimal,isoDate,priority}from"./chunk-UDPJ2IGK.js";
|
|
4
|
+
import{PRIVATE_TASKS_PATH,TASK_MASTERS}from"./chunk-ZST7XESB.js";import"./chunk-IF2K4PM5.js";import{UUID_RE,isSafePathSegment}from"./chunk-GMBJTG6A.js";import"./chunk-J7QYPKVK.js";import"./chunk-4VZKNEVN.js";import"./chunk-QQRJLH6B.js";import"./chunk-NHYMHCAT.js";import{PRIVATE_PROJECT_REF}from"./chunk-GY7KI5E5.js";import{LIST_FLAGS,LIST_PAGING_HELP,envelopePaging,nonEmpty,positiveInteger}from"./chunk-R53CMVWR.js";import"./chunk-II5RVJQN.js";
|
|
5
5
|
import{requireResolved,singleRef,withResolved}from"./chunk-ZN5EFDH7.js";import{acknowledgement,isRecord,pick}from"./chunk-ZWVYVS2A.js";import{ApiResponseError,UsageError}from"./chunk-7WSNIXTQ.js";import"./chunk-RZVI6PMW.js";import"./chunk-VSJBJXZO.js";var LIST_COLUMNS=["id","created_at","created_by_name","comment_type","content"];var QUESTION_COLUMN="question";var ANSWER_COLUMN="answer";function summarizeComments(items){const answersByQuestion=new Map;for(const row of items){const answer=isRecord(row)?row["answer_to"]:void 0;if(!isRecord(answer))continue;const target=answer["comment_id"];if(typeof target!=="string"||target==="")continue;answersByQuestion.set(target,selectedKeyText(answer["selected_key"]))}return items.map(row=>{const source=isRecord(
|
|
6
6
|
row)?row:{};const id=typeof source["id"]==="string"?source["id"]:"";const answer=isRecord(source["answer_to"])?selectedKeyText(source["answer_to"]["selected_key"]):answersByQuestion.get(id)??null;const base=pick(row,LIST_COLUMNS);return{id:base["id"],created_at:base["created_at"],created_by_name:base["created_by_name"],comment_type:base["comment_type"],[QUESTION_COLUMN]:questionText(source["question"]),[ANSWER_COLUMN]:answer,content:base["content"]}})}function questionText(question){if(!isRecord(
|
|
7
7
|
question))return null;const options=question["options"];if(!Array.isArray(options))return null;const parts=options.map(option=>{if(!isRecord(option))return null;const key=typeof option["key"]==="string"?option["key"]:null;if(key===null)return null;const label=typeof option["label"]==="string"?option["label"]:"";return label===""?key:`${key}=${label}`}).filter(part=>part!==null);return parts.length===0?null:parts.join(" / ")}function selectedKeyText(selected){if(typeof selected==="string"&&selected!==
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire as __twpCreateRequire } from 'node:module';
|
|
2
2
|
const require = __twpCreateRequire(import.meta.url);
|
|
3
|
-
import{USER_REF_FLAG,USER_REF_HELP,prepareUser,userPath}from"./chunk-2M2JQ23W.js";import{decodeCsvText,readCsvFileText}from"./chunk-I6DWJXPC.js";import{createFlags,fieldBody,hasAnyField,resolveRefFields,updateFlags}from"./chunk-
|
|
3
|
+
import{USER_REF_FLAG,USER_REF_HELP,prepareUser,userPath}from"./chunk-2M2JQ23W.js";import{decodeCsvText,readCsvFileText}from"./chunk-I6DWJXPC.js";import{createFlags,fieldBody,hasAnyField,resolveRefFields,updateFlags}from"./chunk-KA3EE4TJ.js";import{repeatedValues}from"./chunk-IOGVQVGD.js";import{booleanText,boundedText,isoDate,isoDateValue}from"./chunk-UDPJ2IGK.js";import{DEPARTMENTS_PATH,ORG_MASTER_LIMIT,POSITIONS_PATH}from"./chunk-ZST7XESB.js";import{ApiError}from"./chunk-IF2K4PM5.js";
|
|
4
4
|
import{ResolveError,isSafePathSegment}from"./chunk-GMBJTG6A.js";import"./chunk-J7QYPKVK.js";import"./chunk-4VZKNEVN.js";import"./chunk-QQRJLH6B.js";import"./chunk-NHYMHCAT.js";import{LIST_FLAGS,LIST_PAGING_HELP,envelopePaging,flagSegment,nonEmpty,positiveInteger,shellQuote}from"./chunk-R53CMVWR.js";import"./chunk-II5RVJQN.js";import{requireResolved,singleRef,withResolved}from"./chunk-ZN5EFDH7.js";import{isRecord,pick}from"./chunk-ZWVYVS2A.js";
|
|
5
5
|
import{ApiRejectedError,ApiResponseError,UsageError}from"./chunk-7WSNIXTQ.js";import"./chunk-RZVI6PMW.js";import"./chunk-VSJBJXZO.js";import fs2 from"fs";var ASSIGNMENT_COLUMNS=["id","department_name","position_name","start_date","end_date","is_primary","is_current","is_approval_route","effective_status"];function assignmentRows(body){const response=isRecord(body)&&"response"in body?body["response"]:body;const list=isRecord(response)?response["list"]:void 0;if(!Array.isArray(list)){throw new ApiResponseError("\u6240\u5C5E\u4E00\u89A7\u306E\u5FDC\u7B54\u306B list \u914D\u5217\u304C\u3042\u308A\u307E\u305B\u3093\u3002\u63A5\u7D9A\u5148\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002")}
|
|
6
6
|
return list}async function nameMap(ctx,path,label2){try{const body=await ctx.send({method:"GET",path,query:{limit:ORG_MASTER_LIMIT}});const list=isRecord(body)?body["list"]:void 0;if(!Array.isArray(list))throw new Error(`${label2}\u4E00\u89A7\u306E\u5FDC\u7B54\u306B list \u914D\u5217\u304C\u3042\u308A\u307E\u305B\u3093`);const count=isRecord(body)?body["count"]:void 0;if(typeof count==="number"&&count>list.length){ctx.warn(`${label2}\u4E00\u89A7\u304C ${count} \u4EF6\u4E2D ${list.length} \u4EF6\u3067\u5207\u308A\u8A70\u3081\u3089\
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { createRequire as __twpCreateRequire } from 'node:module';
|
|
2
|
+
const require = __twpCreateRequire(import.meta.url);
|
|
3
|
+
import{applyInstancePlan,createInstancePlan,formColumns,parseInstanceContent,workflowDomain,writtenInstance}from"./chunk-U6GEC6KI.js";import"./chunk-HGTG5XQ7.js";import"./chunk-ZST7XESB.js";import"./chunk-IF2K4PM5.js";import"./chunk-GMBJTG6A.js";import"./chunk-J7QYPKVK.js";import"./chunk-4VZKNEVN.js";import"./chunk-NHYMHCAT.js";import"./chunk-R53CMVWR.js";import"./chunk-II5RVJQN.js";import"./chunk-ZN5EFDH7.js";import"./chunk-ZWVYVS2A.js";
|
|
4
|
+
import"./chunk-7WSNIXTQ.js";import"./chunk-RZVI6PMW.js";import"./chunk-VSJBJXZO.js";export{applyInstancePlan,createInstancePlan,formColumns,parseInstanceContent,workflowDomain,writtenInstance};
|
package/package.json
CHANGED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { createRequire as __twpCreateRequire } from 'node:module';
|
|
2
|
-
const require = __twpCreateRequire(import.meta.url);
|
|
3
|
-
import{PUNCH_TYPES,assertCurrentMonthOpen,attendanceDomain,hoursMinutes}from"./chunk-BU3NOAYC.js";import"./chunk-ZN5EFDH7.js";import"./chunk-ZWVYVS2A.js";import"./chunk-7WSNIXTQ.js";import"./chunk-VSJBJXZO.js";export{PUNCH_TYPES,assertCurrentMonthOpen,attendanceDomain,hoursMinutes};
|
package/dist/chunk-XNW2UNWQ.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { createRequire as __twpCreateRequire } from 'node:module';
|
|
2
|
-
const require = __twpCreateRequire(import.meta.url);
|
|
3
|
-
var LOADERS={"agent-loop":async()=>(await import("./agent-loop-SP2UKXIG.js")).agentLoopDomain,attendance:async()=>(await import("./attendance-LM3Q4TAU.js")).attendanceDomain,backlog:async()=>(await import("./backlog-2VHFVU5C.js")).backlogDomain,company:async()=>(await import("./company-6HMFGVPJ.js")).companyDomain,customer:async()=>(await import("./company-6HMFGVPJ.js")).customerDomain,department:async()=>(await import("./department-DH5YABBF.js")).departmentDomain,estimate:async()=>(await import("./sales-OFEVE2PG.js")).
|
|
4
|
-
estimateDomain,inquiry:async()=>(await import("./inquiry-67OW3HBZ.js")).inquiryDomain,invoice:async()=>(await import("./sales-OFEVE2PG.js")).invoiceDomain,"job-title":async()=>(await import("./job-title-YEIANJNC.js")).jobTitleDomain,leave:async()=>(await import("./leave-XXDCHUGK.js")).leaveDomain,media:async()=>(await import("./media-NZD6J7KE.js")).mediaDomain,notification:async()=>(await import("./notification-BQ4ODX6U.js")).notificationDomain,position:async()=>(await import("./position-WR5YODDU.js")).
|
|
5
|
-
positionDomain,project:async()=>(await import("./project-ROLQ535L.js")).projectDomain,prospect:async()=>(await import("./prospect-YZUHE7PL.js")).prospectDomain,report:async()=>(await import("./report-SGAVGU4G.js")).reportDomain,shift:async()=>(await import("./attendance-lists-PR6NQDQB.js")).shiftDomain,storage:async()=>(await import("./storage-ANKKJJJO.js")).storageDomain,task:async()=>(await import("./task-IE7DNU34.js")).taskDomain,user:async()=>(await import("./user-UJIB3SCU.js")).
|
|
6
|
-
userDomain,workchange:async()=>(await import("./attendance-lists-PR6NQDQB.js")).workchangeDomain,workflow:async()=>(await import("./workflow-QWVZH4NG.js")).workflowDomain};async function loadDomain(name){return LOADERS[name]()}export{loadDomain};
|
package/dist/leave-XXDCHUGK.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { createRequire as __twpCreateRequire } from 'node:module';
|
|
2
|
-
const require = __twpCreateRequire(import.meta.url);
|
|
3
|
-
import{USER_REF_FLAG,USER_REF_HELP,userPath}from"./chunk-2M2JQ23W.js";import"./chunk-DBIDYOKW.js";import"./chunk-IF2K4PM5.js";import"./chunk-GMBJTG6A.js";import"./chunk-J7QYPKVK.js";import"./chunk-4VZKNEVN.js";import"./chunk-NHYMHCAT.js";import"./chunk-II5RVJQN.js";import{requireResolved,singleRef,withResolved}from"./chunk-ZN5EFDH7.js";import{isRecord,pick}from"./chunk-ZWVYVS2A.js";import{ApiResponseError,UsageError}from"./chunk-7WSNIXTQ.js";
|
|
4
|
-
import"./chunk-RZVI6PMW.js";import"./chunk-VSJBJXZO.js";var LIST_USAGE="twp leave list";var GRANTS_USAGE="twp leave grants [<\u30E6\u30FC\u30B6\u30FC> | --user <\u30E6\u30FC\u30B6\u30FC>]";var USAGE_COLUMNS=["used_date","type_label","days","hours","status_label","reason","is_post_application","id"];var GRANT_COLUMNS=["grant_date","type_label","days","remaining_days","remaining_hours","expiry_date","status_label","reason","id"];function noArgs(input,operation){if(input.args.length>0){throw new UsageError(`${operation} \u306F\u4F4D\u7F6E\u5F15\u6570\u3092\u53D7\u3051\u53D6\u308A\u307E\u305B\u3093: ${input.
|
|
5
|
-
args.join(" ")}`,`twp leave ${operation} help`)}}function summaryBody(body){if(!isRecord(body)||!isRecord(body["summary"])){throw new ApiResponseError("\u6709\u7D66\u30B5\u30DE\u30EA\u306E\u5FDC\u7B54\u306B summary \u304C\u3042\u308A\u307E\u305B\u3093\u3002\u63A5\u7D9A\u5148\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002")}return body}function usagesBody(body){if(!isRecord(body)||!Array.isArray(body["usages"])){throw new ApiResponseError("\u6709\u7D66\u306E\u53D6\u5F97\u5C65\u6B74\u306E\u5FDC\u7B54\u306B usages \u304C\u3042\u308A\u307E\u305B\u3093\u3002\u63A5\u7D9A\u5148\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002")}
|
|
6
|
-
return body}function grantsBody(body){if(!isRecord(body)||!Array.isArray(body["grants"])){throw new ApiResponseError("\u6709\u7D66\u306E\u4ED8\u4E0E\u5C65\u6B74\u306E\u5FDC\u7B54\u306B grants \u304C\u3042\u308A\u307E\u305B\u3093\u3002\u63A5\u7D9A\u5148\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002")}return body}function listBody(body){const combined=isRecord(body)?body:{};return{summary:summaryBody(combined["summary"]),usages:usagesBody(combined["usages"])}}async function list(input,ctx){
|
|
7
|
-
const summary=summaryBody(await ctx.send(listPlan(input)));const usages=await ctx.send({method:"GET",path:"/api/v1/paid-leave/me/usages"});return{summary,usages}}function listPlan(input){noArgs(input,"list");return{method:"GET",path:"/api/v1/paid-leave/me"}}function listNotes(body){const{summary:sheet}=listBody(body);const summary=sheet["summary"];const hours=typeof summary["total_remaining_hours"]==="number"&&summary["total_remaining_hours"]>0?` ${String(summary["total_remaining_hours"])} \u6642\u9593`:
|
|
8
|
-
"";const notes=[`\u6709\u7D66\u306E\u6B8B\u308A: ${String(summary["total_remaining"])} \u65E5${hours}\uFF08\u4ED8\u4E0E ${String(summary["total_granted"])} \u65E5 / \u53D6\u5F97 ${String(summary["total_used"])} \u65E5 / \u5931\u52B9 ${String(summary["total_expired"])} \u65E5\uFF09\u30FB\u53D6\u5F97\u7387 ${String(sheet["usage_rate"])}%\uFF08\u5168\u9805\u76EE\u306F --output json \u306E summary\uFF09`];if(sheet["meets_minimum_requirement"]===true){notes.push(`\u5E745\u65E5\u306E\u53D6\u5F97\u7FA9\u52D9: \u9054\u6210\u6E08\u307F\uFF08${String(
|
|
9
|
-
summary["period_start"])}\u301C${String(summary["period_end"])}\uFF09`)}else if(sheet["meets_minimum_requirement"]===false){notes.push(`\u5E745\u65E5\u306E\u53D6\u5F97\u7FA9\u52D9: \u672A\u9054\u30FB\u3042\u3068 ${String(sheet["days_until_minimum_requirement"])} \u65E5\uFF08${String(summary["period_start"])}\u301C${String(summary["period_end"])}\uFF09`)}return notes}function grantsRef(input){const ref=singleRef(input,{flag:"--user",label:"\u30E6\u30FC\u30B6\u30FC",usage:GRANTS_USAGE,required:false});
|
|
10
|
-
return ref===void 0||ref==="me"?void 0:ref}function grantsNotes(body){const sheet=grantsBody(body);const adjustments=Array.isArray(sheet["carry_adjustments"])?sheet["carry_adjustments"].length:0;const notes=[`\u4ED8\u4E0E: ${String(sheet["grants"].length)} \u4EF6`];if(adjustments>0)notes.push(`\u7E70\u8D8A\u306E\u8ABF\u6574\u304C ${String(adjustments)} \u4EF6\u3042\u308A\u307E\u3059\uFF08--output json \u306E carry_adjustments\uFF09`);return notes}var leaveDomain={name:"leave",summary:"\u6709\u7D66\u4F11\u6687\uFF08\u81EA\u5206\u306E\u6B8B\u65E5\
|
|
11
|
-
\u6570\u3068\u53D6\u5F97\u5C65\u6B74\u30FB\u4ED8\u4E0E\u5C65\u6B74\uFF09",operations:[{name:"list",summary:"\u81EA\u5206\u306E\u6709\u7D66\u306E\u53D6\u5F97\u5C65\u6B74\u3092\u4E00\u89A7\u3057\u3001\u6B8B\u65E5\u6570\u3092\u8868\u793A\u3059\u308B",usage:LIST_USAGE,description:"GET /api/v1/paid-leave/me\uFF08\u6B8B\u65E5\u6570\u306E\u30B5\u30DE\u30EA\uFF09\u3068 GET /api/v1/paid-leave/me/usages\uFF08\u53D6\u5F97\u5C65\u6B74\uFF09\u3092\u8868\u793A\u3057\u307E\u3059\uFF08\u30ED\u30B0\u30A4\u30F3\u3057\u3066\u3044\u308B\u672C\u4EBA\u306E\u5206\uFF09\u3002\n--output table / text / tsv \u306F\u53D6\u5F97\u5C65\u6B74\u306E\u8981\u7D04\u5217\u3067\u3001\u6B8B\u65E5\u6570\u30FB\u53D6\u5F97\u7387\u30FB\u5E745\u65E5\u306E\u53D6\u5F97\u7FA9\u52D9\u306F stderr \u306B\u51FA\u3057\u307E\u3059\u3002\n--output json \u306F {summary, usages} \u306B2\u3064\u306E API \u306E\u5FDC\u7B54\u3092\u305D\u306E\u307E\u307E\u5165\u308C\u3066\u51FA\
|
|
12
|
-
\u3057\u307E\u3059\u3002\n\u6709\u7D66\u306E\u7533\u8ACB\u306F\u3067\u304D\u307E\u305B\u3093\uFF08\u753B\u9762\u306E\u30EF\u30FC\u30AF\u30D5\u30ED\u30FC\u304B\u3089\u884C\u3063\u3066\u304F\u3060\u3055\u3044\uFF09\u3002",flags:[],plan:listPlan,plannedNotes:()=>["\u5B9F\u884C\u6642\u306F\u3001\u7D9A\u3051\u3066\u53D6\u5F97\u5C65\u6B74\uFF08GET /api/v1/paid-leave/me/usages\uFF09\u3082\u9001\u308A\u307E\u3059\u3002"],execute:list,summarize:body=>listBody(body).usages["usages"].map(row=>pick(row,USAGE_COLUMNS)),
|
|
13
|
-
raw:body=>listBody(body),notes:listNotes},{name:"grants",summary:"\u6709\u7D66\u306E\u4ED8\u4E0E\u5C65\u6B74\uFF08\u4ED8\u4E0E\u65E5\u30FB\u65E5\u6570\u30FB\u6B8B\u308A\u30FB\u6709\u52B9\u671F\u9650\uFF09\u3092\u8868\u793A\u3059\u308B",usage:GRANTS_USAGE,description:`<\u30E6\u30FC\u30B6\u30FC> \u3092\u7701\u7565\u3059\u308B\u304B me \u3092\u6307\u5B9A\u3059\u308B\u3068 GET /api/v1/paid-leave/me/grants\uFF08\u672C\u4EBA\u306E\u5206\uFF09\u3001
|
|
14
|
-
\u305D\u308C\u4EE5\u5916\u306F GET /api/v1/paid-leave/users/{userId}/grants \u3092\u8868\u793A\u3057\u307E\u3059\u3002
|
|
15
|
-
\u4ED6\u306E\u4EBA\u306E\u4ED8\u4E0E\u5C65\u6B74\u306F\u3001\u6709\u7D66\u7BA1\u7406\u306E\u6A29\u9650\u3092\u6301\u3064\u4EBA\u304B\u3001\u305D\u306E\u4EBA\u306E\u4E0A\u9577\u3060\u3051\u304C\u898B\u3089\u308C\u307E\u3059\uFF08\u7121\u3051\u308C\u3070\u7D42\u4E86\u30B3\u30FC\u30C9 3\uFF09\u3002
|
|
16
|
-
\u6A29\u9650\u306B\u3088\u3063\u3066\u306F\u7406\u7531\uFF08reason\uFF09\u304C\u4F0F\u305B\u3089\u308C\u307E\u3059\u3002
|
|
17
|
-
${USER_REF_HELP}
|
|
18
|
-
--output json \u306F API \u304C\u8FD4\u3059\u5168\u30D5\u30A3\u30FC\u30EB\u30C9\uFF08\u7E70\u8D8A\u306E\u8ABF\u6574 carry_adjustments \u3092\u542B\u3080\uFF09\u3092\u51FA\u3057\u307E\u3059\u3002`,flags:[USER_REF_FLAG],async prepare(input,ctx){const ref=grantsRef(input);if(ref===void 0)return input;const user=await ctx.resolver.user(ref);return withResolved(input,{userId:user.id})},plan(input){if(grantsRef(input)===void 0)return{method:"GET",path:"/api/v1/paid-leave/me/grants"};requireResolved(input,
|
|
19
|
-
"userId");return{method:"GET",path:`/api/v1/paid-leave/users/${userPath(input,"/grants")}`}},summarize:body=>grantsBody(body)["grants"].map(row=>pick(row,GRANT_COLUMNS)),raw:body=>grantsBody(body),notes:grantsNotes,forbidden:"\u6A29\u9650\u304C\u8DB3\u308A\u307E\u305B\u3093\u3002\u81EA\u5206\u306E\u4ED8\u4E0E\u5C65\u6B74\u306F\u52E4\u6020\u306E\u5229\u7528\u6A29\u9650\u3001\u4ED6\u306E\u4EBA\u306E\u4ED8\u4E0E\u5C65\u6B74\u306F\u6709\u7D66\u7BA1\u7406\u306E\u6A29\u9650\u304B\u3001\u305D\u306E\u4EBA\u306E\u4E0A\u9577\u3067\u3042\u308B\u3053\u3068\u304C\u8981\u308A\u307E\u3059\u3002\u30C6\u30CA\u30F3\u30C8\u306E\u7BA1\u7406\u8005\u306B\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044"}]};export{leaveDomain};
|