@stacksjs/sms 0.51.0 → 0.52.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 CHANGED
@@ -16,6 +16,7 @@ You may now use it in your project:
16
16
 
17
17
  ```ts
18
18
  import * as sms from '@stacksjs/sms'
19
+
19
20
  /* Then choose a driver. E.g for twilio */
20
21
  const notification = sms.twilio
21
22
 
@@ -107,7 +108,7 @@ pnpm test
107
108
 
108
109
  Please see our [releases](https://github.com/stacksjs/stacks/releases) page for more information on what has changed recently.
109
110
 
110
- ## 💪🏼 Contributing
111
+ ## 🚜 Contributing
111
112
 
112
113
  Please review the [Contributing Guide](https://github.com/stacksjs/contributing) for details.
113
114
 
@@ -1,4 +1,4 @@
1
1
  import type { SmsOptions } from '@stacksjs/types';
2
2
  import { ResultAsync } from '@stacksjs/error-handling';
3
- declare function send(options: SmsOptions): ResultAsync<import("@novu/stateless").ISendMessageSuccessResponse, Error>;
3
+ declare function send(options: SmsOptions): ResultAsync<import("@stacksjs/types").SendMessageSuccessResponse, Error>;
4
4
  export { send as Send, send };
@@ -2,10 +2,10 @@ import { GupshupSmsProvider } from "@novu/gupshup";
2
2
  import { italic } from "@stacksjs/cli";
3
3
  import { ResultAsync } from "@stacksjs/error-handling";
4
4
  import { notification } from "@stacksjs/config";
5
- const env = notification.sms.gupshup;
5
+ const env = notification.sms?.gupshup;
6
6
  const provider = new GupshupSmsProvider({
7
- userId: env.user,
8
- password: env.password
7
+ userId: env?.user || "",
8
+ password: env?.password || ""
9
9
  });
10
10
  function send(options) {
11
11
  return ResultAsync.fromPromise(
@@ -1,4 +1,4 @@
1
1
  import type { SmsOptions } from '@stacksjs/types';
2
2
  import { ResultAsync } from '@stacksjs/error-handling';
3
- declare function send(options: SmsOptions): ResultAsync<import("@novu/stateless").ISendMessageSuccessResponse, Error>;
3
+ declare function send(options: SmsOptions): ResultAsync<import("@stacksjs/types").SendMessageSuccessResponse, Error>;
4
4
  export { send as Send, send };
@@ -2,11 +2,11 @@ import { NexmoSmsProvider } from "@novu/nexmo";
2
2
  import { italic } from "@stacksjs/cli";
3
3
  import { ResultAsync } from "@stacksjs/error-handling";
4
4
  import { notification } from "@stacksjs/config";
5
- const env = notification.sms.nexmo;
5
+ const env = notification.sms?.nexmo;
6
6
  const provider = new NexmoSmsProvider({
7
- apiKey: env.key,
8
- apiSecret: env.secret,
9
- from: env.from
7
+ apiKey: env?.key || "",
8
+ apiSecret: env?.secret || "",
9
+ from: env?.from || ""
10
10
  });
11
11
  function send(options) {
12
12
  return ResultAsync.fromPromise(
@@ -1,4 +1,4 @@
1
1
  import type { SmsOptions } from '@stacksjs/types';
2
2
  import { ResultAsync } from '@stacksjs/error-handling';
3
- declare function send(options: SmsOptions): ResultAsync<import("@novu/stateless").ISendMessageSuccessResponse, Error>;
3
+ declare function send(options: SmsOptions): ResultAsync<import("@stacksjs/types").SendMessageSuccessResponse, Error>;
4
4
  export { send as Send, send };
@@ -2,11 +2,11 @@ import { PlivoSmsProvider } from "@novu/plivo";
2
2
  import { italic } from "@stacksjs/cli";
3
3
  import { ResultAsync } from "@stacksjs/error-handling";
4
4
  import { notification } from "@stacksjs/config";
5
- const env = notification.sms.plivo;
5
+ const env = notification.sms?.plivo;
6
6
  const provider = new PlivoSmsProvider({
7
- accountSid: env.sid,
8
- authToken: env.authToken,
9
- from: env.from
7
+ accountSid: env?.sid,
8
+ authToken: env?.authToken,
9
+ from: env?.from
10
10
  });
11
11
  function send(options) {
12
12
  return ResultAsync.fromPromise(
@@ -1,4 +1,4 @@
1
1
  import type { SmsOptions } from '@stacksjs/types';
2
2
  import { ResultAsync } from '@stacksjs/error-handling';
3
- declare function send(options: SmsOptions): ResultAsync<import("@novu/stateless").ISendMessageSuccessResponse, Error>;
3
+ declare function send(options: SmsOptions): ResultAsync<import("@stacksjs/types").SendMessageSuccessResponse, Error>;
4
4
  export { send as Send, send };
@@ -2,10 +2,10 @@ import { Sms77SmsProvider } from "@novu/sms77";
2
2
  import { italic } from "@stacksjs/cli";
3
3
  import { ResultAsync } from "@stacksjs/error-handling";
4
4
  import { notification } from "@stacksjs/config";
5
- const env = notification.sms.sms77;
5
+ const env = notification.sms?.sms77;
6
6
  const provider = new Sms77SmsProvider({
7
- apiKey: env.key,
8
- from: env.from
7
+ apiKey: env?.key,
8
+ from: env?.from
9
9
  });
10
10
  function send(options) {
11
11
  return ResultAsync.fromPromise(
@@ -1,4 +1,4 @@
1
1
  import type { SmsOptions } from '@stacksjs/types';
2
2
  import { ResultAsync } from '@stacksjs/error-handling';
3
- declare function send(options: SmsOptions): ResultAsync<import("@novu/stateless").ISendMessageSuccessResponse, Error>;
3
+ declare function send(options: SmsOptions): ResultAsync<import("@stacksjs/types").SendMessageSuccessResponse, Error>;
4
4
  export { send as Send, send };
@@ -2,11 +2,11 @@ import { SNSSmsProvider } from "@novu/sns";
2
2
  import { italic } from "@stacksjs/cli";
3
3
  import { ResultAsync } from "@stacksjs/error-handling";
4
4
  import { notification } from "@stacksjs/config";
5
- const env = notification.sms.sns;
5
+ const env = notification.sms?.sns;
6
6
  const provider = new SNSSmsProvider({
7
- region: env.region,
8
- accessKeyId: env.key,
9
- secretAccessKey: env.secret
7
+ region: env?.region,
8
+ accessKeyId: env?.key,
9
+ secretAccessKey: env?.secret
10
10
  });
11
11
  function send(options) {
12
12
  return ResultAsync.fromPromise(
@@ -1,4 +1,4 @@
1
1
  import type { SmsOptions } from '@stacksjs/types';
2
2
  import { ResultAsync } from '@stacksjs/error-handling';
3
- declare function send(options: SmsOptions): ResultAsync<import("@novu/stateless").ISendMessageSuccessResponse, Error>;
3
+ declare function send(options: SmsOptions): ResultAsync<import("@stacksjs/types").SendMessageSuccessResponse, Error>;
4
4
  export { send as Send, send };
@@ -2,11 +2,11 @@ import { TelnyxSmsProvider } from "@novu/telnyx";
2
2
  import { italic } from "@stacksjs/cli";
3
3
  import { ResultAsync } from "@stacksjs/error-handling";
4
4
  import { notification } from "@stacksjs/config";
5
- const env = notification.sms.telnyx;
5
+ const env = notification.sms?.telnyx;
6
6
  const provider = new TelnyxSmsProvider({
7
- apiKey: env.key,
8
- messageProfileId: env.messageProfileId,
9
- from: env.from
7
+ apiKey: env?.key,
8
+ messageProfileId: env?.messageProfileId,
9
+ from: env?.from
10
10
  });
11
11
  function send(options) {
12
12
  return ResultAsync.fromPromise(
@@ -1,4 +1,4 @@
1
1
  import type { SmsOptions } from '@stacksjs/types';
2
2
  import { ResultAsync } from '@stacksjs/error-handling';
3
- declare function send(options: SmsOptions): ResultAsync<import("@novu/stateless").ISendMessageSuccessResponse, Error>;
3
+ declare function send(options: SmsOptions): ResultAsync<import("@stacksjs/types").SendMessageSuccessResponse, Error>;
4
4
  export { send as Send, send };
@@ -2,10 +2,10 @@ import { TermiiSmsProvider } from "@novu/termii";
2
2
  import { italic } from "@stacksjs/cli";
3
3
  import { ResultAsync } from "@stacksjs/error-handling";
4
4
  import { notification } from "@stacksjs/config";
5
- const env = notification.sms.termii;
5
+ const env = notification.sms?.termii;
6
6
  const provider = new TermiiSmsProvider({
7
- apiKey: env.key,
8
- from: env.from
7
+ apiKey: env?.key,
8
+ from: env?.from
9
9
  });
10
10
  function send(options) {
11
11
  return ResultAsync.fromPromise(
@@ -1,4 +1,4 @@
1
1
  import type { SmsOptions } from '@stacksjs/types';
2
2
  import { ResultAsync } from '@stacksjs/error-handling';
3
- declare function send(options: SmsOptions): ResultAsync<import("@novu/stateless").ISendMessageSuccessResponse, Error>;
3
+ declare function send(options: SmsOptions): ResultAsync<import("@stacksjs/types").SendMessageSuccessResponse, Error>;
4
4
  export { send as Send, send };
@@ -2,11 +2,11 @@ import { TwilioSmsProvider } from "@novu/twilio";
2
2
  import { italic } from "@stacksjs/cli";
3
3
  import { ResultAsync } from "@stacksjs/error-handling";
4
4
  import { notification } from "@stacksjs/config";
5
- const env = notification.sms.twilio;
5
+ const env = notification.sms?.twilio;
6
6
  const provider = new TwilioSmsProvider({
7
- accountSid: env.sid,
8
- authToken: env.authToken,
9
- from: env.from
7
+ accountSid: env?.sid,
8
+ authToken: env?.authToken,
9
+ from: env?.from
10
10
  });
11
11
  function send(options) {
12
12
  return ResultAsync.fromPromise(
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@stacksjs/sms",
3
3
  "type": "module",
4
- "version": "0.51.0",
5
- "packageManager": "pnpm@7.26.3",
4
+ "version": "0.52.0",
5
+ "packageManager": "pnpm@8.5.1",
6
6
  "description": "The Stacks SMS integration. Painlessly create & manage your inboxes, templates, and send sms.",
7
7
  "author": "Chris Breuer",
8
8
  "license": "MIT",
@@ -28,7 +28,12 @@
28
28
  "termii",
29
29
  "twilio"
30
30
  ],
31
- "main": "dist/index.mjs",
31
+ "exports": {
32
+ ".": {
33
+ "types": "./dist/index.d.ts",
34
+ "import": "./dist/index.mjs"
35
+ }
36
+ },
32
37
  "module": "dist/index.mjs",
33
38
  "types": "dist/index.d.ts",
34
39
  "contributors": [
@@ -38,34 +43,29 @@
38
43
  "dist",
39
44
  "README.md"
40
45
  ],
41
- "engines": {
42
- "node": ">=v18.14.0",
43
- "pnpm": ">=7.26.3"
44
- },
45
46
  "peerDependencies": {
46
- "@novu/gupshup": "^0.11.0",
47
- "@novu/nexmo": "^0.11.0",
48
- "@novu/node": "^0.11.0",
49
- "@novu/plivo": "^0.11.0",
50
- "@novu/sms77": "^0.11.0",
51
- "@novu/sns": "^0.11.0",
52
- "@novu/stateless": "^0.11.0",
53
- "@novu/telnyx": "^0.11.0",
54
- "@novu/termii": "^0.11.0",
55
- "@novu/twilio": "^0.11.0",
56
- "@stacksjs/cli": "0.51.0",
57
- "@stacksjs/config": "0.51.0",
58
- "@stacksjs/error-handling": "0.51.0",
59
- "@stacksjs/types": "0.51.0"
47
+ "@novu/gupshup": "^0.14.0",
48
+ "@novu/nexmo": "^0.14.0",
49
+ "@novu/node": "^0.14.0",
50
+ "@novu/plivo": "^0.14.0",
51
+ "@novu/sms77": "^0.14.0",
52
+ "@novu/sns": "^0.14.0",
53
+ "@novu/stateless": "^0.14.0",
54
+ "@novu/telnyx": "^0.14.0",
55
+ "@novu/termii": "^0.14.0",
56
+ "@novu/twilio": "^0.14.0",
57
+ "@stacksjs/cli": "0.52.0",
58
+ "@stacksjs/config": "0.52.0",
59
+ "@stacksjs/error-handling": "0.52.0",
60
+ "@stacksjs/types": "0.52.0"
60
61
  },
61
62
  "devDependencies": {
62
- "mkdist": "^1.1.0",
63
- "typescript": "^4.9.5",
64
- "@stacksjs/testing": "0.51.0"
63
+ "@stacksjs/config": "0.52.0",
64
+ "@stacksjs/development": "0.52.0"
65
65
  },
66
66
  "scripts": {
67
- "build": "mkdist -d",
68
- "dev": "mkdist -d",
67
+ "build": "unbuild",
68
+ "dev": "unbuild --stub",
69
69
  "typecheck": "tsc --noEmit"
70
70
  }
71
71
  }