@nauth-toolkit/sms-aws-sns 0.1.3
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/LICENSE +90 -0
- package/README.md +163 -0
- package/dist/aws-sms-config.interface.d.ts +8 -0
- package/dist/aws-sms-config.interface.d.ts.map +1 -0
- package/dist/aws-sms-config.interface.js +3 -0
- package/dist/aws-sms-config.interface.js.map +1 -0
- package/dist/aws-sms.provider.d.ts +14 -0
- package/dist/aws-sms.provider.d.ts.map +1 -0
- package/dist/aws-sms.provider.js +92 -0
- package/dist/aws-sms.provider.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/package.json +49 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
NAUTH TOOLKIT EARLY ACCESS LICENSE
|
|
2
|
+
Version 1.0 (December 2025)
|
|
3
|
+
|
|
4
|
+
================================================================================
|
|
5
|
+
FUTURE OPEN SOURCE NOTICE
|
|
6
|
+
================================================================================
|
|
7
|
+
NAuth Toolkit will transition to an open-source license (MIT or Apache 2.0) for
|
|
8
|
+
core authentication features once the project reaches production readiness.
|
|
9
|
+
|
|
10
|
+
This Early Access License is temporary and designed to:
|
|
11
|
+
• Allow developers to build with nauth-toolkit during preview/beta
|
|
12
|
+
• Provide clear expectations during the pre-release phase
|
|
13
|
+
• Enable feedback and real-world testing before GA
|
|
14
|
+
|
|
15
|
+
We're committed to keeping core auth free and open source. Premium features
|
|
16
|
+
(enterprise SSO, advanced compliance, hosted options) will be offered separately
|
|
17
|
+
under fair commercial terms.
|
|
18
|
+
|
|
19
|
+
================================================================================
|
|
20
|
+
EARLY ACCESS LICENSE TERMS
|
|
21
|
+
================================================================================
|
|
22
|
+
|
|
23
|
+
1. Grant of Use
|
|
24
|
+
You are granted a free, non-exclusive, non-transferable license to:
|
|
25
|
+
- Install and use nauth-toolkit packages in development, testing, staging,
|
|
26
|
+
and production environments
|
|
27
|
+
- Modify the code for your own internal use
|
|
28
|
+
- Deploy applications using nauth-toolkit to serve your users
|
|
29
|
+
|
|
30
|
+
You may NOT:
|
|
31
|
+
- Redistribute NAuth Toolkit as a standalone product or service
|
|
32
|
+
- Sell, sublicense, or offer NAuth Toolkit as part of a competing auth
|
|
33
|
+
platform or toolkit
|
|
34
|
+
- Remove or alter copyright notices
|
|
35
|
+
|
|
36
|
+
2. No Fees During Early Access
|
|
37
|
+
There are no license fees, subscription costs, or usage charges during the
|
|
38
|
+
Early Access period. You may use nauth-toolkit freely for commercial and
|
|
39
|
+
non-commercial purposes within the terms of this license.
|
|
40
|
+
|
|
41
|
+
3. Production Use
|
|
42
|
+
Production use is permitted but comes with standard early-access caveats:
|
|
43
|
+
- Features and APIs may change between preview releases
|
|
44
|
+
- Support is community-based (GitHub issues/discussions)
|
|
45
|
+
- No SLA or guaranteed uptime (you run it on your infrastructure)
|
|
46
|
+
|
|
47
|
+
We recommend thorough testing and having rollback plans for critical systems.
|
|
48
|
+
|
|
49
|
+
4. Future Transition
|
|
50
|
+
When nauth-toolkit releases v1.0 GA:
|
|
51
|
+
- Core packages will adopt an open-source license (MIT or Apache 2.0)
|
|
52
|
+
- Your existing deployments will continue to work
|
|
53
|
+
- Premium features (if any) will be clearly documented with separate licensing
|
|
54
|
+
- No forced upgrades or surprise fees
|
|
55
|
+
|
|
56
|
+
5. Ownership
|
|
57
|
+
NAuth Toolkit is developed and maintained by Noorix Digital Solutions.
|
|
58
|
+
You retain full ownership of your applications and data.
|
|
59
|
+
|
|
60
|
+
6. Data and Privacy
|
|
61
|
+
NAuth Toolkit runs in YOUR infrastructure and database. You control all data.
|
|
62
|
+
You are responsible for compliance with applicable data protection laws.
|
|
63
|
+
|
|
64
|
+
7. Disclaimer of Warranty
|
|
65
|
+
THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
66
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
67
|
+
FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
|
|
68
|
+
|
|
69
|
+
8. Limitation of Liability
|
|
70
|
+
IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY INDIRECT, INCIDENTAL,
|
|
71
|
+
SPECIAL, CONSEQUENTIAL, OR EXEMPLARY DAMAGES, INCLUDING BUT NOT LIMITED TO LOSS
|
|
72
|
+
OF PROFITS, REVENUE, DATA, OR USE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
|
|
73
|
+
DAMAGES.
|
|
74
|
+
|
|
75
|
+
9. Termination
|
|
76
|
+
This license remains in effect until:
|
|
77
|
+
- You stop using nauth-toolkit, or
|
|
78
|
+
- The project transitions to open source (at which point the new license applies)
|
|
79
|
+
|
|
80
|
+
If you breach these terms, your license terminates and you must stop using the
|
|
81
|
+
software.
|
|
82
|
+
|
|
83
|
+
10. Contact and Support
|
|
84
|
+
- Documentation: https://nauth.dev
|
|
85
|
+
- Issues/Discussions: GitHub (when public repository launches)
|
|
86
|
+
- Commercial inquiries: Contact admin@noorix.com
|
|
87
|
+
|
|
88
|
+
================================================================================
|
|
89
|
+
Thank you for being an early adopter. Your feedback shapes the future of NAuth.
|
|
90
|
+
================================================================================
|
package/README.md
ADDED
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
# @nauth-toolkit/sms-aws-sns
|
|
2
|
+
|
|
3
|
+
AWS SNS SMS provider for nauth-toolkit.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- ✅ **Platform-Agnostic** - Pure TypeScript, zero framework dependencies
|
|
8
|
+
- ✅ **AWS SNS** - Reliable SMS delivery via AWS Simple Notification Service
|
|
9
|
+
- ✅ **Transactional** - All messages sent with highest priority
|
|
10
|
+
- ✅ **Simple** - Minimal configuration, lean implementation
|
|
11
|
+
- ✅ **Configuration Sets** - Optional CloudWatch metrics and event tracking
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
yarn add @nauth-toolkit/sms-aws-sns
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
**Note:** `@aws-sdk/client-sns` is automatically installed as a dependency.
|
|
20
|
+
|
|
21
|
+
## Usage
|
|
22
|
+
|
|
23
|
+
### With IAM Role (Recommended)
|
|
24
|
+
|
|
25
|
+
```typescript
|
|
26
|
+
import { AWSSMSProvider, AWSSMSConfig } from '@nauth-toolkit/sms-aws-sns';
|
|
27
|
+
import { AuthModule } from '@nauth-toolkit/nestjs';
|
|
28
|
+
|
|
29
|
+
// Credentials auto-discovered from IAM role (EC2, ECS, Lambda)
|
|
30
|
+
const config: AWSSMSConfig = {
|
|
31
|
+
region: 'us-east-1',
|
|
32
|
+
originationNumber: '+12345678901',
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
@Module({
|
|
36
|
+
imports: [
|
|
37
|
+
AuthModule.forRoot({
|
|
38
|
+
sms: {
|
|
39
|
+
provider: new AWSSMSProvider(config),
|
|
40
|
+
},
|
|
41
|
+
}),
|
|
42
|
+
],
|
|
43
|
+
})
|
|
44
|
+
export class AppModule {}
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### With Explicit Credentials
|
|
48
|
+
|
|
49
|
+
```typescript
|
|
50
|
+
// If not using IAM role, provide credentials explicitly
|
|
51
|
+
const config: AWSSMSConfig = {
|
|
52
|
+
region: 'us-east-1',
|
|
53
|
+
accessKeyId: process.env.AWS_ACCESS_KEY_ID!,
|
|
54
|
+
secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY!,
|
|
55
|
+
originationNumber: '+12345678901',
|
|
56
|
+
};
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### With Configuration Set
|
|
60
|
+
|
|
61
|
+
```typescript
|
|
62
|
+
const config: AWSSMSConfig = {
|
|
63
|
+
region: 'us-east-1',
|
|
64
|
+
originationNumber: '+12345678901',
|
|
65
|
+
configurationSetName: 'my-sms-tracking', // Optional: for CloudWatch metrics
|
|
66
|
+
};
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Configuration
|
|
70
|
+
|
|
71
|
+
### Required
|
|
72
|
+
|
|
73
|
+
- `region`: AWS Region (e.g., `'us-east-1'`)
|
|
74
|
+
- `originationNumber`: Phone number (E.164) or sender ID
|
|
75
|
+
|
|
76
|
+
### Optional
|
|
77
|
+
|
|
78
|
+
- `accessKeyId`: AWS Access Key ID (auto-discovered if not provided)
|
|
79
|
+
- `secretAccessKey`: AWS Secret Access Key (required if accessKeyId provided)
|
|
80
|
+
- `configurationSetName`: AWS SNS configuration set name
|
|
81
|
+
|
|
82
|
+
### Credential Discovery
|
|
83
|
+
|
|
84
|
+
AWS SDK automatically discovers credentials from:
|
|
85
|
+
1. **IAM Instance Role** (EC2, ECS, Lambda) - Recommended
|
|
86
|
+
2. **Environment Variables** (`AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`)
|
|
87
|
+
3. **AWS Credentials File** (`~/.aws/credentials`)
|
|
88
|
+
4. **AWS Profile** (`AWS_PROFILE` environment variable)
|
|
89
|
+
|
|
90
|
+
Only provide `accessKeyId` and `secretAccessKey` if none of the above are available.
|
|
91
|
+
|
|
92
|
+
### Origination Number
|
|
93
|
+
|
|
94
|
+
**US/Canada** - Must use phone number:
|
|
95
|
+
```typescript
|
|
96
|
+
originationNumber: '+12345678901' // E.164 format
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
**Other Regions** - Can use sender ID:
|
|
100
|
+
```typescript
|
|
101
|
+
originationNumber: 'MyApp' // Alphanumeric, max 11 chars
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
## AWS Setup
|
|
105
|
+
|
|
106
|
+
### 1. IAM Permissions
|
|
107
|
+
|
|
108
|
+
```json
|
|
109
|
+
{
|
|
110
|
+
"Version": "2012-10-17",
|
|
111
|
+
"Statement": [
|
|
112
|
+
{
|
|
113
|
+
"Effect": "Allow",
|
|
114
|
+
"Action": ["sns:Publish"],
|
|
115
|
+
"Resource": "*"
|
|
116
|
+
}
|
|
117
|
+
]
|
|
118
|
+
}
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### 2. Origination Number
|
|
122
|
+
|
|
123
|
+
**US/Canada:**
|
|
124
|
+
- Go to AWS Console → Amazon Pinpoint → Phone numbers
|
|
125
|
+
- Request a phone number (long code or toll-free)
|
|
126
|
+
- Use in `originationNumber`
|
|
127
|
+
|
|
128
|
+
**Other Regions:**
|
|
129
|
+
- Can use alphanumeric sender ID (no setup required in most countries)
|
|
130
|
+
|
|
131
|
+
### 3. Configuration Set (Optional)
|
|
132
|
+
|
|
133
|
+
Configure in AWS Console for:
|
|
134
|
+
- CloudWatch metrics
|
|
135
|
+
- Delivery status tracking
|
|
136
|
+
- Event destinations (Kinesis, SQS)
|
|
137
|
+
- Spend limits
|
|
138
|
+
|
|
139
|
+
Reference the configuration set name in your config:
|
|
140
|
+
```typescript
|
|
141
|
+
configurationSetName: 'my-sms-tracking'
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
## Platform-Agnostic Design
|
|
145
|
+
|
|
146
|
+
This package is **framework-agnostic** and works with:
|
|
147
|
+
|
|
148
|
+
- ✅ **NestJS** (via `@nauth-toolkit/nestjs`)
|
|
149
|
+
- 🚧 **Express** (adapter coming soon)
|
|
150
|
+
- 🚧 **Fastify** (adapter coming soon)
|
|
151
|
+
|
|
152
|
+
The `AWSSMSProvider` is a pure TypeScript class with no framework dependencies.
|
|
153
|
+
|
|
154
|
+
## Related Packages
|
|
155
|
+
|
|
156
|
+
- `@nauth-toolkit/core` - Core authentication services
|
|
157
|
+
- `@nauth-toolkit/sms-console` - Console SMS provider (dev only)
|
|
158
|
+
- `@nauth-toolkit/nestjs` - NestJS adapter (for NestJS apps)
|
|
159
|
+
|
|
160
|
+
## License
|
|
161
|
+
|
|
162
|
+
MIT
|
|
163
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aws-sms-config.interface.d.ts","sourceRoot":"","sources":["../src/aws-sms-config.interface.ts"],"names":[],"mappings":"AA8BA,MAAM,WAAW,YAAY;IAK3B,MAAM,EAAE,MAAM,CAAC;IAUf,WAAW,CAAC,EAAE,MAAM,CAAC;IAOrB,eAAe,CAAC,EAAE,MAAM,CAAC;IAWzB,iBAAiB,EAAE,MAAM,CAAC;IAe1B,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aws-sms-config.interface.js","sourceRoot":"","sources":["../src/aws-sms-config.interface.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { SMSProvider } from '@nauth-toolkit/core';
|
|
2
|
+
import { AWSSMSConfig } from './aws-sms-config.interface';
|
|
3
|
+
export declare class AWSSMSProvider implements SMSProvider {
|
|
4
|
+
private readonly logger;
|
|
5
|
+
private readonly snsClient;
|
|
6
|
+
private readonly config;
|
|
7
|
+
private SNSClientClass;
|
|
8
|
+
private PublishCommandClass;
|
|
9
|
+
constructor(config: AWSSMSConfig);
|
|
10
|
+
sendOTP(phone: string, code: string): Promise<void>;
|
|
11
|
+
sendVerificationCode(phone: string, code: string): Promise<void>;
|
|
12
|
+
private sendSMS;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=aws-sms.provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aws-sms.provider.d.ts","sourceRoot":"","sources":["../src/aws-sms.provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAA8C,MAAM,qBAAqB,CAAC;AAC9F,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAuB1D,qBAAa,cAAe,YAAW,WAAW;IAChD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAc;IACrC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAY;IACtC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAe;IAEtC,OAAO,CAAC,cAAc,CAAa;IAEnC,OAAO,CAAC,mBAAmB,CAAa;gBAE5B,MAAM,EAAE,YAAY;IAyE1B,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAenD,oBAAoB,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;YAsBxD,OAAO;CAiEtB"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AWSSMSProvider = void 0;
|
|
4
|
+
const core_1 = require("@nauth-toolkit/core");
|
|
5
|
+
class AWSSMSProvider {
|
|
6
|
+
logger;
|
|
7
|
+
snsClient;
|
|
8
|
+
config;
|
|
9
|
+
SNSClientClass = null;
|
|
10
|
+
PublishCommandClass = null;
|
|
11
|
+
constructor(config) {
|
|
12
|
+
this.logger = new core_1.NAuthLogger();
|
|
13
|
+
this.config = config;
|
|
14
|
+
if (!config.region || !config.originationNumber) {
|
|
15
|
+
throw new core_1.NAuthException(core_1.AuthErrorCode.VALIDATION_FAILED, 'AWS SMS Provider: region and originationNumber are required');
|
|
16
|
+
}
|
|
17
|
+
if (config.accessKeyId && !config.secretAccessKey) {
|
|
18
|
+
throw new core_1.NAuthException(core_1.AuthErrorCode.VALIDATION_FAILED, 'AWS SMS Provider: secretAccessKey is required when accessKeyId is provided');
|
|
19
|
+
}
|
|
20
|
+
try {
|
|
21
|
+
const awsSdk = require('@aws-sdk/client-sns');
|
|
22
|
+
this.SNSClientClass = awsSdk.SNSClient;
|
|
23
|
+
this.PublishCommandClass = awsSdk.PublishCommand;
|
|
24
|
+
}
|
|
25
|
+
catch (error) {
|
|
26
|
+
throw new core_1.NAuthException(core_1.AuthErrorCode.INTERNAL_ERROR, 'AWS SMS Provider: Failed to load @aws-sdk/client-sns. Ensure @nauth-toolkit/sms-aws-sns is properly installed.');
|
|
27
|
+
}
|
|
28
|
+
const clientConfig = { region: config.region };
|
|
29
|
+
if (config.accessKeyId && config.secretAccessKey) {
|
|
30
|
+
clientConfig.credentials = {
|
|
31
|
+
accessKeyId: config.accessKeyId,
|
|
32
|
+
secretAccessKey: config.secretAccessKey,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
this.snsClient = new this.SNSClientClass(clientConfig);
|
|
36
|
+
this.logger.log(`AWS SMS Provider initialized (region: ${config.region})`);
|
|
37
|
+
}
|
|
38
|
+
async sendOTP(phone, code) {
|
|
39
|
+
const message = `Your verification code is: ${code}`;
|
|
40
|
+
await this.sendSMS(phone, message);
|
|
41
|
+
}
|
|
42
|
+
async sendVerificationCode(phone, code) {
|
|
43
|
+
await this.sendOTP(phone, code);
|
|
44
|
+
}
|
|
45
|
+
async sendSMS(phone, message) {
|
|
46
|
+
try {
|
|
47
|
+
const messageAttributes = {
|
|
48
|
+
'AWS.SNS.SMS.SMSType': {
|
|
49
|
+
DataType: 'String',
|
|
50
|
+
StringValue: 'Transactional',
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
const isPhoneNumber = this.config.originationNumber.startsWith('+');
|
|
54
|
+
if (isPhoneNumber) {
|
|
55
|
+
messageAttributes['AWS.MM.SMS.OriginationNumber'] = {
|
|
56
|
+
DataType: 'String',
|
|
57
|
+
StringValue: this.config.originationNumber,
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
messageAttributes['AWS.SNS.SMS.SenderID'] = {
|
|
62
|
+
DataType: 'String',
|
|
63
|
+
StringValue: this.config.originationNumber,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
const input = {
|
|
67
|
+
PhoneNumber: phone,
|
|
68
|
+
Message: message,
|
|
69
|
+
MessageAttributes: messageAttributes,
|
|
70
|
+
};
|
|
71
|
+
if (this.config.configurationSetName) {
|
|
72
|
+
input.MessageAttributes['AWS.SNS.SMS.ConfigurationSetName'] = {
|
|
73
|
+
DataType: 'String',
|
|
74
|
+
StringValue: this.config.configurationSetName,
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
if (!this.PublishCommandClass) {
|
|
78
|
+
throw new core_1.NAuthException(core_1.AuthErrorCode.INTERNAL_ERROR, 'AWS SDK not initialized');
|
|
79
|
+
}
|
|
80
|
+
const command = new this.PublishCommandClass(input);
|
|
81
|
+
const response = await this.snsClient.send(command);
|
|
82
|
+
this.logger.log(`SMS sent to ${phone} (MessageId: ${response.MessageId})`);
|
|
83
|
+
}
|
|
84
|
+
catch (error) {
|
|
85
|
+
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
86
|
+
this.logger.error(`AWS SMS failed: ${errorMessage}`);
|
|
87
|
+
throw new core_1.NAuthException(core_1.AuthErrorCode.INTERNAL_ERROR, `AWS SMS delivery failed: ${errorMessage}`);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
exports.AWSSMSProvider = AWSSMSProvider;
|
|
92
|
+
//# sourceMappingURL=aws-sms.provider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aws-sms.provider.js","sourceRoot":"","sources":["../src/aws-sms.provider.ts"],"names":[],"mappings":";;;AAAA,8CAA8F;AAwB9F,MAAa,cAAc;IACR,MAAM,CAAc;IACpB,SAAS,CAAY;IACrB,MAAM,CAAe;IAE9B,cAAc,GAAQ,IAAI,CAAC;IAE3B,mBAAmB,GAAQ,IAAI,CAAC;IAExC,YAAY,MAAoB;QAC9B,IAAI,CAAC,MAAM,GAAG,IAAI,kBAAW,EAAE,CAAC;QAChC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QAGrB,IAAI,CAAC,MAAM,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,iBAAiB,EAAE,CAAC;YAChD,MAAM,IAAI,qBAAc,CACt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AAC,CAAC;YACpD,MAAM,QAAQ,GAAG,MAAO,IAAI,CAAC,SAAyE,CAAC,IAAI,CACzG,OAAO,CACR,CAAC;YAEF,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,eAAe,KAAK,gBAAgB,QAAQ,CAAC,SAAS,GAAG,CAAC,CAAC;QAC7E,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,YAAY,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,CAAC;YAC9E,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,mBAAmB,YAAY,EAAE,CAAC,CAAC;YACrD,MAAM,IAAI,qBAAc,CAAC,oBAAa,CAAC,cAAc,EAAE,4BAA4B,YAAY,EAAE,CAAC,CAAC;QACrG,CAAC;IACH,CAAC;CACF;AAxLD,wCAwLC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AWSSMSProvider = void 0;
|
|
4
|
+
var aws_sms_provider_1 = require("./aws-sms.provider");
|
|
5
|
+
Object.defineProperty(exports, "AWSSMSProvider", { enumerable: true, get: function () { return aws_sms_provider_1.AWSSMSProvider; } });
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAMA,uDAAoD;AAA3C,kHAAA,cAAc,OAAA"}
|
package/package.json
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@nauth-toolkit/sms-aws-sns",
|
|
3
|
+
"version": "0.1.3",
|
|
4
|
+
"description": "AWS SNS SMS provider for nauth-toolkit",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"build": "tsc -b",
|
|
9
|
+
"clean": "rm -rf dist *.tsbuildinfo",
|
|
10
|
+
"test": "jest --passWithNoTests",
|
|
11
|
+
"lint": "eslint src --ext .ts",
|
|
12
|
+
"lint:fix": "eslint src --ext .ts --fix",
|
|
13
|
+
"format": "prettier --write \"src/**/*.ts\"",
|
|
14
|
+
"format:check": "prettier --check \"src/**/*.ts\""
|
|
15
|
+
},
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"@aws-sdk/client-sns": "^3.0.0"
|
|
18
|
+
},
|
|
19
|
+
"peerDependencies": {
|
|
20
|
+
"@nauth-toolkit/core": "^0.1.3"
|
|
21
|
+
},
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"@types/jest": "^29.5.0",
|
|
24
|
+
"@types/node": "^22.0.0",
|
|
25
|
+
"jest": "^29.7.0",
|
|
26
|
+
"ts-jest": "^29.2.0",
|
|
27
|
+
"typescript": "^5.5.0"
|
|
28
|
+
},
|
|
29
|
+
"engines": {
|
|
30
|
+
"node": ">=22.0.0"
|
|
31
|
+
},
|
|
32
|
+
"publishConfig": {
|
|
33
|
+
"access": "public",
|
|
34
|
+
"tag": "preview"
|
|
35
|
+
},
|
|
36
|
+
"license": "UNLICENSED",
|
|
37
|
+
"keywords": [
|
|
38
|
+
"nestjs",
|
|
39
|
+
"authentication",
|
|
40
|
+
"sms",
|
|
41
|
+
"aws",
|
|
42
|
+
"sns"
|
|
43
|
+
],
|
|
44
|
+
"files": [
|
|
45
|
+
"dist",
|
|
46
|
+
"LICENSE",
|
|
47
|
+
"README.md"
|
|
48
|
+
]
|
|
49
|
+
}
|