@sinch/conversation 1.3.0 → 1.4.1

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 (232) hide show
  1. package/dist/models/v1/audit-record/audit-record.d.ts +18 -0
  2. package/dist/models/v1/audit-record/audit-record.js +3 -0
  3. package/dist/models/v1/audit-record/audit-record.js.map +1 -0
  4. package/dist/models/v1/audit-record/index.d.ts +1 -0
  5. package/dist/models/v1/audit-record/index.js +3 -0
  6. package/dist/models/v1/audit-record/index.js.map +1 -0
  7. package/dist/models/v1/audit-records-list/audit-records-list.d.ts +8 -0
  8. package/dist/models/v1/audit-records-list/audit-records-list.js +3 -0
  9. package/dist/models/v1/audit-records-list/audit-records-list.js.map +1 -0
  10. package/dist/models/v1/audit-records-list/index.d.ts +1 -0
  11. package/dist/models/v1/audit-records-list/index.js +3 -0
  12. package/dist/models/v1/audit-records-list/index.js.map +1 -0
  13. package/dist/models/v1/calendar-message/calendar-message.d.ts +14 -0
  14. package/dist/models/v1/calendar-message/calendar-message.js +3 -0
  15. package/dist/models/v1/calendar-message/calendar-message.js.map +1 -0
  16. package/dist/models/v1/calendar-message/index.d.ts +1 -0
  17. package/dist/models/v1/calendar-message/index.js +3 -0
  18. package/dist/models/v1/calendar-message/index.js.map +1 -0
  19. package/dist/models/v1/card-message/card-message.d.ts +7 -1
  20. package/dist/models/v1/card-message/index.d.ts +1 -1
  21. package/dist/models/v1/channel-identity/channel-identity.d.ts +1 -1
  22. package/dist/models/v1/channel-specific-message/channel-specific-message.d.ts +22 -1
  23. package/dist/models/v1/channel-specific-message/index.d.ts +1 -1
  24. package/dist/models/v1/choice/choice.d.ts +47 -1
  25. package/dist/models/v1/choice-item/choice-item.d.ts +1 -1
  26. package/dist/models/v1/choice-message/choice-message.d.ts +2 -2
  27. package/dist/models/v1/client-credentials/client-credentials.d.ts +6 -0
  28. package/dist/models/v1/consent-identity/consent-identity.d.ts +7 -0
  29. package/dist/models/v1/consent-identity/consent-identity.js +3 -0
  30. package/dist/models/v1/consent-identity/consent-identity.js.map +1 -0
  31. package/dist/models/v1/consent-identity/index.d.ts +1 -0
  32. package/dist/models/v1/consent-identity/index.js +3 -0
  33. package/dist/models/v1/consent-identity/index.js.map +1 -0
  34. package/dist/models/v1/contact-settings/contact-settings.d.ts +7 -0
  35. package/dist/models/v1/contact-settings/contact-settings.js +3 -0
  36. package/dist/models/v1/contact-settings/contact-settings.js.map +1 -0
  37. package/dist/models/v1/contact-settings/index.d.ts +1 -0
  38. package/dist/models/v1/contact-settings/index.js +3 -0
  39. package/dist/models/v1/contact-settings/index.js.map +1 -0
  40. package/dist/models/v1/conversation-channel/conversation-channel.d.ts +2 -2
  41. package/dist/models/v1/conversation-channel-credential/conversation-channel-credential.d.ts +3 -2
  42. package/dist/models/v1/conversation-message/conversation-message.d.ts +1 -1
  43. package/dist/models/v1/enums.d.ts +7 -1
  44. package/dist/models/v1/identity-conflict/identity-conflict.d.ts +8 -0
  45. package/dist/models/v1/identity-conflict/identity-conflict.js +3 -0
  46. package/dist/models/v1/identity-conflict/identity-conflict.js.map +1 -0
  47. package/dist/models/v1/identity-conflict/index.d.ts +1 -0
  48. package/dist/models/v1/identity-conflict/index.js +3 -0
  49. package/dist/models/v1/identity-conflict/index.js.map +1 -0
  50. package/dist/models/v1/index.d.ts +25 -3
  51. package/dist/models/v1/index.js +25 -3
  52. package/dist/models/v1/index.js.map +1 -1
  53. package/dist/models/v1/inject-message-request/inject-message-request.d.ts +1 -1
  54. package/dist/models/v1/kakaotalk-button/index.d.ts +1 -0
  55. package/dist/models/v1/kakaotalk-button/index.js +3 -0
  56. package/dist/models/v1/kakaotalk-button/index.js.map +1 -0
  57. package/dist/models/v1/kakaotalk-button/kakaotalk-button.d.ts +27 -0
  58. package/dist/models/v1/kakaotalk-button/kakaotalk-button.js +3 -0
  59. package/dist/models/v1/kakaotalk-button/kakaotalk-button.js.map +1 -0
  60. package/dist/models/v1/kakaotalk-carousel/index.d.ts +1 -0
  61. package/dist/models/v1/kakaotalk-carousel/index.js +3 -0
  62. package/dist/models/v1/kakaotalk-carousel/index.js.map +1 -0
  63. package/dist/models/v1/kakaotalk-carousel/kakaotalk-carousel.d.ts +38 -0
  64. package/dist/models/v1/kakaotalk-carousel/kakaotalk-carousel.js +3 -0
  65. package/dist/models/v1/kakaotalk-carousel/kakaotalk-carousel.js.map +1 -0
  66. package/dist/models/v1/kakaotalk-carousel-commerce/index.d.ts +1 -0
  67. package/dist/models/v1/kakaotalk-carousel-commerce/index.js +3 -0
  68. package/dist/models/v1/kakaotalk-carousel-commerce/index.js.map +1 -0
  69. package/dist/models/v1/kakaotalk-carousel-commerce/kakaotalk-carousel-commerce.d.ts +12 -0
  70. package/dist/models/v1/kakaotalk-carousel-commerce/kakaotalk-carousel-commerce.js +3 -0
  71. package/dist/models/v1/kakaotalk-carousel-commerce/kakaotalk-carousel-commerce.js.map +1 -0
  72. package/dist/models/v1/kakaotalk-commerce/index.d.ts +1 -0
  73. package/dist/models/v1/kakaotalk-commerce/index.js +3 -0
  74. package/dist/models/v1/kakaotalk-commerce/index.js.map +1 -0
  75. package/dist/models/v1/kakaotalk-commerce/kakaotalk-commerce.d.ts +7 -0
  76. package/dist/models/v1/kakaotalk-commerce/kakaotalk-commerce.js +3 -0
  77. package/dist/models/v1/kakaotalk-commerce/kakaotalk-commerce.js.map +1 -0
  78. package/dist/models/v1/kakaotalk-coupon/index.d.ts +1 -0
  79. package/dist/models/v1/kakaotalk-coupon/index.js +3 -0
  80. package/dist/models/v1/kakaotalk-coupon/index.js.map +1 -0
  81. package/dist/models/v1/kakaotalk-coupon/kakaotalk-coupon.d.ts +79 -0
  82. package/dist/models/v1/kakaotalk-coupon/kakaotalk-coupon.js +3 -0
  83. package/dist/models/v1/kakaotalk-coupon/kakaotalk-coupon.js.map +1 -0
  84. package/dist/models/v1/kakaotalk-image/index.d.ts +1 -0
  85. package/dist/models/v1/kakaotalk-image/index.js +3 -0
  86. package/dist/models/v1/kakaotalk-image/index.js.map +1 -0
  87. package/dist/models/v1/kakaotalk-image/kakaotalk-image.d.ts +6 -0
  88. package/dist/models/v1/kakaotalk-image/kakaotalk-image.js +3 -0
  89. package/dist/models/v1/kakaotalk-image/kakaotalk-image.js.map +1 -0
  90. package/dist/models/v1/kakaotalk-message/index.d.ts +1 -0
  91. package/dist/models/v1/kakaotalk-message/index.js +3 -0
  92. package/dist/models/v1/kakaotalk-message/index.js.map +1 -0
  93. package/dist/models/v1/kakaotalk-message/kakaotalk-message.d.ts +16 -0
  94. package/dist/models/v1/kakaotalk-message/kakaotalk-message.js +3 -0
  95. package/dist/models/v1/kakaotalk-message/kakaotalk-message.js.map +1 -0
  96. package/dist/models/v1/kakaotalk-pricing/index.d.ts +1 -0
  97. package/dist/models/v1/kakaotalk-pricing/index.js +3 -0
  98. package/dist/models/v1/kakaotalk-pricing/index.js.map +1 -0
  99. package/dist/models/v1/kakaotalk-pricing/kakao-talk-pricing.d.ts +33 -0
  100. package/dist/models/v1/kakaotalk-pricing/kakao-talk-pricing.js +3 -0
  101. package/dist/models/v1/kakaotalk-pricing/kakao-talk-pricing.js.map +1 -0
  102. package/dist/models/v1/line-notification-template/index.d.ts +1 -0
  103. package/dist/models/v1/line-notification-template/index.js +3 -0
  104. package/dist/models/v1/line-notification-template/index.js.map +1 -0
  105. package/dist/models/v1/line-notification-template/line-notification-template.d.ts +10 -0
  106. package/dist/models/v1/line-notification-template/line-notification-template.js +3 -0
  107. package/dist/models/v1/line-notification-template/line-notification-template.js.map +1 -0
  108. package/dist/models/v1/line-notification-template-body/index.d.ts +1 -0
  109. package/dist/models/v1/line-notification-template-body/index.js +3 -0
  110. package/dist/models/v1/line-notification-template-body/index.js.map +1 -0
  111. package/dist/models/v1/line-notification-template-body/line-notification-template-body.d.ts +13 -0
  112. package/dist/models/v1/line-notification-template-body/line-notification-template-body.js +3 -0
  113. package/dist/models/v1/line-notification-template-body/line-notification-template-body.js.map +1 -0
  114. package/dist/models/v1/line-notification-template-button/index.d.ts +1 -0
  115. package/dist/models/v1/line-notification-template-button/index.js +3 -0
  116. package/dist/models/v1/line-notification-template-button/index.js.map +1 -0
  117. package/dist/models/v1/line-notification-template-button/line-notification-template-button.d.ts +9 -0
  118. package/dist/models/v1/line-notification-template-button/line-notification-template-button.js +3 -0
  119. package/dist/models/v1/line-notification-template-button/line-notification-template-button.js.map +1 -0
  120. package/dist/models/v1/line-notification-template-item/index.d.ts +1 -0
  121. package/dist/models/v1/line-notification-template-item/index.js +3 -0
  122. package/dist/models/v1/line-notification-template-item/index.js.map +1 -0
  123. package/dist/models/v1/line-notification-template-item/line-notification-template-item.d.ts +9 -0
  124. package/dist/models/v1/line-notification-template-item/line-notification-template-item.js +3 -0
  125. package/dist/models/v1/line-notification-template-item/line-notification-template-item.js.map +1 -0
  126. package/dist/models/v1/list-last-messages-by-channel-identity-request/index.d.ts +1 -0
  127. package/dist/models/v1/list-last-messages-by-channel-identity-request/index.js +3 -0
  128. package/dist/models/v1/list-last-messages-by-channel-identity-request/index.js.map +1 -0
  129. package/dist/models/v1/list-last-messages-by-channel-identity-request/list-last-messages-by-channel-identity-request.d.ts +29 -0
  130. package/dist/models/v1/list-last-messages-by-channel-identity-request/list-last-messages-by-channel-identity-request.js +3 -0
  131. package/dist/models/v1/list-last-messages-by-channel-identity-request/list-last-messages-by-channel-identity-request.js.map +1 -0
  132. package/dist/models/v1/mod-callback-events/conversation-callback-event/conversation-callback-event.d.ts +2 -2
  133. package/dist/models/v1/project-settings/index.d.ts +1 -0
  134. package/dist/models/v1/project-settings/index.js +3 -0
  135. package/dist/models/v1/project-settings/index.js.map +1 -0
  136. package/dist/models/v1/project-settings/project-settings.d.ts +10 -0
  137. package/dist/models/v1/project-settings/project-settings.js +3 -0
  138. package/dist/models/v1/project-settings/project-settings.js.map +1 -0
  139. package/dist/models/v1/project-settings-request/index.d.ts +1 -0
  140. package/dist/models/v1/project-settings-request/index.js +3 -0
  141. package/dist/models/v1/project-settings-request/index.js.map +1 -0
  142. package/dist/models/v1/project-settings-request/project-settings-request.d.ts +10 -0
  143. package/dist/models/v1/project-settings-request/project-settings-request.js +3 -0
  144. package/dist/models/v1/project-settings-request/project-settings-request.js.map +1 -0
  145. package/dist/models/v1/requests/consents/consents-request-data.d.ts +17 -0
  146. package/dist/models/v1/requests/consents/consents-request-data.js +3 -0
  147. package/dist/models/v1/requests/consents/consents-request-data.js.map +1 -0
  148. package/dist/models/v1/requests/contact/contact-request-data.d.ts +6 -0
  149. package/dist/models/v1/requests/index.d.ts +2 -0
  150. package/dist/models/v1/requests/index.js +2 -0
  151. package/dist/models/v1/requests/index.js.map +1 -1
  152. package/dist/models/v1/requests/messages/messages-request-data.d.ts +8 -1
  153. package/dist/models/v1/requests/project-settings/project-settings-request-data.d.ts +13 -0
  154. package/dist/models/v1/requests/project-settings/project-settings-request-data.js +3 -0
  155. package/dist/models/v1/requests/project-settings/project-settings-request-data.js.map +1 -0
  156. package/dist/models/v1/send-message-request/send-message-request.d.ts +2 -2
  157. package/dist/models/v1/share-location-message/index.d.ts +1 -0
  158. package/dist/models/v1/share-location-message/index.js +3 -0
  159. package/dist/models/v1/share-location-message/index.js.map +1 -0
  160. package/dist/models/v1/share-location-message/share-location-message.d.ts +6 -0
  161. package/dist/models/v1/share-location-message/share-location-message.js +3 -0
  162. package/dist/models/v1/share-location-message/share-location-message.js.map +1 -0
  163. package/dist/models/v1/smart-conversation/smart-conversation.d.ts +1 -1
  164. package/dist/models/v1/whatsapp-payment-order-details/index.d.ts +1 -1
  165. package/dist/models/v1/whatsapp-payment-order-details/whatsapp-payment-order-details.d.ts +25 -6
  166. package/dist/rest/v1/app/app-api.d.ts +3 -8
  167. package/dist/rest/v1/app/app-api.js +3 -13
  168. package/dist/rest/v1/app/app-api.js.map +1 -1
  169. package/dist/rest/v1/callbacks/callbacks-webhook.d.ts +7 -0
  170. package/dist/rest/v1/callbacks/callbacks-webhook.js +10 -0
  171. package/dist/rest/v1/callbacks/callbacks-webhook.js.map +1 -1
  172. package/dist/rest/v1/capability/capability-api.d.ts +2 -7
  173. package/dist/rest/v1/capability/capability-api.js +2 -8
  174. package/dist/rest/v1/capability/capability-api.js.map +1 -1
  175. package/dist/rest/v1/consents/consents-api.d.ts +20 -0
  176. package/dist/rest/v1/consents/consents-api.jest.fixture.d.ts +13 -0
  177. package/dist/rest/v1/consents/consents-api.jest.fixture.js +17 -0
  178. package/dist/rest/v1/consents/consents-api.jest.fixture.js.map +1 -0
  179. package/dist/rest/v1/consents/consents-api.js +61 -0
  180. package/dist/rest/v1/consents/consents-api.js.map +1 -0
  181. package/dist/rest/v1/consents/index.d.ts +2 -0
  182. package/dist/rest/v1/consents/index.js +19 -0
  183. package/dist/rest/v1/consents/index.js.map +1 -0
  184. package/dist/rest/v1/contact/contact-api.d.ts +12 -9
  185. package/dist/rest/v1/contact/contact-api.jest.fixture.d.ts +5 -1
  186. package/dist/rest/v1/contact/contact-api.jest.fixture.js +4 -0
  187. package/dist/rest/v1/contact/contact-api.jest.fixture.js.map +1 -1
  188. package/dist/rest/v1/contact/contact-api.js +30 -15
  189. package/dist/rest/v1/contact/contact-api.js.map +1 -1
  190. package/dist/rest/v1/conversation/conversation-api.d.ts +4 -8
  191. package/dist/rest/v1/conversation/conversation-api.js +3 -17
  192. package/dist/rest/v1/conversation/conversation-api.js.map +1 -1
  193. package/dist/rest/v1/conversation-domain-api.d.ts +12 -14
  194. package/dist/rest/v1/conversation-domain-api.js +25 -69
  195. package/dist/rest/v1/conversation-domain-api.js.map +1 -1
  196. package/dist/rest/v1/conversation-service.d.ts +31 -2
  197. package/dist/rest/v1/conversation-service.js +126 -32
  198. package/dist/rest/v1/conversation-service.js.map +1 -1
  199. package/dist/rest/v1/events/events-api.d.ts +4 -8
  200. package/dist/rest/v1/events/events-api.js +3 -12
  201. package/dist/rest/v1/events/events-api.js.map +1 -1
  202. package/dist/rest/v1/index.d.ts +3 -0
  203. package/dist/rest/v1/index.js +3 -0
  204. package/dist/rest/v1/index.js.map +1 -1
  205. package/dist/rest/v1/messages/messages-api.d.ts +12 -10
  206. package/dist/rest/v1/messages/messages-api.jest.fixture.d.ts +7 -1
  207. package/dist/rest/v1/messages/messages-api.jest.fixture.js +4 -0
  208. package/dist/rest/v1/messages/messages-api.jest.fixture.js.map +1 -1
  209. package/dist/rest/v1/messages/messages-api.js +32 -15
  210. package/dist/rest/v1/messages/messages-api.js.map +1 -1
  211. package/dist/rest/v1/project-settings/index.d.ts +2 -0
  212. package/dist/rest/v1/project-settings/index.js +19 -0
  213. package/dist/rest/v1/project-settings/index.js.map +1 -0
  214. package/dist/rest/v1/project-settings/project-settings-api.d.ts +30 -0
  215. package/dist/rest/v1/project-settings/project-settings-api.jest.fixture.d.ts +20 -0
  216. package/dist/rest/v1/project-settings/project-settings-api.jest.fixture.js +25 -0
  217. package/dist/rest/v1/project-settings/project-settings-api.jest.fixture.js.map +1 -0
  218. package/dist/rest/v1/project-settings/project-settings-api.js +101 -0
  219. package/dist/rest/v1/project-settings/project-settings-api.js.map +1 -0
  220. package/dist/rest/v1/templates-v1/templates-v1-api.d.ts +8 -8
  221. package/dist/rest/v1/templates-v1/templates-v1-api.js +8 -13
  222. package/dist/rest/v1/templates-v1/templates-v1-api.js.map +1 -1
  223. package/dist/rest/v1/templates-v2/templates-v2-api.d.ts +3 -8
  224. package/dist/rest/v1/templates-v2/templates-v2-api.js +3 -14
  225. package/dist/rest/v1/templates-v2/templates-v2-api.js.map +1 -1
  226. package/dist/rest/v1/transcoding/transcoding-api.d.ts +2 -7
  227. package/dist/rest/v1/transcoding/transcoding-api.js +2 -8
  228. package/dist/rest/v1/transcoding/transcoding-api.js.map +1 -1
  229. package/dist/rest/v1/webhooks/webhooks-api.d.ts +2 -7
  230. package/dist/rest/v1/webhooks/webhooks-api.js +2 -12
  231. package/dist/rest/v1/webhooks/webhooks-api.js.map +1 -1
  232. package/package.json +2 -2
