Giter VIP home page Giter VIP logo

Comments (5)

dsinghvi avatar dsinghvi commented on August 22, 2024 1

Hey @NatoBoram thanks for filing this issue. For context, Courier's SDK is generated with automation so this will involve updaating their API Definition and regenerating the SDK. We should be able to get to this today!

from courier-node.

NatoBoram avatar NatoBoram commented on August 22, 2024 1

I just updated to @trycourier/[email protected], reset my node_modules and lockfiles and restarted my CLIs but it doesn't seem to have changed anything

import { CourierClient } from "@trycourier/courier"

const courier = new CourierClient({ authorizationToken: "courier_auth_token" })

await courier.send({
	message: {
		to: {
			slack: { access_token: "slack_access_token", channel: "channel_id" },
		},
		data: { message: "this is a message" },
	},
})
src/courier/slack.ts:8:4 - error TS2353: Object literal may only specify known properties, and 'slack' does not exist in type 'MessageRecipient'.

8    slack: { access_token: "slack_access_token", channel: "channel_id" },
     ~~~~~

  node_modules/@trycourier/courier/api/resources/send/types/ContentMessage.d.ts:16:5
    16     to: Courier.MessageRecipient;
           ~~
    The expected type comes from property 'to' which is declared here on type 'Message'


Found 1 error in src/courier/slack.ts:8

Have you managed to make it work with that version?

from courier-node.

tk26 avatar tk26 commented on August 22, 2024

@NatoBoram cc @bwebs @dsinghvi this should be live with the latest release - please let us know if you have any questions/feedback :)

from courier-node.

bwebs avatar bwebs commented on August 22, 2024

I think I spotted it. We are re-using this type in a couple of places, but it looks like we missed the "slack" property in Recipient that already existed in UserProfile. We tested with UserProfile, hence the miss.

from courier-node.

bwebs avatar bwebs commented on August 22, 2024

v6.0.7 will be released shortly; tested the typing for courier.send({to:{slack: ...}}) upstream as well.

from courier-node.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.