@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.
Files changed (88) hide show
  1. package/README.md +44 -38
  2. package/dist/models/v1/api-batch-list/api-batch-list.d.ts +2 -8
  3. package/dist/models/v1/api-batch-list/api-batch-list.js +0 -6
  4. package/dist/models/v1/api-batch-list/api-batch-list.js.map +1 -1
  5. package/dist/models/v1/api-update-binary-mt-message/api-update-binary-mt-message.d.ts +1 -8
  6. package/dist/models/v1/api-update-mms-mt-message/api-update-mms-mt-message.d.ts +1 -8
  7. package/dist/models/v1/api-update-mms-mt-message/api-update-mms-mt-message.js +0 -6
  8. package/dist/models/v1/api-update-mms-mt-message/api-update-mms-mt-message.js.map +1 -1
  9. package/dist/models/v1/api-update-text-mt-message/api-update-text-mt-message.d.ts +1 -8
  10. package/dist/models/v1/api-update-text-mt-message/api-update-text-mt-message.js +0 -6
  11. package/dist/models/v1/api-update-text-mt-message/api-update-text-mt-message.js.map +1 -1
  12. package/dist/models/v1/binary-request/binary-request.d.ts +5 -10
  13. package/dist/models/v1/binary-response/binary-response.d.ts +1 -8
  14. package/dist/models/v1/delivery-report/delivery-report.d.ts +1 -8
  15. package/dist/models/v1/delivery-report/delivery-report.js +0 -6
  16. package/dist/models/v1/delivery-report/delivery-report.js.map +1 -1
  17. package/dist/models/v1/enums.d.ts +0 -13
  18. package/dist/models/v1/index.d.ts +0 -1
  19. package/dist/models/v1/index.js +0 -1
  20. package/dist/models/v1/index.js.map +1 -1
  21. package/dist/models/v1/media-body/media-body.d.ts +0 -6
  22. package/dist/models/v1/media-body/media-body.js +0 -6
  23. package/dist/models/v1/media-body/media-body.js.map +1 -1
  24. package/dist/models/v1/media-request/media-request.d.ts +5 -10
  25. package/dist/models/v1/media-request/media-request.js +0 -6
  26. package/dist/models/v1/media-request/media-request.js.map +1 -1
  27. package/dist/models/v1/media-response/media-response.d.ts +10 -15
  28. package/dist/models/v1/media-response/media-response.js +0 -6
  29. package/dist/models/v1/media-response/media-response.js.map +1 -1
  30. package/dist/models/v1/mo-binary/mo-binary.d.ts +1 -8
  31. package/dist/models/v1/mo-binary/mo-binary.js +0 -6
  32. package/dist/models/v1/mo-binary/mo-binary.js.map +1 -1
  33. package/dist/models/v1/mo-text/mo-text.d.ts +1 -8
  34. package/dist/models/v1/mo-text/mo-text.js +0 -6
  35. package/dist/models/v1/mo-text/mo-text.js.map +1 -1
  36. package/dist/models/v1/recipient-delivery-report/recipient-delivery-report.d.ts +2 -10
  37. package/dist/models/v1/send-sms-request/send-sms-request.d.ts +0 -6
  38. package/dist/models/v1/send-sms-request/send-sms-request.js +0 -6
  39. package/dist/models/v1/send-sms-request/send-sms-request.js.map +1 -1
  40. package/dist/models/v1/send-sms-response/send-sms-response.d.ts +0 -6
  41. package/dist/models/v1/send-sms-response/send-sms-response.js +0 -6
  42. package/dist/models/v1/send-sms-response/send-sms-response.js.map +1 -1
  43. package/dist/models/v1/text-request/text-request.d.ts +5 -10
  44. package/dist/models/v1/text-request/text-request.js +0 -6
  45. package/dist/models/v1/text-request/text-request.js.map +1 -1
  46. package/dist/models/v1/text-response/text-response.d.ts +5 -10
  47. package/dist/models/v1/text-response/text-response.js +0 -6
  48. package/dist/models/v1/text-response/text-response.js.map +1 -1
  49. package/dist/rest/v1/batches/batches-api.d.ts +50 -7
  50. package/dist/rest/v1/batches/batches-api.jest.fixture.d.ts +15 -3
  51. package/dist/rest/v1/batches/batches-api.jest.fixture.js +12 -0
  52. package/dist/rest/v1/batches/batches-api.jest.fixture.js.map +1 -1
  53. package/dist/rest/v1/batches/batches-api.js +48 -5
  54. package/dist/rest/v1/batches/batches-api.js.map +1 -1
  55. package/dist/rest/v1/callbacks/callbacks-webhook.d.ts +15 -3
  56. package/dist/rest/v1/callbacks/callbacks-webhook.js +59 -17
  57. package/dist/rest/v1/callbacks/callbacks-webhook.js.map +1 -1
  58. package/dist/rest/v1/delivery-reports/delivery-reports-api.d.ts +8 -9
  59. package/dist/rest/v1/delivery-reports/delivery-reports-api.jest.fixture.d.ts +4 -4
  60. package/dist/rest/v1/delivery-reports/delivery-reports-api.jest.fixture.js +2 -2
  61. package/dist/rest/v1/delivery-reports/delivery-reports-api.jest.fixture.js.map +1 -1
  62. package/dist/rest/v1/delivery-reports/delivery-reports-api.js +4 -4
  63. package/dist/rest/v1/delivery-reports/delivery-reports-api.js.map +1 -1
  64. package/dist/rest/v1/enums.d.ts +1 -1
  65. package/dist/rest/v1/groups/groups-api.d.ts +2 -2
  66. package/dist/rest/v1/groups/groups-api.js +2 -2
  67. package/dist/rest/v1/groups/groups-api.js.map +1 -1
  68. package/dist/rest/v1/inbounds/inbounds-api.d.ts +2 -2
  69. package/dist/rest/v1/inbounds/inbounds-api.js +2 -2
  70. package/dist/rest/v1/inbounds/inbounds-api.js.map +1 -1
  71. package/dist/rest/v1/index.d.ts +1 -1
  72. package/dist/rest/v1/index.js +1 -1
  73. package/dist/rest/v1/index.js.map +1 -1
  74. package/dist/rest/v1/{sms-api.d.ts → sms-domain-api.d.ts} +1 -1
  75. package/dist/rest/v1/{sms-api.js → sms-domain-api.js} +4 -4
  76. package/dist/rest/v1/sms-domain-api.js.map +1 -0
  77. package/dist/rest/v1/{sms.d.ts → sms-service.d.ts} +1 -7
  78. package/dist/rest/v1/{sms.js → sms-service.js} +4 -4
  79. package/dist/rest/v1/sms-service.js.map +1 -0
  80. package/package.json +2 -2
  81. package/dist/models/v1/api-batch-list-batches-inner/api-batch-list-batches-inner.d.ts +0 -10
  82. package/dist/models/v1/api-batch-list-batches-inner/api-batch-list-batches-inner.js +0 -9
  83. package/dist/models/v1/api-batch-list-batches-inner/api-batch-list-batches-inner.js.map +0 -1
  84. package/dist/models/v1/api-batch-list-batches-inner/index.d.ts +0 -1
  85. package/dist/models/v1/api-batch-list-batches-inner/index.js +0 -3
  86. package/dist/models/v1/api-batch-list-batches-inner/index.js.map +0 -1
  87. package/dist/rest/v1/sms-api.js.map +0 -1
  88. package/dist/rest/v1/sms.js.map +0 -1
