@sinch/sms 0.0.4 → 1.0.0

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.
Files changed (48) hide show
  1. package/README.md +17 -22
  2. package/dist/index.d.ts +1 -1
  3. package/dist/index.js +14 -1
  4. package/dist/index.js.map +1 -1
  5. package/dist/models/v1/index.d.ts +1 -0
  6. package/dist/models/v1/index.js +1 -0
  7. package/dist/models/v1/index.js.map +1 -1
  8. package/dist/models/v1/requests/batches/batches-request-data.d.ts +71 -0
  9. package/dist/models/v1/requests/batches/batches-request-data.js +3 -0
  10. package/dist/models/v1/requests/batches/batches-request-data.js.map +1 -0
  11. package/dist/models/v1/requests/delivery-reports/delivery-reports-request-data.d.ts +33 -0
  12. package/dist/models/v1/requests/delivery-reports/delivery-reports-request-data.js +3 -0
  13. package/dist/models/v1/requests/delivery-reports/delivery-reports-request-data.js.map +1 -0
  14. package/dist/models/v1/requests/groups/groups-request-data.d.ts +37 -0
  15. package/dist/models/v1/requests/groups/groups-request-data.js +3 -0
  16. package/dist/models/v1/requests/groups/groups-request-data.js.map +1 -0
  17. package/dist/models/v1/requests/inbounds/inbounds-request-data.d.ts +18 -0
  18. package/dist/models/v1/requests/inbounds/inbounds-request-data.js +3 -0
  19. package/dist/models/v1/requests/inbounds/inbounds-request-data.js.map +1 -0
  20. package/dist/models/v1/requests/index.d.ts +4 -0
  21. package/dist/models/v1/requests/index.js +21 -0
  22. package/dist/models/v1/requests/index.js.map +1 -0
  23. package/dist/rest/v1/batches/batches-api.d.ts +1 -62
  24. package/dist/rest/v1/batches/batches-api.jest.fixture.d.ts +2 -2
  25. package/dist/rest/v1/batches/batches-api.jest.fixture.js.map +1 -1
  26. package/dist/rest/v1/batches/batches-api.js +15 -15
  27. package/dist/rest/v1/batches/batches-api.js.map +1 -1
  28. package/dist/rest/v1/delivery-reports/delivery-reports-api.d.ts +1 -33
  29. package/dist/rest/v1/delivery-reports/delivery-reports-api.jest.fixture.d.ts +2 -2
  30. package/dist/rest/v1/delivery-reports/delivery-reports-api.jest.fixture.js.map +1 -1
  31. package/dist/rest/v1/delivery-reports/delivery-reports-api.js +5 -5
  32. package/dist/rest/v1/delivery-reports/delivery-reports-api.js.map +1 -1
  33. package/dist/rest/v1/groups/groups-api.d.ts +1 -35
  34. package/dist/rest/v1/groups/groups-api.jest.fixture.d.ts +2 -2
  35. package/dist/rest/v1/groups/groups-api.jest.fixture.js.map +1 -1
  36. package/dist/rest/v1/groups/groups-api.js +13 -13
  37. package/dist/rest/v1/groups/groups-api.js.map +1 -1
  38. package/dist/rest/v1/inbounds/inbounds-api.d.ts +1 -19
  39. package/dist/rest/v1/inbounds/inbounds-api.jest.fixture.d.ts +2 -2
  40. package/dist/rest/v1/inbounds/inbounds-api.js +3 -3
  41. package/dist/rest/v1/inbounds/inbounds-api.js.map +1 -1
  42. package/dist/rest/v1/sms-domain-api.d.ts +10 -5
  43. package/dist/rest/v1/sms-domain-api.js +27 -38
  44. package/dist/rest/v1/sms-domain-api.js.map +1 -1
  45. package/dist/rest/v1/sms-service.d.ts +28 -5
  46. package/dist/rest/v1/sms-service.js +36 -8
  47. package/dist/rest/v1/sms-service.js.map +1 -1
  48. package/package.json +2 -2
package/README.md CHANGED
@@ -2,9 +2,6 @@
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 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
-
8
5
  ## Installation
9
6
 
10
7
  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.
@@ -43,20 +40,19 @@ If you are using this SDK as part of the Sinch SDK (`@sinch/sdk-core`) you can a
43
40
 
