@sendly/node 3.5.2 → 3.5.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/README.md CHANGED
@@ -77,10 +77,17 @@ import Sendly from '@sendly/node';
77
77
 
78
78
  const sendly = new Sendly('sk_live_v1_xxx');
79
79
 
80
- // Basic usage
80
+ // Basic usage (marketing message - default)
81
81
  const message = await sendly.messages.send({
82
82
  to: '+15551234567',
83
- text: 'Your verification code is: 123456'
83
+ text: 'Check out our new features!'
84
+ });
85
+
86
+ // Transactional message (bypasses quiet hours)
87
+ const message = await sendly.messages.send({
88
+ to: '+15551234567',
89
+ text: 'Your verification code is: 123456',
90
+ messageType: 'transactional'
84
91
  });
85
92
 
86
93
  // With custom sender ID (international)
@@ -201,12 +208,12 @@ console.log(sendly.isTestMode()); // true
201
208
 
202
209
  // Use sandbox test numbers
203
210
  await sendly.messages.send({
204
- to: SANDBOX_TEST_NUMBERS.SUCCESS, // +15550001234 - Always succeeds
211
+ to: SANDBOX_TEST_NUMBERS.SUCCESS, // +15005550000 - Always succeeds
205
212
  text: 'Test message'
206
213
  });
207
214
 
208
215
  await sendly.messages.send({
209
- to: SANDBOX_TEST_NUMBERS.INVALID, // +15550001001 - Returns invalid_number error
216
+ to: SANDBOX_TEST_NUMBERS.INVALID, // +15005550001 - Returns invalid_number error
210
217
  text: 'Test message'
211
218
  });
