@ttctl/cli 0.0.0 → 0.1.0-rc.1
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 +31 -0
- package/dist/commands/profile/certifications/index.d.ts.map +1 -0
- package/dist/commands/profile/certifications/index.js +298 -0
- package/dist/commands/profile/certifications/index.js.map +1 -0
- package/dist/commands/profile/education/index.d.ts +28 -0
- package/dist/commands/profile/education/index.d.ts.map +1 -0
- package/dist/commands/profile/education/index.js +287 -0
- package/dist/commands/profile/education/index.js.map +1 -0
- package/dist/commands/profile/employment/index.d.ts +40 -0
- package/dist/commands/profile/employment/index.d.ts.map +1 -0
- package/dist/commands/profile/employment/index.js +364 -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 +20 -0
- package/dist/commands/profile/external/index.d.ts.map +1 -0
- package/dist/commands/profile/external/index.js +102 -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/update.d.ts +32 -0
- package/dist/commands/profile/external/update.d.ts.map +1 -0
- package/dist/commands/profile/external/update.js +118 -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 +36 -0
- package/dist/commands/profile/industries/index.d.ts.map +1 -0
- package/dist/commands/profile/industries/index.js +230 -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,124 @@
|
|
|
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 { runAllocatedHoursSet, runAllocatedHoursShow } from "./allocated-hours.js";
|
|
7
|
+
import { runAvailabilityShow } from "./show.js";
|
|
8
|
+
import { runWorkingHoursSet, runWorkingHoursShow } from "./working-hours.js";
|
|
9
|
+
/**
|
|
10
|
+
* Build the `ttctl availability` command tree (#146 amended spec). Five
|
|
11
|
+
* leaves across the top-level group and two nested sub-groups
|
|
12
|
+
* (`working-hours`, `allocated-hours`):
|
|
13
|
+
*
|
|
14
|
+
* | Leaf | Description |
|
|
15
|
+
* |-------------------------------------|------------------------------------------|
|
|
16
|
+
* | `show` | Full availability snapshot |
|
|
17
|
+
* | `working-hours show` | Just the time-zone + daily window subset |
|
|
18
|
+
* | `working-hours set [--start/--end/--time-zone/--flex-start/--flex-end]` | Partial-update working hours |
|
|
19
|
+
* | `allocated-hours show` | Just the allocated-hours value |
|
|
20
|
+
* | `allocated-hours set --hours <n>` | Set allocated-hours |
|
|
21
|
+
*
|
|
22
|
+
* **Vocabulary note**: per-engagement "time off" is owned by
|
|
23
|
+
* `ttctl engagements breaks {list, add, remove}` — there is no parallel
|
|
24
|
+
* `ttctl availability time-off` surface (the underlying API would be
|
|
25
|
+
* identical to the engagement-break one). Booking-page "lead time" /
|
|
26
|
+
* "minimum scheduling notice" is a different surface and is not
|
|
27
|
+
* surfaced in v1.
|
|
28
|
+
*
|
|
29
|
+
* **Out of scope for v1** (per #146 amended spec from 2026-05-11):
|
|
30
|
+
* - Time-off list/add/remove (use `engagements breaks` instead)
|
|
31
|
+
* - Lead-time / minimum-scheduling-notice setting (booking-page
|
|
32
|
+
* follow-up)
|
|
33
|
+
* - Setting `meetingTimeFrom` / `meetingTimeTo` (read-only)
|
|
34
|
+
* - Per-engagement availability overrides (no API support)
|
|
35
|
+
*/
|
|
36
|
+
export function buildAvailabilityCommand() {
|
|
37
|
+
const cmd = new Command("availability").description("View and manage availability: time zone, working hours, allocated hours");
|
|
38
|
+
cmd
|
|
39
|
+
.command("show")
|
|
40
|
+
.description("Show full availability snapshot")
|
|
41
|
+
.addOption(new Option("-o, --output <format>", "output format")
|
|
42
|
+
.choices(OUTPUT_FORMATS)
|
|
43
|
+
.default("pretty"))
|
|
44
|
+
.action(async (options) => {
|
|
45
|
+
await runAvailabilityShow(options.output);
|
|
46
|
+
});
|
|
47
|
+
// ----- working-hours sub-group ---------------------------------------
|
|
48
|
+
const workingHours = cmd
|
|
49
|
+
.command("working-hours")
|
|
50
|
+
.description("Manage daily working hours, time zone, and flexible shift range");
|
|
51
|
+
workingHours
|
|
52
|
+
.command("show")
|
|
53
|
+
.description("Show the working-hours subset")
|
|
54
|
+
.addOption(new Option("-o, --output <format>", "output format")
|
|
55
|
+
.choices(OUTPUT_FORMATS)
|
|
56
|
+
.default("pretty"))
|
|
57
|
+
.action(async (options) => {
|
|
58
|
+
await runWorkingHoursShow(options.output);
|
|
59
|
+
});
|
|
60
|
+
// Marked as a mutation (issue #164) so the global `--dry-run` flag
|
|
61
|
+
// routes through to `availability.workingHours.set()`'s `dryRun` option.
|
|
62
|
+
markMutation(workingHours
|
|
63
|
+
.command("set")
|
|
64
|
+
.description("Update working hours (at least one of the options below)")
|
|
65
|
+
.option("--start <HH:MM:SS>", "daily working-hours window start")
|
|
66
|
+
.option("--end <HH:MM:SS>", "daily working-hours window end")
|
|
67
|
+
.option("--time-zone <IANA>", "IANA time-zone identifier (e.g., Europe/Berlin)")
|
|
68
|
+
.option("--flex-start <HH:MM:SS>", "flexible shift-range start")
|
|
69
|
+
.option("--flex-end <HH:MM:SS>", "flexible shift-range end")
|
|
70
|
+
.addOption(new Option("-o, --output <format>", "output format")
|
|
71
|
+
.choices(OUTPUT_FORMATS)
|
|
72
|
+
.default("pretty"))
|
|
73
|
+
.action(async (options) => {
|
|
74
|
+
const setOpts = { output: options.output };
|
|
75
|
+
if (options.start !== undefined)
|
|
76
|
+
setOpts.start = options.start;
|
|
77
|
+
if (options.end !== undefined)
|
|
78
|
+
setOpts.end = options.end;
|
|
79
|
+
if (options.timeZone !== undefined)
|
|
80
|
+
setOpts.timeZone = options.timeZone;
|
|
81
|
+
if (options.flexStart !== undefined)
|
|
82
|
+
setOpts.flexStart = options.flexStart;
|
|
83
|
+
if (options.flexEnd !== undefined)
|
|
84
|
+
setOpts.flexEnd = options.flexEnd;
|
|
85
|
+
await runWorkingHoursSet(setOpts);
|
|
86
|
+
}));
|
|
87
|
+
// ----- allocated-hours sub-group -------------------------------------
|
|
88
|
+
const allocatedHours = cmd.command("allocated-hours").description("Manage viewer-scoped allocated hours per week");
|
|
89
|
+
allocatedHours
|
|
90
|
+
.command("show")
|
|
91
|
+
.description("Show the current allocated hours")
|
|
92
|
+
.addOption(new Option("-o, --output <format>", "output format")
|
|
93
|
+
.choices(OUTPUT_FORMATS)
|
|
94
|
+
.default("pretty"))
|
|
95
|
+
.action(async (options) => {
|
|
96
|
+
await runAllocatedHoursShow(options.output);
|
|
97
|
+
});
|
|
98
|
+
// Marked as a mutation (issue #164) so the global `--dry-run` flag
|
|
99
|
+
// routes through to `availability.allocatedHours.set()`'s `dryRun` option.
|
|
100
|
+
markMutation(allocatedHours
|
|
101
|
+
.command("set")
|
|
102
|
+
.description("Set allocated hours (non-negative integer; portal caps at 80)")
|
|
103
|
+
.requiredOption("--hours <n>", "hours per week (non-negative integer)", parseHoursArg)
|
|
104
|
+
.addOption(new Option("-o, --output <format>", "output format")
|
|
105
|
+
.choices(OUTPUT_FORMATS)
|
|
106
|
+
.default("pretty"))
|
|
107
|
+
.action(async (options) => {
|
|
108
|
+
await runAllocatedHoursSet({ hours: options.hours, output: options.output });
|
|
109
|
+
}));
|
|
110
|
+
return cmd;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Parse a `--hours` argument as a non-negative integer. Rejects
|
|
114
|
+
* floating-point / negative / non-numeric / empty values at parse time
|
|
115
|
+
* so the handler receives a validated `number`.
|
|
116
|
+
*/
|
|
117
|
+
function parseHoursArg(value) {
|
|
118
|
+
const trimmed = value.trim();
|
|
119
|
+
if (!/^\d+$/.test(trimmed)) {
|
|
120
|
+
throw new InvalidArgumentError("--hours must be a non-negative integer (no decimals, no sign)");
|
|
121
|
+
}
|
|
122
|
+
return Number.parseInt(trimmed, 10);
|
|
123
|
+
}
|
|
124
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/availability/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,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AACnF,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAEhD,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAE7E;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,UAAU,wBAAwB;IACtC,MAAM,GAAG,GAAG,IAAI,OAAO,CAAC,cAAc,CAAC,CAAC,WAAW,CACjD,yEAAyE,CAC1E,CAAC;IAEF,GAAG;SACA,OAAO,CAAC,MAAM,CAAC;SACf,WAAW,CAAC,iCAAiC,CAAC;SAC9C,SAAS,CACR,IAAI,MAAM,CAAC,uBAAuB,EAAE,eAAe,CAAC;SACjD,OAAO,CAAC,cAAc,CAAC;SACvB,OAAO,CAAC,QAA+B,CAAC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AO,CAAC,QAA+B,CAAC,CAC5C;SACA,MAAM,CAAC,KAAK,EAAE,OAAgD,EAAE,EAAE;QACjE,MAAM,oBAAoB,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IAC/E,CAAC,CAAC,CACL,CAAC;IAEF,OAAO,GAAG,CAAC;AACb,CAAC;AAED;;;;GAIG;AACH,SAAS,aAAa,CAAC,KAAa;IAClC,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IAC7B,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;QAC3B,MAAM,IAAI,oBAAoB,CAAC,+DAA+D,CAAC,CAAC;IAClG,CAAC;IACD,OAAO,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;AACtC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
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
|
+
* `availability.AvailabilityError` and {@link hintForAvailabilityCode}.
|
|
6
|
+
* The router applies the envelope ABI (#128) branching uniformly across
|
|
7
|
+
* sub-domains; the hint adapter is invoked on the domain-error branch
|
|
8
|
+
* to surface a per-code recovery suggestion when one is available.
|
|
9
|
+
*/
|
|
10
|
+
export declare function handleAvailabilityError(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/availability/shared.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAE3D;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,GAAE,YAAuB,GAAG,KAAK,CAElH"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
2
|
+
// Copyright (C) 2026 Oleksii PELYKH
|
|
3
|
+
import { availability } 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
|
+
* `availability.AvailabilityError` and {@link hintForAvailabilityCode}.
|
|
9
|
+
* The router applies the envelope ABI (#128) branching uniformly across
|
|
10
|
+
* sub-domains; the hint adapter is invoked on the domain-error branch
|
|
11
|
+
* to surface a per-code recovery suggestion when one is available.
|
|
12
|
+
*/
|
|
13
|
+
export function handleAvailabilityError(commandLabel, err, format = "pretty") {
|
|
14
|
+
handleDomainError(commandLabel, err, availability.AvailabilityError, format, hintForAvailabilityCode);
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Per-code recovery hints. Not every code carries one — only the ones
|
|
18
|
+
* where a concrete next step is clearly actionable for the user.
|
|
19
|
+
*/
|
|
20
|
+
function hintForAvailabilityCode(code) {
|
|
21
|
+
switch (code) {
|
|
22
|
+
case "NO_VIEWER_ROLE":
|
|
23
|
+
return "Sign in as a Toptal Talent (the availability surface is talent-side).";
|
|
24
|
+
case "MUTATION_ERROR":
|
|
25
|
+
return "The mutation was rejected by the server (often: malformed time string, unknown time-zone identifier, or out-of-range allocated hours). Check the message above.";
|
|
26
|
+
default:
|
|
27
|
+
return undefined;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=shared.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.js","sourceRoot":"","sources":["../../../src/commands/availability/shared.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,oCAAoC;AAEpC,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAG/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAE3D;;;;;;GAMG;AACH,MAAM,UAAU,uBAAuB,CAAC,YAAoB,EAAE,GAAY,EAAE,SAAuB,QAAQ;IACzG,iBAAiB,CAAC,YAAY,EAAE,GAAG,EAAE,YAAY,CAAC,iBAAiB,EAAE,MAAM,EAAE,uBAAuB,CAAC,CAAC;AACxG,CAAC;AAED;;;GAGG;AACH,SAAS,uBAAuB,CAAC,IAAwC;IACvE,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,gBAAgB;YACnB,OAAO,uEAAuE,CAAC;QACjF,KAAK,gBAAgB;YACnB,OAAO,iKAAiK,CAAC;QAC3K;YACE,OAAO,SAAS,CAAC;IACrB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { availability } from "@ttctl/core";
|
|
2
|
+
import type { OutputFormat } from "../../lib/output.js";
|
|
3
|
+
/**
|
|
4
|
+
* Action handler for `ttctl availability show`. Reads the full
|
|
5
|
+
* availability snapshot — time zone, working hours, flexible shift
|
|
6
|
+
* range, and allocated hours.
|
|
7
|
+
*
|
|
8
|
+
* Pretty rendering groups the snapshot into a sectioned multi-line
|
|
9
|
+
* block. `json` / `yaml` emit the full server payload.
|
|
10
|
+
*
|
|
11
|
+
* **What this does NOT show** (out of scope per #146 amended spec):
|
|
12
|
+
* - Per-engagement time-off / engagement breaks (see
|
|
13
|
+
* `ttctl engagements breaks list <id>`).
|
|
14
|
+
* - Booking-page lead-time / "minimum scheduling notice" (different
|
|
15
|
+
* surface; follow-up issue).
|
|
16
|
+
*/
|
|
17
|
+
export declare function runAvailabilityShow(output: OutputFormat): Promise<void>;
|
|
18
|
+
/**
|
|
19
|
+
* Render the full availability snapshot as a sectioned multi-line
|
|
20
|
+
* block. Pure — directly unit-testable.
|
|
21
|
+
*
|
|
22
|
+
* Sections:
|
|
23
|
+
* 1. Identity (viewer id)
|
|
24
|
+
* 2. Time zone (name / IANA value / offsets)
|
|
25
|
+
* 3. Working hours (workingTimeFrom/To)
|
|
26
|
+
* 4. Flexible shift range (availableShiftRangeFrom/To)
|
|
27
|
+
* 5. Allocated hours
|
|
28
|
+
*
|
|
29
|
+
* Sections whose fields are all null/empty are omitted.
|
|
30
|
+
*/
|
|
31
|
+
export declare function formatAvailabilitySnapshot(snap: availability.AvailabilitySnapshot): string;
|
|
32
|
+
//# sourceMappingURL=show.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"show.d.ts","sourceRoot":"","sources":["../../../src/commands/availability/show.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAG3C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAGxD;;;;;;;;;;;;;GAaG;AACH,wBAAsB,mBAAmB,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAa7E;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,YAAY,CAAC,oBAAoB,GAAG,MAAM,CAyC1F"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
2
|
+
// Copyright (C) 2026 Oleksii PELYKH
|
|
3
|
+
import { availability } from "@ttctl/core";
|
|
4
|
+
import { emitResult } from "../../lib/output.js";
|
|
5
|
+
import { handleAvailabilityError, loadAuthTokenOrExit } from "./shared.js";
|
|
6
|
+
/**
|
|
7
|
+
* Action handler for `ttctl availability show`. Reads the full
|
|
8
|
+
* availability snapshot — time zone, working hours, flexible shift
|
|
9
|
+
* range, and allocated hours.
|
|
10
|
+
*
|
|
11
|
+
* Pretty rendering groups the snapshot into a sectioned multi-line
|
|
12
|
+
* block. `json` / `yaml` emit the full server payload.
|
|
13
|
+
*
|
|
14
|
+
* **What this does NOT show** (out of scope per #146 amended spec):
|
|
15
|
+
* - Per-engagement time-off / engagement breaks (see
|
|
16
|
+
* `ttctl engagements breaks list <id>`).
|
|
17
|
+
* - Booking-page lead-time / "minimum scheduling notice" (different
|
|
18
|
+
* surface; follow-up issue).
|
|
19
|
+
*/
|
|
20
|
+
export async function runAvailabilityShow(output) {
|
|
21
|
+
const token = await loadAuthTokenOrExit("availability show", output);
|
|
22
|
+
let snap;
|
|
23
|
+
try {
|
|
24
|
+
snap = await availability.show(token);
|
|
25
|
+
}
|
|
26
|
+
catch (err) {
|
|
27
|
+
handleAvailabilityError("availability show", err, output);
|
|
28
|
+
}
|
|
29
|
+
emitResult(snap, output, {
|
|
30
|
+
pretty: (data) => formatAvailabilitySnapshot(data),
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Render the full availability snapshot as a sectioned multi-line
|
|
35
|
+
* block. Pure — directly unit-testable.
|
|
36
|
+
*
|
|
37
|
+
* Sections:
|
|
38
|
+
* 1. Identity (viewer id)
|
|
39
|
+
* 2. Time zone (name / IANA value / offsets)
|
|
40
|
+
* 3. Working hours (workingTimeFrom/To)
|
|
41
|
+
* 4. Flexible shift range (availableShiftRangeFrom/To)
|
|
42
|
+
* 5. Allocated hours
|
|
43
|
+
*
|
|
44
|
+
* Sections whose fields are all null/empty are omitted.
|
|
45
|
+
*/
|
|
46
|
+
export function formatAvailabilitySnapshot(snap) {
|
|
47
|
+
const lines = [];
|
|
48
|
+
lines.push(`Availability (viewer ${snap.viewerId})`);
|
|
49
|
+
if (snap.timeZone !== null) {
|
|
50
|
+
lines.push("");
|
|
51
|
+
lines.push("Time zone");
|
|
52
|
+
const tz = snap.timeZone;
|
|
53
|
+
lines.push(` IANA: ${tz.value}`);
|
|
54
|
+
if (tz.name !== null && tz.name !== "")
|
|
55
|
+
lines.push(` Name: ${tz.name}`);
|
|
56
|
+
if (tz.location !== null && tz.location !== "")
|
|
57
|
+
lines.push(` Location: ${tz.location}`);
|
|
58
|
+
if (tz.utcOffset !== null && tz.utcOffset !== "")
|
|
59
|
+
lines.push(` UTC offset: ${tz.utcOffset}`);
|
|
60
|
+
if (tz.stdOffset !== null && tz.stdOffset !== "" && tz.stdOffset !== tz.utcOffset) {
|
|
61
|
+
lines.push(` Standard offset: ${tz.stdOffset}`);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
if (snap.workingTimeFrom !== null || snap.workingTimeTo !== null) {
|
|
65
|
+
lines.push("");
|
|
66
|
+
lines.push("Working hours");
|
|
67
|
+
lines.push(` From: ${snap.workingTimeFrom ?? "—"}`);
|
|
68
|
+
lines.push(` To: ${snap.workingTimeTo ?? "—"}`);
|
|
69
|
+
}
|
|
70
|
+
if (snap.availableShiftRangeFrom !== null || snap.availableShiftRangeTo !== null) {
|
|
71
|
+
lines.push("");
|
|
72
|
+
lines.push("Flexible shift range");
|
|
73
|
+
lines.push(` From: ${snap.availableShiftRangeFrom ?? "—"}`);
|
|
74
|
+
lines.push(` To: ${snap.availableShiftRangeTo ?? "—"}`);
|
|
75
|
+
}
|
|
76
|
+
lines.push("");
|
|
77
|
+
lines.push("Allocated hours");
|
|
78
|
+
if (snap.allocatedHours === null) {
|
|
79
|
+
lines.push(" (unset)");
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
lines.push(` ${snap.allocatedHours.toString()} h/week`);
|
|
83
|
+
}
|
|
84
|
+
return lines.join("\n");
|
|
85
|
+
}
|
|
86
|
+
//# sourceMappingURL=show.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"show.js","sourceRoot":"","sources":["../../../src/commands/availability/show.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,oCAAoC;AAEpC,OAAO,EAAE,YAAY,EAAE,M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CAAC,IAAI,CAAC,WAAW,IAAI,CAAC,qBAAqB,IAAI,GAAG,EAAE,CAAC,CAAC;IAC7D,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACf,KAAK,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;IAC9B,IAAI,IAAI,CAAC,cAAc,KAAK,IAAI,EAAE,CAAC;QACjC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAC1B,CAAC;SAAM,CAAC;QACN,KAAK,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;IAC3D,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { availability } from "@ttctl/core";
|
|
2
|
+
import type { OutputFormat } from "../../lib/output.js";
|
|
3
|
+
/**
|
|
4
|
+
* Action handler for `ttctl availability working-hours show`. Reads
|
|
5
|
+
* just the working-hours subset of the availability snapshot — time
|
|
6
|
+
* zone + daily working window + flexible shift range. Drops the
|
|
7
|
+
* `allocatedHours` field (separately surfaced under `allocated-hours`).
|
|
8
|
+
*/
|
|
9
|
+
export declare function runWorkingHoursShow(output: OutputFormat): Promise<void>;
|
|
10
|
+
type WorkingHoursShow = Awaited<ReturnType<typeof availability.workingHours.show>>;
|
|
11
|
+
/**
|
|
12
|
+
* Render the working-hours subset as a sectioned multi-line block.
|
|
13
|
+
* Pure — directly unit-testable.
|
|
14
|
+
*/
|
|
15
|
+
export declare function formatWorkingHoursShow(data: WorkingHoursShow): string;
|
|
16
|
+
/**
|
|
17
|
+
* Options for `ttctl availability working-hours set`. All time fields
|
|
18
|
+
* are `"HH:MM:SS"` strings (the wire format the platform expects);
|
|
19
|
+
* `--time-zone` is an IANA zone identifier. At least one option must
|
|
20
|
+
* be provided — the action handler rejects an empty change set
|
|
21
|
+
* pre-flight.
|
|
22
|
+
*/
|
|
23
|
+
export interface WorkingHoursSetOptions {
|
|
24
|
+
start?: string;
|
|
25
|
+
end?: string;
|
|
26
|
+
timeZone?: string;
|
|
27
|
+
flexStart?: string;
|
|
28
|
+
flexEnd?: string;
|
|
29
|
+
output: OutputFormat;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Action handler for `ttctl availability working-hours set`. Updates
|
|
33
|
+
* any subset of (time-zone, daily window, flexible range) via the
|
|
34
|
+
* `UpdateWorkingHours` mutation.
|
|
35
|
+
*
|
|
36
|
+
* Validates each time string against `HH:MM:SS` (the wire format the
|
|
37
|
+
* platform expects). Pre-flight validation throws
|
|
38
|
+
* `AvailabilityError("MUTATION_ERROR")` BEFORE the mutation goes out
|
|
39
|
+
* — fail-fast instead of relying on the server to return
|
|
40
|
+
* `MUTATION_ERROR`.
|
|
41
|
+
*/
|
|
42
|
+
export declare function runWorkingHoursSet(opts: WorkingHoursSetOptions): Promise<void>;
|
|
43
|
+
type WorkingHoursSetResult = Extract<availability.WorkingHoursSetOutcome, {
|
|
44
|
+
kind: "applied";
|
|
45
|
+
}>["result"];
|
|
46
|
+
/**
|
|
47
|
+
* Render the post-update working-hours payload as the indented entity
|
|
48
|
+
* preview inside the success-update envelope's pretty block. Pure —
|
|
49
|
+
* directly unit-testable.
|
|
50
|
+
*/
|
|
51
|
+
export declare function formatWorkingHoursSet(result: WorkingHoursSetResult): string;
|
|
52
|
+
export {};
|
|
53
|
+
//# sourceMappingURL=working-hours.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"working-hours.d.ts","sourceRoot":"","sources":["../../../src/commands/availability/working-hours.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAI3C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAIxD;;;;;GAKG;AACH,wBAAsB,mBAAmB,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAa7E;AAED,KAAK,gBAAgB,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,YAAY,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC;AAEnF;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,gBAAgB,GAAG,MAAM,CAyBrE;AAED;;;;;;GAMG;AACH,MAAM,WAAW,sBAAsB;IACrC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,YAAY,CAAC;CACtB;AAID;;;;;;;;;;GAUG;AACH,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC,CAsEpF;AAED,KAAK,qBAAqB,GAAG,OAAO,CAAC,YAAY,CAAC,sBAAsB,EAAE;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,CAAC,CAAC,QAAQ,CAAC,CAAC;AAEzG;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,qBAAqB,GAAG,MAAM,CAU3E"}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
2
|
+
// Copyright (C) 2026 Oleksii PELYKH
|
|
3
|
+
import { availability } from "@ttctl/core";
|
|
4
|
+
import { getCliDryRun } from "../../lib/dry-run.js";
|
|
5
|
+
import { emitResult } from "../../lib/output.js";
|
|
6
|
+
import { emitDryRunSuccess, emitUpdateSuccess } from "../../lib/envelopes.js";
|
|
7
|
+
import { handleAvailabilityError, loadAuthTokenOrExit } from "./shared.js";
|
|
8
|
+
/**
|
|
9
|
+
* Action handler for `ttctl availability working-hours show`. Reads
|
|
10
|
+
* just the working-hours subset of the availability snapshot — time
|
|
11
|
+
* zone + daily working window + flexible shift range. Drops the
|
|
12
|
+
* `allocatedHours` field (separately surfaced under `allocated-hours`).
|
|
13
|
+
*/
|
|
14
|
+
export async function runWorkingHoursShow(output) {
|
|
15
|
+
const token = await loadAuthTokenOrExit("availability working-hours show", output);
|
|
16
|
+
let snap;
|
|
17
|
+
try {
|
|
18
|
+
snap = await availability.workingHours.show(token);
|
|
19
|
+
}
|
|
20
|
+
catch (err) {
|
|
21
|
+
handleAvailabilityError("availability working-hours show", err, output);
|
|
22
|
+
}
|
|
23
|
+
emitResult(snap, output, {
|
|
24
|
+
pretty: (data) => formatWorkingHoursShow(data),
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Render the working-hours subset as a sectioned multi-line block.
|
|
29
|
+
* Pure — directly unit-testable.
|
|
30
|
+
*/
|
|
31
|
+
export function formatWorkingHoursShow(data) {
|
|
32
|
+
const lines = [`Working hours (viewer ${data.viewerId})`];
|
|
33
|
+
if (data.timeZone !== null) {
|
|
34
|
+
const tz = data.timeZone;
|
|
35
|
+
lines.push("");
|
|
36
|
+
lines.push("Time zone");
|
|
37
|
+
lines.push(` IANA: ${tz.value}`);
|
|
38
|
+
if (tz.name !== null && tz.name !== "")
|
|
39
|
+
lines.push(` Name: ${tz.name}`);
|
|
40
|
+
if (tz.utcOffset !== null && tz.utcOffset !== "")
|
|
41
|
+
lines.push(` UTC offset: ${tz.utcOffset}`);
|
|
42
|
+
}
|
|
43
|
+
lines.push("");
|
|
44
|
+
lines.push("Daily window");
|
|
45
|
+
lines.push(` From: ${data.workingTimeFrom ?? "—"}`);
|
|
46
|
+
lines.push(` To: ${data.workingTimeTo ?? "—"}`);
|
|
47
|
+
if (data.availableShiftRangeFrom !== null || data.availableShiftRangeTo !== null) {
|
|
48
|
+
lines.push("");
|
|
49
|
+
lines.push("Flexible shift range");
|
|
50
|
+
lines.push(` From: ${data.availableShiftRangeFrom ?? "—"}`);
|
|
51
|
+
lines.push(` To: ${data.availableShiftRangeTo ?? "—"}`);
|
|
52
|
+
}
|
|
53
|
+
return lines.join("\n");
|
|
54
|
+
}
|
|
55
|
+
const HHMMSS_PATTERN = /^([01]\d|2[0-3]):[0-5]\d:[0-5]\d$/;
|
|
56
|
+
/**
|
|
57
|
+
* Action handler for `ttctl availability working-hours set`. Updates
|
|
58
|
+
* any subset of (time-zone, daily window, flexible range) via the
|
|
59
|
+
* `UpdateWorkingHours` mutation.
|
|
60
|
+
*
|
|
61
|
+
* Validates each time string against `HH:MM:SS` (the wire format the
|
|
62
|
+
* platform expects). Pre-flight validation throws
|
|
63
|
+
* `AvailabilityError("MUTATION_ERROR")` BEFORE the mutation goes out
|
|
64
|
+
* — fail-fast instead of relying on the server to return
|
|
65
|
+
* `MUTATION_ERROR`.
|
|
66
|
+
*/
|
|
67
|
+
export async function runWorkingHoursSet(opts) {
|
|
68
|
+
const token = await loadAuthTokenOrExit("availability working-hours set", opts.output);
|
|
69
|
+
const dryRun = getCliDryRun();
|
|
70
|
+
const input = {};
|
|
71
|
+
try {
|
|
72
|
+
if (opts.start !== undefined) {
|
|
73
|
+
assertHHMMSS("--start", opts.start);
|
|
74
|
+
input.workingTimeFrom = opts.start;
|
|
75
|
+
}
|
|
76
|
+
if (opts.end !== undefined) {
|
|
77
|
+
assertHHMMSS("--end", opts.end);
|
|
78
|
+
input.workingTimeTo = opts.end;
|
|
79
|
+
}
|
|
80
|
+
if (opts.timeZone !== undefined) {
|
|
81
|
+
input.timeZone = opts.timeZone;
|
|
82
|
+
}
|
|
83
|
+
if (opts.flexStart !== undefined) {
|
|
84
|
+
assertHHMMSS("--flex-start", opts.flexStart);
|
|
85
|
+
input.availableShiftRangeFrom = opts.flexStart;
|
|
86
|
+
}
|
|
87
|
+
if (opts.flexEnd !== undefined) {
|
|
88
|
+
assertHHMMSS("--flex-end", opts.flexEnd);
|
|
89
|
+
input.availableShiftRangeTo = opts.flexEnd;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
catch (err) {
|
|
93
|
+
handleAvailabilityError("availability working-hours set", err, opts.output);
|
|
94
|
+
}
|
|
95
|
+
if (Object.keys(input).length === 0) {
|
|
96
|
+
handleAvailabilityError("availability working-hours set", new availability.AvailabilityError("MUTATION_ERROR", "No change supplied — pass at least one of --start, --end, --time-zone, --flex-start, --flex-end."), opts.output);
|
|
97
|
+
}
|
|
98
|
+
let outcome;
|
|
99
|
+
try {
|
|
100
|
+
outcome = await availability.workingHours.set(token, input, { dryRun });
|
|
101
|
+
}
|
|
102
|
+
catch (err) {
|
|
103
|
+
handleAvailabilityError("availability working-hours set", err, opts.output);
|
|
104
|
+
}
|
|
105
|
+
if (outcome.kind === "preview") {
|
|
106
|
+
emitDryRunSuccess({
|
|
107
|
+
operation: "availability.working-hours.set",
|
|
108
|
+
format: opts.output,
|
|
109
|
+
preview: outcome.preview,
|
|
110
|
+
});
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
const updated = outcome.result;
|
|
114
|
+
const summaryParts = [];
|
|
115
|
+
if (updated.timeZone !== null)
|
|
116
|
+
summaryParts.push(`tz=${updated.timeZone.value}`);
|
|
117
|
+
if (updated.workingTimeFrom !== null)
|
|
118
|
+
summaryParts.push(`from=${updated.workingTimeFrom}`);
|
|
119
|
+
if (updated.workingTimeTo !== null)
|
|
120
|
+
summaryParts.push(`to=${updated.workingTimeTo}`);
|
|
121
|
+
emitUpdateSuccess({
|
|
122
|
+
operation: "availability.working-hours.set",
|
|
123
|
+
format: opts.output,
|
|
124
|
+
updated,
|
|
125
|
+
prettySummary: summaryParts.length > 0 ? `working hours (${summaryParts.join(", ")})` : "working hours",
|
|
126
|
+
prettyEntity: (data) => formatWorkingHoursSet(data),
|
|
127
|
+
notice: updated.notice ?? undefined,
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Render the post-update working-hours payload as the indented entity
|
|
132
|
+
* preview inside the success-update envelope's pretty block. Pure —
|
|
133
|
+
* directly unit-testable.
|
|
134
|
+
*/
|
|
135
|
+
export function formatWorkingHoursSet(result) {
|
|
136
|
+
const lines = [];
|
|
137
|
+
if (result.timeZone !== null) {
|
|
138
|
+
lines.push(`Time zone: ${result.timeZone.value}`);
|
|
139
|
+
}
|
|
140
|
+
lines.push(`Working: ${result.workingTimeFrom ?? "—"} → ${result.workingTimeTo ?? "—"}`);
|
|
141
|
+
if (result.availableShiftRangeFrom !== null || result.availableShiftRangeTo !== null) {
|
|
142
|
+
lines.push(`Flex: ${result.availableShiftRangeFrom ?? "—"} → ${result.availableShiftRangeTo ?? "—"}`);
|
|
143
|
+
}
|
|
144
|
+
return lines.join("\n");
|
|
145
|
+
}
|
|
146
|
+
function assertHHMMSS(flag, value) {
|
|
147
|
+
if (!HHMMSS_PATTERN.test(value)) {
|
|
148
|
+
throw new availability.AvailabilityError("MUTATION_ERROR", `${flag} expects a time in HH:MM:SS format (got "${value}").`);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
//# sourceMappingURL=working-hours.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"working-hours.js","sourceRoot":"","sources":["../../../src/commands/availability/working-hours.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,oCAAoC;AAEpC,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC9E,OAAO,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAE3E;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,MAAoB;IAC5D,MAAM,KAAK,GAAG,MAAM,mBAAmB,CAAC,iCAAiC,EAAE,MAAM,CAAC,CAAC;IAEnF,IAAI,IAAgE,CAAC;IACrE,IAAI,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MAAM,MAAM,CAAC,aAAa,IAAI,GAAG,EAAE,CAAC,CAAC;IACzF,IAAI,MAAM,CAAC,uBAAuB,KAAK,IAAI,IAAI,MAAM,CAAC,qBAAqB,KAAK,IAAI,EAAE,CAAC;QACrF,KAAK,CAAC,IAAI,CAAC,YAAY,MAAM,CAAC,uBAAuB,IAAI,GAAG,MAAM,MAAM,CAAC,qBAAqB,IAAI,GAAG,EAAE,CAAC,CAAC;IAC3G,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAED,SAAS,YAAY,CAAC,IAAY,EAAE,KAAa;IAC/C,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QAChC,MAAM,IAAI,YAAY,CAAC,iBAAiB,CACtC,gBAAgB,EAChB,GAAG,IAAI,4CAA4C,KAAK,KAAK,CAC9D,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { Command } from "commander";
|
|
2
|
+
import { contracts } from "@ttctl/core";
|
|
3
|
+
import type { OutputFormat } from "../../lib/output.js";
|
|
4
|
+
/**
|
|
5
|
+
* Build the `ttctl contracts` command tree (#195). Two read-only leaves:
|
|
6
|
+
*
|
|
7
|
+
* | Leaf | Description |
|
|
8
|
+
* |-------------------------------|--------------------------------------------|
|
|
9
|
+
* | `list` | List talent-level contracts |
|
|
10
|
+
* | `show <id>` | Show one contract by id |
|
|
11
|
+
*
|
|
12
|
+
* `<id>` is the `Contract.id` from the `list` output.
|
|
13
|
+
*
|
|
14
|
+
* **Domain distinction**: this group surfaces *talent-level legal
|
|
15
|
+
* documents* (Toptal Direct, Master Service Agreement) reachable via
|
|
16
|
+
* `viewer.contracts` on the portal surface. Engagement-attached
|
|
17
|
+
* commercial agreements (rates, hours, period for one project) live on
|
|
18
|
+
* a different surface — use `ttctl engagements show <engagement-id>`.
|
|
19
|
+
*
|
|
20
|
+
* **Out of scope for v1** (per issue #195):
|
|
21
|
+
*
|
|
22
|
+
* - Contract negotiation / mutation (read-only group).
|
|
23
|
+
* - Document download (no API surface exposes a PDF URL today).
|
|
24
|
+
*/
|
|
25
|
+
export declare function buildContractsCommand(): Command;
|
|
26
|
+
/**
|
|
27
|
+
* Action handler for `ttctl contracts list`. Returns the contracts in
|
|
28
|
+
* the v1.0 list envelope on `--json` / `--yaml`; renders a
|
|
29
|
+
* `cli-table3` table on `--output=pretty`. An empty list is a
|
|
30
|
+
* legitimate return value.
|
|
31
|
+
*/
|
|
32
|
+
export declare function runContractsList(output: OutputFormat): Promise<void>;
|
|
33
|
+
/**
|
|
34
|
+
* Action handler for `ttctl contracts show <id>`. Returns the bare
|
|
35
|
+
* `Contract` detail shape on `--json` / `--yaml`; renders a
|
|
36
|
+
* multi-line key:value layout on `--output=pretty`.
|
|
37
|
+
*/
|
|
38
|
+
export declare function runContractsShow(id: string, output: OutputFormat): Promise<void>;
|
|
39
|
+
/**
|
|
40
|
+
* Render the contracts list as a `cli-table3` table. Columns: id,
|
|
41
|
+
* kind, provider, status, signedAt, active. `title` is intentionally
|
|
42
|
+
* NOT a column (often long and redundant with kind/provider) — it
|
|
43
|
+
* surfaces in `show <id>` and in `--json`/`--yaml`.
|
|
44
|
+
*/
|
|
45
|
+
export declare function formatContractsTable(items: contracts.Contract[], terminalWidth?: number): string;
|
|
46
|
+
/**
|
|
47
|
+
* Render a single contract as a sectioned multi-line block. Pure
|
|
48
|
+
* — directly unit-testable.
|
|
49
|
+
*/
|
|
50
|
+
export declare function formatContractDetail(c: contracts.Contract): string;
|
|
51
|
+
/**
|
|
52
|
+
* Trim an ISO 8601 timestamp to its `YYYY-MM-DD` prefix for table
|
|
53
|
+
* rendering. Returns the input unchanged when it doesn't start with a
|
|
54
|
+
* date.
|
|
55
|
+
*/
|
|
56
|
+
export declare function formatDate(value: string | null): string;
|
|
57
|
+
/**
|
|
58
|
+
* Map `isActive` to a compact table-cell marker: `★` for active,
|
|
59
|
+
* empty for inactive, `?` for null (forward-compat).
|
|
60
|
+
*/
|
|
61
|
+
export declare function activeMarker(isActive: boolean | null): string;
|
|
62
|
+
/**
|
|
63
|
+
* Thin wrapper around the shared CLI error router (#330) closed over
|
|
64
|
+
* `contracts.ContractsError` and {@link hintForContractsCode}. The
|
|
65
|
+
* router applies the envelope ABI (#128) branching uniformly across
|
|
66
|
+
* sub-domains.
|
|
67
|
+
*/
|
|
68
|
+
export declare function handleContractsError(commandLabel: string, err: unknown, format?: OutputFormat): never;
|
|
69
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/contracts/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAU,MAAM,WAAW,CAAC;AAE5C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAMxC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAGxD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,qBAAqB,IAAI,OAAO,CAmC/C;AAED;;;;;GAKG;AACH,wBAAsB,gBAAgB,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAe1E;AAED;;;;GAIG;AACH,wBAAsB,gBAAgB,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAatF;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,SAAS,CAAC,QAAQ,EAAE,EAC3B,aAAa,GAAE,MAAsC,GACpD,MAAM,CA8BR;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,SAAS,CAAC,QAAQ,GAAG,MAAM,CAalE;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAIvD;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI,GAAG,MAAM,CAG7D;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,GAAE,YAAuB,GAAG,KAAK,CAE/G"}
|