@@ -7,6 +7,17 @@ import { runTeamsChannels, runTeamsChannelGet } from './teams.js';
77import { runRecurringScanslist , runRecurringScansCreate , runRecurringScansUpdate } from './recurring-scans.js' ;
88import { runSprintReportsList , runSprintReportsCreate , runSprintReportsUpdate } from './sprint-reports.js' ;
99import { runCveReportingList , runCveReportingCreate , runCveReportingUpdate } from './cve-reporting.js' ;
10+ import {
11+ runTeamSubscriptionsList ,
12+ runTeamUsersList ,
13+ runTeamUserGet ,
14+ runTeamUserCreate ,
15+ runTeamUserDelete ,
16+ runTeamUserUpdate ,
17+ runTeamRbacGet ,
18+ runTeamRbacSave ,
19+ runTeamPlanEnd ,
20+ } from './team-management.js' ;
1021
1122/**
1223 * Register all `codeant settings <verb>` subcommands.
@@ -310,4 +321,95 @@ export default function registerSettingsCommands(program, { runCmd }) {
310321 reportConfig : opts . reportConfig ,
311322 notificationConfig : opts . notificationConfig ,
312323 } ) ) ) ;
324+
325+ // ── team-subscriptions-list ────────────────────────────────────────────────
326+ settings
327+ . command ( 'team-subscriptions-list' )
328+ . description ( 'List all subscriptions for the account' )
329+ . action ( ( ) => runCmd ( ( ) => runTeamSubscriptionsList ( ) ) ) ;
330+
331+ // ── team-users-list ────────────────────────────────────────────────────────
332+ settings
333+ . command ( 'team-users-list' )
334+ . description ( 'List users for a subscription' )
335+ . requiredOption ( '--subscription-id <id>' , 'Subscription ID' )
336+ . action ( ( opts ) => runCmd ( ( ) => runTeamUsersList ( { subscriptionId : opts . subscriptionId } ) ) ) ;
337+
338+ // ── team-user-get ──────────────────────────────────────────────────────────
339+ settings
340+ . command ( 'team-user-get' )
341+ . description ( 'Get a user by ID' )
342+ . requiredOption ( '--user-id <id>' , 'User ID' )
343+ . action ( ( opts ) => runCmd ( ( ) => runTeamUserGet ( { userId : opts . userId } ) ) ) ;
344+
345+ // ── team-user-create ───────────────────────────────────────────────────────
346+ settings
347+ . command ( 'team-user-create' )
348+ . description ( 'Create a new team user' )
349+ . requiredOption ( '--user-id <id>' , 'User ID' )
350+ . requiredOption ( '--email <email>' , 'User email' )
351+ . requiredOption ( '--name <name>' , 'User display name' )
352+ . requiredOption ( '--role <role>' , 'User role (e.g. developer, admin)' )
353+ . option ( '--plan-ids <json>' , 'Plan IDs as JSON array (e.g. \'["plan_1"]\')' , '[]' )
354+ . option ( '--subscription-ids <json>' , 'Subscription IDs as JSON array' , '[]' )
355+ . option ( '--invited' , 'Send invitation email' , false )
356+ . action ( ( opts ) => runCmd ( ( ) => runTeamUserCreate ( {
357+ userId : opts . userId ,
358+ email : opts . email ,
359+ name : opts . name ,
360+ role : opts . role ,
361+ planIds : opts . planIds ,
362+ subscriptionIds : opts . subscriptionIds ,
363+ invited : opts . invited ,
364+ } ) ) ) ;
365+
366+ // ── team-user-delete ───────────────────────────────────────────────────────
367+ settings
368+ . command ( 'team-user-delete' )
369+ . description ( 'Delete a team user' )
370+ . requiredOption ( '--user-id <id>' , 'User ID to delete' )
371+ . action ( ( opts ) => runCmd ( ( ) => runTeamUserDelete ( { userId : opts . userId } ) ) ) ;
372+
373+ // ── team-user-update ───────────────────────────────────────────────────────
374+ settings
375+ . command ( 'team-user-update' )
376+ . description ( 'Update a team user' )
377+ . requiredOption ( '--user-id <id>' , 'User ID to update' )
378+ . requiredOption ( '--email <email>' , 'User email' )
379+ . requiredOption ( '--name <name>' , 'User display name' )
380+ . requiredOption ( '--role <role>' , 'User role (e.g. developer, admin)' )
381+ . requiredOption ( '--status <status>' , 'User status (e.g. active, inactive)' )
382+ . option ( '--plan-ids <json>' , 'Plan IDs as JSON array' , '[]' )
383+ . option ( '--subscription-ids <json>' , 'Subscription IDs as JSON array' , '[]' )
384+ . action ( ( opts ) => runCmd ( ( ) => runTeamUserUpdate ( {
385+ userId : opts . userId ,
386+ email : opts . email ,
387+ name : opts . name ,
388+ role : opts . role ,
389+ status : opts . status ,
390+ planIds : opts . planIds ,
391+ subscriptionIds : opts . subscriptionIds ,
392+ } ) ) ) ;
393+
394+ // ── team-rbac-get ──────────────────────────────────────────────────────────
395+ settings
396+ . command ( 'team-rbac-get' )
397+ . description ( 'Get RBAC settings for a repository' )
398+ . requiredOption ( '--repo <repo>' , 'Repository (owner/repo)' )
399+ . action ( ( opts ) => runCmd ( ( ) => runTeamRbacGet ( { repo : opts . repo } ) ) ) ;
400+
401+ // ── team-rbac-save ─────────────────────────────────────────────────────────
402+ settings
403+ . command ( 'team-rbac-save' )
404+ . description ( 'Save RBAC settings for a repository' )
405+ . requiredOption ( '--repo <repo>' , 'Repository (owner/repo)' )
406+ . requiredOption ( '--data <json>' , 'RBAC settings as JSON (e.g. \'{"enabled":true}\')' )
407+ . action ( ( opts ) => runCmd ( ( ) => runTeamRbacSave ( { repo : opts . repo , data : opts . data } ) ) ) ;
408+
409+ // ── team-plan-end ──────────────────────────────────────────────────────────
410+ settings
411+ . command ( 'team-plan-end' )
412+ . description ( 'End/expire the active subscription plan' )
413+ . option ( '--include-users' , 'Also remove all users from the plan' , false )
414+ . action ( ( opts ) => runCmd ( ( ) => runTeamPlanEnd ( { includeUsers : opts . includeUsers } ) ) ) ;
313415}
0 commit comments