44
41
  ```typescript
45
42
  import {
46
- SendSMSRequestData,
47
- SendSMSResponse,
43
+ Sms,
48
44
  SmsService,
49
45
  SinchClient,
50
46
  ServicePlanIdCredentials,
51
47
  UnifiedCredentials,
52
- Region,
48
+ SmsRegion,
53
49
  } from '@sinch/sdk-core';
54
50
 
55
51
  const credentialsWithProjectId: UnifiedCredentials = {
56
52
  projectId: 'PROJECT_ID',
57
53
  keyId: 'KEY_ID',
58
54
  keySecret: 'KEY_SECRET',
59
- region: Region.UNITED_STATES, // Optional, default is 'us'. Only other possibility is 'eu'
55
+ smsRegion: SmsRegion.UNITED_STATES, // Optional, default is 'us'. Only other possibility is 'eu'
60
56
  };
61
57
  // Access the 'sms' service registered on the Sinch Client
62
58
  const sinchClientCreatedWithProjectId = new SinchClient(credentialsWithProjectId);
@@ -65,25 +61,25 @@ const smsServiceWithProjectId: SmsService = sinchClientCreatedWithProjectId.sms;
65
61
  const credentialsWithServicePlanId: ServicePlanIdCredentials = {
66
62
  servicePlanId: 'SERVICE_PLAN_ID',
67
63
  apiToken: 'API_TOKEN',
68
- region: Region.UNITED_STATES, // Optional, default is 'us'. Other possibilities are 'eu', 'br', 'au' and 'ca'
64
+ smsRegion: SmsRegion.UNITED_STATES, // Optional, default is 'us'. Other possibilities are 'eu', 'br', 'au' and 'ca'
69
65
  };
70
66
  // Access the 'sms' service registered on the Sinch Client
71
67
  const sinchClientCreatedWithServicePlanId = new SinchClient(credentialsWithServicePlanId);
72
68
  const smsServiceWithServicePlanId: SmsService = sinchClientCreatedWithServicePlanId.sms;
73
69
 
74
70
  // Build the request data
75
- const requestData: SendSMSRequestData = {
71
+ const requestData: Sms.SendSMSRequestData = {
76
72
  sendSMSRequestBody: {
77
73
  to: [
78
74
  '+12223334444',
79
- '+12223335555'
75
+ '+12223335555',
80
76
  ],
81
77
  from: '+12228889999',
82
78
  parameters: {
83
79
  name: {
84
80
  '+12223334444': 'John',
85
81
  default: 'there',
86
- }
82
+ },
87
83
  },
88
84
  body: 'Hi ${name}',
89
85
  type: 'mt_text',
@@ -92,12 +88,12 @@ const requestData: SendSMSRequestData = {
92
88
 
93
89
  // Use the 'sms' service registered on the Sinch client
94
90
  // The request will be authenticated with OAuth2 and sent to https://zt.us.sms.api.sinch.com
95
- const availabilityResult_1: SendSMSResponse
91
+ const availabilityResult_1: Sms.SendSMSResponse
96
92
  = await smsServiceWithProjectId.batches.send(requestData);
97
93
 
98
94
  // Use the 'sms' service registered on the Sinch client
99
95
  // The request will be authenticated with the API Token and sent to https://us.sms.api.sinch.com
100
- const availabilityResult_2: SendSMSResponse
96
+ const availabilityResult_2: Sms.SendSMSResponse
101
97
  = await smsServiceWithServicePlanId.batches.send(requestData);
102
98
  ```
103
99
 
@@ -107,13 +103,12 @@ The SDK can be used standalone if you need to use only the SMS APIs. As for a us
107
103
 
108
104
  ```typescript
109
105
  import {
110
- Region,
106
+ SmsRegion,
111
107
  ServicePlanIdCredentials,
112
108
  UnifiedCredentials,
113
109
  } from '@sinch/sdk-client';
114
110
  import {
115
- SendSMSRequestData,
116
- SendSMSResponse,
111
+ Sms,
117
112
  SmsService,
118
113
  } from '@sinch/sms';
119
114
 
@@ -121,7 +116,7 @@ const credentialsWithProjectId: UnifiedCredentials = {
121
116
  projectId: 'PROJECT_ID',
122
117
  keyId: 'KEY_ID',
123
118
  keySecret: 'KEY_SECRET',
124
- region: Region.UNITED_STATES, // Optional, default is 'us'. Only other possibility is 'eu'
119
+ smsRegion: SmsRegion.UNITED_STATES, // Optional, default is 'us'. Only other possibility is 'eu'
125
120
  };
126
121
  // Declare the 'sms' service in a standalone way
127
122
  const smsServiceWithProjectId = new SmsService(credentialsWithProjectId);
@@ -129,23 +124,23 @@ const smsServiceWithProjectId = new SmsService(credentialsWithProjectId);
129
124
  const credentialsWithServicePlanId: ServicePlanIdCredentials = {
130
125
  servicePlanId: 'SERVICE_PLAN_ID',
131
126
  apiToken: 'API_TOKEN',
132
- region: Region.UNITED_STATES, // Optional, default is 'us'. Other possibilities are 'eu', 'br', 'au' and 'ca'
127
+ smsRegion: SmsRegion.UNITED_STATES, // Optional, default is 'us'. Other possibilities are 'eu', 'br', 'au' and 'ca'
133
128
  };
134
129
  // Declare the 'sms' service in a standalone way
135
130
  const smsServiceWithServicePlanId = new SmsService(credentialsWithServicePlanId);
136
131
 
137
132
  // Build the request data
138
- const requestData: SendSMSRequestData = {
133
+ const requestData: Sms.SendSMSRequestData = {
139
134
  // some request parameters
140
135
  };
141
136
 
142
137
  // Use the standalone declaration of the 'sms' service
143
138
  // 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
+ const response_1: Sms.SendSMSResponse = await smsServiceWithProjectId.batches.send(requestData);
145
140
 
146
141
  // Use the standalone declaration of the 'sms' service
147
142
  // 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
+ const response_2: Sms.SendSMSResponse = await smsServiceWithServicePlanId.batches.send(requestData);
149
144
  ```
