@sinch/cli 0.1.17-beta.0 → 0.1.18-beta.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 +253 -253
  3. package/bin/sinch +2 -2
  4. package/dist/index.js +62 -62
  5. package/package.json +71 -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,254 +1,254 @@
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 secrets add` | Store secrets securely |
96
- | `sinch templates list` | Browse available templates |
97
- | `sinch help` | Show help for any command |
98
-
99
- ## Templates
100
-
101
- Create functions from pre-built templates:
102
-
103
- ### Voice Templates
104
- - `node/simple-voice-ivr` - Interactive voice menu system
105
- - `node/call-forwarding` - Intelligent call routing
106
- - `node/number-masking` - Privacy-preserving calls
107
- - `node/conference-call` - Multi-party conferences
108
- - `node/voicemail` - Complete voicemail system
109
-
110
- ### More Languages
111
- - `csharp/simple-voice-ivr` - IVR in C#/.NET
112
- - `java/simple-voice-ivr` - Q4 2025
113
-
114
- ## Features
115
-
116
- ### 🔐 Secure Secrets Management
117
- Secrets are stored in your OS keychain (Windows Credential Manager, macOS Keychain, Linux Secret Service):
118
-
119
- ```bash
120
- # Add a secret
121
- sinch secrets add STRIPE_KEY sk_test_123456
122
-
123
- # List secrets
124
- sinch secrets list
125
-
126
- # Use in your function
127
- const stripeKey = process.env.STRIPE_KEY;
128
- ```
129
-
130
- ### 🔄 Hot Reload Development
131
- Changes to your function are automatically reloaded:
132
-
133
- ```bash
134
- sinch functions dev --watch
135
- ```
136
-
137
- ### 🐛 VS Code Debugging
138
- All templates include VS Code launch configs. Just press F5 to debug!
139
-
140
- ### 🌐 Tunnel Support
141
- Test webhooks locally with runtime-integrated tunneling:
142
-
143
- ```bash
144
- sinch functions dev
145
- # Choose tunnel preference when prompted
146
- # Tunnel runs inside your function runtime
147
- ```
148
-
149
- ## Documentation
150
-
151
- - **Full Documentation**: [/docs/README.md](./docs/README.md)
152
- - **Command Reference**: [/docs/COMMANDS.md](./docs/COMMANDS.md)
153
- - **Development Guide**: [/docs/DEVELOPMENT.md](./docs/DEVELOPMENT.md)
154
- - **Examples**: [/docs/examples/](./docs/examples/)
155
-
156
- ## Resources
157
-
158
- - **Sinch Voice API**: https://www.sinch.com/products/apis/voice/
159
- - **Documentation**: Full CLI reference in [/docs](./docs/README.md)
160
- - **Templates Gallery**: Browse available templates with `sinch templates list`
161
-
162
- ## Troubleshooting
163
-
164
- ### Authentication Issues
165
-
166
- ```bash
167
- # Check authentication status
168
- sinch auth status
169
-
170
- # Re-authenticate if needed
171
- sinch auth logout
172
- sinch auth login
173
- ```
174
-
175
- ### Debug Mode
176
-
177
- ```bash
178
- # Enable debug output
179
- DEBUG=1 sinch functions dev
180
-
181
- # HTTP request debugging
182
- DEBUG_HTTP=1 sinch functions deploy
183
- ```
184
-
185
- ### Common Issues
186
-
187
- - **Command not found**: Reinstall globally with `npm install -g @sinch/sinch-cli@beta`
188
- - **Authentication failed**: Check your Sinch API credentials with `sinch auth status`
189
- - **Deployment failed**: Verify your function configuration and project access
190
-
191
- ## Support
192
-
193
- - **Documentation**: [Full CLI Documentation](./docs/README.md)
194
- - **Issues**: [Report a Bug](https://gitlab.com/sinch/sinch-projects/voice/functions/sinch-cli/-/issues)
195
- - **Email**: support@sinch.com
196
-
197
- ## Contributing
198
-
199
- Contributions are welcome! Visit our [GitLab repository](https://gitlab.com/sinch/sinch-projects/voice/functions/sinch-cli) for development setup and contribution guidelines.
200
-
201
- ### Release Process
202
-
203
- To publish a new version of the CLI:
204
-
205
- #### 1. Production Release
206
-
207
- ```bash
208
- # Update version in package.json and create git tag
209
- npm version patch # 0.1.0 → 0.1.1 (bug fixes)
210
- npm version minor # 0.1.1 → 0.2.0 (new features)
211
- npm version major # 0.2.0 → 1.0.0 (breaking changes)
212
-
213
- # Or specify exact version
214
- npm version 1.0.0
215
-
216
- # Push commits and tags
217
- git push
218
- git push --tags
219
-
220
- # CI will automatically build and publish to npm @latest
221
- ```
222
-
223
- #### 2. Beta Release
224
-
225
- ```bash
226
- # Create next beta version (recommended)
227
- npm version prepatch --preid=beta # 0.1.13 → 0.1.14-beta.0
228
-
229
- # Or increment existing beta
230
- npm version prerelease --preid=beta # 0.1.14-beta.0 → 0.1.14-beta.1
231
-
232
- # Push commits and tags
233
- git push
234
- git push --tags
235
-
236
- # CI will automatically publish to npm @beta
237
- ```
238
-
239
- #### 3. Dev Releases (Automatic)
240
-
241
- Dev releases are **automatically published** on every commit to `main` with version `X.Y.Z-dev.{PIPELINE_ID}` and tagged as `@dev` on npm.
242
-
243
- **Note**: Always run `npm version` before creating tags. The CI pipeline verifies that package.json version matches the git tag and will fail if they don't match.
244
-
245
- ## License
246
-
247
- MIT License - Copyright © 2025 Sinch
248
-
249
- ---
250
-
251
- **npm**: https://www.npmjs.com/package/@sinch/sinch-cli
252
- **Repository**: https://gitlab.com/sinch/sinch-projects/voice/functions/sinch-cli
253
- **Version**: 0.1.0-beta.1
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 secrets add` | Store secrets securely |
96
+ | `sinch templates list` | Browse available templates |
97
+ | `sinch help` | Show help for any command |
98
+
99
+ ## Templates
100
+
101
+ Create functions from pre-built templates:
102
+
103
+ ### Voice Templates
104
+ - `node/simple-voice-ivr` - Interactive voice menu system
105
+ - `node/call-forwarding` - Intelligent call routing
106
+ - `node/number-masking` - Privacy-preserving calls
107
+ - `node/conference-call` - Multi-party conferences
108
+ - `node/voicemail` - Complete voicemail system
109
+
110
+ ### More Languages
111
+ - `csharp/simple-voice-ivr` - IVR in C#/.NET
112
+ - `java/simple-voice-ivr` - Q4 2025
113
+
114
+ ## Features
115
+
116
+ ### 🔐 Secure Secrets Management
117
+ Secrets are stored in your OS keychain (Windows Credential Manager, macOS Keychain, Linux Secret Service):
118
+
119
+ ```bash
120
+ # Add a secret
121
+ sinch secrets add STRIPE_KEY sk_test_123456
122
+
123
+ # List secrets
124
+ sinch secrets list
125
+
126
+ # Use in your function
127
+ const stripeKey = process.env.STRIPE_KEY;
128
+ ```
129
+
130
+ ### 🔄 Hot Reload Development
131
+ Changes to your function are automatically reloaded:
132
+
133
+ ```bash
134
+ sinch functions dev --watch
135
+ ```
136
+
137
+ ### 🐛 VS Code Debugging
138
+ All templates include VS Code launch configs. Just press F5 to debug!
139
+
140
+ ### 🌐 Tunnel Support
141
+ Test webhooks locally with runtime-integrated tunneling:
142
+
143
+ ```bash
144
+ sinch functions dev
145
+ # Choose tunnel preference when prompted
146
+ # Tunnel runs inside your function runtime
147
+ ```
148
+
149
+ ## Documentation
150
+
151
+ - **Full Documentation**: [/docs/README.md](./docs/README.md)
152
+ - **Command Reference**: [/docs/COMMANDS.md](./docs/COMMANDS.md)
153
+ - **Development Guide**: [/docs/DEVELOPMENT.md](./docs/DEVELOPMENT.md)
154
+ - **Examples**: [/docs/examples/](./docs/examples/)
155
+
156
+ ## Resources
157
+
158
+ - **Sinch Voice API**: https://www.sinch.com/products/apis/voice/
159
+ - **Documentation**: Full CLI reference in [/docs](./docs/README.md)
160
+ - **Templates Gallery**: Browse available templates with `sinch templates list`
161
+
162
+ ## Troubleshooting
163
+
164
+ ### Authentication Issues
165
+
166
+ ```bash
167
+ # Check authentication status
168
+ sinch auth status
169
+
170
+ # Re-authenticate if needed
171
+ sinch auth logout
172
+ sinch auth login
173
+ ```
174
+
175
+ ### Debug Mode
176
+
177
+ ```bash
178
+ # Enable debug output
179
+ DEBUG=1 sinch functions dev
180
+
181
+ # HTTP request debugging
182
+ DEBUG_HTTP=1 sinch functions deploy
183
+ ```
184
+
185
+ ### Common Issues
186
+
187
+ - **Command not found**: Reinstall globally with `npm install -g @sinch/sinch-cli@beta`
188
+ - **Authentication failed**: Check your Sinch API credentials with `sinch auth status`
189
+ - **Deployment failed**: Verify your function configuration and project access
190
+
191
+ ## Support
192
+
193
+ - **Documentation**: [Full CLI Documentation](./docs/README.md)
194
+ - **Issues**: [Report a Bug](https://gitlab.com/sinch/sinch-projects/voice/functions/sinch-cli/-/issues)
195
+ - **Email**: support@sinch.com
196
+
197
+ ## Contributing
198
+
199
+ Contributions are welcome! Visit our [GitLab repository](https://gitlab.com/sinch/sinch-projects/voice/functions/sinch-cli) for development setup and contribution guidelines.
200
+
201
+ ### Release Process
202
+
203
+ To publish a new version of the CLI:
204
+
205
+ #### 1. Production Release
206
+
207
+ ```bash
208
+ # Update version in package.json and create git tag
209
+ npm version patch # 0.1.0 → 0.1.1 (bug fixes)
210
+ npm version minor # 0.1.1 → 0.2.0 (new features)
211
+ npm version major # 0.2.0 → 1.0.0 (breaking changes)
212
+
213
+ # Or specify exact version
214
+ npm version 1.0.0
215
+
216
+ # Push commits and tags
217
+ git push
218
+ git push --tags
219
+
220
+ # CI will automatically build and publish to npm @latest
221
+ ```
222
+
223
+ #### 2. Beta Release
224
+
225
+ ```bash
226
+ # Create next beta version (recommended)
227
+ npm version prepatch --preid=beta # 0.1.13 → 0.1.14-beta.0
228
+
229
+ # Or increment existing beta
230
+ npm version prerelease --preid=beta # 0.1.14-beta.0 → 0.1.14-beta.1
231
+
232
+ # Push commits and tags
233
+ git push
234
+ git push --tags
235
+
236
+ # CI will automatically publish to npm @beta
237
+ ```
238
+
239
+ #### 3. Dev Releases (Automatic)
240
+
241
+ Dev releases are **automatically published** on every commit to `main` with version `X.Y.Z-dev.{PIPELINE_ID}` and tagged as `@dev` on npm.
242
+
243
+ **Note**: Always run `npm version` before creating tags. The CI pipeline verifies that package.json version matches the git tag and will fail if they don't match.
244
+
245
+ ## License
246
+
247
+ MIT License - Copyright © 2025 Sinch
248
+
249
+ ---
250
+
251
+ **npm**: https://www.npmjs.com/package/@sinch/sinch-cli
252
+ **Repository**: https://gitlab.com/sinch/sinch-projects/voice/functions/sinch-cli
253
+ **Version**: 0.1.0-beta.1
254
254
  **Status**: Open Beta
package/bin/sinch CHANGED
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env node
2
-
3
- // Use compiled TypeScript output
2
+
3
+ // Use compiled TypeScript output
4
4
  require('../dist/index.js');