@@ -1,13 +1,6 @@
1
- /**
2
- * Model: MOText
3
- *
4
- * THIS FILE HAS BEEN AUTOMATICALLY GENERATED. DO NOT EDIT.
5
- *
6
- */
7
1
  import { ApiMoMessage } from '../api-mo-message';
8
2
  export interface MOText extends ApiMoMessage {
9
3
  body: string;
10
4
  /** Regular SMS */
11
- type: TypeEnum;
5
+ type: 'mo_text';
12
6
  }
13
- export type TypeEnum = 'mo_text';
@@ -1,9 +1,3 @@
1
1
  "use strict";
2
- /**
3
- * Model: MOText
4
- *
5
- * THIS FILE HAS BEEN AUTOMATICALLY GENERATED. DO NOT EDIT.
6
- *
7
- */
8
2
  Object.defineProperty(exports, "__esModule", { value: true });
9
3
  //# sourceMappingURL=mo-text.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"mo-text.js","sourceRoot":"","sources":["../../../../src/models/v1/mo-text/mo-text.ts"],"names":[],"mappings":";AAAA;;;;;GAKG"}
1
+ {"version":3,"file":"mo-text.js","sourceRoot":"","sources":["../../../../src/models/v1/mo-text/mo-text.ts"],"names":[],"mappings":""}
@@ -1,9 +1,3 @@
1
- /**
2
- * Model: RecipientDeliveryReport
3
- *
4
- * THIS FILE HAS BEEN AUTOMATICALLY GENERATED. DO NOT EDIT.
5
- *
6
- */
7
1
  import { DeliveryReportStatusEnum } from '../enums';