150
145
 
151
146
  ## Promises
@@ -154,7 +149,7 @@ All the methods that interact with the Sinch APIs use Promises. You can use `awa
154
149
 
155
150
  ```typescript
156
151
  // Method 1: Wait for the Promise to complete (you need to be in an 'async' method)
157
- let batchResponse: SendSMSResponse;
152
+ let batchResponse: Sms.SendSMSResponse;
158
153
  try {
159
154
  batchResponse = await smsService.batches.send(requestData);
160
155
  console.log(`The SMS has been sent successfully: batch id = ${batchResponse.id}`);
package/dist/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- export * from './models';
1
+ export * as Sms from './models';
2
2
  export * from './rest';
3
3
  export * from '@sinch/sdk-client';
package/dist/index.js CHANGED
@@ -10,11 +10,24 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
10
10
  if (k2 === undefined) k2 = k;
11
11
  o[k2] = m[k];
12
12
  }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
13
25
  var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
26
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
27
  };
16
28
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./models"), exports);
29
+ exports.Sms = void 0;
30
+ exports.Sms = __importStar(require("./models"));
18
31
  __exportStar(require("./rest"), exports);
19
32
  __exportStar(require("@sinch/sdk-client"), exports);
20
33
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,yCAAuB;AACvB,oDAAkC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAAgC;AAChC,yCAAuB;AACvB,oDAAkC"}
@@ -42,3 +42,4 @@ export * from './update-group-request-auto-update';
42
42
  export * from './update-group-request-auto-update-add';
43
43
  export * from './update-group-request-auto-update-remove';
44
44
  export * from './enums';
45
+ export * from './requests';
@@ -58,4 +58,5 @@ __exportStar(require("./update-group-request-auto-update"), exports);
58
58
  __exportStar(require("./update-group-request-auto-update-add"), exports);
59
59
  __exportStar(require("./update-group-request-auto-update-remove"), exports);
60
60
  __exportStar(require("./enums"), exports);