@@ -1,110 +1,66 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ConversationDomainApi = exports.DEFAULT_CONVERSATION_REGION_DEPRECATION_WARNING = void 0;
4
- const sdk_client_1 = require("@sinch/sdk-client");
5
4
  exports.DEFAULT_CONVERSATION_REGION_DEPRECATION_WARNING = '** DEPRECATION NOTICE ** '
6
5
  + 'The "conversationRegion" property will become mandatory in the next major version of the SDK and not default '
7
6
  + 'to "us" anymore. Please set it to a valid region.';
8
7
  class ConversationDomainApi {
9
- constructor(sinchClientParameters, apiName) {
10
- this.sinchClientParameters = sinchClientParameters;
8
+ constructor(lazyClient, apiName) {
9
+ this.lazyClient = lazyClient;
11
10
  this.apiName = apiName;
12
11
  }
12
+ get client() {
13
+ return this.lazyClient.getApiClient();
14
+ }
15
+ /**
16
+ * Kept for backward compatibility - TODO: remove in future major release
17
+ * @return {ApiClient}
18
+ * @deprecated
19
+ */
20
+ getSinchClient() {
21
+ return this.lazyClient.getApiClient();
22
+ }
13
23
  /**
14
24
  * Update the default hostname for the API
15
25
  * @param {string} hostname - The new hostname to use for the APIs.
16
26
  */
17
27
  setHostname(hostname) {
18
- try {
19
- // The next "if/else" block is a workaround to detect if the hostname is set for the Conversation or Templates API - To be deleted in 2.0
20
- if (this.apiName === 'TemplatesV1Api' || this.apiName === 'TemplatesV2Api') {
21
- this.sinchClientParameters.conversationTemplatesHostname = hostname;
22
- }
23
- else {
24
- this.sinchClientParameters.conversationHostname = hostname;
25
- }
26
- this.client = this.getSinchClient();
27
- this.client.apiClientOptions.hostname = hostname;
28
+ if (this.apiName === 'TemplatesV1Api' || this.apiName === 'TemplatesV2Api') {
29
+ this.lazyClient.sharedConfig.conversationTemplatesHostname = hostname;
28
30
  }
29
- catch (error) {
30
- console.error('Impossible to set a new hostname, the credentials need to be provided first.');
31
- throw error;
31
+ else {
32
+ this.lazyClient.sharedConfig.conversationHostname = hostname;
32
33
  }
34
+ this.lazyClient.getApiClient().apiClientOptions.hostname = hostname;
33
35
  }
34
36
  /**
35
37
  * Update the region in the basePath
36
38
  * @param {ConversationRegion} region - The new region to send the requests to
37
39
  */
38
40
  setRegion(region) {
39
- this.sinchClientParameters.conversationRegion = region;
40
- if (this.client) {
41
- this.client.apiClientOptions.hostname = this.buildHostname(region);
42
- }
41
+ this.lazyClient.sharedConfig.conversationRegion = region;
42
+ this.lazyClient.resetApiClient();
43
43
  }
44
44
  /**
45
45
  * Updates the credentials used to authenticate API requests
46
46
  * @param {UnifiedCredentials} credentials
47
47
  */
48
48
  setCredentials(credentials) {
49
- const parametersBackup = { ...this.sinchClientParameters };
50
- this.sinchClientParameters = {
49
+ const parametersBackup = { ...this.lazyClient.sharedConfig };
50
+ this.lazyClient.sharedConfig = {
51
51
  ...parametersBackup,
52
52
  ...credentials,
53
53
  };
54
- this.resetApiClient();
54
+ this.lazyClient.resetApiClient();
55
55
  try {
56
- this.getSinchClient();
56
+ this.lazyClient.getApiClient();
57
57
  }
58
58
  catch (error) {
59
59
  console.error('Impossible to assign the new credentials to the Conversation API');
60
- this.sinchClientParameters = parametersBackup;
60
+ this.lazyClient.sharedConfig = parametersBackup;
61
61
  throw error;
62
62
  }
63
63
  }
64
- resetApiClient() {
65
- this.client = undefined;
66
- }
67
- /**
68
- * Checks the configuration parameters are ok and initialize the API client. Once initialized, the same instance will
69
- * be returned for the subsequent API calls (singleton pattern)
70
- * @return {ApiClient} the API Client or throws an error in case the configuration parameters are not ok
71
- * @private
72
- */
73
- getSinchClient() {
74
- if (!this.client) {
75
- const region = this.sinchClientParameters.conversationRegion ?? sdk_client_1.ConversationRegion.UNITED_STATES;
76
- // Deprecation Notice - to remove in 2.0
77
- const isConversationHostnameOverridden = !!this.sinchClientParameters.conversationHostname
78
- && this.apiName !== 'TemplatesV1Api'
79
- && this.apiName !== 'TemplatesV2Api';
80
- const isConversationTemplatesHostnameOverridden = !!this.sinchClientParameters.conversationTemplatesHostname
81
- && (this.apiName === 'TemplatesV1Api' || this.apiName === 'TemplatesV2Api');
82
- if (!this.sinchClientParameters.conversationRegion
83
- && !isConversationHostnameOverridden
84
- && !isConversationTemplatesHostnameOverridden) {
85
- console.warn(exports.DEFAULT_CONVERSATION_REGION_DEPRECATION_WARNING);
86
- }
87
- if (!Object.values(sdk_client_1.SupportedConversationRegion).includes(region)) {
88
- console.warn(`The region "${region}" is not known as a supported region for the Conversation API`);
89
- }
90
- const apiClientOptions = (0, sdk_client_1.buildOAuth2ApiClientOptions)(this.sinchClientParameters, 'Conversation');
91
- this.client = new sdk_client_1.ApiFetchClient(apiClientOptions);
92
- this.client.apiClientOptions.hostname = this.buildHostname(region);
93
- }
94
- return this.client;
95
- }
96
- buildHostname(region) {
97
- const formattedRegion = region !== '' ? `${region}.` : '';
98
- switch (this.apiName) {
99
- case 'TemplatesV1Api':
100
- case 'TemplatesV2Api':
101
- return this.sinchClientParameters.conversationTemplatesHostname
102
- ?? (0, sdk_client_1.formatRegionalizedHostname)(sdk_client_1.CONVERSATION_TEMPLATES_HOSTNAME, formattedRegion);
103
- default:
104
- return this.sinchClientParameters.conversationHostname
105
- ?? (0, sdk_client_1.formatRegionalizedHostname)(sdk_client_1.CONVERSATION_HOSTNAME, formattedRegion);
106
- }
107
- }
108
64
  }
109
65
  exports.ConversationDomainApi = ConversationDomainApi;
110
66
  //# sourceMappingURL=conversation-domain-api.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"conversation-domain-api.js","sourceRoot":"","sources":["../../../src/rest/v1/conversation-domain-api.ts"],"names":[],"mappings":";;;AAAA,kDAY2B;AAEd,QAAA,+CAA+C,GAAG,2BAA2B;MACtF,+GAA+G;MAC/G,mDAAmD,CAAC;AAExD,MAAa,qBAAqB;IAKhC,YAAY,qBAA4C,EAAE,OAAe;QACvE,IAAI,CAAC,qBAAqB,GAAG,qBAAqB,CAAC;QACnD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED;;;OAGG;IACI,WAAW,CAAC,QAAgB;QACjC,IAAI,CAAC;YACH,yIAAyI;YACzI,IAAI,IAAI,CAAC,OAAO,KAAK,gBAAg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Aa,CAAC,MAA0B;QAC9C,MAAM,eAAe,GAAG,MAAM,KAAK,EAAE,CAAC,CAAC,CAAC,GAAG,MAAM,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;QAC1D,QAAQ,IAAI,CAAC,OAAO,EAAE,CAAC;YACvB,KAAK,gBAAgB,CAAC;YACtB,KAAK,gBAAgB;gBACnB,OAAO,IAAI,CAAC,qBAAqB,CAAC,6BAA6B;uBAC1D,IAAA,uCAA0B,EAAC,4CAA+B,EAAE,eAAe,CAAC,CAAC;YACpF;gBACE,OAAO,IAAI,CAAC,qBAAqB,CAAC,oBAAoB;uBACjD,IAAA,uCAA0B,EAAC,kCAAqB,EAAE,eAAe,CAAC,CAAC;QAC1E,CAAC;IACH,CAAC;CAEF;AA5GD,sDA4GC"}
1
+ {"version":3,"file":"conversation-domain-api.js","sourceRoot":"","sources":["../../../src/rest/v1/conversation-domain-api.ts"],"names":[],"mappings":";;;AAQa,QAAA,+CAA+C,GAAG,2BAA2B;MACtF,+GAA+G;MAC/G,mDAAmD,CAAC;AAExD,MAAa,qBAAqB;IAChC,YACkB,UAAyE,EACzE,OAAe;QADf,eAAU,GAAV,UAAU,CAA+D;QACzE,YAAO,GAAP,OAAO,CAAQ;IAC9B,CAAC;IAEJ,IAAW,MAAM;QACf,OAAO,IAAI,CAAC,UAAU,CAAC,YAAY,EAAE,CAAC;IACxC,CAAC;IAED;;;;OAIG;IACI,cAAc;QACnB,OAAO,IAAI,CAAC,UAAU,CAAC,YAAY,EAAE,CAAC;IACxC,CAAC;IAED;;;OAGG;IACI,WAAW,CAAC,QAAgB;QACjC,IAAI,IAAI,CAAC,OAAO,KAAK,gBAAgB,IAAI,IAAI,CAAC,OAAO,KAAK,gBAAgB,EAAE,CAAC;YAC3E,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,6BAA6B,GAAG,QAAQ,CAAC;QACxE,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,oBAAoB,GAAG,QAAQ,CAAC;QAC/D,CAAC;QACD,IAAI,CAAC,UAAU,CAAC,YAAY,EAAE,CAAC,gBAAgB,CAAC,QAAQ,GAAG,QAAQ,CAAC;IACtE,CAAC;IAED;;;OAGG;IACI,SAAS,CAAC,MAA0B;QACzC,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,kBAAkB,GAAG,MAAM,CAAC;QACzD,IAAI,CAAC,UAAU,CAAC,cAAc,EAAE,CAAC;IACnC,CAAC;IAED;;;OAGG;IACI,cAAc,CAAC,WAAwC;QAC5D,MAAM,gBAAgB,GAAG,EAAE,GAAG,IAAI,CAAC,UAAU,CAAC,YAAY,EAAE,CAAC;QAC7D,IAAI,CAAC,UAAU,CAAC,YAAY,GAAG;YAC7B,GAAG,gBAAgB;YACnB,GAAG,WAAW;SACf,CAAC;QACF,IAAI,CAAC,UAAU,CAAC,cAAc,EAAE,CAAC;QACjC,IAAI,CAAC;YACH,IAAI,CAAC,UAAU,CAAC,YAAY,EAAE,CAAC;QACjC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,kEAAkE,CAAC,CAAC;YAClF,IAAI,CAAC,UAAU,CAAC,YAAY,GAAG,gBAAgB,CAAC;YAChD,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;CAEF;AA7DD,sDA6DC"}
@@ -1,4 +1,4 @@
1
- import { ConversationRegion, SinchClientParameters } from '@sinch/sdk-client';
1
+ import { ApiFetchClient, ConversationRegion, SinchClientParameters, UnifiedCredentials } from '@sinch/sdk-client';
2
2
  import { ContactApi } from './contact';
3
3
  import { AppApi } from './app';
4
4
  import { EventsApi } from './events';
@@ -6,9 +6,27 @@ import { MessagesApi } from './messages';
6
6
  import { TranscodingApi } from './transcoding';
7
7
  import { CapabilityApi } from './capability';
8
8
  import { ConversationApi } from './conversation';
9
+ import { ProjectSettingsApi } from './project-settings';
9
10
  import { WebhooksApi } from './webhooks';
10
11
  import { TemplatesV1Api } from './templates-v1';
11
12
  import { TemplatesV2Api } from './templates-v2';
13
+ import { ConsentsApi } from './consents';
14
+ export declare class LazyConversationApiClient {
15
+ sharedConfig: SinchClientParameters;
16
+ apiFetchClient?: ApiFetchClient;
17
+ constructor(sharedConfig: SinchClientParameters);
18
+ getApiClient(): ApiFetchClient;
19
+ resetApiClient(): void;
20
+ private buildHostname;
21
+ }
22
+ export declare class LazyConversationTemplateApiClient {
23
+ sharedConfig: SinchClientParameters;
24
+ apiFetchClient?: ApiFetchClient;
25
+ constructor(sharedConfig: SinchClientParameters);
26
+ getApiClient(): ApiFetchClient;
27
+ resetApiClient(): void;
28
+ private buildHostname;
29
+ }
12
30
  /**
13
31
  * The Conversation Service exposes the following APIs:
14
32
  * - app
@@ -30,9 +48,14 @@ export declare class ConversationService {
30
48
  readonly transcoding: TranscodingApi;
31
49
  readonly capability: CapabilityApi;
32
50
  readonly conversation: ConversationApi;
51
+ readonly projectSettings: ProjectSettingsApi;
33
52
  readonly webhooks: WebhooksApi;
53
+ /** @deprecated Use {@link templatesV2} instead */
34
54
  readonly templatesV1: TemplatesV1Api;
35
55
  readonly templatesV2: TemplatesV2Api;
56
+ readonly consents: ConsentsApi;
57
+ readonly lazyConversationClient: LazyConversationApiClient;
58
+ readonly lazyConversationTemplateClient: LazyConversationTemplateApiClient;
36
59
  /**
37
60
  * Create a new ConversationService instance with its configuration. It needs the following parameters for authentication:
38
61
  * - `projectId`
@@ -46,9 +69,10 @@ export declare class ConversationService {
46
69
  * @param {SinchClientParameters} params - an Object containing the necessary properties to initialize the service
47
70
  */
48
71
  constructor(params: SinchClientParameters);
72
+ setApiClientConfig(newParams: SinchClientParameters): void;
49
73
  /**
50
74
  * Update the default hostname for each API (except Templates)
51
- * @param {string} hostname - The new hostname to use for all the APIs.
75
+ * @param {string} hostname - The new hostname to use for the APIs.
52
76
  */
53
77
  setHostname(hostname: string): void;
54
78
  /**
@@ -56,6 +80,11 @@ export declare class ConversationService {
56
80
  * @param {string} hostname - The new hostname to use for the Templates APIs.
57
81
  */
58
82
  setTemplatesHostname(hostname: string): void;
83
+ /**
84
+ * Updates the credentials used to authenticate API requests.
85
+ * @param credentials - The new credentials to use for the APIs.
86
+ */
87
+ setCredentials(credentials: Partial<UnifiedCredentials>): void;
59
88
  /**
60
89
  * Update the current region for each API
61
90
  * @param {ConversationRegion} region - The new region to use in the production URL
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ConversationService = void 0;
3
+ exports.ConversationService = exports.LazyConversationTemplateApiClient = exports.LazyConversationApiClient = void 0;
4
+ const sdk_client_1 = require("@sinch/sdk-client");
4
5
  const contact_1 = require("./contact");
5
6
  const app_1 = require("./app");
6
7
  const events_1 = require("./events");
@@ -8,9 +9,74 @@ const messages_1 = require("./messages");
8
9
  const transcoding_1 = require("./transcoding");
9
10
  const capability_1 = require("./capability");
10
11
  const conversation_1 = require("./conversation");
12
+ const project_settings_1 = require("./project-settings");
11
13
  const webhooks_1 = require("./webhooks");
12
14
  const templates_v1_1 = require("./templates-v1");
13
15
  const templates_v2_1 = require("./templates-v2");
16
+ const consents_1 = require("./consents");
17
+ const conversation_domain_api_1 = require("./conversation-domain-api");
18
+ class LazyConversationApiClient {
19
+ constructor(sharedConfig) {
20
+ this.sharedConfig = sharedConfig;
21
+ }
22
+ getApiClient() {
23
+ if (!this.apiFetchClient) {
24
+ const region = this.sharedConfig.conversationRegion ?? sdk_client_1.ConversationRegion.UNITED_STATES;
25
+ // Deprecation Notice - to remove in 2.0
26
+ const isConversationHostnameOverridden = !!this.sharedConfig.conversationHostname;
27
+ if (!this.sharedConfig.conversationRegion && !isConversationHostnameOverridden) {
28
+ console.warn(conversation_domain_api_1.DEFAULT_CONVERSATION_REGION_DEPRECATION_WARNING);
29
+ }
30
+ if (!Object.values(sdk_client_1.SupportedConversationRegion).includes(region)) {
31
+ console.warn(`The region "${region}" is not known as a supported region for the Conversation API`);
32
+ }
33
+ const apiClientOptions = (0, sdk_client_1.buildOAuth2ApiClientOptions)(this.sharedConfig, 'Conversation');
34
+ this.apiFetchClient = new sdk_client_1.ApiFetchClient(apiClientOptions);
35
+ this.apiFetchClient.apiClientOptions.hostname = this.buildHostname(region);
36
+ }
37
+ return this.apiFetchClient;
38
+ }
39
+ resetApiClient() {
40
+ this.apiFetchClient = undefined;
41
+ }
42
+ buildHostname(region) {
43
+ const formattedRegion = region !== '' ? `${region}.` : '';
44
+ return this.sharedConfig.conversationHostname
45
+ ?? (0, sdk_client_1.formatRegionalizedHostname)(sdk_client_1.CONVERSATION_HOSTNAME, formattedRegion);
46
+ }
47
+ }
48
+ exports.LazyConversationApiClient = LazyConversationApiClient;
49
+ class LazyConversationTemplateApiClient {
50
+ constructor(sharedConfig) {
51
+ this.sharedConfig = sharedConfig;
52
+ }
53
+ getApiClient() {
54
+ if (!this.apiFetchClient) {
55
+ const region = this.sharedConfig.conversationRegion ?? sdk_client_1.ConversationRegion.UNITED_STATES;
56
+ // Deprecation Notice - to remove in 2.0
57
+ const isConversationTemplatesHostnameOverridden = !!this.sharedConfig.conversationTemplatesHostname;
58
+ if (!this.sharedConfig.conversationRegion && !isConversationTemplatesHostnameOverridden) {
59
+ console.warn(conversation_domain_api_1.DEFAULT_CONVERSATION_REGION_DEPRECATION_WARNING);
60
+ }
61
+ if (!Object.values(sdk_client_1.SupportedConversationRegion).includes(region)) {
62
+ console.warn(`The region "${region}" is not known as a supported region for the Conversation API`);
63
+ }
64
+ const apiClientOptions = (0, sdk_client_1.buildOAuth2ApiClientOptions)(this.sharedConfig, 'Conversation');
65
+ this.apiFetchClient = new sdk_client_1.ApiFetchClient(apiClientOptions);
66
+ this.apiFetchClient.apiClientOptions.hostname = this.buildHostname(region);
67
+ }
68
+ return this.apiFetchClient;
69
+ }
70
+ resetApiClient() {
71
+ this.apiFetchClient = undefined;
72
+ }
73
+ buildHostname(region) {
74
+ const formattedRegion = region !== '' ? `${region}.` : '';
75
+ return this.sharedConfig.conversationTemplatesHostname
76
+ ?? (0, sdk_client_1.formatRegionalizedHostname)(sdk_client_1.CONVERSATION_TEMPLATES_HOSTNAME, formattedRegion);
77
+ }
78
+ }
79
+ exports.LazyConversationTemplateApiClient = LazyConversationTemplateApiClient;
14
80
  /**
15
81
  * The Conversation Service exposes the following APIs:
16
82
  * - app
@@ -38,54 +104,82 @@ class ConversationService {
38
104
  * @param {SinchClientParameters} params - an Object containing the necessary properties to initialize the service
39
105
  */
40
106
  constructor(params) {
41
- this.contact = new contact_1.ContactApi(params);
42
- this.app = new app_1.AppApi(params);
43
- this.events = new events_1.EventsApi(params);
44
- this.messages = new messages_1.MessagesApi(params);
45
- this.transcoding = new transcoding_1.TranscodingApi(params);
46
- this.capability = new capability_1.CapabilityApi(params);
47
- this.conversation = new conversation_1.ConversationApi(params);
48
- this.webhooks = new webhooks_1.WebhooksApi(params);
49
- this.templatesV1 = new templates_v1_1.TemplatesV1Api(params);
50
- this.templatesV2 = new templates_v2_1.TemplatesV2Api(params);
107
+ const sharedConversationClient = new LazyConversationApiClient(params);
108
+ this.lazyConversationClient = sharedConversationClient;
109
+ const sharedConversationTemplateClient = new LazyConversationTemplateApiClient(params);
110
+ this.lazyConversationTemplateClient = sharedConversationTemplateClient;
111
+ this.contact = new contact_1.ContactApi(sharedConversationClient);
112
+ this.app = new app_1.AppApi(sharedConversationClient);
113
+ this.events = new events_1.EventsApi(sharedConversationClient);
114
+ this.messages = new messages_1.MessagesApi(sharedConversationClient);
115
+ this.transcoding = new transcoding_1.TranscodingApi(sharedConversationClient);
116
+ this.capability = new capability_1.CapabilityApi(sharedConversationClient);
117
+ this.conversation = new conversation_1.ConversationApi(sharedConversationClient);
118
+ this.projectSettings = new project_settings_1.ProjectSettingsApi(sharedConversationClient);
119
+ this.webhooks = new webhooks_1.WebhooksApi(sharedConversationClient);
120
+ this.consents = new consents_1.ConsentsApi(sharedConversationClient);
121
+ this.templatesV1 = new templates_v1_1.TemplatesV1Api(sharedConversationTemplateClient);
122
+ this.templatesV2 = new templates_v2_1.TemplatesV2Api(sharedConversationTemplateClient);
123
+ }
124
+ setApiClientConfig(newParams) {
125
+ this.lazyConversationClient.sharedConfig = newParams;
126
+ this.lazyConversationClient.resetApiClient();
127
+ this.lazyConversationTemplateClient.sharedConfig = newParams;
128
+ this.lazyConversationTemplateClient.resetApiClient();
51
129
  }
52
130
  /**
53
131
  * Update the default hostname for each API (except Templates)
54
- * @param {string} hostname - The new hostname to use for all the APIs.
132
+ * @param {string} hostname - The new hostname to use for the APIs.
55
133
  */
56
134
  setHostname(hostname) {
57
- this.contact.setHostname(hostname);
58
- this.app.setHostname(hostname);
59
- this.events.setHostname(hostname);
60
- this.messages.setHostname(hostname);
61
- this.transcoding.setHostname(hostname);
62
- this.capability.setHostname(hostname);
63
- this.conversation.setHostname(hostname);
64
- this.webhooks.setHostname(hostname);
135
+ this.lazyConversationClient.sharedConfig.conversationHostname = hostname;
136
+ this.lazyConversationClient.getApiClient().apiClientOptions.hostname = hostname;
65
137
  }
66
138
  /**
67
139
  * Update the default hostname for the Templates APIs
68
140
  * @param {string} hostname - The new hostname to use for the Templates APIs.
69
141
  */
70
142
  setTemplatesHostname(hostname) {
71
- this.templatesV1.setHostname(hostname);
72
- this.templatesV2.setHostname(hostname);
143
+ this.lazyConversationTemplateClient.sharedConfig.conversationTemplatesHostname = hostname;
144
+ this.lazyConversationTemplateClient.getApiClient().apiClientOptions.hostname = hostname;
145
+ }
146
+ /**
147
+ * Updates the credentials used to authenticate API requests.
148
+ * @param credentials - The new credentials to use for the APIs.
149
+ */
150
+ setCredentials(credentials) {
151
+ const parametersBackup = { ...this.lazyConversationClient.sharedConfig };
152
+ const parametersTemplatesBackup = { ...this.lazyConversationTemplateClient.sharedConfig };
153
+ this.lazyConversationClient.sharedConfig = {
154
+ ...parametersBackup,
155
+ ...credentials,
156
+ };
157
+ this.lazyConversationTemplateClient.sharedConfig = {
158
+ ...parametersTemplatesBackup,
159
+ ...credentials,
160
+ };
161
+ this.lazyConversationClient.resetApiClient();
162
+ this.lazyConversationTemplateClient.resetApiClient();
163
+ try {
164
+ this.lazyConversationClient.getApiClient();
165
+ this.lazyConversationTemplateClient.getApiClient();
166
+ }
167
+ catch (error) {
168
+ console.error('Impossible to assign the new credentials to the Conversation API');
169
+ this.lazyConversationClient.sharedConfig = parametersBackup;
170
+ this.lazyConversationTemplateClient.sharedConfig = parametersTemplatesBackup;
171
+ throw error;
172
+ }
73
173
  }
74
174
  /**
75
175
  * Update the current region for each API
76
176
  * @param {ConversationRegion} region - The new region to use in the production URL
77
177
  */
78
178
  setRegion(region) {
79
- this.contact.setRegion(region);
80
- this.app.setRegion(region);
81
- this.events.setRegion(region);
82
- this.messages.setRegion(region);
83
- this.transcoding.setRegion(region);
84
- this.capability.setRegion(region);
85
- this.conversation.setRegion(region);
86
- this.webhooks.setRegion(region);
87
- this.templatesV1.setRegion(region);
88
- this.templatesV2.setRegion(region);
179
+ this.lazyConversationClient.sharedConfig.conversationRegion = region;
180
+ this.lazyConversationClient.resetApiClient();
181
+ this.lazyConversationTemplateClient.sharedConfig.conversationRegion = region;
182
+ this.lazyConversationTemplateClient.resetApiClient();
89
183
  }
90
184
  }
91
185
  exports.ConversationService = ConversationService;
@@ -1 +1 @@
1
- {"version":3,"file":"conversation-service.js","sourceRoot":"","sources":["../../../src/rest/v1/conversation-service.ts"],"names":[],"mappings":";;;AACA,uCAAuC;AACvC,+BAA+B;AAC/B,qCAAqC;AACrC,yCAAyC;AACzC,+CAA+C;AAC/C,6CAA6C;AAC7C,iDAAiD;AACjD,yCAAyC;AACzC,iDAAgD;AAChD,iDAAgD;AAEhD;;;;;;;;;;;;GAYG;AACH,MAAa,mBAAmB;IAY9B;;;;;;;;;;;OAWG;IACH,YAAY,MAA6B;QACvC,IAAI,CAAC,OAAO,GAAG,IAAI,oBAAU,CAAC,MAAM,CAAC,CAAC;QACtC,IAAI,CAAC,GAAG,GAAG,IAAI,YAAM,CAAC,MAAM,CAAC,CAAC;QAC9B,IAAI,CA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,KAAK,CAAC,kEAAkE,CAAC,CAAC;YAClF,IAAI,CAAC,sBAAsB,CAAC,YAAY,GAAG,gBAAgB,CAAC;YAC5D,IAAI,CAAC,8BAA8B,CAAC,YAAY,GAAG,yBAAyB,CAAC;YAC7E,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;IAED;;;OAGG;IACI,SAAS,CAAC,MAA0B;QACzC,IAAI,CAAC,sBAAsB,CAAC,YAAY,CAAC,kBAAkB,GAAG,MAAM,CAAC;QACrE,IAAI,CAAC,sBAAsB,CAAC,cAAc,EAAE,CAAC;QAC7C,IAAI,CAAC,8BAA8B,CAAC,YAAY,CAAC,kBAAkB,GAAG,MAAM,CAAC;QAC7E,IAAI,CAAC,8BAA8B,CAAC,cAAc,EAAE,CAAC;IACvD,CAAC;CACF;AAlHD,kDAkHC"}
@@ -1,13 +1,9 @@
1
- import { ApiListPromise, SinchClientParameters } from '@sinch/sdk-client';
1
+ import { ApiListPromise } from '@sinch/sdk-client';
2
2
  import { ConversationEvent, DeleteEventRequestData, GetEventRequestData, ListEventsRequestData, Recipient, SendAgentJoinedEventRequestData, SendAgentLeftEventRequestData, SendCommentReplyEventRequestData, SendComposingEndEventRequestData, SendComposingEventRequestData, SendEventRequestData, SendEventResponse, SendGenericEventRequestData } from '../../../models';
3
3
  import { ConversationDomainApi } from '../conversation-domain-api';
4
+ import { LazyConversationApiClient } from '../conversation-service';
4
5
  export declare class EventsApi extends ConversationDomainApi {
5
- /**
6
- * Initialize your interface
7
- *
8
- * @param {SinchClientParameters} sinchClientParameters - The parameters used to initialize the API Client.
9
- */
10
- constructor(sinchClientParameters: SinchClientParameters);
6
+ constructor(lazyApiClient: LazyConversationApiClient);
11
7
  /**
12
8
  * Delete an event
13
9
  * Delete a specific event by its ID.
@@ -26,7 +22,7 @@ export declare class EventsApi extends ConversationDomainApi {
26
22
  * @param { ListEventsRequestData } data - The data to provide to the API call.
27
23
  * @return {ApiListPromise<ConversationEvent>}
28
24
  */
29
- list(data: ListEventsRequestData): ApiListPromise<ConversationEvent>;
25
+ list(data?: ListEventsRequestData): ApiListPromise<ConversationEvent>;
30
26
  /**
31
27
  * Send an event
32
28
  * Sends an event to the referenced contact from the referenced app. Note that this operation enqueues the event in a queue so a successful response only indicates that the event has been queued.
@@ -4,13 +4,8 @@ exports.EventsApi = void 0;
4
4
  const sdk_client_1 = require("@sinch/sdk-client");
5
5
  const conversation_domain_api_1 = require("../conversation-domain-api");
6
6
  class EventsApi extends conversation_domain_api_1.ConversationDomainApi {
7
- /**
8
- * Initialize your interface
9
- *
10
- * @param {SinchClientParameters} sinchClientParameters - The parameters used to initialize the API Client.
11
- */
12
- constructor(sinchClientParameters) {
13
- super(sinchClientParameters, 'EventsApi');
7
+ constructor(lazyApiClient) {
8
+ super(lazyApiClient, 'EventsApi');
14
9
  }
15
10
  /**
16
11
  * Delete an event
@@ -18,7 +13,6 @@ class EventsApi extends conversation_domain_api_1.ConversationDomainApi {
18
13
  * @param { DeleteEventRequestData } data - The data to provide to the API call.
19
14
  */
20
15
  async delete(data) {
21
- this.client = this.getSinchClient();
22
16
  const getParams = this.client.extractQueryParams(data, []);
23
17
  const headers = {
24
18
  'Content-Type': 'application/json',
@@ -41,7 +35,6 @@ class EventsApi extends conversation_domain_api_1.ConversationDomainApi {
41
35
  * @param { GetEventRequestData } data - The data to provide to the API call.
42
36
  */
43
37
  async get(data) {
44
- this.client = this.getSinchClient();
45
38
  const getParams = this.client.extractQueryParams(data, []);
46
39
  const headers = {
47
40
  'Content-Type': 'application/json',
@@ -65,8 +58,7 @@ class EventsApi extends conversation_domain_api_1.ConversationDomainApi {
65
58
  * @return {ApiListPromise<ConversationEvent>}
66
59
  */
67
60
  list(data) {
68
- this.client = this.getSinchClient();
69
- const getParams = this.client.extractQueryParams(data, [
61
+ const getParams = this.client.extractQueryParams(data ?? {}, [
70
62
  'conversation_id',
71
63
  'contact_id',
72
64
  'page_size',
@@ -148,7 +140,6 @@ class EventsApi extends conversation_domain_api_1.ConversationDomainApi {
148
140
  return this.sendEvent(data, 'SendGenericEvent');
149
141
  }
150
142
  async sendEvent(data, operationId) {
151
- this.client = this.getSinchClient();
152
143
  const getParams = this.client.extractQueryParams(data, []);
153
144
  const headers = {
154
145
  'Content-Type': 'application/json',
@@ -1 +1 @@
1
- {"version":3,"file":"events-api.js","sourceRoot":"","sources":["../../../../src/rest/v1/events/events-api.ts"],"names":[],"mappings":";;;AAAA,kDAQ2B;AAiB3B,wEAAmE;AAEnE,MAAa,SAAU,SAAQ,+CAAqB;IAElD;;;;OAIG;IACH,YAAY,qBAA4C;QACtD,KAAK,CAAC,qBAAqB,EAAE,WAAW,CAAC,CAAC;IAC5C,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,MAAM,CAAC,IAA4B;QAC9C,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,cAAc,EAAE,CAAC;QACpC,MAAM,SAAS,GAAG,IAAI,CAAC,MAAM,CAAC,kBAAkB,CAAyB,IAAI,EAAE,EAAa,CAAC,CAAC;QAC9F,MAAM,OAAO,GAA0C;YACrD,cAAc,EAAE,kBAAkB;YAClC,QAAQ,EAAE,kBAAkB;SAC7B,CAAC;QAEF,MAAM,IAAI,GAAgB,EAAE,CAAC;QAC7B,MAAM,WAAW,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,QAAQ,gBAAgB,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,SAAS,WAAW,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC;QAEhJ,MAAM,cAAc,GAChB,MAAM,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,IAAI,SAAS,CAAC,CAAC;QACnG,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,cAAc,CAAC,QAAQ,EAAE,cAAc,CAAC,WAAW,CAAC,CAAC;QAExF,OAAO,IAAI,CAAC,MAAM,CA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,CAAC,gBAAgB,CAAC,SAAS,cAAc,CAAC;QAEjI,MAAM,cAAc,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,IAAI,SAAS,CAAC,CAAC;QACpH,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,CAAoB;YAChD,GAAG;YACH,cAAc;YACd,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,WAAW;SACZ,CAAC,CAAC;IACL,CAAC;CAEF;AAnMD,8BAmMC"}
@@ -1,12 +1,15 @@
1
1
  export * from './app';
2
2
  export * from './callbacks';
3
3
  export * from './capability';
4
+ export * from './consents';
4
5
  export * from './contact';
5
6
  export * from './conversation';
6
7
  export * from './events';
7
8
  export * from './messages';
9
+ export * from './project-settings';
8
10
  export * from './templates-v1';
9
11
  export * from './templates-v2';
10
12
  export * from './transcoding';
11
13
  export * from './webhooks';
14
+ export * from './conversation-domain-api';
12
15
  export * from './conversation-service';
@@ -17,13 +17,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./app"), exports);
18
18
  __exportStar(require("./callbacks"), exports);
19
19
  __exportStar(require("./capability"), exports);
20
+ __exportStar(require("./consents"), exports);
20
21
  __exportStar(require("./contact"), exports);
21
22
  __exportStar(require("./conversation"), exports);
22
23
  __exportStar(require("./events"), exports);
23
24
  __exportStar(require("./messages"), exports);
25
+ __exportStar(require("./project-settings"), exports);
24
26
  __exportStar(require("./templates-v1"), exports);
25
27
  __exportStar(require("./templates-v2"), exports);
26
28
  __exportStar(require("./transcoding"), exports);
27
29
  __exportStar(require("./webhooks"), exports);
30
+ __exportStar(require("./conversation-domain-api"), exports);
28
31
  __exportStar(require("./conversation-service"), exports);
29
32
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/rest/v1/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wCAAsB;AACtB,8CAA4B;AAC5B,+CAA6B;AAC7B,4CAA0B;AAC1B,iDAA+B;AAC/B,2CAAyB;AACzB,6CAA2B;AAC3B,iDAA+B;AAC/B,iDAA+B;AAC/B,gDAA8B;AAC9B,6CAA2B;AAC3B,yDAAuC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/rest/v1/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wCAAsB;AACtB,8CAA4B;AAC5B,+CAA6B;AAC7B,6CAA2B;AAC3B,4CAA0B;AAC1B,iDAA+B;AAC/B,2CAAyB;AACzB,6CAA2B;AAC3B,qDAAmC;AACnC,iDAA+B;AAC/B,iDAA+B;AAC/B,gDAA8B;AAC9B,6CAA2B;AAC3B,4DAA0C;AAC1C,yDAAuC"}
@@ -1,16 +1,12 @@
1
- import { ApiListPromise, SinchClientParameters } from '@sinch/sdk-client';
2
- import { ConversationMessage, DeleteMessageRequestData, GetMessageRequestData, ListMessagesRequestData, Recipient, SendCardMessageRequestData, SendCarouselMessageRequestData, SendChoiceMessageRequestData, SendContactInfoMessageRequestData, SendListMessageRequestData, SendLocationMessageRequestData, SendMediaMessageRequestData, SendMessageRequest, SendMessageRequestData, SendMessageResponse, SendTemplateMessageRequestData, SendTextMessageRequestData, UpdateMessageRequestData } from '../../../models';
1
+ import { ApiListPromise } from '@sinch/sdk-client';
2
+ import { ConversationMessage, DeleteMessageRequestData, GetMessageRequestData, ListLastMessagesByChannelIdentityRequestData, ListMessagesRequestData, Recipient, SendCardMessageRequestData, SendCarouselMessageRequestData, SendChoiceMessageRequestData, SendContactInfoMessageRequestData, SendListMessageRequestData, SendLocationMessageRequestData, SendMediaMessageRequestData, SendMessageRequest, SendMessageRequestData, SendMessageResponse, SendTemplateMessageRequestData, SendTextMessageRequestData, UpdateMessageRequestData } from '../../../models';
3
3
  import { ConversationDomainApi } from '../conversation-domain-api';
4
+ import { LazyConversationApiClient } from '../conversation-service';
4
5
  export declare class MessagesApi extends ConversationDomainApi {
5
- /**
6
- * Initialize your interface
7
- *
8
- * @param {SinchClientParameters} sinchClientParameters - The parameters used to initialize the API Client.
9
- */
10
- constructor(sinchClientParameters: SinchClientParameters);
6
+ constructor(lazyApiClient: LazyConversationApiClient);
11
7
  /**
12
8
  * Delete a message
13
- * Delete a specific message by its ID. Note: Removing all messages of a conversation will not automatically delete the conversation.
9
+ * Delete a specific message by its ID. Note that this operation deletes the message from Conversation API storage; this operation does not affect messages already delivered to recipients\&#39; handsets. Also note that removing all messages of a conversation will not automatically delete the conversation.
14
10
  * @param { DeleteMessageRequestData } data - The data to provide to the API call.
15
11
  */
16
12
  delete(data: DeleteMessageRequestData): Promise<any>;
@@ -26,7 +22,13 @@ export declare class MessagesApi extends ConversationDomainApi {
26
22
  * @param { ListMessagesRequestData } data - The data to provide to the API call.
27
23
  * @return {ApiListPromise<ConversationMessage>}
28
24
  */
29
- list(data: ListMessagesRequestData): ApiListPromise<ConversationMessage>;
25
+ list(data?: ListMessagesRequestData): ApiListPromise<ConversationMessage>;
26
+ /**
27
+ * List messages by channel identity
28
+ * Retrieves the last message sent to specified channel identities. In CONVERSATION_SOURCE mode, you can query either by channel_identities or by contact_ids. Note: Use either contact_ids OR channel_identities per request, not both. DISPATCH_SOURCE mode does not support contact_ids.
29
+ * @param { ListLastMessagesByChannelIdentityRequestData } data - The data to provide to the API call.
30
+ */
31
+ listLastMessagesByChannelIdentity(data: ListLastMessagesByChannelIdentityRequestData): ApiListPromise<ConversationMessage>;
30
32
  /**
31
33
  * Send a message
32
34
  * You can send a message from a Conversation app to a contact associated with that app. If the recipient is not associated with an existing contact, a new contact will be created. The message is added to the active conversation with the contact if a conversation already exists. If no active conversation exists a new one is started automatically. You can find all of your IDs and authentication credentials on the [Sinch Customer Dashboard](https://dashboard.sinch.com/convapi/overview).