@sinch/sms 0.0.3 → 0.0.5

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 -19
  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
@@ -43,20 +43,19 @@ If you are using this SDK as part of the Sinch SDK (`@sinch/sdk-core`) you can a
43
43
 
44
44
  ```typescript
45
45
  import {
46
- SendSMSRequestData,
47
- SendSMSResponse,
46
+ Sms,
48
47
  SmsService,
49
48
  SinchClient,
50
49
  ServicePlanIdCredentials,
51
50
  UnifiedCredentials,
52
- Region,
51
+ SmsRegion,
53
52
  } from '@sinch/sdk-core';
54
53
 
55
54
  const credentialsWithProjectId: UnifiedCredentials = {
56
55
  projectId: 'PROJECT_ID',
57
56
  keyId: 'KEY_ID',
58
57
  keySecret: 'KEY_SECRET',
59
- region: Region.UNITED_STATES, // Optional, default is 'us'. Only other possibility is 'eu'
58
+ smsRegion: SmsRegion.UNITED_STATES, // Optional, default is 'us'. Only other possibility is 'eu'
60
59
  };
61
60
  // Access the 'sms' service registered on the Sinch Client
62
61
  const sinchClientCreatedWithProjectId = new SinchClient(credentialsWithProjectId);
@@ -65,25 +64,25 @@ const smsServiceWithProjectId: SmsService = sinchClientCreatedWithProjectId.sms;
65
64
  const credentialsWithServicePlanId: ServicePlanIdCredentials = {
66
65
  servicePlanId: 'SERVICE_PLAN_ID',
67
66
  apiToken: 'API_TOKEN',
68
- region: Region.UNITED_STATES, // Optional, default is 'us'. Other possibilities are 'eu', 'br', 'au' and 'ca'
67
+ smsRegion: SmsRegion.UNITED_STATES, // Optional, default is 'us'. Other possibilities are 'eu', 'br', 'au' and 'ca'
69
68
  };
70
69
  // Access the 'sms' service registered on the Sinch Client
71
70
  const sinchClientCreatedWithServicePlanId = new SinchClient(credentialsWithServicePlanId);
72
71
  const smsServiceWithServicePlanId: SmsService = sinchClientCreatedWithServicePlanId.sms;
73
72
 
74
73
  // Build the request data
75
- const requestData: SendSMSRequestData = {
74
+ const requestData: Sms.SendSMSRequestData = {
76
75
  sendSMSRequestBody: {
77
76
  to: [
78
77
  '+12223334444',
79
- '+12223335555'
78
+ '+12223335555',
80
79
  ],
81
80
  from: '+12228889999',
82
81
  parameters: {
83
82
  name: {
84
83
  '+12223334444': 'John',
85
84
  default: 'there',
86
- }
85
+ },
87
86
  },
88
87
  body: 'Hi ${name}',
89
88
  type: 'mt_text',
@@ -92,12 +91,12 @@ const requestData: SendSMSRequestData = {
92
91
 
93
92
  // Use the 'sms' service registered on the Sinch client
94
93
  // The request will be authenticated with OAuth2 and sent to https://zt.us.sms.api.sinch.com
95
- const availabilityResult_1: SendSMSResponse
94
+ const availabilityResult_1: Sms.SendSMSResponse
96
95
  = await smsServiceWithProjectId.batches.send(requestData);
97
96
 
98
97
  // Use the 'sms' service registered on the Sinch client
99
98
  // The request will be authenticated with the API Token and sent to https://us.sms.api.sinch.com
100
- const availabilityResult_2: SendSMSResponse
99
+ const availabilityResult_2: Sms.SendSMSResponse
101
100
  = await smsServiceWithServicePlanId.batches.send(requestData);
102
101
  ```
103
102
 
@@ -107,13 +106,12 @@ The SDK can be used standalone if you need to use only the SMS APIs. As for a us
107
106
 
108
107
  ```typescript
109
108
  import {
110
- Region,
109
+ SmsRegion,
111
110
  ServicePlanIdCredentials,
112
111
  UnifiedCredentials,
113
112
  } from '@sinch/sdk-client';
114
113
  import {
115
- SendSMSRequestData,
116
- SendSMSResponse,
114
+ Sms,
117
115
  SmsService,
118
116
  } from '@sinch/sms';
119
117
 
@@ -121,7 +119,7 @@ const credentialsWithProjectId: UnifiedCredentials = {
121
119
  projectId: 'PROJECT_ID',
122
120
  keyId: 'KEY_ID',
123
121
  keySecret: 'KEY_SECRET',
124
- region: Region.UNITED_STATES, // Optional, default is 'us'. Only other possibility is 'eu'
122
+ smsRegion: SmsRegion.UNITED_STATES, // Optional, default is 'us'. Only other possibility is 'eu'
125
123
  };
126
124
  // Declare the 'sms' service in a standalone way
127
125
  const smsServiceWithProjectId = new SmsService(credentialsWithProjectId);
@@ -129,23 +127,23 @@ const smsServiceWithProjectId = new SmsService(credentialsWithProjectId);
129
127
  const credentialsWithServicePlanId: ServicePlanIdCredentials = {
130
128
  servicePlanId: 'SERVICE_PLAN_ID',
131
129
  apiToken: 'API_TOKEN',
132
- region: Region.UNITED_STATES, // Optional, default is 'us'. Other possibilities are 'eu', 'br', 'au' and 'ca'
130
+ smsRegion: SmsRegion.UNITED_STATES, // Optional, default is 'us'. Other possibilities are 'eu', 'br', 'au' and 'ca'
133
131
  };
134
132
  // Declare the 'sms' service in a standalone way
135
133
  const smsServiceWithServicePlanId = new SmsService(credentialsWithServicePlanId);
136
134
 
137
135
  // Build the request data
138
- const requestData: SendSMSRequestData = {
136
+ const requestData: Sms.SendSMSRequestData = {
139
137
  // some request parameters
140
138
  };
141
139
 
142
140
  // Use the standalone declaration of the 'sms' service
143
141
  // 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);
142
+ const response_1: Sms.SendSMSResponse = await smsServiceWithProjectId.batches.send(requestData);
145
143
 
146
144
  // Use the standalone declaration of the 'sms' service
147
145
  // 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);
146
+ const response_2: Sms.SendSMSResponse = await smsServiceWithServicePlanId.batches.send(requestData);
149
147
  ```
150
148
 
151
149
  ## Promises
@@ -154,7 +152,7 @@ All the methods that interact with the Sinch APIs use Promises. You can use `awa
154
152
 
155
153
  ```typescript
156
154
  // Method 1: Wait for the Promise to complete (you need to be in an 'async' method)
157
- let batchResponse: SendSMSResponse;
155
+ let batchResponse: Sms.SendSMSResponse;
158
156
  try {
159
157
  batchResponse = await smsService.batches.send(requestData);
160
158
  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,