212
219
  ```
@@ -215,11 +222,12 @@ await sendly.messages.send({
215
222
 
216
223
  | Number | Behavior |
217
224
  |--------|----------|
218
- | `+15550001234` | Instant success |
219
- | `+15550001010` | Success after 10s delay |
220
- | `+15550001001` | Fails: invalid_number |
221
- | `+15550001002` | Fails: carrier_rejected (2s delay) |
222
- | `+15550001003` | Fails: rate_limit_exceeded |
225
+ | `+15005550000` | Success (instant) |
226
+ | `+15005550001` | Fails: invalid_number |
227
+ | `+15005550002` | Fails: unroutable_destination |
228
+ | `+15005550003` | Fails: queue_full |
229
+ | `+15005550004` | Fails: rate_limit_exceeded |
230
+ | `+15005550006` | Fails: carrier_violation |
223
231
 
224
232
  ## Pricing Tiers
225
233
 
package/dist/index.d.mts CHANGED
@@ -755,19 +755,22 @@ interface ApiKey {
755
755
  isRevoked: boolean;
756
756
  }
757
757
  /**
758
- * Test phone numbers for sandbox mode
758
+ * Test phone numbers for sandbox mode.
759
+ * Use these with test API keys (sk_test_*) to simulate different scenarios.
759
760
  */
760
761
  declare const SANDBOX_TEST_NUMBERS: {
761
- /** Always succeeds instantly */
762
- readonly SUCCESS: "+15550001234";
763
- /** Succeeds after 10 second delay */
764
- readonly DELAYED: "+15550001010";
762
+ /** Always succeeds - any number not in error list succeeds */
763
+ readonly SUCCESS: "+15005550000";
765
764
  /** Fails with invalid_number error */
766
- readonly INVALID: "+15550001001";
767
- /** Fails with carrier_rejected error after 2 seconds */
768
- readonly REJECTED: "+15550001002";
765
+ readonly INVALID: "+15005550001";
766
+ /** Fails with unroutable destination error */
767
+ readonly UNROUTABLE: "+15005550002";
768
+ /** Fails with queue_full error */
769
+ readonly QUEUE_FULL: "+15005550003";
769
770
  /** Fails with rate_limit_exceeded error */
770
- readonly RATE_LIMITED: "+15550001003";
771
+ readonly RATE_LIMITED: "+15005550004";
772
+ /** Fails with carrier_violation error */
773
+ readonly CARRIER_VIOLATION: "+15005550006";
771
774
  };
772
775
 
773
776
  /**
package/dist/index.d.ts CHANGED
@@ -755,19 +755,22 @@ interface ApiKey {
755
755
  isRevoked: boolean;
756
756
  }
757
757
  /**
758
- * Test phone numbers for sandbox mode
758
+ * Test phone numbers for sandbox mode.
759
+ * Use these with test API keys (sk_test_*) to simulate different scenarios.
759
760
  */
760
761
  declare const SANDBOX_TEST_NUMBERS: {
761
- /** Always succeeds instantly */
762
- readonly SUCCESS: "+15550001234";
763
- /** Succeeds after 10 second delay */
764
- readonly DELAYED: "+15550001010";
762
+ /** Always succeeds - any number not in error list succeeds */
763
+ readonly SUCCESS: "+15005550000";
765
764
  /** Fails with invalid_number error */
766
- readonly INVALID: "+15550001001";
767
- /** Fails with carrier_rejected error after 2 seconds */
768
- readonly REJECTED: "+15550001002";
765
+ readonly INVALID: "+15005550001";
766
+ /** Fails with unroutable destination error */
767
+ readonly UNROUTABLE: "+15005550002";
768
+ /** Fails with queue_full error */
769
+ readonly QUEUE_FULL: "+15005550003";
769
770
  /** Fails with rate_limit_exceeded error */
770
- readonly RATE_LIMITED: "+15550001003";
771
+ readonly RATE_LIMITED: "+15005550004";
772
+ /** Fails with carrier_violation error */
773
+ readonly CARRIER_VIOLATION: "+15005550006";
771
774
  };
772
775
 
773
776
  /**
package/dist/index.js CHANGED
@@ -441,16 +441,18 @@ var SUPPORTED_COUNTRIES = {
441
441
  };
442
442
  var ALL_SUPPORTED_COUNTRIES = Object.values(SUPPORTED_COUNTRIES).flat();
443
443
  var SANDBOX_TEST_NUMBERS = {
444
- /** Always succeeds instantly */
445
- SUCCESS: "+15550001234",
446
- /** Succeeds after 10 second delay */
447
- DELAYED: "+15550001010",
444
+ /** Always succeeds - any number not in error list succeeds */
445
+ SUCCESS: "+15005550000",
448
446
  /** Fails with invalid_number error */
449
- INVALID: "+15550001001",
450
- /** Fails with carrier_rejected error after 2 seconds */
451
- REJECTED: "+15550001002",
447
+ INVALID: "+15005550001",
448
+ /** Fails with unroutable destination error */
449
+ UNROUTABLE: "+15005550002",
450
+ /** Fails with queue_full error */
451
+ QUEUE_FULL: "+15005550003",
452
452
  /** Fails with rate_limit_exceeded error */
453
- RATE_LIMITED: "+15550001003"
453
+ RATE_LIMITED: "+15005550004",
454
+ /** Fails with carrier_violation error */
455
+ CARRIER_VIOLATION: "+15005550006"
454
456
  };
455
457
 
456
458
  // src/utils/validation.ts
package/dist/index.mjs CHANGED
@@ -381,16 +381,18 @@ var SUPPORTED_COUNTRIES = {
381
381
  };
382
382
  var ALL_SUPPORTED_COUNTRIES = Object.values(SUPPORTED_COUNTRIES).flat();
383
383
  var SANDBOX_TEST_NUMBERS = {
384
- /** Always succeeds instantly */
385
- SUCCESS: "+15550001234",
386
- /** Succeeds after 10 second delay */
387
- DELAYED: "+15550001010",
384
+ /** Always succeeds - any number not in error list succeeds */
385
+ SUCCESS: "+15005550000",
388
386
  /** Fails with invalid_number error */
389
- INVALID: "+15550001001",
390
- /** Fails with carrier_rejected error after 2 seconds */
391
- REJECTED: "+15550001002",
387
+ INVALID: "+15005550001",
388
+ /** Fails with unroutable destination error */
389
+ UNROUTABLE: "+15005550002",
390
+ /** Fails with queue_full error */
391
+ QUEUE_FULL: "+15005550003",
392
392
  /** Fails with rate_limit_exceeded error */
393
- RATE_LIMITED: "+15550001003"
393
+ RATE_LIMITED: "+15005550004",
394
+ /** Fails with carrier_violation error */
395
+ CARRIER_VIOLATION: "+15005550006"
394
396
  };
395
397
 
396
398
  // src/utils/validation.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sendly/node",
3
- "version": "3.5.2",
3
+ "version": "3.5.3",
4
4
  "description": "Official Sendly Node.js SDK for SMS messaging",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",