User team (add, update and remove) implementation#152
Conversation
| logger.info(renderTeamUserAsciiTable(table)) | ||
| logger.info('') | ||
| logger.info( | ||
| `Result: ${result.success ? 'success' : 'partial/failed'} ` + |
There was a problem hiding this comment.
for partial / failed, priting separately would be better, if success = 0 and failed != 0, failed, iff success !=0 and failed != 0, partial
| createMessage( | ||
| data, | ||
| 'enterprise/teams_enterprise_users_add', | ||
| 'teams/teams_enterprise_users_add', |
There was a problem hiding this comment.
is this a valid change from enterprise to team
There was a problem hiding this comment.
teams_enterprise_users_add
is this related to the change this API that was previously mentioned ?
| FormattedTeamUserTable, | ||
| } | ||
|
|
||
| const SUCCESS_RESULT = 'success' |
There was a problem hiding this comment.
don't use constant for simple english words
There was a problem hiding this comment.
This is probably a result state. Adding an enum for the result type might be a better idea across all returns when dealing with states
| type VaultHandle = Awaited<ReturnType<typeof login>> | ||
|
|
||
| const OP_ADD = '1' | ||
| const OP_REMOVE = '2' |
There was a problem hiding this comment.
These types are constants are what fit into enum
| const USERS_PROMPT = 'User email(s) or ID(s) (comma-separated): ' | ||
| const TEAMS_PROMPT = 'Team name(s) or UID(s) (comma-separated): ' | ||
| const HIDE_SHARED_FOLDERS_PROMPT = 'Hide shared folders? [on/off/skip]: ' | ||
| const OPERATION_INPUT_PROMPT = `Operation [${OP_ADD}-${OP_REMOVE}]: ` |
There was a problem hiding this comment.
probably need not be assigned to constants
| async function executeOperation(vault: VaultHandle, input: OperationInput): Promise<TeamUserResult> { | ||
| const restore = suppressLogs() | ||
| try { | ||
| return input.kind === 'add' |
No description provided.