|
1 | 1 | import * as CMTypes from "../typescript-node-client/api"; |
2 | | -import http = require('http'); |
| 2 | +import axios = require('axios'); |
3 | 3 |
|
4 | 4 | export type Channel = "SMS" | "Viber" | "RCS" | "Apple Messages for Business" | "WhatsApp" | "Telegram Messenger" | "Twitter" | "MobilePush" | "Facebook Messenger" | "Google Business Messages" | "Instagram"; |
5 | 5 | export type RichMessage = CMTypes.RichMessage; |
@@ -29,20 +29,6 @@ export class MessageApiClient { |
29 | 29 | return new Message(this.productToken); |
30 | 30 | } |
31 | 31 |
|
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 | | - |
46 | 32 | /** |
47 | 33 | * Send an SMS message |
48 | 34 | * @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 { |
90 | 76 | */ |
91 | 77 | public setMessage(to: string[], from: string, message: string, reference: string = undefined): Message { |
92 | 78 | const msg = new CMTypes.Message(); |
93 | | - msg.customGrouping = "text-sdk-javascript"; |
| 79 | + msg.customGrouping3 = "text-sdk-javascript"; |
94 | 80 | msg.from = from; |
95 | 81 | msg.body = new CMTypes.MessageBody(); |
96 | 82 | msg.body.type = "AUTO"; |
@@ -154,7 +140,7 @@ export class Message extends CMTypes.MessageEnvelope { |
154 | 140 | /** |
155 | 141 | * Sends the message to the CM.com Platform |
156 | 142 | */ |
157 | | - public send(): Promise<{ body: MessagesResponse; response: http.IncomingMessage }> { |
| 143 | + public send(): Promise<axios.AxiosResponse<any, any>> { |
158 | 144 | return this.api.messagesSendMessage(this); |
159 | 145 | } |
160 | 146 |
|
|
0 commit comments