Skip to content

Log the entire API response for teams app publish #4010

@milanholemans

Description

@milanholemans

I noticed that the command teams app publish only logs the ID of the published app on success.

const res: { id: string; } = await request.post<{ id: string; }>(requestOptions);
if (res && res.id) {
logger.log(res.id);
}

I'm questioning why this is done. The original response of the API looks like:

{
  "id": "e3e29acb-8c79-412b-b746-e6c39ff4cd22",
  "externalId": "b5561ec9-8cab-4aa3-8aa2-d8d7172e4311",
  "name": "Test App",
  "version": "1.0.0",
  "distributionMethod": "organization"
}
  1. Shouldn't we log the entire response instead of only the ID?
  2. We should also add a responseType: 'json' to the request options. Right now the response is not formatted as json but as a JSON string. Therefore the command cannot find res.id and won't log anything at all.
  3. Update the command output in the docs

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions