@venturialstd/twilio 0.0.7 → 0.0.8
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 +83 -83
- package/dist/twilio.module.d.ts.map +1 -1
- package/dist/twilio.module.js +0 -1
- package/dist/twilio.module.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,83 +1,83 @@
|
|
|
1
|
-
# @venturialstd/twilio
|
|
2
|
-
|
|
3
|
-
A NestJS module for integrating Twilio messaging services (SMS, WhatsApp) into Venturial applications.
|
|
4
|
-
|
|
5
|
-
## Features
|
|
6
|
-
|
|
7
|
-
- **Twilio Client**: Wrapper for Twilio SDK with dynamic configuration
|
|
8
|
-
- **Message Service**: Send SMS and WhatsApp messages
|
|
9
|
-
- **Webhook Support**: Handle incoming messages via webhooks
|
|
10
|
-
- **Event-Driven**: Event emitter integration for message handling
|
|
11
|
-
- **Settings Integration**: Dynamic configuration via Venturial's SettingsService
|
|
12
|
-
|
|
13
|
-
## Installation
|
|
14
|
-
|
|
15
|
-
```bash
|
|
16
|
-
npm install @venturialstd/twilio
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
## Usage
|
|
20
|
-
|
|
21
|
-
### Import the Module
|
|
22
|
-
|
|
23
|
-
```typescript
|
|
24
|
-
import { Module } from '@nestjs/common';
|
|
25
|
-
import { TwilioModule } from '@venturialstd/twilio';
|
|
26
|
-
|
|
27
|
-
@Module({
|
|
28
|
-
imports: [TwilioModule],
|
|
29
|
-
})
|
|
30
|
-
export class AppModule {}
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
### Send Messages
|
|
34
|
-
|
|
35
|
-
```typescript
|
|
36
|
-
import { TwilioMessageService } from '@venturialstd/twilio';
|
|
37
|
-
|
|
38
|
-
@Injectable()
|
|
39
|
-
export class MyService {
|
|
40
|
-
constructor(private readonly twilioService: TwilioMessageService) {}
|
|
41
|
-
|
|
42
|
-
async sendSMS(to: string, message: string) {
|
|
43
|
-
await this.twilioService.sendMessage(null, to, message);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
### Webhook Controller
|
|
49
|
-
|
|
50
|
-
The module includes a webhook controller at `/general/twilio/webhook` that handles incoming Twilio messages and emits events.
|
|
51
|
-
|
|
52
|
-
### Settings
|
|
53
|
-
|
|
54
|
-
The module uses Venturial's SettingsService for configuration. Configure the following settings:
|
|
55
|
-
|
|
56
|
-
- `GLOBAL:TWILIO:GENERAL:ENABLED` - Enable/disable the module
|
|
57
|
-
- `GLOBAL:TWILIO:GENERAL:ACCOUNT_SID` - Twilio Account SID
|
|
58
|
-
- `GLOBAL:TWILIO:GENERAL:AUTH_TOKEN` - Twilio Auth Token
|
|
59
|
-
- `GLOBAL:TWILIO:GENERAL:PHONE_NUMBER` - Twilio Phone Number
|
|
60
|
-
|
|
61
|
-
## Events
|
|
62
|
-
|
|
63
|
-
The module emits the following events:
|
|
64
|
-
|
|
65
|
-
- `webhook_incoming_message` - When a message is received via webhook
|
|
66
|
-
- `send_message` - Trigger to send a message (handled by TwilioMessageListener)
|
|
67
|
-
|
|
68
|
-
## Development
|
|
69
|
-
|
|
70
|
-
```bash
|
|
71
|
-
# Build
|
|
72
|
-
npm run build
|
|
73
|
-
|
|
74
|
-
# Test
|
|
75
|
-
npm run test:dev
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
## Publishing
|
|
79
|
-
|
|
80
|
-
```bash
|
|
81
|
-
# Build and publish patch version
|
|
82
|
-
npm run release:patch
|
|
83
|
-
```
|
|
1
|
+
# @venturialstd/twilio
|
|
2
|
+
|
|
3
|
+
A NestJS module for integrating Twilio messaging services (SMS, WhatsApp) into Venturial applications.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Twilio Client**: Wrapper for Twilio SDK with dynamic configuration
|
|
8
|
+
- **Message Service**: Send SMS and WhatsApp messages
|
|
9
|
+
- **Webhook Support**: Handle incoming messages via webhooks
|
|
10
|
+
- **Event-Driven**: Event emitter integration for message handling
|
|
11
|
+
- **Settings Integration**: Dynamic configuration via Venturial's SettingsService
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install @venturialstd/twilio
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
### Import the Module
|
|
22
|
+
|
|
23
|
+
```typescript
|
|
24
|
+
import { Module } from '@nestjs/common';
|
|
25
|
+
import { TwilioModule } from '@venturialstd/twilio';
|
|
26
|
+
|
|
27
|
+
@Module({
|
|
28
|
+
imports: [TwilioModule],
|
|
29
|
+
})
|
|
30
|
+
export class AppModule {}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Send Messages
|
|
34
|
+
|
|
35
|
+
```typescript
|
|
36
|
+
import { TwilioMessageService } from '@venturialstd/twilio';
|
|
37
|
+
|
|
38
|
+
@Injectable()
|
|
39
|
+
export class MyService {
|
|
40
|
+
constructor(private readonly twilioService: TwilioMessageService) {}
|
|
41
|
+
|
|
42
|
+
async sendSMS(to: string, message: string) {
|
|
43
|
+
await this.twilioService.sendMessage(null, to, message);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Webhook Controller
|
|
49
|
+
|
|
50
|
+
The module includes a webhook controller at `/general/twilio/webhook` that handles incoming Twilio messages and emits events.
|
|
51
|
+
|
|
52
|
+
### Settings
|
|
53
|
+
|
|
54
|
+
The module uses Venturial's SettingsService for configuration. Configure the following settings:
|
|
55
|
+
|
|
56
|
+
- `GLOBAL:TWILIO:GENERAL:ENABLED` - Enable/disable the module
|
|
57
|
+
- `GLOBAL:TWILIO:GENERAL:ACCOUNT_SID` - Twilio Account SID
|
|
58
|
+
- `GLOBAL:TWILIO:GENERAL:AUTH_TOKEN` - Twilio Auth Token
|
|
59
|
+
- `GLOBAL:TWILIO:GENERAL:PHONE_NUMBER` - Twilio Phone Number
|
|
60
|
+
|
|
61
|
+
## Events
|
|
62
|
+
|
|
63
|
+
The module emits the following events:
|
|
64
|
+
|
|
65
|
+
- `webhook_incoming_message` - When a message is received via webhook
|
|
66
|
+
- `send_message` - Trigger to send a message (handled by TwilioMessageListener)
|
|
67
|
+
|
|
68
|
+
## Development
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
# Build
|
|
72
|
+
npm run build
|
|
73
|
+
|
|
74
|
+
# Test
|
|
75
|
+
npm run test:dev
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Publishing
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
# Build and publish patch version
|
|
82
|
+
npm run release:patch
|
|
83
|
+
```
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"twilio.module.d.ts","sourceRoot":"","sources":["../src/twilio.module.ts"],"names":[],"mappings":"AAiBA,
|
|
1
|
+
{"version":3,"file":"twilio.module.d.ts","sourceRoot":"","sources":["../src/twilio.module.ts"],"names":[],"mappings":"AAiBA,qBA+Ba,YAAY;CAAG"}
|
package/dist/twilio.module.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"twilio.module.js","sourceRoot":"","sources":["../src/twilio.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,yDAA2D;AAC3D,6CAAgD;AAChD,6CAAkD;AAElD,2DAAuD;AACvD,+FAAiG;AACjG,iFAA4E;AAC5E,wFAAmF;AACnF,4EAAuE;AACvE,8EAAyE;AACzE,wFAAkF;AAClF,0EAAqE;AACrE,4EAAuE;AACvE,0EAAqE;AACrE,0EAAqE;
|
|
1
|
+
{"version":3,"file":"twilio.module.js","sourceRoot":"","sources":["../src/twilio.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,yDAA2D;AAC3D,6CAAgD;AAChD,6CAAkD;AAElD,2DAAuD;AACvD,+FAAiG;AACjG,iFAA4E;AAC5E,wFAAmF;AACnF,4EAAuE;AACvE,8EAAyE;AACzE,wFAAkF;AAClF,0EAAqE;AACrE,4EAAuE;AACvE,0EAAqE;AACrE,0EAAqE;AAiC9D,IAAM,YAAY,GAAlB,MAAM,YAAY;CAAG,CAAA;AAAf,oCAAY;uBAAZ,YAAY;IA/BxB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,mBAAY;YACZ,kCAAkB;YAClB,uBAAa,CAAC,UAAU,CAAC,EAAE,CAAC;SAC7B;QACD,SAAS,EAAE;YACT,4BAAY;YACZ,6CAAoB;YACpB,yCAAkB;YAClB,2CAAmB;YACnB,yCAAkB;YAClB,uDAAyB;YACzB,sDAAwB;YACxB,2CAAmB;YACnB,yCAAkB;YAClB,+CAAqB;SACtB;QACD,WAAW,EAAE,CAAC,0DAA8B,CAAC;QAC7C,OAAO,EAAE;YACP,4BAAY;YACZ,6CAAoB;YACpB,yCAAkB;YAClB,2CAAmB;YACnB,yCAAkB;YAClB,uDAAyB;YACzB,sDAAwB;YACxB,2CAAmB;YACnB,yCAAkB;SACnB;KACF,CAAC;GACW,YAAY,CAAG"}
|