Adding teams user app list#1874
Conversation
|
Hey @sebastienlevert, seems like we're missing some coverage. Care to have another look? |
|
It actually seems that something happened on the build side. Running them locally is successful. Trying another thing. Just did a new push and it seems that it's at 100% now. Maybe some instability? CircleCI is all good now! |
|
Actually... It might have been a PR / push issue by myself (the squash part, probably). |
|
Thanks @sebastienlevert tests all looks good now 👍 I assume that this PR is good for review? If so, let us know clicking the 'Ready for review' button to take the PR out of draft status and it will show up on our radar 😊 |
|
Hey @sebastienlevert, have you checked if this command is working? When I'm running it, I'm getting a |
|
Also @waldekmastykarz, did you reconsent to the app permissions? As this command requires the new TeamsAppInstallation.ReadWriteForUser.All scope! |
|
@sebastienlevert I've seen intermittent issues with tests. Not sure where it's coming from, but it's something that popped up recently. Seems like we should investigate it. As for the permissions, I did reconsent the app, but looking at the token, I'm not seeing this scope despite it being in the app reg. Let me have another look at it. Thanks for confirming and sorry for the trouble. |
|
Hey @sebastienlevert, seems like the last change you've pushed, is breaking a couple of your tests: Would you mind having a look? |
|
Just added the /beta to the Unit Tests! |
waldekmastykarz
left a comment
There was a problem hiding this comment.
Nicely done with a few minor changes I've done when merging the PR 👍
| public get description(): string { | ||
| return 'Lists the apps deployed in the personal scope of the specified user'; | ||
| } | ||
|
|
There was a problem hiding this comment.
We're missing telemetry to track the usage of optional command options
| } | ||
|
|
||
| public commandAction(logger: Logger, args: CommandArgs, cb: () => void): void { | ||
| var userIdPromise: Promise<{ value: string; }>; |
There was a problem hiding this comment.
We should use let or const instead of the generic var
| public commandAction(logger: Logger, args: CommandArgs, cb: () => void): void { | ||
| var userIdPromise: Promise<{ value: string; }>; | ||
|
|
||
| if(args.options.userName) { |
There was a problem hiding this comment.
We could make the code easier to read and maintain by putting userId resolution in a separate method.
| userIdPromise.then((userId) => { | ||
| const endpoint: string = `${this.resource}/beta/users/${encodeURIComponent(userId.value)}/teamwork/installedApps` | ||
|
|
||
| this.getAllItems(endpoint, logger, true) |
There was a problem hiding this comment.
We should avoid nesting promises and instead return this operation to the main chain.
| this.getAllItems(endpoint, logger, true) | ||
| .then((): void => { | ||
| this.items.map(i => { | ||
| var userAppId = Buffer.from(i.id, 'base64').toString('ascii'); |
There was a problem hiding this comment.
We should use const instead of var as this const is not assigned another value
| .then((): void => { | ||
| this.items.map(i => { | ||
| var userAppId = Buffer.from(i.id, 'base64').toString('ascii'); | ||
| var appId = userAppId.substr(userAppId.indexOf("##") + 2, userAppId.length - userId.value.length - 2) |
There was a problem hiding this comment.
We should use const instead of var as this const is not assigned another value
| const options: CommandOption[] = [ | ||
| { | ||
| option: '--userId', | ||
| description: 'The ID of user to get the apps from' |
There was a problem hiding this comment.
Doesn't match description from the docs
| }, | ||
| { | ||
| option: '--userName', | ||
| description: 'The UPN of user to get the apps from' |
There was a problem hiding this comment.
Doesn't match description from the docs
| } | ||
|
|
||
| public get description(): string { | ||
| return 'Lists the apps deployed in the personal scope of the specified user'; |
There was a problem hiding this comment.
Doesn't match description from the docs (installed vs. deployed)
|
Merged manually. Thank you! 👏 |





Adding teams user app list.
Closes #1866