@newpeak/barista-cli 0.1.8 ā 0.1.10
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/README.md +10 -10
- package/dist/commands/liberica/index.d.ts.map +1 -1
- package/dist/commands/liberica/index.js +9 -0
- package/dist/commands/liberica/index.js.map +1 -1
- package/dist/commands/liberica/materials/create.d.ts.map +1 -1
- package/dist/commands/liberica/materials/create.js +13 -6
- package/dist/commands/liberica/materials/create.js.map +1 -1
- package/dist/commands/liberica/materials/update.js +1 -1
- package/dist/commands/liberica/materials/update.js.map +1 -1
- package/dist/commands/liberica/mould/get.d.ts +3 -0
- package/dist/commands/liberica/mould/get.d.ts.map +1 -0
- package/dist/commands/liberica/mould/get.js +90 -0
- package/dist/commands/liberica/mould/get.js.map +1 -0
- package/dist/commands/liberica/mould/index.d.ts +3 -0
- package/dist/commands/liberica/mould/index.d.ts.map +1 -0
- package/dist/commands/liberica/mould/index.js +15 -0
- package/dist/commands/liberica/mould/index.js.map +1 -0
- package/dist/commands/liberica/mould/list.d.ts +3 -0
- package/dist/commands/liberica/mould/list.d.ts.map +1 -0
- package/dist/commands/liberica/mould/list.js +114 -0
- package/dist/commands/liberica/mould/list.js.map +1 -0
- package/dist/commands/liberica/mould/set-status.d.ts +3 -0
- package/dist/commands/liberica/mould/set-status.d.ts.map +1 -0
- package/dist/commands/liberica/mould/set-status.js +84 -0
- package/dist/commands/liberica/mould/set-status.js.map +1 -0
- package/dist/commands/liberica/mould/stock-in.d.ts +3 -0
- package/dist/commands/liberica/mould/stock-in.d.ts.map +1 -0
- package/dist/commands/liberica/mould/stock-in.js +160 -0
- package/dist/commands/liberica/mould/stock-in.js.map +1 -0
- package/dist/commands/liberica/teams/index.d.ts +3 -0
- package/dist/commands/liberica/teams/index.d.ts.map +1 -0
- package/dist/commands/liberica/teams/index.js +15 -0
- package/dist/commands/liberica/teams/index.js.map +1 -0
- package/dist/commands/liberica/teams/issues/close.d.ts +3 -0
- package/dist/commands/liberica/teams/issues/close.d.ts.map +1 -0
- package/dist/commands/liberica/teams/issues/close.js +99 -0
- package/dist/commands/liberica/teams/issues/close.js.map +1 -0
- package/dist/commands/liberica/teams/issues/create.d.ts +3 -0
- package/dist/commands/liberica/teams/issues/create.d.ts.map +1 -0
- package/dist/commands/liberica/teams/issues/create.js +255 -0
- package/dist/commands/liberica/teams/issues/create.js.map +1 -0
- package/dist/commands/liberica/teams/issues/delete.d.ts +3 -0
- package/dist/commands/liberica/teams/issues/delete.d.ts.map +1 -0
- package/dist/commands/liberica/teams/issues/delete.js +55 -0
- package/dist/commands/liberica/teams/issues/delete.js.map +1 -0
- package/dist/commands/liberica/teams/issues/get.d.ts +3 -0
- package/dist/commands/liberica/teams/issues/get.d.ts.map +1 -0
- package/dist/commands/liberica/teams/issues/get.js +68 -0
- package/dist/commands/liberica/teams/issues/get.js.map +1 -0
- package/dist/commands/liberica/teams/issues/index.d.ts +3 -0
- package/dist/commands/liberica/teams/issues/index.d.ts.map +1 -0
- package/dist/commands/liberica/teams/issues/index.js +19 -0
- package/dist/commands/liberica/teams/issues/index.js.map +1 -0
- package/dist/commands/liberica/teams/issues/list.d.ts +3 -0
- package/dist/commands/liberica/teams/issues/list.d.ts.map +1 -0
- package/dist/commands/liberica/teams/issues/list.js +111 -0
- package/dist/commands/liberica/teams/issues/list.js.map +1 -0
- package/dist/commands/liberica/teams/issues/update.d.ts +3 -0
- package/dist/commands/liberica/teams/issues/update.d.ts.map +1 -0
- package/dist/commands/liberica/teams/issues/update.js +132 -0
- package/dist/commands/liberica/teams/issues/update.js.map +1 -0
- package/dist/commands/liberica/teams/projects/create.d.ts +3 -0
- package/dist/commands/liberica/teams/projects/create.d.ts.map +1 -0
- package/dist/commands/liberica/teams/projects/create.js +164 -0
- package/dist/commands/liberica/teams/projects/create.js.map +1 -0
- package/dist/commands/liberica/teams/projects/delete.d.ts +3 -0
- package/dist/commands/liberica/teams/projects/delete.d.ts.map +1 -0
- package/dist/commands/liberica/teams/projects/delete.js +55 -0
- package/dist/commands/liberica/teams/projects/delete.js.map +1 -0
- package/dist/commands/liberica/teams/projects/get.d.ts +3 -0
- package/dist/commands/liberica/teams/projects/get.d.ts.map +1 -0
- package/dist/commands/liberica/teams/projects/get.js +77 -0
- package/dist/commands/liberica/teams/projects/get.js.map +1 -0
- package/dist/commands/liberica/teams/projects/index.d.ts +3 -0
- package/dist/commands/liberica/teams/projects/index.d.ts.map +1 -0
- package/dist/commands/liberica/teams/projects/index.js +17 -0
- package/dist/commands/liberica/teams/projects/index.js.map +1 -0
- package/dist/commands/liberica/teams/projects/list.d.ts +3 -0
- package/dist/commands/liberica/teams/projects/list.d.ts.map +1 -0
- package/dist/commands/liberica/teams/projects/list.js +115 -0
- package/dist/commands/liberica/teams/projects/list.js.map +1 -0
- package/dist/commands/liberica/teams/projects/update.d.ts +3 -0
- package/dist/commands/liberica/teams/projects/update.d.ts.map +1 -0
- package/dist/commands/liberica/teams/projects/update.js +115 -0
- package/dist/commands/liberica/teams/projects/update.js.map +1 -0
- package/dist/commands/liberica/teams/tasks/create.d.ts +3 -0
- package/dist/commands/liberica/teams/tasks/create.d.ts.map +1 -0
- package/dist/commands/liberica/teams/tasks/create.js +88 -0
- package/dist/commands/liberica/teams/tasks/create.js.map +1 -0
- package/dist/commands/liberica/teams/tasks/delete.d.ts +3 -0
- package/dist/commands/liberica/teams/tasks/delete.d.ts.map +1 -0
- package/dist/commands/liberica/teams/tasks/delete.js +73 -0
- package/dist/commands/liberica/teams/tasks/delete.js.map +1 -0
- package/dist/commands/liberica/teams/tasks/get.d.ts +3 -0
- package/dist/commands/liberica/teams/tasks/get.d.ts.map +1 -0
- package/dist/commands/liberica/teams/tasks/get.js +51 -0
- package/dist/commands/liberica/teams/tasks/get.js.map +1 -0
- package/dist/commands/liberica/teams/tasks/index.d.ts +3 -0
- package/dist/commands/liberica/teams/tasks/index.d.ts.map +1 -0
- package/dist/commands/liberica/teams/tasks/index.js +17 -0
- package/dist/commands/liberica/teams/tasks/index.js.map +1 -0
- package/dist/commands/liberica/teams/tasks/list.d.ts +3 -0
- package/dist/commands/liberica/teams/tasks/list.d.ts.map +1 -0
- package/dist/commands/liberica/teams/tasks/list.js +82 -0
- package/dist/commands/liberica/teams/tasks/list.js.map +1 -0
- package/dist/commands/liberica/teams/tasks/update.d.ts +3 -0
- package/dist/commands/liberica/teams/tasks/update.d.ts.map +1 -0
- package/dist/commands/liberica/teams/tasks/update.js +114 -0
- package/dist/commands/liberica/teams/tasks/update.js.map +1 -0
- package/dist/commands/liberica/teams/work-logs/create.d.ts +3 -0
- package/dist/commands/liberica/teams/work-logs/create.d.ts.map +1 -0
- package/dist/commands/liberica/teams/work-logs/create.js +183 -0
- package/dist/commands/liberica/teams/work-logs/create.js.map +1 -0
- package/dist/commands/liberica/teams/work-logs/delete.d.ts +3 -0
- package/dist/commands/liberica/teams/work-logs/delete.d.ts.map +1 -0
- package/dist/commands/liberica/teams/work-logs/delete.js +55 -0
- package/dist/commands/liberica/teams/work-logs/delete.js.map +1 -0
- package/dist/commands/liberica/teams/work-logs/get.d.ts +3 -0
- package/dist/commands/liberica/teams/work-logs/get.d.ts.map +1 -0
- package/dist/commands/liberica/teams/work-logs/get.js +77 -0
- package/dist/commands/liberica/teams/work-logs/get.js.map +1 -0
- package/dist/commands/liberica/teams/work-logs/index.d.ts +3 -0
- package/dist/commands/liberica/teams/work-logs/index.d.ts.map +1 -0
- package/dist/commands/liberica/teams/work-logs/index.js +17 -0
- package/dist/commands/liberica/teams/work-logs/index.js.map +1 -0
- package/dist/commands/liberica/teams/work-logs/list.d.ts +3 -0
- package/dist/commands/liberica/teams/work-logs/list.d.ts.map +1 -0
- package/dist/commands/liberica/teams/work-logs/list.js +109 -0
- package/dist/commands/liberica/teams/work-logs/list.js.map +1 -0
- package/dist/commands/liberica/teams/work-logs/update.d.ts +3 -0
- package/dist/commands/liberica/teams/work-logs/update.d.ts.map +1 -0
- package/dist/commands/liberica/teams/work-logs/update.js +105 -0
- package/dist/commands/liberica/teams/work-logs/update.js.map +1 -0
- package/dist/commands/liberica/transfer-in-forms/batch-delete.d.ts +3 -0
- package/dist/commands/liberica/transfer-in-forms/batch-delete.d.ts.map +1 -0
- package/dist/commands/liberica/transfer-in-forms/batch-delete.js +147 -0
- package/dist/commands/liberica/transfer-in-forms/batch-delete.js.map +1 -0
- package/dist/commands/liberica/transfer-in-forms/batch-review.d.ts +3 -0
- package/dist/commands/liberica/transfer-in-forms/batch-review.d.ts.map +1 -0
- package/dist/commands/liberica/transfer-in-forms/batch-review.js +146 -0
- package/dist/commands/liberica/transfer-in-forms/batch-review.js.map +1 -0
- package/dist/commands/liberica/transfer-in-forms/batch-unreview.d.ts +3 -0
- package/dist/commands/liberica/transfer-in-forms/batch-unreview.d.ts.map +1 -0
- package/dist/commands/liberica/transfer-in-forms/batch-unreview.js +147 -0
- package/dist/commands/liberica/transfer-in-forms/batch-unreview.js.map +1 -0
- package/dist/commands/liberica/transfer-in-forms/create.d.ts +3 -0
- package/dist/commands/liberica/transfer-in-forms/create.d.ts.map +1 -0
- package/dist/commands/liberica/transfer-in-forms/create.js +168 -0
- package/dist/commands/liberica/transfer-in-forms/create.js.map +1 -0
- package/dist/commands/liberica/transfer-in-forms/get.d.ts +3 -0
- package/dist/commands/liberica/transfer-in-forms/get.d.ts.map +1 -0
- package/dist/commands/liberica/transfer-in-forms/get.js +94 -0
- package/dist/commands/liberica/transfer-in-forms/get.js.map +1 -0
- package/dist/commands/liberica/transfer-in-forms/index.d.ts +3 -0
- package/dist/commands/liberica/transfer-in-forms/index.d.ts.map +1 -0
- package/dist/commands/liberica/transfer-in-forms/index.js +21 -0
- package/dist/commands/liberica/transfer-in-forms/index.js.map +1 -0
- package/dist/commands/liberica/transfer-in-forms/list.d.ts +3 -0
- package/dist/commands/liberica/transfer-in-forms/list.d.ts.map +1 -0
- package/dist/commands/liberica/transfer-in-forms/list.js +94 -0
- package/dist/commands/liberica/transfer-in-forms/list.js.map +1 -0
- package/dist/commands/liberica/transfer-in-forms/update.d.ts +3 -0
- package/dist/commands/liberica/transfer-in-forms/update.d.ts.map +1 -0
- package/dist/commands/liberica/transfer-in-forms/update.js +206 -0
- package/dist/commands/liberica/transfer-in-forms/update.js.map +1 -0
- package/dist/commands/liberica/transfer-out-forms/batch-delete.d.ts +3 -0
- package/dist/commands/liberica/transfer-out-forms/batch-delete.d.ts.map +1 -0
- package/dist/commands/liberica/transfer-out-forms/batch-delete.js +80 -0
- package/dist/commands/liberica/transfer-out-forms/batch-delete.js.map +1 -0
- package/dist/commands/liberica/transfer-out-forms/batch-review.d.ts +3 -0
- package/dist/commands/liberica/transfer-out-forms/batch-review.d.ts.map +1 -0
- package/dist/commands/liberica/transfer-out-forms/batch-review.js +142 -0
- package/dist/commands/liberica/transfer-out-forms/batch-review.js.map +1 -0
- package/dist/commands/liberica/transfer-out-forms/batch-unreview.d.ts +3 -0
- package/dist/commands/liberica/transfer-out-forms/batch-unreview.d.ts.map +1 -0
- package/dist/commands/liberica/transfer-out-forms/batch-unreview.js +53 -0
- package/dist/commands/liberica/transfer-out-forms/batch-unreview.js.map +1 -0
- package/dist/commands/liberica/transfer-out-forms/create.d.ts +3 -0
- package/dist/commands/liberica/transfer-out-forms/create.d.ts.map +1 -0
- package/dist/commands/liberica/transfer-out-forms/create.js +191 -0
- package/dist/commands/liberica/transfer-out-forms/create.js.map +1 -0
- package/dist/commands/liberica/transfer-out-forms/get.d.ts +3 -0
- package/dist/commands/liberica/transfer-out-forms/get.d.ts.map +1 -0
- package/dist/commands/liberica/transfer-out-forms/get.js +87 -0
- package/dist/commands/liberica/transfer-out-forms/get.js.map +1 -0
- package/dist/commands/liberica/transfer-out-forms/index.d.ts +3 -0
- package/dist/commands/liberica/transfer-out-forms/index.d.ts.map +1 -0
- package/dist/commands/liberica/transfer-out-forms/index.js +21 -0
- package/dist/commands/liberica/transfer-out-forms/index.js.map +1 -0
- package/dist/commands/liberica/transfer-out-forms/list.d.ts +3 -0
- package/dist/commands/liberica/transfer-out-forms/list.d.ts.map +1 -0
- package/dist/commands/liberica/transfer-out-forms/list.js +118 -0
- package/dist/commands/liberica/transfer-out-forms/list.js.map +1 -0
- package/dist/commands/liberica/transfer-out-forms/update.d.ts +3 -0
- package/dist/commands/liberica/transfer-out-forms/update.d.ts.map +1 -0
- package/dist/commands/liberica/transfer-out-forms/update.js +197 -0
- package/dist/commands/liberica/transfer-out-forms/update.js.map +1 -0
- package/dist/core/api/client.d.ts +59 -0
- package/dist/core/api/client.d.ts.map +1 -1
- package/dist/core/api/client.js +1106 -136
- package/dist/core/api/client.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/types/index.d.ts +7 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +5 -0
- package/dist/types/index.js.map +1 -1
- package/dist/types/material.d.ts +1 -1
- package/dist/types/material.d.ts.map +1 -1
- package/dist/types/mould-stock-in.d.ts +70 -0
- package/dist/types/mould-stock-in.d.ts.map +1 -0
- package/dist/types/mould-stock-in.js +3 -0
- package/dist/types/mould-stock-in.js.map +1 -0
- package/dist/types/mould.d.ts +61 -0
- package/dist/types/mould.d.ts.map +1 -0
- package/dist/types/mould.js +2 -0
- package/dist/types/mould.js.map +1 -0
- package/dist/types/team-issue.d.ts +87 -0
- package/dist/types/team-issue.d.ts.map +1 -0
- package/dist/types/team-issue.js +2 -0
- package/dist/types/team-issue.js.map +1 -0
- package/dist/types/team-project.d.ts +68 -0
- package/dist/types/team-project.d.ts.map +1 -0
- package/dist/types/team-project.js +2 -0
- package/dist/types/team-project.js.map +1 -0
- package/dist/types/team-task.d.ts +91 -0
- package/dist/types/team-task.d.ts.map +1 -0
- package/dist/types/team-task.js +2 -0
- package/dist/types/team-task.js.map +1 -0
- package/dist/types/team-work-log.d.ts +81 -0
- package/dist/types/team-work-log.d.ts.map +1 -0
- package/dist/types/team-work-log.js +2 -0
- package/dist/types/team-work-log.js.map +1 -0
- package/dist/types/transfer-in-form.d.ts +242 -0
- package/dist/types/transfer-in-form.d.ts.map +1 -0
- package/dist/types/transfer-in-form.js +2 -0
- package/dist/types/transfer-in-form.js.map +1 -0
- package/dist/types/transfer-out-form.d.ts +252 -0
- package/dist/types/transfer-out-form.d.ts.map +1 -0
- package/dist/types/transfer-out-form.js +4 -0
- package/dist/types/transfer-out-form.js.map +1 -0
- package/docs/commands/liberica/teams/issues/close.md +161 -0
- package/docs/commands/liberica/teams/issues/create.md +212 -0
- package/docs/commands/liberica/teams/issues/delete.md +179 -0
- package/docs/commands/liberica/teams/issues/get.md +167 -0
- package/docs/commands/liberica/teams/issues/list.md +182 -0
- package/docs/commands/liberica/teams/issues/tests-design.md +341 -0
- package/docs/commands/liberica/teams/issues/update.md +202 -0
- package/docs/commands/liberica/teams/projects/create.md +174 -0
- package/docs/commands/liberica/teams/projects/delete.md +180 -0
- package/docs/commands/liberica/teams/projects/get.md +150 -0
- package/docs/commands/liberica/teams/projects/list.md +179 -0
- package/docs/commands/liberica/teams/projects/update.md +175 -0
- package/docs/commands/liberica/teams/tasks/create.md +163 -0
- package/docs/commands/liberica/teams/tasks/delete.md +109 -0
- package/docs/commands/liberica/teams/tasks/get.md +121 -0
- package/docs/commands/liberica/teams/tasks/list.md +148 -0
- package/docs/commands/liberica/teams/tasks/update.md +158 -0
- package/docs/commands/liberica/teams/work-logs/create.md +151 -0
- package/docs/commands/liberica/teams/work-logs/delete.md +130 -0
- package/docs/commands/liberica/teams/work-logs/get.md +131 -0
- package/docs/commands/liberica/teams/work-logs/list.md +153 -0
- package/docs/commands/liberica/teams/work-logs/update.md +150 -0
- package/docs/commands/liberica/transfer-in-forms/batch-delete.md +157 -0
- package/docs/commands/liberica/transfer-in-forms/batch-review.md +157 -0
- package/docs/commands/liberica/transfer-in-forms/batch-unreview.md +157 -0
- package/docs/commands/liberica/transfer-in-forms/create.md +220 -0
- package/docs/commands/liberica/transfer-in-forms/get.md +221 -0
- package/docs/commands/liberica/transfer-in-forms/list.md +242 -0
- package/docs/commands/liberica/transfer-in-forms/update.md +185 -0
- package/docs/commands/liberica/transfer-out-forms/batch-delete.md +187 -0
- package/docs/commands/liberica/transfer-out-forms/batch-review.md +157 -0
- package/docs/commands/liberica/transfer-out-forms/batch-unreview.md +157 -0
- package/docs/commands/liberica/transfer-out-forms/create.md +280 -0
- package/docs/commands/liberica/transfer-out-forms/get.md +211 -0
- package/docs/commands/liberica/transfer-out-forms/list.md +233 -0
- package/docs/commands/liberica/transfer-out-forms/update.md +286 -0
- package/package.json +1 -1
- package/src/commands/liberica/index.ts +10 -1
- package/src/commands/liberica/materials/create.ts +13 -5
- package/src/commands/liberica/materials/update.ts +1 -1
- package/src/commands/liberica/mould/get.ts +111 -0
- package/src/commands/liberica/mould/index.ts +17 -0
- package/src/commands/liberica/mould/list.ts +157 -0
- package/src/commands/liberica/mould/set-status.ts +99 -0
- package/src/commands/liberica/mould/stock-in.ts +165 -0
- package/src/commands/liberica/teams/index.ts +17 -0
- package/src/commands/liberica/teams/issues/close.ts +104 -0
- package/src/commands/liberica/teams/issues/create.ts +254 -0
- package/src/commands/liberica/teams/issues/delete.ts +58 -0
- package/src/commands/liberica/teams/issues/get.ts +78 -0
- package/src/commands/liberica/teams/issues/index.ts +21 -0
- package/src/commands/liberica/teams/issues/list.ts +144 -0
- package/src/commands/liberica/teams/issues/update.ts +141 -0
- package/src/commands/liberica/teams/projects/create.ts +159 -0
- package/src/commands/liberica/teams/projects/delete.ts +58 -0
- package/src/commands/liberica/teams/projects/get.ts +87 -0
- package/src/commands/liberica/teams/projects/index.ts +19 -0
- package/src/commands/liberica/teams/projects/list.ts +147 -0
- package/src/commands/liberica/teams/projects/update.ts +117 -0
- package/src/commands/liberica/teams/tasks/create.ts +102 -0
- package/src/commands/liberica/teams/tasks/delete.ts +92 -0
- package/src/commands/liberica/teams/tasks/get.ts +64 -0
- package/src/commands/liberica/teams/tasks/index.ts +19 -0
- package/src/commands/liberica/teams/tasks/list.ts +102 -0
- package/src/commands/liberica/teams/tasks/update.ts +122 -0
- package/src/commands/liberica/teams/work-logs/create.ts +204 -0
- package/src/commands/liberica/teams/work-logs/delete.ts +58 -0
- package/src/commands/liberica/teams/work-logs/get.ts +87 -0
- package/src/commands/liberica/teams/work-logs/index.ts +19 -0
- package/src/commands/liberica/teams/work-logs/list.ts +141 -0
- package/src/commands/liberica/teams/work-logs/update.ts +120 -0
- package/src/commands/liberica/transfer-in-forms/batch-delete.ts +152 -0
- package/src/commands/liberica/transfer-in-forms/batch-review.ts +151 -0
- package/src/commands/liberica/transfer-in-forms/batch-unreview.ts +152 -0
- package/src/commands/liberica/transfer-in-forms/create.ts +179 -0
- package/src/commands/liberica/transfer-in-forms/get.ts +107 -0
- package/src/commands/liberica/transfer-in-forms/index.ts +23 -0
- package/src/commands/liberica/transfer-in-forms/list.ts +97 -0
- package/src/commands/liberica/transfer-in-forms/update.ts +213 -0
- package/src/commands/liberica/transfer-out-forms/batch-delete.ts +83 -0
- package/src/commands/liberica/transfer-out-forms/batch-review.ts +148 -0
- package/src/commands/liberica/transfer-out-forms/batch-unreview.ts +56 -0
- package/src/commands/liberica/transfer-out-forms/create.ts +194 -0
- package/src/commands/liberica/transfer-out-forms/get.ts +114 -0
- package/src/commands/liberica/transfer-out-forms/index.ts +23 -0
- package/src/commands/liberica/transfer-out-forms/list.ts +125 -0
- package/src/commands/liberica/transfer-out-forms/update.ts +197 -0
- package/src/core/api/client.ts +1351 -121
- package/src/index.ts +1 -1
- package/src/types/index.ts +7 -0
- package/src/types/material.ts +1 -1
- package/src/types/mould-stock-in.ts +82 -0
- package/src/types/mould.ts +74 -0
- package/src/types/team-issue.ts +94 -0
- package/src/types/team-project.ts +74 -0
- package/src/types/team-task.ts +98 -0
- package/src/types/team-work-log.ts +87 -0
- package/src/types/transfer-in-form.ts +265 -0
- package/src/types/transfer-out-form.ts +290 -0
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { Command, Option } from 'commander';
|
|
2
|
+
import chalk from 'chalk';
|
|
3
|
+
import { configManager } from '../../../../core/config/manager.js';
|
|
4
|
+
import { apiClient } from '../../../../core/api/client.js';
|
|
5
|
+
import { Environment } from '../../../../types/index.js';
|
|
6
|
+
import {
|
|
7
|
+
UpdateTeamProjectRequest,
|
|
8
|
+
ProjectStatus,
|
|
9
|
+
ProjectPriority,
|
|
10
|
+
} from '../../../../types/team-project.js';
|
|
11
|
+
|
|
12
|
+
export function createTeamProjectUpdateCommand(): Command {
|
|
13
|
+
const updateCommand = new Command('update');
|
|
14
|
+
updateCommand
|
|
15
|
+
.description('Update team project information')
|
|
16
|
+
.argument('<project-id>', 'Project ID')
|
|
17
|
+
.option('--name <string>', 'Project name')
|
|
18
|
+
.option('--code <string>', 'Project code')
|
|
19
|
+
.option('--desc <string>', 'Project description')
|
|
20
|
+
.option('--status <string>', 'Project status: ACTIVE/INACTIVE/ARCHIVED')
|
|
21
|
+
.option('--priority <string>', 'Priority: LOW/MEDIUM/HIGH/URGENT')
|
|
22
|
+
.option('--start-date <string>', 'Start date (YYYY-MM-DD)')
|
|
23
|
+
.option('--end-date <string>', 'End date (YYYY-MM-DD)')
|
|
24
|
+
.option('--manager-id <string>', 'Manager user ID')
|
|
25
|
+
.option('--team-id <string>', 'Team ID')
|
|
26
|
+
.addOption(new Option('--env <string>').hideHelp())
|
|
27
|
+
.addOption(new Option('--tenant <string>').hideHelp())
|
|
28
|
+
.option('--dry-run', 'Preview without actual API call')
|
|
29
|
+
.option('--json', 'Output as JSON');
|
|
30
|
+
|
|
31
|
+
updateCommand.action(async (projectId: string, options: Record<string, unknown>) => {
|
|
32
|
+
const context = configManager.getCurrentContext();
|
|
33
|
+
const environment = context.environment as Environment;
|
|
34
|
+
const tenant = context.tenant;
|
|
35
|
+
|
|
36
|
+
const fields: Partial<UpdateTeamProjectRequest> = { teamProjectId: projectId };
|
|
37
|
+
if (options.name) fields.projectName = options.name as string;
|
|
38
|
+
if (options.code) fields.projectCode = options.code as string;
|
|
39
|
+
if (options.desc) fields.projectDesc = options.desc as string;
|
|
40
|
+
if (options.status) fields.projectStatus = options.status as ProjectStatus;
|
|
41
|
+
if (options.priority) fields.priority = options.priority as ProjectPriority;
|
|
42
|
+
if (options.startDate) fields.startDate = options.startDate as string;
|
|
43
|
+
if (options.endDate) fields.endDate = options.endDate as string;
|
|
44
|
+
if (options.managerId) fields.managerId = options.managerId as string;
|
|
45
|
+
if (options.teamId) fields.teamId = options.teamId as string;
|
|
46
|
+
|
|
47
|
+
const fieldsToUpdate = Object.keys(fields).filter((k) => k !== 'teamProjectId');
|
|
48
|
+
if (fieldsToUpdate.length === 0) {
|
|
49
|
+
console.error(
|
|
50
|
+
chalk.red(
|
|
51
|
+
'\nā No fields to update. Provide at least one option: --name, --code, --desc, --status, --priority, --start-date, --end-date, --manager-id, --team-id\n'
|
|
52
|
+
)
|
|
53
|
+
);
|
|
54
|
+
process.exit(1);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
if (options.dryRun) {
|
|
58
|
+
console.log(chalk.bold('\nš Dry-Run Mode: Preview update\n'));
|
|
59
|
+
console.log(chalk.gray(' Project ID: ') + chalk.white(projectId));
|
|
60
|
+
if (fields.projectName) console.log(chalk.gray(' Name: ') + chalk.white(fields.projectName));
|
|
61
|
+
if (fields.projectCode) console.log(chalk.gray(' Code: ') + chalk.white(fields.projectCode));
|
|
62
|
+
if (fields.projectDesc) console.log(chalk.gray(' Description: ') + chalk.white(fields.projectDesc));
|
|
63
|
+
if (fields.projectStatus) console.log(chalk.gray(' Status: ') + chalk.white(fields.projectStatus));
|
|
64
|
+
if (fields.priority) console.log(chalk.gray(' Priority: ') + chalk.white(fields.priority));
|
|
65
|
+
if (fields.startDate) console.log(chalk.gray(' Start Date: ') + chalk.white(fields.startDate));
|
|
66
|
+
if (fields.endDate) console.log(chalk.gray(' End Date: ') + chalk.white(fields.endDate));
|
|
67
|
+
if (fields.managerId) console.log(chalk.gray(' Manager ID: ') + chalk.white(fields.managerId));
|
|
68
|
+
if (fields.teamId) console.log(chalk.gray(' Team ID: ') + chalk.white(fields.teamId));
|
|
69
|
+
console.log();
|
|
70
|
+
console.log(chalk.yellow(' ā ļø This is a dry-run. No API call was made.\n'));
|
|
71
|
+
process.exit(0);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
try {
|
|
75
|
+
const response = await apiClient.updateTeamProject(
|
|
76
|
+
environment,
|
|
77
|
+
tenant,
|
|
78
|
+
fields as UpdateTeamProjectRequest
|
|
79
|
+
);
|
|
80
|
+
|
|
81
|
+
if (response.success) {
|
|
82
|
+
if (options.json) {
|
|
83
|
+
console.log(JSON.stringify({ success: true, data: response.data }, null, 2));
|
|
84
|
+
} else {
|
|
85
|
+
console.log(chalk.green('\nā Team project updated successfully\n'));
|
|
86
|
+
}
|
|
87
|
+
} else {
|
|
88
|
+
if (options.json) {
|
|
89
|
+
console.log(JSON.stringify({ success: false, error: response.error }, null, 2));
|
|
90
|
+
} else {
|
|
91
|
+
console.error(chalk.red(`\nā Update failed: ${response.error?.message || 'Unknown error'}`));
|
|
92
|
+
if (response.error?.code) {
|
|
93
|
+
console.error(chalk.gray(` Error code: ${response.error.code}`));
|
|
94
|
+
}
|
|
95
|
+
console.error();
|
|
96
|
+
}
|
|
97
|
+
process.exit(1);
|
|
98
|
+
}
|
|
99
|
+
} catch (error) {
|
|
100
|
+
if (options.json) {
|
|
101
|
+
console.log(
|
|
102
|
+
JSON.stringify({
|
|
103
|
+
success: false,
|
|
104
|
+
error: { message: error instanceof Error ? error.message : 'Unknown error' },
|
|
105
|
+
})
|
|
106
|
+
);
|
|
107
|
+
} else {
|
|
108
|
+
console.error(
|
|
109
|
+
chalk.red(`\nā Error: ${error instanceof Error ? error.message : 'Unknown error'}\n`)
|
|
110
|
+
);
|
|
111
|
+
}
|
|
112
|
+
process.exit(1);
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
return updateCommand;
|
|
117
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import chalk from 'chalk';
|
|
3
|
+
import Table from 'cli-table3';
|
|
4
|
+
import { configManager } from '../../../../core/config/manager.js';
|
|
5
|
+
import { apiClient } from '../../../../core/api/client.js';
|
|
6
|
+
import { CreateTeamTaskRequest, TeamTask } from '../../../../types/team-task.js';
|
|
7
|
+
import { Environment } from '../../../../types/index.js';
|
|
8
|
+
|
|
9
|
+
export function createTeamTaskCreateCommand(): Command {
|
|
10
|
+
const createCommand = new Command('create');
|
|
11
|
+
createCommand.description('Create a new team task');
|
|
12
|
+
|
|
13
|
+
createCommand
|
|
14
|
+
.option('-t, --title <string>', 'Task title (required)')
|
|
15
|
+
.option('-d, --desc <string>', 'Task description')
|
|
16
|
+
.option('-p, --priority <string>', 'Priority (LOW/MEDIUM/HIGH/URGENT)', 'MEDIUM')
|
|
17
|
+
.option('-s, --status <string>', 'Status (OPEN/IN_PROGRESS/RESOLVED/CLOSED)', 'OPEN')
|
|
18
|
+
.option('-a, --assign-to <string>', 'Assignee (required)')
|
|
19
|
+
.option('--tags <string>', 'Tags (comma-separated)')
|
|
20
|
+
.option('--task-code <string>', 'Task code')
|
|
21
|
+
.option('--start-time <string>', 'Start time (ISO-8601)')
|
|
22
|
+
.option('--end-time <string>', 'End time (ISO-8601)')
|
|
23
|
+
.option('--completion-rate <number>', 'Completion rate (0-100)')
|
|
24
|
+
.option('--ref-id <string>', 'Reference ID')
|
|
25
|
+
.option('--dry-run', 'Preview without executing')
|
|
26
|
+
.option('--json', 'Output as JSON')
|
|
27
|
+
.action(async (options) => {
|
|
28
|
+
const context = configManager.getCurrentContext();
|
|
29
|
+
const environment = (options.env as Environment) || context.environment;
|
|
30
|
+
const tenant = options.tenant || context.tenant;
|
|
31
|
+
|
|
32
|
+
const taskTitle = options.title;
|
|
33
|
+
const assignTo = options.assignTo;
|
|
34
|
+
|
|
35
|
+
if (!taskTitle) {
|
|
36
|
+
console.error(chalk.red('\nā Task title is required. Use --title <title>'));
|
|
37
|
+
process.exit(1);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
if (!assignTo) {
|
|
41
|
+
console.error(chalk.red('\nā Assignee is required. Use --assign-to <user>'));
|
|
42
|
+
process.exit(1);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const request: CreateTeamTaskRequest = {
|
|
46
|
+
taskTitle,
|
|
47
|
+
taskType: 'REQUIREMENT' as const,
|
|
48
|
+
taskDesc: options.desc,
|
|
49
|
+
projectId: '',
|
|
50
|
+
projectCode: '',
|
|
51
|
+
projectName: '',
|
|
52
|
+
assignTo: assignTo ? [assignTo] : undefined,
|
|
53
|
+
teamTaskStatus: options.status as any,
|
|
54
|
+
priority: options.priority as any,
|
|
55
|
+
tags: options.tags ? options.tags.split(',') : undefined,
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
if (options.dryRun) {
|
|
59
|
+
console.log(chalk.yellow('\nš Dry-Run Mode: The following team task will be created:\n'));
|
|
60
|
+
const previewTable = new Table({
|
|
61
|
+
head: ['Field', 'Value'],
|
|
62
|
+
colWidths: [20, 50],
|
|
63
|
+
});
|
|
64
|
+
previewTable.push(['Title', taskTitle]);
|
|
65
|
+
previewTable.push(['Description', options.desc || '-']);
|
|
66
|
+
previewTable.push(['Priority', options.priority]);
|
|
67
|
+
previewTable.push(['Status', options.status]);
|
|
68
|
+
previewTable.push(['Assignee', assignTo]);
|
|
69
|
+
previewTable.push(['Tags', options.tags || '-']);
|
|
70
|
+
previewTable.push(['Task Code', options.taskCode || '(auto-generated)']);
|
|
71
|
+
console.log(previewTable.toString());
|
|
72
|
+
console.log(chalk.yellow('\nā ļø Add --confirm to execute or remove --dry-run\n'));
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const response = await apiClient.createTeamTask(environment, tenant, request);
|
|
77
|
+
|
|
78
|
+
if (!response.success) {
|
|
79
|
+
console.error(chalk.red(`\nā Failed to create team task: ${response.error?.message || 'Unknown error'}`));
|
|
80
|
+
process.exit(1);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
const task = response.data as TeamTask;
|
|
84
|
+
|
|
85
|
+
if (options.json) {
|
|
86
|
+
console.log(JSON.stringify({ success: true, data: task }, null, 2));
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
console.log(chalk.green('\nā Team task created successfully\n'));
|
|
91
|
+
const table = new Table({
|
|
92
|
+
head: ['Field', 'Value'],
|
|
93
|
+
colWidths: [20, 50],
|
|
94
|
+
});
|
|
95
|
+
table.push(['Task ID', task.teamTaskId]);
|
|
96
|
+
table.push(['Task Code', task.teamTaskCode || '-']);
|
|
97
|
+
table.push(['Title', task.taskTitle]);
|
|
98
|
+
console.log(table.toString());
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
return createCommand;
|
|
102
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import chalk from 'chalk';
|
|
3
|
+
import Table from 'cli-table3';
|
|
4
|
+
import { configManager } from '../../../../core/config/manager.js';
|
|
5
|
+
import { apiClient } from '../../../../core/api/client.js';
|
|
6
|
+
import { Environment } from '../../../../types/index.js';
|
|
7
|
+
|
|
8
|
+
export function createTeamTaskDeleteCommand(): Command {
|
|
9
|
+
const deleteCommand = new Command('delete');
|
|
10
|
+
deleteCommand.description('Delete a team task');
|
|
11
|
+
|
|
12
|
+
deleteCommand
|
|
13
|
+
.option('-i, --task-id <string>', 'Task ID (required)')
|
|
14
|
+
.option('-f, --force', 'Skip confirmation')
|
|
15
|
+
.option('--dry-run', 'Preview without executing')
|
|
16
|
+
.option('--json', 'Output as JSON')
|
|
17
|
+
.action(async (options) => {
|
|
18
|
+
const context = configManager.getCurrentContext();
|
|
19
|
+
const environment = (options.env as Environment) || context.environment;
|
|
20
|
+
const tenant = options.tenant || context.tenant;
|
|
21
|
+
|
|
22
|
+
const taskId = options.taskId;
|
|
23
|
+
|
|
24
|
+
if (!taskId) {
|
|
25
|
+
console.error(chalk.red('\nā Task ID is required. Use --task-id <id>'));
|
|
26
|
+
process.exit(1);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
if (options.dryRun) {
|
|
30
|
+
console.log(chalk.yellow('\nš Dry-Run Mode: The following team task will be deleted:\n'));
|
|
31
|
+
const previewTable = new Table({
|
|
32
|
+
head: ['Field', 'Value'],
|
|
33
|
+
colWidths: [20, 50],
|
|
34
|
+
});
|
|
35
|
+
previewTable.push(['Task ID', taskId]);
|
|
36
|
+
console.log(previewTable.toString());
|
|
37
|
+
console.log(chalk.yellow('\nā ļø Add --confirm to execute or remove --dry-run\n'));
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
if (!options.force) {
|
|
42
|
+
const readline = require('readline').createInterface({
|
|
43
|
+
input: process.stdin,
|
|
44
|
+
output: process.stdout,
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
return new Promise<void>((resolve) => {
|
|
48
|
+
readline.question(
|
|
49
|
+
chalk.yellow(`\nā ļø Are you sure you want to delete team task ${taskId}? (y/N): `),
|
|
50
|
+
async (answer: string) => {
|
|
51
|
+
readline.close();
|
|
52
|
+
if (answer.toLowerCase() !== 'y') {
|
|
53
|
+
console.log(chalk.gray('\nOperation cancelled.'));
|
|
54
|
+
process.exit(0);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const response = await apiClient.deleteTeamTask(environment, tenant, taskId);
|
|
58
|
+
|
|
59
|
+
if (!response.success) {
|
|
60
|
+
console.error(chalk.red(`\nā Failed to delete team task: ${response.error?.message || 'Unknown error'}`));
|
|
61
|
+
process.exit(1);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
if (options.json) {
|
|
65
|
+
console.log(JSON.stringify({ success: true, message: 'Team task deleted successfully' }, null, 2));
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
console.log(chalk.green('\nā Team task deleted successfully\n'));
|
|
70
|
+
resolve();
|
|
71
|
+
}
|
|
72
|
+
);
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const response = await apiClient.deleteTeamTask(environment, tenant, taskId);
|
|
77
|
+
|
|
78
|
+
if (!response.success) {
|
|
79
|
+
console.error(chalk.red(`\nā Failed to delete team task: ${response.error?.message || 'Unknown error'}`));
|
|
80
|
+
process.exit(1);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
if (options.json) {
|
|
84
|
+
console.log(JSON.stringify({ success: true, message: 'Team task deleted successfully' }, null, 2));
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
console.log(chalk.green('\nā Team task deleted successfully\n'));
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
return deleteCommand;
|
|
92
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import chalk from 'chalk';
|
|
3
|
+
import Table from 'cli-table3';
|
|
4
|
+
import { configManager } from '../../../../core/config/manager.js';
|
|
5
|
+
import { apiClient } from '../../../../core/api/client.js';
|
|
6
|
+
import { TeamTask } from '../../../../types/team-task.js';
|
|
7
|
+
import { Environment } from '../../../../types/index.js';
|
|
8
|
+
|
|
9
|
+
export function createTeamTaskGetCommand(): Command {
|
|
10
|
+
const getCommand = new Command('get');
|
|
11
|
+
getCommand.description('Get team task details');
|
|
12
|
+
|
|
13
|
+
getCommand
|
|
14
|
+
.option('-i, --task-id <string>', 'Task ID')
|
|
15
|
+
.option('--json', 'Output as JSON')
|
|
16
|
+
.action(async (options) => {
|
|
17
|
+
const context = configManager.getCurrentContext();
|
|
18
|
+
const environment = (options.env as Environment) || context.environment;
|
|
19
|
+
const tenant = options.tenant || context.tenant;
|
|
20
|
+
|
|
21
|
+
const taskId = options.taskId;
|
|
22
|
+
|
|
23
|
+
if (!taskId) {
|
|
24
|
+
console.error(chalk.red('\nā Task ID is required. Use --task-id <id>'));
|
|
25
|
+
process.exit(1);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const response = await apiClient.getTeamTask(environment, tenant, taskId);
|
|
29
|
+
|
|
30
|
+
if (!response.success) {
|
|
31
|
+
console.error(chalk.red(`\nā Failed to get team task: ${response.error?.message || 'Unknown error'}`));
|
|
32
|
+
process.exit(1);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const task = response.data as TeamTask;
|
|
36
|
+
|
|
37
|
+
if (options.json) {
|
|
38
|
+
console.log(JSON.stringify({ success: true, data: task }, null, 2));
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const table = new Table({
|
|
43
|
+
head: ['Field', 'Value'],
|
|
44
|
+
colWidths: [20, 50],
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
table.push(['Task ID', task.teamTaskId]);
|
|
48
|
+
table.push(['Task Code', task.teamTaskCode || '-']);
|
|
49
|
+
table.push(['Title', task.taskTitle]);
|
|
50
|
+
table.push(['Description', task.taskDesc || '-']);
|
|
51
|
+
table.push(['Type', task.taskType]);
|
|
52
|
+
table.push(['Status', task.teamTaskStatus]);
|
|
53
|
+
table.push(['Priority', task.priority]);
|
|
54
|
+
table.push(['Reporter', task.reporterName || '-']);
|
|
55
|
+
table.push(['Assignee', task.assignTo || '-']);
|
|
56
|
+
table.push(['Tags', task.tags || '-']);
|
|
57
|
+
table.push(['Reference ID', task.refId || '-']);
|
|
58
|
+
|
|
59
|
+
console.log(chalk.bold('\nš Team Task Details'));
|
|
60
|
+
console.log(table.toString());
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
return getCommand;
|
|
64
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import { createTeamTaskListCommand } from './list.js';
|
|
3
|
+
import { createTeamTaskGetCommand } from './get.js';
|
|
4
|
+
import { createTeamTaskCreateCommand } from './create.js';
|
|
5
|
+
import { createTeamTaskUpdateCommand } from './update.js';
|
|
6
|
+
import { createTeamTaskDeleteCommand } from './delete.js';
|
|
7
|
+
|
|
8
|
+
export function createTeamTasksCommand(): Command {
|
|
9
|
+
const tasksCommand = new Command('tasks');
|
|
10
|
+
tasksCommand.description('Manage team tasks');
|
|
11
|
+
|
|
12
|
+
tasksCommand.addCommand(createTeamTaskListCommand());
|
|
13
|
+
tasksCommand.addCommand(createTeamTaskGetCommand());
|
|
14
|
+
tasksCommand.addCommand(createTeamTaskCreateCommand());
|
|
15
|
+
tasksCommand.addCommand(createTeamTaskUpdateCommand());
|
|
16
|
+
tasksCommand.addCommand(createTeamTaskDeleteCommand());
|
|
17
|
+
|
|
18
|
+
return tasksCommand;
|
|
19
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import chalk from 'chalk';
|
|
3
|
+
import Table from 'cli-table3';
|
|
4
|
+
import { configManager } from '../../../../core/config/manager.js';
|
|
5
|
+
import { apiClient } from '../../../../core/api/client.js';
|
|
6
|
+
import {
|
|
7
|
+
TeamTaskQueryParams,
|
|
8
|
+
TeamTaskListResponse,
|
|
9
|
+
TeamTaskStatus,
|
|
10
|
+
TeamTaskPriority,
|
|
11
|
+
} from '../../../../types/team-task.js';
|
|
12
|
+
import { Environment } from '../../../../types/index.js';
|
|
13
|
+
|
|
14
|
+
export function createTeamTaskListCommand(): Command {
|
|
15
|
+
const listCommand = new Command('list');
|
|
16
|
+
listCommand.description('List team tasks with pagination');
|
|
17
|
+
|
|
18
|
+
listCommand
|
|
19
|
+
.option('-p, --page <number>', 'Page number', '1')
|
|
20
|
+
.option('-s, --size <number>', 'Page size', '20')
|
|
21
|
+
.option('-t, --title <string>', 'Filter by task title')
|
|
22
|
+
.option('--status <string>', 'Filter by status (OPEN/IN_PROGRESS/RESOLVED/CLOSED)')
|
|
23
|
+
.option('--priority <string>', 'Filter by priority (LOW/MEDIUM/HIGH/URGENT)')
|
|
24
|
+
.option('-a, --assign-to <string>', 'Filter by assignee')
|
|
25
|
+
.option('-c, --creator-name <string>', 'Filter by creator name')
|
|
26
|
+
.option('--task-code <string>', 'Filter by task code')
|
|
27
|
+
.option('--json', 'Output as JSON')
|
|
28
|
+
.action(async (options) => {
|
|
29
|
+
const context = configManager.getCurrentContext();
|
|
30
|
+
const environment = (options.env as Environment) || context.environment;
|
|
31
|
+
const tenant = options.tenant || context.tenant;
|
|
32
|
+
|
|
33
|
+
const page = parseInt(options.page as string, 10) - 1;
|
|
34
|
+
const size = parseInt(options.size as string, 10);
|
|
35
|
+
|
|
36
|
+
const params: TeamTaskQueryParams = {
|
|
37
|
+
pageNo: page,
|
|
38
|
+
pageSize: size,
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
if (options.title) {
|
|
42
|
+
params.taskTitle = options.title;
|
|
43
|
+
}
|
|
44
|
+
if (options.status) {
|
|
45
|
+
params.teamTaskStatus = options.status as TeamTaskStatus;
|
|
46
|
+
}
|
|
47
|
+
if (options.priority) {
|
|
48
|
+
params.priority = options.priority as TeamTaskPriority;
|
|
49
|
+
}
|
|
50
|
+
if (options.assignTo) {
|
|
51
|
+
params.assignTo = options.assignTo;
|
|
52
|
+
}
|
|
53
|
+
if (options.creatorName) {
|
|
54
|
+
params.reporterName = options.creatorName;
|
|
55
|
+
}
|
|
56
|
+
if (options.taskCode) {
|
|
57
|
+
params.teamTaskCode = options.taskCode;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const response = await apiClient.listTeamTasks(environment, tenant, params);
|
|
61
|
+
|
|
62
|
+
if (!response.success) {
|
|
63
|
+
console.error(chalk.red(`\nā Failed to list team tasks: ${response.error?.message || 'Unknown error'}`));
|
|
64
|
+
process.exit(1);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
const data = response.data as TeamTaskListResponse;
|
|
68
|
+
|
|
69
|
+
if (options.json) {
|
|
70
|
+
console.log(JSON.stringify({ success: true, data }, null, 2));
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
if (!data.rows || data.rows.length === 0) {
|
|
75
|
+
console.log(chalk.yellow('\nNo team tasks found.'));
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
const table = new Table({
|
|
80
|
+
head: ['Task ID', 'Task Code', 'Title', 'Status', 'Priority', 'Assignee', 'Creator'],
|
|
81
|
+
colWidths: [12, 12, 30, 12, 10, 15, 15],
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
data.rows.forEach((task) => {
|
|
85
|
+
table.push([
|
|
86
|
+
task.teamTaskId,
|
|
87
|
+
task.teamTaskCode || '-',
|
|
88
|
+
task.taskTitle,
|
|
89
|
+
task.teamTaskStatus,
|
|
90
|
+
task.priority,
|
|
91
|
+
task.assignTo || '-',
|
|
92
|
+
task.reporterName || '-',
|
|
93
|
+
]);
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
console.log(chalk.bold('\nš Team Tasks List'));
|
|
97
|
+
console.log(table.toString());
|
|
98
|
+
console.log(chalk.gray(`\nTotal: ${data.totalRows} | Page: ${data.pageNo + 1}/${Math.ceil(data.totalRows / data.pageSize)}`));
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
return listCommand;
|
|
102
|
+
}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import chalk from 'chalk';
|
|
3
|
+
import Table from 'cli-table3';
|
|
4
|
+
import { configManager } from '../../../../core/config/manager.js';
|
|
5
|
+
import { apiClient } from '../../../../core/api/client.js';
|
|
6
|
+
import { UpdateTeamTaskRequest, TeamTask } from '../../../../types/team-task.js';
|
|
7
|
+
import { Environment } from '../../../../types/index.js';
|
|
8
|
+
|
|
9
|
+
export function createTeamTaskUpdateCommand(): Command {
|
|
10
|
+
const updateCommand = new Command('update');
|
|
11
|
+
updateCommand.description('Update a team task');
|
|
12
|
+
|
|
13
|
+
updateCommand
|
|
14
|
+
.option('-i, --task-id <string>', 'Task ID (required)')
|
|
15
|
+
.option('-t, --title <string>', 'Task title')
|
|
16
|
+
.option('-d, --desc <string>', 'Task description')
|
|
17
|
+
.option('-p, --priority <string>', 'Priority (LOW/MEDIUM/HIGH/URGENT)')
|
|
18
|
+
.option('-s, --status <string>', 'Status (OPEN/IN_PROGRESS/RESOLVED/CLOSED)')
|
|
19
|
+
.option('-a, --assign-to <string>', 'Assignee')
|
|
20
|
+
.option('--tags <string>', 'Tags (comma-separated)')
|
|
21
|
+
.option('--task-code <string>', 'Task code')
|
|
22
|
+
.option('--start-time <string>', 'Start time (ISO-8601)')
|
|
23
|
+
.option('--end-time <string>', 'End time (ISO-8601)')
|
|
24
|
+
.option('--completion-rate <number>', 'Completion rate (0-100)')
|
|
25
|
+
.option('--ref-id <string>', 'Reference ID')
|
|
26
|
+
.option('--dry-run', 'Preview without executing')
|
|
27
|
+
.option('--json', 'Output as JSON')
|
|
28
|
+
.action(async (options) => {
|
|
29
|
+
const context = configManager.getCurrentContext();
|
|
30
|
+
const environment = (options.env as Environment) || context.environment;
|
|
31
|
+
const tenant = options.tenant || context.tenant;
|
|
32
|
+
|
|
33
|
+
const taskId = options.taskId;
|
|
34
|
+
|
|
35
|
+
if (!taskId) {
|
|
36
|
+
console.error(chalk.red('\nā Task ID is required. Use --task-id <id>'));
|
|
37
|
+
process.exit(1);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const request: UpdateTeamTaskRequest = {
|
|
41
|
+
teamTaskId: taskId,
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
if (options.title) {
|
|
45
|
+
request.taskTitle = options.title;
|
|
46
|
+
}
|
|
47
|
+
if (options.desc) {
|
|
48
|
+
request.taskDesc = options.desc;
|
|
49
|
+
}
|
|
50
|
+
if (options.priority) {
|
|
51
|
+
request.priority = options.priority as any;
|
|
52
|
+
}
|
|
53
|
+
if (options.status) {
|
|
54
|
+
request.teamTaskStatus = options.status as any;
|
|
55
|
+
}
|
|
56
|
+
if (options.assignTo) {
|
|
57
|
+
request.assignTo = options.assignTo.split(',');
|
|
58
|
+
}
|
|
59
|
+
if (options.tags) {
|
|
60
|
+
request.tags = options.tags.split(',');
|
|
61
|
+
}
|
|
62
|
+
if (options.taskCode) {
|
|
63
|
+
request.taskCode = options.taskCode;
|
|
64
|
+
}
|
|
65
|
+
if (options.startTime) {
|
|
66
|
+
request.startTime = options.startTime;
|
|
67
|
+
}
|
|
68
|
+
if (options.endTime) {
|
|
69
|
+
request.endTime = options.endTime;
|
|
70
|
+
}
|
|
71
|
+
if (options.completionRate) {
|
|
72
|
+
request.completionRate = options.completionRate;
|
|
73
|
+
}
|
|
74
|
+
if (options.refId) {
|
|
75
|
+
request.refId = options.refId;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
if (options.dryRun) {
|
|
79
|
+
console.log(chalk.yellow('\nš Dry-Run Mode: The following team task will be updated:\n'));
|
|
80
|
+
const previewTable = new Table({
|
|
81
|
+
head: ['Field', 'Value'],
|
|
82
|
+
colWidths: [20, 50],
|
|
83
|
+
});
|
|
84
|
+
previewTable.push(['Task ID', taskId]);
|
|
85
|
+
if (options.title) previewTable.push(['Title', options.title]);
|
|
86
|
+
if (options.desc) previewTable.push(['Description', options.desc]);
|
|
87
|
+
if (options.priority) previewTable.push(['Priority', options.priority]);
|
|
88
|
+
if (options.status) previewTable.push(['Status', options.status]);
|
|
89
|
+
if (options.assignTo) previewTable.push(['Assignee', options.assignTo]);
|
|
90
|
+
if (options.tags) previewTable.push(['Tags', options.tags]);
|
|
91
|
+
console.log(previewTable.toString());
|
|
92
|
+
console.log(chalk.yellow('\nā ļø Add --confirm to execute or remove --dry-run\n'));
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
const response = await apiClient.updateTeamTask(environment, tenant, request);
|
|
97
|
+
|
|
98
|
+
if (!response.success) {
|
|
99
|
+
console.error(chalk.red(`\nā Failed to update team task: ${response.error?.message || 'Unknown error'}`));
|
|
100
|
+
process.exit(1);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
const task = response.data as TeamTask;
|
|
104
|
+
|
|
105
|
+
if (options.json) {
|
|
106
|
+
console.log(JSON.stringify({ success: true, data: task }, null, 2));
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
console.log(chalk.green('\nā Team task updated successfully\n'));
|
|
111
|
+
const table = new Table({
|
|
112
|
+
head: ['Field', 'Value'],
|
|
113
|
+
colWidths: [20, 50],
|
|
114
|
+
});
|
|
115
|
+
table.push(['Task ID', task.teamTaskId]);
|
|
116
|
+
table.push(['Task Code', task.teamTaskCode || '-']);
|
|
117
|
+
table.push(['Title', task.taskTitle]);
|
|
118
|
+
console.log(table.toString());
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
return updateCommand;
|
|
122
|
+
}
|