@sendly/node 1.0.6 → 1.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 CHANGED
@@ -137,7 +137,7 @@ const sendly = new Sendly({
137
137
  apiKey: 'sk_live_v1_xxx',
138
138
 
139
139
  // Optional: Custom base URL (for testing)
140
- baseUrl: 'https://sendly.live/api',
140
+ baseUrl: 'https://sendly.live/api/v1',
141
141
 
142
142
  // Optional: Request timeout in ms (default: 30000)
143
143
  timeout: 60000,
package/dist/index.d.mts CHANGED
@@ -12,7 +12,7 @@ interface SendlyConfig {
12
12
  apiKey: string;
13
13
  /**
14
14
  * Base URL for the Sendly API
15
- * @default "https://sendly.live/api"
15
+ * @default "https://sendly.live/api/v1"
16
16
  */
17
17
  baseUrl?: string;
18
18
  /**
@@ -309,7 +309,7 @@ interface BatchMessageResult {
309
309
  /**
310
310
  * Batch status values
311
311
  */
312
- type BatchStatus = "processing" | "completed" | "partial_failure";
312
+ type BatchStatus = "processing" | "completed" | "partial_failure" | "failed";
313
313
  /**
314
314
  * Response from sending batch messages
315
315
  */
package/dist/index.d.ts CHANGED
@@ -12,7 +12,7 @@ interface SendlyConfig {
12
12
  apiKey: string;
13
13
  /**
14
14
  * Base URL for the Sendly API
15
- * @default "https://sendly.live/api"
15
+ * @default "https://sendly.live/api/v1"
16
16
  */
17
17
  baseUrl?: string;
18
18
  /**
@@ -309,7 +309,7 @@ interface BatchMessageResult {
309
309
  /**
310
310
  * Batch status values
311
311
  */
312
- type BatchStatus = "processing" | "completed" | "partial_failure";
312
+ type BatchStatus = "processing" | "completed" | "partial_failure" | "failed";
313
313
  /**
314
314
  * Response from sending batch messages
315
315
  */
package/dist/index.js CHANGED
@@ -182,7 +182,7 @@ var TimeoutError = class extends SendlyError {
182
182
  };
183
183
 
184
184
  // src/utils/http.ts
185
- var DEFAULT_BASE_URL = "https://sendly.live/api/";
185
+ var DEFAULT_BASE_URL = "https://sendly.live/api/v1";
186
186
  var DEFAULT_TIMEOUT = 3e4;
187
187
  var DEFAULT_MAX_RETRIES = 3;
188
188
  var HttpClient = class {
@@ -339,7 +339,7 @@ var HttpClient = class {
339
339
  Authorization: `Bearer ${this.config.apiKey}`,
340
340
  "Content-Type": "application/json",
341
341
  Accept: "application/json",
342
- "User-Agent": "@sendly/node/1.0.0",
342
+ "User-Agent": "@sendly/node/1.0.5",
343
343
  ...additionalHeaders
344
344
  };
345
345
  }
@@ -631,7 +631,7 @@ var MessagesResource = class {
631
631
  }
632
632
  const message = await this.http.request({
633
633
  method: "POST",
634
- path: "/v1/messages",
634
+ path: "/messages",
635
635
  body: {
636
636
  to: request.to,
637
637
  text: request.text,
@@ -667,7 +667,7 @@ var MessagesResource = class {
667
667
  validateLimit(options.limit);
668
668
  const response = await this.http.request({
669
669
  method: "GET",
670
- path: "/v1/messages",
670
+ path: "/messages",
671
671
  query: {
672
672
  limit: options.limit,
673
673
  offset: options.offset,
@@ -698,7 +698,7 @@ var MessagesResource = class {
698
698
  validateMessageId(id);
699
699
  const message = await this.http.request({
700
700
  method: "GET",
701
- path: `/v1/messages/${encodeURIComponent(id)}`
701
+ path: `/messages/${encodeURIComponent(id)}`
702
702
  });
703
703
  return message;
704
704
  }
@@ -731,7 +731,7 @@ var MessagesResource = class {
731
731
  while (hasMore) {
732
732
  const response = await this.http.request({
733
733
  method: "GET",
734
- path: "/v1/messages",
734
+ path: "/messages",
735
735
  query: {
736
736
  limit: batchSize,
737
737
  offset
@@ -790,7 +790,7 @@ var MessagesResource = class {
790
790
  }
791
791
  const scheduled = await this.http.request({
792
792
  method: "POST",
793
- path: "/v1/messages/schedule",
793
+ path: "/messages/schedule",
794
794
  body: {
795
795
  to: request.to,
796
796
  text: request.text,
@@ -819,7 +819,7 @@ var MessagesResource = class {
819
819
  validateLimit(options.limit);
820
820
  const response = await this.http.request({
821
821
  method: "GET",
822
- path: "/v1/messages/scheduled",
822
+ path: "/messages/scheduled",
823
823
  query: {
824
824
  limit: options.limit,
825
825
  offset: options.offset,
@@ -844,7 +844,7 @@ var MessagesResource = class {
844
844
  validateMessageId(id);
845
845
  const scheduled = await this.http.request({
846
846
  method: "GET",
847
- path: `/v1/messages/scheduled/${encodeURIComponent(id)}`
847
+ path: `/messages/scheduled/${encodeURIComponent(id)}`
848
848
  });
849
849
  return scheduled;
850
850
  }
@@ -869,7 +869,7 @@ var MessagesResource = class {
869
869
  validateMessageId(id);
870
870
  const result = await this.http.request({
871
871
  method: "DELETE",
872
- path: `/v1/messages/scheduled/${encodeURIComponent(id)}`
872
+ path: `/messages/scheduled/${encodeURIComponent(id)}`
873
873
  });
874
874
  return result;
875
875
  }
@@ -915,7 +915,7 @@ var MessagesResource = class {
915
915
  }
916
916
  const batch = await this.http.request({
917
917
  method: "POST",
918
- path: "/v1/messages/batch",
918
+ path: "/messages/batch",
919
919
  body: {
920
920
  messages: request.messages,
921
921
  ...request.from && { from: request.from }
@@ -944,7 +944,7 @@ var MessagesResource = class {
944
944
  }
945
945
  const batch = await this.http.request({
946
946
  method: "GET",
947
- path: `/v1/messages/batch/${encodeURIComponent(batchId)}`
947
+ path: `/messages/batch/${encodeURIComponent(batchId)}`
948
948
  });
949
949
  return batch;
950
950
  }
@@ -967,7 +967,7 @@ var MessagesResource = class {
967
967
  validateLimit(options.limit);
968
968
  const response = await this.http.request({
969
969
  method: "GET",
970
- path: "/v1/messages/batches",
970
+ path: "/messages/batches",
971
971
  query: {
972
972
  limit: options.limit,
973
973
  offset: options.offset,
@@ -979,7 +979,7 @@ var MessagesResource = class {
979
979
  };
980
980
 
981
981
  // src/client.ts
982
- var DEFAULT_BASE_URL2 = "https://sendly.live/api";
982
+ var DEFAULT_BASE_URL2 = "https://sendly.live/api/v1";
983
983
  var DEFAULT_TIMEOUT2 = 3e4;
984
984
  var DEFAULT_MAX_RETRIES2 = 3;
985
985
  var Sendly = class {
package/dist/index.mjs CHANGED
@@ -122,7 +122,7 @@ var TimeoutError = class extends SendlyError {
122
122
  };
123
123
 
124
124
  // src/utils/http.ts
125
- var DEFAULT_BASE_URL = "https://sendly.live/api/";
125
+ var DEFAULT_BASE_URL = "https://sendly.live/api/v1";
126
126
  var DEFAULT_TIMEOUT = 3e4;
127
127
  var DEFAULT_MAX_RETRIES = 3;
128
128
  var HttpClient = class {
@@ -279,7 +279,7 @@ var HttpClient = class {
279
279
  Authorization: `Bearer ${this.config.apiKey}`,
280
280
  "Content-Type": "application/json",
281
281
  Accept: "application/json",
282
- "User-Agent": "@sendly/node/1.0.0",
282
+ "User-Agent": "@sendly/node/1.0.5",
283
283
  ...additionalHeaders
284
284
  };
285
285
  }
@@ -571,7 +571,7 @@ var MessagesResource = class {
571
571
  }
572
572
  const message = await this.http.request({
573
573
  method: "POST",
574
- path: "/v1/messages",
574
+ path: "/messages",
575
575
  body: {
576
576
  to: request.to,
577
577
  text: request.text,
@@ -607,7 +607,7 @@ var MessagesResource = class {
607
607
  validateLimit(options.limit);
608
608
  const response = await this.http.request({
609
609
  method: "GET",
610
- path: "/v1/messages",
610
+ path: "/messages",
611
611
  query: {
612
612
  limit: options.limit,
613
613
  offset: options.offset,
@@ -638,7 +638,7 @@ var MessagesResource = class {
638
638
  validateMessageId(id);
639
639
  const message = await this.http.request({
640
640
  method: "GET",
641
- path: `/v1/messages/${encodeURIComponent(id)}`
641
+ path: `/messages/${encodeURIComponent(id)}`
642
642
  });
643
643
  return message;
644
644
  }
@@ -671,7 +671,7 @@ var MessagesResource = class {
671
671
  while (hasMore) {
672
672
  const response = await this.http.request({
673
673
  method: "GET",
674
- path: "/v1/messages",
674
+ path: "/messages",
675
675
  query: {
676
676
  limit: batchSize,
677
677
  offset
@@ -730,7 +730,7 @@ var MessagesResource = class {
730
730
  }
731
731
  const scheduled = await this.http.request({
732
732
  method: "POST",
733
- path: "/v1/messages/schedule",
733
+ path: "/messages/schedule",
734
734
  body: {
735
735
  to: request.to,
736
736
  text: request.text,
@@ -759,7 +759,7 @@ var MessagesResource = class {
759
759
  validateLimit(options.limit);
760
760
  const response = await this.http.request({
761
761
  method: "GET",
762
- path: "/v1/messages/scheduled",
762
+ path: "/messages/scheduled",
763
763
  query: {
764
764
  limit: options.limit,
765
765
  offset: options.offset,
@@ -784,7 +784,7 @@ var MessagesResource = class {
784
784
  validateMessageId(id);
785
785
  const scheduled = await this.http.request({
786
786
  method: "GET",
787
- path: `/v1/messages/scheduled/${encodeURIComponent(id)}`
787
+ path: `/messages/scheduled/${encodeURIComponent(id)}`
788
788
  });
789
789
  return scheduled;
790
790
  }
@@ -809,7 +809,7 @@ var MessagesResource = class {
809
809
  validateMessageId(id);
810
810
  const result = await this.http.request({
811
811
  method: "DELETE",
812
- path: `/v1/messages/scheduled/${encodeURIComponent(id)}`
812
+ path: `/messages/scheduled/${encodeURIComponent(id)}`
813
813
  });
814
814
  return result;
815
815
  }
@@ -855,7 +855,7 @@ var MessagesResource = class {
855
855
  }
856
856
  const batch = await this.http.request({
857
857
  method: "POST",
858
- path: "/v1/messages/batch",
858
+ path: "/messages/batch",
859
859
  body: {
860
860
  messages: request.messages,
861
861
  ...request.from && { from: request.from }
@@ -884,7 +884,7 @@ var MessagesResource = class {
884
884
  }
885
885
  const batch = await this.http.request({
886
886
  method: "GET",
887
- path: `/v1/messages/batch/${encodeURIComponent(batchId)}`
887
+ path: `/messages/batch/${encodeURIComponent(batchId)}`
888
888
  });
889
889
  return batch;
890
890
  }
@@ -907,7 +907,7 @@ var MessagesResource = class {
907
907
  validateLimit(options.limit);
908
908
  const response = await this.http.request({
909
909
  method: "GET",
910
- path: "/v1/messages/batches",
910
+ path: "/messages/batches",
911
911
  query: {
912
912
  limit: options.limit,
913
913
  offset: options.offset,
@@ -919,7 +919,7 @@ var MessagesResource = class {
919
919
  };
920
920
 
921
921
  // src/client.ts
922
- var DEFAULT_BASE_URL2 = "https://sendly.live/api";
922
+ var DEFAULT_BASE_URL2 = "https://sendly.live/api/v1";
923
923
  var DEFAULT_TIMEOUT2 = 3e4;
924
924
  var DEFAULT_MAX_RETRIES2 = 3;
925
925
  var Sendly = class {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sendly/node",
3
- "version": "1.0.6",
3
+ "version": "1.0.8",
4
4
  "description": "Official Sendly Node.js SDK for SMS messaging",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",