@robinpath/sms 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +104 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/sms.d.ts +139 -0
- package/dist/sms.d.ts.map +1 -0
- package/dist/sms.js +165 -0
- package/dist/sms.js.map +1 -0
- package/package.json +13 -0
package/README.md
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
# @robinpath/sms
|
|
2
|
+
|
|
3
|
+
> SMS sending via Twilio and Vonage with validation, formatting, lookup, and cost estimation
|
|
4
|
+
|
|
5
|
+
   
|
|
6
|
+
|
|
7
|
+
## Why use this module?
|
|
8
|
+
|
|
9
|
+
The `sms` module lets you:
|
|
10
|
+
|
|
11
|
+
- Send an SMS message
|
|
12
|
+
- Send SMS to multiple recipients
|
|
13
|
+
- Validate E.164 phone format
|
|
14
|
+
- Format phone to E.164
|
|
15
|
+
- Lookup phone info via Twilio
|
|
16
|
+
|
|
17
|
+
All functions are callable directly from RobinPath scripts with a simple, consistent API.
|
|
18
|
+
|
|
19
|
+
## Installation
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
npm install @robinpath/sms
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Quick Start
|
|
26
|
+
|
|
27
|
+
**1. Set up credentials**
|
|
28
|
+
|
|
29
|
+
```robinpath
|
|
30
|
+
sms.configure "main" {"provider": "twilio", "accountSid": "AC...", "authToken": "..."}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
**2. Send an SMS message**
|
|
34
|
+
|
|
35
|
+
```robinpath
|
|
36
|
+
sms.send "main" "+15559876543" "Your code is 1234"
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Available Functions
|
|
40
|
+
|
|
41
|
+
| Function | Description |
|
|
42
|
+
|----------|-------------|
|
|
43
|
+
| `sms.configure` | Configure SMS provider (Twilio or Vonage) |
|
|
44
|
+
| `sms.send` | Send an SMS message |
|
|
45
|
+
| `sms.sendBulk` | Send SMS to multiple recipients |
|
|
46
|
+
| `sms.validate` | Validate E.164 phone format |
|
|
47
|
+
| `sms.format` | Format phone to E.164 |
|
|
48
|
+
| `sms.lookup` | Lookup phone info via Twilio |
|
|
49
|
+
| `sms.status` | Check message delivery status |
|
|
50
|
+
| `sms.estimateCost` | Estimate SMS cost |
|
|
51
|
+
| `sms.isGsm` | Check if message uses GSM-7 encoding |
|
|
52
|
+
| `sms.segmentCount` | Count SMS segments |
|
|
53
|
+
|
|
54
|
+
## Examples
|
|
55
|
+
|
|
56
|
+
### Send an SMS message
|
|
57
|
+
|
|
58
|
+
```robinpath
|
|
59
|
+
sms.send "main" "+15559876543" "Your code is 1234"
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Send SMS to multiple recipients
|
|
63
|
+
|
|
64
|
+
```robinpath
|
|
65
|
+
sms.sendBulk "main" ["+155511111", "+155522222"] "Hello!"
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### Validate E.164 phone format
|
|
69
|
+
|
|
70
|
+
```robinpath
|
|
71
|
+
sms.validate "+15551234567"
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Integration with RobinPath
|
|
75
|
+
|
|
76
|
+
```typescript
|
|
77
|
+
import { RobinPath } from "@wiredwp/robinpath";
|
|
78
|
+
import Module from "@robinpath/sms";
|
|
79
|
+
|
|
80
|
+
const rp = new RobinPath();
|
|
81
|
+
rp.registerModule(Module.name, Module.functions);
|
|
82
|
+
rp.registerModuleMeta(Module.name, Module.functionMetadata);
|
|
83
|
+
|
|
84
|
+
const result = await rp.executeScript(`
|
|
85
|
+
sms.configure "main" {"provider": "twilio", "accountSid": "AC...", "authToken": "..."}
|
|
86
|
+
sms.send "main" "+15559876543" "Your code is 1234"
|
|
87
|
+
`);
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Full API Reference
|
|
91
|
+
|
|
92
|
+
See [MODULE.md](./MODULE.md) for complete documentation including all parameters, return types, error handling, and advanced examples.
|
|
93
|
+
|
|
94
|
+
## Related Modules
|
|
95
|
+
|
|
96
|
+
- [`@robinpath/slack`](../slack) — Slack module for complementary functionality
|
|
97
|
+
- [`@robinpath/discord`](../discord) — Discord module for complementary functionality
|
|
98
|
+
- [`@robinpath/teams`](../teams) — Teams module for complementary functionality
|
|
99
|
+
- [`@robinpath/telegram`](../telegram) — Telegram module for complementary functionality
|
|
100
|
+
- [`@robinpath/whatsapp`](../whatsapp) — WhatsApp module for complementary functionality
|
|
101
|
+
|
|
102
|
+
## License
|
|
103
|
+
|
|
104
|
+
MIT
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ModuleAdapter } from "@wiredwp/robinpath";
|
|
2
|
+
declare const SmsModule: ModuleAdapter;
|
|
3
|
+
export default SmsModule;
|
|
4
|
+
export { SmsModule };
|
|
5
|
+
export { SmsFunctions, SmsFunctionMetadata, SmsModuleMetadata } from "./sms.js";
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD,QAAA,MAAM,SAAS,EAAE,aAA+J,CAAC;AACjL,eAAe,SAAS,CAAC;AACzB,OAAO,EAAE,SAAS,EAAE,CAAC;AACrB,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { SmsFunctions, SmsFunctionMetadata, SmsModuleMetadata } from "./sms.js";
|
|
2
|
+
const SmsModule = { name: "sms", functions: SmsFunctions, functionMetadata: SmsFunctionMetadata, moduleMetadata: SmsModuleMetadata, global: false };
|
|
3
|
+
export default SmsModule;
|
|
4
|
+
export { SmsModule };
|
|
5
|
+
export { SmsFunctions, SmsFunctionMetadata, SmsModuleMetadata } from "./sms.js";
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAChF,MAAM,SAAS,GAAkB,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,gBAAgB,EAAE,mBAA0B,EAAE,cAAc,EAAE,iBAAwB,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;AACjL,eAAe,SAAS,CAAC;AACzB,OAAO,EAAE,SAAS,EAAE,CAAC;AACrB,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC"}
|
package/dist/sms.d.ts
ADDED
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import type { BuiltinHandler } from "@wiredwp/robinpath";
|
|
2
|
+
export declare const SmsFunctions: Record<string, BuiltinHandler>;
|
|
3
|
+
export declare const SmsFunctionMetadata: {
|
|
4
|
+
configure: {
|
|
5
|
+
description: string;
|
|
6
|
+
parameters: {
|
|
7
|
+
name: string;
|
|
8
|
+
dataType: string;
|
|
9
|
+
description: string;
|
|
10
|
+
formInputType: string;
|
|
11
|
+
required: boolean;
|
|
12
|
+
}[];
|
|
13
|
+
returnType: string;
|
|
14
|
+
returnDescription: string;
|
|
15
|
+
example: string;
|
|
16
|
+
};
|
|
17
|
+
send: {
|
|
18
|
+
description: string;
|
|
19
|
+
parameters: {
|
|
20
|
+
name: string;
|
|
21
|
+
dataType: string;
|
|
22
|
+
description: string;
|
|
23
|
+
formInputType: string;
|
|
24
|
+
required: boolean;
|
|
25
|
+
}[];
|
|
26
|
+
returnType: string;
|
|
27
|
+
returnDescription: string;
|
|
28
|
+
example: string;
|
|
29
|
+
};
|
|
30
|
+
sendBulk: {
|
|
31
|
+
description: string;
|
|
32
|
+
parameters: {
|
|
33
|
+
name: string;
|
|
34
|
+
dataType: string;
|
|
35
|
+
description: string;
|
|
36
|
+
formInputType: string;
|
|
37
|
+
required: boolean;
|
|
38
|
+
}[];
|
|
39
|
+
returnType: string;
|
|
40
|
+
returnDescription: string;
|
|
41
|
+
example: string;
|
|
42
|
+
};
|
|
43
|
+
validate: {
|
|
44
|
+
description: string;
|
|
45
|
+
parameters: {
|
|
46
|
+
name: string;
|
|
47
|
+
dataType: string;
|
|
48
|
+
description: string;
|
|
49
|
+
formInputType: string;
|
|
50
|
+
required: boolean;
|
|
51
|
+
}[];
|
|
52
|
+
returnType: string;
|
|
53
|
+
returnDescription: string;
|
|
54
|
+
example: string;
|
|
55
|
+
};
|
|
56
|
+
format: {
|
|
57
|
+
description: string;
|
|
58
|
+
parameters: {
|
|
59
|
+
name: string;
|
|
60
|
+
dataType: string;
|
|
61
|
+
description: string;
|
|
62
|
+
formInputType: string;
|
|
63
|
+
required: boolean;
|
|
64
|
+
}[];
|
|
65
|
+
returnType: string;
|
|
66
|
+
returnDescription: string;
|
|
67
|
+
example: string;
|
|
68
|
+
};
|
|
69
|
+
lookup: {
|
|
70
|
+
description: string;
|
|
71
|
+
parameters: {
|
|
72
|
+
name: string;
|
|
73
|
+
dataType: string;
|
|
74
|
+
description: string;
|
|
75
|
+
formInputType: string;
|
|
76
|
+
required: boolean;
|
|
77
|
+
}[];
|
|
78
|
+
returnType: string;
|
|
79
|
+
returnDescription: string;
|
|
80
|
+
example: string;
|
|
81
|
+
};
|
|
82
|
+
status: {
|
|
83
|
+
description: string;
|
|
84
|
+
parameters: {
|
|
85
|
+
name: string;
|
|
86
|
+
dataType: string;
|
|
87
|
+
description: string;
|
|
88
|
+
formInputType: string;
|
|
89
|
+
required: boolean;
|
|
90
|
+
}[];
|
|
91
|
+
returnType: string;
|
|
92
|
+
returnDescription: string;
|
|
93
|
+
example: string;
|
|
94
|
+
};
|
|
95
|
+
estimateCost: {
|
|
96
|
+
description: string;
|
|
97
|
+
parameters: {
|
|
98
|
+
name: string;
|
|
99
|
+
dataType: string;
|
|
100
|
+
description: string;
|
|
101
|
+
formInputType: string;
|
|
102
|
+
required: boolean;
|
|
103
|
+
}[];
|
|
104
|
+
returnType: string;
|
|
105
|
+
returnDescription: string;
|
|
106
|
+
example: string;
|
|
107
|
+
};
|
|
108
|
+
isGsm: {
|
|
109
|
+
description: string;
|
|
110
|
+
parameters: {
|
|
111
|
+
name: string;
|
|
112
|
+
dataType: string;
|
|
113
|
+
description: string;
|
|
114
|
+
formInputType: string;
|
|
115
|
+
required: boolean;
|
|
116
|
+
}[];
|
|
117
|
+
returnType: string;
|
|
118
|
+
returnDescription: string;
|
|
119
|
+
example: string;
|
|
120
|
+
};
|
|
121
|
+
segmentCount: {
|
|
122
|
+
description: string;
|
|
123
|
+
parameters: {
|
|
124
|
+
name: string;
|
|
125
|
+
dataType: string;
|
|
126
|
+
description: string;
|
|
127
|
+
formInputType: string;
|
|
128
|
+
required: boolean;
|
|
129
|
+
}[];
|
|
130
|
+
returnType: string;
|
|
131
|
+
returnDescription: string;
|
|
132
|
+
example: string;
|
|
133
|
+
};
|
|
134
|
+
};
|
|
135
|
+
export declare const SmsModuleMetadata: {
|
|
136
|
+
description: string;
|
|
137
|
+
methods: string[];
|
|
138
|
+
};
|
|
139
|
+
//# sourceMappingURL=sms.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sms.d.ts","sourceRoot":"","sources":["../src/sms.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAA2C,MAAM,oBAAoB,CAAC;AAuIlG,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAsG,CAAC;AAE/J,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAW/B,CAAC;AAEF,eAAO,MAAM,iBAAiB;;;CAG7B,CAAC"}
|
package/dist/sms.js
ADDED
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
const configs = new Map();
|
|
2
|
+
const GSM_CHARS = new Set("@£$¥èéùìòÇ\nØø\rÅåΔ_ΦΓΛΩΠΨΣΘΞ ÆæßÉ !\"#¤%&'()*+,-./0123456789:;<=>?¡ABCDEFGHIJKLMNOPQRSTUVWXYZÄÖÑܧ¿abcdefghijklmnopqrstuvwxyzäöñüà");
|
|
3
|
+
const GSM_EXTENDED = new Set("^{}\\[~]|€");
|
|
4
|
+
function isGsmEncoding(text) {
|
|
5
|
+
for (const ch of text) {
|
|
6
|
+
if (!GSM_CHARS.has(ch) && !GSM_EXTENDED.has(ch))
|
|
7
|
+
return false;
|
|
8
|
+
}
|
|
9
|
+
return true;
|
|
10
|
+
}
|
|
11
|
+
function countSegments(text) {
|
|
12
|
+
if (!text)
|
|
13
|
+
return 0;
|
|
14
|
+
if (isGsmEncoding(text)) {
|
|
15
|
+
let len = 0;
|
|
16
|
+
for (const ch of text)
|
|
17
|
+
len += GSM_EXTENDED.has(ch) ? 2 : 1;
|
|
18
|
+
return len <= 160 ? 1 : Math.ceil(len / 153);
|
|
19
|
+
}
|
|
20
|
+
return text.length <= 70 ? 1 : Math.ceil(text.length / 67);
|
|
21
|
+
}
|
|
22
|
+
const configure = (args) => {
|
|
23
|
+
const id = String(args[0] ?? "default");
|
|
24
|
+
const opts = (typeof args[1] === "object" && args[1] !== null ? args[1] : {});
|
|
25
|
+
const provider = String(opts.provider ?? "twilio").toLowerCase();
|
|
26
|
+
if (provider !== "twilio" && provider !== "vonage")
|
|
27
|
+
throw new Error(`Unsupported provider: "${provider}". Use "twilio" or "vonage".`);
|
|
28
|
+
configs.set(id, { provider, accountSid: opts.accountSid ? String(opts.accountSid) : undefined, authToken: opts.authToken ? String(opts.authToken) : undefined, apiKey: opts.apiKey ? String(opts.apiKey) : undefined, apiSecret: opts.apiSecret ? String(opts.apiSecret) : undefined, from: opts.from ? String(opts.from) : undefined });
|
|
29
|
+
return { id, provider };
|
|
30
|
+
};
|
|
31
|
+
const send = async (args) => {
|
|
32
|
+
const configId = String(args[0] ?? "default");
|
|
33
|
+
const to = String(args[1] ?? "");
|
|
34
|
+
const body = String(args[2] ?? "");
|
|
35
|
+
const opts = (typeof args[3] === "object" && args[3] !== null ? args[3] : {});
|
|
36
|
+
const cfg = configs.get(configId);
|
|
37
|
+
if (!cfg)
|
|
38
|
+
throw new Error(`SMS config "${configId}" not found. Call sms.configure first.`);
|
|
39
|
+
const from = opts.from ? String(opts.from) : cfg.from;
|
|
40
|
+
if (!to)
|
|
41
|
+
throw new Error("Recipient phone number is required.");
|
|
42
|
+
if (!body)
|
|
43
|
+
throw new Error("Message body is required.");
|
|
44
|
+
if (cfg.provider === "twilio") {
|
|
45
|
+
if (!cfg.accountSid || !cfg.authToken)
|
|
46
|
+
throw new Error("Twilio requires accountSid and authToken.");
|
|
47
|
+
if (!from)
|
|
48
|
+
throw new Error("Sender (from) is required for Twilio.");
|
|
49
|
+
const params = new URLSearchParams();
|
|
50
|
+
params.set("To", to);
|
|
51
|
+
params.set("From", from);
|
|
52
|
+
params.set("Body", body);
|
|
53
|
+
const response = await fetch(`https://api.twilio.com/2010-04-01/Accounts/${cfg.accountSid}/Messages.json`, {
|
|
54
|
+
method: "POST",
|
|
55
|
+
headers: { "Authorization": "Basic " + btoa(`${cfg.accountSid}:${cfg.authToken}`), "Content-Type": "application/x-www-form-urlencoded" },
|
|
56
|
+
body: params.toString(),
|
|
57
|
+
});
|
|
58
|
+
const data = await response.json();
|
|
59
|
+
if (!response.ok)
|
|
60
|
+
throw new Error(`Twilio error ${response.status}: ${data.message ?? JSON.stringify(data)}`);
|
|
61
|
+
return { success: true, messageId: data.sid, provider: "twilio" };
|
|
62
|
+
}
|
|
63
|
+
// Vonage
|
|
64
|
+
if (!cfg.apiKey || !cfg.apiSecret)
|
|
65
|
+
throw new Error("Vonage requires apiKey and apiSecret.");
|
|
66
|
+
if (!from)
|
|
67
|
+
throw new Error("Sender (from) is required for Vonage.");
|
|
68
|
+
const response = await fetch("https://rest.nexmo.com/sms/json", {
|
|
69
|
+
method: "POST", headers: { "Content-Type": "application/json" },
|
|
70
|
+
body: JSON.stringify({ api_key: cfg.apiKey, api_secret: cfg.apiSecret, to, from, text: body }),
|
|
71
|
+
});
|
|
72
|
+
const data = await response.json();
|
|
73
|
+
const messages = data.messages;
|
|
74
|
+
const first = messages?.[0];
|
|
75
|
+
if (!first || String(first.status) !== "0")
|
|
76
|
+
throw new Error(`Vonage error: ${first?.["error-text"] ?? JSON.stringify(data)}`);
|
|
77
|
+
return { success: true, messageId: first["message-id"], provider: "vonage" };
|
|
78
|
+
};
|
|
79
|
+
const sendBulk = async (args) => {
|
|
80
|
+
const configId = String(args[0] ?? "default");
|
|
81
|
+
const recipients = Array.isArray(args[1]) ? args[1].map(String) : [];
|
|
82
|
+
const body = String(args[2] ?? "");
|
|
83
|
+
const results = [];
|
|
84
|
+
for (const to of recipients) {
|
|
85
|
+
try {
|
|
86
|
+
const result = await send([configId, to, body]);
|
|
87
|
+
results.push({ to, success: true, messageId: result.messageId });
|
|
88
|
+
}
|
|
89
|
+
catch (err) {
|
|
90
|
+
results.push({ to, success: false, error: err instanceof Error ? err.message : String(err) });
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
return results;
|
|
94
|
+
};
|
|
95
|
+
const validate = (args) => /^\+[1-9]\d{1,14}$/.test(String(args[0] ?? ""));
|
|
96
|
+
const format = (args) => {
|
|
97
|
+
const phone = String(args[0] ?? "");
|
|
98
|
+
const countryCode = String(args[1] ?? "1");
|
|
99
|
+
if (phone.startsWith("+"))
|
|
100
|
+
return phone;
|
|
101
|
+
const digits = phone.replace(/\D/g, "");
|
|
102
|
+
if (!digits)
|
|
103
|
+
return "";
|
|
104
|
+
if (digits.startsWith(countryCode) && digits.length > countryCode.length + 4)
|
|
105
|
+
return `+${digits}`;
|
|
106
|
+
return `+${countryCode}${digits}`;
|
|
107
|
+
};
|
|
108
|
+
const lookup = async (args) => {
|
|
109
|
+
const configId = String(args[0] ?? "default");
|
|
110
|
+
const phone = String(args[1] ?? "");
|
|
111
|
+
const cfg = configs.get(configId);
|
|
112
|
+
if (!cfg)
|
|
113
|
+
throw new Error(`SMS config "${configId}" not found.`);
|
|
114
|
+
if (cfg.provider !== "twilio")
|
|
115
|
+
throw new Error("Lookup is only supported with Twilio.");
|
|
116
|
+
if (!cfg.accountSid || !cfg.authToken)
|
|
117
|
+
throw new Error("Twilio requires accountSid and authToken.");
|
|
118
|
+
const response = await fetch(`https://lookups.twilio.com/v1/PhoneNumbers/${encodeURIComponent(phone)}?Type=carrier`, { headers: { "Authorization": "Basic " + btoa(`${cfg.accountSid}:${cfg.authToken}`) } });
|
|
119
|
+
const data = await response.json();
|
|
120
|
+
if (!response.ok)
|
|
121
|
+
throw new Error(`Twilio Lookup error: ${data.message ?? JSON.stringify(data)}`);
|
|
122
|
+
const carrier = data.carrier;
|
|
123
|
+
return { valid: true, countryCode: data.country_code, carrier: carrier?.name ?? null, type: carrier?.type ?? null };
|
|
124
|
+
};
|
|
125
|
+
const status = async (args) => {
|
|
126
|
+
const configId = String(args[0] ?? "default");
|
|
127
|
+
const messageId = String(args[1] ?? "");
|
|
128
|
+
const cfg = configs.get(configId);
|
|
129
|
+
if (!cfg)
|
|
130
|
+
throw new Error(`SMS config "${configId}" not found.`);
|
|
131
|
+
if (cfg.provider !== "twilio")
|
|
132
|
+
throw new Error("Status check only supported with Twilio.");
|
|
133
|
+
if (!cfg.accountSid || !cfg.authToken)
|
|
134
|
+
throw new Error("Twilio requires accountSid and authToken.");
|
|
135
|
+
const response = await fetch(`https://api.twilio.com/2010-04-01/Accounts/${cfg.accountSid}/Messages/${messageId}.json`, { headers: { "Authorization": "Basic " + btoa(`${cfg.accountSid}:${cfg.authToken}`) } });
|
|
136
|
+
const data = await response.json();
|
|
137
|
+
if (!response.ok)
|
|
138
|
+
throw new Error(`Twilio error: ${data.message ?? JSON.stringify(data)}`);
|
|
139
|
+
return { status: data.status, errorCode: data.error_code ?? null, errorMessage: data.error_message ?? null };
|
|
140
|
+
};
|
|
141
|
+
const estimateCost = (args) => {
|
|
142
|
+
const body = String(args[0] ?? "");
|
|
143
|
+
const segments = countSegments(body);
|
|
144
|
+
return { segments, estimatedCost: Math.round(segments * 0.0075 * 10000) / 10000 };
|
|
145
|
+
};
|
|
146
|
+
const isGsm = (args) => isGsmEncoding(String(args[0] ?? ""));
|
|
147
|
+
const segmentCount = (args) => countSegments(String(args[0] ?? ""));
|
|
148
|
+
export const SmsFunctions = { configure, send, sendBulk, validate, format, lookup, status, estimateCost, isGsm, segmentCount };
|
|
149
|
+
export const SmsFunctionMetadata = {
|
|
150
|
+
configure: { description: "Configure SMS provider (Twilio or Vonage)", parameters: [{ name: "id", dataType: "string", description: "Config name", formInputType: "text", required: false }, { name: "options", dataType: "object", description: "{provider, accountSid, authToken, apiKey, apiSecret, from}", formInputType: "text", required: true }], returnType: "object", returnDescription: "{id, provider}", example: 'sms.configure "main" {"provider": "twilio", "accountSid": "AC...", "authToken": "..."}' },
|
|
151
|
+
send: { description: "Send an SMS message", parameters: [{ name: "configId", dataType: "string", description: "Config name", formInputType: "text", required: true }, { name: "to", dataType: "string", description: "Recipient phone (E.164)", formInputType: "text", required: true }, { name: "body", dataType: "string", description: "Message text", formInputType: "text", required: true }, { name: "options", dataType: "object", description: "{from}", formInputType: "text", required: false }], returnType: "object", returnDescription: "{success, messageId, provider}", example: 'sms.send "main" "+15559876543" "Your code is 1234"' },
|
|
152
|
+
sendBulk: { description: "Send SMS to multiple recipients", parameters: [{ name: "configId", dataType: "string", description: "Config name", formInputType: "text", required: true }, { name: "recipients", dataType: "array", description: "Phone numbers", formInputType: "text", required: true }, { name: "body", dataType: "string", description: "Message text", formInputType: "text", required: true }], returnType: "array", returnDescription: "Array of results", example: 'sms.sendBulk "main" ["+155511111", "+155522222"] "Hello!"' },
|
|
153
|
+
validate: { description: "Validate E.164 phone format", parameters: [{ name: "phone", dataType: "string", description: "Phone number", formInputType: "text", required: true }], returnType: "boolean", returnDescription: "true if valid E.164", example: 'sms.validate "+15551234567"' },
|
|
154
|
+
format: { description: "Format phone to E.164", parameters: [{ name: "phone", dataType: "string", description: "Phone number", formInputType: "text", required: true }, { name: "countryCode", dataType: "string", description: "Country code (default 1)", formInputType: "text", required: false }], returnType: "string", returnDescription: "E.164 formatted", example: 'sms.format "(555) 123-4567"' },
|
|
155
|
+
lookup: { description: "Lookup phone info via Twilio", parameters: [{ name: "configId", dataType: "string", description: "Config name", formInputType: "text", required: true }, { name: "phone", dataType: "string", description: "Phone number", formInputType: "text", required: true }], returnType: "object", returnDescription: "{valid, countryCode, carrier, type}", example: 'sms.lookup "main" "+15551234567"' },
|
|
156
|
+
status: { description: "Check message delivery status", parameters: [{ name: "configId", dataType: "string", description: "Config name", formInputType: "text", required: true }, { name: "messageId", dataType: "string", description: "Message SID", formInputType: "text", required: true }], returnType: "object", returnDescription: "{status, errorCode, errorMessage}", example: 'sms.status "main" "SM123..."' },
|
|
157
|
+
estimateCost: { description: "Estimate SMS cost", parameters: [{ name: "body", dataType: "string", description: "Message text", formInputType: "text", required: true }], returnType: "object", returnDescription: "{segments, estimatedCost}", example: 'sms.estimateCost "Hello world"' },
|
|
158
|
+
isGsm: { description: "Check if message uses GSM-7 encoding", parameters: [{ name: "body", dataType: "string", description: "Message text", formInputType: "text", required: true }], returnType: "boolean", returnDescription: "true if GSM-7", example: 'sms.isGsm "Hello"' },
|
|
159
|
+
segmentCount: { description: "Count SMS segments", parameters: [{ name: "body", dataType: "string", description: "Message text", formInputType: "text", required: true }], returnType: "number", returnDescription: "Segment count", example: 'sms.segmentCount "Hello world"' },
|
|
160
|
+
};
|
|
161
|
+
export const SmsModuleMetadata = {
|
|
162
|
+
description: "SMS sending via Twilio and Vonage with validation, formatting, lookup, and cost estimation",
|
|
163
|
+
methods: ["configure", "send", "sendBulk", "validate", "format", "lookup", "status", "estimateCost", "isGsm", "segmentCount"],
|
|
164
|
+
};
|
|
165
|
+
//# sourceMappingURL=sms.js.map
|
package/dist/sms.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sms.js","sourceRoot":"","sources":["../src/sms.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,GAAG,IAAI,GAAG,EAA6H,CAAC;AAErJ,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,qIAAqI,CAAC,CAAC;AACjK,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC,YAAY,CAAC,CAAC;AAE3C,SAAS,aAAa,CAAC,IAAY;IACjC,KAAK,MAAM,EAAE,IAAI,IAAI,EAAE,CAAC;QAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,EAAE,CAAC;YAAE,OAAO,KAAK,CAAC;IAAC,CAAC;IACzF,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAS,aAAa,CAAC,IAAY;IACjC,IAAI,CAAC,IAAI;QAAE,OAAO,CAAC,CAAC;IACpB,IAAI,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC;QACxB,IAAI,GAAG,GAAG,CAAC,CAAC;QACZ,KAAK,MAAM,EAAE,IAAI,IAAI;YAAE,GAAG,IAAI,YAAY,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC3D,OAAO,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC;IAC/C,CAAC;IACD,OA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AAiB,EAAE,eAAe,EAAE,OAAO,EAAE,mBAAmB,EAAE;IAC/Q,YAAY,EAAE,EAAE,WAAW,EAAE,oBAAoB,EAAE,UAAU,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,EAAE,UAAU,EAAE,QAAQ,EAAE,iBAAiB,EAAE,eAAe,EAAE,OAAO,EAAE,gCAAgC,EAAE;CACjR,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,WAAW,EAAE,4FAA4F;IACzG,OAAO,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,cAAc,EAAE,OAAO,EAAE,cAAc,CAAC;CAC9H,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@robinpath/sms",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"publishConfig": { "access": "public" },
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"exports": { ".": { "import": "./dist/index.js", "types": "./dist/index.d.ts" } },
|
|
9
|
+
"files": ["dist"],
|
|
10
|
+
"scripts": { "build": "tsc", "test": "node --import tsx --test tests/*.test.ts" },
|
|
11
|
+
"peerDependencies": { "@wiredwp/robinpath": ">=0.20.0" },
|
|
12
|
+
"devDependencies": { "@wiredwp/robinpath": "^0.30.1", "tsx": "^4.19.0", "typescript": "^5.6.0" }
|
|
13
|
+
}
|