@stacksjs/sms 0.57.3 โ 0.58.19
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 +4 -4
- package/dist/index.js +240 -0
- package/package.json +43 -32
- package/LICENSE.md +0 -21
- package/dist/drivers/gupshup.d.ts +0 -0
- package/dist/drivers/gupshup.mjs +0 -16
- package/dist/drivers/index.d.ts +0 -8
- package/dist/drivers/index.mjs +0 -8
- package/dist/drivers/nexmo.d.ts +0 -0
- package/dist/drivers/nexmo.mjs +0 -18
- package/dist/drivers/plivo.d.ts +0 -0
- package/dist/drivers/plivo.mjs +0 -18
- package/dist/drivers/sms77.d.ts +0 -0
- package/dist/drivers/sms77.mjs +0 -17
- package/dist/drivers/sns.d.ts +0 -0
- package/dist/drivers/sns.mjs +0 -17
- package/dist/drivers/telnyx.d.ts +0 -0
- package/dist/drivers/telnyx.mjs +0 -18
- package/dist/drivers/termii.d.ts +0 -0
- package/dist/drivers/termii.mjs +0 -17
- package/dist/drivers/twilio.d.ts +0 -0
- package/dist/drivers/twilio.mjs +0 -18
- package/dist/index.d.ts +0 -1
- package/dist/index.mjs +0 -1
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@ Stacks SMS is driver system for sending SMS messages.
|
|
|
9
9
|
## ๐ค Usage
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
|
-
|
|
12
|
+
bun install -d @stacksjs/sms
|
|
13
13
|
```
|
|
14
14
|
|
|
15
15
|
You may now use it in your project:
|
|
@@ -101,7 +101,7 @@ Learn more in the docs.
|
|
|
101
101
|
## ๐งช Testing
|
|
102
102
|
|
|
103
103
|
```bash
|
|
104
|
-
|
|
104
|
+
bun test
|
|
105
105
|
```
|
|
106
106
|
|
|
107
107
|
## ๐ Changelog
|
|
@@ -120,7 +120,7 @@ For help, discussion about best practices, or any other conversation that would
|
|
|
120
120
|
|
|
121
121
|
For casual chit-chat with others using this package:
|
|
122
122
|
|
|
123
|
-
[Join the Stacks Discord Server](https://discord.
|
|
123
|
+
[Join the Stacks Discord Server](https://discord.gg/stacksjs)
|
|
124
124
|
|
|
125
125
|
## ๐๐ผ Credits
|
|
126
126
|
|
|
@@ -134,4 +134,4 @@ Many thanks to the following core technologies & people who have contributed to
|
|
|
134
134
|
|
|
135
135
|
The MIT License (MIT). Please see [LICENSE](https://github.com/stacksjs/stacks/tree/main/LICENSE.md) for more information.
|
|
136
136
|
|
|
137
|
-
Made with
|
|
137
|
+
Made with ๐
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __export = (target, all) => {
|
|
3
|
+
for (var name in all)
|
|
4
|
+
__defProp(target, name, {
|
|
5
|
+
get: all[name],
|
|
6
|
+
enumerable: true,
|
|
7
|
+
configurable: true,
|
|
8
|
+
set: (newValue) => all[name] = () => newValue
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
// src/drivers/twilio.ts
|
|
13
|
+
var exports_twilio = {};
|
|
14
|
+
__export(exports_twilio, {
|
|
15
|
+
send: () => {
|
|
16
|
+
{
|
|
17
|
+
return send;
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
Send: () => {
|
|
21
|
+
{
|
|
22
|
+
return send;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
import {TwilioSmsProvider} from "@novu/twilio";
|
|
27
|
+
import {italic} from "@stacksjs/cli";
|
|
28
|
+
import {ResultAsync} from "@stacksjs/error-handling";
|
|
29
|
+
import {notification} from "@stacksjs/config";
|
|
30
|
+
var send = function(options) {
|
|
31
|
+
return ResultAsync.fromPromise(provider.sendMessage(options), () => new Error(`Failed to send message using provider: ${italic("Twilio")}`));
|
|
32
|
+
};
|
|
33
|
+
var from = notification.sms?.from;
|
|
34
|
+
var env = notification.sms?.drivers.twilio;
|
|
35
|
+
var provider = new TwilioSmsProvider({
|
|
36
|
+
accountSid: env?.sid,
|
|
37
|
+
authToken: env?.authToken,
|
|
38
|
+
from: from || ""
|
|
39
|
+
});
|
|
40
|
+
// src/drivers/plivo.ts
|
|
41
|
+
var exports_plivo = {};
|
|
42
|
+
__export(exports_plivo, {
|
|
43
|
+
send: () => {
|
|
44
|
+
{
|
|
45
|
+
return send2;
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
Send: () => {
|
|
49
|
+
{
|
|
50
|
+
return send2;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
import {PlivoSmsProvider} from "@novu/plivo";
|
|
55
|
+
import {italic as italic2} from "@stacksjs/cli";
|
|
56
|
+
import {ResultAsync as ResultAsync2} from "@stacksjs/error-handling";
|
|
57
|
+
import {notification as notification2} from "@stacksjs/config";
|
|
58
|
+
var send2 = function(options) {
|
|
59
|
+
return ResultAsync2.fromPromise(provider2.sendMessage(options), () => new Error(`Failed to send message using provider: ${italic2("Plivo")}`));
|
|
60
|
+
};
|
|
61
|
+
var from2 = notification2.sms?.from;
|
|
62
|
+
var env2 = notification2.sms?.drivers.plivo;
|
|
63
|
+
var provider2 = new PlivoSmsProvider({
|
|
64
|
+
accountSid: env2?.sid,
|
|
65
|
+
authToken: env2?.authToken,
|
|
66
|
+
from: from2 || ""
|
|
67
|
+
});
|
|
68
|
+
// src/drivers/nexmo.ts
|
|
69
|
+
var exports_nexmo = {};
|
|
70
|
+
__export(exports_nexmo, {
|
|
71
|
+
send: () => {
|
|
72
|
+
{
|
|
73
|
+
return send3;
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
Send: () => {
|
|
77
|
+
{
|
|
78
|
+
return send3;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
import {NexmoSmsProvider} from "@novu/nexmo";
|
|
83
|
+
import {italic as italic3} from "@stacksjs/cli";
|
|
84
|
+
import {ResultAsync as ResultAsync3} from "@stacksjs/error-handling";
|
|
85
|
+
import {notification as notification3} from "@stacksjs/config";
|
|
86
|
+
var send3 = function(options) {
|
|
87
|
+
return ResultAsync3.fromPromise(provider3.sendMessage(options), () => new Error(`Failed to send message using provider: ${italic3("Nexmo")}`));
|
|
88
|
+
};
|
|
89
|
+
var from3 = notification3.sms?.from;
|
|
90
|
+
var env3 = notification3.sms?.drivers.nexmo;
|
|
91
|
+
var provider3 = new NexmoSmsProvider({
|
|
92
|
+
apiKey: env3?.key || "",
|
|
93
|
+
apiSecret: env3?.secret || "",
|
|
94
|
+
from: from3 || ""
|
|
95
|
+
});
|
|
96
|
+
// src/drivers/sms77.ts
|
|
97
|
+
var exports_sms77 = {};
|
|
98
|
+
__export(exports_sms77, {
|
|
99
|
+
send: () => {
|
|
100
|
+
{
|
|
101
|
+
return send4;
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
Send: () => {
|
|
105
|
+
{
|
|
106
|
+
return send4;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
import {Sms77SmsProvider} from "@novu/sms77";
|
|
111
|
+
import {italic as italic4} from "@stacksjs/cli";
|
|
112
|
+
import {ResultAsync as ResultAsync4} from "@stacksjs/error-handling";
|
|
113
|
+
import {notification as notification4} from "@stacksjs/config";
|
|
114
|
+
var send4 = function(options) {
|
|
115
|
+
return ResultAsync4.fromPromise(provider4.sendMessage(options), () => new Error(`Failed to send message using provider: ${italic4("Sms77")}`));
|
|
116
|
+
};
|
|
117
|
+
var from4 = notification4.sms?.from;
|
|
118
|
+
var env4 = notification4.sms?.drivers.sms77;
|
|
119
|
+
var provider4 = new Sms77SmsProvider({
|
|
120
|
+
apiKey: env4?.key,
|
|
121
|
+
from: from4
|
|
122
|
+
});
|
|
123
|
+
// src/drivers/sns.ts
|
|
124
|
+
var exports_sns = {};
|
|
125
|
+
__export(exports_sns, {
|
|
126
|
+
send: () => {
|
|
127
|
+
{
|
|
128
|
+
return send5;
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
Send: () => {
|
|
132
|
+
{
|
|
133
|
+
return send5;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
import {SNSSmsProvider} from "@novu/sns";
|
|
138
|
+
import {italic as italic5} from "@stacksjs/cli";
|
|
139
|
+
import {ResultAsync as ResultAsync5} from "@stacksjs/error-handling";
|
|
140
|
+
import {notification as notification5} from "@stacksjs/config";
|
|
141
|
+
var send5 = function(options) {
|
|
142
|
+
return ResultAsync5.fromPromise(provider5.sendMessage(options), () => new Error(`Failed to send message using provider: ${italic5("SNS")}`));
|
|
143
|
+
};
|
|
144
|
+
var env5 = notification5.sms?.drivers.sns;
|
|
145
|
+
var provider5 = new SNSSmsProvider({
|
|
146
|
+
region: env5?.region,
|
|
147
|
+
accessKeyId: env5?.key,
|
|
148
|
+
secretAccessKey: env5?.secret
|
|
149
|
+
});
|
|
150
|
+
// src/drivers/gupshup.ts
|
|
151
|
+
var exports_gupshup = {};
|
|
152
|
+
__export(exports_gupshup, {
|
|
153
|
+
send: () => {
|
|
154
|
+
{
|
|
155
|
+
return send6;
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
Send: () => {
|
|
159
|
+
{
|
|
160
|
+
return send6;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
import {GupshupSmsProvider} from "@novu/gupshup";
|
|
165
|
+
import {italic as italic6} from "@stacksjs/cli";
|
|
166
|
+
import {ResultAsync as ResultAsync6} from "@stacksjs/error-handling";
|
|
167
|
+
import {notification as notification6} from "@stacksjs/config";
|
|
168
|
+
var send6 = function(options) {
|
|
169
|
+
return ResultAsync6.fromPromise(provider6.sendMessage(options), () => new Error(`Failed to send message using provider: ${italic6("Gupshup")}`));
|
|
170
|
+
};
|
|
171
|
+
var env6 = notification6.sms?.drivers.gupshup;
|
|
172
|
+
var provider6 = new GupshupSmsProvider({
|
|
173
|
+
userId: env6?.user || "",
|
|
174
|
+
password: env6?.password || ""
|
|
175
|
+
});
|
|
176
|
+
// src/drivers/telnyx.ts
|
|
177
|
+
var exports_telnyx = {};
|
|
178
|
+
__export(exports_telnyx, {
|
|
179
|
+
send: () => {
|
|
180
|
+
{
|
|
181
|
+
return send7;
|
|
182
|
+
}
|
|
183
|
+
},
|
|
184
|
+
Send: () => {
|
|
185
|
+
{
|
|
186
|
+
return send7;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
});
|
|
190
|
+
import {TelnyxSmsProvider} from "@novu/telnyx";
|
|
191
|
+
import {italic as italic7} from "@stacksjs/cli";
|
|
192
|
+
import {ResultAsync as ResultAsync7} from "@stacksjs/error-handling";
|
|
193
|
+
import {notification as notification7} from "@stacksjs/config";
|
|
194
|
+
var send7 = function(options) {
|
|
195
|
+
return ResultAsync7.fromPromise(provider7.sendMessage(options), () => new Error(`Failed to send message using provider: ${italic7("Telnyx")}`));
|
|
196
|
+
};
|
|
197
|
+
var from5 = notification7.sms?.from;
|
|
198
|
+
var env7 = notification7.sms?.drivers.telnyx;
|
|
199
|
+
var provider7 = new TelnyxSmsProvider({
|
|
200
|
+
apiKey: env7?.key,
|
|
201
|
+
messageProfileId: env7?.messageProfileId,
|
|
202
|
+
from: from5 || ""
|
|
203
|
+
});
|
|
204
|
+
// src/drivers/termii.ts
|
|
205
|
+
var exports_termii = {};
|
|
206
|
+
__export(exports_termii, {
|
|
207
|
+
send: () => {
|
|
208
|
+
{
|
|
209
|
+
return send8;
|
|
210
|
+
}
|
|
211
|
+
},
|
|
212
|
+
Send: () => {
|
|
213
|
+
{
|
|
214
|
+
return send8;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
});
|
|
218
|
+
import {TermiiSmsProvider} from "@novu/termii";
|
|
219
|
+
import {italic as italic8} from "@stacksjs/cli";
|
|
220
|
+
import {ResultAsync as ResultAsync8} from "@stacksjs/error-handling";
|
|
221
|
+
import {notification as notification8} from "@stacksjs/config";
|
|
222
|
+
var send8 = function(options) {
|
|
223
|
+
return ResultAsync8.fromPromise(provider8.sendMessage(options), () => new Error(`Failed to send message using provider: ${italic8("Termii")}`));
|
|
224
|
+
};
|
|
225
|
+
var from6 = notification8.sms?.from;
|
|
226
|
+
var env8 = notification8.sms?.drivers.termii;
|
|
227
|
+
var provider8 = new TermiiSmsProvider({
|
|
228
|
+
apiKey: env8?.key,
|
|
229
|
+
from: from6 || ""
|
|
230
|
+
});
|
|
231
|
+
export {
|
|
232
|
+
exports_twilio as twilio,
|
|
233
|
+
exports_termii as termii,
|
|
234
|
+
exports_telnyx as telnyx,
|
|
235
|
+
exports_sns as sns,
|
|
236
|
+
exports_sms77 as sms77,
|
|
237
|
+
exports_plivo as plivo,
|
|
238
|
+
exports_nexmo as nexmo,
|
|
239
|
+
exports_gupshup as gupshup
|
|
240
|
+
};
|
package/package.json
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/sms",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
5
|
-
"packageManager": "pnpm@8.6.6",
|
|
4
|
+
"version": "0.58.19",
|
|
6
5
|
"description": "The Stacks SMS integration. Painlessly create & manage your inboxes, templates, and send sms.",
|
|
7
6
|
"author": "Chris Breuer",
|
|
8
7
|
"license": "MIT",
|
|
9
8
|
"funding": "https://github.com/sponsors/chrisbbreuer",
|
|
10
|
-
"homepage": "https://github.com/stacksjs/stacks/tree/main
|
|
9
|
+
"homepage": "https://github.com/stacksjs/stacks/tree/main/storage/framework/core/src/sms#readme",
|
|
11
10
|
"repository": {
|
|
12
11
|
"type": "git",
|
|
13
12
|
"url": "git+https://github.com/stacksjs/stacks.git",
|
|
14
|
-
"directory": "
|
|
13
|
+
"directory": "./storage/framework/core/src/sms"
|
|
15
14
|
},
|
|
16
15
|
"bugs": {
|
|
17
16
|
"url": "https://github.com/stacksjs/stacks/issues"
|
|
@@ -30,42 +29,54 @@
|
|
|
30
29
|
],
|
|
31
30
|
"exports": {
|
|
32
31
|
".": {
|
|
33
|
-
"
|
|
34
|
-
"import": "./dist/index.
|
|
32
|
+
"bun": "./src/index.ts",
|
|
33
|
+
"import": "./dist/index.js"
|
|
34
|
+
},
|
|
35
|
+
"./*": {
|
|
36
|
+
"bun": "./src/*",
|
|
37
|
+
"import": "./dist/*"
|
|
35
38
|
}
|
|
36
39
|
},
|
|
37
|
-
"module": "dist/index.
|
|
40
|
+
"module": "dist/index.js",
|
|
38
41
|
"types": "dist/index.d.ts",
|
|
39
42
|
"contributors": [
|
|
40
|
-
"Chris Breuer <chris@
|
|
43
|
+
"Chris Breuer <chris@stacksjs.org>"
|
|
41
44
|
],
|
|
42
45
|
"files": [
|
|
43
|
-
"
|
|
44
|
-
"
|
|
46
|
+
"README.md",
|
|
47
|
+
"dist"
|
|
45
48
|
],
|
|
49
|
+
"scripts": {
|
|
50
|
+
"build": "bun --bun build.ts",
|
|
51
|
+
"typecheck": "bun --bun tsc --noEmit",
|
|
52
|
+
"prepublishOnly": "bun --bun run build"
|
|
53
|
+
},
|
|
46
54
|
"peerDependencies": {
|
|
47
|
-
"@
|
|
48
|
-
"@
|
|
49
|
-
"@
|
|
50
|
-
"@
|
|
51
|
-
"@novu/sms77": "^0.16.2",
|
|
52
|
-
"@novu/sns": "^0.16.2",
|
|
53
|
-
"@novu/stateless": "^0.16.2",
|
|
54
|
-
"@novu/telnyx": "^0.16.2",
|
|
55
|
-
"@novu/termii": "^0.16.2",
|
|
56
|
-
"@novu/twilio": "^0.16.2",
|
|
57
|
-
"@stacksjs/cli": "0.57.3",
|
|
58
|
-
"@stacksjs/config": "0.57.3",
|
|
59
|
-
"@stacksjs/error-handling": "0.57.3",
|
|
60
|
-
"@stacksjs/types": "0.57.3"
|
|
55
|
+
"@stacksjs/cli": "workspace:*",
|
|
56
|
+
"@stacksjs/config": "workspace:*",
|
|
57
|
+
"@stacksjs/error-handling": "workspace:*",
|
|
58
|
+
"@stacksjs/types": "workspace:*"
|
|
61
59
|
},
|
|
62
|
-
"
|
|
63
|
-
"@stacksjs/
|
|
64
|
-
"@stacksjs/
|
|
60
|
+
"dependencies": {
|
|
61
|
+
"@stacksjs/cli": "workspace:*",
|
|
62
|
+
"@stacksjs/config": "workspace:*",
|
|
63
|
+
"@stacksjs/error-handling": "workspace:*",
|
|
64
|
+
"@stacksjs/types": "workspace:*"
|
|
65
65
|
},
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"
|
|
66
|
+
"optionalDependencies": {
|
|
67
|
+
"@novu/gupshup": "^0.22.0",
|
|
68
|
+
"@novu/nexmo": "^0.22.0",
|
|
69
|
+
"@novu/node": "^0.22.0",
|
|
70
|
+
"@novu/plivo": "^0.22.0",
|
|
71
|
+
"@novu/sms77": "^0.22.0",
|
|
72
|
+
"@novu/sns": "^0.22.0",
|
|
73
|
+
"@novu/stateless": "^0.22.0",
|
|
74
|
+
"@novu/telnyx": "^0.22.0",
|
|
75
|
+
"@novu/termii": "^0.22.0",
|
|
76
|
+
"@novu/twilio": "^0.22.0"
|
|
77
|
+
},
|
|
78
|
+
"devDependencies": {
|
|
79
|
+
"@stacksjs/config": "workspace:*",
|
|
80
|
+
"@stacksjs/development": "workspace:*"
|
|
70
81
|
}
|
|
71
|
-
}
|
|
82
|
+
}
|
package/LICENSE.md
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
# MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2022 Open Web Foundation
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
File without changes
|
package/dist/drivers/gupshup.mjs
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { GupshupSmsProvider } from "@novu/gupshup";
|
|
2
|
-
import { italic } from "@stacksjs/cli";
|
|
3
|
-
import { ResultAsync } from "@stacksjs/error-handling";
|
|
4
|
-
import { notification } from "@stacksjs/config";
|
|
5
|
-
const env = notification.sms?.drivers.gupshup;
|
|
6
|
-
const provider = new GupshupSmsProvider({
|
|
7
|
-
userId: env?.user || "",
|
|
8
|
-
password: env?.password || ""
|
|
9
|
-
});
|
|
10
|
-
function send(options) {
|
|
11
|
-
return ResultAsync.fromPromise(
|
|
12
|
-
provider.sendMessage(options),
|
|
13
|
-
() => new Error(`Failed to send message using provider: ${italic("Gupshup")}`)
|
|
14
|
-
);
|
|
15
|
-
}
|
|
16
|
-
export { send as Send, send };
|
package/dist/drivers/index.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export * as twilio from './twilio';
|
|
2
|
-
export * as plivo from './plivo';
|
|
3
|
-
export * as nexmo from './nexmo';
|
|
4
|
-
export * as sms77 from './sms77';
|
|
5
|
-
export * as sns from './sns';
|
|
6
|
-
export * as gupshup from './gupshup';
|
|
7
|
-
export * as telnyx from './telnyx';
|
|
8
|
-
export * as termii from './termii';
|
package/dist/drivers/index.mjs
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export * as twilio from "./twilio.mjs";
|
|
2
|
-
export * as plivo from "./plivo.mjs";
|
|
3
|
-
export * as nexmo from "./nexmo.mjs";
|
|
4
|
-
export * as sms77 from "./sms77.mjs";
|
|
5
|
-
export * as sns from "./sns.mjs";
|
|
6
|
-
export * as gupshup from "./gupshup.mjs";
|
|
7
|
-
export * as telnyx from "./telnyx.mjs";
|
|
8
|
-
export * as termii from "./termii.mjs";
|
package/dist/drivers/nexmo.d.ts
DELETED
|
File without changes
|
package/dist/drivers/nexmo.mjs
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { NexmoSmsProvider } from "@novu/nexmo";
|
|
2
|
-
import { italic } from "@stacksjs/cli";
|
|
3
|
-
import { ResultAsync } from "@stacksjs/error-handling";
|
|
4
|
-
import { notification } from "@stacksjs/config";
|
|
5
|
-
const from = notification.sms?.from;
|
|
6
|
-
const env = notification.sms?.drivers.nexmo;
|
|
7
|
-
const provider = new NexmoSmsProvider({
|
|
8
|
-
apiKey: env?.key || "",
|
|
9
|
-
apiSecret: env?.secret || "",
|
|
10
|
-
from: from || ""
|
|
11
|
-
});
|
|
12
|
-
function send(options) {
|
|
13
|
-
return ResultAsync.fromPromise(
|
|
14
|
-
provider.sendMessage(options),
|
|
15
|
-
() => new Error(`Failed to send message using provider: ${italic("Nexmo")}`)
|
|
16
|
-
);
|
|
17
|
-
}
|
|
18
|
-
export { send as Send, send };
|
package/dist/drivers/plivo.d.ts
DELETED
|
File without changes
|
package/dist/drivers/plivo.mjs
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { PlivoSmsProvider } from "@novu/plivo";
|
|
2
|
-
import { italic } from "@stacksjs/cli";
|
|
3
|
-
import { ResultAsync } from "@stacksjs/error-handling";
|
|
4
|
-
import { notification } from "@stacksjs/config";
|
|
5
|
-
const from = notification.sms?.from;
|
|
6
|
-
const env = notification.sms?.drivers.plivo;
|
|
7
|
-
const provider = new PlivoSmsProvider({
|
|
8
|
-
accountSid: env?.sid,
|
|
9
|
-
authToken: env?.authToken,
|
|
10
|
-
from: from || ""
|
|
11
|
-
});
|
|
12
|
-
function send(options) {
|
|
13
|
-
return ResultAsync.fromPromise(
|
|
14
|
-
provider.sendMessage(options),
|
|
15
|
-
() => new Error(`Failed to send message using provider: ${italic("Plivo")}`)
|
|
16
|
-
);
|
|
17
|
-
}
|
|
18
|
-
export { send as Send, send };
|
package/dist/drivers/sms77.d.ts
DELETED
|
File without changes
|
package/dist/drivers/sms77.mjs
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Sms77SmsProvider } from "@novu/sms77";
|
|
2
|
-
import { italic } from "@stacksjs/cli";
|
|
3
|
-
import { ResultAsync } from "@stacksjs/error-handling";
|
|
4
|
-
import { notification } from "@stacksjs/config";
|
|
5
|
-
const from = notification.sms?.from;
|
|
6
|
-
const env = notification.sms?.drivers.sms77;
|
|
7
|
-
const provider = new Sms77SmsProvider({
|
|
8
|
-
apiKey: env?.key,
|
|
9
|
-
from
|
|
10
|
-
});
|
|
11
|
-
function send(options) {
|
|
12
|
-
return ResultAsync.fromPromise(
|
|
13
|
-
provider.sendMessage(options),
|
|
14
|
-
() => new Error(`Failed to send message using provider: ${italic("Sms77")}`)
|
|
15
|
-
);
|
|
16
|
-
}
|
|
17
|
-
export { send as Send, send };
|
package/dist/drivers/sns.d.ts
DELETED
|
File without changes
|
package/dist/drivers/sns.mjs
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { SNSSmsProvider } from "@novu/sns";
|
|
2
|
-
import { italic } from "@stacksjs/cli";
|
|
3
|
-
import { ResultAsync } from "@stacksjs/error-handling";
|
|
4
|
-
import { notification } from "@stacksjs/config";
|
|
5
|
-
const env = notification.sms?.drivers.sns;
|
|
6
|
-
const provider = new SNSSmsProvider({
|
|
7
|
-
region: env?.region,
|
|
8
|
-
accessKeyId: env?.key,
|
|
9
|
-
secretAccessKey: env?.secret
|
|
10
|
-
});
|
|
11
|
-
function send(options) {
|
|
12
|
-
return ResultAsync.fromPromise(
|
|
13
|
-
provider.sendMessage(options),
|
|
14
|
-
() => new Error(`Failed to send message using provider: ${italic("SNS")}`)
|
|
15
|
-
);
|
|
16
|
-
}
|
|
17
|
-
export { send as Send, send };
|
package/dist/drivers/telnyx.d.ts
DELETED
|
File without changes
|
package/dist/drivers/telnyx.mjs
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { TelnyxSmsProvider } from "@novu/telnyx";
|
|
2
|
-
import { italic } from "@stacksjs/cli";
|
|
3
|
-
import { ResultAsync } from "@stacksjs/error-handling";
|
|
4
|
-
import { notification } from "@stacksjs/config";
|
|
5
|
-
const from = notification.sms?.from;
|
|
6
|
-
const env = notification.sms?.drivers.telnyx;
|
|
7
|
-
const provider = new TelnyxSmsProvider({
|
|
8
|
-
apiKey: env?.key,
|
|
9
|
-
messageProfileId: env?.messageProfileId,
|
|
10
|
-
from: from || ""
|
|
11
|
-
});
|
|
12
|
-
function send(options) {
|
|
13
|
-
return ResultAsync.fromPromise(
|
|
14
|
-
provider.sendMessage(options),
|
|
15
|
-
() => new Error(`Failed to send message using provider: ${italic("Telnyx")}`)
|
|
16
|
-
);
|
|
17
|
-
}
|
|
18
|
-
export { send as Send, send };
|
package/dist/drivers/termii.d.ts
DELETED
|
File without changes
|
package/dist/drivers/termii.mjs
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { TermiiSmsProvider } from "@novu/termii";
|
|
2
|
-
import { italic } from "@stacksjs/cli";
|
|
3
|
-
import { ResultAsync } from "@stacksjs/error-handling";
|
|
4
|
-
import { notification } from "@stacksjs/config";
|
|
5
|
-
const from = notification.sms?.from;
|
|
6
|
-
const env = notification.sms?.drivers.termii;
|
|
7
|
-
const provider = new TermiiSmsProvider({
|
|
8
|
-
apiKey: env?.key,
|
|
9
|
-
from: from || ""
|
|
10
|
-
});
|
|
11
|
-
function send(options) {
|
|
12
|
-
return ResultAsync.fromPromise(
|
|
13
|
-
provider.sendMessage(options),
|
|
14
|
-
() => new Error(`Failed to send message using provider: ${italic("Termii")}`)
|
|
15
|
-
);
|
|
16
|
-
}
|
|
17
|
-
export { send as Send, send };
|
package/dist/drivers/twilio.d.ts
DELETED
|
File without changes
|
package/dist/drivers/twilio.mjs
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { TwilioSmsProvider } from "@novu/twilio";
|
|
2
|
-
import { italic } from "@stacksjs/cli";
|
|
3
|
-
import { ResultAsync } from "@stacksjs/error-handling";
|
|
4
|
-
import { notification } from "@stacksjs/config";
|
|
5
|
-
const from = notification.sms?.from;
|
|
6
|
-
const env = notification.sms?.drivers.twilio;
|
|
7
|
-
const provider = new TwilioSmsProvider({
|
|
8
|
-
accountSid: env?.sid,
|
|
9
|
-
authToken: env?.authToken,
|
|
10
|
-
from: from || ""
|
|
11
|
-
});
|
|
12
|
-
function send(options) {
|
|
13
|
-
return ResultAsync.fromPromise(
|
|
14
|
-
provider.sendMessage(options),
|
|
15
|
-
() => new Error(`Failed to send message using provider: ${italic("Twilio")}`)
|
|
16
|
-
);
|
|
17
|
-
}
|
|
18
|
-
export { send as Send, send };
|
package/dist/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './drivers';
|
package/dist/index.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./drivers/index.mjs";
|