61
+ __exportStar(require("./requests"), exports);
61
62
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
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
+ {"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;AACxB,6CAA2B"}
@@ -0,0 +1,71 @@
1
+ import { DeliveryFeedbackRequest } from '../../delivery-feedback-request';
2
+ import { DryRunRequest, ReplaceBatchMessageRequest } from '../../dry-run-request';
3
+ import { SendSMSRequest } from '../../send-sms-request';
4
+ import { TextRequest } from '../../text-request';
5
+ import { BinaryRequest } from '../../binary-request';
6
+ import { MediaRequest } from '../../media-request';
7
+ import { UpdateBatchMessageRequest } from '../../update-batch-message-request';
8
+ export interface CancelBatchMessageRequestData {
9
+ /** The batch ID you received from sending a message. */
10
+ 'batch_id': string;
11
+ }
12
+ export interface DeliveryFeedbackRequestData {
13
+ /** The batch ID you received from sending a message. */
14
+ 'batch_id': string;
15
+ /** A list of phone numbers (MSISDNs) that successfully received the message. */
16
+ 'deliveryFeedbackRequestBody': DeliveryFeedbackRequest;
17
+ }
18
+ export interface DryRunRequestData {
19
+ /** Whether to include per recipient details in the response */
20
+ 'per_recipient'?: boolean;
21
+ /** Max number of recipients to include per recipient details for in the response */
22
+ 'number_of_recipients'?: number;
23
+ /** */
24
+ 'dryRunRequestBody'?: DryRunRequest;
25
+ }
26
+ export interface GetBatchMessageRequestData {
27
+ /** The batch ID you received from sending a message. */
28
+ 'batch_id': string;
29
+ }
30
+ export interface ListBatchesRequestData {
31
+ /** The page number starting from 0. */
32
+ 'page'?: number;
33
+ /** Determines the size of a page. */
34
+ 'page_size'?: number;
35
+ /** Only list messages sent from this sender number. Multiple originating numbers can be comma separated. Must be phone numbers or short code. */
36
+ 'from'?: string;
37
+ /** Only list messages received at or after this date/time. Formatted as [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601): `YYYY-MM-DDThh:mm:ss.SSSZ`. Default: Now-24 */
38
+ 'start_date'?: Date;
39
+ /** Only list messages received before this date/time. Formatted as [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601): `YYYY-MM-DDThh:mm:ss.SSSZ`. */
40
+ 'end_date'?: Date;
41
+ /** Client reference to include */
42
+ 'client_reference'?: string;
43
+ }
44
+ export interface ReplaceBatchMessageRequestData {
45
+ /** The batch ID you received from sending a message. */
46
+ 'batch_id': string;
47
+ /** */
48
+ 'replaceBatchMessageRequestBody'?: ReplaceBatchMessageRequest;
49
+ }
50
+ export interface SendSMSRequestData {
51
+ /** Default schema is Text if type is not specified. */
52
+ 'sendSMSRequestBody'?: SendSMSRequest;
53
+ }
54
+ export interface SendTextSMSRequestData {
55
+ /** TextMessage request body */
56
+ 'sendSMSRequestBody'?: TextRequest;
57
+ }
58
+ export interface SendBinarySMSRequestData {
59
+ /** BinaryMessage request body */
60
+ 'sendSMSRequestBody'?: BinaryRequest;
61
+ }
62
+ export interface SendMediaSMSRequestData {
63
+ /** MediaMessage request body */
64
+ 'sendSMSRequestBody'?: MediaRequest;
65
+ }
66
+ export interface UpdateBatchMessageRequestData {
67
+ /** The batch ID you received from sending a message. */
68
+ 'batch_id': string;
69
+ /** */
70
+ 'updateBatchMessageRequestBody'?: UpdateBatchMessageRequest;
71
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=batches-request-data.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"batches-request-data.js","sourceRoot":"","sources":["../../../../../src/models/v1/requests/batches/batches-request-data.ts"],"names":[],"mappings":""}
@@ -0,0 +1,33 @@
1
+ import { DeliveryReportStatusEnum } from '../../enums';
2
+ export interface GetDeliveryReportByBatchIdRequestData {
3
+ /** The batch ID you received from sending a message. */
4
+ 'batch_id': string;
5
+ /** The type of delivery report. - A `summary` will count the number of messages sent per status. - A `full` report give that of a `summary` report but in addition, lists phone numbers. */
6
+ 'type'?: 'summary' | 'full';
7
+ /** Comma separated list of delivery_report_statuses to include */
8
+ 'status'?: DeliveryReportStatusEnum[];
9
+ /** Comma separated list of delivery_receipt_error_codes to include */
10
+ 'code'?: string;
11
+ }
12
+ export interface GetDeliveryReportByPhoneNumberRequestData {
13
+ /** The batch ID you received from sending a message. */
14
+ 'batch_id': string;
15
+ /** Phone number for which you to want to search. */
16
+ 'recipient_msisdn': string;
17
+ }
18
+ export interface ListDeliveryReportsRequestData {
19
+ /** The page number starting from 0. */
20
+ 'page'?: number;
21
+ /** Determines the size of a page. */
22
+ 'page_size'?: number;
23
+ /** Only list messages received at or after this date/time. Default: 24h ago */
24
+ 'start_date'?: Date;
25
+ /** Only list messages received before this date/time. */
26
+ 'end_date'?: Date;
27
+ /** Comma separated list of delivery report statuses to include. */
28
+ 'status'?: DeliveryReportStatusEnum[];
29
+ /** Comma separated list of delivery receipt error codes to include. */
30
+ 'code'?: string;
31
+ /** Client reference to include */
32
+ 'client_reference'?: string;
33
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=delivery-reports-request-data.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delivery-reports-request-data.js","sourceRoot":"","sources":["../../../../../src/models/v1/requests/delivery-reports/delivery-reports-request-data.ts"],"names":[],"mappings":""}
@@ -0,0 +1,37 @@
1
+ import { CreateGroupRequest } from '../../create-group-request';
2
+ import { ReplaceGroupRequest } from '../../replace-group-request';
3
+ import { UpdateGroupRequest } from '../../update-group-request';
4
+ export interface CreateGroupRequestData {
5
+ /** */
6
+ 'createGroupRequestBody'?: CreateGroupRequest;
7
+ }
8
+ export interface DeleteGroupRequestData {
9
+ /** ID of a group that you are interested in getting. */
10
+ 'group_id': string;
11
+ }
12
+ export interface ListMembersRequestData {
13
+ /** ID of a group that you are interested in getting. */
14
+ 'group_id': string;
15
+ }
16
+ export interface ListGroupsRequestData {
17
+ /** The page number starting from 0. */
18
+ 'page'?: number;
19
+ /** Determines the size of a page. */
20
+ 'page_size'?: number;
21
+ }
22
+ export interface ReplaceGroupRequestData {
23
+ /** ID of a group that you are interested in getting. */
24
+ 'group_id': string;
25
+ /** */
26
+ 'replaceGroupRequestBody'?: ReplaceGroupRequest;
27
+ }
28
+ export interface GetGroupRequestData {
29
+ /** ID of a group that you are interested in getting. */
30
+ 'group_id': string;
31
+ }
32
+ export interface UpdateGroupRequestData {
33
+ /** ID of a group that you are interested in getting. */
34
+ 'group_id': string;
35
+ /** */
36
+ 'updateGroupRequestBody'?: UpdateGroupRequest;
37
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=groups-request-data.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"groups-request-data.js","sourceRoot":"","sources":["../../../../../src/models/v1/requests/groups/groups-request-data.ts"],"names":[],"mappings":""}
@@ -0,0 +1,18 @@
1
+ export interface ListInboundMessagesRequestData {
2
+ /** The page number starting from 0. */
3
+ 'page'?: number;
4
+ /** Determines the size of a page */
5
+ 'page_size'?: number;
6
+ /** Only list messages sent to this destination. Multiple phone numbers formatted as either <a href=\"https://community.sinch.com/t5/Glossary/E-164/ta-p/7537\" target=\"_blank\">E.164</a> or short codes can be comma separated. */
7
+ 'to'?: string;
8
+ /** Only list messages received at or after this date/time. Formatted as [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601): `YYYY-MM-DDThh:mm:ss.SSSZ`. Default: Now-24 */
9
+ 'start_date'?: Date;
10
+ /** Only list messages received before this date/time. Formatted as [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601): `YYYY-MM-DDThh:mm:ss.SSSZ`. */
11
+ 'end_date'?: Date;
12
+ /** Using a client reference in inbound messages requires additional setup on your account. Contact your [account manager](https://dashboard.sinch.com/settings/account-details) to enable this feature. Only list inbound messages that are in response to messages with a previously provided client reference. */
13
+ 'client_reference'?: string;
14
+ }
15
+ export interface GetInboundMessageRequestData {
16
+ /** The inbound ID found when listing inbound messages. */
17
+ 'inbound_id': string;
18
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=inbounds-request-data.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inbounds-request-data.js","sourceRoot":"","sources":["../../../../../src/models/v1/requests/inbounds/inbounds-request-data.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ export * from './batches/batches-request-data';
2
+ export * from './delivery-reports/delivery-reports-request-data';
3
+ export * from './groups/groups-request-data';
4
+ export * from './inbounds/inbounds-request-data';
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./batches/batches-request-data"), exports);
18
+ __exportStar(require("./delivery-reports/delivery-reports-request-data"), exports);
19
+ __exportStar(require("./groups/groups-request-data"), exports);
20
+ __exportStar(require("./inbounds/inbounds-request-data"), exports);
21
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/models/v1/requests/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iEAA+C;AAC/C,mFAAiE;AACjE,+DAA6C;AAC7C,mEAAiD"}
@@ -1,67 +1,6 @@
1
- import { CancelBatchMessageResponse, DeliveryFeedbackRequest, DryRunResponse, DryRunRequest, ReplaceBatchMessageResponse, ReplaceBatchMessageRequest, SendSMSResponse, SendSMSRequest, UpdateBatchMessageRequest, TextRequest, BinaryRequest, MediaRequest, BinaryResponse, TextResponse, MediaResponse } from '../../../models';
1
+ import { CancelBatchMessageResponse, DryRunResponse, ReplaceBatchMessageResponse, SendSMSResponse, BinaryResponse, TextResponse, MediaResponse, CancelBatchMessageRequestData, DeliveryFeedbackRequestData, DryRunRequestData, GetBatchMessageRequestData, ListBatchesRequestData, ReplaceBatchMessageRequestData, SendSMSRequestData, SendTextSMSRequestData, SendBinarySMSRequestData, SendMediaSMSRequestData, UpdateBatchMessageRequestData } from '../../../models';
2
2
  import { ApiListPromise, SinchClientParameters } from '@sinch/sdk-client';
3
3
  import { SmsDomainApi } from '../sms-domain-api';
4
- export interface CancelBatchMessageRequestData {
5
- /** The batch ID you received from sending a message. */
6
- 'batch_id': string;
7
- }
8
- export interface DeliveryFeedbackRequestData {
9
- /** The batch ID you received from sending a message. */
10
- 'batch_id': string;
11
- /** A list of phone numbers (MSISDNs) that successfully received the message. */
12
- 'deliveryFeedbackRequestBody': DeliveryFeedbackRequest;
13
- }
14
- export interface DryRunRequestData {
15
- /** Whether to include per recipient details in the response */
16
- 'per_recipient'?: boolean;
17
- /** Max number of recipients to include per recipient details for in the response */
18
- 'number_of_recipients'?: number;
19
- /** */
20
- 'dryRunRequestBody'?: DryRunRequest;
21
- }
22
- export interface GetBatchMessageRequestData {
23
- /** The batch ID you received from sending a message. */
24
- 'batch_id': string;
25
- }
26
- export interface ListBatchesRequestData {
27
- /** The page number starting from 0. */
28
- 'page'?: number;
29
- /** Determines the size of a page. */
30
- 'page_size'?: number;
31
- /** Only list messages sent from this sender number. Multiple originating numbers can be comma separated. Must be phone numbers or short code. */
32
- 'from'?: string;
33
- /** Only list messages received at or after this date/time. Formatted as [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601): `YYYY-MM-DDThh:mm:ss.SSSZ`. Default: Now-24 */
34
- 'start_date'?: Date;
35
- /** Only list messages received before this date/time. Formatted as [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601): `YYYY-MM-DDThh:mm:ss.SSSZ`. */
36
- 'end_date'?: Date;
37
- /** Client reference to include */
38
- 'client_reference'?: string;
39
- }
40
- export interface ReplaceBatchMessageRequestData {
41
- /** The batch ID you received from sending a message. */
42
- 'batch_id': string;
43
- /** */
44
- 'replaceBatchMessageRequestBody'?: ReplaceBatchMessageRequest;
45
- }
46
- export interface SendSMSRequestData {
47
- /** Default schema is Text if type is not specified. */
48
- 'sendSMSRequestBody'?: SendSMSRequest;
49
- }
50
- export interface SendTextSMSRequestData {
51
- 'sendSMSRequestBody'?: TextRequest;
52
- }
53
- export interface SendBinarySMSRequestData {
54
- 'sendSMSRequestBody'?: BinaryRequest;
55
- }
56
- export interface SendMediaSMSRequestData {
57
- 'sendSMSRequestBody'?: MediaRequest;
58
- }
59
- export interface UpdateBatchMessageRequestData {
60
- /** The batch ID you received from sending a message. */
61
- 'batch_id': string;
62
- /** */
63
- 'updateBatchMessageRequestBody'?: UpdateBatchMessageRequest;
64
- }
65
4
  export declare class BatchesApi extends SmsDomainApi {
66
5
  /**
67
6
  * Initialize your interface
@@ -1,6 +1,6 @@
1
1
  /// <reference types="jest" />
2
- import { BatchesApi, CancelBatchMessageRequestData, DeliveryFeedbackRequestData, DryRunRequestData, GetBatchMessageRequestData, ListBatchesRequestData, ReplaceBatchMessageRequestData, SendBinarySMSRequestData, SendMediaSMSRequestData, SendSMSRequestData, SendTextSMSRequestData, UpdateBatchMessageRequestData } from './batches-api';
3
- import { BinaryResponse, DryRunResponse, MediaResponse, SendSMSResponse, TextResponse } from '../../../models';
2
+ import { BatchesApi } from './batches-api';
3
+ import { BinaryResponse, CancelBatchMessageRequestData, DeliveryFeedbackRequestData, DryRunRequestData, DryRunResponse, GetBatchMessageRequestData, ListBatchesRequestData, MediaResponse, ReplaceBatchMessageRequestData, SendBinarySMSRequestData, SendMediaSMSRequestData, SendSMSRequestData, SendSMSResponse, SendTextSMSRequestData, TextResponse, UpdateBatchMessageRequestData } from '../../../models';
4
4
  import { ApiListPromise } from '@sinch/sdk-client';
5
5
  export declare class BatchesApiFixture implements Partial<Readonly<BatchesApi>> {
6
6
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"batches-api.jest.fixture.js","sourceRoot":"","sources":["../../../../src/rest/v1/batches/batches-api.jest.fixture.ts"],"names":[],"mappings":";;;AAiBA,MAAa,iBAAiB;IAA9B;QAEE;;YAEI;QACG,WAAM,GAAyE,IAAI,CAAC,EAAE,EAAE,CAAC;QAChG;;YAEI;QACG,yBAAoB,GAA4D,IAAI,CAAC,EAAE,EAAE,CAAC;QACjG;;YAEI;QACG,WAAM,GAA4D,IAAI,CAAC,EAAE,EAAE,CAAC;QACnF;;YAEI;QACG,QAAG,GAAsE,IAAI,CAAC,EAAE,EAAE,CAAC;QAC1F;;YAEI;QACG,SAAI,GAAyE,IAAI,CAAC,EAAE,EAAE,CAAC;QAC9F;;YAEI;QACG,YAAO,GAA0E,IAAI,CAAC,EAAE,EAAE,CAAC;QAClG;;YAEI;QACG,SAAI,GAA8D,IAAI,CAAC,EAAE,EAAE,CAAC;QACnF;;WAEG;QACI,oBAAe,GAA+D,IAAI,CAAC,EAAE,EAAE,CAAC;QAC/F;;WAEG;QACI,sBAAiB,GAAmE,IAAI,CAAC,EAAE,EAAE,CAAC;QACrG;;WAEG;QACI,qBAAgB,GAAiE,IAAI,CAAC,EAAE,EAAE,CAAC;QAClG;;YAEI;QACG,WAAM,GAAyE,IAAI,CAAC,EAAE,EAAE,CAAC;IAClG,CAAC;CAAA;AA9CD,8CA8CC"}
1
+ {"version":3,"file":"batches-api.jest.fixture.js","sourceRoot":"","sources":["../../../../src/rest/v1/batches/batches-api.jest.fixture.ts"],"names":[],"mappings":";;;AAqBA,MAAa,iBAAiB;IAA9B;QAEE;;YAEI;QACG,WAAM,GAAyE,IAAI,CAAC,EAAE,EAAE,CAAC;QAChG;;YAEI;QACG,yBAAoB,GAA4D,IAAI,CAAC,EAAE,EAAE,CAAC;QACjG;;YAEI;QACG,WAAM,GAA4D,IAAI,CAAC,EAAE,EAAE,CAAC;QACnF;;YAEI;QACG,QAAG,GAAsE,IAAI,CAAC,EAAE,EAAE,CAAC;QAC1F;;YAEI;QACG,SAAI,GAAyE,IAAI,CAAC,EAAE,EAAE,CAAC;QAC9F;;YAEI;QACG,YAAO,GAA0E,IAAI,CAAC,EAAE,EAAE,CAAC;QAClG;;YAEI;QACG,SAAI,GAA8D,IAAI,CAAC,EAAE,EAAE,CAAC;QACnF;;WAEG;QACI,oBAAe,GAA+D,IAAI,CAAC,EAAE,EAAE,CAAC;QAC/F;;WAEG;QACI,sBAAiB,GAAmE,IAAI,CAAC,EAAE,EAAE,CAAC;QACrG;;WAEG;QACI,qBAAgB,GAAiE,IAAI,CAAC,EAAE,EAAE,CAAC;QAClG;;YAEI;QACG,WAAM,GAAyE,IAAI,CAAC,EAAE,EAAE,CAAC;IAClG,CAAC;CAAA;AA9CD,8CA8CC"}
@@ -25,9 +25,9 @@ class BatchesApi extends sms_domain_api_1.SmsDomainApi {
25
25
  'Accept': 'application/json',
26
26
  };
27
27
  const body = '';
28
- const basePathUrl = `${this.client.apiClientOptions.basePath}/xms/v1/${this.client.apiClientOptions.projectId}/batches/${data['batch_id']}`;
28
+ const basePathUrl = `${this.client.apiClientOptions.hostname}/xms/v1/${this.client.apiClientOptions.projectId}/batches/${data['batch_id']}`;
29
29
  const requestOptions = await this.client.prepareOptions(basePathUrl, 'DELETE', getParams, headers, body || undefined);
30
- const url = this.client.prepareUrl(requestOptions.basePath, requestOptions.queryParams);
30
+ const url = this.client.prepareUrl(requestOptions.hostname, requestOptions.queryParams);
31
31
  return this.client.processCall({
32
32
  url,
33
33
  requestOptions,
@@ -50,9 +50,9 @@ class BatchesApi extends sms_domain_api_1.SmsDomainApi {
50
50
  'Accept': 'application/json',
51
51
  };
52
52
  const body = data['deliveryFeedbackRequestBody'] ? JSON.stringify(data['deliveryFeedbackRequestBody']) : '{}';
53
- const basePathUrl = `${this.client.apiClientOptions.basePath}/xms/v1/${this.client.apiClientOptions.projectId}/batches/${data['batch_id']}/delivery_feedback`;
53
+ const basePathUrl = `${this.client.apiClientOptions.hostname}/xms/v1/${this.client.apiClientOptions.projectId}/batches/${data['batch_id']}/delivery_feedback`;
54
54
  const requestOptions = await this.client.prepareOptions(basePathUrl, 'POST', getParams, headers, body || undefined);
55
- const url = this.client.prepareUrl(requestOptions.basePath, requestOptions.queryParams);
55
+ const url = this.client.prepareUrl(requestOptions.hostname, requestOptions.queryParams);
56
56
  return this.client.processCall({
57
57
  url,
58
58
  requestOptions,
@@ -77,9 +77,9 @@ class BatchesApi extends sms_domain_api_1.SmsDomainApi {
77
77
  'Accept': 'application/json',
78
78
  };
79
79
  const body = data['dryRunRequestBody'] ? JSON.stringify(data['dryRunRequestBody']) : '{}';
80
- const basePathUrl = `${this.client.apiClientOptions.basePath}/xms/v1/${this.client.apiClientOptions.projectId}/batches/dry_run`;
80
+ const basePathUrl = `${this.client.apiClientOptions.hostname}/xms/v1/${this.client.apiClientOptions.projectId}/batches/dry_run`;
81
81
  const requestOptions = await this.client.prepareOptions(basePathUrl, 'POST', getParams, headers, body || undefined);
82
- const url = this.client.prepareUrl(requestOptions.basePath, requestOptions.queryParams);
82
+ const url = this.client.prepareUrl(requestOptions.hostname, requestOptions.queryParams);
83
83
  return this.client.processCall({
84
84
  url,
85
85
  requestOptions,
@@ -100,9 +100,9 @@ class BatchesApi extends sms_domain_api_1.SmsDomainApi {
100
100
  'Accept': 'application/json',
101
101
  };
102
102
  const body = '';
103
- const basePathUrl = `${this.client.apiClientOptions.basePath}/xms/v1/${this.client.apiClientOptions.projectId}/batches/${data['batch_id']}`;
103
+ const basePathUrl = `${this.client.apiClientOptions.hostname}/xms/v1/${this.client.apiClientOptions.projectId}/batches/${data['batch_id']}`;
104
104
  const requestOptions = await this.client.prepareOptions(basePathUrl, 'GET', getParams, headers, body || undefined);
105
- const url = this.client.prepareUrl(requestOptions.basePath, requestOptions.queryParams);
105
+ const url = this.client.prepareUrl(requestOptions.hostname, requestOptions.queryParams);
106
106
  return this.client.processCall({
107
107
  url,
108
108
  requestOptions,
@@ -125,7 +125,7 @@ class BatchesApi extends sms_domain_api_1.SmsDomainApi {
125
125
  'Accept': 'application/json',
126
126
  };
127
127
  const body = '';
128
- const basePathUrl = `${this.client.apiClientOptions.basePath}/xms/v1/${this.client.apiClientOptions.projectId}/batches`;
128
+ const basePathUrl = `${this.client.apiClientOptions.hostname}/xms/v1/${this.client.apiClientOptions.projectId}/batches`;
129
129
  const requestOptionsPromise = this.client.prepareOptions(basePathUrl, 'GET', getParams, headers, body || undefined);
130
130
  const operationProperties = {
131
131
  pagination: sdk_client_1.PaginationEnum.PAGE,
@@ -152,9 +152,9 @@ class BatchesApi extends sms_domain_api_1.SmsDomainApi {
152
152
  'Accept': 'application/json',
153
153
  };
154
154
  const body = data['replaceBatchMessageRequestBody'] ? JSON.stringify(data['replaceBatchMessageRequestBody']) : '{}';
155
- const basePathUrl = `${this.client.apiClientOptions.basePath}/xms/v1/${this.client.apiClientOptions.projectId}/batches/${data['batch_id']}`;
155
+ const basePathUrl = `${this.client.apiClientOptions.hostname}/xms/v1/${this.client.apiClientOptions.projectId}/batches/${data['batch_id']}`;
156
156
  const requestOptions = await this.client.prepareOptions(basePathUrl, 'PUT', getParams, headers, body || undefined);
157
- const url = this.client.prepareUrl(requestOptions.basePath, requestOptions.queryParams);
157
+ const url = this.client.prepareUrl(requestOptions.hostname, requestOptions.queryParams);
158
158
  return this.client.processCall({
159
159
  url,
160
160
  requestOptions,
@@ -179,9 +179,9 @@ class BatchesApi extends sms_domain_api_1.SmsDomainApi {
179
179
  'Accept': 'application/json',
180
180
  };
181
181
  const body = data['sendSMSRequestBody'] ? JSON.stringify(data['sendSMSRequestBody']) : '{}';
182
- const basePathUrl = `${this.client.apiClientOptions.basePath}/xms/v1/${this.client.apiClientOptions.projectId}/batches`;
182
+ const basePathUrl = `${this.client.apiClientOptions.hostname}/xms/v1/${this.client.apiClientOptions.projectId}/batches`;
183
183
  const requestOptions = await this.client.prepareOptions(basePathUrl, 'POST', getParams, headers, body || undefined);
184
- const url = this.client.prepareUrl(requestOptions.basePath, requestOptions.queryParams);
184
+ const url = this.client.prepareUrl(requestOptions.hostname, requestOptions.queryParams);
185
185
  return this.client.processCall({
186
186
  url,
187
187
  requestOptions,
@@ -241,9 +241,9 @@ class BatchesApi extends sms_domain_api_1.SmsDomainApi {
241
241
  'Accept': 'application/json',
242
242
  };
243
243
  const body = data['updateBatchMessageRequestBody'] ? JSON.stringify(data['updateBatchMessageRequestBody']) : '{}';
244
- const basePathUrl = `${this.client.apiClientOptions.basePath}/xms/v1/${this.client.apiClientOptions.projectId}/batches/${data['batch_id']}`;
244
+ const basePathUrl = `${this.client.apiClientOptions.hostname}/xms/v1/${this.client.apiClientOptions.projectId}/batches/${data['batch_id']}`;
245
245
  const requestOptions = await this.client.prepareOptions(basePathUrl, 'POST', getParams, headers, body || undefined);
246
- const url = this.client.prepareUrl(requestOptions.basePath, requestOptions.queryParams);
246
+ const url = this.client.prepareUrl(requestOptions.hostname, requestOptions.queryParams);
247
247
  return this.client.processCall({
248
248
  url,
249
249
  requestOptions,