-
Notifications
You must be signed in to change notification settings - Fork 1
feat: Create the sms module
#131
feat: Create the sms module
#131
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @Blckbrry-Pi and the rest of your teammates on |
7a771d2 to
a84215f
Compare
8ffc555 to
5408b00
Compare
|
|
||
| export type Response = Message; | ||
|
|
||
| export async function run( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is too verbose. we need to provide a generic superset over other peoples' apis. it's better to expose less than more so we can maintain consistent behavior across providers. i'd recommend completely deleting this script unless you see a good reason otherwise.
| } else if ("twilio" in ctx.config.provider) { | ||
| provider = new TwilioProvider(ctx.config.provider.twilio); | ||
| } else { | ||
| throw new RuntimeError("unreachable"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use unreachableerror
| export interface Request { | ||
| to: string; | ||
| content: string; | ||
| useGSM7?: boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
afaik we don't need to provide this, it's done by default: https://www.twilio.com/docs/glossary/what-is-gsm-7-character-encoding#how-twilio-encodes-your-messages
keep the api as minimal as possible
|
|
||
| export interface Config { | ||
| provider: Provider; | ||
| convertCurrencyTo?: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove me (see get_message)
| @@ -0,0 +1,16 @@ | |||
| import { RuntimeError } from "../module.gen.ts"; | |||
|
|
|||
| export async function convertCurrencyTo(from: string, to: string, amount: number): Promise<number> { | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove
| FAILED = "failed", | ||
| } | ||
|
|
||
| export interface Message { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove completely
| useGSM7?: boolean; | ||
| } | ||
|
|
||
| export type Response = Message; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does not need to return anything. see comment in get_message
| FAILED = "failed", | ||
| } | ||
|
|
||
| export interface Message { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remoev

No description provided.