nyaruka / gocommon Goto Github PK
View Code? Open in Web Editor NEWCommon utility library for the TextIt platform.
License: Other
Common utility library for the TextIt platform.
License: Other
urns.NewTelURNForCountry("tel:+12065551212", "US")
-> tel:+tel12065551212
Which seems mighty unfortunate considering how many people probably intuitively want to use @urns.tel
as the argument to things that expect a telephone number.
Detecting we are given a tel URN seems like it would probably be worth it? What are possible downsides there?
Also feels super weird that the current behavior ends up with +
prefixed on the returned number.
@rowanseymour feels liken number parsing this has been under a lot of flux lately, any opinions here?
Will need a new release version for nyaruka/courier#247 to pass
This issue is causing to trim + on number(https://github.com/nyaruka/gocommon/blob/master/urns/urns.go#L289) and return the number missing the + when phonenumbers lib does not consider the number to be valid https://github.com/nyaruka/gocommon/blob/master/urns/urns.go#L305
https://github.com/nyaruka/gocommon/blob/master/urns/urns.go#L70
Normalizing tel+2621112222
(invalid) returns tel:2621112222
(invalid) but normalizing that returns tel:+12621112222
(valid).
Maybe we need to combine normalization and validation, e.g. NormalizeAndValidate
which will only ever return a number which passes phonenumber.parse
.
This is more a urns package than a gocommon package.
There are a bunch of things which we could probably move from courier / goflow / mailroom to here to unify our use. Some ideas:
I use Minio in my local development environment to support developing on attachments. It doesn't work properly right now, because all the URLs that courier passes to rapidpro are wrong, pointing to Amazon S3 rather than my local minio environment.
Line 15 in e8b962c
I could make a PR if you want.
Looking to use Trace in swaggo and it is mostly great but there's a few things that feel like they are missing from a DRY perspective:
I guess it is balance between whether we think those two things would cause trouble elsewhere, but I certainly am finding myself wanting to use Trace as a way to say create an HTTPLog as a standalone thing and it isn't so convenient because of the above.
Thoughts @rowanseymour ?
The URL returned for stored files does not include the bucket region.
Attachments are stored in the correct bucket but the URL returned and stored on the message is incorrect.
The URL is defined here https://github.com/nyaruka/gocommon/blob/main/storage/s3.go#L19
As per the S3 naming conventions the bucket region should form part of the endpoint URL
https://docs.aws.amazon.com/general/latest/gr/s3.html
dbutil.BulkQuery
currently only works when statement includes the exact text VALUES(
but sometimes depending on formatting style it might be preferable to write it VALUES (
.
Would be useful if it allowed casts as well, e.g. VALUES (:id::int)
so that the column is created with type int
and you don't have to use ::int
elsewhere in the query.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.