@sinch/cli 0.1.31-beta.0 → 0.2.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.
Files changed (5) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +228 -220
  3. package/bin/sinch +4 -4
  4. package/dist/index.js +162 -128
  5. package/package.json +79 -71
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2025 Sinch
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.
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Sinch
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.
package/README.md CHANGED
@@ -1,220 +1,228 @@
1
- # Sinch CLI
2
-
3
- > **Official command-line interface for Sinch - Manage Functions, Voice, SMS, and more from your terminal**
4
-
5
- [![npm version](https://img.shields.io/npm/v/@sinch/sinch-cli.svg)](https://www.npmjs.com/package/@sinch/sinch-cli)
6
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
7
-
8
- ## Overview
9
-
10
- The Sinch CLI is your unified developer tool for managing all Sinch products. Currently featuring full support for **Sinch Functions** - create, test, and deploy serverless voice applications. More Sinch products coming soon!
11
-
12
- ## Installation
13
-
14
- ```bash
15
- # Latest stable release (production)
16
- npm install -g @sinch/cli
17
-
18
- # Beta releases (pre-release testing)
19
- npm install -g @sinch/cli@beta
20
-
21
- # Dev channel (bleeding edge - latest from main branch)
22
- npm install -g @sinch/cli@dev
23
- ```
24
-
25
- **Installation Channels:**
26
- - **`@latest`** (default) - Production-ready stable releases
27
- - **`@beta`** - Pre-release versions for testing new features
28
- - **`@dev`** - Cutting-edge builds from main branch (auto-published on every commit)
29
-
30
- ## Prerequisites
31
-
32
- - **Node.js**: 20.0.0 or higher (Node 20 LTS or Node 22 LTS recommended)
33
- - **npm**: 9.0.0 or higher
34
- - **OS**: Windows 10+, macOS 10.15+, or Ubuntu 20.04+
35
-
36
- ## Quick Start
37
-
38
- ### 1. Authenticate with Sinch
39
-
40
- ```bash
41
- sinch auth login
42
- ```
43
-
44
- ### 2. Create a new function
45
-
46
- ```bash
47
- # Interactive mode - choose from templates
48
- sinch functions init
49
-
50
- # Or specify a template directly
51
- # package | function | command | template
52
- sinch functions init simple-voice-ivr
53
- ```
54
-
55
- ### 3. Test locally
56
-
57
- ```bash
58
- cd my-voice-app
59
- sinch functions dev
60
-
61
- # With runtime tunnel for webhooks
62
- sinch functions dev
63
- ```
64
-
65
- ### 4. Deploy to production
66
-
67
- ```bash
68
- sinch functions deploy
69
- ```
70
-
71
- ### 5. Monitor your function
72
-
73
- ```bash
74
- # List all functions
75
- sinch functions list
76
-
77
- # Stream logs
78
- sinch functions logs <function-id> --follow
79
-
80
- # Check status
81
- sinch functions status <function-id>
82
- ```
83
-
84
- ## Available Commands
85
-
86
- | Command | Description |
87
- |---------|-------------|
88
- | `sinch auth login` | Authenticate with Sinch platform |
89
- | `sinch functions init` | Create new function from template |
90
- | `sinch functions dev` | Start local development server |
91
- | `sinch functions deploy` | Deploy function to production |
92
- | `sinch functions list` | List all deployed functions |
93
- | `sinch functions logs` | Stream function logs |
94
- | `sinch functions delete` | Delete a deployed function |
95
- | `sinch sip trunks list` | List SIP trunks |
96
- | `sinch sip trunks create` | Create a new SIP trunk |
97
- | `sinch sip endpoints list <trunkId>` | List endpoints for a trunk |
98
- | `sinch sip endpoints create <trunkId>` | Create a SIP endpoint |
99
- | `sinch secrets add` | Store secrets securely |
100
- | `sinch templates list` | Browse available templates |
101
- | `sinch help` | Show help for any command |
102
-
103
- ## Templates
104
-
105
- Create functions from pre-built templates:
106
-
107
- ### Voice Templates
108
- - `node/simple-voice-ivr` - Interactive voice menu system
109
- - `node/call-forwarding` - Intelligent call routing
110
- - `node/number-masking` - Privacy-preserving calls
111
- - `node/conference-call` - Multi-party conferences
112
- - `node/voicemail` - Complete voicemail system
113
-
114
- ### More Languages
115
- - `csharp/simple-voice-ivr` - IVR in C#/.NET
116
- - `java/simple-voice-ivr` - Q4 2025
117
-
118
- ## Features
119
-
120
- ### 🔐 Secure Secrets Management
121
- Secrets are stored in your OS keychain (Windows Credential Manager, macOS Keychain, Linux Secret Service):
122
-
123
- ```bash
124
- # Add a secret
125
- sinch secrets add STRIPE_KEY sk_test_123456
126
-
127
- # List secrets
128
- sinch secrets list
129
-
130
- # Use in your function
131
- const stripeKey = process.env.STRIPE_KEY;
132
- ```
133
-
134
- ### 🔄 Hot Reload Development
135
- Changes to your function are automatically reloaded:
136
-
137
- ```bash
138
- sinch functions dev --watch
139
- ```
140
-
141
- ### 🐛 VS Code Debugging
142
- All templates include VS Code launch configs. Just press F5 to debug!
143
-
144
- ### 🌐 Tunnel Support
145
- Test webhooks locally with runtime-integrated tunneling:
146
-
147
- ```bash
148
- sinch functions dev
149
- # Choose tunnel preference when prompted
150
- # Tunnel runs inside your function runtime
151
- ```
152
-
153
- ### 📞 Elastic SIP Trunking
154
- Manage SIP trunks and endpoints for voice connectivity:
155
-
156
- ```bash
157
- # List your SIP trunks
158
- sinch sip trunks list
159
-
160
- # Create a new trunk (interactive)
161
- sinch sip trunks create
162
-
163
- # Add an endpoint to a trunk
164
- sinch sip endpoints create <trunk-id>
165
-
166
- # Get JSON output for scripting
167
- sinch sip trunks list --json
168
- ```
169
-
170
- ## Documentation
171
-
172
- - **Full Documentation**: [/docs/README.md](./docs/README.md)
173
- - **Command Reference**: [/docs/COMMANDS.md](./docs/COMMANDS.md)
174
- - **Development Guide**: [/docs/DEVELOPMENT.md](./docs/DEVELOPMENT.md)
175
- - **Examples**: [/docs/examples/](./docs/examples/)
176
-
177
- ## Resources
178
-
179
- - **Sinch Voice API**: https://www.sinch.com/products/apis/voice/
180
- - **Documentation**: Full CLI reference in [/docs](./docs/README.md)
181
- - **Templates Gallery**: Browse available templates with `sinch templates list`
182
-
183
- ## Troubleshooting
184
-
185
- ### Authentication Issues
186
-
187
- ```bash
188
- # Check authentication status
189
- sinch auth status
190
-
191
- # Re-authenticate if needed
192
- sinch auth logout
193
- sinch auth login
194
- ```
195
-
196
- ### Debug Mode
197
-
198
- ```bash
199
- # Enable debug output
200
- DEBUG=1 sinch functions dev
201
-
202
- # HTTP request debugging
203
- DEBUG_HTTP=1 sinch functions deploy
204
- ```
205
-
206
- ### Common Issues
207
-
208
- - **Command not found**: Reinstall globally with `npm install -g @sinch/sinch-cli@beta`
209
- - **Authentication failed**: Check your Sinch API credentials with `sinch auth status`
210
- - **Deployment failed**: Verify your function configuration and project access
211
-
212
- ## Support
213
-
214
- - **Documentation**: [Full CLI Documentation](./docs/README.md)
215
- - **Issues**: [Report a Bug](https://gitlab.com/sinch/sinch-projects/voice/functions/sinch-cli/-/issues)
216
- - **Email**: support@sinch.com
217
-
218
- ## License
219
-
220
- MIT License - Copyright © 2025 Sinch
1
+ # Sinch CLI
2
+
3
+ > **Official command-line interface for Sinch - Manage Functions, Voice, SMS, and more from your terminal**
4
+
5
+ [![npm version](https://img.shields.io/npm/v/@sinch/sinch-cli.svg)](https://www.npmjs.com/package/@sinch/sinch-cli)
6
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
7
+
8
+ ## Overview
9
+
10
+ The Sinch CLI is your unified developer tool for managing all Sinch products. Currently featuring full support for **Sinch Functions** - create, test, and deploy serverless voice applications. More Sinch products coming soon!
11
+
12
+ ## Installation
13
+
14
+ ```bash
15
+ # Latest stable release (production)
16
+ npm install -g @sinch/cli
17
+
18
+ # Beta releases (pre-release testing)
19
+ npm install -g @sinch/cli@beta
20
+
21
+ # Dev channel (bleeding edge - latest from main branch)
22
+ npm install -g @sinch/cli@dev
23
+ ```
24
+
25
+ **Installation Channels:**
26
+
27
+ - **`@latest`** (default) - Production-ready stable releases
28
+ - **`@beta`** - Pre-release versions for testing new features
29
+ - **`@dev`** - Cutting-edge builds from main branch (auto-published on every commit)
30
+
31
+ ## Prerequisites
32
+
33
+ - **Node.js**: 20.0.0 or higher (Node 20 LTS or Node 22 LTS recommended)
34
+ - **npm**: 9.0.0 or higher
35
+ - **OS**: Windows 10+, macOS 10.15+, or Ubuntu 20.04+
36
+
37
+ ## Quick Start
38
+
39
+ ### 1. Authenticate with Sinch
40
+
41
+ ```bash
42
+ sinch auth login
43
+ ```
44
+
45
+ ### 2. Create a new function
46
+
47
+ ```bash
48
+ # Interactive mode - choose from templates
49
+ sinch functions init
50
+
51
+ # Or specify a template directly
52
+ # package | function | command | template
53
+ sinch functions init simple-voice-ivr
54
+ ```
55
+
56
+ ### 3. Test locally
57
+
58
+ ```bash
59
+ cd my-voice-app
60
+ sinch functions dev
61
+
62
+ # With runtime tunnel for webhooks
63
+ sinch functions dev
64
+ ```
65
+
66
+ ### 4. Deploy to production
67
+
68
+ ```bash
69
+ sinch functions deploy
70
+ ```
71
+
72
+ ### 5. Monitor your function
73
+
74
+ ```bash
75
+ # List all functions
76
+ sinch functions list
77
+
78
+ # Stream logs
79
+ sinch functions logs <function-id> --follow
80
+
81
+ # Check status
82
+ sinch functions status <function-id>
83
+ ```
84
+
85
+ ## Available Commands
86
+
87
+ | Command | Description |
88
+ | -------------------------------------- | --------------------------------- |
89
+ | `sinch auth login` | Authenticate with Sinch platform |
90
+ | `sinch functions init` | Create new function from template |
91
+ | `sinch functions dev` | Start local development server |
92
+ | `sinch functions deploy` | Deploy function to production |
93
+ | `sinch functions list` | List all deployed functions |
94
+ | `sinch functions logs` | Stream function logs |
95
+ | `sinch functions delete` | Delete a deployed function |
96
+ | `sinch sip trunks list` | List SIP trunks |
97
+ | `sinch sip trunks create` | Create a new SIP trunk |
98
+ | `sinch sip endpoints list <trunkId>` | List endpoints for a trunk |
99
+ | `sinch sip endpoints create <trunkId>` | Create a SIP endpoint |
100
+ | `sinch secrets add` | Store secrets securely |
101
+ | `sinch templates list` | Browse available templates |
102
+ | `sinch help` | Show help for any command |
103
+
104
+ ## Templates
105
+
106
+ Create functions from pre-built templates:
107
+
108
+ ### Voice Templates
109
+
110
+ - `node/simple-voice-ivr` - Interactive voice menu system
111
+ - `node/call-forwarding` - Intelligent call routing
112
+ - `node/number-masking` - Privacy-preserving calls
113
+ - `node/conference-call` - Multi-party conferences
114
+ - `node/voicemail` - Complete voicemail system
115
+
116
+ ### More Languages
117
+
118
+ - `csharp/simple-voice-ivr` - IVR in C#/.NET
119
+ - `java/simple-voice-ivr` - Q4 2025
120
+
121
+ ## Features
122
+
123
+ ### 🔐 Secure Secrets Management
124
+
125
+ Secrets are stored in your OS keychain (Windows Credential Manager, macOS Keychain, Linux Secret Service):
126
+
127
+ ```bash
128
+ # Add a secret
129
+ sinch secrets add STRIPE_KEY sk_test_123456
130
+
131
+ # List secrets
132
+ sinch secrets list
133
+
134
+ # Use in your function
135
+ const stripeKey = process.env.STRIPE_KEY;
136
+ ```
137
+
138
+ ### 🔄 Hot Reload Development
139
+
140
+ Changes to your function are automatically reloaded:
141
+
142
+ ```bash
143
+ sinch functions dev --watch
144
+ ```
145
+
146
+ ### 🐛 VS Code Debugging
147
+
148
+ All templates include VS Code launch configs. Just press F5 to debug!
149
+
150
+ ### 🌐 Tunnel Support
151
+
152
+ Test webhooks locally with runtime-integrated tunneling:
153
+
154
+ ```bash
155
+ sinch functions dev
156
+ # Choose tunnel preference when prompted
157
+ # Tunnel runs inside your function runtime
158
+ ```
159
+
160
+ ### 📞 Elastic SIP Trunking
161
+
162
+ Manage SIP trunks and endpoints for voice connectivity:
163
+
164
+ ```bash
165
+ # List your SIP trunks
166
+ sinch sip trunks list
167
+
168
+ # Create a new trunk (interactive)
169
+ sinch sip trunks create
170
+
171
+ # Add an endpoint to a trunk
172
+ sinch sip endpoints create <trunk-id>
173
+
174
+ # Get JSON output for scripting
175
+ sinch sip trunks list --json
176
+ ```
177
+
178
+ ## Documentation
179
+
180
+ - **Full Documentation**: [/docs/README.md](./docs/README.md)
181
+ - **Command Reference**: [/docs/COMMANDS.md](./docs/COMMANDS.md)
182
+ - **Development Guide**: [/docs/DEVELOPMENT.md](./docs/DEVELOPMENT.md)
183
+ - **Examples**: [/docs/examples/](./docs/examples/)
184
+
185
+ ## Resources
186
+
187
+ - **Sinch Voice API**: https://www.sinch.com/products/apis/voice/
188
+ - **Documentation**: Full CLI reference in [/docs](./docs/README.md)
189
+ - **Templates Gallery**: Browse available templates with `sinch templates list`
190
+
191
+ ## Troubleshooting
192
+
193
+ ### Authentication Issues
194
+
195
+ ```bash
196
+ # Check authentication status
197
+ sinch auth status
198
+
199
+ # Re-authenticate if needed
200
+ sinch auth logout
201
+ sinch auth login
202
+ ```
203
+
204
+ ### Debug Mode
205
+
206
+ ```bash
207
+ # Enable debug output
208
+ DEBUG=1 sinch functions dev
209
+
210
+ # HTTP request debugging
211
+ DEBUG_HTTP=1 sinch functions deploy
212
+ ```
213
+
214
+ ### Common Issues
215
+
216
+ - **Command not found**: Reinstall globally with `npm install -g @sinch/sinch-cli@beta`
217
+ - **Authentication failed**: Check your Sinch API credentials with `sinch auth status`
218
+ - **Deployment failed**: Verify your function configuration and project access
219
+
220
+ ## Support
221
+
222
+ - **Documentation**: [Full CLI Documentation](./docs/README.md)
223
+ - **Issues**: [Report a Bug](https://gitlab.com/sinch/sinch-projects/voice/functions/sinch-cli/-/issues)
224
+ - **Email**: support@sinch.com
225
+
226
+ ## License
227
+
228
+ MIT License - Copyright © 2025 Sinch
package/bin/sinch CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env node
2
-
3
- // Use compiled TypeScript output
4
- require('../dist/index.js');
1
+ #!/usr/bin/env node
2
+
3
+ // Use compiled TypeScript output
4
+ require('../dist/index.js');