8
2
  export interface RecipientDeliveryReport {
9
3
  /** The default originator used for the recipient this delivery report belongs to, if default originator pool configured and no originator set when submitting batch. */
@@ -17,7 +11,7 @@ export interface RecipientDeliveryReport {
17
11
  /** The detailed status code. */
18
12
  code: number;
19
13
  /** Applied encoding for message. Present only if smart encoding is enabled. */
20
- encoding?: EncodingEnum;
14
+ encoding?: 'GSM' | 'UNICODE';
21
15
  /** The number of parts the message was split into. Present only if `max_number_of_message_parts` parameter was set. */
22
16
  number_of_message_parts?: number;
23
17
  /** The operator that was used for delivering the message to this recipient, if enabled on the account by Sinch. */
@@ -29,7 +23,5 @@ export interface RecipientDeliveryReport {
29
23
  /** The simplified status as described in _Delivery Report Statuses_. */
30
24
  status: DeliveryReportStatusEnum;
31
25
  /** The recipient delivery report type. */
32
- type: TypeEnum;
26
+ type: 'recipient_delivery_report_sms' | 'recipient_delivery_report_mms';
33
27
  }
34
- export type EncodingEnum = 'GSM' | 'UNICODE';
35
- export type TypeEnum = 'recipient_delivery_report_sms' | 'recipient_delivery_report_mms';
@@ -1,9 +1,3 @@
1
- /**
2
- * Model: SendSMSRequest
3
- *
4
- * THIS FILE HAS BEEN AUTOMATICALLY GENERATED. DO NOT EDIT.
5
- *
6
- */
7
1
  import { BinaryRequest } from '../binary-request';
8
2
  import { MediaRequest } from '../media-request';
9
3
  import { TextRequest } from '../text-request';
@@ -1,9 +1,3 @@
1
1
  "use strict";
2
- /**
3
- * Model: SendSMSRequest
4
- *
5
- * THIS FILE HAS BEEN AUTOMATICALLY GENERATED. DO NOT EDIT.
6
- *
7
- */
8
2
  Object.defineProperty(exports, "__esModule", { value: true });
9
3
  //# sourceMappingURL=send-sms-request.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"send-sms-request.js","sourceRoot":"","sources":["../../../../src/models/v1/send-sms-request/send-sms-request.ts"],"names":[],"mappings":";AAAA;;;;;GAKG"}
1
+ {"version":3,"file":"send-sms-request.js","sourceRoot":"","sources":["../../../../src/models/v1/send-sms-request/send-sms-request.ts"],"names":[],"mappings":""}
@@ -1,9 +1,3 @@
1
- /**
2
- * Model: SendSMSResponse
3
- *
4
- * THIS FILE HAS BEEN AUTOMATICALLY GENERATED. DO NOT EDIT.
5
- *
6
- */
7
1
  import { BinaryResponse } from '../binary-response';
8
2
  import { MediaResponse } from '../media-response';
9
3
  import { TextResponse } from '../text-response';
@@ -1,9 +1,3 @@
1
1
  "use strict";
2
- /**
3
- * Model: SendSMSResponse
4
- *
5
- * THIS FILE HAS BEEN AUTOMATICALLY GENERATED. DO NOT EDIT.
6
- *
7
- */
8
2
  Object.defineProperty(exports, "__esModule", { value: true });
9
3
  //# sourceMappingURL=send-sms-response.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"send-sms-response.js","sourceRoot":"","sources":["../../../../src/models/v1/send-sms-response/send-sms-response.ts"],"names":[],"mappings":";AAAA;;;;;GAKG"}
1
+ {"version":3,"file":"send-sms-response.js","sourceRoot":"","sources":["../../../../src/models/v1/send-sms-response/send-sms-response.ts"],"names":[],"mappings":""}
@@ -1,9 +1,3 @@
1
- /**
2
- * Model: TextRequest
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 TextRequest {
@@ -16,12 +10,14 @@ export interface TextRequest {
16
10
  /** The message content */
17
11
  body: string;
18
12
  /** Regular SMS */
19
- type?: TypeEnum;
13
+ type?: 'mt_text';
20
14
  /** Request delivery report callback. Note that delivery reports can be fetched from the API regardless of this setting. */
21
15
  delivery_report?: DeliveryReportEnum;
22
- /** If set in the future, the message will be delayed until `send_at` occurs. 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): `YYYY-MM-DDThh:mm:ss.SSSZ`. */
16
+ /** If set in the future, the message will be delayed until `send_at` occurs.
17
+ * 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): `YYYY-MM-DDThh:mm:ss.SSSZ`. */
23
18
  send_at?: Date;
24
- /** If set, the system will stop trying to deliver the message at this point. 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): `YYYY-MM-DDThh:mm:ss.SSSZ`. */
19
+ /** If set, the system will stop trying to deliver the message at this point.
20
+ * 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): `YYYY-MM-DDThh:mm:ss.SSSZ`. */
25
21
  expire_at?: Date;
26
22
  /** 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>. */
27
23
  callback_url?: string;
@@ -40,4 +36,3 @@ export interface TextRequest {
40
36
  /** Number Plan Indicator for the sender number. Use to override the automatic detection. */
41
37
  from_npi?: number;
42
38
  }
43
- export type TypeEnum = 'mt_text' | 'mt_binary' | 'mt_media';
@@ -1,9 +1,3 @@
1
1
  "use strict";
2
- /**
3
- * Model: TextRequest
4
- *
5
- * THIS FILE HAS BEEN AUTOMATICALLY GENERATED. DO NOT EDIT.
6
- *
7
- */
8
2
  Object.defineProperty(exports, "__esModule", { value: true });
9
3
  //# sourceMappingURL=text-request.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"text-request.js","sourceRoot":"","sources":["../../../../src/models/v1/text-request/text-request.ts"],"names":[],"mappings":";AAAA;;;;;GAKG"}
1
+ {"version":3,"file":"text-request.js","sourceRoot":"","sources":["../../../../src/models/v1/text-request/text-request.ts"],"names":[],"mappings":""}
@@ -1,9 +1,3 @@
1
- /**
2
- * Model: TextResponse
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 TextResponse {
@@ -20,16 +14,18 @@ export interface TextResponse {
20
14
  /** The message content */
21
15
  body?: string;
22
16
  /** Regular SMS */
23
- type?: TypeEnum;
17
+ type?: 'mt_text';
24
18
  /** Timestamp for when batch was created. Formatted as [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601):`YYYY-MM-DDThh:mm:ss.SSSZ`. */
25
19
  created_at?: Date;
26
20
  /** Timestamp for when batch was last updated. Formatted as [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601):`YYYY-MM-DDThh:mm:ss.SSSZ`. */
27
21
  modified_at?: Date;
28
22
  /** Request delivery report callback. Note that delivery reports can be fetched from the API regardless of this setting. */
29
23
  delivery_report?: DeliveryReportEnum;
30
- /** If set in the future, the message will be delayed until `send_at` occurs. 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): `YYYY-MM-DDThh:mm:ss.SSSZ`. */
24
+ /** If set in the future, the message will be delayed until `send_at` occurs.
25
+ * 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): `YYYY-MM-DDThh:mm:ss.SSSZ`. */
31
26
  send_at?: Date;
32
- /** If set, the system will stop trying to deliver the message at this point. 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): `YYYY-MM-DDThh:mm:ss.SSSZ`. */
27
+ /** If set, the system will stop trying to deliver the message at this point.
28
+ * 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): `YYYY-MM-DDThh:mm:ss.SSSZ`. */
33
29
  expire_at?: Date;
34
30
  /** Override the default callback URL for this batch. Must be valid URL. */
35
31
  callback_url?: string;
@@ -48,4 +44,3 @@ export interface TextResponse {
48
44
  /** Number Plan Indicator for the sender number. Use to override the automatic detection. */
49
45
  from_npi?: number;
50
46
  }
51
- export type TypeEnum = 'mt_text' | 'mt_binary' | 'mt_media';
@@ -1,9 +1,3 @@
1
1
  "use strict";
2
- /**
3
- * Model: TextResponse
4
- *
5
- * THIS FILE HAS BEEN AUTOMATICALLY GENERATED. DO NOT EDIT.
6
- *
7
- */
8
2
  Object.defineProperty(exports, "__esModule", { value: true });
9
3
  //# sourceMappingURL=text-response.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"text-response.js","sourceRoot":"","sources":["../../../../src/models/v1/text-response/text-response.ts"],"names":[],"mappings":";AAAA;;;;;GAKG"}
1
+ {"version":3,"file":"text-response.js","sourceRoot":"","sources":["../../../../src/models/v1/text-response/text-response.ts"],"names":[],"mappings":""}
@@ -1,6 +1,6 @@
1
- import { ApiBatchListBatchesInner, CancelBatchMessageResponse, DeliveryFeedbackRequest, DryRunResponse, DryRunRequest, ReplaceBatchMessageResponse, ReplaceBatchMessageRequest, SendSMSResponse, SendSMSRequest, UpdateBatchMessageRequest } from '../../../models';
1
+ import { CancelBatchMessageResponse, DeliveryFeedbackRequest, DryRunResponse, DryRunRequest, ReplaceBatchMessageResponse, ReplaceBatchMessageRequest, SendSMSResponse, SendSMSRequest, UpdateBatchMessageRequest, TextRequest, BinaryRequest, MediaRequest, BinaryResponse, TextResponse, MediaResponse } from '../../../models';
2
2
  import { ApiListPromise, SinchClientParameters } from '@sinch/sdk-client';
3
- import { SmsApi } from '../sms-api';
3
+ import { SmsDomainApi } from '../sms-domain-api';
4
4
  export interface CancelBatchMessageRequestData {
5
5
  /** The batch ID you received from sending a message. */
6
6
  'batch_id': string;
@@ -47,13 +47,22 @@ export interface SendSMSRequestData {
47
47
  /** Default schema is Text if type is not specified. */
48
48
  'sendSMSRequestBody'?: SendSMSRequest;
49
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
+ }
50
59
  export interface UpdateBatchMessageRequestData {
51
60
  /** The batch ID you received from sending a message. */
52
61
  'batch_id': string;
53
62
  /** */
54
63
  'updateBatchMessageRequestBody'?: UpdateBatchMessageRequest;
55
64
  }
56
- export declare class BatchesApi extends SmsApi {
65
+ export declare class BatchesApi extends SmsDomainApi {
57
66
  /**
58
67
  * Initialize your interface
59
68
  *
@@ -90,9 +99,9 @@ export declare class BatchesApi extends SmsApi {
90
99
  * List Batches
91
100
  * With the list operation you can list batch messages created in the last 14 days that you have created. This operation supports pagination.
92
101
  * @param { ListBatchesRequestData } data - The data to provide to the API call.
93
- * @return {ApiListPromise<ApiBatchListBatchesInner>}
102
+ * @return {ApiListPromise<SendSMSResponse>}
94
103
  */
95
- list(data: ListBatchesRequestData): ApiListPromise<ApiBatchListBatchesInner>;
104
+ list(data: ListBatchesRequestData): ApiListPromise<SendSMSResponse>;
96
105
  /**
97
106
  * Replace a batch
98
107
  * This operation will replace all the parameters of a batch with the provided values. It is the same as cancelling a batch and sending a new one instead.
@@ -100,11 +109,45 @@ export declare class BatchesApi extends SmsApi {
100
109
  */
101
110
  replace(data: ReplaceBatchMessageRequestData): Promise<ReplaceBatchMessageResponse>;
102
111
  /**
103
- * Send
104
- * Send a message or a batch of messages. Depending on the length of the body, one message might be split into multiple parts and charged accordingly. Any groups targeted in a scheduled batch will be evaluated at the time of sending. If a group is deleted between batch creation and scheduled date, it will be considered empty. Be sure to use the correct &lt;a href&#x3D;\&quot;/docs/sms/api-reference/#base-url\&quot; target&#x3D;\&quot;_blank\&quot;&gt;region&lt;/a&gt; in the server URL.
112
+ * Send Text Message
113
+ * Send a text message or a batch of text messages.
114
+ * Depending on the length of the body, one message might be split into multiple parts and charged accordingly.
115
+ * Any groups targeted in a scheduled batch will be evaluated at the time of sending.
116
+ * If a group is deleted between batch creation and scheduled date, it will be considered empty.
117
+ * Be sure to use the correct region in the server URL.
105
118
  * @param { SendSMSRequestData } data - The data to provide to the API call.
106
119
  */
107
120
  send(data: SendSMSRequestData): Promise<SendSMSResponse>;
121
+ /**
122
+ * Send Text Message
123
+ * Send a text message or a batch of text messages.
124
+ * Depending on the length of the body, one message might be split into multiple parts and charged accordingly.
125
+ * Any groups targeted in a scheduled batch will be evaluated at the time of sending.
126
+ * If a group is deleted between batch creation and scheduled date, it will be considered empty.
127
+ * Be sure to use the correct region in the server URL.
128
+ * @param { SendTextSMSRequestData } data - The data to provide to the API call.
129
+ */
130
+ sendTextMessage(data: SendTextSMSRequestData): Promise<TextResponse>;
131
+ /**
132
+ * Send Binary Message
133
+ * Send a binary message or a batch of binary messages.
134
+ * Depending on the length of the body, one message might be split into multiple parts and charged accordingly.
135
+ * Any groups targeted in a scheduled batch will be evaluated at the time of sending.
136
+ * If a group is deleted between batch creation and scheduled date, it will be considered empty.
137
+ * Be sure to use the correct region in the server URL.
138
+ * @param { SendBinarySMSRequestData } data - The data to provide to the API call.
139
+ */
140
+ sendBinaryMessage(data: SendBinarySMSRequestData): Promise<BinaryResponse>;
141
+ /**
142
+ * Send Media Message
143
+ * Send a media message or a batch of media messages.
144
+ * Depending on the length of the body, one message might be split into multiple parts and charged accordingly.
145
+ * Any groups targeted in a scheduled batch will be evaluated at the time of sending.
146
+ * If a group is deleted between batch creation and scheduled date, it will be considered empty.
147
+ * Be sure to use the correct region in the server URL.
148
+ * @param { SendMediaSMSRequestData } data - The data to provide to the API call.
149
+ */
150
+ sendMediaMessage(data: SendMediaSMSRequestData): Promise<MediaResponse>;
108
151
  /**
109
152
  * Update a Batch message
110
153
  * This operation updates all specified parameters of a batch that matches the provided batch ID.
@@ -1,6 +1,6 @@
1
1
  /// <reference types="jest" />
2
- import { BatchesApi, CancelBatchMessageRequestData, DeliveryFeedbackRequestData, DryRunRequestData, GetBatchMessageRequestData, ListBatchesRequestData, ReplaceBatchMessageRequestData, SendSMSRequestData, UpdateBatchMessageRequestData } from './batches-api';
3
- import { ApiBatchListBatchesInner, DryRunResponse, SendSMSResponse } from '../../../models';
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';
4
4
  import { ApiListPromise } from '@sinch/sdk-client';
5
5
  export declare class BatchesApiFixture implements Partial<Readonly<BatchesApi>> {
6
6
  /**
@@ -22,7 +22,7 @@ export declare class BatchesApiFixture implements Partial<Readonly<BatchesApi>>
22
22
  /**
23
23
  * Fixture associated to function list
24
24
  */
25
- list: jest.Mock<ApiListPromise<ApiBatchListBatchesInner>, [ListBatchesRequestData]>;
25
+ list: jest.Mock<ApiListPromise<SendSMSResponse>, [ListBatchesRequestData]>;
26
26
  /**
27
27
  * Fixture associated to function replace
28
28
  */
@@ -31,6 +31,18 @@ export declare class BatchesApiFixture implements Partial<Readonly<BatchesApi>>
31
31
  * Fixture associated to function send
32
32
  */
33
33
  send: jest.Mock<Promise<SendSMSResponse>, [SendSMSRequestData]>;
34
+ /**
35
+ * Fixture associated to function sendTextMessage
36
+ */
37
+ sendTextMessage: jest.Mock<Promise<TextResponse>, [SendTextSMSRequestData]>;
38
+ /**
39
+ * Fixture associated to function send
40
+ */
41
+ sendBinaryMessage: jest.Mock<Promise<BinaryResponse>, [SendBinarySMSRequestData]>;
42
+ /**
43
+ * Fixture associated to function send
44
+ */
45
+ sendMediaMessage: jest.Mock<Promise<MediaResponse>, [SendMediaSMSRequestData]>;
34
46
  /**
35
47
  * Fixture associated to function update
36
48
  */
@@ -31,6 +31,18 @@ class BatchesApiFixture {
31
31
  * Fixture associated to function send
32
32
  */
33
33
  this.send = jest.fn();
34
+ /**
35
+ * Fixture associated to function sendTextMessage
36
+ */
37
+ this.sendTextMessage = jest.fn();
38
+ /**
39
+ * Fixture associated to function send
40
+ */
41
+ this.sendBinaryMessage = jest.fn();
42
+ /**
43
+ * Fixture associated to function send
44
+ */
45
+ this.sendMediaMessage = jest.fn();
34
46
  /**
35
47
  * Fixture associated to function update
36
48
  */
@@ -1 +1 @@
1
- {"version":3,"file":"batches-api.jest.fixture.js","sourceRoot":"","sources":["../../../../src/rest/v1/batches/batches-api.jest.fixture.ts"],"names":[],"mappings":";;;AAIA,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,GAAkF,IAAI,CAAC,EAAE,EAAE,CAAC;QACvG;;YAEI;QACG,YAAO,GAA0E,IAAI,CAAC,EAAE,EAAE,CAAC;QAClG;;YAEI;QACG,SAAI,GAA8D,IAAI,CAAC,EAAE,EAAE,CAAC;QACnF;;YAEI;QACG,WAAM,GAAyE,IAAI,CAAC,EAAE,EAAE,CAAC;IAClG,CAAC;CAAA;AAlCD,8CAkCC"}
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"}
@@ -2,8 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.BatchesApi = void 0;
4
4
  const sdk_client_1 = require("@sinch/sdk-client");
5
- const sms_api_1 = require("../sms-api");
6
- class BatchesApi extends sms_api_1.SmsApi {
5
+ const sms_domain_api_1 = require("../sms-domain-api");
6
+ class BatchesApi extends sms_domain_api_1.SmsDomainApi {
7
7
  /**
8
8
  * Initialize your interface
9
9
  *
@@ -114,7 +114,7 @@ class BatchesApi extends sms_api_1.SmsApi {
114
114
  * List Batches
115
115
  * With the list operation you can list batch messages created in the last 14 days that you have created. This operation supports pagination.
116
116
  * @param { ListBatchesRequestData } data - The data to provide to the API call.
117
- * @return {ApiListPromise<ApiBatchListBatchesInner>}
117
+ * @return {ApiListPromise<SendSMSResponse>}
118
118
  */
119
119
  list(data) {
120
120
  this.client = this.getSinchClient();
@@ -163,8 +163,12 @@ class BatchesApi extends sms_api_1.SmsApi {
163
163
  });
164
164
  }
165
165
  /**
166
- * Send
167
- * Send a message or a batch of messages. Depending on the length of the body, one message might be split into multiple parts and charged accordingly. Any groups targeted in a scheduled batch will be evaluated at the time of sending. If a group is deleted between batch creation and scheduled date, it will be considered empty. Be sure to use the correct &lt;a href&#x3D;\&quot;/docs/sms/api-reference/#base-url\&quot; target&#x3D;\&quot;_blank\&quot;&gt;region&lt;/a&gt; in the server URL.
166
+ * Send Text Message
167
+ * Send a text message or a batch of text messages.
168
+ * Depending on the length of the body, one message might be split into multiple parts and charged accordingly.
169
+ * Any groups targeted in a scheduled batch will be evaluated at the time of sending.
170
+ * If a group is deleted between batch creation and scheduled date, it will be considered empty.
171
+ * Be sure to use the correct region in the server URL.
168
172
  * @param { SendSMSRequestData } data - The data to provide to the API call.
169
173
  */
170
174
  async send(data) {
@@ -185,6 +189,45 @@ class BatchesApi extends sms_api_1.SmsApi {
185
189
  operationId: 'SendSMS',
186
190
  });
187
191
  }
192
+ /**
193
+ * Send Text Message
194
+ * Send a text message or a batch of text messages.
195
+ * Depending on the length of the body, one message might be split into multiple parts and charged accordingly.
196
+ * Any groups targeted in a scheduled batch will be evaluated at the time of sending.
197
+ * If a group is deleted between batch creation and scheduled date, it will be considered empty.
198
+ * Be sure to use the correct region in the server URL.
199
+ * @param { SendTextSMSRequestData } data - The data to provide to the API call.
200
+ */
201
+ async sendTextMessage(data) {
202
+ const response = await this.send(data);
203
+ return response;
204
+ }
205
+ /**
206
+ * Send Binary Message
207
+ * Send a binary message or a batch of binary messages.
208
+ * Depending on the length of the body, one message might be split into multiple parts and charged accordingly.
209
+ * Any groups targeted in a scheduled batch will be evaluated at the time of sending.
210
+ * If a group is deleted between batch creation and scheduled date, it will be considered empty.
211
+ * Be sure to use the correct region in the server URL.
212
+ * @param { SendBinarySMSRequestData } data - The data to provide to the API call.
213
+ */
214
+ async sendBinaryMessage(data) {
215
+ const response = await this.send(data);
216
+ return response;
217
+ }
218
+ /**
219
+ * Send Media Message
220
+ * Send a media message or a batch of media messages.
221
+ * Depending on the length of the body, one message might be split into multiple parts and charged accordingly.
222
+ * Any groups targeted in a scheduled batch will be evaluated at the time of sending.
223
+ * If a group is deleted between batch creation and scheduled date, it will be considered empty.
224
+ * Be sure to use the correct region in the server URL.
225
+ * @param { SendMediaSMSRequestData } data - The data to provide to the API call.
226
+ */
227
+ async sendMediaMessage(data) {
228
+ const response = await this.send(data);
229
+ return response;
230
+ }
188
231
  /**
189
232
  * Update a Batch message
190
233
  * This operation updates all specified parameters of a batch that matches the provided batch ID.
@@ -1 +1 @@
1
- {"version":3,"file":"batches-api.js","sourceRoot":"","sources":["../../../../src/rest/v1/batches/batches-api.ts"],"names":[],"mappings":";;;AAYA,kDAQ2B;AAC3B,wCAAoC;AAuDpC,MAAa,UAAW,SAAQ,gBAAM;IAEpC;;;;OAIG;IACH,YAAY,qBAA4C;QACtD,KAAK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C;QACzG,MAAM,WAAW,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,QAAQ,WAAW,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,SAAS,YAAY,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC;QAE5I,MAAM,cAAc,GAChB,MAAM,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,IAAI,SAAS,CAAC,CAAC;QACjG,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,cAAc,CAAC,QAAQ,EAAE,cAAc,CAAC,WAAW,CAAC,CAAC;QAExF,OAAO,IAAI,CAAC,MAAM,CAAC,WAAW,CAAkB;YAC9C,GAAG;YACH,cAAc;YACd,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,WAAW,EAAE,oBAAoB;SAClC,CAAC,CAAC;IACL,CAAC;CAEF;AArTD,gCAqTC"}
@@ -1,3 +1,15 @@
1
- import { DeliveryReport, MOBinary, MOText } from '../../../models';
2
- export type SmsCallback = DeliveryReport | MOText | MOBinary;
3
- export declare const parseSmsEventNotification: (eventBody: any) => SmsCallback;
1
+ /// <reference types="node" />
2
+ import { DeliveryReport, MOBinary, MOText, RecipientDeliveryReport } from '../../../models';
3
+ import { CallbackProcessor } from '@sinch/sdk-client';
4
+ import { IncomingHttpHeaders } from 'http';
5
+ export type SmsCallback = DeliveryReport | RecipientDeliveryReport | MOText | MOBinary;
6
+ export declare class SmsCallbackWebhooks implements CallbackProcessor<SmsCallback> {
7
+ validateAuthenticationHeader(_headers: IncomingHttpHeaders, _body: any, _path: string, _method: string): boolean;
8
+ /**
9
+ * Reviver for an SMS Event.
10
+ * This method ensures the object can be treated as an SMS Event and should be called before any action is taken to manipulate the object.
11
+ * @param {any} eventBody - The event body containing the SMS event notification.
12
+ * @return {SmsCallback} - The parsed SMS event object
13
+ */
14
+ parseEvent(eventBody: any): SmsCallback;
15
+ }
@@ -1,22 +1,64 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.parseSmsEventNotification = void 0;
4
- const parseSmsEventNotification = (eventBody) => {
5
- if (eventBody.type) {
6
- switch (eventBody.type) {
7
- case 'delivery_report_sms':
8
- case 'delivery_report_mms':
9
- return eventBody;
10
- case 'mo_text':
11
- return eventBody;
12
- case 'mo_binary':
13
- return eventBody;
14
- default:
15
- throw new Error(`Unknown SMS event type: ${eventBody.type}`);
3
+ exports.SmsCallbackWebhooks = void 0;
4
+ class SmsCallbackWebhooks {
5
+ validateAuthenticationHeader(
6
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
7
+ _headers, _body, _path, _method) {
8
+ // No header validation is implemented for SMS API
9
+ return true;
10
+ }
11
+ /**
12
+ * Reviver for an SMS Event.
13
+ * This method ensures the object can be treated as an SMS Event and should be called before any action is taken to manipulate the object.
14
+ * @param {any} eventBody - The event body containing the SMS event notification.
15
+ * @return {SmsCallback} - The parsed SMS event object
16
+ */
17
+ parseEvent(eventBody) {
18
+ if (eventBody.type) {
19
+ let recipientDeliveryReport = null;
20
+ let moText = null;
21
+ let moBinary = null;
22
+ switch (eventBody.type) {
23
+ case 'delivery_report_sms':
24
+ case 'delivery_report_mms':
25
+ return eventBody;
26
+ case 'recipient_delivery_report_sms':
27
+ case 'recipient_delivery_report_mms':
28
+ recipientDeliveryReport = eventBody;
29
+ if (recipientDeliveryReport.at) {
30
+ recipientDeliveryReport.at = new Date(recipientDeliveryReport.at);
31
+ }
32
+ if (recipientDeliveryReport.operator_status_at) {
33
+ recipientDeliveryReport.operator_status_at = new Date(recipientDeliveryReport.operator_status_at);
34
+ }
35
+ return recipientDeliveryReport;
36
+ case 'mo_text':
37
+ moText = eventBody;
38
+ if (moText.received_at) {
39
+ moText.received_at = new Date(moText.received_at);
40
+ }
41
+ if (moText.sent_at) {
42
+ moText.sent_at = new Date(moText.sent_at);
43
+ }
44
+ return moText;
45
+ case 'mo_binary':
46
+ moBinary = eventBody;
47
+ if (moBinary.received_at) {
48
+ moBinary.received_at = new Date(moBinary.received_at);
49
+ }
50
+ if (moBinary.sent_at) {
51
+ moBinary.sent_at = new Date(moBinary.sent_at);
52
+ }
53
+ return moBinary;
54
+ default:
55
+ throw new Error(`Unknown SMS event type: ${eventBody.type}`);
56
+ }
16
57
  }
58
+ console.log(eventBody);
59
+ throw new Error('Unknown SMS event');
17
60
  }
18
- console.log(eventBody);
19
- throw new Error('Unknown SMS event');
20
- };
21
- exports.parseSmsEventNotification = parseSmsEventNotification;
61
+ ;
62
+ }
63
+ exports.SmsCallbackWebhooks = SmsCallbackWebhooks;
22
64
  //# sourceMappingURL=callbacks-webhook.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"callbacks-webhook.js","sourceRoot":"","sources":["../../../../src/rest/v1/callbacks/callbacks-webhook.ts"],"names":[],"mappings":";;;AAIO,MAAM,yBAAyB,GAAG,CAAC,SAAc,EAAe,EAAE;IACvE,IAAI,SAAS,CAAC,IAAI,EAAE,CAAC;QACnB,QAAQ,SAAS,CAAC,IAAI,EAAE,CAAC;YACzB,KAAK,qBAAqB,CAAC;YAC3B,KAAK,qBAAqB;gBACxB,OAAO,SAA2B,CAAC;YACrC,KAAK,SAAS;gBACZ,OAAO,SAAmB,CAAC;YAC7B,KAAK,WAAW;gBACd,OAAO,SAAqB,CAAC;YAC/B;gBACE,MAAM,IAAI,KAAK,CAAC,2BAA2B,SAAS,CAAC,IAAI,EAAE,CAAC,CAAC;QAC/D,CAAC;IACH,CAAC;IACD,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IACvB,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC;AACvC,CAAC,CAAC;AAhBW,QAAA,yBAAyB,6BAgBpC"}
1
+ {"version":3,"file":"callbacks-webhook.js","sourceRoot":"","sources":["../../../../src/rest/v1/callbacks/callbacks-webhook.ts"],"names":[],"mappings":";;;AAMA,MAAa,mBAAm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