Skip to content

Commit da9a878

Browse files
author
Soufmaestro 3K
authored
Merge pull request #54 from cmdotcom/feature/remove-deprecated-packages
Remove deprecated packages
2 parents 5713433 + 61263c9 commit da9a878

File tree

7 files changed

+448
-1131
lines changed

7 files changed

+448
-1131
lines changed

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
## [2.0.0] - 2023-10-18
2+
### Added
3+
- Use `axios` to send HTTP requests
4+
5+
### Changed
6+
- Removed dependencies on `http`, `bluebird`, `request`
7+
- Use customgrouping3 instead of customgrouping for categorization
8+
- Target `ES2022` instead of `ES5`
9+
- Various package versions
10+
11+
### Removed
12+
- Possibility to use a query string
13+
- Deprecated methods from `MessageApiClient.ts`
14+
115
## [1.4.1] - 2022-12-12
216
### Changed
317
- Update model for WhatsApp Interactive.

lib/MessageApiClient.ts

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as CMTypes from "../typescript-node-client/api";
2-
import http = require('http');
2+
import axios = require('axios');
33

44
export type Channel = "SMS" | "Viber" | "RCS" | "Apple Messages for Business" | "WhatsApp" | "Telegram Messenger" | "Twitter" | "MobilePush" | "Facebook Messenger" | "Google Business Messages" | "Instagram";
55
export type RichMessage = CMTypes.RichMessage;
@@ -29,20 +29,6 @@ export class MessageApiClient {
2929
return new Message(this.productToken);
3030
}
3131

32-
/**
33-
* @deprecated use .sendTextMessages(...) instead
34-
*/
35-
public SendTextMessage(to: string, from: string, message: string, reference: string = undefined) {
36-
return this.SendTextMessages([to], from, message, reference);
37-
}
38-
39-
/**
40-
* @deprecated use .sendTextMessages(...) instead
41-
*/
42-
public SendTextMessages(to: string[], from: string, message: string, reference: string = undefined) {
43-
return this.sendTextMessage(to, from, message, reference);
44-
}
45-
4632
/**
4733
* Send an SMS message
4834
* @param to array of recipients for the message, specify the numbers in international format with leading 00
@@ -90,7 +76,7 @@ export class Message extends CMTypes.MessageEnvelope {
9076
*/
9177
public setMessage(to: string[], from: string, message: string, reference: string = undefined): Message {
9278
const msg = new CMTypes.Message();
93-
msg.customGrouping = "text-sdk-javascript";
79+
msg.customGrouping3 = "text-sdk-javascript";
9480
msg.from = from;
9581
msg.body = new CMTypes.MessageBody();
9682
msg.body.type = "AUTO";
@@ -154,7 +140,7 @@ export class Message extends CMTypes.MessageEnvelope {
154140
/**
155141
* Sends the message to the CM.com Platform
156142
*/
157-
public send(): Promise<{ body: MessagesResponse; response: http.IncomingMessage }> {
143+
public send(): Promise<axios.AxiosResponse<any, any>> {
158144
return this.api.messagesSendMessage(this);
159145
}
160146

0 commit comments

Comments
 (0)