@sinch/sms 0.0.2 → 0.0.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 +24 -20
- package/dist/models/v1/api-batch-list/api-batch-list.d.ts +2 -8
- package/dist/models/v1/api-batch-list/api-batch-list.js +0 -6
- package/dist/models/v1/api-batch-list/api-batch-list.js.map +1 -1
- package/dist/models/v1/api-update-binary-mt-message/api-update-binary-mt-message.d.ts +1 -8
- package/dist/models/v1/api-update-mms-mt-message/api-update-mms-mt-message.d.ts +1 -8
- package/dist/models/v1/api-update-mms-mt-message/api-update-mms-mt-message.js +0 -6
- package/dist/models/v1/api-update-mms-mt-message/api-update-mms-mt-message.js.map +1 -1
- package/dist/models/v1/api-update-text-mt-message/api-update-text-mt-message.d.ts +1 -8
- package/dist/models/v1/api-update-text-mt-message/api-update-text-mt-message.js +0 -6
- package/dist/models/v1/api-update-text-mt-message/api-update-text-mt-message.js.map +1 -1
- package/dist/models/v1/binary-request/binary-request.d.ts +5 -10
- package/dist/models/v1/binary-response/binary-response.d.ts +1 -8
- package/dist/models/v1/delivery-report/delivery-report.d.ts +1 -8
- package/dist/models/v1/delivery-report/delivery-report.js +0 -6
- package/dist/models/v1/delivery-report/delivery-report.js.map +1 -1
- package/dist/models/v1/enums.d.ts +0 -13
- package/dist/models/v1/index.d.ts +0 -1
- package/dist/models/v1/index.js +0 -1
- package/dist/models/v1/index.js.map +1 -1
- package/dist/models/v1/media-body/media-body.d.ts +0 -6
- package/dist/models/v1/media-body/media-body.js +0 -6
- package/dist/models/v1/media-body/media-body.js.map +1 -1
- package/dist/models/v1/media-request/media-request.d.ts +5 -10
- package/dist/models/v1/media-request/media-request.js +0 -6
- package/dist/models/v1/media-request/media-request.js.map +1 -1
- package/dist/models/v1/media-response/media-response.d.ts +10 -15
- package/dist/models/v1/media-response/media-response.js +0 -6
- package/dist/models/v1/media-response/media-response.js.map +1 -1
- package/dist/models/v1/mo-binary/mo-binary.d.ts +1 -8
- package/dist/models/v1/mo-binary/mo-binary.js +0 -6
- package/dist/models/v1/mo-binary/mo-binary.js.map +1 -1
- package/dist/models/v1/mo-text/mo-text.d.ts +1 -8
- package/dist/models/v1/mo-text/mo-text.js +0 -6
- package/dist/models/v1/mo-text/mo-text.js.map +1 -1
- package/dist/models/v1/recipient-delivery-report/recipient-delivery-report.d.ts +2 -10
- package/dist/models/v1/send-sms-request/send-sms-request.d.ts +0 -6
- package/dist/models/v1/send-sms-request/send-sms-request.js +0 -6
- package/dist/models/v1/send-sms-request/send-sms-request.js.map +1 -1
- package/dist/models/v1/send-sms-response/send-sms-response.d.ts +0 -6
- package/dist/models/v1/send-sms-response/send-sms-response.js +0 -6
- package/dist/models/v1/send-sms-response/send-sms-response.js.map +1 -1
- package/dist/models/v1/text-request/text-request.d.ts +5 -10
- package/dist/models/v1/text-request/text-request.js +0 -6
- package/dist/models/v1/text-request/text-request.js.map +1 -1
- package/dist/models/v1/text-response/text-response.d.ts +5 -10
- package/dist/models/v1/text-response/text-response.js +0 -6
- package/dist/models/v1/text-response/text-response.js.map +1 -1
- package/dist/rest/v1/batches/batches-api.d.ts +48 -5
- package/dist/rest/v1/batches/batches-api.jest.fixture.d.ts +15 -3
- package/dist/rest/v1/batches/batches-api.jest.fixture.js +12 -0
- package/dist/rest/v1/batches/batches-api.jest.fixture.js.map +1 -1
- package/dist/rest/v1/batches/batches-api.js +46 -3
- package/dist/rest/v1/batches/batches-api.js.map +1 -1
- package/dist/rest/v1/delivery-reports/delivery-reports-api.d.ts +6 -7
- package/dist/rest/v1/delivery-reports/delivery-reports-api.jest.fixture.d.ts +4 -4
- package/dist/rest/v1/delivery-reports/delivery-reports-api.jest.fixture.js +2 -2
- package/dist/rest/v1/delivery-reports/delivery-reports-api.jest.fixture.js.map +1 -1
- package/dist/rest/v1/delivery-reports/delivery-reports-api.js +2 -2
- package/dist/rest/v1/delivery-reports/delivery-reports-api.js.map +1 -1
- package/dist/rest/v1/enums.d.ts +1 -1
- package/package.json +2 -2
- package/dist/models/v1/api-batch-list-batches-inner/api-batch-list-batches-inner.d.ts +0 -10
- package/dist/models/v1/api-batch-list-batches-inner/api-batch-list-batches-inner.js +0 -9
- package/dist/models/v1/api-batch-list-batches-inner/api-batch-list-batches-inner.js.map +0 -1
- package/dist/models/v1/api-batch-list-batches-inner/index.d.ts +0 -1
- package/dist/models/v1/api-batch-list-batches-inner/index.js +0 -3
- package/dist/models/v1/api-batch-list-batches-inner/index.js.map +0 -1
package/README.md
CHANGED
|
@@ -45,8 +45,8 @@ If you are using this SDK as part of the Sinch SDK (`@sinch/sdk-core`) you can a
|
|
|
45
45
|
import {
|
|
46
46
|
SendSMSRequestData,
|
|
47
47
|
SendSMSResponse,
|
|
48
|
+
SmsService,
|
|
48
49
|
SinchClient,
|
|
49
|
-
SinchSmsClient,
|
|
50
50
|
ServicePlanIdCredentials,
|
|
51
51
|
UnifiedCredentials,
|
|
52
52
|
Region,
|
|
@@ -58,15 +58,20 @@ const credentialsWithProjectId: UnifiedCredentials = {
|
|
|
58
58
|
keySecret: 'KEY_SECRET',
|
|
59
59
|
region: Region.UNITED_STATES, // Optional, default is 'us'. Only other possibility is 'eu'
|
|
60
60
|
};
|
|
61
|
-
|
|
61
|
+
// Access the 'sms' service registered on the Sinch Client
|
|
62
|
+
const sinchClientCreatedWithProjectId = new SinchClient(credentialsWithProjectId);
|
|
63
|
+
const smsServiceWithProjectId: SmsService = sinchClientCreatedWithProjectId.sms;
|
|
62
64
|
|
|
63
65
|
const credentialsWithServicePlanId: ServicePlanIdCredentials = {
|
|
64
66
|
servicePlanId: 'SERVICE_PLAN_ID',
|
|
65
67
|
apiToken: 'API_TOKEN',
|
|
66
68
|
region: Region.UNITED_STATES, // Optional, default is 'us'. Other possibilities are 'eu', 'br', 'au' and 'ca'
|
|
67
69
|
};
|
|
68
|
-
|
|
70
|
+
// Access the 'sms' service registered on the Sinch Client
|
|
71
|
+
const sinchClientCreatedWithServicePlanId = new SinchClient(credentialsWithServicePlanId);
|
|
72
|
+
const smsServiceWithServicePlanId: SmsService = sinchClientCreatedWithServicePlanId.sms;
|
|
69
73
|
|
|
74
|
+
// Build the request data
|
|
70
75
|
const requestData: SendSMSRequestData = {
|
|
71
76
|
sendSMSRequestBody: {
|
|
72
77
|
to: [
|
|
@@ -85,23 +90,21 @@ const requestData: SendSMSRequestData = {
|
|
|
85
90
|
},
|
|
86
91
|
};
|
|
87
92
|
|
|
88
|
-
//
|
|
93
|
+
// Use the 'sms' service registered on the Sinch client
|
|
89
94
|
// The request will be authenticated with OAuth2 and sent to https://zt.us.sms.api.sinch.com
|
|
90
95
|
const availabilityResult_1: SendSMSResponse
|
|
91
|
-
= await
|
|
96
|
+
= await smsServiceWithProjectId.batches.send(requestData);
|
|
92
97
|
|
|
93
|
-
//
|
|
98
|
+
// Use the 'sms' service registered on the Sinch client
|
|
94
99
|
// The request will be authenticated with the API Token and sent to https://us.sms.api.sinch.com
|
|
95
100
|
const availabilityResult_2: SendSMSResponse
|
|
96
|
-
= await
|
|
101
|
+
= await smsServiceWithServicePlanId.batches.send(requestData);
|
|
97
102
|
```
|
|
98
103
|
|
|
99
104
|
### Standalone
|
|
100
105
|
|
|
101
106
|
The SDK can be used standalone if you need to use only the SMS APIs. As for a usage with the Sinch Client, you can choose to use the `projectId` or `servicePlanId` credentials.
|
|
102
107
|
|
|
103
|
-
#### With the Oauth2TokenRequest plugin
|
|
104
|
-
|
|
105
108
|
```typescript
|
|
106
109
|
import {
|
|
107
110
|
Region,
|
|
@@ -111,7 +114,7 @@ import {
|
|
|
111
114
|
import {
|
|
112
115
|
SendSMSRequestData,
|
|
113
116
|
SendSMSResponse,
|
|
114
|
-
|
|
117
|
+
SmsService,
|
|
115
118
|
} from '@sinch/sms';
|
|
116
119
|
|
|
117
120
|
const credentialsWithProjectId: UnifiedCredentials = {
|
|
@@ -120,28 +123,29 @@ const credentialsWithProjectId: UnifiedCredentials = {
|
|
|
120
123
|
keySecret: 'KEY_SECRET',
|
|
121
124
|
region: Region.UNITED_STATES, // Optional, default is 'us'. Only other possibility is 'eu'
|
|
122
125
|
};
|
|
123
|
-
// Declare the 'sms'
|
|
124
|
-
const
|
|
126
|
+
// Declare the 'sms' service in a standalone way
|
|
127
|
+
const smsServiceWithProjectId = new SmsService(credentialsWithProjectId);
|
|
125
128
|
|
|
126
129
|
const credentialsWithServicePlanId: ServicePlanIdCredentials = {
|
|
127
130
|
servicePlanId: 'SERVICE_PLAN_ID',
|
|
128
131
|
apiToken: 'API_TOKEN',
|
|
129
132
|
region: Region.UNITED_STATES, // Optional, default is 'us'. Other possibilities are 'eu', 'br', 'au' and 'ca'
|
|
130
133
|
};
|
|
131
|
-
// Declare the 'sms'
|
|
132
|
-
const
|
|
134
|
+
// Declare the 'sms' service in a standalone way
|
|
135
|
+
const smsServiceWithServicePlanId = new SmsService(credentialsWithServicePlanId);
|
|
133
136
|
|
|
137
|
+
// Build the request data
|
|
134
138
|
const requestData: SendSMSRequestData = {
|
|
135
139
|
// some request parameters
|
|
136
140
|
};
|
|
137
141
|
|
|
138
|
-
// Use the standalone declaration of the 'sms'
|
|
142
|
+
// Use the standalone declaration of the 'sms' service
|
|
139
143
|
// The request will be authenticated with OAuth2 and sent to https://zt.us.sms.api.sinch.com
|
|
140
|
-
const response_1: SendSMSResponse = await
|
|
144
|
+
const response_1: SendSMSResponse = await smsServiceWithProjectId.batches.send(requestData);
|
|
141
145
|
|
|
142
|
-
// Use the standalone declaration of the 'sms'
|
|
146
|
+
// Use the standalone declaration of the 'sms' service
|
|
143
147
|
// The request will be authenticated with the API Token and sent to https://us.sms.api.sinch.com
|
|
144
|
-
const response_2: SendSMSResponse = await
|
|
148
|
+
const response_2: SendSMSResponse = await smsServiceWithServicePlanId.batches.send(requestData);
|
|
145
149
|
```
|
|
146
150
|
|
|
147
151
|
## Promises
|
|
@@ -152,14 +156,14 @@ All the methods that interact with the Sinch APIs use Promises. You can use `awa
|
|
|
152
156
|
// Method 1: Wait for the Promise to complete (you need to be in an 'async' method)
|
|
153
157
|
let batchResponse: SendSMSResponse;
|
|
154
158
|
try {
|
|
155
|
-
batchResponse = await
|
|
159
|
+
batchResponse = await smsService.batches.send(requestData);
|
|
156
160
|
console.log(`The SMS has been sent successfully: batch id = ${batchResponse.id}`);
|
|
157
161
|
} catch (error: any) {
|
|
158
162
|
console.error(`ERROR ${error.statusCode}: the SMS could not be sent`);
|
|
159
163
|
}
|
|
160
164
|
|
|
161
165
|
// Method 2: Resolve the promise
|
|
162
|
-
|
|
166
|
+
smsService.batches.send(requestData)
|
|
163
167
|
.then(response => console.log(`The SMS has been sent successfully: batch id = ${response.id}`))
|
|
164
168
|
.catch(error => console.error(`ERROR ${error.statusCode}: the SMS could not be sent`));
|
|
165
169
|
```
|
|
@@ -1,17 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
* Model: ApiBatchList
|
|
3
|
-
*
|
|
4
|
-
* THIS FILE HAS BEEN AUTOMATICALLY GENERATED. DO NOT EDIT.
|
|
5
|
-
*
|
|
6
|
-
*/
|
|
7
|
-
import { ApiBatchListBatchesInner } from '../api-batch-list-batches-inner';
|
|
1
|
+
import { SendSMSResponse } from '../send-sms-response';
|
|
8
2
|
export interface ApiBatchList {
|
|
9
3
|
/** The total number of entries matching the given filters. */
|
|
10
4
|
count?: number;
|
|
11
5
|
/** The requested page. */
|
|
12
6
|
page?: number;
|
|
13
7
|
/** The page of batches matching the given filters. */
|
|
14
|
-
batches?:
|
|
8
|
+
batches?: SendSMSResponse[];
|
|
15
9
|
/** The number of entries returned in this request. */
|
|
16
10
|
page_size?: number;
|
|
17
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-batch-list.js","sourceRoot":"","sources":["../../../../src/models/v1/api-batch-list/api-batch-list.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"api-batch-list.js","sourceRoot":"","sources":["../../../../src/models/v1/api-batch-list/api-batch-list.ts"],"names":[],"mappings":""}
|
|
@@ -1,15 +1,9 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Model: ApiUpdateBinaryMtMessage
|
|
3
|
-
*
|
|
4
|
-
* THIS FILE HAS BEEN AUTOMATICALLY GENERATED. DO NOT EDIT.
|
|
5
|
-
*
|
|
6
|
-
*/
|
|
7
1
|
import { DeliveryReportEnum } from '../enums';
|
|
8
2
|
export interface ApiUpdateBinaryMtMessage {
|
|
9
3
|
/** Sender number. Must be valid phone number, short code or alphanumeric. */
|
|
10
4
|
from?: string;
|
|
11
5
|
/** SMS in binary format */
|
|
12
|
-
type?:
|
|
6
|
+
type?: 'mt_binary';
|
|
13
7
|
/** List of phone numbers and group IDs to add to the batch. */
|
|
14
8
|
to_add?: string[];
|
|
15
9
|
/** List of phone numbers and group IDs to remove from the batch. */
|
|
@@ -27,4 +21,3 @@ export interface ApiUpdateBinaryMtMessage {
|
|
|
27
21
|
/** The UDH header of a binary message HEX encoded. Max 140 bytes together with body. */
|
|
28
22
|
udh?: string;
|
|
29
23
|
}
|
|
30
|
-
export type TypeEnum = 'mt_binary';
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Model: ApiUpdateMmsMtMessage
|
|
3
|
-
*
|
|
4
|
-
* THIS FILE HAS BEEN AUTOMATICALLY GENERATED. DO NOT EDIT.
|
|
5
|
-
*
|
|
6
|
-
*/
|
|
7
1
|
import { MediaBody } from '../media-body';
|
|
8
2
|
import { ParameterObj } from '../parameter-obj';
|
|
9
3
|
import { DeliveryReportEnum } from '../enums';
|
|
@@ -11,7 +5,7 @@ export interface ApiUpdateMmsMtMessage {
|
|
|
11
5
|
/** Sender number. Must be valid phone number, short code or alphanumeric. */
|
|
12
6
|
from?: string;
|
|
13
7
|
/** MMS */
|
|
14
|
-
type?:
|
|
8
|
+
type?: 'mt_media';
|
|
15
9
|
/** List of phone numbers and group IDs to add to the batch. */
|
|
16
10
|
to_add?: string[];
|
|
17
11
|
/** List of phone numbers and group IDs to remove from the batch. */
|
|
@@ -31,4 +25,3 @@ export interface ApiUpdateMmsMtMessage {
|
|
|
31
25
|
/** Whether or not you want the media included in your message to be checked against [Sinch MMS channel best practices](/docs/mms/bestpractices/). If set to true, your message will be rejected if it doesn\'t conform to the listed recommendations, otherwise no validation will be performed. */
|
|
32
26
|
strict_validation?: boolean;
|
|
33
27
|
}
|
|
34
|
-
export type TypeEnum = 'mt_media';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-update-mms-mt-message.js","sourceRoot":"","sources":["../../../../src/models/v1/api-update-mms-mt-message/api-update-mms-mt-message.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"api-update-mms-mt-message.js","sourceRoot":"","sources":["../../../../src/models/v1/api-update-mms-mt-message/api-update-mms-mt-message.ts"],"names":[],"mappings":""}
|
|
@@ -1,16 +1,10 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Model: ApiUpdateTextMtMessage
|
|
3
|
-
*
|
|
4
|
-
* THIS FILE HAS BEEN AUTOMATICALLY GENERATED. DO NOT EDIT.
|
|
5
|
-
*
|
|
6
|
-
*/
|
|
7
1
|
import { ParameterObj } from '../parameter-obj';
|
|
8
2
|
import { DeliveryReportEnum } from '../enums';
|
|
9
3
|
export interface ApiUpdateTextMtMessage {
|
|
10
4
|
/** Sender number. Must be valid phone number, short code or alphanumeric. */
|
|
11
5
|
from?: string;
|
|
12
6
|
/** Regular SMS */
|
|
13
|
-
type?:
|
|
7
|
+
type?: 'mt_text';
|
|
14
8
|
/** List of phone numbers and group IDs to add to the batch. */
|
|
15
9
|
to_add?: string[];
|
|
16
10
|
/** List of phone numbers and group IDs to remove from the batch. */
|
|
@@ -28,4 +22,3 @@ export interface ApiUpdateTextMtMessage {
|
|
|
28
22
|
/** The message content */
|
|
29
23
|
body?: string;
|
|
30
24
|
}
|
|
31
|
-
export type TypeEnum = 'mt_text' | 'mt_binary' | 'mt_media';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-update-text-mt-message.js","sourceRoot":"","sources":["../../../../src/models/v1/api-update-text-mt-message/api-update-text-mt-message.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"api-update-text-mt-message.js","sourceRoot":"","sources":["../../../../src/models/v1/api-update-text-mt-message/api-update-text-mt-message.ts"],"names":[],"mappings":""}
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Model: BinaryRequest
|
|
3
|
-
*
|
|
4
|
-
* THIS FILE HAS BEEN AUTOMATICALLY GENERATED. DO NOT EDIT.
|
|
5
|
-
*
|
|
6
|
-
*/
|
|
7
1
|
import { DeliveryReportEnum } from '../enums';
|
|
8
2
|
export interface BinaryRequest {
|
|
9
3
|
/** A list of phone numbers and group IDs that will receive the batch. [More info](https://community.sinch.com/t5/Glossary/MSISDN/ta-p/7628). */
|
|
@@ -15,12 +9,14 @@ export interface BinaryRequest {
|
|
|
15
9
|
/** The UDH header of a binary message HEX encoded. Max 140 bytes including the `body`. */
|
|
16
10
|
udh: string;
|
|
17
11
|
/** SMS in <a href=\"https://community.sinch.com/t5/Glossary/Binary-SMS/ta-p/7470\" target=\"_blank\">binary</a> format. */
|
|
18
|
-
type?:
|
|
12
|
+
type?: 'mt_binary';
|
|
19
13
|
/** Request delivery report callback. Note that delivery reports can be fetched from the API regardless of this setting. */
|
|
20
14
|
delivery_report?: DeliveryReportEnum;
|
|
21
|
-
/** If set in the future the message will be delayed until `send_at` occurs.
|
|
15
|
+
/** If set in the future the message will be delayed until `send_at` occurs.
|
|
16
|
+
* Must be before `expire_at`. If set in the past, messages will be sent immediately. Formatted as [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601). For example: `YYYY-MM-DDThh:mm:ss.SSSZ`. */
|
|
22
17
|
send_at?: Date;
|
|
23
|
-
/** If set, the system will stop trying to deliver the message at this point.
|
|
18
|
+
/** If set, the system will stop trying to deliver the message at this point.
|
|
19
|
+
* Must be after `send_at`. Default and max is 3 days after `send_at`. Formatted as [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601). For example: `YYYY-MM-DDThh:mm:ss.SSSZ`. */
|
|
24
20
|
expire_at?: Date;
|
|
25
21
|
/** Override the *default* callback URL for this batch. Must be a valid URL. Learn how to set a default callback URL <a href=\"https://community.sinch.com/t5/SMS/How-do-I-assign-a-callback-URL-to-an-SMS-service-plan/ta-p/8414\" target=\"_blank\">here</a>. */
|
|
26
22
|
callback_url?: string;
|
|
@@ -39,4 +35,3 @@ export interface BinaryRequest {
|
|
|
39
35
|
/** Number Plan Indicator for the sender number. Use to override the automatic detection. */
|
|
40
36
|
from_npi?: number;
|
|
41
37
|
}
|
|
42
|
-
export type TypeEnum = 'mt_binary';
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Model: BinaryResponse
|
|
3
|
-
*
|
|
4
|
-
* THIS FILE HAS BEEN AUTOMATICALLY GENERATED. DO NOT EDIT.
|
|
5
|
-
*
|
|
6
|
-
*/
|
|
7
1
|
import { DeliveryReportEnum } from '../enums';
|
|
8
2
|
export interface BinaryResponse {
|
|
9
3
|
/** Unique identifier for batch. */
|
|
@@ -19,7 +13,7 @@ export interface BinaryResponse {
|
|
|
19
13
|
/** The <a href=\"https://community.sinch.com/t5/Glossary/UDH-User-Data-Header/ta-p/7776\" target=\"_blank\">UDH</a> header of a binary message HEX encoded. Max 140 bytes including the `body`. */
|
|
20
14
|
udh?: string;
|
|
21
15
|
/** SMS in <a href=\"https://community.sinch.com/t5/Glossary/Binary-SMS/ta-p/7470\" target=\"_blank\">binary</a> format. */
|
|
22
|
-
type?:
|
|
16
|
+
type?: 'mt_binary';
|
|
23
17
|
/** Timestamp for when batch was created. Formatted as [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601). For example: `YYYY-MM-DDThh:mm:ss.SSSZ`. */
|
|
24
18
|
created_at?: Date;
|
|
25
19
|
/** Timestamp for when batch was last updated. Formatted as [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601). For example: `YYYY-MM-DDThh:mm:ss.SSSZ`. */
|
|
@@ -47,4 +41,3 @@ export interface BinaryResponse {
|
|
|
47
41
|
/** Number Plan Indicator for the sender number. */
|
|
48
42
|
from_npi?: number;
|
|
49
43
|
}
|
|
50
|
-
export type TypeEnum = 'mt_binary';
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Model: DeliveryReport
|
|
3
|
-
*
|
|
4
|
-
* THIS FILE HAS BEEN AUTOMATICALLY GENERATED. DO NOT EDIT.
|
|
5
|
-
*
|
|
6
|
-
*/
|
|
7
1
|
import { MessageDeliveryStatus } from '../message-delivery-status';
|
|
8
2
|
export interface DeliveryReport {
|
|
9
3
|
/** The ID of the batch this delivery report belongs to. */
|
|
@@ -15,6 +9,5 @@ export interface DeliveryReport {
|
|
|
15
9
|
/** The total number of messages in the batch. */
|
|
16
10
|
total_message_count: number;
|
|
17
11
|
/** The delivery report type. */
|
|
18
|
-
type:
|
|
12
|
+
type: 'delivery_report_sms' | 'delivery_report_mms';
|
|
19
13
|
}
|
|
20
|
-
export type TypeEnum = 'delivery_report_sms' | 'delivery_report_mms';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delivery-report.js","sourceRoot":"","sources":["../../../../src/models/v1/delivery-report/delivery-report.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"delivery-report.js","sourceRoot":"","sources":["../../../../src/models/v1/delivery-report/delivery-report.ts"],"names":[],"mappings":""}
|
|
@@ -1,15 +1,2 @@
|
|
|
1
|
-
export type { TypeEnum as ApiUpdateBinaryMtMessageTypeEnum, } from './api-update-binary-mt-message/api-update-binary-mt-message';
|
|
2
|
-
export type { TypeEnum as ApiUpdateMmsMtMessageTypeEnum, } from './api-update-mms-mt-message/api-update-mms-mt-message';
|
|
3
|
-
export type { TypeEnum as ApiUpdateTextMtMessageTypeEnum, } from './api-update-text-mt-message/api-update-text-mt-message';
|
|
4
|
-
export type { TypeEnum as BinaryRequestTypeEnum } from './binary-request/binary-request';
|
|
5
|
-
export type { TypeEnum as BinaryResponseTypeEnum } from './binary-response/binary-response';
|
|
6
|
-
export type { TypeEnum as DeliveryReportTypeEnum } from './delivery-report/delivery-report';
|
|
7
|
-
export type { TypeEnum as MOBinaryTypeEnum } from './mo-binary/mo-binary';
|
|
8
|
-
export type { TypeEnum as MOTextTypeEnum } from './mo-text/mo-text';
|
|
9
|
-
export type { TypeEnum as MediaRequestTypeEnum } from './media-request/media-request';
|
|
10
|
-
export type { TypeEnum as MediaResponseTypeEnum } from './media-response/media-response';
|
|
11
|
-
export type { EncodingEnum as RecipientDeliveryReportEncodingEnum, TypeEnum as RecipientDeliveryReportTypeEnum, } from './recipient-delivery-report/recipient-delivery-report';
|
|
12
|
-
export type { TypeEnum as TextRequestTypeEnum } from './text-request/text-request';
|
|
13
|
-
export type { TypeEnum as TextResponseTypeEnum } from './text-response/text-response';
|
|
14
1
|
export type DeliveryReportEnum = 'none' | 'summary' | 'full' | 'per_recipient' | 'per_recipient_final';
|
|
15
2
|
export type DeliveryReportStatusEnum = 'Queued' | 'Dispatched' | 'Aborted' | 'Cancelled' | 'Rejected' | 'Deleted' | 'Delivered' | 'Failed' | 'Expired' | 'Unknown';
|
package/dist/models/v1/index.js
CHANGED
|
@@ -15,7 +15,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./api-batch-list"), exports);
|
|
18
|
-
__exportStar(require("./api-batch-list-batches-inner"), exports);
|
|
19
18
|
__exportStar(require("./delivery-feedback-request"), exports);
|
|
20
19
|
__exportStar(require("./api-inbound-list"), exports);
|
|
21
20
|
__exportStar(require("./inbound-message-response"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/models/v1/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mDAAiC;AACjC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/models/v1/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mDAAiC;AACjC,8DAA4C;AAC5C,qDAAmC;AACnC,6DAA2C;AAC3C,mDAAiC;AACjC,iEAA+C;AAC/C,8DAA4C;AAC5C,0DAAwC;AACxC,+DAA6C;AAC7C,mDAAiC;AACjC,oDAAkC;AAClC,0DAAwC;AACxC,oDAAkC;AAClC,yDAAuC;AACvC,oDAAkC;AAClC,qDAAmC;AACnC,yEAAuD;AACvD,uDAAqC;AACrC,sDAAoC;AACpC,yDAAuC;AACvC,6DAA2C;AAC3C,oEAAkD;AAClD,6DAA2C;AAC3C,yDAAuC;AACvC,8CAA4B;AAC5B,4CAA0B;AAC1B,+CAA6B;AAC7B,kDAAgC;AAChC,mDAAiC;AACjC,4DAA0C;AAC1C,kDAAgC;AAChC,gEAA8C;AAC9C,8DAA4C;AAC5C,0DAAwC;AACxC,sDAAoC;AACpC,qDAAmC;AACnC,iDAA+B;AAC/B,kDAAgC;AAChC,iEAA+C;AAC/C,yDAAuC;AACvC,qEAAmD;AACnD,yEAAuD;AACvD,4EAA0D;AAC1D,0CAAwB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"media-body.js","sourceRoot":"","sources":["../../../../src/models/v1/media-body/media-body.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"media-body.js","sourceRoot":"","sources":["../../../../src/models/v1/media-body/media-body.ts"],"names":[],"mappings":""}
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Model: MediaRequest
|
|
3
|
-
*
|
|
4
|
-
* THIS FILE HAS BEEN AUTOMATICALLY GENERATED. DO NOT EDIT.
|
|
5
|
-
*
|
|
6
|
-
*/
|
|
7
1
|
import { MediaBody } from '../media-body';
|
|
8
2
|
import { ParameterObj } from '../parameter-obj';
|
|
9
3
|
import { DeliveryReportEnum } from '../enums';
|
|
@@ -20,12 +14,14 @@ export interface MediaRequest {
|
|
|
20
14
|
/** @see ParameterObj */
|
|
21
15
|
parameters?: ParameterObj;
|
|
22
16
|
/** MMS */
|
|
23
|
-
type?:
|
|
17
|
+
type?: 'mt_media';
|
|
24
18
|
/** Request delivery report callback. Note that delivery reports can be fetched from the API regardless of this setting. */
|
|
25
19
|
delivery_report?: DeliveryReportEnum;
|
|
26
|
-
/** If set in the future, the message will be delayed until `send_at` occurs.
|
|
20
|
+
/** If set in the future, the message will be delayed until `send_at` occurs.
|
|
21
|
+
* Must be before `expire_at`. If set in the past, messages will be sent immediately. Formatted as <a href=\"https://en.wikipedia.org/wiki/ISO_8601\" target=\"_blank\">ISO-8601</a>: `YYYY-MM-DDThh:mm:ss.SSSZ`. */
|
|
27
22
|
send_at?: Date;
|
|
28
|
-
/** If set, the system will stop trying to deliver the message at this point.
|
|
23
|
+
/** If set, the system will stop trying to deliver the message at this point.
|
|
24
|
+
* Must be after `send_at`. Default and max is 3 days after `send_at`. Formatted as <a href=\"https://en.wikipedia.org/wiki/ISO_8601\" target=\"_blank\">ISO-8601</a>: `YYYY-MM-DDThh:mm:ss.SSSZ`. */
|
|
29
25
|
expire_at?: Date;
|
|
30
26
|
/** Override the default callback URL for this batch. Must be valid URL. */
|
|
31
27
|
callback_url?: string;
|
|
@@ -36,4 +32,3 @@ export interface MediaRequest {
|
|
|
36
32
|
/** Whether or not you want the media included in your message to be checked against [Sinch MMS channel best practices](/docs/mms/bestpractices/). If set to true, your message will be rejected if it doesn\'t conform to the listed recommendations, otherwise no validation will be performed. */
|
|
37
33
|
strict_validation?: boolean;
|
|
38
34
|
}
|
|
39
|
-
export type TypeEnum = 'mt_media';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"media-request.js","sourceRoot":"","sources":["../../../../src/models/v1/media-request/media-request.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"media-request.js","sourceRoot":"","sources":["../../../../src/models/v1/media-request/media-request.ts"],"names":[],"mappings":""}
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Model: MediaResponse
|
|
3
|
-
*
|
|
4
|
-
* THIS FILE HAS BEEN AUTOMATICALLY GENERATED. DO NOT EDIT.
|
|
5
|
-
*
|
|
6
|
-
*/
|
|
7
1
|
import { MediaBody } from '../media-body';
|
|
8
2
|
import { ParameterObj } from '../parameter-obj';
|
|
9
3
|
import { DeliveryReportEnum } from '../enums';
|
|
@@ -12,7 +6,7 @@ export interface MediaResponse {
|
|
|
12
6
|
id?: string;
|
|
13
7
|
/** List of Phone numbers and group IDs that will receive the batch. [More info](https://community.sinch.com/t5/Glossary/MSISDN/ta-p/7628) */
|
|
14
8
|
to?: string[];
|
|
15
|
-
/** Sender number.
|
|
9
|
+
/** Sender number. Required if Automatic Default Originator not configured. */
|
|
16
10
|
from?: string;
|
|
17
11
|
/** Indicates if the batch has been canceled or not. */
|
|
18
12
|
canceled?: boolean;
|
|
@@ -21,16 +15,18 @@ export interface MediaResponse {
|
|
|
21
15
|
/** @see ParameterObj */
|
|
22
16
|
parameters?: ParameterObj;
|
|
23
17
|
/** Media message */
|
|
24
|
-
type?:
|
|
25
|
-
/** Timestamp for when batch was created.
|
|
18
|
+
type?: 'mt_media';
|
|
19
|
+
/** Timestamp for when batch was created. YYYY-MM-DDThh:mm:ss.SSSZ format */
|
|
26
20
|
created_at?: Date;
|
|
27
|
-
/** Timestamp for when batch was last updated.
|
|
21
|
+
/** Timestamp for when batch was last updated. YYYY-MM-DDThh:mm:ss.SSSZ format */
|
|
28
22
|
modified_at?: Date;
|
|
29
|
-
/** Request delivery report callback.
|
|
23
|
+
/** Request delivery report callback. Note that delivery reports can be fetched from the API regardless of this setting. */
|
|
30
24
|
delivery_report?: DeliveryReportEnum;
|
|
31
|
-
/** If set in the future the message will be delayed until send_at occurs.
|
|
25
|
+
/** If set in the future the message will be delayed until send_at occurs.
|
|
26
|
+
* Must be before `expire_at`. If set in the past messages will be sent immediately. YYYY-MM-DDThh:mm:ss.SSSZ format */
|
|
32
27
|
send_at?: Date;
|
|
33
|
-
/** If set the system will stop trying to deliver the message at this point.
|
|
28
|
+
/** If set the system will stop trying to deliver the message at this point.
|
|
29
|
+
* Must be after `send_at`. Default and max is 3 days after send_at. YYYY-MM-DDThh:mm:ss.SSSZ format */
|
|
34
30
|
expire_at?: Date;
|
|
35
31
|
/** Override the default callback URL for this batch. Must be valid URL. */
|
|
36
32
|
callback_url?: string;
|
|
@@ -38,7 +34,6 @@ export interface MediaResponse {
|
|
|
38
34
|
client_reference?: string;
|
|
39
35
|
/** If set to true then [feedback](/docs/sms/api-reference/sms/tag/Batches/#tag/Batches/operation/deliveryFeedback) is expected after successful delivery. */
|
|
40
36
|
feedback_enabled?: boolean;
|
|
41
|
-
/** Whether or not you want the media included in your message to be checked against [Sinch MMS channel best practices](/docs/mms/bestpractices/). If set to true, your message will be rejected if it doesn
|
|
37
|
+
/** Whether or not you want the media included in your message to be checked against [Sinch MMS channel best practices](/docs/mms/bestpractices/). If set to true, your message will be rejected if it doesn't conform to the listed recommendations, otherwise no validation will be performed. */
|
|
42
38
|
strict_validation?: boolean;
|
|
43
39
|
}
|
|
44
|
-
export type TypeEnum = 'mt_media';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"media-response.js","sourceRoot":"","sources":["../../../../src/models/v1/media-response/media-response.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"media-response.js","sourceRoot":"","sources":["../../../../src/models/v1/media-response/media-response.ts"],"names":[],"mappings":""}
|
|
@@ -1,16 +1,9 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Model: MOBinary
|
|
3
|
-
*
|
|
4
|
-
* THIS FILE HAS BEEN AUTOMATICALLY GENERATED. DO NOT EDIT.
|
|
5
|
-
*
|
|
6
|
-
*/
|
|
7
1
|
import { ApiMoMessage } from '../api-mo-message';
|
|
8
2
|
export interface MOBinary extends ApiMoMessage {
|
|
9
3
|
/** The message content Base64 encoded. Max 140 bytes together with udh. */
|
|
10
4
|
body: string;
|
|
11
5
|
/** SMS in binary format */
|
|
12
|
-
type:
|
|
6
|
+
type: 'mo_binary';
|
|
13
7
|
/** The UDH header of a binary message HEX encoded. Max 140 bytes together with body. */
|
|
14
8
|
udh: string;
|
|
15
9
|
}
|
|
16
|
-
export type TypeEnum = 'mo_binary';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mo-binary.js","sourceRoot":"","sources":["../../../../src/models/v1/mo-binary/mo-binary.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mo-binary.js","sourceRoot":"","sources":["../../../../src/models/v1/mo-binary/mo-binary.ts"],"names":[],"mappings":""}
|
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Model: MOText
|
|
3
|
-
*
|
|
4
|
-
* THIS FILE HAS BEEN AUTOMATICALLY GENERATED. DO NOT EDIT.
|
|
5
|
-
*
|
|
6
|
-
*/
|
|
7
1
|
import { ApiMoMessage } from '../api-mo-message';
|
|
8
2
|
export interface MOText extends ApiMoMessage {
|
|
9
3
|
body: string;
|
|
10
4
|
/** Regular SMS */
|
|
11
|
-
type:
|
|
5
|
+
type: 'mo_text';
|
|
12
6
|
}
|
|
13
|
-
export type TypeEnum = 'mo_text';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mo-text.js","sourceRoot":"","sources":["../../../../src/models/v1/mo-text/mo-text.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mo-text.js","sourceRoot":"","sources":["../../../../src/models/v1/mo-text/mo-text.ts"],"names":[],"mappings":""}
|