Closed ekoeryanto closed 3 months ago
Hey, thanks for writing this PR!
That typo was really sneaky, nice catch. On the other hand, I'm going to need a little more information with two things:
npm ci
requires the package-lock.json file to work as expected IIRC)In other matters, I don't like the timestamp and status properties in the OnSentArgs, the first one because it might not be consistent with the API due to server timezones, and the second one because the message_status issue. I do, however, like the idea of timestamp for status and messages. Not including it for the former was an oversight from my part, and the later can access it via message.timestamp, but there's no drama with having the information duplicated for consistency within the library.
Let me know what you think about this 3 points, and we can keep working on the merge later.
Many thanks!
Not every one use NPM, based on my experience, companies strict it to chosen PM they prefer. and for me personally i use only bun for PM just because there are to much cache saved if I use multiple PMs, (my laptop that only has 256 SSD forces me). If we use npm ci here, so yes maybe if will fail but it back to you then, modify it or just use the lockfile.
and yes I test it too there is message_status in the response
{
// removed for privacy
"response": {
"messaging_product": "whatsapp",
"contacts": [
{
"input": "628xxxxxxx",
"wa_id": "628xxxxxxx"
}
],
"messages": [
{
"id": "wamid.HBgNNjI4MTIxMTEwOTg0NRUCABEYEkQ5NDgxMDQ4QUNDRjE2RTIwMAA=",
"message_status": "accepted"
}
]
}
}
I still don't get why the lock file would affect the end user. The package isn't released with it to npm, it's only used in development. Does the file prevents you from using bun? If possible, I would rather not change the repo's actions.
In respect to the message_status, I only found this documentation about the property:
Applies to businesses in Brazil, Colombia, and Singapore, starting September 12, 2023. Applies to all businesses starting October 12, 2023.
In theory, it should be available to everyone, but the documentation doesn't clarify if the property is always there or if it's specific for templates (which by the possible values seems to be the case).
I think the argument could be reworked into held_for_quality_assessment
being a boolean, true to indicate if the property is equal to "held_for_quality_assessment", false if it's "accepted" or undefined. I believe it would create more confussion if the property is called status
, as the end user might assume it can be used to check if the message was sent sucessfully, which clearly isn't its usage.
Last, if you don't mind, I would love to split this PR into 3 different ones. You can cherry pick each commit into a different branch, or if you don't know how to, I can do it for you. This is just to keep the conversations splitted, and start merging the changes that are ready, such as the typo fix.
Let me know if you agree!
I can do it for you.
great, please do it
Closing in favor of #324 #325 #326
Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
Tests
npm run test
and lint the project withnpm run lint
andnpm run prettier