Skip to content

v2.1.0

Latest
Compare
Choose a tag to compare
@dasrick dasrick released this 08 Apr 06:19
· 7 commits to master since this release
823a70e

New

  • MessageCard type includes additional fields

    • Type and Context fields provide required JSON payload
      fields
      • preset to required static values via updated
        NewMessageCard() constructor
    • Summary
      • required if Text field is not set, optional otherwise
    • Sections slice
      • MessageCardSection type
  • Additional nested types

    • MessageCardSection
    • MessageCardSectionFact
    • MessageCardSectionImage
  • Additional methods for MessageCard and nested types

    • MessageCard.AddSection()
    • MessageCardSection.AddFact()
    • MessageCardSection.AddFactFromKeyValue()
    • MessageCardSection.AddImage()
    • MessageCardSection.AddHeroImageStr()
    • MessageCardSection.AddHeroImage()
  • Additional factory functions

    • NewMessageCardSection()
    • NewMessageCardSectionFact()
    • NewMessageCardSectionImage()
  • IsValidMessageCard() added to check for minimum required
    field values.

    • This function has the potential to be extended
      later with additional validation steps.
  • Wrapper IsValidInput() added to handle all validation
    needs from one location.

    • the intent was to both solve a CI erro and provide
      a location to easily extend validation checks in
      the future (if needed)

Changed

  • MessageCard type includes additional fields

  • NewMessageCard factory function sets fields needed for
    required JSON payload fields

    • Type
    • Context
  • teamsClient.Send() method updated to apply MessageCard struct
    validation alongside existing webhook URL validation

  • isValidWebhookURL() exported as IsValidWebhookURL() so that client
    code can use the validation functionality instead of repeating the
    code

    • e.g., flag value validation for "fail early" behavior

Known Issues

  • No support in this set of changes for potentialAction types
    • ViewAction
    • OpenUri
    • HttpPOST
    • ActionCard
    • InvokeAddInCommand
      • Outlook specific based on what I read; likely not included
        in a future release due to non-Teams specific usage