-
Notifications
You must be signed in to change notification settings - Fork 370
Enhances 'teams chat message list' command #7087
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR enhances the teams chat message list command by migrating it to Zod schema validation and adding support for filtering messages by creation date.
Key changes:
- Migrates command validation from legacy pattern to Zod schema
- Adds optional
endDateTimeparameter to filter messages created before a specific date - Updates default output properties to include
createdDateTime
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/m365/teams/commands/chat/chat-message-list.ts | Migrates to Zod schema validation, adds endDateTime option for filtering messages, updates default properties to include createdDateTime |
| src/m365/teams/commands/chat/chat-message-list.spec.ts | Updates tests to use Zod schema validation pattern, adds test for endDateTime filtering, refactors test data into shared apiResponse constant |
| docs/docs/cmd/teams/chat/chat-message-list.mdx | Adds documentation for new endDateTime option, updates permissions section, updates example outputs to include createdDateTime |
Comments suppressed due to low confidence (1)
src/m365/teams/commands/chat/chat-message-list.ts:86
- Test coverage is missing for the JSON output scenario. The command should have a test that verifies the message body structure is preserved in JSON output mode (i.e., the body.content is not hoisted to body and shortBody is not added). The removed test 'outputs all data in json output mode' provided this coverage, and should be replaced with an equivalent test.
if (args.options.output && args.options.output !== 'json') {
items.forEach(i => {
// hoist the content to body for readability
i.body = (i.body as ItemBody).content as any;
let shortBody: string | undefined;
const bodyToProcess = i.body as string;
if (bodyToProcess) {
let maxLength = 50;
let addedDots = '...';
if (bodyToProcess.length < maxLength) {
maxLength = bodyToProcess.length;
addedDots = '';
}
shortBody = bodyToProcess.replace(/\n/g, ' ').substring(0, maxLength) + addedDots;
}
i.shortBody = shortBody;
});
}
fc34184 to
39e2880
Compare
39e2880 to
a67e9b3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
4a2bb4e to
8f0fe54
Compare
Closes #6484