From 00cf7230aea8bccf30e583eb75362194501c84e2 Mon Sep 17 00:00:00 2001 From: Daniel Chambers Date: Wed, 28 Feb 2024 12:02:30 +1100 Subject: [PATCH] Fix incorrect types used on unsubscription_settings (#9) --- .github/workflows/docker.yml | 33 +++++++++++++++++++++++++ CHANGELOG.md | 17 ++++++------- crates/ndc-sendgrid/src/schema.rs | 4 +-- crates/ndc-sendgrid/src/sendgrid_api.rs | 4 +-- 4 files changed, 44 insertions(+), 14 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 18af4e2..b300185 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -4,6 +4,9 @@ name: Create and publish a Docker image # Configures this workflow to run every time a change is pushed to selected tags and branches on: + pull_request: + branches: + - main push: branches: - main @@ -61,3 +64,33 @@ jobs: name: connector-definition.tgz path: ./connector-definition/dist/connector-definition.tgz compression-level: 0 # Already compressed + + release-connector: + name: Release connector + runs-on: ubuntu-latest + needs: build-and-push-image + if: ${{ startsWith(github.ref, 'refs/tags/v') }} + steps: + - uses: actions/checkout@v4 + - uses: actions/download-artifact@v4 + with: + name: connector-definition.tgz + path: ./connector-definition/dist/connector-definition.tgz + - name: Get version from tag + id: get-version + run: | + echo "tagged_version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT + shell: bash + - uses: mindsers/changelog-reader-action@v2 + id: changelog-reader + with: + version: ${{ steps.get-version.outputs.tagged_version }} + path: ./CHANGELOG.md + - uses: softprops/action-gh-release@v1 + with: + draft: false + tag_name: v${{ steps.get-version.outputs.tagged_version }} + body: ${{ steps.changelog-reader.outputs.changes }} + files: | + ./connector-definition/dist/connector-definition.tgz + fail_on_unmatched_files: true diff --git a/CHANGELOG.md b/CHANGELOG.md index f4f375b..fc68501 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,30 +1,27 @@ # SendGrid Connector Changelog - This changelog documents changes between release tags. -## main - +## [Unreleased] Upcoming changes for the next versioned release. -## v0.4 +## [0.5] - 2024-02-28 +* Fix incorrect types used on unsubscription_settings object type ([#9](https://github.com/hasura/ndc-sendgrid/pull/9)) +## [0.4] - 2024-02-21 * Updated with the latest NDC SDK version that supports NDC Spec v0.1.0-rc.16 * send_mail procedure now takes the full send mail request type and uses nested objects -## v0.3 +## [0.3] - 2023-10-26 * Simplified send_mail inputs to work around v3-engine missing argument object type support -## v0.2 - +## [0.2] - 2023-09-15 Updates include: * Updating the Spec and SDK dependencies * Auth Support via `SERVICE_TOKEN_SECRET` - -## v0.1 - +## [0.1] - 2023-09-14 Initial releaase of SendGrid Connector. Supports: diff --git a/crates/ndc-sendgrid/src/schema.rs b/crates/ndc-sendgrid/src/schema.rs index 0f8549f..6e2b0b0 100644 --- a/crates/ndc-sendgrid/src/schema.rs +++ b/crates/ndc-sendgrid/src/schema.rs @@ -453,11 +453,11 @@ fn unsubscription_settings() -> ObjectType { description: Some(String::from("An object allowing you to specify how to handle unsubscribes.")), fields: BTreeMap::from([ (String::from("group_id"), ObjectField { - r#type: named("String"), + r#type: named("Int"), description: Some(String::from("The unsubscribe group to associate with this email.")) }), (String::from("groups_to_display"), ObjectField { - r#type: nullable(array_of(named("group_id"))), + r#type: nullable(array_of(named("Int"))), description: Some(String::from("An array containing the unsubscribe groups that you would like to be displayed on the unsubscribe preferences page.")) }), ]), diff --git a/crates/ndc-sendgrid/src/sendgrid_api.rs b/crates/ndc-sendgrid/src/sendgrid_api.rs index e6c9c50..4afd9c7 100644 --- a/crates/ndc-sendgrid/src/sendgrid_api.rs +++ b/crates/ndc-sendgrid/src/sendgrid_api.rs @@ -185,8 +185,8 @@ pub struct MailAttachment { #[derive(Serialize, Deserialize, Clone, Debug)] pub struct UnsubscriptionSettings { - pub group_id: String, - pub groups_to_display: Option>, + pub group_id: u32, + pub groups_to_display: Option>, } pub async fn invoke_list_function_templates(