@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,258 @@
|
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
2
|
+
// Copyright (C) 2026 Oleksii PELYKH
|
|
3
|
+
import { profile } from "@ttctl/core";
|
|
4
|
+
import { Command, Option } from "commander";
|
|
5
|
+
import { emitAddSuccess, emitErrorAndExit, emitRemoveSuccess, emitUpdateSuccess, wrapListEnvelope, } from "../../../lib/envelopes.js";
|
|
6
|
+
import { OUTPUT_FORMATS, emitResult } from "../../../lib/output.js";
|
|
7
|
+
import { loadAuthTokenOrExit, parseLimitOrExit, presentSubDomainError } from "../shared.js";
|
|
8
|
+
/**
|
|
9
|
+
* Build the `ttctl profile industries` command tree.
|
|
10
|
+
*
|
|
11
|
+
* Six leaves:
|
|
12
|
+
* - `add <name> [--connection <type>]`
|
|
13
|
+
* - `update <id> [field-flags]`
|
|
14
|
+
* - `remove <id>`
|
|
15
|
+
* - `show <id> [-o text|json|table]`
|
|
16
|
+
* - `list [-o text|json|table]`
|
|
17
|
+
* - `autocomplete <query>` — looks up known industry names from the
|
|
18
|
+
* Toptal catalog
|
|
19
|
+
*
|
|
20
|
+
* Each `add` creates an `IndustryProfile` row (the user's authored
|
|
21
|
+
* domain-expertise entry). `<name>` becomes `title`; `--connection`
|
|
22
|
+
* becomes `domainArea` (the user's role within the industry, e.g.
|
|
23
|
+
* "Healthcare" + connection "Backend").
|
|
24
|
+
*
|
|
25
|
+
* `autocomplete` is a separate query against `industriesAutocomplete`
|
|
26
|
+
* — the catalog of known industry names. `add` does NOT consult the
|
|
27
|
+
* catalog; users supply the title directly.
|
|
28
|
+
*
|
|
29
|
+
* `show <id>` is the per-id read companion of `list`, added in #342 to
|
|
30
|
+
* close the Class A surface-shape gap (service exported a `show()` but
|
|
31
|
+
* neither CLI nor MCP exposed it). The wire call resolves the row via
|
|
32
|
+
* the schema's `node()` resolver — see
|
|
33
|
+
* `packages/core/src/services/profile/industries/index.ts:226`.
|
|
34
|
+
*/
|
|
35
|
+
export function buildProfileIndustriesCommand() {
|
|
36
|
+
const industries = new Command("industries").description("View and update the industries section of your profile");
|
|
37
|
+
industries
|
|
38
|
+
.command("add")
|
|
39
|
+
.description("Add a new industry-profile entry to your profile")
|
|
40
|
+
.argument("<name>", "industry name (mapped to title)")
|
|
41
|
+
.option("--connection <type>", "your connection / role within the industry (mapped to domainArea)")
|
|
42
|
+
.option("--about <text>", "longer-form description (optional)")
|
|
43
|
+
.addOption(new Option("-o, --output <format>", "output format")
|
|
44
|
+
.choices(OUTPUT_FORMATS)
|
|
45
|
+
.default("pretty"))
|
|
46
|
+
.action(async (name, options) => {
|
|
47
|
+
await runAdd(name, options);
|
|
48
|
+
});
|
|
49
|
+
industries
|
|
50
|
+
.command("update")
|
|
51
|
+
.description("Update an existing industry-profile entry by id")
|
|
52
|
+
.argument("<id>", "industry profile id")
|
|
53
|
+
.option("--name <text>", "industry name (mapped to title)")
|
|
54
|
+
.option("--connection <type>", "your connection / role within the industry")
|
|
55
|
+
.option("--about <text>", "longer-form description")
|
|
56
|
+
.addOption(new Option("-o, --output <format>", "output format")
|
|
57
|
+
.choices(OUTPUT_FORMATS)
|
|
58
|
+
.default("pretty"))
|
|
59
|
+
.action(async (id, options) => {
|
|
60
|
+
await runUpdate(id, options);
|
|
61
|
+
});
|
|
62
|
+
industries
|
|
63
|
+
.command("remove")
|
|
64
|
+
.description("Remove an industry-profile entry by id")
|
|
65
|
+
.argument("<id>", "industry profile id")
|
|
66
|
+
.addOption(new Option("-o, --output <format>", "output format")
|
|
67
|
+
.choices(OUTPUT_FORMATS)
|
|
68
|
+
.default("pretty"))
|
|
69
|
+
.action(async (id, options) => {
|
|
70
|
+
await runRemove(id, options.output);
|
|
71
|
+
});
|
|
72
|
+
industries
|
|
73
|
+
.command("show")
|
|
74
|
+
.description("Show a single industry-profile entry by id")
|
|
75
|
+
.argument("<id>", "industry profile id")
|
|
76
|
+
.addOption(new Option("-o, --output <format>", "output format")
|
|
77
|
+
.choices(OUTPUT_FORMATS)
|
|
78
|
+
.default("pretty"))
|
|
79
|
+
.action(async (id, options) => {
|
|
80
|
+
await runShow(id, options.output);
|
|
81
|
+
});
|
|
82
|
+
industries
|
|
83
|
+
.command("list")
|
|
84
|
+
.description("List your industry-profile entries")
|
|
85
|
+
.addOption(new Option("-o, --output <format>", "output format")
|
|
86
|
+
.choices(OUTPUT_FORMATS)
|
|
87
|
+
.default("pretty"))
|
|
88
|
+
.action(async (options) => {
|
|
89
|
+
await runList(options.output);
|
|
90
|
+
});
|
|
91
|
+
industries
|
|
92
|
+
.command("autocomplete")
|
|
93
|
+
.description('Search the known-industries catalog for a name (e.g. "Healthcare")')
|
|
94
|
+
.argument("<query>", "search term")
|
|
95
|
+
.option("--limit <n>", "max results (default 10)", "10")
|
|
96
|
+
.addOption(new Option("-o, --output <format>", "output format")
|
|
97
|
+
.choices(OUTPUT_FORMATS)
|
|
98
|
+
.default("pretty"))
|
|
99
|
+
.action(async (query, options) => {
|
|
100
|
+
await runAutocomplete(query, options);
|
|
101
|
+
});
|
|
102
|
+
return industries;
|
|
103
|
+
}
|
|
104
|
+
async function runAdd(name, options) {
|
|
105
|
+
const fields = { title: name };
|
|
106
|
+
if (options.connection !== undefined)
|
|
107
|
+
fields.domainArea = options.connection;
|
|
108
|
+
if (options.about !== undefined)
|
|
109
|
+
fields.about = options.about;
|
|
110
|
+
const token = await loadAuthTokenOrExit("profile industries add", options.output);
|
|
111
|
+
let result;
|
|
112
|
+
try {
|
|
113
|
+
result = await profile.industries.add(token, fields);
|
|
114
|
+
}
|
|
115
|
+
catch (err) {
|
|
116
|
+
presentSubDomainError("profile industries add", err, options.output);
|
|
117
|
+
}
|
|
118
|
+
emitAddSuccess({
|
|
119
|
+
operation: "profile.industries.add",
|
|
120
|
+
format: options.output,
|
|
121
|
+
created: result,
|
|
122
|
+
prettySummary: `${result.title} (id ${result.id})`,
|
|
123
|
+
prettyEntity: formatIndustryText,
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
async function runUpdate(id, options) {
|
|
127
|
+
const fields = {};
|
|
128
|
+
if (options.name !== undefined)
|
|
129
|
+
fields.title = options.name;
|
|
130
|
+
if (options.connection !== undefined)
|
|
131
|
+
fields.domainArea = options.connection;
|
|
132
|
+
if (options.about !== undefined)
|
|
133
|
+
fields.about = options.about;
|
|
134
|
+
if (Object.keys(fields).length === 0) {
|
|
135
|
+
emitErrorAndExit({
|
|
136
|
+
operation: "profile.industries.update",
|
|
137
|
+
format: options.output,
|
|
138
|
+
errors: [{ code: "VALIDATION_ERROR", message: "at least one field flag is required" }],
|
|
139
|
+
prettySummary: "profile industries update failed (VALIDATION_ERROR): at least one field flag is required",
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
const token = await loadAuthTokenOrExit("profile industries update", options.output);
|
|
143
|
+
let result;
|
|
144
|
+
try {
|
|
145
|
+
result = await profile.industries.update(token, id, fields);
|
|
146
|
+
}
|
|
147
|
+
catch (err) {
|
|
148
|
+
presentSubDomainError("profile industries update", err, options.output);
|
|
149
|
+
}
|
|
150
|
+
emitUpdateSuccess({
|
|
151
|
+
operation: "profile.industries.update",
|
|
152
|
+
format: options.output,
|
|
153
|
+
updated: result,
|
|
154
|
+
prettySummary: `${result.title} (id ${result.id})`,
|
|
155
|
+
prettyEntity: formatIndustryText,
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
async function runRemove(id, format) {
|
|
159
|
+
const token = await loadAuthTokenOrExit("profile industries remove", format);
|
|
160
|
+
let removedId;
|
|
161
|
+
try {
|
|
162
|
+
removedId = await profile.industries.remove(token, id);
|
|
163
|
+
}
|
|
164
|
+
catch (err) {
|
|
165
|
+
presentSubDomainError("profile industries remove", err, format);
|
|
166
|
+
}
|
|
167
|
+
emitRemoveSuccess({
|
|
168
|
+
operation: "profile.industries.remove",
|
|
169
|
+
format,
|
|
170
|
+
id: removedId,
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
async function runShow(id, format) {
|
|
174
|
+
const token = await loadAuthTokenOrExit("profile industries show", format);
|
|
175
|
+
let result;
|
|
176
|
+
try {
|
|
177
|
+
result = await profile.industries.show(token, id);
|
|
178
|
+
}
|
|
179
|
+
catch (err) {
|
|
180
|
+
presentSubDomainError("profile industries show", err, format);
|
|
181
|
+
}
|
|
182
|
+
emitResult(result, format, { pretty: formatIndustryText, table: formatIndustryTable });
|
|
183
|
+
}
|
|
184
|
+
async function runList(format) {
|
|
185
|
+
const token = await loadAuthTokenOrExit("profile industries list", format);
|
|
186
|
+
let result;
|
|
187
|
+
try {
|
|
188
|
+
result = await profile.industries.list(token);
|
|
189
|
+
}
|
|
190
|
+
catch (err) {
|
|
191
|
+
presentSubDomainError("profile industries list", err, format);
|
|
192
|
+
}
|
|
193
|
+
emitResult(wrapListEnvelope(result), format, {
|
|
194
|
+
pretty: (data) => formatIndustryListText(data.items),
|
|
195
|
+
table: (data) => formatIndustryListTable(data.items),
|
|
196
|
+
empty: { command: "profile.industries.list" },
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
async function runAutocomplete(query, options) {
|
|
200
|
+
const limit = parseLimitOrExit(options.limit, "profile industries autocomplete", options.output);
|
|
201
|
+
const token = await loadAuthTokenOrExit("profile industries autocomplete", options.output);
|
|
202
|
+
let suggestions;
|
|
203
|
+
try {
|
|
204
|
+
suggestions = await profile.industries.autocomplete(token, query, { limit });
|
|
205
|
+
}
|
|
206
|
+
catch (err) {
|
|
207
|
+
presentSubDomainError("profile industries autocomplete", err, options.output);
|
|
208
|
+
}
|
|
209
|
+
emitResult(wrapListEnvelope(suggestions), options.output, {
|
|
210
|
+
pretty: (data) => formatCatalogText(data.items),
|
|
211
|
+
table: (data) => formatCatalogTable(data.items),
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Pretty-print an IndustryProfile row.
|
|
216
|
+
*/
|
|
217
|
+
export function formatIndustryText(i) {
|
|
218
|
+
const lines = [i.title];
|
|
219
|
+
if (i.domainArea)
|
|
220
|
+
lines.push(` domain: ${i.domainArea}`);
|
|
221
|
+
if (i.about)
|
|
222
|
+
lines.push(` ${i.about}`);
|
|
223
|
+
lines.push(` id: ${i.id}`);
|
|
224
|
+
return lines.join("\n");
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* Pretty-print an IndustryProfile row as a key/value table.
|
|
228
|
+
*/
|
|
229
|
+
export function formatIndustryTable(i) {
|
|
230
|
+
const rows = [
|
|
231
|
+
["id", i.id],
|
|
232
|
+
["title", i.title],
|
|
233
|
+
["domain", i.domainArea ?? ""],
|
|
234
|
+
["about", i.about ?? ""],
|
|
235
|
+
];
|
|
236
|
+
return rows.map(([k, v]) => `${k}\t${v}`).join("\n");
|
|
237
|
+
}
|
|
238
|
+
export function formatIndustryListText(rows) {
|
|
239
|
+
if (rows.length === 0)
|
|
240
|
+
return "(no industries on this profile)";
|
|
241
|
+
return rows.map(formatIndustryText).join("\n\n");
|
|
242
|
+
}
|
|
243
|
+
export function formatIndustryListTable(rows) {
|
|
244
|
+
if (rows.length === 0)
|
|
245
|
+
return "(no industries on this profile)";
|
|
246
|
+
return rows.map((i) => `${i.id}\t${i.title}\t${i.domainArea ?? ""}`).join("\n");
|
|
247
|
+
}
|
|
248
|
+
export function formatCatalogText(rows) {
|
|
249
|
+
if (rows.length === 0)
|
|
250
|
+
return "(no matches)";
|
|
251
|
+
return rows.map((r) => `${r.name} (${r.id})`).join("\n");
|
|
252
|
+
}
|
|
253
|
+
export function formatCatalogTable(rows) {
|
|
254
|
+
if (rows.length === 0)
|
|
255
|
+
return "(no matches)";
|
|
256
|
+
return rows.map((r) => `${r.id}\t${r.name}`).join("\n");
|
|
257
|
+
}
|
|
258
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/comm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AAC,CAAC;AAC1D,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { profile } from "@ttctl/core";
|
|
2
|
+
import type { OutputFormat } from "../../../lib/output.js";
|
|
3
|
+
/**
|
|
4
|
+
* Action handler for `ttctl profile portfolio add`. Creates a new
|
|
5
|
+
* portfolio item; if `--cover` is supplied, the cover image is uploaded
|
|
6
|
+
* first and its server-issued `coverImageCacheName` is forwarded into
|
|
7
|
+
* the create call so the new item carries the cover from creation.
|
|
8
|
+
*/
|
|
9
|
+
export declare function runProfilePortfolioAdd(options: {
|
|
10
|
+
title: string;
|
|
11
|
+
description?: string;
|
|
12
|
+
edit?: boolean;
|
|
13
|
+
url?: string;
|
|
14
|
+
link?: string;
|
|
15
|
+
cover?: string;
|
|
16
|
+
industryId?: string[];
|
|
17
|
+
output: OutputFormat;
|
|
18
|
+
}): Promise<void>;
|
|
19
|
+
/**
|
|
20
|
+
* Route service errors through the envelope ABI (#128). `TtctlError`
|
|
21
|
+
* subclasses keep their dedicated 3-block pretty rendering on `pretty`;
|
|
22
|
+
* `json`/`yaml` flow through the envelope so machine consumers see the
|
|
23
|
+
* stable wire shape. Domain `PortfolioError` codes always flow through
|
|
24
|
+
* the envelope.
|
|
25
|
+
*/
|
|
26
|
+
declare function handlePortfolioError(commandLabel: string, err: unknown, format?: OutputFormat): never;
|
|
27
|
+
/**
|
|
28
|
+
* Emit the post-mutation portfolio list, wrapped in the v0.4 envelope
|
|
29
|
+
* ABI (#128). The portfolio core API returns the FULL post-mutation
|
|
30
|
+
* list rather than the single mutated entity, so the envelope's
|
|
31
|
+
* `created` / `updated` field carries the list (`PortfolioItem[]`)
|
|
32
|
+
* rather than a single `PortfolioItem`. The pretty rendering keeps the
|
|
33
|
+
* existing "success header + table" UX so users continue to see the
|
|
34
|
+
* post-state at a glance.
|
|
35
|
+
*/
|
|
36
|
+
export declare function emitMutationResult(items: profile.portfolio.PortfolioItem[], format: OutputFormat, verb: "add" | "update" | "remove", options: {
|
|
37
|
+
id?: string;
|
|
38
|
+
prettyHeader: string;
|
|
39
|
+
}): void;
|
|
40
|
+
/** Backward-compatible alias; new call sites use `emitMutationResult`. */
|
|
41
|
+
export declare function emitListResult(items: profile.portfolio.PortfolioItem[], format: OutputFormat, successMessage: string): void;
|
|
42
|
+
export { handlePortfolioError };
|
|
43
|
+
//# sourceMappingURL=add.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add.d.ts","sourceRoot":"","sources":["../../../../src/commands/profile/portfolio/add.ts"],"names":[],"mappings":"AAGA,OAAO,EAAc,OAAO,EAAE,MAAM,aAAa,CAAC;AAMlD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAG3D;;;;;GAKG;AACH,wBAAsB,sBAAsB,CAAC,OAAO,EAAE;IACpD,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,MAAM,EAAE,YAAY,CAAC;CACtB,GAAG,OAAO,CAAC,IAAI,CAAC,CAgFhB;AAED;;;;;;GAMG;AACH,iBAAS,oBAAoB,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,GAAE,YAAuB,GAAG,KAAK,CA0BxG;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,OAAO,CAAC,SAAS,CAAC,aAAa,EAAE,EACxC,MAAM,EAAE,YAAY,EACpB,IAAI,EAAE,KAAK,GAAG,QAAQ,GAAG,QAAQ,EACjC,OAAO,EAAE;IAAE,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,GAC7C,IAAI,CAoCN;AAED,0EAA0E;AAC1E,wBAAgB,cAAc,CAC5B,KAAK,EAAE,OAAO,CAAC,SAAS,CAAC,aAAa,EAAE,EACxC,MAAM,EAAE,YAAY,EACpB,cAAc,EAAE,MAAM,GACrB,IAAI,CAEN;AAED,OAAO,EAAE,oBAAoB,EAAE,CAAC"}
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
2
|
+
// Copyright (C) 2026 Oleksii PELYKH
|
|
3
|
+
import { TtctlError, profile } from "@ttctl/core";
|
|
4
|
+
import { presentTtctlError } from "../../../errors.js";
|
|
5
|
+
import { emitAddSuccess, emitErrorAndExit, emitRemoveSuccess, emitUpdateSuccess } from "../../../lib/envelopes.js";
|
|
6
|
+
import { FreeTextError, resolveFreeText } from "../../../lib/freetext.js";
|
|
7
|
+
import { loadAuthTokenOrExit } from "./shared.js";
|
|
8
|
+
/**
|
|
9
|
+
* Action handler for `ttctl profile portfolio add`. Creates a new
|
|
10
|
+
* portfolio item; if `--cover` is supplied, the cover image is uploaded
|
|
11
|
+
* first and its server-issued `coverImageCacheName` is forwarded into
|
|
12
|
+
* the create call so the new item carries the cover from creation.
|
|
13
|
+
*/
|
|
14
|
+
export async function runProfilePortfolioAdd(options) {
|
|
15
|
+
let description;
|
|
16
|
+
try {
|
|
17
|
+
description = await resolveFreeText(options.description, {
|
|
18
|
+
flagName: "description",
|
|
19
|
+
enableEditor: options.edit ?? false,
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
catch (err) {
|
|
23
|
+
if (err instanceof FreeTextError) {
|
|
24
|
+
emitErrorAndExit({
|
|
25
|
+
operation: "profile.portfolio.add",
|
|
26
|
+
format: options.output,
|
|
27
|
+
errors: [{ code: err.code, message: err.message }],
|
|
28
|
+
prettySummary: `portfolio add failed (${err.code}): ${err.message}`,
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
throw err;
|
|
32
|
+
}
|
|
33
|
+
if (options.url !== undefined && options.link !== undefined && options.url !== options.link) {
|
|
34
|
+
emitErrorAndExit({
|
|
35
|
+
operation: "profile.portfolio.add",
|
|
36
|
+
format: options.output,
|
|
37
|
+
errors: [{ code: "VALIDATION_ERROR", message: "--url and --link cannot disagree." }],
|
|
38
|
+
prettySummary: "portfolio add failed (VALIDATION_ERROR): --url and --link cannot disagree.",
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
if (options.industryId === undefined || options.industryId.length === 0) {
|
|
42
|
+
emitErrorAndExit({
|
|
43
|
+
operation: "profile.portfolio.add",
|
|
44
|
+
format: options.output,
|
|
45
|
+
errors: [
|
|
46
|
+
{
|
|
47
|
+
code: "VALIDATION_ERROR",
|
|
48
|
+
message: "--industry-id is required (at least one). " +
|
|
49
|
+
'Discover catalog IDs via `ttctl profile industries autocomplete "<query>"`.',
|
|
50
|
+
},
|
|
51
|
+
],
|
|
52
|
+
prettySummary: "portfolio add failed (VALIDATION_ERROR): --industry-id is required.",
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
const link = options.link ?? options.url;
|
|
56
|
+
const token = await loadAuthTokenOrExit("portfolio add", options.output);
|
|
57
|
+
// Optional cover-image upload BEFORE create. The two calls are sequenced
|
|
58
|
+
// because `createPortfolioItem` needs the server-issued cache name to
|
|
59
|
+
// bind the cover to the new item; uploading is idempotent so a retry on
|
|
60
|
+
// a transient create failure is safe.
|
|
61
|
+
let coverImageCacheName = null;
|
|
62
|
+
if (options.cover !== undefined) {
|
|
63
|
+
try {
|
|
64
|
+
const result = await profile.portfolio.uploadCover(token, { kind: "path", path: options.cover });
|
|
65
|
+
coverImageCacheName = result.coverImageCacheName;
|
|
66
|
+
}
|
|
67
|
+
catch (err) {
|
|
68
|
+
handlePortfolioError("portfolio add", err, options.output);
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
// `options.industryId` is verified non-empty above (emitErrorAndExit
|
|
73
|
+
// short-circuits) — narrow for TypeScript's benefit.
|
|
74
|
+
const industryIds = options.industryId;
|
|
75
|
+
const input = {
|
|
76
|
+
title: options.title,
|
|
77
|
+
industryIds,
|
|
78
|
+
};
|
|
79
|
+
if (description !== undefined)
|
|
80
|
+
input.description = description;
|
|
81
|
+
if (link !== undefined)
|
|
82
|
+
input.link = link;
|
|
83
|
+
if (coverImageCacheName !== null)
|
|
84
|
+
input.coverImage = coverImageCacheName;
|
|
85
|
+
let items;
|
|
86
|
+
try {
|
|
87
|
+
items = await profile.portfolio.add(token, input);
|
|
88
|
+
}
|
|
89
|
+
catch (err) {
|
|
90
|
+
handlePortfolioError("portfolio add", err, options.output);
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
emitMutationResult(items, options.output, "add", { prettyHeader: "Portfolio item created." });
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Route service errors through the envelope ABI (#128). `TtctlError`
|
|
97
|
+
* subclasses keep their dedicated 3-block pretty rendering on `pretty`;
|
|
98
|
+
* `json`/`yaml` flow through the envelope so machine consumers see the
|
|
99
|
+
* stable wire shape. Domain `PortfolioError` codes always flow through
|
|
100
|
+
* the envelope.
|
|
101
|
+
*/
|
|
102
|
+
function handlePortfolioError(commandLabel, err, format = "pretty") {
|
|
103
|
+
if (err instanceof TtctlError) {
|
|
104
|
+
if (format === "pretty")
|
|
105
|
+
presentTtctlError(err);
|
|
106
|
+
const errors = [{ code: err.code, message: err.message, hint: err.recovery }];
|
|
107
|
+
emitErrorAndExit({
|
|
108
|
+
operation: commandLabel.replace(/ /g, "."),
|
|
109
|
+
format,
|
|
110
|
+
errors,
|
|
111
|
+
exitCode: err.code === "CF_403_CLEARANCE" || err.code === "CF_403_PERSISTENT" ? 2 : 1,
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
if (err instanceof profile.portfolio.PortfolioError) {
|
|
115
|
+
emitErrorAndExit({
|
|
116
|
+
operation: commandLabel.replace(/ /g, "."),
|
|
117
|
+
format,
|
|
118
|
+
errors: [{ code: err.code, message: err.message }],
|
|
119
|
+
prettySummary: `${commandLabel} failed (${err.code}): ${err.message}`,
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
123
|
+
emitErrorAndExit({
|
|
124
|
+
operation: commandLabel.replace(/ /g, "."),
|
|
125
|
+
format,
|
|
126
|
+
errors: [{ code: "INTERNAL_ERROR", message }],
|
|
127
|
+
prettySummary: `${commandLabel} failed: ${message}`,
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Emit the post-mutation portfolio list, wrapped in the v0.4 envelope
|
|
132
|
+
* ABI (#128). The portfolio core API returns the FULL post-mutation
|
|
133
|
+
* list rather than the single mutated entity, so the envelope's
|
|
134
|
+
* `created` / `updated` field carries the list (`PortfolioItem[]`)
|
|
135
|
+
* rather than a single `PortfolioItem`. The pretty rendering keeps the
|
|
136
|
+
* existing "success header + table" UX so users continue to see the
|
|
137
|
+
* post-state at a glance.
|
|
138
|
+
*/
|
|
139
|
+
export function emitMutationResult(items, format, verb, options) {
|
|
140
|
+
const rows = items.map((it) => `${it.id}\t${it.title ?? ""}\t${it.highlight ? "★" : ""}\t${it.link ?? ""}`);
|
|
141
|
+
const tableText = ["id\ttitle\thighlight\tlink", ...rows].join("\n");
|
|
142
|
+
if (verb === "remove") {
|
|
143
|
+
const id = options.id;
|
|
144
|
+
if (id === undefined) {
|
|
145
|
+
throw new Error("emitMutationResult: `id` is required for the `remove` verb");
|
|
146
|
+
}
|
|
147
|
+
emitRemoveSuccess({
|
|
148
|
+
operation: "profile.portfolio.remove",
|
|
149
|
+
format,
|
|
150
|
+
id,
|
|
151
|
+
prettySummary: options.prettyHeader,
|
|
152
|
+
});
|
|
153
|
+
if (format === "pretty" && items.length > 0) {
|
|
154
|
+
process.stdout.write(`${tableText}\n`);
|
|
155
|
+
}
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
if (verb === "add") {
|
|
159
|
+
emitAddSuccess({
|
|
160
|
+
operation: "profile.portfolio.add",
|
|
161
|
+
format,
|
|
162
|
+
created: items,
|
|
163
|
+
prettySummary: options.prettyHeader,
|
|
164
|
+
prettyEntity: () => tableText,
|
|
165
|
+
});
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
emitUpdateSuccess({
|
|
169
|
+
operation: "profile.portfolio.update",
|
|
170
|
+
format,
|
|
171
|
+
updated: items,
|
|
172
|
+
prettySummary: options.prettyHeader,
|
|
173
|
+
prettyEntity: () => tableText,
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
/** Backward-compatible alias; new call sites use `emitMutationResult`. */
|
|
177
|
+
export function emitListResult(items, format, successMessage) {
|
|
178
|
+
emitMutationResult(items, format, "update", { prettyHeader: successMessage });
|
|
179
|
+
}
|
|
180
|
+
export { handlePortfolioError };
|
|
181
|
+
//# sourceMappingURL=add.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add.js","sourceRoot":"","sources":["../../../../src/commands/profile/portfolio/add.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,oCAAoC;AAEpC,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAElD,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAEnH,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAE1E,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAElD;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAAC,OAS5C;IACC,IAAI,WAA+B,CAAC;IACpC,IAAI,CAAC;QACH,WAAW,GAAG,MAAM,eAAe,CAAC,OAAO,CAAC,WAAW,EAAE;YACvD,QAAQ,EAAE,aAAa;YACvB,YAA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AK,CAAC,GAAG,SAAS,IAAI,CAAC,CAAC;QACzC,CAAC;QACD,OAAO;IACT,CAAC;IACD,IAAI,IAAI,KAAK,KAAK,EAAE,CAAC;QACnB,cAAc,CAAC;YACb,SAAS,EAAE,uBAAuB;YAClC,MAAM;YACN,OAAO,EAAE,KAAK;YACd,aAAa,EAAE,OAAO,CAAC,YAAY;YACnC,YAAY,EAAE,GAAG,EAAE,CAAC,SAAS;SAC9B,CAAC,CAAC;QACH,OAAO;IACT,CAAC;IACD,iBAAiB,CAAC;QAChB,SAAS,EAAE,0BAA0B;QACrC,MAAM;QACN,OAAO,EAAE,KAAK;QACd,aAAa,EAAE,OAAO,CAAC,YAAY;QACnC,YAAY,EAAE,GAAG,EAAE,CAAC,SAAS;KAC9B,CAAC,CAAC;AACL,CAAC;AAED,0EAA0E;AAC1E,MAAM,UAAU,cAAc,CAC5B,KAAwC,EACxC,MAAoB,EACpB,cAAsB;IAEtB,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,YAAY,EAAE,cAAc,EAAE,CAAC,CAAC;AAChF,CAAC;AAED,OAAO,EAAE,oBAAoB,EAAE,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { OutputFormat } from "../../../lib/output.js";
|
|
2
|
+
/**
|
|
3
|
+
* Action handler for `ttctl profile portfolio highlight <id>`. Sets the
|
|
4
|
+
* `highlight` flag on the named item. Pass `--off` to clear instead of
|
|
5
|
+
* set. Emits the v0.4 update envelope (#128).
|
|
6
|
+
*/
|
|
7
|
+
export declare function runProfilePortfolioHighlight(id: string, options: {
|
|
8
|
+
off?: boolean;
|
|
9
|
+
output: OutputFormat;
|
|
10
|
+
}): Promise<void>;
|
|
11
|
+
//# sourceMappingURL=highlight.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"highlight.d.ts","sourceRoot":"","sources":["../../../../src/commands/profile/portfolio/highlight.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAI3D;;;;GAIG;AACH,wBAAsB,4BAA4B,CAChD,EAAE,EAAE,MAAM,EACV,OAAO,EAAE;IAAE,GAAG,CAAC,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,YAAY,CAAA;CAAE,GAC/C,OAAO,CAAC,IAAI,CAAC,CAmBf"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
2
|
+
// Copyright (C) 2026 Oleksii PELYKH
|
|
3
|
+
import { profile } from "@ttctl/core";
|
|
4
|
+
import { emitUpdateSuccess } from "../../../lib/envelopes.js";
|
|
5
|
+
import { handlePortfolioError } from "./add.js";
|
|
6
|
+
import { loadAuthTokenOrExit } from "./shared.js";
|
|
7
|
+
/**
|
|
8
|
+
* Action handler for `ttctl profile portfolio highlight <id>`. Sets the
|
|
9
|
+
* `highlight` flag on the named item. Pass `--off` to clear instead of
|
|
10
|
+
* set. Emits the v0.4 update envelope (#128).
|
|
11
|
+
*/
|
|
12
|
+
export async function runProfilePortfolioHighlight(id, options) {
|
|
13
|
+
const flag = !(options.off ?? false);
|
|
14
|
+
const token = await loadAuthTokenOrExit("portfolio highlight", options.output);
|
|
15
|
+
let result;
|
|
16
|
+
try {
|
|
17
|
+
result = await profile.portfolio.highlight(token, id, flag);
|
|
18
|
+
}
|
|
19
|
+
catch (err) {
|
|
20
|
+
handlePortfolioError("portfolio highlight", err, options.output);
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
emitUpdateSuccess({
|
|
24
|
+
operation: "profile.portfolio.highlight",
|
|
25
|
+
format: options.output,
|
|
26
|
+
updated: result,
|
|
27
|
+
prettySummary: `${result.id} highlight ${result.highlight ? "enabled" : "cleared"}`,
|
|
28
|
+
prettyEntity: (entity) => `highlight: ${entity.highlight.toString()}`,
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=highlight.js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L,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Command } from "commander";
|
|
2
|
+
/**
|
|
3
|
+
* Build the `ttctl profile portfolio` command tree.
|
|
4
|
+
*
|
|
5
|
+
* The canonical sub-domain name is `portfolio`; the CLI registers
|
|
6
|
+
* `projects` as a Commander.js alias so users can type either form. Per
|
|
7
|
+
* project policy (see issue #72), aliases are CLI-only — MCP tool names
|
|
8
|
+
* use ONLY the canonical name.
|
|
9
|
+
*
|
|
10
|
+
* The seven leaves follow the verb economy from the #68 epic:
|
|
11
|
+
* `add / update / remove / list / reorder / highlight / upload`. The
|
|
12
|
+
* `update` verb name is the user-facing CLI form; the core function is
|
|
13
|
+
* `update()` (no rename — verbs match between CLI and core for portfolio).
|
|
14
|
+
*/
|
|
15
|
+
export declare function buildProfilePortfolioCommand(): Command;
|
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/profile/portfolio/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAU,MAAM,WAAW,CAAC;AAY5C;;;;;;;;;;;;GAYG;AACH,wBAAgB,4BAA4B,IAAI,OAAO,CA0JtD"}
|