@ttctl/cli 0.0.0 → 0.1.0-rc.2
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 +44 -9
- package/dist/commands/applications/index.d.ts +21 -0
- package/dist/commands/applications/index.d.ts.map +1 -0
- package/dist/commands/applications/index.js +87 -0
- package/dist/commands/applications/index.js.map +1 -0
- package/dist/commands/applications/list.d.ts +55 -0
- package/dist/commands/applications/list.d.ts.map +1 -0
- package/dist/commands/applications/list.js +106 -0
- package/dist/commands/applications/list.js.map +1 -0
- package/dist/commands/applications/shared.d.ts +14 -0
- package/dist/commands/applications/shared.d.ts.map +1 -0
- package/dist/commands/applications/shared.js +19 -0
- package/dist/commands/applications/shared.js.map +1 -0
- package/dist/commands/applications/show.d.ts +51 -0
- package/dist/commands/applications/show.d.ts.map +1 -0
- package/dist/commands/applications/show.js +154 -0
- package/dist/commands/applications/show.js.map +1 -0
- package/dist/commands/applications/stats.d.ts +42 -0
- package/dist/commands/applications/stats.d.ts.map +1 -0
- package/dist/commands/applications/stats.js +69 -0
- package/dist/commands/applications/stats.js.map +1 -0
- package/dist/commands/auth/index.d.ts +17 -0
- package/dist/commands/auth/index.d.ts.map +1 -0
- package/dist/commands/auth/index.js +69 -0
- package/dist/commands/auth/index.js.map +1 -0
- package/dist/commands/auth/init.d.ts +98 -0
- package/dist/commands/auth/init.d.ts.map +1 -0
- package/dist/commands/auth/init.js +387 -0
- package/dist/commands/auth/init.js.map +1 -0
- package/dist/commands/auth/signin.d.ts +81 -0
- package/dist/commands/auth/signin.d.ts.map +1 -0
- package/dist/commands/auth/signin.js +145 -0
- package/dist/commands/auth/signin.js.map +1 -0
- package/dist/commands/auth/signout.d.ts +133 -0
- package/dist/commands/auth/signout.d.ts.map +1 -0
- package/dist/commands/auth/signout.js +172 -0
- package/dist/commands/auth/signout.js.map +1 -0
- package/dist/commands/auth/status.d.ts +62 -0
- package/dist/commands/auth/status.d.ts.map +1 -0
- package/dist/commands/auth/status.js +98 -0
- package/dist/commands/auth/status.js.map +1 -0
- package/dist/commands/availability/allocated-hours.d.ts +27 -0
- package/dist/commands/availability/allocated-hours.d.ts.map +1 -0
- package/dist/commands/availability/allocated-hours.js +61 -0
- package/dist/commands/availability/allocated-hours.js.map +1 -0
- package/dist/commands/availability/index.d.ts +30 -0
- package/dist/commands/availability/index.d.ts.map +1 -0
- package/dist/commands/availability/index.js +124 -0
- package/dist/commands/availability/index.js.map +1 -0
- package/dist/commands/availability/shared.d.ts +11 -0
- package/dist/commands/availability/shared.d.ts.map +1 -0
- package/dist/commands/availability/shared.js +30 -0
- package/dist/commands/availability/shared.js.map +1 -0
- package/dist/commands/availability/show.d.ts +32 -0
- package/dist/commands/availability/show.d.ts.map +1 -0
- package/dist/commands/availability/show.js +86 -0
- package/dist/commands/availability/show.js.map +1 -0
- package/dist/commands/availability/working-hours.d.ts +53 -0
- package/dist/commands/availability/working-hours.d.ts.map +1 -0
- package/dist/commands/availability/working-hours.js +151 -0
- package/dist/commands/availability/working-hours.js.map +1 -0
- package/dist/commands/contracts/index.d.ts +69 -0
- package/dist/commands/contracts/index.d.ts.map +1 -0
- package/dist/commands/contracts/index.js +198 -0
- package/dist/commands/contracts/index.js.map +1 -0
- package/dist/commands/engagements/breaks.d.ts +81 -0
- package/dist/commands/engagements/breaks.d.ts.map +1 -0
- package/dist/commands/engagements/breaks.js +229 -0
- package/dist/commands/engagements/breaks.js.map +1 -0
- package/dist/commands/engagements/index.d.ts +29 -0
- package/dist/commands/engagements/index.d.ts.map +1 -0
- package/dist/commands/engagements/index.js +172 -0
- package/dist/commands/engagements/index.js.map +1 -0
- package/dist/commands/engagements/list.d.ts +49 -0
- package/dist/commands/engagements/list.d.ts.map +1 -0
- package/dist/commands/engagements/list.js +95 -0
- package/dist/commands/engagements/list.js.map +1 -0
- package/dist/commands/engagements/shared.d.ts +10 -0
- package/dist/commands/engagements/shared.d.ts.map +1 -0
- package/dist/commands/engagements/shared.js +31 -0
- package/dist/commands/engagements/shared.js.map +1 -0
- package/dist/commands/engagements/show.d.ts +19 -0
- package/dist/commands/engagements/show.d.ts.map +1 -0
- package/dist/commands/engagements/show.js +150 -0
- package/dist/commands/engagements/show.js.map +1 -0
- package/dist/commands/engagements/stats.d.ts +24 -0
- package/dist/commands/engagements/stats.d.ts.map +1 -0
- package/dist/commands/engagements/stats.js +51 -0
- package/dist/commands/engagements/stats.js.map +1 -0
- package/dist/commands/jobs/index.d.ts +49 -0
- package/dist/commands/jobs/index.d.ts.map +1 -0
- package/dist/commands/jobs/index.js +304 -0
- package/dist/commands/jobs/index.js.map +1 -0
- package/dist/commands/jobs/interest.d.ts +65 -0
- package/dist/commands/jobs/interest.d.ts.map +1 -0
- package/dist/commands/jobs/interest.js +172 -0
- package/dist/commands/jobs/interest.js.map +1 -0
- package/dist/commands/jobs/list.d.ts +81 -0
- package/dist/commands/jobs/list.d.ts.map +1 -0
- package/dist/commands/jobs/list.js +157 -0
- package/dist/commands/jobs/list.js.map +1 -0
- package/dist/commands/jobs/search.d.ts +71 -0
- package/dist/commands/jobs/search.d.ts.map +1 -0
- package/dist/commands/jobs/search.js +163 -0
- package/dist/commands/jobs/search.js.map +1 -0
- package/dist/commands/jobs/shared.d.ts +79 -0
- package/dist/commands/jobs/shared.d.ts.map +1 -0
- package/dist/commands/jobs/shared.js +133 -0
- package/dist/commands/jobs/shared.js.map +1 -0
- package/dist/commands/jobs/show.d.ts +20 -0
- package/dist/commands/jobs/show.d.ts.map +1 -0
- package/dist/commands/jobs/show.js +135 -0
- package/dist/commands/jobs/show.js.map +1 -0
- package/dist/commands/payments/index.d.ts +34 -0
- package/dist/commands/payments/index.d.ts.map +1 -0
- package/dist/commands/payments/index.js +160 -0
- package/dist/commands/payments/index.js.map +1 -0
- package/dist/commands/payments/methods.d.ts +17 -0
- package/dist/commands/payments/methods.d.ts.map +1 -0
- package/dist/commands/payments/methods.js +79 -0
- package/dist/commands/payments/methods.js.map +1 -0
- package/dist/commands/payments/payouts.d.ts +44 -0
- package/dist/commands/payments/payouts.d.ts.map +1 -0
- package/dist/commands/payments/payouts.js +147 -0
- package/dist/commands/payments/payouts.js.map +1 -0
- package/dist/commands/payments/rate.d.ts +48 -0
- package/dist/commands/payments/rate.d.ts.map +1 -0
- package/dist/commands/payments/rate.js +229 -0
- package/dist/commands/payments/rate.js.map +1 -0
- package/dist/commands/payments/shared.d.ts +10 -0
- package/dist/commands/payments/shared.d.ts.map +1 -0
- package/dist/commands/payments/shared.js +27 -0
- package/dist/commands/payments/shared.js.map +1 -0
- package/dist/commands/profile/basic/index.d.ts +18 -0
- package/dist/commands/profile/basic/index.d.ts.map +1 -0
- package/dist/commands/profile/basic/index.js +79 -0
- package/dist/commands/profile/basic/index.js.map +1 -0
- package/dist/commands/profile/basic/photo-show.d.ts +28 -0
- package/dist/commands/profile/basic/photo-show.d.ts.map +1 -0
- package/dist/commands/profile/basic/photo-show.js +112 -0
- package/dist/commands/profile/basic/photo-show.js.map +1 -0
- package/dist/commands/profile/basic/photo-upload.d.ts +10 -0
- package/dist/commands/profile/basic/photo-upload.d.ts.map +1 -0
- package/dist/commands/profile/basic/photo-upload.js +61 -0
- package/dist/commands/profile/basic/photo-upload.js.map +1 -0
- package/dist/commands/profile/basic/set.d.ts +54 -0
- package/dist/commands/profile/basic/set.d.ts.map +1 -0
- package/dist/commands/profile/basic/set.js +174 -0
- package/dist/commands/profile/basic/set.js.map +1 -0
- package/dist/commands/profile/basic/show.d.ts +95 -0
- package/dist/commands/profile/basic/show.d.ts.map +1 -0
- package/dist/commands/profile/basic/show.js +310 -0
- package/dist/commands/profile/basic/show.js.map +1 -0
- package/dist/commands/profile/certifications/index.d.ts +40 -0
- package/dist/commands/profile/certifications/index.d.ts.map +1 -0
- package/dist/commands/profile/certifications/index.js +350 -0
- package/dist/commands/profile/certifications/index.js.map +1 -0
- package/dist/commands/profile/education/index.d.ts +37 -0
- package/dist/commands/profile/education/index.d.ts.map +1 -0
- package/dist/commands/profile/education/index.js +331 -0
- package/dist/commands/profile/education/index.js.map +1 -0
- package/dist/commands/profile/employment/index.d.ts +49 -0
- package/dist/commands/profile/employment/index.d.ts.map +1 -0
- package/dist/commands/profile/employment/index.js +425 -0
- package/dist/commands/profile/employment/index.js.map +1 -0
- package/dist/commands/profile/external/_shared.d.ts +35 -0
- package/dist/commands/profile/external/_shared.d.ts.map +1 -0
- package/dist/commands/profile/external/_shared.js +59 -0
- package/dist/commands/profile/external/_shared.js.map +1 -0
- package/dist/commands/profile/external/advanced-wizard-show.d.ts +15 -0
- package/dist/commands/profile/external/advanced-wizard-show.d.ts.map +1 -0
- package/dist/commands/profile/external/advanced-wizard-show.js +82 -0
- package/dist/commands/profile/external/advanced-wizard-show.js.map +1 -0
- package/dist/commands/profile/external/custom-requirements-set.d.ts +32 -0
- package/dist/commands/profile/external/custom-requirements-set.d.ts.map +1 -0
- package/dist/commands/profile/external/custom-requirements-set.js +116 -0
- package/dist/commands/profile/external/custom-requirements-set.js.map +1 -0
- package/dist/commands/profile/external/custom-requirements-show.d.ts +16 -0
- package/dist/commands/profile/external/custom-requirements-show.d.ts.map +1 -0
- package/dist/commands/profile/external/custom-requirements-show.js +84 -0
- package/dist/commands/profile/external/custom-requirements-show.js.map +1 -0
- package/dist/commands/profile/external/index.d.ts +21 -0
- package/dist/commands/profile/external/index.d.ts.map +1 -0
- package/dist/commands/profile/external/index.js +113 -0
- package/dist/commands/profile/external/index.js.map +1 -0
- package/dist/commands/profile/external/readiness.d.ts +15 -0
- package/dist/commands/profile/external/readiness.d.ts.map +1 -0
- package/dist/commands/profile/external/readiness.js +104 -0
- package/dist/commands/profile/external/readiness.js.map +1 -0
- package/dist/commands/profile/external/recommendations.d.ts +17 -0
- package/dist/commands/profile/external/recommendations.d.ts.map +1 -0
- package/dist/commands/profile/external/recommendations.js +97 -0
- package/dist/commands/profile/external/recommendations.js.map +1 -0
- package/dist/commands/profile/external/show.d.ts +22 -0
- package/dist/commands/profile/external/show.d.ts.map +1 -0
- package/dist/commands/profile/external/show.js +83 -0
- package/dist/commands/profile/external/show.js.map +1 -0
- package/dist/commands/profile/external/update.d.ts +37 -0
- package/dist/commands/profile/external/update.d.ts.map +1 -0
- package/dist/commands/profile/external/update.js +125 -0
- package/dist/commands/profile/external/update.js.map +1 -0
- package/dist/commands/profile/index.d.ts +16 -0
- package/dist/commands/profile/index.d.ts.map +1 -0
- package/dist/commands/profile/index.js +81 -0
- package/dist/commands/profile/index.js.map +1 -0
- package/dist/commands/profile/industries/index.d.ts +43 -0
- package/dist/commands/profile/industries/index.d.ts.map +1 -0
- package/dist/commands/profile/industries/index.js +258 -0
- package/dist/commands/profile/industries/index.js.map +1 -0
- package/dist/commands/profile/portfolio/add.d.ts +43 -0
- package/dist/commands/profile/portfolio/add.d.ts.map +1 -0
- package/dist/commands/profile/portfolio/add.js +181 -0
- package/dist/commands/profile/portfolio/add.js.map +1 -0
- package/dist/commands/profile/portfolio/highlight.d.ts +11 -0
- package/dist/commands/profile/portfolio/highlight.d.ts.map +1 -0
- package/dist/commands/profile/portfolio/highlight.js +31 -0
- package/dist/commands/profile/portfolio/highlight.js.map +1 -0
- package/dist/commands/profile/portfolio/index.d.ts +16 -0
- package/dist/commands/profile/portfolio/index.d.ts.map +1 -0
- package/dist/commands/profile/portfolio/index.js +121 -0
- package/dist/commands/profile/portfolio/index.js.map +1 -0
- package/dist/commands/profile/portfolio/list.d.ts +83 -0
- package/dist/commands/profile/portfolio/list.d.ts.map +1 -0
- package/dist/commands/profile/portfolio/list.js +189 -0
- package/dist/commands/profile/portfolio/list.js.map +1 -0
- package/dist/commands/profile/portfolio/remove.d.ts +9 -0
- package/dist/commands/profile/portfolio/remove.d.ts.map +1 -0
- package/dist/commands/profile/portfolio/remove.js +24 -0
- package/dist/commands/profile/portfolio/remove.js.map +1 -0
- package/dist/commands/profile/portfolio/reorder.d.ts +17 -0
- package/dist/commands/profile/portfolio/reorder.d.ts.map +1 -0
- package/dist/commands/profile/portfolio/reorder.js +135 -0
- package/dist/commands/profile/portfolio/reorder.js.map +1 -0
- package/dist/commands/profile/portfolio/shared.d.ts +8 -0
- package/dist/commands/profile/portfolio/shared.d.ts.map +1 -0
- package/dist/commands/profile/portfolio/shared.js +10 -0
- package/dist/commands/profile/portfolio/shared.js.map +1 -0
- package/dist/commands/profile/portfolio/update.d.ts +18 -0
- package/dist/commands/profile/portfolio/update.d.ts.map +1 -0
- package/dist/commands/profile/portfolio/update.js +77 -0
- package/dist/commands/profile/portfolio/update.js.map +1 -0
- package/dist/commands/profile/portfolio/upload.d.ts +8 -0
- package/dist/commands/profile/portfolio/upload.d.ts.map +1 -0
- package/dist/commands/profile/portfolio/upload.js +131 -0
- package/dist/commands/profile/portfolio/upload.js.map +1 -0
- package/dist/commands/profile/resume/cancel-upload.d.ts +9 -0
- package/dist/commands/profile/resume/cancel-upload.d.ts.map +1 -0
- package/dist/commands/profile/resume/cancel-upload.js +30 -0
- package/dist/commands/profile/resume/cancel-upload.js.map +1 -0
- package/dist/commands/profile/resume/index.d.ts +15 -0
- package/dist/commands/profile/resume/index.d.ts.map +1 -0
- package/dist/commands/profile/resume/index.js +42 -0
- package/dist/commands/profile/resume/index.js.map +1 -0
- package/dist/commands/profile/resume/upload.d.ts +16 -0
- package/dist/commands/profile/resume/upload.d.ts.map +1 -0
- package/dist/commands/profile/resume/upload.js +65 -0
- package/dist/commands/profile/resume/upload.js.map +1 -0
- package/dist/commands/profile/reviews/_shared.d.ts +9 -0
- package/dist/commands/profile/reviews/_shared.d.ts.map +1 -0
- package/dist/commands/profile/reviews/_shared.js +15 -0
- package/dist/commands/profile/reviews/_shared.js.map +1 -0
- package/dist/commands/profile/reviews/approve-item.d.ts +30 -0
- package/dist/commands/profile/reviews/approve-item.d.ts.map +1 -0
- package/dist/commands/profile/reviews/approve-item.js +82 -0
- package/dist/commands/profile/reviews/approve-item.js.map +1 -0
- package/dist/commands/profile/reviews/approve-section.d.ts +15 -0
- package/dist/commands/profile/reviews/approve-section.d.ts.map +1 -0
- package/dist/commands/profile/reviews/approve-section.js +67 -0
- package/dist/commands/profile/reviews/approve-section.js.map +1 -0
- package/dist/commands/profile/reviews/index.d.ts +19 -0
- package/dist/commands/profile/reviews/index.d.ts.map +1 -0
- package/dist/commands/profile/reviews/index.js +71 -0
- package/dist/commands/profile/reviews/index.js.map +1 -0
- package/dist/commands/profile/reviews/list.d.ts +17 -0
- package/dist/commands/profile/reviews/list.d.ts.map +1 -0
- package/dist/commands/profile/reviews/list.js +96 -0
- package/dist/commands/profile/reviews/list.js.map +1 -0
- package/dist/commands/profile/reviews/submit-for-review.d.ts +16 -0
- package/dist/commands/profile/reviews/submit-for-review.d.ts.map +1 -0
- package/dist/commands/profile/reviews/submit-for-review.js +65 -0
- package/dist/commands/profile/reviews/submit-for-review.js.map +1 -0
- package/dist/commands/profile/shared.d.ts +46 -0
- package/dist/commands/profile/shared.d.ts.map +1 -0
- package/dist/commands/profile/shared.js +111 -0
- package/dist/commands/profile/shared.js.map +1 -0
- package/dist/commands/profile/skills/index.d.ts +29 -0
- package/dist/commands/profile/skills/index.d.ts.map +1 -0
- package/dist/commands/profile/skills/index.js +475 -0
- package/dist/commands/profile/skills/index.js.map +1 -0
- package/dist/commands/profile/visas/add.d.ts +19 -0
- package/dist/commands/profile/visas/add.d.ts.map +1 -0
- package/dist/commands/profile/visas/add.js +37 -0
- package/dist/commands/profile/visas/add.js.map +1 -0
- package/dist/commands/profile/visas/index.d.ts +13 -0
- package/dist/commands/profile/visas/index.d.ts.map +1 -0
- package/dist/commands/profile/visas/index.js +69 -0
- package/dist/commands/profile/visas/index.js.map +1 -0
- package/dist/commands/profile/visas/list.d.ts +40 -0
- package/dist/commands/profile/visas/list.d.ts.map +1 -0
- package/dist/commands/profile/visas/list.js +115 -0
- package/dist/commands/profile/visas/list.js.map +1 -0
- package/dist/commands/profile/visas/remove.d.ts +8 -0
- package/dist/commands/profile/visas/remove.d.ts.map +1 -0
- package/dist/commands/profile/visas/remove.js +23 -0
- package/dist/commands/profile/visas/remove.js.map +1 -0
- package/dist/commands/profile/visas/shared.d.ts +11 -0
- package/dist/commands/profile/visas/shared.d.ts.map +1 -0
- package/dist/commands/profile/visas/shared.js +16 -0
- package/dist/commands/profile/visas/shared.js.map +1 -0
- package/dist/commands/profile/visas/update.d.ts +13 -0
- package/dist/commands/profile/visas/update.d.ts.map +1 -0
- package/dist/commands/profile/visas/update.js +44 -0
- package/dist/commands/profile/visas/update.js.map +1 -0
- package/dist/commands/timesheet/index.d.ts +24 -0
- package/dist/commands/timesheet/index.d.ts.map +1 -0
- package/dist/commands/timesheet/index.js +98 -0
- package/dist/commands/timesheet/index.js.map +1 -0
- package/dist/commands/timesheet/list.d.ts +40 -0
- package/dist/commands/timesheet/list.d.ts.map +1 -0
- package/dist/commands/timesheet/list.js +79 -0
- package/dist/commands/timesheet/list.js.map +1 -0
- package/dist/commands/timesheet/shared.d.ts +10 -0
- package/dist/commands/timesheet/shared.d.ts.map +1 -0
- package/dist/commands/timesheet/shared.js +35 -0
- package/dist/commands/timesheet/shared.js.map +1 -0
- package/dist/commands/timesheet/show.d.ts +19 -0
- package/dist/commands/timesheet/show.d.ts.map +1 -0
- package/dist/commands/timesheet/show.js +109 -0
- package/dist/commands/timesheet/show.js.map +1 -0
- package/dist/commands/timesheet/submit.d.ts +50 -0
- package/dist/commands/timesheet/submit.d.ts.map +1 -0
- package/dist/commands/timesheet/submit.js +151 -0
- package/dist/commands/timesheet/submit.js.map +1 -0
- package/dist/crash-handlers.d.ts +67 -0
- package/dist/crash-handlers.d.ts.map +1 -0
- package/dist/crash-handlers.js +78 -0
- package/dist/crash-handlers.js.map +1 -0
- package/dist/errors.d.ts +45 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +57 -0
- package/dist/errors.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +15 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/config-context.d.ts +41 -0
- package/dist/lib/config-context.d.ts.map +1 -0
- package/dist/lib/config-context.js +74 -0
- package/dist/lib/config-context.js.map +1 -0
- package/dist/lib/dry-run.d.ts +70 -0
- package/dist/lib/dry-run.d.ts.map +1 -0
- package/dist/lib/dry-run.js +114 -0
- package/dist/lib/dry-run.js.map +1 -0
- package/dist/lib/empty-state-cta.d.ts +63 -0
- package/dist/lib/empty-state-cta.d.ts.map +1 -0
- package/dist/lib/empty-state-cta.js +88 -0
- package/dist/lib/empty-state-cta.js.map +1 -0
- package/dist/lib/envelopes.d.ts +540 -0
- package/dist/lib/envelopes.d.ts.map +1 -0
- package/dist/lib/envelopes.js +598 -0
- package/dist/lib/envelopes.js.map +1 -0
- package/dist/lib/error-routing.d.ts +49 -0
- package/dist/lib/error-routing.d.ts.map +1 -0
- package/dist/lib/error-routing.js +72 -0
- package/dist/lib/error-routing.js.map +1 -0
- package/dist/lib/format-helpers.d.ts +65 -0
- package/dist/lib/format-helpers.d.ts.map +1 -0
- package/dist/lib/format-helpers.js +79 -0
- package/dist/lib/format-helpers.js.map +1 -0
- package/dist/lib/format-overrides.d.ts +81 -0
- package/dist/lib/format-overrides.d.ts.map +1 -0
- package/dist/lib/format-overrides.js +55 -0
- package/dist/lib/format-overrides.js.map +1 -0
- package/dist/lib/freetext.d.ts +83 -0
- package/dist/lib/freetext.d.ts.map +1 -0
- package/dist/lib/freetext.js +182 -0
- package/dist/lib/freetext.js.map +1 -0
- package/dist/lib/kill-switch-hook.d.ts +49 -0
- package/dist/lib/kill-switch-hook.d.ts.map +1 -0
- package/dist/lib/kill-switch-hook.js +34 -0
- package/dist/lib/kill-switch-hook.js.map +1 -0
- package/dist/lib/output.d.ts +173 -0
- package/dist/lib/output.d.ts.map +1 -0
- package/dist/lib/output.js +177 -0
- package/dist/lib/output.js.map +1 -0
- package/dist/lib/pagination.d.ts +49 -0
- package/dist/lib/pagination.d.ts.map +1 -0
- package/dist/lib/pagination.js +36 -0
- package/dist/lib/pagination.js.map +1 -0
- package/dist/program.d.ts +80 -0
- package/dist/program.d.ts.map +1 -0
- package/dist/program.js +273 -0
- package/dist/program.js.map +1 -0
- package/package.json +35 -13
- package/index.js +0 -7
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { profile } from "@ttctl/core";
|
|
2
|
+
import { emitAddSuccess, emitRemoveSuccess, emitUpdateSuccess, wrapListEnvelope } from "../../../lib/envelopes.js";
|
|
3
|
+
import type { OutputFormat } from "../../../lib/output.js";
|
|
4
|
+
/**
|
|
5
|
+
* Action handler for `ttctl profile visas list`. Reads the user's
|
|
6
|
+
* travel-visa records and emits via the cross-CLI output helper from #71,
|
|
7
|
+
* wrapped in the `{items, pageInfo?}` list envelope (#128) for json/yaml.
|
|
8
|
+
*/
|
|
9
|
+
export declare function runProfileVisasList(format: OutputFormat): Promise<void>;
|
|
10
|
+
/** Format the visas list as a human-readable summary. */
|
|
11
|
+
export declare function formatVisasText(visas: profile.visas.TravelVisa[]): string;
|
|
12
|
+
/** Format the visas list as a `cli-table3`-rendered table. */
|
|
13
|
+
export declare function formatVisasTable(visas: profile.visas.TravelVisa[], terminalWidth?: number): string;
|
|
14
|
+
/**
|
|
15
|
+
* Emit the post-mutation visa list, wrapped in the v0.4 envelope ABI
|
|
16
|
+
* (#128). The visas core API returns the FULL post-mutation list rather
|
|
17
|
+
* than the single mutated entity, so the envelope's `created` /
|
|
18
|
+
* `updated` field carries the list (`TravelVisa[]`) rather than a
|
|
19
|
+
* single `TravelVisa`. The pretty rendering keeps the existing
|
|
20
|
+
* "success header + table" UX so users continue to see the post-state
|
|
21
|
+
* at a glance.
|
|
22
|
+
*
|
|
23
|
+
* `verb` selects which envelope shape to emit:
|
|
24
|
+
*
|
|
25
|
+
* - `add` → `emitAddSuccess` with `created: TravelVisa[]`
|
|
26
|
+
* - `update` → `emitUpdateSuccess` with `updated: TravelVisa[]`
|
|
27
|
+
* - `remove` → `emitRemoveSuccess` with `removed: {id}` (the removed
|
|
28
|
+
* id is supplied by the caller; the post-state list is passed
|
|
29
|
+
* through `notice` for human pretty rendering, NOT for json/yaml —
|
|
30
|
+
* `removed` is a strict `{id}` shape per the AC)
|
|
31
|
+
*
|
|
32
|
+
* `id` is required for the `remove` verb; for `add`/`update` it may be
|
|
33
|
+
* omitted (or supplied for inclusion in the pretty header).
|
|
34
|
+
*/
|
|
35
|
+
export declare function emitVisaListResult(visas: profile.visas.TravelVisa[], format: OutputFormat, verb: "add" | "update" | "remove", options?: {
|
|
36
|
+
id?: string;
|
|
37
|
+
prettyHeader: string;
|
|
38
|
+
}): void;
|
|
39
|
+
export { emitAddSuccess, emitRemoveSuccess, emitUpdateSuccess, wrapListEnvelope };
|
|
40
|
+
//# sourceMappingURL=list.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../../src/commands/profile/visas/list.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAEnH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAG3D;;;;GAIG;AACH,wBAAsB,mBAAmB,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAgB7E;AAED,yDAAyD;AACzD,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,CAAC,KAAK,CAAC,UAAU,EAAE,GAAG,MAAM,CAQzE;AAED,8DAA8D;AAC9D,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,OAAO,CAAC,KAAK,CAAC,UAAU,EAAE,EACjC,aAAa,GAAE,MAAqC,GACnD,MAAM,CAcR;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,OAAO,CAAC,KAAK,CAAC,UAAU,EAAE,EACjC,MAAM,EAAE,YAAY,EACpB,IAAI,EAAE,KAAK,GAAG,QAAQ,GAAG,QAAQ,EACjC,OAAO,GAAE;IAAE,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAyB,GACpE,IAAI,CAkCN;AAID,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
2
|
+
// Copyright (C) 2026 Oleksii PELYKH
|
|
3
|
+
import Table from "cli-table3";
|
|
4
|
+
import { profile } from "@ttctl/core";
|
|
5
|
+
import { emitAddSuccess, emitRemoveSuccess, emitUpdateSuccess, wrapListEnvelope } from "../../../lib/envelopes.js";
|
|
6
|
+
import { emitResult } from "../../../lib/output.js";
|
|
7
|
+
import { handleVisasError, loadAuthTokenOrExit } from "./shared.js";
|
|
8
|
+
/**
|
|
9
|
+
* Action handler for `ttctl profile visas list`. Reads the user's
|
|
10
|
+
* travel-visa records and emits via the cross-CLI output helper from #71,
|
|
11
|
+
* wrapped in the `{items, pageInfo?}` list envelope (#128) for json/yaml.
|
|
12
|
+
*/
|
|
13
|
+
export async function runProfileVisasList(format) {
|
|
14
|
+
const token = await loadAuthTokenOrExit("visas list", format);
|
|
15
|
+
let visas;
|
|
16
|
+
try {
|
|
17
|
+
visas = await profile.visas.list(token);
|
|
18
|
+
}
|
|
19
|
+
catch (err) {
|
|
20
|
+
handleVisasError("visas list", err, format);
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
emitResult(wrapListEnvelope(visas), format, {
|
|
24
|
+
pretty: (data) => formatVisasText(data.items),
|
|
25
|
+
table: (data) => formatVisasTable(data.items),
|
|
26
|
+
empty: { command: "profile.visas.list" },
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
/** Format the visas list as a human-readable summary. */
|
|
30
|
+
export function formatVisasText(visas) {
|
|
31
|
+
if (visas.length === 0)
|
|
32
|
+
return "(no travel visas)";
|
|
33
|
+
const lines = [`${visas.length.toString()} travel visa${visas.length === 1 ? "" : "s"}:`];
|
|
34
|
+
for (const v of visas) {
|
|
35
|
+
const expiry = v.expiryDate !== null ? ` (expires ${v.expiryDate})` : "";
|
|
36
|
+
lines.push(` ${v.id} ${v.countryName} — ${v.visaType}${expiry}`);
|
|
37
|
+
}
|
|
38
|
+
return lines.join("\n");
|
|
39
|
+
}
|
|
40
|
+
/** Format the visas list as a `cli-table3`-rendered table. */
|
|
41
|
+
export function formatVisasTable(visas, terminalWidth = process.stdout.columns || 80) {
|
|
42
|
+
const idWidth = 14;
|
|
43
|
+
const countryWidth = Math.max(15, Math.floor((terminalWidth - idWidth - 8) / 3));
|
|
44
|
+
const typeWidth = Math.max(15, countryWidth);
|
|
45
|
+
const expiryWidth = Math.max(12, terminalWidth - idWidth - countryWidth - typeWidth - 8);
|
|
46
|
+
const table = new Table({
|
|
47
|
+
head: ["id", "country", "type", "expires"],
|
|
48
|
+
colWidths: [idWidth, countryWidth, typeWidth, expiryWidth],
|
|
49
|
+
wordWrap: true,
|
|
50
|
+
});
|
|
51
|
+
for (const v of visas) {
|
|
52
|
+
table.push([v.id, v.countryName, v.visaType, v.expiryDate ?? ""]);
|
|
53
|
+
}
|
|
54
|
+
return table.toString();
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Emit the post-mutation visa list, wrapped in the v0.4 envelope ABI
|
|
58
|
+
* (#128). The visas core API returns the FULL post-mutation list rather
|
|
59
|
+
* than the single mutated entity, so the envelope's `created` /
|
|
60
|
+
* `updated` field carries the list (`TravelVisa[]`) rather than a
|
|
61
|
+
* single `TravelVisa`. The pretty rendering keeps the existing
|
|
62
|
+
* "success header + table" UX so users continue to see the post-state
|
|
63
|
+
* at a glance.
|
|
64
|
+
*
|
|
65
|
+
* `verb` selects which envelope shape to emit:
|
|
66
|
+
*
|
|
67
|
+
* - `add` → `emitAddSuccess` with `created: TravelVisa[]`
|
|
68
|
+
* - `update` → `emitUpdateSuccess` with `updated: TravelVisa[]`
|
|
69
|
+
* - `remove` → `emitRemoveSuccess` with `removed: {id}` (the removed
|
|
70
|
+
* id is supplied by the caller; the post-state list is passed
|
|
71
|
+
* through `notice` for human pretty rendering, NOT for json/yaml —
|
|
72
|
+
* `removed` is a strict `{id}` shape per the AC)
|
|
73
|
+
*
|
|
74
|
+
* `id` is required for the `remove` verb; for `add`/`update` it may be
|
|
75
|
+
* omitted (or supplied for inclusion in the pretty header).
|
|
76
|
+
*/
|
|
77
|
+
export function emitVisaListResult(visas, format, verb, options = { prettyHeader: "" }) {
|
|
78
|
+
if (verb === "remove") {
|
|
79
|
+
const id = options.id;
|
|
80
|
+
if (id === undefined) {
|
|
81
|
+
throw new Error("emitVisaListResult: `id` is required for the `remove` verb");
|
|
82
|
+
}
|
|
83
|
+
emitRemoveSuccess({
|
|
84
|
+
operation: "profile.visas.remove",
|
|
85
|
+
format,
|
|
86
|
+
id,
|
|
87
|
+
prettySummary: options.prettyHeader,
|
|
88
|
+
});
|
|
89
|
+
if (format === "pretty" && visas.length > 0) {
|
|
90
|
+
process.stdout.write(`${formatVisasTable(visas)}\n`);
|
|
91
|
+
}
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
if (verb === "add") {
|
|
95
|
+
emitAddSuccess({
|
|
96
|
+
operation: "profile.visas.add",
|
|
97
|
+
format,
|
|
98
|
+
created: visas,
|
|
99
|
+
prettySummary: options.prettyHeader,
|
|
100
|
+
prettyEntity: () => formatVisasTable(visas),
|
|
101
|
+
});
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
emitUpdateSuccess({
|
|
105
|
+
operation: "profile.visas.update",
|
|
106
|
+
format,
|
|
107
|
+
updated: visas,
|
|
108
|
+
prettySummary: options.prettyHeader,
|
|
109
|
+
prettyEntity: () => formatVisasTable(visas),
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
// Re-export the success-emitter helpers so call sites within visas/* can
|
|
113
|
+
// reach them via the same module they import `emitVisaListResult` from.
|
|
114
|
+
export { emitAddSuccess, emitRemoveSuccess, emitUpdateSuccess, wrapListEnvelope };
|
|
115
|
+
//# sourceMappingURL=list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../../src/commands/profile/visas/list.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,oCAAoC;AAEpC,OAAO,KAAK,MAAM,YAAY,CAAC;AAC/B,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AACnH,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEpD,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAEpE;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,MAAoB;IAC5D,MAAM,KAAK,GAAG,MAAM,mBAAmB,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC;IAE9D,IAAI,KAAiC,CAAC;IACtC,IAAI,CAAC;QACH,KAAK,GAAG,MAAM,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC1C,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,gBAAgB,CAAC,YAAY,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;QAC5C,OAAO;IACT,CAAC;IAED,UAAU,CAAC,gBAAgB,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE;QAC1C,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC;QAC7C,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC;QAC7C,KAAK,EAAE,EAAE,OAAO,EAAE,oBAAoB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YACb,SAAS,EAAE,mBAAmB;YAC9B,MAAM;YACN,OAAO,EAAE,KAAK;YACd,aAAa,EAAE,OAAO,CAAC,YAAY;YACnC,YAAY,EAAE,GAAG,EAAE,CAAC,gBAAgB,CAAC,KAAK,CAAC;SAC5C,CAAC,CAAC;QACH,OAAO;IACT,CAAC;IACD,iBAAiB,CAAC;QAChB,SAAS,EAAE,sBAAsB;QACjC,MAAM;QACN,OAAO,EAAE,KAAK;QACd,aAAa,EAAE,OAAO,CAAC,YAAY;QACnC,YAAY,EAAE,GAAG,EAAE,CAAC,gBAAgB,CAAC,KAAK,CAAC;KAC5C,CAAC,CAAC;AACL,CAAC;AAED,yEAAyE;AACzE,wEAAwE;AACxE,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { OutputFormat } from "../../../lib/output.js";
|
|
2
|
+
/**
|
|
3
|
+
* Action handler for `ttctl profile visas remove <id>` (alias `rm`).
|
|
4
|
+
* Emits the v0.4 envelope (#128); the post-mutation list still renders
|
|
5
|
+
* after the success line in pretty mode.
|
|
6
|
+
*/
|
|
7
|
+
export declare function runProfileVisasRemove(id: string, format: OutputFormat): Promise<void>;
|
|
8
|
+
//# sourceMappingURL=remove.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remove.d.ts","sourceRoot":"","sources":["../../../../src/commands/profile/visas/remove.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAI3D;;;;GAIG;AACH,wBAAsB,qBAAqB,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAY3F"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
2
|
+
// Copyright (C) 2026 Oleksii PELYKH
|
|
3
|
+
import { profile } from "@ttctl/core";
|
|
4
|
+
import { emitVisaListResult } from "./list.js";
|
|
5
|
+
import { handleVisasError, loadAuthTokenOrExit } from "./shared.js";
|
|
6
|
+
/**
|
|
7
|
+
* Action handler for `ttctl profile visas remove <id>` (alias `rm`).
|
|
8
|
+
* Emits the v0.4 envelope (#128); the post-mutation list still renders
|
|
9
|
+
* after the success line in pretty mode.
|
|
10
|
+
*/
|
|
11
|
+
export async function runProfileVisasRemove(id, format) {
|
|
12
|
+
const token = await loadAuthTokenOrExit("visas remove", format);
|
|
13
|
+
let visas;
|
|
14
|
+
try {
|
|
15
|
+
visas = await profile.visas.remove(token, id);
|
|
16
|
+
}
|
|
17
|
+
catch (err) {
|
|
18
|
+
handleVisasError("visas remove", err, format);
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
emitVisaListResult(visas, format, "remove", { id, prettyHeader: id });
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=remove.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remove.js","sourceRoot":"","sources":["../../../../src/commands/profile/visas/remove.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,oCAAoC;AAEpC,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAGtC,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAEpE;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,qBAAqB,CAAC,EAAU,EAAE,MAAoB;IAC1E,MAAM,KAAK,GAAG,MAAM,mBAAmB,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC;IAEhE,IAAI,KAAiC,CAAC;IACtC,IAAI,CAAC;QACH,KAAK,GAAG,MAAM,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IAChD,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,gBAAgB,CAAC,cAAc,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;QAC9C,OAAO;IACT,CAAC;IAED,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,EAAE,EAAE,YAAY,EAAE,EAAE,EAAE,CAAC,CAAC;AACxE,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { OutputFormat } from "../../../lib/output.js";
|
|
2
|
+
export { loadAuthTokenOrExit } from "../shared.js";
|
|
3
|
+
/**
|
|
4
|
+
* Thin wrapper around the shared CLI error router (#330) closed over
|
|
5
|
+
* `profile.visas.VisasError`. The router applies the envelope ABI
|
|
6
|
+
* (#128) branching uniformly across sub-domains. No per-code hint
|
|
7
|
+
* adapter — `VisasError` codes do not carry actionable next-step hints
|
|
8
|
+
* today.
|
|
9
|
+
*/
|
|
10
|
+
export declare function handleVisasError(commandLabel: string, err: unknown, format?: OutputFormat): never;
|
|
11
|
+
//# sourceMappingURL=shared.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../../src/commands/profile/visas/shared.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAE3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAEnD;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,GAAE,YAAuB,GAAG,KAAK,CAE3G"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
2
|
+
// Copyright (C) 2026 Oleksii PELYKH
|
|
3
|
+
import { profile } from "@ttctl/core";
|
|
4
|
+
import { handleDomainError } from "../../../lib/error-routing.js";
|
|
5
|
+
export { loadAuthTokenOrExit } from "../shared.js";
|
|
6
|
+
/**
|
|
7
|
+
* Thin wrapper around the shared CLI error router (#330) closed over
|
|
8
|
+
* `profile.visas.VisasError`. The router applies the envelope ABI
|
|
9
|
+
* (#128) branching uniformly across sub-domains. No per-code hint
|
|
10
|
+
* adapter — `VisasError` codes do not carry actionable next-step hints
|
|
11
|
+
* today.
|
|
12
|
+
*/
|
|
13
|
+
export function handleVisasError(commandLabel, err, format = "pretty") {
|
|
14
|
+
handleDomainError(commandLabel, err, profile.visas.VisasError, format);
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=shared.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.js","sourceRoot":"","sources":["../../../../src/commands/profile/visas/shared.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,oCAAoC;AAEpC,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAGlE,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAEnD;;;;;;GAMG;AACH,MAAM,UAAU,gBAAgB,CAAC,YAAoB,EAAE,GAAY,EAAE,SAAuB,QAAQ;IAClG,iBAAiB,CAAC,YAAY,EAAE,GAAG,EAAE,OAAO,CAAC,KAAK,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;AACzE,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { OutputFormat } from "../../../lib/output.js";
|
|
2
|
+
/**
|
|
3
|
+
* Action handler for `ttctl profile visas update <id>`. Updates only
|
|
4
|
+
* the fields supplied; rejects an empty update with `VALIDATION_ERROR`
|
|
5
|
+
* via the envelope ABI (#128).
|
|
6
|
+
*/
|
|
7
|
+
export declare function runProfileVisasUpdate(id: string, options: {
|
|
8
|
+
country?: string;
|
|
9
|
+
type?: string;
|
|
10
|
+
expires?: string;
|
|
11
|
+
output: OutputFormat;
|
|
12
|
+
}): Promise<void>;
|
|
13
|
+
//# sourceMappingURL=update.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../../../src/commands/profile/visas/update.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAI3D;;;;GAIG;AACH,wBAAsB,qBAAqB,CACzC,EAAE,EAAE,MAAM,EACV,OAAO,EAAE;IAAE,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,YAAY,CAAA;CAAE,GACnF,OAAO,CAAC,IAAI,CAAC,CA+Bf"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
2
|
+
// Copyright (C) 2026 Oleksii PELYKH
|
|
3
|
+
import { profile } from "@ttctl/core";
|
|
4
|
+
import { emitErrorAndExit } from "../../../lib/envelopes.js";
|
|
5
|
+
import { emitVisaListResult } from "./list.js";
|
|
6
|
+
import { handleVisasError, loadAuthTokenOrExit } from "./shared.js";
|
|
7
|
+
/**
|
|
8
|
+
* Action handler for `ttctl profile visas update <id>`. Updates only
|
|
9
|
+
* the fields supplied; rejects an empty update with `VALIDATION_ERROR`
|
|
10
|
+
* via the envelope ABI (#128).
|
|
11
|
+
*/
|
|
12
|
+
export async function runProfileVisasUpdate(id, options) {
|
|
13
|
+
const changes = {};
|
|
14
|
+
if (options.country !== undefined)
|
|
15
|
+
changes.countryId = options.country;
|
|
16
|
+
if (options.type !== undefined)
|
|
17
|
+
changes.visaType = options.type;
|
|
18
|
+
if (options.expires !== undefined)
|
|
19
|
+
changes.expiryDate = options.expires;
|
|
20
|
+
if (Object.keys(changes).length === 0) {
|
|
21
|
+
emitErrorAndExit({
|
|
22
|
+
operation: "profile.visas.update",
|
|
23
|
+
format: options.output,
|
|
24
|
+
errors: [
|
|
25
|
+
{
|
|
26
|
+
code: "VALIDATION_ERROR",
|
|
27
|
+
message: "supply at least one field flag (--country, --type, or --expires).",
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
prettySummary: "visas update failed (VALIDATION_ERROR): supply at least one field flag (--country, --type, or --expires).",
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
const token = await loadAuthTokenOrExit("visas update", options.output);
|
|
34
|
+
let visas;
|
|
35
|
+
try {
|
|
36
|
+
visas = await profile.visas.update(token, id, changes);
|
|
37
|
+
}
|
|
38
|
+
catch (err) {
|
|
39
|
+
handleVisasError("visas update", err, options.output);
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
emitVisaListResult(visas, options.output, "update", { prettyHeader: `Travel visa ${id} updated.` });
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=update.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update.js","sourceRoot":"","sources":["../../../../src/commands/profile/visas/update.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,oCAAoC;AAEpC,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAE7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAEpE;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,qBAAqB,CACzC,EAAU,EACV,OAAoF;IAEpF,MAAM,OAAO,GAAkC,EAAE,CAAC;IAClD,IAAI,OAAO,CAAC,OAAO,KAAK,SAAS;QAAE,OAAO,CAAC,SAAS,GAAG,OAAO,CAAC,OAAO,CAAC;IACvE,IAAI,OAAO,CAAC,IAAI,KAAK,SAAS;QAAE,OAAO,CAAC,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAChE,IAAI,OAAO,CAAC,OAAO,KAAK,SAAS;QAAE,OAAO,CAAC,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC;IAExE,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACtC,gBAAgB,CAAC;YACf,SAAS,EAAE,sBAAsB;YACjC,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,MAAM,EAAE;gBACN;oBACE,IAAI,EAAE,kBAAkB;oBACxB,OAAO,EAAE,mEAAmE;iBAC7E;aACF;YACD,aAAa,EACX,2GAA2G;SAC9G,CAAC,CAAC;IACL,CAAC;IACD,MAAM,KAAK,GAAG,MAAM,mBAAmB,CAAC,cAAc,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IAExE,IAAI,KAAiC,CAAC;IACtC,IAAI,CAAC;QACH,KAAK,GAAG,MAAM,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IACzD,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,gBAAgB,CAAC,cAAc,EAAE,GAAG,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;QACtD,OAAO;IACT,CAAC;IAED,kBAAkB,CAAC,KAAK,EAAE,OAAO,CAAC,MAAM,EAAE,QAAQ,EAAE,EAAE,YAAY,EAAE,eAAe,EAAE,WAAW,EAAE,CAAC,CAAC;AACtG,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Command } from "commander";
|
|
2
|
+
/**
|
|
3
|
+
* Build the `ttctl timesheet` command tree (#13). Three leaves:
|
|
4
|
+
*
|
|
5
|
+
* | Leaf | Description |
|
|
6
|
+
* |----------------------------------|---------------------------------------------------|
|
|
7
|
+
* | `list [--engagement <id>]` | List timesheets (default: viewer-wide pending) |
|
|
8
|
+
* | `show <id>` | One timesheet detail (id = BillingCycle.id) |
|
|
9
|
+
* | `submit [id] [--confirm]` | Submit timesheet for billing (destructive) |
|
|
10
|
+
*
|
|
11
|
+
* **Wire identity model**:
|
|
12
|
+
* - `BillingCycle.id` — the public "timesheet id" returned by
|
|
13
|
+
* `list` and consumed by `show` / `submit`.
|
|
14
|
+
* - `JobActivityItem.id` — the "engagement id" exposed by
|
|
15
|
+
* `engagements list`. Passed via `--engagement <id>` to scope
|
|
16
|
+
* `list` / `submit` auto-resolve to one engagement.
|
|
17
|
+
*
|
|
18
|
+
* **Out of scope for v1** (per #13 spec): editing timesheet records,
|
|
19
|
+
* uploading attachments, reminder settings, rejection/approval
|
|
20
|
+
* workflow. The web UI handles record entry; this CLI surfaces the
|
|
21
|
+
* read paths and the submit verb.
|
|
22
|
+
*/
|
|
23
|
+
export declare function buildTimesheetCommand(): Command;
|
|
24
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/timesheet/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAgC,MAAM,WAAW,CAAC;AASlE;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,qBAAqB,IAAI,OAAO,CA2D/C"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
2
|
+
// Copyright (C) 2026 Oleksii PELYKH
|
|
3
|
+
import { Command, InvalidArgumentError, Option } from "commander";
|
|
4
|
+
import { markMutation } from "../../lib/dry-run.js";
|
|
5
|
+
import { OUTPUT_FORMATS } from "../../lib/output.js";
|
|
6
|
+
import { runTimesheetList } from "./list.js";
|
|
7
|
+
import { runTimesheetShow } from "./show.js";
|
|
8
|
+
import { runTimesheetSubmit } from "./submit.js";
|
|
9
|
+
/**
|
|
10
|
+
* Build the `ttctl timesheet` command tree (#13). Three leaves:
|
|
11
|
+
*
|
|
12
|
+
* | Leaf | Description |
|
|
13
|
+
* |----------------------------------|---------------------------------------------------|
|
|
14
|
+
* | `list [--engagement <id>]` | List timesheets (default: viewer-wide pending) |
|
|
15
|
+
* | `show <id>` | One timesheet detail (id = BillingCycle.id) |
|
|
16
|
+
* | `submit [id] [--confirm]` | Submit timesheet for billing (destructive) |
|
|
17
|
+
*
|
|
18
|
+
* **Wire identity model**:
|
|
19
|
+
* - `BillingCycle.id` — the public "timesheet id" returned by
|
|
20
|
+
* `list` and consumed by `show` / `submit`.
|
|
21
|
+
* - `JobActivityItem.id` — the "engagement id" exposed by
|
|
22
|
+
* `engagements list`. Passed via `--engagement <id>` to scope
|
|
23
|
+
* `list` / `submit` auto-resolve to one engagement.
|
|
24
|
+
*
|
|
25
|
+
* **Out of scope for v1** (per #13 spec): editing timesheet records,
|
|
26
|
+
* uploading attachments, reminder settings, rejection/approval
|
|
27
|
+
* workflow. The web UI handles record entry; this CLI surfaces the
|
|
28
|
+
* read paths and the submit verb.
|
|
29
|
+
*/
|
|
30
|
+
export function buildTimesheetCommand() {
|
|
31
|
+
const cmd = new Command("timesheet").description("View timesheet billing cycles and submit them for billing");
|
|
32
|
+
cmd
|
|
33
|
+
.command("list")
|
|
34
|
+
.description("List timesheet billing cycles (default: viewer-wide pending)")
|
|
35
|
+
.option("--engagement <id>", "scope to one engagement (jobActivityItem.id from `engagements list`)")
|
|
36
|
+
.addOption(new Option("-o, --output <format>", "output format")
|
|
37
|
+
.choices(OUTPUT_FORMATS)
|
|
38
|
+
.default("pretty"))
|
|
39
|
+
.action(async (options) => {
|
|
40
|
+
const listOpts = { output: options.output };
|
|
41
|
+
if (options.engagement !== undefined)
|
|
42
|
+
listOpts.engagement = options.engagement;
|
|
43
|
+
await runTimesheetList(listOpts);
|
|
44
|
+
});
|
|
45
|
+
cmd
|
|
46
|
+
.command("show")
|
|
47
|
+
.description("Show one timesheet by id (BillingCycle.id from `timesheet list`)")
|
|
48
|
+
.argument("<id>", "timesheet id (BillingCycle.id)", parseIdArg)
|
|
49
|
+
.addOption(new Option("-o, --output <format>", "output format")
|
|
50
|
+
.choices(OUTPUT_FORMATS)
|
|
51
|
+
.default("pretty"))
|
|
52
|
+
.action(async (id, options) => {
|
|
53
|
+
await runTimesheetShow(id, options.output);
|
|
54
|
+
});
|
|
55
|
+
const submitCmd = cmd
|
|
56
|
+
.command("submit")
|
|
57
|
+
.description("Submit a timesheet for billing (DESTRUCTIVE — one-way)")
|
|
58
|
+
.argument("[id]", "timesheet id (BillingCycle.id); when omitted, the current pending cycle is auto-resolved", parseIdArgOptional)
|
|
59
|
+
.option("--engagement <id>", "scope auto-resolve to one engagement (jobActivityItem.id)")
|
|
60
|
+
.option("--confirm", "skip the interactive confirmation prompt (required for non-TTY stdin)", false)
|
|
61
|
+
.addOption(new Option("-o, --output <format>", "output format")
|
|
62
|
+
.choices(OUTPUT_FORMATS)
|
|
63
|
+
.default("pretty"))
|
|
64
|
+
.action(async (id, options) => {
|
|
65
|
+
const submitOpts = {
|
|
66
|
+
confirm: options.confirm,
|
|
67
|
+
output: options.output,
|
|
68
|
+
};
|
|
69
|
+
if (options.engagement !== undefined)
|
|
70
|
+
submitOpts.engagement = options.engagement;
|
|
71
|
+
await runTimesheetSubmit(id, submitOpts);
|
|
72
|
+
});
|
|
73
|
+
markMutation(submitCmd);
|
|
74
|
+
return cmd;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Parse the positional `<id>` argument for `show`. Rejects empty /
|
|
78
|
+
* whitespace-only strings — Commander would otherwise pass them
|
|
79
|
+
* through. Mirrors the engagements group's `parseIdArg`.
|
|
80
|
+
*/
|
|
81
|
+
function parseIdArg(value) {
|
|
82
|
+
const trimmed = value.trim();
|
|
83
|
+
if (trimmed === "") {
|
|
84
|
+
throw new InvalidArgumentError("id must not be empty");
|
|
85
|
+
}
|
|
86
|
+
return trimmed;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Optional-positional variant for `submit`. `undefined` flows through
|
|
90
|
+
* (Commander hands us `undefined` when the positional was omitted);
|
|
91
|
+
* a present-but-blank id is rejected so we don't silently use `""`.
|
|
92
|
+
*/
|
|
93
|
+
function parseIdArgOptional(value) {
|
|
94
|
+
if (value === undefined)
|
|
95
|
+
return undefined;
|
|
96
|
+
return parseIdArg(value);
|
|
97
|
+
}
|
|
98
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/timesheet/index.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,oCAAoC;AAEpC,OAAO,EAAE,OAAO,EAAE,oBAAoB,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAElE,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEjD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,UAAU,qBAAqB;IACnC,MAAM,GAAG,GAAG,IAAI,OAAO,CAAC,WAAW,CAAC,CAAC,WAAW,CAAC,2DAA2D,CAAC,CAAC;IAE9G,GAAG;SACA,OAAO,CAAC,MAAM,CAAC;SACf,WAAW,CAAC,8DAA8D,CAAC;SAC3E,MAAM,CAAC,mBAAmB,EAAE,sEAAsE,CAAC;SACnG,SAAS,CACR,IAAI,MAAM,CAAC,uBAAuB,EAAE,eAAe,CAAC;SACjD,OAAO,CAAC,cAAc,CAAC;SACvB,OAAO,CAAC,QAA+B,CAAC,CAC5C;SACA,MAAM,CAAC,KAAK,EAAE,OAAsD,EAAE,EAAE;QACvE,MAAM,QAAQ,GAA6C,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC;QACtF,IAAI,OAAO,CAAC,UAAU,KAAK,SAAS;YAAE,QAAQ,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;Q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AAC,SAAS,CAAC,CAAC;IAExB,OAAO,GAAG,CAAC;AACb,CAAC;AAED;;;;GAIG;AACH,SAAS,UAAU,CAAC,KAAa;IAC/B,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IAC7B,IAAI,OAAO,KAAK,EAAE,EAAE,CAAC;QACnB,MAAM,IAAI,oBAAoB,CAAC,sBAAsB,CAAC,CAAC;IACzD,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;;;;GAIG;AACH,SAAS,kBAAkB,CAAC,KAAyB;IACnD,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAC1C,OAAO,UAAU,CAAC,KAAK,CAAC,CAAC;AAC3B,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { timesheet } from "@ttctl/core";
|
|
2
|
+
import type { OutputFormat } from "../../lib/output.js";
|
|
3
|
+
/**
|
|
4
|
+
* Action handler for `ttctl timesheet list`. Default scope is
|
|
5
|
+
* viewer-wide pending timesheets (whatever the user owes Toptal right
|
|
6
|
+
* now); `--engagement <id>` switches to listing all billing cycles
|
|
7
|
+
* for one engagement.
|
|
8
|
+
*
|
|
9
|
+
* Pretty rendering: column-aligned table; pretty empty-state CTA via
|
|
10
|
+
* the `empty` opt-in in `emitResult` (#122 reframe).
|
|
11
|
+
*
|
|
12
|
+
* **Pagination not supported** — the captured wire ops have no
|
|
13
|
+
* pagination args (`PendingTimesheets` has a hard `limit: 50` inline
|
|
14
|
+
* in its document; `Timesheets($jobActivityItemId)` has none). Per
|
|
15
|
+
* #183, pagination flags are declared PER paginating leaf; this leaf
|
|
16
|
+
* does not declare `--page` / `--per-page`.
|
|
17
|
+
*/
|
|
18
|
+
export interface TimesheetListOptions {
|
|
19
|
+
engagement?: string;
|
|
20
|
+
output: OutputFormat;
|
|
21
|
+
}
|
|
22
|
+
export declare function runTimesheetList(opts: TimesheetListOptions): Promise<void>;
|
|
23
|
+
/**
|
|
24
|
+
* Render the timesheet list as a `cli-table3` table sized to the
|
|
25
|
+
* current terminal width. Columns:
|
|
26
|
+
*
|
|
27
|
+
* id | engagement | job | week | hours | submitted | overdue
|
|
28
|
+
*
|
|
29
|
+
* `week` shows the cycle's date range (`YYYY-MM-DD → YYYY-MM-DD`).
|
|
30
|
+
* `submitted` is `✓` / `·` for visual scanning; `overdue` is
|
|
31
|
+
* `!` only when overdue (otherwise blank) so non-overdue rows are
|
|
32
|
+
* visually quiet.
|
|
33
|
+
*/
|
|
34
|
+
export declare function formatTimesheetsTable(items: timesheet.TimesheetListItem[], terminalWidth?: number): string;
|
|
35
|
+
/**
|
|
36
|
+
* Render the cycle's date range. Wire dates are already ISO `YYYY-MM-DD`
|
|
37
|
+
* strings — render verbatim with a separator.
|
|
38
|
+
*/
|
|
39
|
+
export declare function formatWeek(startDate: string, endDate: string): string;
|
|
40
|
+
//# sourceMappingURL=list.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/commands/timesheet/list.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAIxC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAGxD;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,oBAAoB;IACnC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,YAAY,CAAC;CACtB;AAED,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,CAkBhF;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,SAAS,CAAC,iBAAiB,EAAE,EACpC,aAAa,GAAE,MAAsC,GACpD,MAAM,CAqCR;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAErE"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
2
|
+
// Copyright (C) 2026 Oleksii PELYKH
|
|
3
|
+
import Table from "cli-table3";
|
|
4
|
+
import { timesheet } from "@ttctl/core";
|
|
5
|
+
import { wrapListEnvelope } from "../../lib/envelopes.js";
|
|
6
|
+
import { emitResult } from "../../lib/output.js";
|
|
7
|
+
import { handleTimesheetError, loadAuthTokenOrExit } from "./shared.js";
|
|
8
|
+
export async function runTimesheetList(opts) {
|
|
9
|
+
const token = await loadAuthTokenOrExit("timesheet list", opts.output);
|
|
10
|
+
const listOpts = {};
|
|
11
|
+
if (opts.engagement !== undefined)
|
|
12
|
+
listOpts.engagement = opts.engagement;
|
|
13
|
+
let items;
|
|
14
|
+
try {
|
|
15
|
+
items = await timesheet.list(token, listOpts);
|
|
16
|
+
}
|
|
17
|
+
catch (err) {
|
|
18
|
+
handleTimesheetError("timesheet list", err, opts.output);
|
|
19
|
+
}
|
|
20
|
+
emitResult(wrapListEnvelope(items), opts.output, {
|
|
21
|
+
pretty: (data) => formatTimesheetsTable(data.items),
|
|
22
|
+
table: (data) => formatTimesheetsTable(data.items),
|
|
23
|
+
empty: { command: "timesheet.list" },
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Render the timesheet list as a `cli-table3` table sized to the
|
|
28
|
+
* current terminal width. Columns:
|
|
29
|
+
*
|
|
30
|
+
* id | engagement | job | week | hours | submitted | overdue
|
|
31
|
+
*
|
|
32
|
+
* `week` shows the cycle's date range (`YYYY-MM-DD → YYYY-MM-DD`).
|
|
33
|
+
* `submitted` is `✓` / `·` for visual scanning; `overdue` is
|
|
34
|
+
* `!` only when overdue (otherwise blank) so non-overdue rows are
|
|
35
|
+
* visually quiet.
|
|
36
|
+
*/
|
|
37
|
+
export function formatTimesheetsTable(items, terminalWidth = process.stdout.columns || 100) {
|
|
38
|
+
if (items.length === 0) {
|
|
39
|
+
const empty = new Table({ head: ["id", "engagement", "job", "week", "hours", "submitted", "overdue"] });
|
|
40
|
+
return empty.toString();
|
|
41
|
+
}
|
|
42
|
+
const idWidth = 22;
|
|
43
|
+
const engagementWidth = 14;
|
|
44
|
+
const weekWidth = 24;
|
|
45
|
+
const hoursWidth = 7;
|
|
46
|
+
const submittedWidth = 10;
|
|
47
|
+
const overdueWidth = 8;
|
|
48
|
+
// 7 columns × 2 padding-char + 8 borders ≈ 22
|
|
49
|
+
const remaining = Math.max(20, terminalWidth - idWidth - engagementWidth - weekWidth - hoursWidth - submittedWidth - overdueWidth - 22);
|
|
50
|
+
const jobWidth = Math.max(20, remaining);
|
|
51
|
+
const table = new Table({
|
|
52
|
+
head: ["id", "engagement", "job", "week", "hours", "submitted", "overdue"],
|
|
53
|
+
colWidths: [idWidth, engagementWidth, jobWidth, weekWidth, hoursWidth, submittedWidth, overdueWidth],
|
|
54
|
+
colAligns: ["left", "left", "left", "left", "right", "center", "center"],
|
|
55
|
+
wordWrap: true,
|
|
56
|
+
});
|
|
57
|
+
for (const it of items) {
|
|
58
|
+
const client = it.engagement.job.client?.fullName ?? "(no client)";
|
|
59
|
+
const title = it.engagement.job.title ?? "(untitled)";
|
|
60
|
+
table.push([
|
|
61
|
+
it.id,
|
|
62
|
+
client,
|
|
63
|
+
title,
|
|
64
|
+
formatWeek(it.startDate, it.endDate),
|
|
65
|
+
it.hours,
|
|
66
|
+
it.timesheetSubmitted ? "✓" : "·",
|
|
67
|
+
it.timesheetOverdue ? "!" : "",
|
|
68
|
+
]);
|
|
69
|
+
}
|
|
70
|
+
return table.toString();
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Render the cycle's date range. Wire dates are already ISO `YYYY-MM-DD`
|
|
74
|
+
* strings — render verbatim with a separator.
|
|
75
|
+
*/
|
|
76
|
+
export function formatWeek(startDate, endDate) {
|
|
77
|
+
return `${startDate} → ${endDate}`;
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=list.js.map
|
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E,QAAQ,EAAE,QAAQ,CAAC;QACxE,QAAQ,EAAE,IAAI;KACf,CAAC,CAAC;IACH,KAAK,MAAM,EAAE,IAAI,KAAK,EAAE,CAAC;QACvB,MAAM,MAAM,GAAG,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,MAAM,EAAE,QAAQ,IAAI,aAAa,CAAC;QACnE,MAAM,KAAK,GAAG,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,KAAK,IAAI,YAAY,CAAC;QACtD,KAAK,CAAC,IAAI,CAAC;YACT,EAAE,CAAC,EAAE;YACL,MAAM;YACN,KAAK;YACL,UAAU,CAAC,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC,OAAO,CAAC;YACpC,EAAE,CAAC,KAAK;YACR,EAAE,CAAC,kBAAkB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG;YACjC,EAAE,CAAC,gBAAgB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE;SAC/B,CAAC,CAAC;IACL,CAAC;IACD,OAAO,KAAK,CAAC,QAAQ,EAAE,CAAC;AAC1B,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,UAAU,CAAC,SAAiB,EAAE,OAAe;IAC3D,OAAO,GAAG,SAAS,MAAM,OAAO,EAAE,CAAC;AACrC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { OutputFormat } from "../../lib/output.js";
|
|
2
|
+
export { loadAuthTokenOrExit } from "../profile/shared.js";
|
|
3
|
+
/**
|
|
4
|
+
* Thin wrapper around the shared CLI error router (#330) closed over
|
|
5
|
+
* `timesheet.TimesheetError` and {@link hintForTimesheetCode}. The
|
|
6
|
+
* router applies the envelope ABI (#128) branching uniformly across
|
|
7
|
+
* sub-domains.
|
|
8
|
+
*/
|
|
9
|
+
export declare function handleTimesheetError(commandLabel: string, err: unknown, format?: OutputFormat): never;
|
|
10
|
+
//# sourceMappingURL=shared.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../src/commands/timesheet/shared.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAE3D;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,GAAE,YAAuB,GAAG,KAAK,CAE/G"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
2
|
+
// Copyright (C) 2026 Oleksii PELYKH
|
|
3
|
+
import { timesheet } from "@ttctl/core";
|
|
4
|
+
import { handleDomainError } from "../../lib/error-routing.js";
|
|
5
|
+
export { loadAuthTokenOrExit } from "../profile/shared.js";
|
|
6
|
+
/**
|
|
7
|
+
* Thin wrapper around the shared CLI error router (#330) closed over
|
|
8
|
+
* `timesheet.TimesheetError` and {@link hintForTimesheetCode}. The
|
|
9
|
+
* router applies the envelope ABI (#128) branching uniformly across
|
|
10
|
+
* sub-domains.
|
|
11
|
+
*/
|
|
12
|
+
export function handleTimesheetError(commandLabel, err, format = "pretty") {
|
|
13
|
+
handleDomainError(commandLabel, err, timesheet.TimesheetError, format, hintForTimesheetCode);
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Per-code recovery hints. Only codes with a clearly actionable next
|
|
17
|
+
* step carry one.
|
|
18
|
+
*/
|
|
19
|
+
function hintForTimesheetCode(code) {
|
|
20
|
+
switch (code) {
|
|
21
|
+
case "NOT_FOUND":
|
|
22
|
+
return "Verify the id (use `ttctl timesheet list` to discover billing-cycle ids).";
|
|
23
|
+
case "NO_ENGAGEMENT":
|
|
24
|
+
return "The activity item exists but isn't an engagement — only engagement-bearing rows have timesheets.";
|
|
25
|
+
case "NO_CURRENT_CYCLE":
|
|
26
|
+
return "No billing cycle is currently in its submission window. Run `ttctl timesheet list` to see what's pending.";
|
|
27
|
+
case "MULTIPLE_CURRENT_CYCLES":
|
|
28
|
+
return "Multiple cycles are simultaneously in their submission window — specify the cycle id explicitly: `ttctl timesheet submit <id> --confirm`.";
|
|
29
|
+
case "MUTATION_ERROR":
|
|
30
|
+
return "The server rejected the submission (often: missing required hours, deadline passed, or already submitted). Inspect the message above and fix in the web UI.";
|
|
31
|
+
default:
|
|
32
|
+
return undefined;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=shared.js.map
|