@sinch/sms 0.0.1 → 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 +44 -38
- 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 +50 -7
- 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 +48 -5
- package/dist/rest/v1/batches/batches-api.js.map +1 -1
- package/dist/rest/v1/callbacks/callbacks-webhook.d.ts +15 -3
- package/dist/rest/v1/callbacks/callbacks-webhook.js +59 -17
- package/dist/rest/v1/callbacks/callbacks-webhook.js.map +1 -1
- package/dist/rest/v1/delivery-reports/delivery-reports-api.d.ts +8 -9
- 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 +4 -4
- package/dist/rest/v1/delivery-reports/delivery-reports-api.js.map +1 -1
- package/dist/rest/v1/enums.d.ts +1 -1
- package/dist/rest/v1/groups/groups-api.d.ts +2 -2
- package/dist/rest/v1/groups/groups-api.js +2 -2
- package/dist/rest/v1/groups/groups-api.js.map +1 -1
- package/dist/rest/v1/inbounds/inbounds-api.d.ts +2 -2
- package/dist/rest/v1/inbounds/inbounds-api.js +2 -2
- package/dist/rest/v1/inbounds/inbounds-api.js.map +1 -1
- package/dist/rest/v1/index.d.ts +1 -1
- package/dist/rest/v1/index.js +1 -1
- package/dist/rest/v1/index.js.map +1 -1
- package/dist/rest/v1/{sms-api.d.ts → sms-domain-api.d.ts} +1 -1
- package/dist/rest/v1/{sms-api.js → sms-domain-api.js} +4 -4
- package/dist/rest/v1/sms-domain-api.js.map +1 -0
- package/dist/rest/v1/{sms.d.ts → sms-service.d.ts} +1 -7
- package/dist/rest/v1/{sms.js → sms-service.js} +4 -4
- package/dist/rest/v1/sms-service.js.map +1 -0
- 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/dist/rest/v1/sms-api.js.map +0 -1
- package/dist/rest/v1/sms.js.map +0 -1
package/README.md
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
This package contains the Sinch SMS SDK for Node.js for use with [Sinch APIs](https://developers.sinch.com/). To use it, you will need a Sinch account. Please [sign up](https://dashboard.sinch.com/signup) or [log in](https://dashboard.sinch.com/login) if you already have one.
|
|
4
4
|
|
|
5
|
-
<span style="color:red; font-weight:bold">Warning:</span>
|
|
6
|
-
**This SDK is currently available for preview
|
|
5
|
+
> <span style="color:red; font-weight:bold">Warning:</span>
|
|
6
|
+
> **This SDK is currently available to selected developers for preview use only. It is being provided for the purpose of collecting feedback, and should not be used in production environments.**
|
|
7
7
|
|
|
8
8
|
## Installation
|
|
9
9
|
|
|
10
|
-
We recommend to use this SDK as part of the `@sinch/sdk-core` package
|
|
10
|
+
We recommend to use this SDK as part of the [`@sinch/sdk-core`](../../packages/sdk-core) package in order to make the most out of all the Sinch products.
|
|
11
11
|
|
|
12
12
|
However, it's still possible to use this SDK standalone is you need to access the SMS API only.
|
|
13
13
|
|
|
@@ -45,29 +45,35 @@ 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
|
-
|
|
50
|
-
|
|
50
|
+
ServicePlanIdCredentials,
|
|
51
|
+
UnifiedCredentials,
|
|
51
52
|
Region,
|
|
52
53
|
} from '@sinch/sdk-core';
|
|
53
54
|
|
|
54
|
-
const credentialsWithProjectId:
|
|
55
|
+
const credentialsWithProjectId: UnifiedCredentials = {
|
|
55
56
|
projectId: 'PROJECT_ID',
|
|
56
57
|
keyId: 'KEY_ID',
|
|
57
58
|
keySecret: 'KEY_SECRET',
|
|
58
59
|
region: Region.UNITED_STATES, // Optional, default is 'us'. Only other possibility is 'eu'
|
|
59
60
|
};
|
|
60
|
-
|
|
61
|
+
// Access the 'sms' service registered on the Sinch Client
|
|
62
|
+
const sinchClientCreatedWithProjectId = new SinchClient(credentialsWithProjectId);
|
|
63
|
+
const smsServiceWithProjectId: SmsService = sinchClientCreatedWithProjectId.sms;
|
|
61
64
|
|
|
62
|
-
const credentialsWithServicePlanId:
|
|
65
|
+
const credentialsWithServicePlanId: ServicePlanIdCredentials = {
|
|
63
66
|
servicePlanId: 'SERVICE_PLAN_ID',
|
|
64
67
|
apiToken: 'API_TOKEN',
|
|
65
68
|
region: Region.UNITED_STATES, // Optional, default is 'us'. Other possibilities are 'eu', 'br', 'au' and 'ca'
|
|
66
69
|
};
|
|
67
|
-
|
|
70
|
+
// Access the 'sms' service registered on the Sinch Client
|
|
71
|
+
const sinchClientCreatedWithServicePlanId = new SinchClient(credentialsWithServicePlanId);
|
|
72
|
+
const smsServiceWithServicePlanId: SmsService = sinchClientCreatedWithServicePlanId.sms;
|
|
68
73
|
|
|
74
|
+
// Build the request data
|
|
69
75
|
const requestData: SendSMSRequestData = {
|
|
70
|
-
|
|
76
|
+
sendSMSRequestBody: {
|
|
71
77
|
to: [
|
|
72
78
|
'+12223334444',
|
|
73
79
|
'+12223335555'
|
|
@@ -84,80 +90,80 @@ const requestData: SendSMSRequestData = {
|
|
|
84
90
|
},
|
|
85
91
|
};
|
|
86
92
|
|
|
87
|
-
//
|
|
88
|
-
// The request will be authenticated with OAuth2 and sent to https://zt.us.sms.api.sinch.com
|
|
93
|
+
// Use the 'sms' service registered on the Sinch client
|
|
94
|
+
// The request will be authenticated with OAuth2 and sent to https://zt.us.sms.api.sinch.com
|
|
89
95
|
const availabilityResult_1: SendSMSResponse
|
|
90
|
-
= await
|
|
96
|
+
= await smsServiceWithProjectId.batches.send(requestData);
|
|
91
97
|
|
|
92
|
-
//
|
|
93
|
-
// The request will be authenticated with the API Token and sent to https://us.sms.api.sinch.com
|
|
98
|
+
// Use the 'sms' service registered on the Sinch client
|
|
99
|
+
// The request will be authenticated with the API Token and sent to https://us.sms.api.sinch.com
|
|
94
100
|
const availabilityResult_2: SendSMSResponse
|
|
95
|
-
= await
|
|
101
|
+
= await smsServiceWithServicePlanId.batches.send(requestData);
|
|
96
102
|
```
|
|
97
103
|
|
|
98
104
|
### Standalone
|
|
99
105
|
|
|
100
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.
|
|
101
107
|
|
|
102
|
-
#### With the Oauth2TokenRequest plugin
|
|
103
|
-
|
|
104
108
|
```typescript
|
|
105
109
|
import {
|
|
106
110
|
Region,
|
|
107
|
-
|
|
111
|
+
ServicePlanIdCredentials,
|
|
112
|
+
UnifiedCredentials,
|
|
108
113
|
} from '@sinch/sdk-client';
|
|
109
114
|
import {
|
|
110
115
|
SendSMSRequestData,
|
|
111
116
|
SendSMSResponse,
|
|
112
|
-
|
|
117
|
+
SmsService,
|
|
113
118
|
} from '@sinch/sms';
|
|
114
119
|
|
|
115
|
-
const credentialsWithProjectId:
|
|
120
|
+
const credentialsWithProjectId: UnifiedCredentials = {
|
|
116
121
|
projectId: 'PROJECT_ID',
|
|
117
122
|
keyId: 'KEY_ID',
|
|
118
123
|
keySecret: 'KEY_SECRET',
|
|
119
124
|
region: Region.UNITED_STATES, // Optional, default is 'us'. Only other possibility is 'eu'
|
|
120
125
|
};
|
|
121
|
-
// Declare the 'sms' in a standalone way
|
|
122
|
-
const
|
|
126
|
+
// Declare the 'sms' service in a standalone way
|
|
127
|
+
const smsServiceWithProjectId = new SmsService(credentialsWithProjectId);
|
|
123
128
|
|
|
124
|
-
const credentialsWithServicePlanId:
|
|
129
|
+
const credentialsWithServicePlanId: ServicePlanIdCredentials = {
|
|
125
130
|
servicePlanId: 'SERVICE_PLAN_ID',
|
|
126
131
|
apiToken: 'API_TOKEN',
|
|
127
132
|
region: Region.UNITED_STATES, // Optional, default is 'us'. Other possibilities are 'eu', 'br', 'au' and 'ca'
|
|
128
133
|
};
|
|
129
|
-
// Declare the 'sms' in a standalone way
|
|
130
|
-
const
|
|
134
|
+
// Declare the 'sms' service in a standalone way
|
|
135
|
+
const smsServiceWithServicePlanId = new SmsService(credentialsWithServicePlanId);
|
|
131
136
|
|
|
137
|
+
// Build the request data
|
|
132
138
|
const requestData: SendSMSRequestData = {
|
|
133
139
|
// some request parameters
|
|
134
140
|
};
|
|
135
141
|
|
|
136
|
-
// Use the standalone declaration of the 'sms'
|
|
137
|
-
// The request will be authenticated with OAuth2 and sent to https://zt.us.sms.api.sinch.com
|
|
138
|
-
const response_1: SendSMSResponse = await
|
|
142
|
+
// Use the standalone declaration of the 'sms' service
|
|
143
|
+
// The request will be authenticated with OAuth2 and sent to https://zt.us.sms.api.sinch.com
|
|
144
|
+
const response_1: SendSMSResponse = await smsServiceWithProjectId.batches.send(requestData);
|
|
139
145
|
|
|
140
|
-
// Use the standalone declaration of the 'sms'
|
|
141
|
-
// The request will be authenticated with the API Token and sent to https://us.sms.api.sinch.com
|
|
142
|
-
const response_2: SendSMSResponse = await
|
|
146
|
+
// Use the standalone declaration of the 'sms' service
|
|
147
|
+
// The request will be authenticated with the API Token and sent to https://us.sms.api.sinch.com
|
|
148
|
+
const response_2: SendSMSResponse = await smsServiceWithServicePlanId.batches.send(requestData);
|
|
143
149
|
```
|
|
144
150
|
|
|
145
151
|
## Promises
|
|
146
152
|
|
|
147
|
-
All the methods that interact with the Sinch APIs use Promises. You can use `await` in an `async` method to wait for the response or you can resolve them yourself with `then()` / `catch()`.
|
|
153
|
+
All the methods that interact with the Sinch APIs use Promises. You can use `await` in an `async` method to wait for the response, or you can resolve them yourself with `then()` / `catch()`.
|
|
148
154
|
|
|
149
155
|
```typescript
|
|
150
|
-
// Method 1: Wait for the Promise to complete
|
|
151
|
-
let
|
|
156
|
+
// Method 1: Wait for the Promise to complete (you need to be in an 'async' method)
|
|
157
|
+
let batchResponse: SendSMSResponse;
|
|
152
158
|
try {
|
|
153
|
-
|
|
154
|
-
console.log(`The SMS has been sent successfully: batch id = ${
|
|
159
|
+
batchResponse = await smsService.batches.send(requestData);
|
|
160
|
+
console.log(`The SMS has been sent successfully: batch id = ${batchResponse.id}`);
|
|
155
161
|
} catch (error: any) {
|
|
156
162
|
console.error(`ERROR ${error.statusCode}: the SMS could not be sent`);
|
|
157
163
|
}
|
|
158
164
|
|
|
159
165
|
// Method 2: Resolve the promise
|
|
160
|
-
|
|
166
|
+
smsService.batches.send(requestData)
|
|
161
167
|
.then(response => console.log(`The SMS has been sent successfully: batch id = ${response.id}`))
|
|
162
168
|
.catch(error => console.error(`ERROR ${error.statusCode}: the SMS could not be sent`));
|
|
163
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":""}
|